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,14 @@
All completion criteria verified — no defects found. Final report:
**Phase 47 final verification pass — all green (no code changes needed)**
- Verified implementation: `app/config.py` (17-format allowed set + default CSV), `app/rag/chunker.py` (10 dispatch entries → `chunk_text`), 4 fixture files with sentinels, unit/integration/E2E tests, README, `.env.example`, PLAN.md A9 revision note
- `uv run pytest` (unit + integration): **all passed** (exit 0)
- `uv run pytest --cov=app --cov-report=term-missing`: **TOTAL 99%** (>90% gate ✓)
- `uv run pytest tests/e2e/test_quadlet_jinja_import.py -v --no-cov`: **4 passed** in isolation
- Regressions in isolation: `test_import_documents.py` 3 passed, `test_sync_button.py` 3 passed, `test_git_sources_admin.py` 6 passed
- `uv run ruff check . && uv run pyright`: clean (0 errors)
Completion criteria: (1) default-import indexes all 10 formats, no env config ✓ (2) Sources table rows + viewer shows `.container` TOML with stem title `compose` ✓ (3) `.j2` sentinel question non-deflected with `templates/deploy.j2` chip ✓ (4) validator still rejects `md,xyz` ✓ (5) README + `.env.example` + PLAN A9 note record the set ✓ (6–9) test/coverage/E2E/lint gates ✓ (10) commit `5d679f5` (unsigned, `commit.gpgsign=false`), task dir in `complete/` ✓
No deviations. Next pending phase: none in `todo/` (47 is the last — the harness will move it on success).
@@ -0,0 +1,61 @@
........................................................................ [ 9%]
........................................................................ [ 18%]
........................................................................ [ 27%]
........................................................................ [ 36%]
........................................................................ [ 45%]
........................................................................ [ 54%]
........................................................................ [ 63%]
........................................................................ [ 72%]
........................................................................ [ 81%]
........................................................................ [ 90%]
........................................................................ [ 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 71 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 72 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 1763 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,14 @@
**Phase 47 / Task 01 complete — config: the ten new A9 formats (allowed + default)**
- `app/config.py`: `_ALLOWED_IMPORT_EXTENSIONS` now holds all 17 formats (original 7 + `container, network, volume, image, pod, kube, swap, os, endpoint, j2`), with the 2026-08-27 owner-permission revision recorded in the module comment and section header; `import_extensions` default CSV extended (original seven first, ten appended); `mode="after"` validator untouched — accepts new names, still rejects unknowns.
- `.env.example`: commented `BOR_IMPORT_EXTENSIONS` line documents the new 17-format default.
- `tests/unit/test_config.py`: updated the defaults test to the full 17-set; added tests — allowed-set = all 17, default CSV includes each of the ten new names, `import_extension_set` returns the dotted lowercased set, validator accepts `md,container,j2`, still rejects `md,xyz`.
**Results (exact commands):**
- `uv run pytest tests/unit/test_config.py -v` → 23 passed
- `uv run pytest --cov=app --cov-report=term-missing` → 777 passed, coverage **99%** (>90% gate)
- `uv run ruff check . && uv run pyright` → clean (0 errors)
**Decisions:** no behavior change for existing formats (default CSV only grows); README/PLAN A9 note deliberately deferred to task 04 per the task boundary; phase commit belongs to task 04, so the tree is left with the three modified files uncommitted.
**Next pending task:** `.agent/phases/todo/47_quadlet_jinja_import/02_chunker_dispatch_fixtures.md` (chunker dispatch for the ten suffixes + fixtures).
@@ -0,0 +1,60 @@
........................................................................ [ 9%]
........................................................................ [ 18%]
........................................................................ [ 27%]
........................................................................ [ 37%]
........................................................................ [ 46%]
........................................................................ [ 55%]
........................................................................ [ 64%]
........................................................................ [ 74%]
........................................................................ [ 83%]
........................................................................ [ 92%]
......................................................... [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 71 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 72 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 1763 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,18 @@
All checks pass. Task 02 is complete.
**Implemented**
- `app/rag/chunker.py`: 10 new `_FORMAT_CHUNKERS` entries (quadlet family + `j2` → `chunk_text`), docstring/comment updated to cite A9 revision 2026-08-27; unknown-suffix fallback unchanged
- Fixtures added (existing 9 files byte-identical): `homelab/quadlet/compose.container` (1689 chars, ≥1500), `lan.network`, `cache.volume`, `templates/deploy.j2` — each with its sentinel
- `tests/unit/test_chunker.py`: parametrized dispatch for all ten suffixes, container fixture (≥2 chunks, ≤`HARD_MAX_CHARS`, sentinel), j2 braces verbatim, `.whatever` fallback, hard-cap params for the new formats
- Updated `test_import_documents.py` count constants **here** (preferred option), plus the same constants in 4 integration + 17 E2E suites that pin the grown fixture tree (9→13 docs, format dicts, `format_counts`, stem titles)
**Results**
- `uv run pytest tests/unit/test_chunker.py -v --no-cov` → 50 passed
- `uv run pytest` → 792 passed
- `uv run pytest --cov=app --cov-report=term-missing` → 99% on `app/` (>90% gate)
- `uv run ruff check . && uv run pyright` → clean, 0 errors
- E2E spot-checks in isolation: `test_import_documents.py` 3 passed; `test_chat_rag`+`test_honest_deflection`+`test_retrieval_quality` 10 passed; `test_sync_button`+`test_git_sources_admin` 9 passed
**Decisions**: extended the constant sweep beyond the named file so no suite is left red by the fixture growth; commit deferred to task 04 (per phase protocol).
**Next pending task**: `.agent/phases/todo/47_quadlet_jinja_import/03_importer_integration.md`
@@ -0,0 +1,60 @@
........................................................................ [ 9%]
........................................................................ [ 18%]
........................................................................ [ 27%]
........................................................................ [ 36%]
........................................................................ [ 45%]
........................................................................ [ 54%]
........................................................................ [ 63%]
........................................................................ [ 72%]
........................................................................ [ 81%]
........................................................................ [ 90%]
........................................................................ [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 71 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 72 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 1763 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,12 @@
All green. Task 03 complete.
**Report — Task 03 (importer parity: walk, delta, prune, titles)**
- `tests/unit/test_importer.py`: added `test_iter_importable_files_walker_picks_up_new_formats_by_default` (temp tree: all ten new formats + the original seven; `.xyz`/`.esphome/x.container`/`node_modules/y.container` filtered; uses the live `Settings(_env_file=None).import_extension_set` — no env override) and `test_quadlet_and_j2_files_get_stem_titles_and_per_format_counts` (db-backed, house pattern: per-format counts + stem titles, `#` lines never titles).
- New `tests/integration/test_import_quadlet_jinja.py` (chosen over extending `test_importer_e2e.py`: delta/prune lifecycle mutates the tree between runs; the fixture e2e stays a single import + idempotent re-run). Seeds a temp source with byte copies of the real `compose.container`/`cache.volume`/`deploy.j2` fixtures, then proves: 3 docs land (stem titles, embedded content chunks + phase-30 summary chunks) → `.j2` change → `updated=1`/`unchanged=2` → idempotent re-run (zero embed calls) → `.volume` deleted + `prune=True` → `pruned=1`, row + chunks cascade-deleted.
- Confirmed **no `app/` code change needed**: the config extension set (task 01) is the walk gate and chunker dispatch (task 02) the chunking gate; the importer rides them unchanged.
- Results: `uv run pytest tests/unit/test_importer.py tests/integration/test_import_quadlet_jinja.py -v` → 24 passed; `uv run pytest --cov=app --cov-report=term-missing` → 795 passed, TOTAL **99%** (>90%); `uv run ruff check .` clean; `uv run pyright` → 0 errors.
- Regression check on task 02's touched suite: `uv run pytest tests/e2e/test_import_documents.py -v --no-cov` → 3 passed (DB up).
- No deviations; task/phase files untouched; commit deferred to task 04 per its scope.
**Next pending task:** `.agent/phases/todo/47_quadlet_jinja_import/04_quadlet_e2e_and_docs_commit.md` (story E2E + README + PLAN A9 note + commit).
@@ -0,0 +1,61 @@
........................................................................ [ 9%]
........................................................................ [ 18%]
........................................................................ [ 27%]
........................................................................ [ 36%]
........................................................................ [ 45%]
........................................................................ [ 54%]
........................................................................ [ 63%]
........................................................................ [ 72%]
........................................................................ [ 81%]
........................................................................ [ 90%]
........................................................................ [ 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 71 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 72 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 1763 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK
@@ -0,0 +1,18 @@
Everything is green and committed. Final report:
**Phase 47, task 04 — quadlet/jinja E2E + docs + commit: done.**
- **E2E** `tests/e2e/test_quadlet_jinja_import.py` (new, mock-only, isolation): `/api/docs` lists the 4 new-format docs (non-zero chunks, stem titles, no env config); Sources table rows + `.doc-link` per file; phase-26 modal shows the `.container` TOML (`[Container]` + `RESE-QUADLET-SENTINEL-77aa`) with stem title + `container` badge; `RESE-JINJA-SENTINEL-33dd` question FTS-matches the `.j2` chunk → non-deflected bubble + `templates/deploy.j2` source chip (A8 gate — verified tokenization live in Postgres first).
- **Docs**: README format list + `BOR_IMPORT_EXTENSIONS` row; PLAN.md A9 revision (row status, note under anchors table, §5, §11 — the only PLAN edit, force-added).
- **Commit**: `5d679f5 feat(import): index quadlet unit files and jinja templates (A9 revision)` (`--no-gpg-sign`, 40 files), records the 47/01–03 todo→complete moves; task file + `00_phase.md` left in `todo/` for the harness.
Gates (all exact commands):
- `uv run pytest` → 795 passed
- `uv run pytest --cov=app --cov-report=term-missing` → TOTAL 99% (>90%)
- `uv run pytest tests/e2e/test_quadlet_jinja_import.py -v --no-cov` → 4 passed (run twice)
- Regressions in isolation: `test_import_documents.py` 3 passed, `test_sync_button.py` 3 passed, `test_git_sources_admin.py` 6 passed
- `uv run ruff check . && uv run pyright` → clean (fixed 2 lint hits in the new file)
**Deviation note**: none — followed the task's explicit PLAN.md/phase-move instructions (owner-locked R1 revision). Pre-existing untracked `NOTES.md` and the 40–45 leftover todo deletions were left untouched.
**Next pending task**: none — this was the last task of phase 47; `todo/` holds only the 47 directory awaiting the harness move.
@@ -0,0 +1,61 @@
........................................................................ [ 9%]
........................................................................ [ 18%]
........................................................................ [ 27%]
........................................................................ [ 36%]
........................................................................ [ 45%]
........................................................................ [ 54%]
........................................................................ [ 63%]
........................................................................ [ 72%]
........................................................................ [ 81%]
........................................................................ [ 90%]
........................................................................ [ 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 71 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 72 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 1763 12 99%
coverage gate: app/ 99% (>90%) OK
All checks passed!
0 errors, 0 warnings, 0 informations
validation OK