codeburn/docs/providers/droid.md
Resham Joshi 6746ecc22f
Add CONTRIBUTING.md, docs/architecture.md, and per-provider docs (#284)
Document the contributor onboarding path:
- CONTRIBUTING.md: setup, npm scripts, coding conventions, PR process,
  the block-claude-coauthor enforcement, and the five providers without
  test coverage today (claude, gemini, goose, qwen, antigravity).
- docs/architecture.md: 12-command CLI surface, parser pipeline, three
  cache layers, 14 optimize detectors, and the mac / gnome / build
  layouts with cited line numbers.
- docs/providers/: one file per provider (17 providers plus the shared
  vscode-cline-parser helper). Each covers data path, storage format,
  caching, dedup key, quirks, and a "when fixing a bug here" checklist.

Also fix two pre-existing documentation issues surfaced while writing
the new docs:
- RELEASING.md claimed GitHub Actions auto-publishes the CLI when a
  v* tag is pushed. There is no such workflow; CLI publishing is
  manual via npm publish. Updated the CLI section to reflect reality
  and kept the menubar (mac-v* tag) automation accurate.
- .gitignore had CLAUDE.md unanchored, which on case-insensitive
  filesystems also matched docs/providers/claude.md. Anchored to
  /CLAUDE.md so the root-level memory file stays ignored without
  affecting subdirectory docs.

All cited file paths, line numbers, function names, and test counts
were verified against current code (41 test files, 558 tests passing).
2026-05-09 18:39:41 -07:00

1.2 KiB

Droid

Factory's Droid CLI.

  • Source: src/providers/droid.ts
  • Loading: eager (src/providers/index.ts:4)
  • Test: tests/providers/droid.test.ts (148 lines)

Where it reads from

$FACTORY_DIR if set, otherwise ~/.factory/sessions/<subdir>/*.jsonl.

The parser ignores the .factory/ directory itself (droid.ts:293-296); some installs nest it accidentally.

Storage format

JSONL.

Caching

None.

Deduplication

Per messageId within a session (droid.ts:253).

Quirks

  • Token totals are session-level only. Droid does not report per-message tokens. The parser reads settings.tokenUsage once per session and splits it evenly across all assistant calls, with the remainder added to the last call (droid.ts:223-251). This is approximate but consistent.
  • Project name is derived from the session's cwd. If the cwd contains projects/<name>, that name is preferred over the basename (droid.ts:299-319).

When fixing a bug here

  1. If the bug is "tokens unevenly attributed", that is by design. The session-level total is the only signal Droid emits.
  2. If the bug is "no sessions found", confirm the user does not have $FACTORY_DIR pointing somewhere unexpected.
  3. New fixtures go under tests/fixtures/droid/.