Standardize on the .agents/ directory (shared with project skills): phases/, user_stories/, reports/, screenshots/, validate.sh, and phase-sessions/ + pipeline.log all move to .agents/ (git mv preserves history; runtime artifacts move alongside). Updates every reference in AGENTS.md, README.md, .gitignore, app docstrings, and test story headers. Historical KB content in data/ and the runtime pipeline.log transcript are left untouched.
2.3 KiB
2.3 KiB
Task 03 — TOOLS_SECTION Copy: State the Contract Up Front
Phase: 72_teaching_refusals · Story: .agents/user_stories/agent-document-tools.md
Objective
The HIGH prompt's <tools> section says the same two things the new refusals teach —
the ls path is a source name, not a directory or file path, and read/grep
need the combined source/path string including the source name — so the model
carries the contract before it calls a tool, not only after being refused.
Work
app/rag/prompts.py—TOOLS_SECTIONrewritten (the E2E mock keys off the<tools>marker's presence, not this wording, so the change is mock-safe):lsclause: its optionalpathargument is a source name (e.g.'homelab') — not a directory or file path; omit it to list every document.readclause: the combinedsource/pathstring, exactly as shown in thelsoutput — including the source name; a bare document path will not resolve.grepclause: the locator copy stays (itspathis already described as a combinedsource/pathstring); add the same bare-path-will-not-resolve note.- Keep the section's shape: a single paragraph between
<tools>and</tools>, still appended after the mode body in the HIGH prompt only (the LOW/deflection prompt never carries it — phase 71's plain-text line stays put).
tests/unit/test_prompts.py— update theTOOLS_SECTIONwording pin(s) where they pin the old wording; the<tools>-marker-present-in-HIGH pin, the marker-absent-from-LOW pin, and the byte-identical-LOW-prompt pin stay green as-is.
Testing & Quality
- Unit:
tests/unit/test_prompts.py— marker present in the HIGH prompt and absent from the LOW prompt; the LOW prompt byte-identical to today; the new wording pinned for thelssource-name clause and the read combined-identity clause. - Coverage: >90% on this task's modified code (the constant itself — the builders are already covered).
Completion Criteria
uv run pytest tests/unit/test_prompts.py -v --no-covgreen- The HIGH prompt still ends with the
<tools>section (existing section-order pin green); the LOW/deflection prompt is byte-identical to today uv run ruff check . && uv run pyrightclean