fix(droid): search ~/.factory/sessions, the root Droid 0.202.0 actually writes - #256
Merged
gcko merged 3 commits intoSep 2, 2026
Conversation
…ly writes Droid 0.202.0 writes <home>/.factory/sessions/<slugified-cwd>/<session-id>.jsonl, and the collector's only root was <home>/.factory/projects, so a machine holding three real Droid transcripts discovered nothing and the Droid row never rendered. Measured 2026-09-02 on macOS: discover() was False with the shipped root and True once the sessions root was searched, and collect() returned all three rows with their id, cwd project and title intact. The per-record parsing was right; only the root was wrong. The captures README had recorded the finding on 2026-08-25 and nothing filed it. The sessions root is searched first and `projects` stays as a fallback, because no measurement says which Droid versions wrote there. The new collector test goes through the resolved default roots rather than a store override, since an override would pass against any root at all. SKILL.md's store inventory names the new path and notes the sibling <session-id>.settings.json is not read. Implements DRC-4331. Unblocks the Droid quota fetcher (DRC-4073), because quota follows discovery. Signed-off-by: Jared Scott <jared.scott@variable.team>
The usage design record said Droid was not installed on the machine this work was done against and its store had never been read. Both stopped being true on 2026-09-02: the store was read for DRC-4073 and holds a per-session credit count and no quota window, while the authenticated /limits route stays unread because no Factory account is signed in here. The captures README's Droid row recorded the wrong collector root as an open finding; it now names the fix. Signed-off-by: Jared Scott <jared.scott@variable.team>
…ld a duplicated test Review findings on this branch. The Q-10 paragraph presented the settings.json key names as a measured field when the repository holds no capture of them: it now says they were read by hand on 2026-09-02 and recorded on DRC-4073, that no parser is written against them until a capture lands, and that the /limits, FACTORY_API_KEY and keytar claims were read in the binary's strings and never run. The dedicated roots test duplicated the assertion already in the defaults test byte for byte, so the comment moved onto that assertion and the duplicate is gone. The collector test's cleanup no longer swallows an rmtree failure. Signed-off-by: Jared Scott <jared.scott@variable.team>
Contributor
CoverageThreshold: |
gcko
deleted the
feature/drc-4331-droid-02020-writes-sessions-under-factorysessions-and-the
branch
September 2, 2026 12:29
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.
Implements DRC-4331 — Droid 0.202.0 writes sessions under ~/.factory/sessions, and the collector reads ~/.factory/projects, so every Droid session is invisible
What changed
config.py: thedroid.projectsroots are now<home>/.factory/sessionsthen<home>/.factory/projects. Droid 0.202.0 writessessions/<slugified-cwd>/<session-id>.jsonl;projectsstays as a fallback because no measurement says which versions wrote there.tests/test_droid.py: a collector test that builds the 0.202.0 layout under the suite's HOME and goes through the resolved default roots, not a store override. It fails onorigin/main(discover()is False) and passes here.tests/test_config_diagnostics.py: the roots test expects both roots, sessions first, with the measurement recorded.SKILL.md: the store inventory names the 0.202.0 path, keeps the older root, and notes the sibling<session-id>.settings.jsonis not read.docs/design-usage-quota.mdanddocs/captures/README.md: the design record no longer says Droid was never installed or its store never read; the captures row names the fix.User value
P1, keep. A Droid session now appears on the board at all. Before this, a machine holding three real Droid transcripts rendered no Droid row. Quota follows discovery, so this also unblocks the Droid quota fetcher (DRC-4073).
Verification
Run in the worktree on macOS, droid 0.202.0, with three real sessions under
~/.factory/sessions:AssertionError: False is not true(discover) and the roots test failed listing onlyprojects; both pass after the one-line root change.ruff check .,ruff format --check .,mypy: clean.python3 scripts/lint_embedded.py: clean (node not on this machine, so the JS syntax check was skipped; the frontend is untouched).python3 scripts/validate_plugins.py: passes.python3 scripts/bump_version.py --current: 0.20.0, and no version field moved on this branch.claude plugin validate ./cargento --strictandagy plugin validate ./cargento: pass.server.py --diagnosereportsDroid 3 session(s)and lists~/.factory/sessions (directory)first with~/.factory/projects (missing); a directdroid.collect(show_all=True)on the shipped config returns the three rows with sid, project and state intact.sync-docs): validator, documentation tests and the tone check are clean; the diff is docs-only in the second commit.No mirrored GitHub issue exists, so there is no
Closesline.Review
Two review lenses ran on the worktree diff before this PR opened (correctness and cross-platform; documentation and contract), with findings arbitrated by reproduction. The third commit carries the outcome: provenance labels on the Factory store reading in the usage design record, one duplicated test assertion folded, and a cleanup that no longer swallows an error.