Phase 3: make ordinary workspace mutations record-bounded #38
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority:P1
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/quasar!38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/issue-37-record-bounded-mutations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
Implements #37, Phase 3 of parent #24, on top of merged Phase 2 (#35 / PR #36).
Old defect
Post-Phase-2 ordinary mutations still followed the materialized path:
workspace-for -> load-workspace -> copy-workspace -> mutate -> commitso changing one document could retain/copy the unrelated durable corpus.
workspace.transactionhad the same corpus-sized candidate behavior.TDD red evidence
The first meaningful Phase 3 commit was tests-only:
2cdcd9a6e843913c5227d23adb2506d34ffdf61d.CI run
32093205188/ job95579384402failed all six new Phase 3 tests for the intended invariant: ordinary Tek9 mutations repopulated the full workspace cache, including the real 10,000-document case. No unrelated regression obscured the red evidence.Record-bounded architecture
Production Tek9 mutations now use a record-level mutation context:
The authoritative Tek9 mutation routers do not call
workspace-for,load-workspace, orcopy-workspace. The non-streaming memory store retains an explicitly named materialized compatibility path for focused tests.control-plane.lispwas split into cohesive core, mutation-routing, and runtime/registry modules so Phase 3 does not depend on another load-order override. The temporary Phase 3 override file used during development was deleted.Transaction semantics
workspace.transactionuses the same overlay as single mutations:Memory may scale with the explicit touched/dependency set, never with unrelated workspace corpus size.
Referential integrity
Phase 3 directly validates required document/node/edge dependencies through Tek9-backed access. Adversarial review added/fixed coverage for:
all-documentsgraph before its metadata is first persisted.Atomicity model
commit-change-setopens one Tek9 write transaction and:Events are emitted only after that transaction succeeds. Failure injection covers pre-change, post-change, pre-revision/meta, pre-journal, and pre-commit stages and requires zero record/topology/revision/journal/event leakage. Retry after failure is covered.
Large-corpus / memory evidence
The Phase 3 suite uses real Tek9 stores, close/reopen restart boundaries, and a 10,000-document corpus. It includes:
The tests assert that one-record retained working state remains the same small bounded record set as unrelated corpus size grows 10x, while transaction memory grows with its explicit touched set.
Tek9 boundary
No Tek9 change or pin bump was required. Existing exported Tek9 direct/range/graph/transaction APIs were sufficient. Quasar does not use
tek9::, rawlmdb:, private cursors, or copied LMDB logic.npm run checknow includes a structural record-bounded mutation guard that rejects regression of the authoritative routing/bounded modules to full-workspace materialization and rejects private Tek9/raw LMDB use.Documentation
Added
docs/ADR-RECORD-BOUNDED-MUTATIONS.mdand updated README/architecture while preserving unrelated existing deployment, security, StarLang, UI migration, and external-service documentation.Remaining limitations
Adversarial review findings fixed
Before merge review caught and fixed:
graph.puton a newly staged graph could lose its:newstate;No unresolved PR review comments are present.
Current merge gate
Exact current head:
65b91fccec2ce57f86de075d8a688242c8c44284.Required CI run:
32096264185(run #662), job95588118741.As of the latest check the exact-head job is still
queuedwaiting for a GitHub-hosted runner. It has not reported a code/test failure. The PR remains draft and must not merge until this exact head completes the full mandatory CI matrix green.Closes #37 only when the exact-head gates are green and the PR is merged.
Parent: #24. Evaluate #24 separately after #37; do not close the parent merely because Phase 3 is complete if any durable bounded-memory acceptance criterion remains materially unfinished.
WIP: Phase 3: make ordinary workspace mutations record-boundedto Phase 3: make ordinary workspace mutations record-boundedView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.