feat(worktrees): narrow the manifest store behind a facade (PR 5/6) - #302
Merged
Conversation
Architecture impact report —
|
added 2 commits
August 20, 2026 10:51
Structural single-writer enforcement for the worktree group manifest store, replacing the type-resolved method scan for this state family: - The WorktreeGroupManifestStore class is no longer exported from the module entrypoint. Cross-module consumers receive a capability-free WorktreeGroupManifestStoreHandle plus narrow WorktreeGroupManifestReader / WorktreeGroupManifestWriter views — a write call outside the writer view is a compile error, and importing the store file from outside the module is an entrypoint violation. - Intra-module writers take the handle and unwrap it via the module-internal worktreeGroupManifestStoreOf (never re-exported). - dashboard.ts (the composition root) holds reader/writer views only; its write surface shrinks from 25 methods to the 5 it legitimately needs. The renameGroup enumeration gap disappears with the scan. - checkSingleWriters: a stateFamily declaring writerFacade: true is enforced by a structural import rule on the dependency graph — only declared writers and the module entrypoint may import the store file. Families sharing one store must agree on the flag. Non-facade families (provisioningStore) keep the type-resolved scan during migration. - Invariant catalog: both groupManifest families declare the facade.
Skill-Harvest: none
hzcheng
force-pushed
the
agent-pivot/arch-refact
branch
from
August 20, 2026 02:53
db01d76 to
c7033e7
Compare
Owner
Author
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.
Summary
PR 5/6 of the Harness Simplification program. Structural single-writer enforcement for the worktree group manifest store, replacing the type-resolved method scan for this state family.
WorktreeGroupManifestStoreHandleplus narrowWorktreeGroupManifestReader/WorktreeGroupManifestWriterviews. A write call outside the 5-method writer view is a compile error; importing the store file from outside the module is an entrypoint violation.worktreeGroupManifestStoreOf, which is never re-exported.renameGroupenumeration gap disappears with the scan.stateFamilywithwriterFacade: trueis enforced by a structural import rule on the dependency graph — only declared writers and the module entrypoint may import the store file. Families sharing one store must agree on the flag. Non-facade families (provisioningStore) keep the type-resolved scan during migration.Mutation-sensitivity proof: a probe file importing the store from
src/todos/fails the guard (single-writer: src/todos/__sneaky_probe.ts imports facade store ...); removing it restores green.Skill harvest
no skill change — the facade pattern followed existing codebase conventions (injected closures, handle unwrap); the CI workflow lessons from this program were already harvested in #297/#299.
Owner approvals
Copy each line into a separate PR comment below (both bind the exact head SHA and expire when the head moves):
Verification
npm run test-compilenode --test tests/unit/architecture/** tests/unit/tooling/**— 546 pass (3 new facade edge-rule cases)node --test tests/unit/worktrees/**— 191 pass; full unit/contract/integration suites passnpm run test:behavior-contracts/npm run lint— passnode scripts/run-trusted-kernel.js— passes with approval, fails closed without