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,12 @@
All verification complete. Final report:
**Phase 51 (share_chat) — final verification pass, all green. No code changes needed; repo left untouched.**
- Verified (tasks 01–04 all pre-completed in `complete/`): migration `0009 (head)` applied; share/unshare/public-read API; `/shared/<token>` page route; middleware prefix; Share button + History share column; `shared.html`/`shared.js` read-only page.
- `uv run pytest` → **1010 passed**; `--cov=app` → **TOTAL 99%** (>90%); `uv run ruff check . && uv run pyright` → **clean, 0 errors**.
- `uv run pytest tests/e2e/test_share_chat.py -v --no-cov` → **4/4 passed** in isolation (DB up).
- Regressions in isolation: `test_chat_history` 5/5, `test_chat_persistence` 4/4, `test_smoke` 3/3, `test_cache_busting` 4/4 — all green.
- Live server pass: create-with-share 201 + uuid token shape; idempotent share/unshare; `updated_at` untouched by both; anonymous read = `title`+`messages` only (no id/timestamps/token); page carries `Cache-Control: no-cache` + `?v=114b115` rewrites; zero control markup; unshare revokes (API 404 "unknown or revoked share link", page invalid state); anonymous share denied 403; unknown-id 404s. Test rows cleaned up, verification server stopped.
- Completion criteria 1–8: **all met** (live/E2E evidence above; commit `114b115` with the prescribed message exists; task files in `complete/`, overview move left to the harness).
- Notable: `/shared/<non-uuid>` → 422 (house uuid-path contract, pinned in tests); revoked/wrong valid-UUID tokens serve the page shell with the invalid state rendered client-side — exactly as the task specs define. Working-tree `TODO.md` carries two owner backlog items added after the commit — out of scope, left uncommitted.
- Next pending phase: **none** — `todo/` contains only this phase.
@@ -0,0 +1,66 @@
........................................................................ [ 7%]
........................................................................ [ 14%]
........................................................................ [ 21%]
........................................................................ [ 28%]
........................................................................ [ 35%]
........................................................................ [ 42%]
........................................................................ [ 49%]
........................................................................ [ 57%]
........................................................................ [ 64%]
........................................................................ [ 71%]
........................................................................ [ 78%]
........................................................................ [ 85%]
........................................................................ [ 92%]
........................................................................ [ 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 131 0 100%
app/api/chats.py 105 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 143 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 79 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 93 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 50 0 100%
app/models.py 68 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 78 0 100%
app/rag/archive_upload.py 128 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 189 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 165 0 100%
-----------------------------------------------
TOTAL 2180 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,20 @@
All gates green. Task 01 is complete and verified.
**Implemented** (task 01 — present in tree from a prior partial run; I audited every requirement, fixed a broken dev DB, and re-verified all gates):
- Migration `0009_saved_chat_share_token` (nullable unique `share_token` + index, reversible) + `SavedChat.share_token` model column
- `POST /api/chats/<id>/share|unshare` (admin, idempotent, raw-SQL token write so `updated_at` is never bumped), `GET /api/shared/<token>` public read (`SharedChatOut` snapshot — no id/timestamps/token; one 404 detail for wrong *or* revoked)
- `GET /shared/<token>` page route ahead of the static mount (stale-deploy guard: same 404 JSON, never 500); caching middleware treats `/shared/` prefix as a known HTML page (no-cache + `?v=` rewrite)
- Tests: share/unshare/public-read contract incl. `updated_at` pin (test_chats_api.py), migration 0009 round-trip + NULLs-distinct, middleware prefix pins (test_caching.py)
**Results**
- `uv run pytest --cov=app --cov-report=term-missing` → 976 passed, TOTAL **99%** (>90%)
- `uv run pytest tests/integration/test_chats_api.py tests/integration/test_migration_0009.py tests/unit/test_caching.py -v --no-cov` → 73 passed
- `uv run ruff check . && uv run pyright` → clean (0 errors)
- `uv run alembic upgrade head` → at `0009 (head)`
**Notable**
- Repaired the dev DB: `documents`/`chunks` had ~1590 dead `pg_attribute` slots (1600-col limit, stuck at 0003, zero rows) — dropped/recreated the empty DB and re-applied migrations.
- Unrelated uncommitted `TODO.md` edit (two new owner items) left untouched — not part of this task, and the phase commit (task 04) doesn't include it.
- Task 01 defines no commit; the phase commit belongs to task 04.
**Next pending task:** `.agents/phases/todo/51_share_chat/02_share_ui.md`
@@ -0,0 +1,65 @@
........................................................................ [ 7%]
........................................................................ [ 14%]
........................................................................ [ 22%]
........................................................................ [ 29%]
........................................................................ [ 36%]
........................................................................ [ 44%]
........................................................................ [ 51%]
........................................................................ [ 59%]
........................................................................ [ 66%]
........................................................................ [ 73%]
........................................................................ [ 81%]
........................................................................ [ 88%]
........................................................................ [ 95%]
........................................ [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 131 0 100%
app/api/chats.py 101 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 143 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 79 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 93 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 50 0 100%
app/models.py 68 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 78 0 100%
app/rag/archive_upload.py 128 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 189 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 151 0 100%
-----------------------------------------------
TOTAL 2162 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,21 @@
All green. Final state verified.
## Report
**Implemented (task 02 — Share button + History share column):**
- **Server:** `SavedChatCreate.share: bool = False`; create-with-share sets `share_token = uuid.uuid4()` in the same INSERT/commit (201 carries `share_url`); `SavedChatOut`/`SavedChatRow` gain `share_url` — `None` → key *absent* via a top-level-only `mode="wrap"` model serializer (route-level `exclude_none` would recursively drop nested `ChatMessage` nulls and break the phase-50 byte-identical round-trip pins).
- **Chat UI:** `#share-chat-btn` (exact `.save-chat-btn` pill family, ships hidden, revealed for admin in the same boot block); `shareCurrentChat()` — Save's no-op guard; linked → `POST /api/chats/<id>/share`, unlinked → `POST /api/chats {messages, share:true}` + links `currentChatId` (save-then-share in one action); copies the absolute URL via clipboard try, rejection → transient `.share-link-fallback` `<a>` (select-on-focus) near the status line; live region "Share link copied." / "Share link ready — copy it from the field."; actionable banners; finally-released double-click guard.
- **History UI:** Share column between Updated and Actions; three states (Create link / Copy+Unshare / "Unshare? [Yes] [No]" two-step reusing the phase-50 `.history-confirm-*` CSS); per-page duplicated ~10-line clipboard helper (house style, no new shared module); cell re-renders + live region on every outcome; colspan 4→5.
- **CSS:** `.share-chat-btn` (+ mobile mirror), Tune/Retry-family ghost `.history-share-*`/`.history-unshare` (≥44px), input-like `.share-link-fallback`.
- **Tests:** 6 new integration tests (token shape + immediate public readability, absent-key shapes for create/get/list, unshare-drops-key) + 9 new unit source pins; updated the table-skeleton pin (5 columns).
**Validation:**
- `uv run pytest` → 991 passed
- `uv run pytest --cov=app --cov-report=term-missing` → TOTAL **99%** (chats.py 100%, schemas.py 100%)
- `uv run ruff check .` clean; `uv run pyright` → 0 errors
- E2E regressions in isolation: `test_chat_history` 5, `test_cache_busting` 3, `test_shared_header` 6, `test_nav_consistency` 6, `test_chat_persistence` 4, `test_smoke` 3, `test_header_consistency` 3 — all green
- Throwaway browser check (since removed): all 8 share paths verified, incl. clipboard-rejection fallback + anonymous absence
**Decisions:** wrap-serializer for the omit-when-null rule (see above); fallback `<a>` stays a real link (click = guest view); no commit — the phase commit belongs to task 04.
**Next pending task:** `.agents/phases/todo/51_share_chat/03_shared_page.md` (shared.html + shared.js anonymous rendering).
@@ -0,0 +1,65 @@
........................................................................ [ 7%]
........................................................................ [ 14%]
........................................................................ [ 21%]
........................................................................ [ 29%]
........................................................................ [ 36%]
........................................................................ [ 43%]
........................................................................ [ 50%]
........................................................................ [ 58%]
........................................................................ [ 65%]
........................................................................ [ 72%]
........................................................................ [ 79%]
........................................................................ [ 87%]
........................................................................ [ 94%]
....................................................... [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 131 0 100%
app/api/chats.py 105 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 143 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 79 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 93 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 50 0 100%
app/models.py 68 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 78 0 100%
app/rag/archive_upload.py 128 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 189 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 165 0 100%
-----------------------------------------------
TOTAL 2180 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1 @@
(no final assistant message — see the .err log)
@@ -0,0 +1,65 @@
........................................................................ [ 7%]
........................................................................ [ 14%]
........................................................................ [ 22%]
........................................................................ [ 29%]
........................................................................ [ 36%]
........................................................................ [ 44%]
........................................................................ [ 51%]
........................................................................ [ 59%]
........................................................................ [ 66%]
........................................................................ [ 73%]
........................................................................ [ 81%]
........................................................................ [ 88%]
........................................................................ [ 95%]
........................................ [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 131 0 100%
app/api/chats.py 101 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 143 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 79 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 93 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 50 0 100%
app/models.py 68 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 78 0 100%
app/rag/archive_upload.py 128 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 189 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 151 0 100%
-----------------------------------------------
TOTAL 2162 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1 @@
(no final assistant message — see the .err log)
@@ -0,0 +1,65 @@
........................................................................ [ 7%]
........................................................................ [ 14%]
........................................................................ [ 22%]
........................................................................ [ 29%]
........................................................................ [ 36%]
........................................................................ [ 44%]
........................................................................ [ 51%]
........................................................................ [ 59%]
........................................................................ [ 66%]
........................................................................ [ 73%]
........................................................................ [ 81%]
........................................................................ [ 88%]
........................................................................ [ 95%]
........................................ [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 131 0 100%
app/api/chats.py 101 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 143 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 79 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 93 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 50 0 100%
app/models.py 68 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 78 0 100%
app/rag/archive_upload.py 128 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 189 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 151 0 100%
-----------------------------------------------
TOTAL 2162 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,17 @@
Task 03 complete. All gates green.
**Implemented**
- `frontend/shared.html` (new): anonymous read-only page — identical shared header (admin links ship hidden, sign-in `?next=/` app-root fallback with owner-locked comment, no current nav link), steering panel, `#shared-title` (fallback "Shared conversation"), `.shared-note`, `#shared-invalid` (hidden), `#messages`, footer; brand.js + markdown.js + shared.js with **absolute** `/assets/` paths (nested `/shared/<token>` route breaks relative refs); zero controls (no composer/modal/forms).
- `frontend/assets/shared.js` (new): token parse (malformed → invalid state, **no fetch of any kind**); `initSharedHeader()` → `GET /api/shared/<token>` (404/network/malformed → invalid state, no banner); `renderSharedMessage` mirrors the chat record shape read-only — thinking restored **collapsed**, tool lines, `is-deflected` + plain-SPAN "Maybe try" chips, plain-text source chips (no href), stopped note; global escape-first `renderMarkdown`; source-pinned zero interactive markup.
- `styles.css`: `.shared-shell` 46rem column (PLAN §7), `.shared-note`, `#shared-invalid` card, static-chip scope (`pointer-events:none`, `.shared-shell` only), ≤640px squeeze.
- `Containerfile`: shared.js bundle line + shared.html cp (auto-verified by the hermetic containerfile suite).
- Defect fixes found while testing: `/shared.html` added to `HTML_PAGES` (static-mount path lacked the no-cache+`?v=` contract — task-01 gap); `header.js` `?next=` rewrite now keeps the app root on `/shared/*` (owner-locked guest return, recorded in-module).
- `tests/unit/test_shared_page.py` (new, 13 source-pin tests) + page-enum updates in 6 existing test files.
**Results**
- `uv run pytest` → 1010 passed; `uv run pytest --cov=app --cov-report=term-missing` → TOTAL **99%** (>90%)
- `uv run ruff check .` → clean; `uv run pyright` → 0 errors
- Live browser verification (fresh anonymous Chromium): full conversation renders read-only (collapsed thinking, tool lines, plain chips, stopped note, no visible buttons/forms, admin nav hidden); wrong + revoked tokens show the invalid state; page + `/shared.html` carry no-cache + `?v=`; 375px: no overflow, hamburger works, chips wrap
- Regression E2E in isolation: `test_smoke` + `test_chat_history` + `test_chat_persistence` + `test_cache_busting` → 15 passed
**Next pending task:** `04_e2e_share_chat.md` (story Playwright suite + regressions + the phase commit).
@@ -0,0 +1,66 @@
........................................................................ [ 7%]
........................................................................ [ 14%]
........................................................................ [ 21%]
........................................................................ [ 28%]
........................................................................ [ 35%]
........................................................................ [ 42%]
........................................................................ [ 49%]
........................................................................ [ 57%]
........................................................................ [ 64%]
........................................................................ [ 71%]
........................................................................ [ 78%]
........................................................................ [ 85%]
........................................................................ [ 92%]
........................................................................ [ 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 131 0 100%
app/api/chats.py 105 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 143 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 79 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 93 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 50 0 100%
app/models.py 68 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 78 0 100%
app/rag/archive_upload.py 128 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 189 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 165 0 100%
-----------------------------------------------
TOTAL 2180 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,12 @@
All gates green and the phase is committed. Final report:
**Phase 51 · Task 04 (E2E + regressions + commit) — complete**
- Implemented `tests/e2e/test_share_chat.py` (4 tests, mock-only, DB up, admin via `auth_helpers`, anonymous view in fresh `browser.new_context()`): share-from-chat-page save+share-in-one-action with clipboard/fallback branch on `navigator.clipboard` availability (permissions granted; loopback is a secure context) + API `share_url` shape pin; anonymous read-only view (auto-title, identical deterministic answer, `details.thinking` collapsed via absent-`open`, plain-text source chips, zero `#composer`/Save/Share/Tune/Retry, guest nav); History Create-link → Copy/Unshare two-step → revoked URL shows "invalid or was revoked" + API drops `share_url`; bad token → invalid state, no `pageerror`, guest header.
- Extended `tests/e2e/test_cache_busting.py`: new test pins `GET /shared/<token>` carries `Cache-Control: no-cache` with all `?v=`-tagged asset refs (chat created+shared via admin API, deleted in `finally`).
- Tests: `uv run pytest tests/e2e/test_share_chat.py -v --no-cov` → 4 passed; regressions in isolation: `test_chat_history.py` 5, `test_chat_persistence.py` 4, `test_smoke.py` 3, `test_cache_busting.py` 4 — all green.
- Full suite: `uv run pytest --cov=app --cov-report=term-missing` → 1010 passed, TOTAL coverage **99%** (>90% gate).
- Lint/types: `uv run ruff check .` clean; `uv run pyright` → 0 errors.
- Commit: `114b115 feat(chat): share a chat by link — anonymous read-only /shared/<token> page, share/unshare` (`--no-gpg-sign`, 28 files; Containerfile included per phase-50 precedent).
- Deviations: source-chip assertion relaxed from exact-count 1 to ≥1 + kubernetes.md pin (the "think out loud" question fuses 2 docs); `TODO.md` left unstaged (carries two new owner items, not phase 51 work); phase dir **not** moved — per pipeline rules the harness moves task files on success.
- Next pending task: none — 04 was phase 51's final task; `todo/` is now empty of executable tasks.
@@ -0,0 +1,66 @@
........................................................................ [ 7%]
........................................................................ [ 14%]
........................................................................ [ 21%]
........................................................................ [ 28%]
........................................................................ [ 35%]
........................................................................ [ 42%]
........................................................................ [ 49%]
........................................................................ [ 57%]
........................................................................ [ 64%]
........................................................................ [ 71%]
........................................................................ [ 78%]
........................................................................ [ 85%]
........................................................................ [ 92%]
........................................................................ [ 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 131 0 100%
app/api/chats.py 105 0 100%
app/api/config.py 7 0 100%
app/api/docs.py 23 0 100%
app/api/git_sources.py 143 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 79 0 100%
app/core/__init__.py 0 0 100%
app/core/auth.py 20 0 100%
app/core/caching.py 93 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 50 0 100%
app/models.py 68 0 100%
app/rag/__init__.py 0 0 100%
app/rag/agent.py 78 0 100%
app/rag/archive_upload.py 128 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 189 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 165 0 100%
-----------------------------------------------
TOTAL 2180 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK