{"slug":"architecture/15_RECONCILIATION","title":"15 · Reconciliation","section":"architecture","sectionLabel":"Architecture","status":"unclassified","type":"document","path":"architecture/15_RECONCILIATION.mdx","bytes":2904,"description":"Closes the loop — verifies that intended outcomes match actual outcomes, handles discrepancies, and promotes learnings","updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n\n**Closes the loop.**\n\nReconciliation ensures that every action's outcome is verified against its intent. It is the mechanism that makes SpineWorkspace self-improving.\n\n---\n\n## Reconciliation Flow\n\n```text\nExecution Receipt → Re-ingestion → Normalization → State Update → Reconciliation → Discrepancy Handling → Memory Promotion → Next Work\n```\n\n---\n\n## Step 1: Execution Receipt\n\n```typescript\ninterface ExecutionReceipt {\n  id: string;\n  executionToken: string;\n  action: ActionDef;\n  status: 'success' | 'partial' | 'failure';\n  result: ActionResult;\n  timestamp: string;\n}\n```\n\n---\n\n## Step 2: Re-ingestion\n\n| Trigger | Re-ingestion |\n|---------|-------------|\n| Write succeeded | Pull updated state from target system |\n| Write partial | Pull partial state, flag discrepancy |\n| Write failed | Log failure, no re-ingestion |\n\n---\n\n## Step 3: Normalization & Entity Resolution\n\n| Operation | Description |\n|-----------|-------------|\n| Schema mapping | Map target system fields to Spine schema |\n| Entity resolution | Match to existing Spine entities |\n| Deduplication | Merge duplicate records |\n| Validation | Check data quality |\n\n---\n\n## Step 4: State Update\n\nThe Spine is updated with normalized data:\n- Entity state updates\n- Event recording\n- Decision recording\n- Provenance tracking\n\n---\n\n## Step 5: Reconciliation\n\n```typescript\ninterface ReconciliationReport {\n  executionToken: string;\n  intended: ActionDef;\n  actual: ActionResult;\n  match: 'exact' | 'partial' | 'mismatch';\n  discrepancies: Discrepancy[];\n}\n```\n\n| Match Type | Action |\n|-----------|--------|\n| **Exact** | Close, promote memory |\n| **Partial** | Flag for review |\n| **Mismatch** | Escalate, compensate |\n\n---\n\n## Step 6: Discrepancy Handling\n\n| Severity | Handling |\n|----------|----------|\n| Low | Auto-retry with correction |\n| Medium | Queue for human review |\n| High | Escalate immediately, compensate |\n| Critical | Halt pipeline, alert admin |\n\n---\n\n## Step 7: Memory Promotion\n\n| Memory Type | Content |\n|-------------|---------|\n| Success patterns | What worked, why it worked |\n| Failure patterns | What failed, why it failed |\n| Entity knowledge | New facts about entities |\n| Process knowledge | Improved workflows |\n\n---\n\n## Reconciliation Connects to\n\n| Layer | Relationship |\n|-------|-------------|\n| [Execution](/architecture/13_EXECUTION) | Receives execution receipts |\n| [Source Systems](/architecture/14_SOURCE_SYSTEMS) | Re-ingests from source systems |\n| [Spine Fabric](/architecture/02_SPINE_FABRIC) | Updates Spine state |\n| [Organizational Memory](/architecture/03_ORGANIZATIONAL_MEMORY) | Promotes learnings |\n| [Loop State](/architecture/16_LOOP_STATE) | Advances work item lifecycle |\n"}