What this is: A local-first VS Code extension that turns a monorepo or multi-repo workspace of React / Vue / Flutter / Django / FastAPI / Firebase Functions / Node.js projects into actionable test-quality intelligence — test inventory, coverage, weak/ghost tests, source risk, changed-file risk, and an optional LLM-driven investigation drilldown. Open source, public VS Code Marketplace as the distribution target.
You are an AI agent reading this file (Codex CLI / OpenAI Agents). All mandatory protocols below apply to you exactly as they apply to Claude Code and Gemini CLI.
TypeScript 5.4 (strict) · @types/vscode ^1.90 · Node 20 runtime · tsc build (no bundler yet — open decision #1) · node --test runner · OpenAI-compatible HTTPS endpoint for the optional LLM layer (key in VS Code SecretStorage).
Single repo. The product itself operates across multi-repo and monorepo workspaces, but this source tree is one repo.
src/
├── extension.ts entry, command registration, DI wiring (OVERSIZED — split target)
├── models.ts shared TS types
├── adapters/ framework adapters (react, flutter, python, firebase, shared)
├── services/ coverage, quality, risk, runner, investigator, llm, state, …
├── views/ TreeDataProviders + Webview Dashboard / Investigation (dashboard.ts OVERSIZED)
└── utils/ fs, path, xml helpers
test/
├── fixtures/<stack>/ per-stack sample workspaces
└── unit/ node --test specs
- Adapter pattern is sacred. Core never branches on framework. New stack = new adapter file + registry entry, not edits to
extension.ts/ services. - All scoring is deterministic. Coverage → quality → risk → changed-file → investigation are pure functions. The optional LLM enriches but never alters scores.
- Local-first or it doesn't ship. Every core feature works with no LLM key. The LLM is strictly additive.
- Dashboard is a Webview for KPIs, charts, filters, drilldowns. Tree views are sidebar entry points only.
package.jsoncontributes is the public contract. Every command incontributes.commands+activationEvents+ registered inextension.ts. Settings undertestInspector.*.
See .platform/workflow.md for the 6-stage inline workflow (Triage → Interview → Research → Propose → Execute → Verify) and the mandatory new-stream / checkpoint / handoff / closure rituals.
Session start (every session — mandatory):
- Run
ab brieffirst — compact state-of-project view. - Read
.platform/work/BRIEF.mdthen.platform/work/ACTIVE.md. - Resuming a stream? Run
ab handoff <slug>for the previous agent's Resume state.
Context handoff (before ending or switching providers — mandatory):
ab checkpoint <slug> --what "<what just happened>" --next "<one sentence next>" \
--cumulative-in <N> --cumulative-out <N> --provider codex --model <id>Reasoning annotation (after significant edits — mandatory):
ab log-reason [<file>] "<one sentence why>"Stream closure (mandatory harvest ritual):
ab close <slug> # step 1 — print harvest checklist; distill into memory/
ab close <slug> --confirm # step 2 — archive after closure_approved: trueLong session fallback: ab watch & polls git status every 10 min and auto-checkpoints — the closest equivalent to Claude Code's hooks. Stop with ab watch --stop.
Non-trivial task? Register in ACTIVE.md → create / update .platform/domains/<name>.md → create work/<slug>.md → worktree from develop (or master only for explicit hotfix) → research → propose → execute. Trivial single-file fixes are the only exception.
Stream closure — Only the human declares a stream complete. Verify closure_approved: true in the stream file before archiving. Enforced by a git pre-commit hook on all CLIs.
Load only what the current task touches. Never auto-load work/archive/*, memory/learnings.md, or memory/BACKLOG.md. Use ab search <keywords> before loading any domain or convention file in full.
.platform/STATUS.md— current priorities, release blocklist, file-size violations, pinned gotchas.platform/architecture.md— components, data flow, invariants, architectural debt.platform/repos.md— single-repo layout, specialist routing, hard repo rules.platform/memory/decisions.md— 10 locked decisions + 8 deferred (with revisit triggers).platform/memory/log.md— append-only session log.platform/domains/— adapters, test-discovery, coverage, quality, risk-scoring, changed-files, investigation, llm, runner, dashboard, reports.platform/conventions/— security, testing, qa, api, deployment, typescript, vscode-extension.platform/workflow.md— the 6-stage protocolROADMAP.md— phased backlog (Phase 1–12)test-inspector-extension-prompt.md— original product brief
- Adapter isolation. Core never branches on framework. New framework = new adapter.
- Safe command execution.
execFile/spawnwith arg arrays only. Noexec, noshell: true, noexecSync. Confirmation required for expensive commands. Refuse to spawn in untrusted workspaces. - Local-first / LLM optional. Every core feature works without an LLM key.
- Never mutate source. Read, score, report — don't edit user files.
- Secrets stay in VS Code SecretStorage. Never
settings.json, env, logs, or reports. - No invented coverage commands. Surface a setup blocker instead of guessing.
- 300-line file size cap.
extension.tsandviews/dashboard.tsviolate this; split before adding. - Webview XSS-safe by construction. HTML-escape helper, strict CSP,
command:URIs only. - Only the human declares a stream complete.
closure_approved: truerequired before archiving.