Skip to content

refactor(storage): migrate exact managed mutations - #2185

Merged
Jurij89 merged 6 commits into
integration/2052-system-record-syncfrom
fix/2162-structured-managed-updates
Aug 9, 2026
Merged

refactor(storage): migrate exact managed mutations#2185
Jurij89 merged 6 commits into
integration/2052-system-record-syncfrom
fix/2162-structured-managed-updates

Conversation

@Jurij89

@Jurij89 Jurij89 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Migrate the remaining exact managed-state writes for requester join state, graph-scoped KA materialization, and subgraph registration into bounded structured storage operations.
  • Include the merged refactor(storage): add bounded managed mutation capabilities #2186 expansion: one closed TripleStore.structuredMutation() union, bounded validation and serialization, first-party adapter/decorator forwarding, and migrations for catalog, retention, curator refresh, RS repair, and KA metadata callers.
  • Reuse the canonical store-chain traversal for capability discovery, so transparent wrappers participate through their existing chain link instead of maintaining a parallel forwarding protocol.
  • Guard every RS-heal materialization write boundary with the current subscription/on-chain binding so a stale repair pass cannot clear a valid completion marker.
  • Remove the subgraph deregistration fallback that sent a SPARQL mutation through query(), while preserving rolling-upgrade behavior through explicit capability checks.
  • Keep raw-channel contraction separate in stacked PR security(storage): close leased raw SPARQL mutation routes #2187 so the ownership-lease security boundary can be reviewed independently.

Related

Diagrams

Managed-state mutation path

flowchart LR
    A[Domain caller] --> B[Structured mutation descriptor]
    B --> C{Validate scope and bounds}
    C -->|invalid| D[Typed refusal]
    C -->|valid| E[Decorators account for touched graphs]
    E --> F[Adapter-authored bounded SPARQL]
    F --> G[Storage backend]
Loading

Stack boundary

flowchart TB
    P2186[PR 2186: bounded capability layer]
    P2185[PR 2185: migrate exact callers]
    P2187[PR 2187: close leased raw mutation channels]
    P2186 --> P2185
    P2185 --> P2187
Loading

Files changed

Area What
packages/storage/src/** Defines, validates, forwards, and implements the closed structured mutation capability across first-party stores and decorators.
packages/agent/src/** Migrates join state, registration cleanup, retention, curator refresh, and RS repair away from caller-authored mutations; guards RS-heal writes against stale ownership.
packages/publisher/src/** Migrates graph-scoped KA materialization, catalog cleanup, agents retention, and Merkle-root metadata.
packages/{storage,agent,publisher}/test/** Covers bounds, atomicity, reserved scopes, decorator accounting, worker parity, retries, retention, rolling-upgrade behavior, and stale RS-heal cancellation.

Test plan

  • Post-rebase builds: core, storage, publisher, and agent
  • Canonical capability-chain regression: 30 focused storage tests, including link-only capable and incapable wrappers
  • Post-rebase Agent selected suites: 32 passed
  • Decorated RS-repair suite after the final review fix: 16 passed
  • Companion RS-repair suite after the final review fix: 15 passed
  • Post-rebase Publisher selected suites: 22 passed
  • Agent type and package-root checks
  • Merged refactor(storage): add bounded managed mutation capabilities #2186 storage suite evidence: 948 passed, 26 skipped integration tests
  • Merged refactor(storage): add bounded managed mutation capabilities #2186 changed Agent suite: 76 passed
  • Merged refactor(storage): add bounded managed mutation capabilities #2186 focused Publisher suite: 65 passed
  • Real worker-RPC coverage for all six structured mutation variants
  • Multi-root and over-budget RS repair coverage, including ordered chunks below the 4 MiB serialized-update cap
  • Stale-before-first-write and stale-after-data-copy RS-heal regressions proving later metadata/completion writes are not dispatched
  • Over-cap retention integration across multiple bounded mutations
  • Raw mutation inventory at the merged capability head: no Agent/Publisher store.update() or mutating store.query() caller remains
  • git diff --check; worktree clean after rebasing onto current integration/2052-system-record-sync

Comment thread packages/publisher/src/update-handler.ts

@otReviewAgent otReviewAgent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Agent completed this review and found no issues.

Comment thread packages/storage/src/triple-store.ts
Comment thread packages/agent/src/join-request-retention.ts
@Jurij89
Jurij89 force-pushed the fix/2162-structured-managed-updates branch from a1b82f0 to afe1226 Compare August 9, 2026 10:24
Comment thread packages/storage/src/unsupported-capability-error.ts
Comment thread packages/agent/src/dkg-agent-swm-host.ts Outdated
Comment thread packages/agent/src/dkg-agent-base.ts
Jurij Skornik and others added 5 commits August 9, 2026 12:55
* refactor(storage): add bounded managed mutations

* fix(agent): drain bounded join retention backlog

* test(agent): exercise unified projection mutation

* fix(storage): harden structured mutation boundary

* fix(agent): preserve update-only join moderation

* fix(storage): forward structured capability truthfully

* fix(agent): chunk large RS heal projections

* refactor(storage): centralize bounded operation probes

* fix(storage): preserve bounded update compatibility

* refactor(agent): unify join retention policy

* fix(storage): preserve blob-backed bounded replacements

* refactor(storage): centralize structured quad rewriting

* fix(storage): retain update-only linked-record pruning

---------

Co-authored-by: Jurij Skornik <jurij.skornik@gmail.com>
Comment thread packages/agent/src/dkg-agent-swm-host.ts
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