Three CLI commands (gather → generate → submit) share disk state under out/<run-id>/.
Each command is a thin wrapper around a pipeline function in src/pipeline/.
Data sources implement the DataSource interface (see src/sources/types.ts).
- Never call
exec/shelldirectly. Allghcalls go throughrunGh(src/sources/gh-run.ts) which usesexecFileand runs args throughvalidateGhArgsfirst. - All LLM responses go through
extractJson(throws) orextractJsonOrNull(returns null) — seesrc/generator/extractJson.ts. - Every cross-command artifact (
meta.json,cards.json,context.json) is Zod-validated before use. Schemas live near the writer, but are imported by the reader. - Retry only network/5xx/429 errors. GraphQL application errors and 4xx auth errors
are NOT retried — see
defaultIsRetryableinsrc/util/retry.ts.
pnpm verify runs typecheck + all tests. Run before any commit.
Tests inject fakes (mock client, mock exec, mock streams). Do NOT mock module internals
or spy on logger.
- New data source: implement
DataSourceinsrc/sources/, register insrc/sources/registry.ts, add tests intest/sources/. - Change default model or token budget: edit
src/config/defaults.ts(single source of truth). - Change
ghallowlist: editsrc/sources/gh-allowlist.tsand add a test case.
- TypeScript strict mode +
verbatimModuleSyntax. Useimport typefor type-only imports. - All local imports use
.tsextensions (required byallowImportingTsExtensions). - Single shared
loggerfromsrc/config/logger.ts— taggedconsolainstance.