Repository navigation
Share one Log inventory capture across Command observations - #1248
Merged
Merged
Conversation
A Snapshot now captures owner, repository, commands and kind folders once behind a Files adapter. Command-record loading, historical recovery, Session queries and the Logs listing consume that capture; Session candidates are decoded, their Model evidence read and their modification times looked up once per capture, and indexed by folder, subject and effective owner.
…ntries Point the Session selection index row at Session membership, share the repository name and owned Session identity, rename the entry kind and on-demand capture, and check that a fresh capture and Logs listing drop an entry retargeted to a symlink.
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
A Snapshot now captures the Log inventory once. Everything that used to walk the log folder again now reads that capture: Command-record loading, historical recovery, every Command's Session query, and the Logs listing.
What is unchanged:
reader.rs,still_listed) still check eligibility and writer lifetime on every read.docs/code-navigation.mdpoints at its new owner.Seams under test: the Snapshot interface and the projections built on it (
Observation::sessions/session/details,trace::ancestry::of,catalog::list). They run over a temporary filesystem through the internalFilesseam, with a counting adapter wrapped aroundNative.Evidence
Before:
a593009e, eachObservation::sessions()listed its Command's folder and re-read its sidecars and metadata.catalog::loadthen listed every folder again.After:
cargo test --bin thirdshift logs::reading::testspasses 22/22. It includes two new tests:Suite: the full Rust suite, from
scripts/affected-tests origin/mainpluscargo test --no-fail-fast: 2604 passed, 0 failed across 62 test binaries atbbc78a62.tag.gpgsign true. That breaks 3worktree::synchronization_tests, which create lightweight tags, on any branch.GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=tag.gpgsign GIT_CONFIG_VALUE_0=false.Merge Danger
Door: two-way
It is a refactor with no new file format, cache or setting, so a revert restores the old discovery loops exactly.
Blast Radius: logs
These all read the capture:
status,show,logs, the Console Inbox, the Logs page, Trace export and Waterfall, Stop and Dismiss. If ownership, ordering or eligibility drifted, it would show up there. The retained regressions intests/show_logs.rs,tests/status.rs,tests/console.rsandreader_tests.rspin those.Review
origin/main, because the localmainref was stale.thirdshift-code-review.console/README.mdjoined the diff after review. It is a one-line wording fix for a Standards finding: "Session inventory" became "Session traces". The Standards axis had read that line; the Spec axis left it unread.Unaddressed findings
Standards
&Arc<Inventory>threaded throughtree/children/Command::new/history::readand stored on each Command. Declined, per plan Decision 2: "The Snapshot and its Command/history observations retain a private shared handle to the captured inventory; their Session queries use that handle." Existing callers such as Inbox rows, details and Trace ancestry keep callingcommand.sessions()with no new parameter (src/logs/reading/selection.rs,Observation::sessions).Inventory::sessions/candidateswork onFolderdata. Declined, as a judgement call. Moving them ontoFolderwould make every Folder carry theFilesadapter. Keeping them onInventorysends every discovery effect through the one owner that the counting test observes (src/logs/reading/inventory.rs,Inventory::sessions).catalog::list(snapshot, root, …)passesrootbeside the Snapshot. Declined. The on-demand capture used by Stop'sretained_workhas no root. The listing's root is the configuredlogs_dir, which its caller already holds and whichReader::withinneeds anyway (src/logs/reading/catalog.rs,load)._Avoid_line for "Session inventory" under Log inventory. Declined. The remaining uses were reworded. "Session inventory" was never a competing name for the Log inventory, and_Avoid_is optional in this glossary.Spec
reader_tests::configured_root_and_commands_aliases_stay_readableand the history cases insrc/logs/reading/tests.rsandtests/status.rsare kept unchanged and pass.Security
ce8b4bbe...bbc78a62found no introduced finding. These are unchanged: physical-only Logs eligibility, the symlink exclusions for owner, repository, kind and file entries, Model-evidence reads, and the per-readstill_listedand writer checks in Readers. Every capture is request-scoped.Closes #1246
Built with claude · claude-opus-5-5 · high
Security review outcome
No unaddressed introduced findings.