Skip to content

fix(droid): search ~/.factory/sessions, the root Droid 0.202.0 actually writes - #256

Merged
gcko merged 3 commits into
mainfrom
feature/drc-4331-droid-02020-writes-sessions-under-factorysessions-and-the
Sep 2, 2026
Merged

fix(droid): search ~/.factory/sessions, the root Droid 0.202.0 actually writes#256
gcko merged 3 commits into
mainfrom
feature/drc-4331-droid-02020-writes-sessions-under-factorysessions-and-the

Conversation

@gcko

@gcko gcko commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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: the droid.projects roots are now <home>/.factory/sessions then <home>/.factory/projects. Droid 0.202.0 writes sessions/<slugified-cwd>/<session-id>.jsonl; projects stays 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 on origin/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.json is not read.
  • docs/design-usage-quota.md and docs/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:

  • RED first: the new collector test failed with AssertionError: False is not true (discover) and the roots test failed listing only projects; 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.
  • Full suite once under coverage: 1769 tests OK, 1 skipped; scripts tests OK; coverage total 90.2%.
  • claude plugin validate ./cargento --strict and agy plugin validate ./cargento: pass.
  • Live: server.py --diagnose reports Droid 3 session(s) and lists ~/.factory/sessions (directory) first with ~/.factory/projects (missing); a direct droid.collect(show_all=True) on the shipped config returns the three rows with sid, project and state intact.
  • Docs pass (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 Closes line.

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.

gcko added 3 commits September 2, 2026 20:17
…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>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Coverage

Name                                                                  Stmts   Miss Branch BrPart  Cover
-------------------------------------------------------------------------------------------------------
cargento/skills/cargento/agy_hook.py                                     79     14     28      7  78.5%
cargento/skills/cargento/cargento_runtime/__init__.py                     0      0      0      0 100.0%
cargento/skills/cargento/cargento_runtime/aggregate.py                  213      1     64      0  99.6%
cargento/skills/cargento/cargento_runtime/asks.py                       110      0     28      0 100.0%
cargento/skills/cargento/cargento_runtime/claude_data.py                305     33    142     17  88.8%
cargento/skills/cargento/cargento_runtime/cli.py                        120     17     26      4  84.2%
cargento/skills/cargento/cargento_runtime/collectors/__init__.py          0      0      0      0 100.0%
cargento/skills/cargento/cargento_runtime/collectors/antigravity.py     410     41    166     25  87.2%
cargento/skills/cargento/cargento_runtime/collectors/claude.py          256     15     94     12  91.7%
cargento/skills/cargento/cargento_runtime/collectors/codex.py           101      7     38      7  89.9%
cargento/skills/cargento/cargento_runtime/collectors/copilot.py         148      6     50      2  96.0%
cargento/skills/cargento/cargento_runtime/collectors/cursor.py          276     19    104     16  90.3%
cargento/skills/cargento/cargento_runtime/collectors/droid.py            32      3      6      1  89.5%
cargento/skills/cargento/cargento_runtime/collectors/gemini.py           53      7     16      4  84.1%
cargento/skills/cargento/cargento_runtime/collectors/goose.py            89     11     28      4  87.2%
cargento/skills/cargento/cargento_runtime/collectors/opencode.py         78      6     26      2  92.3%
cargento/skills/cargento/cargento_runtime/collectors/pi.py              326     34    152     20  88.7%
cargento/skills/cargento/cargento_runtime/config.py                     189      1     20      1  99.0%
cargento/skills/cargento/cargento_runtime/diagnostics.py                 84      4     26      4  92.7%
cargento/skills/cargento/cargento_runtime/dismissals.py                 113      2     28      2  97.2%
cargento/skills/cargento/cargento_runtime/events.py                     169      0     64      0 100.0%
cargento/skills/cargento/cargento_runtime/git_status.py                  28      2      8      2  88.9%
cargento/skills/cargento/cargento_runtime/http_api.py                   520     36    172     10  93.1%
cargento/skills/cargento/cargento_runtime/io.py                         130      2     28      0  98.7%
cargento/skills/cargento/cargento_runtime/lifecycle.py                  325     15    106      6  95.1%
cargento/skills/cargento/cargento_runtime/notifications.py              174     14     60      4  91.5%
cargento/skills/cargento/cargento_runtime/observation.py                271      9     74      1  97.1%
cargento/skills/cargento/cargento_runtime/observer.py                   239     25    108     13  87.3%
cargento/skills/cargento/cargento_runtime/probe.py                       44      0     18      1  98.4%
cargento/skills/cargento/cargento_runtime/quota.py                      333      2    112      1  99.3%
cargento/skills/cargento/cargento_runtime/records.py                    262      6    116     10  95.8%
cargento/skills/cargento/cargento_runtime/sessions.py                   101      0     44      0 100.0%
cargento/skills/cargento/cargento_runtime/snapshot.py                    36      0      4      0 100.0%
cargento/skills/cargento/cargento_runtime/spacedock.py                  454     48    238     26  89.0%
cargento/skills/cargento/cargento_runtime/state.py                       66      0      2      0 100.0%
cargento/skills/cargento/cargento_runtime/stream.py                      57      0      8      0 100.0%
cargento/skills/cargento/cargento_runtime/transcripts.py                523     31    268     27  92.7%
cargento/skills/cargento/cargento_runtime/turns.py                      197     14    104     12  90.7%
cargento/skills/cargento/cargento_runtime/web/__init__.py                 0      0      0      0 100.0%
cargento/skills/cargento/cargento_runtime/web/page.py                    38      0     10      0 100.0%
cargento/skills/cargento/event_hook.py                                   86      4     28      3  93.9%
cargento/skills/cargento/mcp_server.py                                  377     22    112     14  92.2%
cargento/skills/cargento/notify_hook.py                                  49     15      6      1  67.3%
cargento/skills/cargento/server.py                                        3      0      2      1  80.0%
cargento/skills/cargento/statusline_hook.py                             131     13     46      8  87.0%
scripts/bench_collect.py                                                211     10     54      6  94.0%
scripts/bench_event_latency.py                                           67     21     14      1  67.9%
scripts/bump_version.py                                                  60     12     24      5  77.4%
scripts/capture_hook.py                                                 287     30     86     11  88.5%
scripts/derive_prompt_shapes.py                                         210     16     88     14  89.3%
scripts/lint_embedded.py                                                 89      3     28      2  95.7%
scripts/validate_plugins.py                                             675    190    390     60  69.2%
-------------------------------------------------------------------------------------------------------
TOTAL                                                                  9194    761   3464    367  90.1%

Threshold: fail_under in pyproject.toml · label coverage-exception to bypass (visible in PR timeline).

@gcko
gcko merged commit a49e752 into main Sep 2, 2026
19 of 21 checks passed
@gcko
gcko deleted the feature/drc-4331-droid-02020-writes-sessions-under-factorysessions-and-the branch September 2, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant