Phase 3: make ordinary workspace mutations record-bounded - #38
Draft
lost-rob0t wants to merge 35 commits into
Draft
Phase 3: make ordinary workspace mutations record-bounded#38lost-rob0t wants to merge 35 commits into
lost-rob0t wants to merge 35 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.