Context
From the system design audit, cross-aggregate consistency rules are incomplete. The spec now resolves these but the codebase should enforce them explicitly.
Key Rules (from spec)
| Trigger |
Cascade |
Atomicity |
client.delete |
client.deleted + N x project.client-unassigned |
Single decider invocation, all events in one batch |
thread.delete |
thread.deleted only. Session NOT auto-stopped |
Single event |
thread.project.reassign (hot) |
thread.project-reassigned. Active session/turn/approvals continue |
Single event |
| Checkpoint trim (500 cap) |
Projection record removed. Diff blob deleted. Git ref retained |
Projection update |
Specific Gaps to Address
- client.delete cascade: Already implemented. Verify test coverage for cascading unassign with N projects.
- thread.delete + active session: Document that session is NOT auto-stopped. Add test: delete thread with active session -> verify session still runs (or explicit stop required first).
- Hot reassignment: Already implemented (no quiescence check). Document that this is intentional. Add test: reassign thread mid-turn -> verify turn completes successfully.
- Checkpoint trim cleanup: See companion issue for diff blob cleanup.
Acceptance Criteria
References
- System Design Spec:
.plans/21-system-design-spec.md Section 5 (Cascading Behaviors)
- Audit finding: "Cross-aggregate consistency rules are incomplete"
Context
From the system design audit, cross-aggregate consistency rules are incomplete. The spec now resolves these but the codebase should enforce them explicitly.
Key Rules (from spec)
client.deleteclient.deleted+ N xproject.client-unassignedthread.deletethread.deletedonly. Session NOT auto-stoppedthread.project.reassign(hot)thread.project-reassigned. Active session/turn/approvals continueSpecific Gaps to Address
Acceptance Criteria
References
.plans/21-system-design-spec.mdSection 5 (Cascading Behaviors)