feat(invariants): enforce replace provenance — sourceEventSeqs must cover every shadowed surface node

This commit is contained in:
Hypatia May
2026-06-23 13:37:13 +08:00
parent 1ec8c40d0d
commit 358ae02c56
3 changed files with 132 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ The `repair.ts` module synthesizes `tool/result` closers for orphaned tool calls
### Invariants
The dev-mode invariants plugin validates: `sourceEventSeqs` references (non-empty, no duplicates, references earlier events, references known seqs) and `surfaceOp` (replace start ≤ end).
The dev-mode invariants plugin validates: `sourceEventSeqs` references (non-empty, no duplicates, references earlier events, references known seqs) and `surfaceOp` (replace `start ≤ end`, both endpoints are on the tracked surface, the range is non-reversed in surface position, and `sourceEventSeqs` includes every node the range shadows).
## Consequences