{"slug":"architecture/06_CONTEXTUAL_TWIN_AND_FOUR_BUTTONS","title":"06 — Contextual Twin and Four Buttons","section":"architecture","sectionLabel":"Architecture","status":"unclassified","type":"document","path":"architecture/06_CONTEXTUAL_TWIN_AND_FOUR_BUTTONS.mdx","bytes":3216,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n## Product rule\n\nTwin appears only where work is happening. It is not a large autonomous chatbot attached to every page.\n\nTwin may detect, predict, explain, prepare, and present. It may not execute autonomously, write canonical truth, approve itself, or change a source system without explicit user approval.\n\n## Contextual signal\n\nA Twin signal is a small, dismissible next-action prompt inside the active work surface.\n\nExample:\n\n```text\nTwin noticed a possible next action\nPrepare the recovery plan for Thursday?\n\n[Ask your Twin] [Assign your Twin] [Dismiss]\n```\n\n## Trigger scenarios\n\n### FinanceFlow\n\nThe user opens FinanceFlow, reads Aisha's email, and inspects two P1 tickets.\n\nTwin may surface:\n\n```text\nPrepare the recovery plan for Thursday?\n```\n\n### Repeated meeting follow-up\n\nThe user repeatedly creates the same task set after meetings.\n\nTwin may surface:\n\n```text\nYou usually create this follow-up after customer meetings. Prepare the task set?\n```\n\n### Account-risk preparation\n\nThe user reviews account risk, opens linked documents, and schedules a meeting.\n\nTwin may surface:\n\n```text\nPrepare a meeting brief with the account risk and linked evidence?\n```\n\n### Missing follow-through\n\nThe user changes a record and pauses.\n\nTwin may surface:\n\n```text\nStore this observation in Spine?\nDraft the customer update?\n```\n\n## The Four Buttons\n\n### Store in Spine\n\nMeaning: prepare a governed proposal to capture truth.\n\nUI sequence:\n\n1. Open proposal drawer.\n2. Show proposed content and evidence.\n3. Allow edits.\n4. Mark as awaiting approval.\n5. Allow explicit approval or rejection.\n6. Display simulated completion only; do not claim a real canonical write.\n\n### Ask your Twin\n\nMeaning: reason over the active work context.\n\nUI sequence:\n\n1. Open contextual drawer.\n2. Show included context and evidence.\n3. Accept a question.\n4. Return a deterministic local response.\n5. Offer relevant next actions.\n\n### Assign your Twin\n\nMeaning: prepare a draft or bounded workflow.\n\nUI sequence:\n\n1. Show assignment, context, expected output, and limits.\n2. Create a local prepared run.\n3. Show the draft result.\n4. Require approval before any represented action.\n\n### Approve Twin's Action\n\nMeaning: authorize a prepared governed proposal.\n\nUI sequence:\n\n1. Show target, proposed change, evidence, and risk.\n2. Require explicit confirmation.\n3. Move the local proposal to approved.\n4. Optionally show simulated completion.\n5. Never call a real external system in this frontend increment.\n\n## Proposal state machine\n\n```text\nSuggested\n→ Prepared\n→ Awaiting approval\n→ Approved or rejected\n→ Simulated complete\n```\n\n```ts\nexport type ProposalStatus =\n  | \"suggested\"\n  | \"prepared\"\n  | \"awaiting_approval\"\n  | \"approved\"\n  | \"rejected\"\n  | \"simulated_complete\";\n```\n\n## Placement rules\n\nTwin signals may appear:\n\n- Near a selected account, ticket, task, email, document, or meeting\n- Inside a detail drawer\n- At the end of a meaningful sequence of user actions\n- Beside missing follow-through\n\nTwin signals must not appear as unrelated dashboard decoration.\n\n## Approval law\n\nTwin may explain an approval and prepare revisions. Twin may not approve its own action.\n"}