docs(handoff): PR #193 all 10 review findings resolved + 2 decisions

Findings doc gets a per-finding RESOLUTION section; HANDOFF resume point moves to
"re-push + merge" and corrects the false Task 16/17 "done" record; CURRENT_TASK
updated; two architectural decisions logged (real ai_build columns replacing the
meta convention; ad-hoc walk restored); SESSION_LOG entry added.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 15:56:03 -04:00
parent 9afaf37fb3
commit db446e1fd6
5 changed files with 129 additions and 24 deletions

View File

@@ -5,6 +5,43 @@
**Process:** 7 independent finder angles, every candidate independently verified against actual code (quoted lines confirmed, not speculation).
**Verdict: DO NOT MERGE as-is.** The headline feature (AI-guided walkthrough) is non-functional end-to-end, two tasks recorded as complete in `.ai/HANDOFF.md` were never actually committed, and one DB constraint is a deletion time bomb.
---
## ✅ RESOLUTION (2026-06-09, same day)
**All 10 findings resolved.** Two architectural decisions taken (see `.ai/DECISIONS.md`):
the **root fix** for Findings 8/9 (real `category` / `problem_text` / `pending_node`
columns on `l1_walk_sessions`; the `{"node_type":"meta"}` walked_path convention
deleted entirely — migration `61dda4f615c6`), and **restoring the ad-hoc walk**
(Finding 5 option a — `adhoc=True` intake + "Walk it ad-hoc" out_of_scope button).
- **Finding 1** — `ai_tree_builder._assign_id` stamps `uuid4().hex[:8]` on every node
(generated, depth-cap, generation-failed); `current_node_id` now real. Contract test
added (`test_ai_build_first_node_carries_id_and_advance_grows_walk`).
- **Finding 2a/3** — `L1EscalationsSection` mounted on `EscalationQueuePage`;
`ProposalDetail` `/pilot` link gated on `source_session_id`, L1-source block added.
- **Finding 2b** — renders `step.question ?? step.text`, `timeAgo`, shows `problem_text`.
- **Finding 4** — intake honors explicit `flow_id` (matcher bypassed); suggest card passes
`near_miss.flow_id`; the three intake handlers collapsed into one `runIntake`.
- **Finding 5** — ad-hoc walk restored (option a).
- **Finding 6** — `l1_session_id` FK → `ondelete=CASCADE` (model + migration); cascade-delete test.
- **Finding 7** — owner+admin at all three layers (GET dep, route guard, `usePermissions`);
`require_account_owner_or_admin` delegates to `User.can_manage_account`; `User.account_role`
TS type gains `'admin'`.
- **Finding 8** — `pending_node` column; `/next-node` replays the served node on re-mount
(no duplicate paid generation); reads context off the session (no ticket re-fetch).
- **Finding 9** — meta entry gone → empty walk is falsy (no junk proposal) and the depth
cap counts only real steps.
- **Finding 10** — `escalate` passes `target_ids or None` (default fallback), filters
`deleted_at IS NULL`, warns when empty; two tests.
- **Cleanups** — dead `ticket_ref` deleted, `IntakeResponse` per-outcome validator + `ticket_kind`
Literal restored, unused `acknowledged` dropped, escalations partial index added, restored the
deleted `no_kb_content` audit assertion.
**Verification:** full Phase 2A backend set **110 passed / 0 failed**; frontend `tsc -b` +
`eslint` + `vite build` clean; migration upgrade→downgrade→upgrade roundtrip clean
(columns + FK `confdeltype` + partial index confirmed); anti-parrot guardrail green.
How to use this file: work the findings in order. Findings 17 are merge blockers; 810 can be fast-follows. Each finding lists the verified evidence (file:line) and a suggested fix. Several findings share two root causes — fix those at the root rather than patching symptoms:
- **Root cause A:** AI-generated nodes have no `id`, but the advance protocol keys on `node_id`. (Finding 1; touches 8.)