Problem
Graph-scoped durable materialization is currently implemented as a deeply nested closure in runLegacyDurableSyncForContextGraphDetailed. It owns chain authentication, binding-generation fences, strict binding persistence, physical-run registration, atomic materialization/quarantine, and post-commit invalidation.
The behavior is tested, but the ownership boundary is difficult to scan and future fence changes can be placed incorrectly.
Direction
Extract a named graph-scoped durable materialization coordinator or focused lifecycle helper. Keep durable-sync request construction in the existing method and move the commit lifecycle behind a small typed API.
This must be a no-behavior-change refactor. Do not add a worker, scheduler, queue, cache, or store operation.
Acceptance criteria
- Binding changes during authentication abort before materialization.
- A subscription removed after an atomic commit triggers compensating atomic quarantine.
- A public sync admitted without a subscription retains its authenticated commit.
- Strict on-chain binding persistence happens before materialization and remains fail-closed.
- Physical-run retirement and shutdown cancellation behavior are unchanged.
- Existing lifecycle-binding and graph-scoped materialization suites remain green.
Related
Problem
Graph-scoped durable materialization is currently implemented as a deeply nested closure in
runLegacyDurableSyncForContextGraphDetailed. It owns chain authentication, binding-generation fences, strict binding persistence, physical-run registration, atomic materialization/quarantine, and post-commit invalidation.The behavior is tested, but the ownership boundary is difficult to scan and future fence changes can be placed incorrectly.
Direction
Extract a named graph-scoped durable materialization coordinator or focused lifecycle helper. Keep durable-sync request construction in the existing method and move the commit lifecycle behind a small typed API.
This must be a no-behavior-change refactor. Do not add a worker, scheduler, queue, cache, or store operation.
Acceptance criteria
Related