Skip to content

refactor(agent): extract graph-scoped durable materialization lifecycle #2069

Description

@Jurij89

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions