Fix the failing init-project-doc tests and the context usage issues.
- User
Fix the failing init-project-doc tests and the context usage issues.
Assistant
I'll fix the init-project-doc tests and the context issues.
Assistant
TDD for the project-doc initializer — a deterministic workspace scan that writes a starter AGENTS.md.
Assistant
detectProjectBootstrapsynthesizesnpm testrather than using the real script value. Reading the actualpackage.jsonscripts is more accurate — let me do that inbuildProjectDoc.Assistant
Now the context-usage estimator — token breakdown by component.
Assistant
iterationToolsisn't in scope yet at that point — usingresolveTools()directly.Assistant
Now register the init tool in the session, add exports, and add the
/contextTUI command.Assistant
Now add the
contextWindowTokens()helper near the top of App and pass it to the loop.Assistant
Also wire it into exec. Let me add the same to the exec loop call.
Assistant
Now a loop test for the context-fill nudge, then the full gate.
Assistant
All green — 1170 tests. Let me verify the init tool live and check the sourcemap once more for any final quick win, then document + commit.
Assistant
Round complete and pushed (): . I verified live against this repo (it correctly surfaced the real and build scripts). HF credits remain depleted, so this was offline harness work. What I re-mined from the sourcemap