Skip to content

feat(agent): add exact active System Record receiver - #2202

Open
Jurij89 wants to merge 8 commits into
integration/2052-system-record-syncfrom
fix/2052-agent-profile-sync
Open

feat(agent): add exact active System Record receiver#2202
Jurij89 wants to merge 8 commits into
integration/2052-system-record-syncfrom
fix/2052-agent-profile-sync

Conversation

@Jurij89

@Jurij89 Jurij89 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the first default-off Stack D receiver kernel for one already-admitted ordinary active Agent Profile inventory row.
  • Verify the exact signed authority closure, graph-scoped publication bundle, inventory-row binding, and owned-subject table before handing one immutable candidate to the lifecycle-owned materializer bridge.
  • Extract the current head from the verified closure result instead of callback side effects, while retaining the first-artifact row-binding rejection that avoids unnecessary closure fetches.
  • Bind canonical projection bytes and parsed quads into one verified-bundle value, reject any callback result whose bytes differ from the exact supplied bundle projection, and expose the verified envelope as an active-head type at the materializer boundary.
  • Keep protocol registration, inventory traversal, admission, retries, reconciliation, tombstone/quarantine handling, lifecycle flags, timers, queues, and activation out of this PR; current node behavior remains unchanged.
  • Avoid adding sync pressure: dependencies are captured once, row/artifact bytes are bounded before copying, unbound metadata is refused after the first head lookup, and no second copy of the complete closure is retained.

Related

Diagrams

Active profile verification and apply kernel

Before:

sequenceDiagram
    participant Coordinator
    participant Receiver
    participant Repository
    participant Materializer
    Note over Coordinator,Materializer: No exact active-profile receiver kernel exists
    Coordinator-->>Receiver: No callable bounded verification/apply path
Loading

After:

sequenceDiagram
    participant Coordinator
    participant Receiver
    participant Repository
    participant Materializer
    Coordinator->>Receiver: Already-admitted ordinary active row
    Receiver->>Repository: Resolve bounded content-addressed closure
    Repository-->>Receiver: Exact verified closure objects
    Receiver->>Receiver: Bind row, head, projection bytes/quads, and subject table
    Receiver->>Materializer: Immutable verified candidate plus separate signal
    Materializer-->>Receiver: Typed atomic-apply outcome
    Receiver-->>Coordinator: Preserve committed outcome after point of no return
Loading

The receiver is not registered or called by production lifecycle code in this PR.

Files changed

File What
packages/agent/src/system-records/receiver-v1.ts Default-off active-row kernel, verified-closure extraction, coherent projection contract, exact row/table bindings, and lifecycle dependency snapshotting.
packages/agent/test/system-record-receiver-v1.test.ts Active success, exact verifier inputs, multi-subject handoff, independent fail-closed row/table/projection/authority cases, cancellation point-of-no-return behavior, dependency snapshotting, and zero-fetch refusal coverage.

Test plan

  • Build Core and Storage.
  • Build Agent, including type tests and package-root verification.
  • Run test/system-record-receiver-v1.test.ts (14/14).
  • Run receiver, producer publication/validation, and provider suites together (65/65).
  • Verify corrupted but valid subject-table bytes and mismatched projection bytes fail before consumeCandidate.
  • Run git diff --check.
  • Confirm the branch contains only receiver implementation/tests and no ignored or local-only files.

@Jurij89

Jurij89 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@otReviewAgent Please review the current head for merge readiness. This is the first default-unused Stack D receiver kernel; it does not register or activate sync, and its local resource/fail-closed gates plus live managed-ownership CI are green.

Comment thread packages/agent/src/system-records/receiver-v1.ts Outdated
Comment thread packages/agent/src/system-records/receiver-v1.ts
Comment thread packages/agent/test/system-record-receiver-v1.test.ts
Comment thread packages/agent/src/system-records/receiver-v1.ts
Comment thread packages/agent/src/system-records/receiver-v1.ts
Comment thread packages/agent/test/system-record-receiver-v1.test.ts Outdated
Comment thread packages/agent/src/system-records/receiver-v1.ts
Comment thread packages/agent/test/system-record-receiver-v1.test.ts
@Jurij89

Jurij89 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@otReviewAgent Please review current head f94b34d for convergence. The latest commit pins exact verifier head/bundle/signal inputs, exposes an active-head envelope at the candidate boundary, and verifies full multi-subject handoff; Agent build/type/package checks and 65/65 focused tests pass.

@Jurij89

Jurij89 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@otReviewAgent Please review the current head after the empty retrigger commit; evaluate the exact active receiver kernel for convergence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants