diff --git a/docs/handoff/20260612-handoff-67.md b/docs/handoff/20260612-handoff-67.md new file mode 100644 index 0000000..65477e0 --- /dev/null +++ b/docs/handoff/20260612-handoff-67.md @@ -0,0 +1,119 @@ +# Session handoff — 2026-06-12 (67) + +Sixty-seventh handover. Continues directly from handoff-66 (ADR-0048 +`seed` Phase 2, committed). This was a **manual-testing pass**: the user +exercised the app, found several rough edges, and we triaged each into +*fix now* vs *file an issue*. Net result: **three bug fixes committed** +and **three enhancement issues filed**. + +## §1. State at handoff + +**Branch:** `main`. Working tree **clean**; all work committed. Unpushed +(push is the user's step). + +**Tests: 2407 passing / 0 failing / 0 skipped / 1 ignored** (the +long-standing `friendly` doctest). **Clippy clean** (nursery, all +targets). +7 over handoff-66's 2400. + +**Commits since handoff-65:** +``` +f7155ce fix(input): thread the `:` one-shot escape into live SQL feedback +4cacb82 fix(completion): don't flag a table alias used before its FROM clause +c3e0103 fix(completion): flag-aware partial so a dash completes flags, not keywords +30b2677 docs: ADR-0048 Phase 2 implemented + handoff 66 +a12facc feat(seed): set override clause + column-fill (ADR-0048 Phase 2) +``` +(`a12facc`/`30b2677` are the Phase-2 work documented in handoff-66.) + +## §2. Bug fixes this session (all committed, all tested) + +1. **`c3e0103` — flag completion ate the dash.** Typing a flag at a + flag position (`add 1:n relationship … -`) offered the `on` keyword + and, on accept, produced `-on` / `---create-fk`: the partial-token + walk stopped at `-`, so the dash was outside the replaced range. + Fix: flag-aware partial detection (a dash-prefixed token at a word + boundary is a flag-in-progress, **gated on a flag being expected** so + `where x = -5` stays a number) + a unified flag matcher + (`trim_start_matches('-')`). Affected **all** flags. 4 tests + 2 + partial-flag snapshots updated (they'd captured the latent bug). + +2. **`4cacb82` — table alias flagged as an unknown column.** In a + SELECT, the projection (`sum(ol.count*…)`) can reference an alias + whose `FROM … OrderLines ol` sits *after* the cursor. The candidate + engine recovers that via the §10.6 full-input lookahead (ADR-0032), + but `invalid_ident_at_cursor` only walked text *before* the cursor — + so `ol` matched no scope and got a red "ERR" overlay on an otherwise + valid query. Fix: give the validity check the same full-input + lookahead and bail when the partial prefix-matches a binding's alias + or table. 1 test. + +3. **`f7155ce` — the `:` one-shot escape broke live SQL feedback.** + Submission strips the `:` (ADR-0003), but the *live* feedback kept it + in the buffer handed to the walker, which bailed at the `:`. Effect: + under `:`, Tab completed nothing and a valid query could flash `[ERR]` + — while the same line in full `mode advanced` worked. (The hint + already stripped it, hence "hint shows the name but Tab does + nothing".) Fix: one shared `App::feedback_view()` (the `:`-stripped + SQL + mapped cursor + stripped offset) routed through completion (with + a `replaced_range` offset shift), the validity verdict, and rendering + (new `render_input_runs_feedback` highlights/overlays the view shifted + by the offset; the `:` renders as plain text); the ambient hint was + consolidated onto it (removing the duplicate `strip_one_shot_prefix`). + 3 tests + the 9 existing colon tests still green. + +## §3. Investigated, **no code change** (working as designed) + +- **Comma-`FROM` implicit join** (`select … from A, B, C`) is + **deliberately rejected** — ADR-0032 §11 / OOS-3: *"comma-FROM teaches + habits we do not want to encourage; `CROSS JOIN` covers the same shape + explicitly."* The explicit equivalent (`CROSS JOIN … WHERE …`) works. +- **`sum(…)` returning one row** with no `GROUP BY` is **correct SQL** + (the aggregate collapses the result to one row; SQLite/the playground + allow the non-aggregated columns where Postgres would error). The + user's query needed `group by o.id`. Verified (1 row). + +## §4. Open issues filed this session — **next session's candidates** + +All on `git.lazyeval.net/oli/rdbms-playground`, label `enhancement`: + +- **#26 — `seed