chore(agent): track .agent/ planning tree in git
Build and Push Containers / build-and-push-app (push) Successful in 12s
Build and Push Containers / build-and-push-db (push) Successful in 10s

Remove the blanket .agent/ gitignore so the phase roadmap, user
stories, reports, and PLAN.md are versioned with the code. Only
runtime artifacts (.agent/phase-sessions/, .agent/pipeline.log)
remain ignored. Update AGENTS.md git protocol rule to match.
This commit is contained in:
2026-09-01 10:18:22 -04:00
parent 5fa620fde5
commit 4971e2859d
818 changed files with 23964 additions and 4 deletions
@@ -0,0 +1,13 @@
All verification complete. Every criterion checks out — this was a verification pass (both tasks already done and committed).
**Phase 20 — Sources Mid-Stream: final verification pass — all green**
- Verified `app.js` `pagehide` handler: in-flight guard (`thinking`/`streaming` + non-empty `acc`), reuses `rememberBrainTurn(acc, { thinking: thinkingAcc || undefined })`, turn-scoped idempotency flag `persistedOnLeave` (module-scope hoist of `acc`/`thinkingAcc`, reset per turn in `handleSend`); persistence comment lists the 3rd save point; `clearChatStorage` untouched
- Tests/lint/coverage: `uv run pytest --cov=app --cov-report=term-missing` → **315 passed, 99% app coverage** (≥90% gate, unchanged — frontend-only); `uv run ruff check . && uv run pyright` → clean (0 errors)
- E2E story suite (isolated, db up): `uv run pytest tests/e2e/test_sources_midstream_bug.py -v --no-cov` → **4/4 passed** (8.5s)
- Regressions (isolated): `test_chat_persistence.py` 4/4, `test_thinking_display.py` 5/5, `test_shared_header.py` 6/6 — all green
- Criteria: mid-stream Sources nav → question + partial rendered, no alert, `bor.chat.v1` holds partial ✅ · pre-token nav → question only, zero brain bubbles ✅ · completed turn sources/deflection/suggestions intact ✅ · New Chat from sources clears ✅ · story file `.agent/user_stories/sources-midstream.md` exists ✅
- UI Structure Check ✅ — no new surface; partial renders through existing bubble/thinking contract (app.js logic-only diff)
- Commit ✅ — `76c6a01` "fix(chat): keep the in-flight answer when navigating away mid-turn" (`--no-gpg-sign`); tasks 01/02 in `complete/`; `00_phase.md` left in `todo/` for the harness to move
- Deviations: none. Pending tree entry `D …/todo/20_sources_midstream_bug/02_…md` is the harness's task-file move (tracked-file deletion), untouched per protocol
- Next pending phase: `21_thinking_no_scroll`
@@ -0,0 +1,46 @@
........................................................................ [ 22%]
........................................................................ [ 45%]
........................................................................ [ 68%]
........................................................................ [ 91%]
........................... [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 95 0 100%
app/api/docs.py 23 0 100%
app/api/health.py 10 0 100%
app/api/steering.py 33 0 100%
app/api/suggestions.py 8 0 100%
app/config.py 56 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 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 36 0 100%
app/models.py 46 0 100%
app/rag/__init__.py 0 0 100%
app/rag/chunker.py 206 4 98%
app/rag/importer.py 150 5 97%
app/rag/llm.py 105 0 100%
app/rag/prompts.py 44 0 100%
app/rag/retriever.py 102 3 97%
app/rag/suggestions.py 27 0 100%
app/schemas.py 62 0 100%
--------------------------------------------
TOTAL 1109 14 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,17 @@
Task 01 complete. Report:
**Implemented**
- `frontend/assets/app.js`: one new `pagehide` save point — in-flight guard (`uiState` = thinking/streaming) + non-empty `acc`, persists the partial via the existing `rememberBrainTurn(acc, { thinking: thinkingAcc || undefined })`; turn-local `persistedOnLeave` idempotency flag (module-scope hoist of `acc`/`thinkingAcc`, reset per turn at the top of `handleSend`, zero behavior change)
- Persistence block comment now lists all three save points (send / done / navigate-away)
- New `tests/unit/test_sources_midstream.py` — 6 source-level pins (single listener, guard order, helper reuse with no duplicated storage code, flag scoping/reset, comment, `clearChatStorage` still the only deliberate literal-key clear)
**Results**
- `uv run pytest tests/unit/test_sources_midstream.py -v` → 6 passed
- `uv run pytest` → 315 passed (existing persistence pins untouched and green)
- `uv run pytest --cov=app --cov-report=term-missing` → TOTAL 99% (gate >90%, unchanged — frontend-only)
- `uv run ruff check .` → All checks passed; `uv run pyright` → 0 errors; `node --check` on app.js → syntax OK
**Decisions**
- Task file names the turn function `runTurn`; the actual one is `handleSend` — pinned against the real name (task allows matching names actually in scope). No commit made — the atomic commit + phase move belong to task 02.
**Next pending task:** `02_e2e_story_suite_commit.md` (E2E suite, regressions, story file, commit, phase move)
@@ -0,0 +1,46 @@
........................................................................ [ 22%]
........................................................................ [ 45%]
........................................................................ [ 68%]
........................................................................ [ 91%]
........................... [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 95 0 100%
app/api/docs.py 23 0 100%
app/api/health.py 10 0 100%
app/api/steering.py 33 0 100%
app/api/suggestions.py 8 0 100%
app/config.py 56 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 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 36 0 100%
app/models.py 46 0 100%
app/rag/__init__.py 0 0 100%
app/rag/chunker.py 206 4 98%
app/rag/importer.py 150 5 97%
app/rag/llm.py 105 0 100%
app/rag/prompts.py 44 0 100%
app/rag/retriever.py 102 3 97%
app/rag/suggestions.py 27 0 100%
app/schemas.py 62 0 100%
--------------------------------------------
TOTAL 1109 14 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,11 @@
All green. Final state verified — report:
**Phase 20 task 02 complete — all gates green**
- Implemented: `tests/e2e/test_sources_midstream_bug.py` (4 scenarios: mid-stream Sources-nav restores partial answer; pure-thinking nav persists nothing brain-side; completed turn byte-identical; sources-page New Chat still clears) + additive mock trigger `think out loud then hesitate` (4s pre-content pause; byte-identical for all other suites) + `.agent/user_stories/sources-midstream.md`
- `uv run pytest tests/e2e/test_sources_midstream_bug.py -v --no-cov` → 4/4 in isolation
- Regressions, isolated: `test_chat_persistence.py` 4/4 · `test_thinking_display.py` 5/5 · `test_shared_header.py` 6/6 (extra safety: long_answers+loading_feedback+honest_deflection 10/10)
- `uv run pytest --cov=app --cov-report=term-missing` → 315 passed, **99%** (baseline held, no `app/` changes); `uv run ruff check . && uv run pyright` → clean, 0 errors
- UI Structure Check: no new surface/ids — partial restores through the existing bubble/thinking contract (pinned in E2E: no thinking block, no chips, no `role=alert`)
- Commit `76c6a01` (task's exact message, `--no-gpg-sign`, 5 files): app.js pagehide save point (task 01) + unit pins + mock + E2E + story-file deletion record
- Deviations: literal `git add -A .agent/` is git-rejected (ignored path) — equivalent staging done; new `.agent` plan files stay untracked/ignored per post-`076358d` repo precedent; phase-dir move left to the harness (task 01 was already harness-moved); E2E scenario 1 doubles as task 01's browser-level smoke
- Next pending task: `.agent/phases/todo/21_thinking_no_scroll/01_disable_thinking_scroll.md`
@@ -0,0 +1,46 @@
........................................................................ [ 22%]
........................................................................ [ 45%]
........................................................................ [ 68%]
........................................................................ [ 91%]
........................... [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 95 0 100%
app/api/docs.py 23 0 100%
app/api/health.py 10 0 100%
app/api/steering.py 33 0 100%
app/api/suggestions.py 8 0 100%
app/config.py 56 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 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 36 0 100%
app/models.py 46 0 100%
app/rag/__init__.py 0 0 100%
app/rag/chunker.py 206 4 98%
app/rag/importer.py 150 5 97%
app/rag/llm.py 105 0 100%
app/rag/prompts.py 44 0 100%
app/rag/retriever.py 102 3 97%
app/rag/suggestions.py 27 0 100%
app/schemas.py 62 0 100%
--------------------------------------------
TOTAL 1109 14 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK