{"slug":"architecture/CAPABILITY_CONSTITUTION","title":"Capability Constitution","section":"architecture","sectionLabel":"Architecture","status":"unclassified","type":"document","path":"architecture/CAPABILITY_CONSTITUTION.mdx","bytes":2818,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\nStatus: SUPERSEDED / ABSORBED — historical subsystem constitution. Current authority: [`INTEGRATEWISE_ARCHITECTURE.md`](INTEGRATEWISE_ARCHITECTURE.md) v2.2.\nScope: Canonical capability contracts, adapter resolution, execution behavior, and fallback policy.\nCanonical Owner: IntegrateWise Platform\nLast Verified: 2026-07-20\n\n---\n\n## 1. Purpose\n\nThis document defines how IntegrateWise declares, resolves, and executes business-intent capabilities.\n\nThe UI never binds to providers. The UI binds to capability contracts.\n\n---\n\n## 2. Contract\n\n```typescript\ninterface CapabilityContract {\n  id: CapabilityId;\n  title: string;\n  description: string;\n  category: CapabilityCategory;\n  risk: \"low\" | \"medium\" | \"high\" | \"critical\";\n  requiresApproval: boolean;\n  inputFields: readonly CapabilityInputField[];\n}\n```\n\n---\n\n## 3. Categories\n\n| Category           | Examples                         |\n| ------------------ | -------------------------------- |\n| crm                | account.view, opportunity.update |\n| support            | ticket.create, ticket.escalate   |\n| messaging          | message.send                     |\n| email              | email.send                       |\n| calendar           | meeting.create                   |\n| documents          | document.upload                  |\n| knowledge          | knowledge.search                 |\n| source_control     | pull_request.create              |\n| project_management | issue.create                     |\n| ci_cd              | deployment.view                  |\n| monitoring         | incident.view                    |\n| finance            | invoice.approve                  |\n| procurement        | purchase_order.create            |\n| hr                 | hiring.open                      |\n| marketing          | campaign.create                  |\n| identity           | user.invite                      |\n| ai                 | ai.summarize                     |\n| data               | report.generate                  |\n\n---\n\n## 4. Adapter Resolution\n\n```text\nmock → workbench → provider\n```\n\n- **mock**: default fallback for demo/seed data.\n- **workbench**: governed live actions in Gateway.\n- **provider**: live external adapter.\n\nNo capability executes without an adapter resolution path.\n\n---\n\n## 5. Execution Behavior\n\n1. Validate intent and inputs against contract.\n2. Load context from Spine.\n3. Run pre-proposal governance.\n4. Execute steps or emit proposal.\n5. Emit events and side effects.\n6. Commit canonical state first.\n7. Queue sync independently.\n\n---\n\n## 6. Invariants\n\n1. Capability ids are business intent, not provider-specific.\n2. Every capability has a mock fallback behavior.\n3. Every write capability has a rollback path.\n4. The UI never references provider names in capability contracts.\n"}