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,21 @@
`NOTES.md` is the owner's own notes file (source for later phases) — untracked, out of scope, left as-is. All verification is complete; every gate is green.
**Phase 43 — Thinking scroll back: final verification pass — ALL GREEN**
- Verified (no code changes needed): CSS contract (`overflow-y: auto`, `max-height: 320px`, owner-direction 2026-08-27 comment), gated pin (`export const THINKING_NEAR_BOTTOM_PX = 32` + `isThinkingNearBottom`, `if (block.open && isThinkingNearBottom(textEl))`), unit pin swap, phase commit `27b7cb9` (unsigned, includes both deletions + both new test files)
- `uv run pytest --cov=app --cov-report=term-missing` → 725 passed, TOTAL 99% (>90%, unchanged)
- `uv run ruff check . && uv run pyright` → All checks passed / 0 errors
- `uv run pytest tests/e2e/test_thinking_scroll.py -v --no-cov` → 7 passed in isolation (DB up)
- Regressions (isolated runs): `test_thinking_display` 5 passed, `test_chat_persistence` 4 passed, `test_no_reply_autoscroll` 5 passed, `test_smoke` 3 passed
Completion criteria:
1. Window user-scrollable + CSS computed values — ✅ (E2E tests 1 & 5)
2. Pinned follow / pause on scroll-up / resume on return (±1px) — ✅ (E2E tests 2–4)
3. Auto-collapse, reduced-motion, answer-bubble scroll, restored-collapsed block unchanged — ✅ (E2E 6–7 + `test_thinking_display` regression)
4. Full pytest green, coverage TOTAL unchanged (99%) — ✅
5. Phase E2E green in isolation — ✅
6. Four regression E2E suites green in isolation — ✅
7. ruff + pyright clean — ✅
8. One `--no-gpg-sign` commit; task files in `complete/` — ✅ (`00_phase.md` move left to harness)
Deviations: none. Next pending phase: `44_markdown_tables`.
@@ -0,0 +1,60 @@
........................................................................ [ 9%]
........................................................................ [ 19%]
........................................................................ [ 29%]
........................................................................ [ 39%]
........................................................................ [ 49%]
........................................................................ [ 59%]
........................................................................ [ 69%]
........................................................................ [ 79%]
........................................................................ [ 89%]
........................................................................ [ 99%]
..... [100%]
=============================== warnings summary ===============================
.venv/lib/python3.13/site-packages/fastapi/testclient.py:1
/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.13.13-final-0 _______________
Name Stmts Miss Cover
--------------------------------------------
app/__init__.py 1 0 100%
app/api/__init__.py 0 0 100%
app/api/auth.py 22 0 100%
app/api/chat.py 122 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 66 0 100%
app/api/health.py 10 0 100%
app/api/steering.py 42 0 100%
app/api/suggestions.py 8 0 100%
app/api/sync.py 81 0 100%
app/config.py 66 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 92 0 100%
app/core/debugging.py 29 2 93%
app/core/logging.py 13 0 100%
app/db.py 21 0 100%
app/main.py 44 0 100%
app/models.py 60 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 81 0 100%
app/rag/chunker.py 206 4 98%
app/rag/git_sources.py 14 0 100%
app/rag/importer.py 173 3 98%
app/rag/llm.py 186 0 100%
app/rag/overview.py 71 0 100%
app/rag/prompts.py 65 0 100%
app/rag/retriever.py 94 3 97%
app/rag/suggestions.py 27 0 100%
app/rag/summarizer.py 24 0 100%
app/schemas.py 99 0 100%
--------------------------------------------
TOTAL 1767 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,12 @@
All references remaining are in `.agents/` planning/history files (untouchable by design). Task 01 complete — no commit, since task 03 is the phase's commit task.
**Task 01 report — Thinking window user-scrollable again (CSS + unit pin swap)**
- `frontend/assets/styles.css`: `.thinking-text` rule `overflow-y: hidden` → `auto`; phase-21 comment replaced with the owner-direction comment (2026-08-27, `TODO.md` L7); `max-height: 320px` and all other declarations byte-identical (verified via diff).
- Deleted `tests/unit/test_thinking_no_scroll.py` + `tests/e2e/test_thinking_no_scroll.py` (reversed behavior; task 03 lands the E2E replacement).
- New `tests/unit/test_thinking_scroll.py`: pins `overflow-y: auto` + 320px clip + owner-direction comment, absence of `hidden`/`scroll`, and the surviving phase-17 pin marker in `app.js` (no JS-gate pins yet — task 02).
- Fixed stale defect: `tests/unit/test_chat_persistence.py` pinned the reversed phase-21 `overflow-y: hidden` — updated to the phase-43 contract (docstring + asserts).
- Deviation note: task-quoted comment's markdown backticks around `TODO.md` broke the required `"TODO.md L7"` pin; written backtick-free to match the phase-42 house style and satisfy the assertion.
- `uv run pytest` → 722 passed; `uv run pytest --cov=app --cov-report=term` → TOTAL 99% (>90%, unchanged, frontend-only).
- `uv run ruff check .` → All checks passed!; `uv run pyright` → 0 errors.
- Next pending task: `43_thinking_scroll_back/02_gated_bottom_pin.md` (then task 03: E2E replacement + commit).
@@ -0,0 +1,60 @@
........................................................................ [ 9%]
........................................................................ [ 19%]
........................................................................ [ 29%]
........................................................................ [ 39%]
........................................................................ [ 49%]
........................................................................ [ 59%]
........................................................................ [ 69%]
........................................................................ [ 79%]
........................................................................ [ 89%]
........................................................................ [ 99%]
.. [100%]
=============================== warnings summary ===============================
.venv/lib/python3.13/site-packages/fastapi/testclient.py:1
/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.13.13-final-0 _______________
Name Stmts Miss Cover
--------------------------------------------
app/__init__.py 1 0 100%
app/api/__init__.py 0 0 100%
app/api/auth.py 22 0 100%
app/api/chat.py 122 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 66 0 100%
app/api/health.py 10 0 100%
app/api/steering.py 42 0 100%
app/api/suggestions.py 8 0 100%
app/api/sync.py 81 0 100%
app/config.py 66 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 92 0 100%
app/core/debugging.py 29 2 93%
app/core/logging.py 13 0 100%
app/db.py 21 0 100%
app/main.py 44 0 100%
app/models.py 60 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 81 0 100%
app/rag/chunker.py 206 4 98%
app/rag/git_sources.py 14 0 100%
app/rag/importer.py 173 3 98%
app/rag/llm.py 186 0 100%
app/rag/overview.py 71 0 100%
app/rag/prompts.py 65 0 100%
app/rag/retriever.py 94 3 97%
app/rag/suggestions.py 27 0 100%
app/rag/summarizer.py 24 0 100%
app/schemas.py 99 0 100%
--------------------------------------------
TOTAL 1767 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,12 @@
**Task 02 — Gated bottom pin: complete**
- `frontend/assets/app.js`: added `export const THINKING_NEAR_BOTTOM_PX = 32` + `isThinkingNearBottom(textEl)` (`scrollHeight - scrollTop - clientHeight <= band`) next to the `SCROLL` constant, with the owner-direction comment block; replaced the phase-17 pin with `if (block.open && isThinkingNearBottom(textEl))` in the `thinking` SSE handler — rest of handler byte-identical.
- `tests/unit/test_thinking_scroll.py`: extended with JS pins — band export, gate math (regex), combined gate + pin-inside-gate + no unconditional `if (block.open)` left, and restore-path collapsed block (`block.open = false` in `renderStoredMessage`); kept surviving task-01 pin assertions (pin ×1, in thinking branch).
- Defect fixed in prior work: phase-42 `test_frontend_scroll.py::test_phase18_gate_is_gone` pinned `"NEAR_BOTTOM_PX" not in js` by raw substring, which the new `THINKING_NEAR_BOTTOM_PX` tripped — re-pinned with word-boundary regex (page-level constant absence is the phase-42 intent).
Results:
- `uv run pytest --cov=app --cov-report=term` → 725 passed; coverage TOTAL 99% (>90%, `app/` untouched)
- `uv run ruff check .` → clean; `uv run pyright` → 0 errors
- `node --check` on app.js → syntax OK
No deviations; no commit (task 03 owns the phase commit). Next pending: `43_thinking_scroll_back/03_thinking_scroll_e2e_and_commit.md`.
@@ -0,0 +1,60 @@
........................................................................ [ 9%]
........................................................................ [ 19%]
........................................................................ [ 29%]
........................................................................ [ 39%]
........................................................................ [ 49%]
........................................................................ [ 59%]
........................................................................ [ 69%]
........................................................................ [ 79%]
........................................................................ [ 89%]
........................................................................ [ 99%]
..... [100%]
=============================== warnings summary ===============================
.venv/lib/python3.13/site-packages/fastapi/testclient.py:1
/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.13.13-final-0 _______________
Name Stmts Miss Cover
--------------------------------------------
app/__init__.py 1 0 100%
app/api/__init__.py 0 0 100%
app/api/auth.py 22 0 100%
app/api/chat.py 122 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 66 0 100%
app/api/health.py 10 0 100%
app/api/steering.py 42 0 100%
app/api/suggestions.py 8 0 100%
app/api/sync.py 81 0 100%
app/config.py 66 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 92 0 100%
app/core/debugging.py 29 2 93%
app/core/logging.py 13 0 100%
app/db.py 21 0 100%
app/main.py 44 0 100%
app/models.py 60 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 81 0 100%
app/rag/chunker.py 206 4 98%
app/rag/git_sources.py 14 0 100%
app/rag/importer.py 173 3 98%
app/rag/llm.py 186 0 100%
app/rag/overview.py 71 0 100%
app/rag/prompts.py 65 0 100%
app/rag/retriever.py 94 3 97%
app/rag/suggestions.py 27 0 100%
app/rag/summarizer.py 24 0 100%
app/schemas.py 99 0 100%
--------------------------------------------
TOTAL 1767 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,14 @@
**Phase 43 task 03 complete** — all gates green, phase committed.
**Implemented**
- `tests/e2e/test_thinking_scroll.py` (new, mock-only, 7 tests): user-scroll on the frozen 4s-hesitation tail (wheel 1:1, click+Home keyboard, drag holds user position — headless Chromium overlay scrollbars aren't grabbable by synthetic mouse, documented in-suite), follow-while-pinned at chunk N-1/N (±1px) + last chunk visible, no re-pin over ≥5 mid-stream chunks after half-window scroll-up, re-pin on next chunk after return to bottom, CSS contract (`overflow-y: auto`, 320px, real clip), phase-11 long-answer and phase-17 restored-collapsed regressions.
- Fixed two mid-run issues: mid-stream waits now require ≥100px window headroom (first-overflow frame is only ~4px); phase-42 leaves the page at top, so the long-answer test scrolls the page to bottom (phase-18 convention) before wheel assertions.
**Results**
- `uv run pytest tests/e2e/test_thinking_scroll.py -v --no-cov` → 7/7 (ran twice, isolation)
- Regressions (isolation): `test_thinking_display` 5/5, `test_chat_persistence` 4/4, `test_no_reply_autoscroll` 5/5, `test_smoke` 3/3
- `uv run pytest` → 725 passed; `--cov=app` → TOTAL 99% (unchanged); `ruff check . && pyright` → clean
**Decisions**: programmatic `scrollTop` for tests 3/4 (phase-18 user-scroll-away convention); `tabindex=0`+click as keyboard scaffolding (div not focusable by design).
**Commit**: `27b7cb9 feat(chat): thinking window scrolls again, follows the tail only while pinned` — 8 files, includes both deleted phase-21 test files. Phase dir move left to the harness.
**Next pending**: phase 44 `44_markdown_tables` (task 01: table renderer and styles).
@@ -0,0 +1,60 @@
........................................................................ [ 9%]
........................................................................ [ 19%]
........................................................................ [ 29%]
........................................................................ [ 39%]
........................................................................ [ 49%]
........................................................................ [ 59%]
........................................................................ [ 69%]
........................................................................ [ 79%]
........................................................................ [ 89%]
........................................................................ [ 99%]
..... [100%]
=============================== warnings summary ===============================
.venv/lib/python3.13/site-packages/fastapi/testclient.py:1
/var/home/ducoterra/Projects/Personal/brain_of_reese/.venv/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.13.13-final-0 _______________
Name Stmts Miss Cover
--------------------------------------------
app/__init__.py 1 0 100%
app/api/__init__.py 0 0 100%
app/api/auth.py 22 0 100%
app/api/chat.py 122 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 66 0 100%
app/api/health.py 10 0 100%
app/api/steering.py 42 0 100%
app/api/suggestions.py 8 0 100%
app/api/sync.py 81 0 100%
app/config.py 66 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 92 0 100%
app/core/debugging.py 29 2 93%
app/core/logging.py 13 0 100%
app/db.py 21 0 100%
app/main.py 44 0 100%
app/models.py 60 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 81 0 100%
app/rag/chunker.py 206 4 98%
app/rag/git_sources.py 14 0 100%
app/rag/importer.py 173 3 98%
app/rag/llm.py 186 0 100%
app/rag/overview.py 71 0 100%
app/rag/prompts.py 65 0 100%
app/rag/retriever.py 94 3 97%
app/rag/suggestions.py 27 0 100%
app/rag/summarizer.py 24 0 100%
app/schemas.py 99 0 100%
--------------------------------------------
TOTAL 1767 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK