v0.7.0 — token-burn: Eliminate redundant Reads of design docs by SWE — pass doc body inline
## Problem The `feedback_big_spec_doc_reference` doctrine says: when spec_body would exceed `SPEC_BODY_MAX_BYTES`, write the design to `TMB/docs/<topic>_<issue>.md` and reference the absolute path from spec. This keeps the MCP `spec_body` field small — but the SWE then `Read`s the full doc into context at spawn-time anyway. Net token cost is identical; only the storage location changes. Worse, the doc lives in `TMB/docs/` (outside `plugin/`), so the SWE Reads from a path the worktree doesn't include — requiring absolute paths and sometimes triggering CC's path-policy guards. ## Evidence (verified against live source + v0.6.0 release history) - `SPEC_BODY_MAX_BYTES` is defined in `mcp/trajectory-server/src/tools/tasks.ts` (referenced from `composites.ts:11`). Configurable via `TMB_SPEC_BODY_MAX_BYTES`. - v0.6.0 release artifacts: - `TMB/docs/pr-reviewer-stack-fix_2899-2900.md` — referenced from !188 spec - `TMB/docs/bug-capture-lints_2902.md` — referenced from !189 spec - `TMB/docs/docs-drift_2893.md` — referenced from !184 spec - `TMB/docs/prompts-broken-refs_2892.md` — referenced from !185 spec - Each adds a ~3–8 KB Read at SWE spawn. ## Plan 1. **Add `spec_doc_path` + `spec_doc_content_inlined` fields** to `task_create_batch`: - `spec_doc_path` (string): absolute path the server reads at create-time - Server inlines the content into the task row's effective spec (server-stored, not duplicated in spec_body) 2. **At SWE spawn**, server injects the doc content as a separate tool message (visible at start of spawn, like CC's tool results). SWE doesn't need to Read it. 3. **Lint** `tests/lint/no-spec-body-doc-read-instruction.sh` — forbid spec_body strings containing `Read /Users/.../TMB/docs/` patterns; they should use `spec_doc_path` instead. 4. **Update `feedback_big_spec_doc_reference`** memory (user-level) to reflect the new pattern: use `spec_doc_path`, not "tell SWE to Read the path." ## Acceptance criteria - New L4 test: `task_create_batch` with `spec_doc_path` succeeds; the spawned SWE receives the doc body without needing to Read it. - L1 lint catches `Read /Users/` patterns in spec_body strings stored in the DB. - Mean SWE startup Reads (per spawn) drop by ≥1. ## Out of scope - Versioning of spec docs. - Inlining external URLs. ## Coordination - Pairs with #2911 (SWE worktree over-reads) — both reduce SWE startup Reads. ## Note on source Verified `TMB/docs/<topic>_<issue>.md` files exist for the 4 cited v0.6.0 specs. Verified `SPEC_BODY_MAX_BYTES` lives in `tools/tasks.ts`. Verified `composites.ts:11` imports it.
issue