Repository navigation
refactor(bucket): give the prs namespace a domain module - #128
Merged
Merged
Conversation
Facts was the one shape in the state directory whose storage lived in the commands: the sweep opened the namespace and passed the handle down, and swept opened it a second time to read one pull request back. The read and the write join Facts. The sweep stops carrying a store through its own signature, and the one sentence that was genuinely the command's - that nothing is known until a sweep has run - stays in the command. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
prswas the one namespace the state directory holds with no module indomain/. Its shape,Facts, already sat insrc/domain/bucket.ts; its storage sat in two commands, and the sweep carried the open store down through its own signature to reach it. The read and the write join the shape, which is where every other namespace keeps them.What changes
src/domain/bucket.ts— gainsfactsForandrecordFacts, besideFacts.src/cli/sweep.ts—sweepPrdrops itsstoreparameter; theStorealias and theKeyValueStoreimport go with it.src/cli/pr.ts—sweptreads throughfactsForand keeps its own sentence, that nothing is known until a sweep has run.Done when
No file in
src/cli/callsstoreFor("prs", …). Verified: none does.Why bucket.ts and not a new module
Factsis already there, andsrc/domain/review.tsis the precedent for one module holding a shape, its keys, its reads and its rules. The cost is worth naming:bucket.tswas adapter-free before this and now reaches the key-value store.src/domain/stamp.tsalready mixes pure rules with storage, so the shape is not new — andplaceandgroupstay pure.Test plan
pnpm check— pass: lint, format, typecheck, 817/817 tests, buildsrc/cli/status.test.tsdrives both the read and the write through the sweepRisk
None to the state directory: same namespace, same key, same schema, so a directory written before this reads the same after. If
factsForwere wrong every pull request would look new to the quiet rule and the sweep would pay for reads it used to skip — visible on the first run, and the way back is the revert.Closes #127