Repository navigation
Ignore what the ledger format doesn't name (#104) - #105
Merged
Merged
Conversation
The format said what a ledger folder must hold and nothing about what else may be in it. The code filled the gap by accident: #scan read every folder at the top as a writer, .git and .stfolder included, so a segment-named file inside .git was folded. #scan now skips dot-entries at the top and in writer directories, the way inspect already did, and does not list them in status.ignored. Everything else the format does not name is still listed there. multi-writer.md gets a section with the rule (a writer writes the format exactly, a reader ignores what it does not name, a build may add files), extras at the top as files only, the unchanged marker check, the rule for shared files at the top, and an empty list of named extras for #63. "LEDGER is the only file at the top" becomes "the only file required". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-unnamed-104 # Conflicts: # packages/ledger/ledger.ts
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.
Closes #104.
What changed
Code (
packages/ledger/ledger.ts):#scannow skips dot-entries, files and folders, at the top of the ledger and inside writer directories.inspectalready did this, and now both use onehidden()check. Before this change,.git,.stfolderand.stversionswere each read as a writer, and a segment-named file inside.gitwas actually folded.Spec (
packages/ledger/multi-writer.md): a new section, "What else the folder may hold":randomUUID()before and after Swap @pbnotes/ledger for @pbnotes/append-only-log in the app #50, a UUIDv8 fromopenWriter). A pattern was considered, but it protects nothing until every build in use has it, and it would mean renaming every writer folder in the tests.status.ignored. Everything else the format does not name is still listed.AGENTS.mdand the code that reads the list land in ledger: write an AGENTS.md at the root of a new ledger #63.LEDGERis the only file at the top" now says "the only file required at the top".app/CLAUDE.mdsays the same.For the reviewer
status.ignored, not just skipped. That includes a.DS_Storeinside a writer directory, which used to be listed. Common sync tools don't give conflicted copies names that start with a dot (Dropbox, Syncthing, iCloud, OneDrive), so this hides no conflict, and it keeps a sync tool's temp files out of the list.mainafter Read quiet writer directories less often, and slow down in the background #101 (Decide how often the ledger looks for changes #52, cadence). The one conflict was the top-level loop in#scan: main's version is kept, with the dot-entry skip in front of it.app/CLAUDE.mdsays the marker's comment changed in Swap @pbnotes/ledger for @pbnotes/append-only-log in the app #50, but the spec says Give the ledger an instance interface: openOrCreate, writer, post, onEvent, close #45. That is left as it was.Tests
.gitfolder that holds a valid segment folds nothing..stfolder,.DS_Store(at the top and in a writer folder) and a Syncthing temp file are neither read nor listed. A plainnotes.txtat the top is still listed instatus.ignored. The test failed before the fix (.git-1was folded).npm test(138 tests across all workspaces) andnpm run typecheckpass.🤖 Generated with Claude Code