diff --git a/.ai/CURRENT_TASK.md b/.ai/CURRENT_TASK.md index 41635201..6e9db75e 100644 --- a/.ai/CURRENT_TASK.md +++ b/.ai/CURRENT_TASK.md @@ -1,21 +1,28 @@ # CURRENT_TASK.md +**Task:** Land PR #153 — fix the AssistantChatPage prefill `currentChatRef` bug that silently dropped AI follow-up responses in the task lane. + +**Status:** in-progress (CI running on rebased branch) + +**Definition of Done:** +- [ ] PR #153 (`fix/tasklane-prefill-ref`) CI green on the rebased SHA `1559feb`. Backend, frontend, and e2e all pass. +- [ ] PR #153 merged into `main`. +- [ ] User-visible verification: from the dashboard, type a prefill, answer a subset of task-lane questions, click *Send N of M Responses* — AI follow-up renders. + +**Assumptions:** +- Rebasing onto post-#150 main pulls in the workflow fixes (no host-port mapping for postgres, no upload-artifact step), so the prior CI failures on this PR are resolved structurally. +- The new e2e regression spec (`frontend/e2e/assistant-chat-prefill.spec.ts`) doesn't depend on Anthropic — it uses `page.route` to stub `/ai-sessions/*/chat` deterministically, so it should be CI-stable. + +**Out of scope (deferred to TODO):** +- Hardening the `currentChatRef.current !== sentForChatId` silent-return pattern across `handleSend`, `handleTaskSubmit`, `selectChat`, `refreshFacts`, `refreshActiveFix`, `refreshPreview`. PR #153 fixes the specific symptom; the broader audit is its own task in `TODO.md`. +- Promoting `CI / e2e (pull_request)` to required on `main`. Holding off until two consecutive green PR runs (PR #150 was one; PR #153's run will be the second if it passes). + +## Previous task — closed out + **Task:** Land consolidated CI-recovery PR #150 and lock reliable CI gates on `main`. -**Status:** in-progress +**Status:** complete (2026-04-26). -**Definition of Done:** -- [ ] PR #150 (`fix/ci-workflow-config`) merged. `CI / backend (pull_request)`, `CI / frontend (pull_request)`, and `CI / e2e (pull_request)` show success before merge. -- [ ] `CI / backend (pull_request)` added to required status checks on `main` in Gitea branch protection (frontend is already required). -- [ ] Optional: `CI / e2e (pull_request)` confirmed clean across at least one PR run and added to required checks. - -**Assumptions:** -- The 8-core homelab Gitea Actions runner can support `-n auto` (8 xdist workers). If memory pressure shows up in CI, drop to `-n 4`. -- pytest-cov's xdist support continues to handle the coverage merge and `--cov-fail-under=50` check correctly. -- The per-worker DB creation in `conftest.py` is idempotent and racing workers on first import won't all try to CREATE DATABASE simultaneously — postgres serializes that, but if it surfaces issues, wrap with an advisory lock. - -**Out of scope:** -- Frontend lint warnings (23 remain after #149). -- The 23 react-hooks/exhaustive-deps warnings. -- RLS test suite (gated behind `RUN_RLS_TESTS=1`; not in default CI). -- Per-test transactional rollback (would shave another 30-40% off backend time but is a much bigger refactor — capture in TODO if interested). +- PR #150 merged as commit `87bb20b` on `main`. Backend, frontend, and e2e all green on the merge SHA. +- `CI / backend (pull_request)` added to required status checks on `main` (alongside the pre-existing `CI / frontend (pull_request)` requirement). +- `CI / e2e (pull_request)` left as not-required pending one more green PR run. diff --git a/.ai/HANDOFF.md b/.ai/HANDOFF.md index 54367b03..b46e91e7 100644 --- a/.ai/HANDOFF.md +++ b/.ai/HANDOFF.md @@ -2,63 +2,54 @@ # HANDOFF.md -**Last updated:** 2026-04-25 16:41 EDT +**Last updated:** 2026-04-26 03:50 EDT -**Active task:** Land PR #150 (the consolidated CI-recovery PR), then enable backend and eventually e2e gates on `main`. See [CURRENT_TASK.md](CURRENT_TASK.md). +**Active task:** Ship PR #153 — the AssistantChatPage prefill `currentChatRef` bug fix. See [CURRENT_TASK.md](CURRENT_TASK.md). -**Branch:** `fix/ci-workflow-config` -> PR #150. PRs #151 and #152 were closed and consolidated into this branch. +**Branch:** `fix/tasklane-prefill-ref` → PR #153. ## Current resume point -Latest PR #150 CI had backend and frontend green, but `CI / e2e (pull_request)` failed on the resume smoke test. +PR #150 is merged. Branch `fix/tasklane-prefill-ref` has been rebased onto the new `main` (HEAD `1559feb`) and force-pushed; that pulled in the workflow fixes from #150, so the prior backend port-conflict and frontend upload-artifact failures are gone structurally. -The failure was not product behavior. Playwright was using: +CI was kicked off automatically on the rebased SHA. Watch: -```ts -page.locator('.bg-card').filter({ hasText: tree.name }).first() -``` +- `CI / backend (pull_request)` — should pass now that postgres uses the docker-network DNS name `postgres:5432` (no host port race). +- `CI / frontend (pull_request)` — should pass now that the `actions/upload-artifact@v4` step is removed. +- `CI / e2e (pull_request)` — runs on its own postgres + builds frontend inline. Includes the new `e2e/assistant-chat-prefill.spec.ts` regression test, which stubs `/ai-sessions/*/chat` with `page.route` and is independent of Anthropic. -On the session history page this matched the tree filter `` before the intended session card.