Unclassified
Execution Constitution
Status: SUPERSEDED / ABSORBED — historical subsystem constitution. Current authority: INTEGRATEWISE_ARCHITECTURE.md v2.2.
Scope: Execution lifecycle, plan compilation, adapter dispatch, rollback, side effects, and sync.
Canonical Owner: IntegrateWise Platform
Last Verified: 2026-07-20
1. Purpose
This document defines how IntegrateWise executes governed capabilities.
Execution commits canonical state first. Sync is independent.
2. Lifecycle
User Initiates Capability
│
▼
Gate 1: Pre-Proposal
│
▼
Pending Approval
│
▼
User Approves
│
▼
Gate 2: Execution
│
▼
Spine Sync
│
▼
Projection Refresh
3. Execution Plan
interface ExecutionPlan {
id: string;
tenant: string;
proposal: string;
confidence: number;
evidence: Evidence[];
context: ExecutionContext;
steps: ExecutionStep[];
governance: GovernanceRecord;
outcome?: ExecutionOutcome;
}
4. Step Contract
interface ExecutionStep {
capability: CapabilityId;
adapter: AdapterId;
params: Record<string, unknown>;
rollback: CapabilityId | null;
}
5. Adapter Dispatch
- Resolve adapter by capability and configured providers.
- Prefer live adapter when healthy; fallback to mock when unavailable.
- Execute step with timeout and retry policy.
- Emit timeline event for every step.
- On failure, execute rollback step if defined.
6. Side Effects
- Timeline entry
- Notification
- Evidence record
- Memory promotion candidate
7. Sync Behavior
- Sync is asynchronous.
- Sync failures do not invalidate execution success.
- Sync status is surfaced explicitly.
- Retry uses exponential backoff.
8. Service Ownership (Amendment 7 & 8)
WorkService owns human operational work:
- Commands: CreateTask, UpdateTask, AssignWork, CompleteWork, ReopenWork, RouteQueueItem
- Storage: tasks, work_items, assignments, queues, task_dependencies
- Events: work.created, work.assigned, work.started, work.completed, work.blocked
ExecutionService owns machine execution:
- Storage: capability_invocations, provider dispatch attempts, execution status,
provider acceptance, retry state - Does not own: tasks, work_items, assignments (those belong to WorkService)
CapabilityService owns capability definitions:
- Storage: capability_registry, capability_grants, capability dependencies, capability schemas
- Does not own: capability_invocations (those belong to ExecutionService)
CapabilityService validates what may execute. ExecutionService records and manages
the actual execution. WorkService tracks human work independently.
9. Invariants
- Execution never writes directly to external systems before Spine commit.
- Every execution plan is immutable after approval.
- Every step has a defined rollback path.
- Every execution emits an outcome event.
- Every event is published through the transactional outbox (Amendment 6).
- Every consumer is idempotent via the processed_commands table (Amendment 5).
- Provider acceptance is never presented as completed work until reconciliation
confirms the expected outcome (Amendment 9).