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:
+10
@@ -0,0 +1,10 @@
|
||||
**Task 01 complete — follow-the-bottom scroll gate in `app.js`**
|
||||
|
||||
- `frontend/assets/app.js`: added exported `NEAR_BOTTOM_PX = 200`, `isNearBottom()` (document scroller), and `scrollReveal()` — now the **single** `scrollIntoView` call site (pinned to bottom OR forced). Rewired all call sites: `addMessage` (behavior/force passthrough), `addTyping`, the phase-17 `thinking` branch (keeps its internal `.thinking-text` pin), the `delta` branch, and both phase-14 restore call sites → `("auto", true)`. Submit stays the plain gated default. Header doc gained the "Scroll (phase 18)" paragraph.
|
||||
- **Defect found & fixed:** turn-end `input.focus()` (phase 06) scrolled the off-screen composer into view, yanking a top-scrolled user to the bottom the moment a turn ended — replaced with `input.focus({ preventScroll: true })` (verified via instrumented headless-browser timeline: 9.3s stream held scrollY=0 with it; yanked to 3871px without).
|
||||
- Updated the stale phase-14 unit pin (`tests/unit/test_chat_persistence.py`) to the forced restore form.
|
||||
- New `tests/unit/test_frontend_scroll.py`: 7 source-level pins (6 spec'd + 1 for the preventScroll fix).
|
||||
- Results: `uv run pytest` → **295 passed** · `uv run pytest --cov=app --cov-report=term-missing` → **99% (1109 stmts, 14 missed — identical to baseline)** · `uv run pytest tests/unit/test_frontend_scroll.py -v --no-cov` → 7 passed · `uv run ruff check . && uv run pyright` → clean (0 errors) · `rg -c "scrollIntoView" frontend/assets/app.js` → **1**.
|
||||
- Browser smoke (mock LLM + Chromium): pinned follow (max 64px from bottom ≤ 200), top-hold through a full delta stream, top-hold through thinking+answer, reload landing on the latest message — all pass. E2E regression sanity: `test_chat_persistence.py` 4/4, `test_thinking_display.py` 5/5.
|
||||
- No `index.html`/`styles.css`/template changes; no commit (single phase commit belongs to task 03).
|
||||
- Next pending task: `02_e2e_story_suite.md` (phase 18).
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
_______________ 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
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
All green. The remaining working-tree diffs are phase 18 task 01's (already complete; task 03 owns the commit).
|
||||
|
||||
**Task 02 report — `18_follow_bottom_scroll/02_e2e_story_suite.md`**
|
||||
|
||||
- Implemented `tests/e2e/test_follow_bottom_scroll.py`: 5 Playwright scenarios (submit reveals message; follow alive while pinned; no-yank mid-answer with `scrollTo(0,0)` held ≤5px; no-yank during phase-17 thinking stream — full scratchpad + long answer land off-screen; restore still force-lands on the latest message), document-scroller measurement convention (`{y, sh, ch}` via `page.evaluate`, 200px band mirroring `NEAR_BOTTOM_PX`), `seeded_kb` fixture reusing conftest `db_ready`.
|
||||
- No `app/`, mock, or `frontend/` changes (no defects found — the suite passed against task 01's `scrollReveal` gate as-is).
|
||||
- `uv run pytest tests/e2e/test_follow_bottom_scroll.py -v --no-cov` → **5 passed** (114s, isolation).
|
||||
- Regressions, each in isolation: `test_thinking_display.py` 5 passed · `test_chat_persistence.py` 4 passed · `test_loading_feedback.py` 5 passed · `test_chat_rag.py` 3 passed · `test_suggestion_chips.py` 4 passed.
|
||||
- `uv run pytest` → 295 passed; `uv run pytest --cov=app --cov-report=term-missing` → **99%** (unchanged, >90% gate); `uv run ruff check . && uv run pyright` → clean (0 errors).
|
||||
- Notable: mock-only suite (`E2E_REAL_LLM=1` unsupported — scroll-away windows need deterministic pacing); one f-string brace-escape fix during authoring.
|
||||
- Next pending task: `03_docs_plan_commit.md` (user story file, PLAN revisions, final validation, the atomic `--no-gpg-sign` commit, phase move).
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
_______________ 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
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
All green (pytest exit 0; summary matches the earlier full run of 295 passed). Phase 18 is complete.
|
||||
|
||||
**Task 03 report — `18_follow_bottom_scroll` (docs, PLAN, validation, commit)**
|
||||
|
||||
- Created `.agents/user_stories/follow-bottom-scroll.md` (header, narrative, 6 acceptance criteria, UI visualization, verbatim 5-scenario Playwright Mapping Rule — matches sibling format)
|
||||
- `.agents/PLAN.md`: header revisions line + §7.4 "Scroll (follow-the-bottom, phase 18)" row + §12 row 18, each noting the owner choice (2026-08-23, option 1 — no pill); no anchor text altered; README untouched (per task)
|
||||
- Gates: `uv run pytest --cov=app --cov-report=term-missing` → 295 passed, **99%** coverage; `uv run pytest tests/e2e/test_follow_bottom_scroll.py -v --no-cov` → 5/5 in isolation; regressions in isolation: thinking_display 5✓, chat_persistence 4✓, loading_feedback 5✓, chat_rag 3✓, suggestion_chips 4✓; `uv run ruff check . && uv run pyright` clean; `rg -c "scrollIntoView" frontend/assets/app.js` → 1
|
||||
- Commit `bc0158f` `feat(ui): chat auto-scrolls only while pinned to the bottom — …` (conventional, `--no-gpg-sign`); phase dir now under `.agents/phases/complete/`
|
||||
- Deviations: (1) task's `git add -A .agents/` errors on the ignored pathspec in this git — staged via `git add -f .agents/PLAN.md` (the AGENTS.md rule-8 mechanism); (2) `mv` of the todo dir failed because the harness had already moved tasks 01/02 into `complete/18` — merged remaining `00`/`03` files in and removed the todo dir; (3) header line carries "(Phase 18, owner choice 2026-08-23)" so the owner-choice wording sits on every note, per the phase-17 precedent
|
||||
|
||||
Next pending task: `.agents/phases/todo/19_shared_header/` (first task in that phase).
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
_______________ 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
|
||||
Reference in New Issue
Block a user