refactor(agents): migrate .agent/ planning tree to .agents/

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.
This commit is contained in:
2026-09-05 10:57:07 -04:00
parent 766702c750
commit dbf2af26c6
1118 changed files with 664 additions and 664 deletions
@@ -0,0 +1,38 @@
# 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
1. `app/rag/prompts.py` — `TOOLS_SECTION` rewritten (the E2E mock keys off the
`<tools>` marker's *presence*, not this wording, so the change is mock-safe):
- `ls` clause: its optional `path` argument is a *source name* (e.g. `'homelab'`)
— **not** a directory or file path; omit it to list every document.
- `read` clause: the combined `source/path` string, exactly as shown in the `ls`
output — *including the source name*; a bare document path will not resolve.
- `grep` clause: the locator copy stays (its `path` is already described as a
combined `source/path` string); 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).
2. `tests/unit/test_prompts.py` — update the `TOOLS_SECTION` wording 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 the `ls` source-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-cov` green
- [ ] 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 pyright` clean