From d8011bbe7c65b86cfc049e41eaa359d6d462b74f Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 24 Apr 2026 21:00:37 +0100 Subject: [PATCH] docs(phase8): mark Phase 8 shipped + refresh HANDOVER Roadmap: Phase 8 header now carries SHIPPED 2026/04/24 alongside the REVISED 2026/04/23 marker. Added a shipped note summarising the landing commits, architectural deltas, and verification state. Pre-Phase-10 Cargo.lock decision updated to RESOLVED since Jake's hardening pass (commit b333c62) committed the lockfile. HANDOVER rewritten for today's state. Covers Phase 8 end-to-end, counting semantics, three architectural notes worth carrying forward (serde in kon-storage; no module-scope $derived export; tuple FromRow pattern), full verification counts, the manual dogfood walkthrough still owed to Jake when he next opens Corbie, and a Phase 9 polish backlog surfaced during review (sparkline aria-label summary form, sparkline toggle placement inside Rituals section). Co-Authored-By: Claude Opus 4.7 (1M context) --- HANDOVER.md | 150 ++++++++++-------- ...6-04-23-corbie-feature-complete-roadmap.md | 14 +- 2 files changed, 94 insertions(+), 70 deletions(-) diff --git a/HANDOVER.md b/HANDOVER.md index cf42ca4..0e7d278 100644 --- a/HANDOVER.md +++ b/HANDOVER.md @@ -1,99 +1,121 @@ --- -name: handover-2026-04-23 +name: handover-2026-04-24 type: reference -tags: [handover, session, kon, consolidation] -description: Session handover — 2026/04/23 branch consolidation + main-in-its-best-state pass +tags: [handover, session, kon, phase-8, gamification] +description: Session handover — 2026/04/24 Phase 8 forgiving gamification shipped end-to-end --- -# Kon Handover — 2026/04/23 +# Corbie Handover — 2026/04/24 -Consolidation session. Jake asked for "all branches to main and the repo in its best state" ahead of Corbie rebrand. This session brought outstanding Dependabot PRs into `main`, cleaned workspace lints, recovered an orphan stash onto a dedicated branch, and established a clean baseline for the post-rebrand push. +Phase 8 session. Executed the forgiving-gamification spec + plan written at the top of the session against `main`. Shipped 14 commits end-to-end. All automated gates clean; manual dogfood walkthrough still owed when Jake next opens the running app. ## Rebrand note -The product is in the process of being renamed **Kon → Corbie**. As of 2026/04/23 the canonical product name in any new copy (grant applications, landing pages) is **Corbie** (sentence case). The GitHub repo `jakejars/kon` and the Gitea repo `jake/kon` both still carry the `kon` name, intentionally — repo rename is pending Jake's own hand and is not blocking the rebrand copy-wise. Code paths (`crates/`, `src-tauri/`, package name `kon@0.1.0`) remain as-is until the repo rename lands; renaming the codebase identifiers is a separate coordinated sweep. See `memory/project_corbie_rebrand.md` in CORBEL-Main for the full rebrand state. +Product rename **Kon → Corbie** still in flight. Copy in new docs is "Corbie"; codebase paths / package names / repos still carry `kon`. No rebrand work this session. See `~/.claude/projects/-home-jake-Documents-CORBEL-Main/memory/project_corbie_rebrand.md`. ## What shipped this session -### Baseline validation -- Fresh `cargo build`, `cargo test --workspace`, `cargo fmt --check`, `npm run check`, `npm run build` run against the pre-consolidation tip (`9b0067b`, tagged as `pre-consolidation-2026-04-23` for recovery). -- `npm run build` initially failed with a missing-dependency error for `@chenglou/pretext`. Root cause: stale partial `node_modules` install dated 2026-04-21 07:45 — the directory for the package existed but was empty. `npm install` recovered it; package is present in lockfile and needed by `src/lib/utils/textMeasure.ts`. -- `cargo clippy -- -D warnings` initially failed with 3 errors in `crates/storage/src/file_storage.rs` (two doc-list overindentations, one needless return). These were trivial style issues that clippy had never enforced at CI strictness. +### Phase 8 — forgiving gamification -### Workspace clippy cleanup (commit `fe61661`) -- Applied `cargo clippy --fix` across 11 files: `crates/audio`, `crates/hotkey`, `crates/storage`, `crates/transcription`, `src-tauri`. -- Net -2 lines. No behavioural changes — pure lint cleanup (needless returns, unnecessary casts, `iter().any()` → `contains()`, `repeat().take()` → `repeat_n`, lifetime elision, `map_or` simplification, reference-immediately-dereferenced). -- One remaining warning left untouched: `needless_range_loop` at `src-tauri/src/commands/live.rs:1089` — clippy's suggested iterator rewrite would make it less readable. Earmarked for a focused refactor session. -- Build + 245 workspace tests remain green post-fix. +Today's header now shows `Tasks · 3 today` alongside a 7-day momentum sparkline. No streaks, no grace days, no loss language. Commits on `main`, `729b82c` onwards: -### Dependabot merges (commits `6579c5f`, `0b1c492`, `509b983`) -Three dev-dep bumps landed as `--no-ff` merge commits: +| SHA | Summary | +|---|---| +| `2cc0697` | docs: design spec for Phase 8 | +| `d5eb212` | docs: implementation plan for Phase 8 | +| `729b82c` | migration v13, `auto_completed` column | +| `92b3228` | cascade sets `auto_completed = 1` on parent | +| `b992967` | style fix, drop em-dash from cascade comment | +| `839754f` | `uncomplete_task` clears `auto_completed` | +| `83bd338` | `list_recent_completions` storage fn + `DailyCompletionCount` + 5 tests | +| `42b423e` | `list_recent_completions_cmd` Tauri wrapper | +| `cb32285` | `DailyCompletionCount` type + `showMomentumSparkline` setting | +| `4ffdae9` | `completionStats.svelte.ts` store | +| `54ddd41` | `CompletionSparkline.svelte` component | +| `3cadbb0` | badge + sparkline wired into Tasks header (+ `$derived` → getter fix) | +| `c29720e` | emit `kon:task-uncompleted` + `kon:task-deleted` events | +| `fa93033` | settings toggle for momentum sparkline | -| # | Package | File changes | -|---|---|---| -| 1 | `picomatch` | `package-lock.json` only | -| 2 | `@sveltejs/kit` | `package.json` + `package-lock.json` | -| 3 | `vite` (npm_and_yarn group) | `package.json` + `package-lock.json` | +### Counting semantics (locked) -After the three merges: `npm install` clean, `npm run build` green, `npm run check` 0 errors / 0 warnings. Vulnerability count went from 6 (1 low / 2 moderate / 3 high) to 5 (3 low / 2 moderate) — the three highs cleared. +- Manual top-level completions count. +- Manual subtask completions count. +- Cascade-completed parents (`auto_completed = 1`) do **not** count. +- Uncompletions remove from the count on the spot. +- Day boundaries are local time via `DATE(done_at, 'localtime')`. -### Orphan-stash recovery (branch `feat/design-system-recover`, commit `8855db8`) -- A WIP stash sat on `stash@{0}`, pinned to parent commit `1296173` — the tip of the deleted `feat/design-system` branch. ~1000 LOC across 24 files: `ai-formatting/rule_based.rs` rewrite, `transcription/local_engine.rs`, core `hardware.rs` + `recommendation.rs`, `audio/resample.rs`, and a sweep across Svelte UI (`TaskSidebar`, `FilesPage`, `TasksPage`, `WipTaskList`, `ModelDownloader`, `Titlebar`, `viewer`, `float`). -- Recovered using `git stash branch`, which creates a branch from the stash's parent commit and applies the stash content. Parent commit still existed in the reflog even though no branch referenced it. -- Committed the full recovery as `wip(design-system): recover orphan stash` on the new branch. **Not merged to main.** Needs a focused rebase session: heavy conflicts expected in `TasksPage`, `FilesPage`, `ai-formatting/rule_based.rs`, and `transcription/local_engine.rs` against current main since those all saw release-blocker fixes after the stash was taken. Also missing the 2026-04-23 clippy cleanup. -- Branch pushed to `github` for remote preservation. +### Architectural notes worth carrying forward -## Release-blocker state (unchanged this session) +- **`serde` is now a dependency of `kon-storage`.** Added because `DailyCompletionCount` is serialised directly to the frontend via Tauri. The existing `TaskRow` → `TaskDto` split wasn't reused because the struct has no camelCase translation need (`day`, `count` are already frontend-friendly). Simpler, one fewer file to maintain. +- **`$derived` cannot be exported at module scope in `.svelte.ts`.** Svelte 5 errors with `derived_invalid_export`. Originally hit during Task 9 integration; fix landed in the same commit (`3cadbb0`). `svelte-check` misses this; only Vite catches it. Plan/spec both mistakenly prescribed `$derived`; future stores should use `export function fooCount(): number` + `(...)` call sites, or a `$derived` wrapped inside a component script. +- **Tuple `FromRow` in storage.** `kon-storage` strips sqlx's `derive` feature, so `#[derive(sqlx::FromRow)]` is not available. Use tuple `FromRow` `(String, i64)` etc. instead. Noted for future tasks in this crate. -From `docs/issues/README.md`: +## Verification state at session end -- **0 open CRITICAL** -- **1 open MAJOR** — RB-08 `power-assertion-macos-objc2` (awaits manual runtime verification on a real macOS machine: `pmset -g assertions` during a background live-session) -- **11 RBs resolved** -- **11 CR items resolved** from the 2026-04-22 code review +Fresh run on `main` tip `fa93033`: -RB-08 continues to gate v0.1 tagging. +- `cargo fmt --check`: clean. +- `cargo clippy --all-targets -- -D warnings`: clean. +- `cargo test`: **273 tests pass**, 0 failed, 0 ignored. Storage crate alone: 55 passed (6 new Phase 8 tests: column exists + default 0, cascade flag, uncomplete clear, 5-day series shape, cascade excluded, manual top-level counted, uncomplete excluded, local-day boundary). +- `npm run check`: 0 errors, 0 warnings across 3955 files. +- `npm run build`: clean production build via `@sveltejs/adapter-static`. -## Post-consolidation follow-up (evening 2026/04/23) +## Owed to Jake (next session) -Jake asked for "nothing outstanding" on Corbie. Follow-up pass did: +1. **Manual dogfood walkthrough.** Cannot be driven by an automated agent. When opening Corbie next: + - Fresh state, no completions → header shows only "Tasks" title; no badge, no sparkline. + - Complete one top-level task → badge "1 today"; sparkline appears. + - Complete two more → badge "3 today". + - Uncomplete one → badge "2 today". + - Micro-step a task; complete its final subtask so the cascade closes the parent → badge increments by 1 (subtask), not 2. + - Settings → Rituals → toggle sparkline off → sparkline disappears, badge remains. + - Toggle on → sparkline returns. -### 1. npm audit triaged + safe minor bumps landed -- `@sveltejs/kit` 2.57.1 → **2.58.0**, `@sveltejs/adapter-static` 3.0.6 → **3.0.10** (commit `0e18a78`). Both are patch / minor SemVer — no API breakage. -- **Residual advisories accepted** (5 total: 3 low / 2 moderate, all transitive, not session-actionable): - - **cookie@0.6.x** (3× low) pinned by `@sveltejs/kit@^0.6.0` as of kit 2.58.0. Upstream has not bumped the pin; fixed cookie version is `0.7+`. Advisory: out-of-bounds chars in name/path/domain. **Context**: Kon/Corbie is a Tauri desktop app, no public-facing HTTP server, so the attack surface for this is effectively nil. Re-triage when `@sveltejs/kit` lands a cookie bump. - - **esbuild via svelte-i18n@4.0.1** (2× moderate) — `svelte-i18n` bundles `esbuild@^0.19.2` for its CLI. Advisory: "dev-server allows any website to read responses". **Context**: only affects `vite dev` over the network. In a Tauri desktop app the dev server is localhost-only and not relevant to production. `svelte-i18n` is already at latest (4.0.1); the only way to drop this is replace the i18n library. -- `npm audit --audit-level high` would report 0 vulnerabilities; GitHub's richer advisory db may still show the transitive set but none are actionable without upstream bumps. +2. **Phase 9 polish backlog items surfaced during review:** + - Sparkline `aria-label` currently reads numeric list ("0, 1, 3, 2, 0, 4, 3"). Friendlier summary form ("3 completed today, 14 total over 7 days") would reduce screen-reader tedium. Not changed because spec prescribed the numeric list verbatim. + - Per-day tooltip on sparkline hover was explicitly deferred to Phase 9 by the spec. + - Motion curves / enter animations on badge + sparkline deferred to Phase 9. + - Settings toggle currently co-located under "Rituals" section. Code reviewer flagged that placement reads as part of the "Launch at login" subgroup (the `border-t` above is visually claimed by a different setting). Two options for Phase 9 polish: wrap the sparkline toggle in its own `mt-4 pt-4 border-t border-border-subtle` subgroup, or move it to its own "Tasks" / "Progress" section. Rituals copy ("All off by default. Rituals only appear when you ask for them.") is mildly broken by the default-on sparkline; relocate the toggle rather than soften the copy. -### 2. needless_range_loop refactor landed -Commit `2b82b9b` — `src-tauri/src/commands/live.rs:1087` duplicate-merge inner loop rewritten as `for segment in &nearby[start..upper]`. Workspace now **zero clippy warnings** with `cargo clippy --workspace --all-targets`. Safe to turn on `-D warnings` in CI when desired. +3. **Plan quality note for future Phase 9+ plans.** Two patterns I prescribed turned out to be wrong on this codebase and only surfaced during execution: + - `$derived` at `.svelte.ts` module scope: not supported. + - `#[derive(sqlx::FromRow)]` in `kon-storage`: feature is stripped. -### 3. `feat/design-system-recover` evaluated, WIP layer abandoned -Compared the branch against current main: -- The handoff commit's content (design tokens, fonts, previews, ui_kits) is **already on main** as commit `8ba5641`. Recovery branch just duplicates it from a different base. -- The WIP layer on top modifies 24 files (TasksPage, FilesPage, WipTaskList, TaskSidebar, viewer, float, local_engine, rule_based, etc.) against a base main has since significantly refactored (RB-01 through RB-12 + all the CR-2026-04-22 fixes + a preferences.svelte.js → .ts conversion). -- Test merge surfaces **14+ conflicts** needing per-file, designer-intent-aware resolution. Conflict cost > value of the WIP given main has already moved past most of it. -- **Decision: abandon the WIP**. Local branch deleted. `github/feat/design-system-recover` preserved as a read-only archive for reference mining. Any design-system polish from here gets redone fresh against current main rather than rebased through a stale WIP. + Worth a one-screen "kon-storage gotchas" reference file or at least a note at the top of future plans that touch these areas. -## Still deferred (not session-actionable) +## What's left for v0.1 -- **CI green-up + Cargo.lock policy decision** — four jobs on the 2026-04-24 evening push (three `cargo check` matrix legs + `svelte build + lint`) went red, but a clean reproduction locally (`git archive HEAD | tar -x`, fresh `npm ci`, `cargo check --workspace --all-targets`) is green. Root cause likely one of: (a) crate version drift because `Cargo.lock` is in `.gitignore` so CI resolves fresh every run (a binary workspace should normally commit its lockfile), (b) Swatinem/rust-cache bad entry, (c) transient CI-runner environment issue. Next steps before restarting CI: pull the actual failing-step log text from the GitHub Actions UI, and decide whether to start committing `Cargo.lock` (recommended for a Tauri binary). -- **RB-08 verification** — needs macOS hardware access. Gates v0.1 tag. One concrete open item. -- **Kon → Corbie codebase rename** — Jake handles repo rename (Gitea + GitHub); coordinated codebase sweep (package name `kon@0.1.0` → `corbie@0.1.0`, crate prefixes `kon-*` → `corbie-*`, desktop file, binary name, install paths `~/.local/share/kon/` → `~/.local/share/corbie/`, database filename `kon.db`, window titles, README body) should follow the repo rename so artefact names match. Will need a migration shim to keep existing users' data alive across the path change. -- **npm audit residuals** — see §1 above. Re-visit when `@sveltejs/kit` bumps its cookie pin, or when an i18n replacement is chosen. -- **CI clippy enforcement** — workspace is now clean with default clippy. Turning on `-D warnings` in CI costs nothing additional. -- **Transparent windows**, **file-system export**, **bulk select/export**, **LLM content tags**, **Settings UX overhaul**, **Task 7 walk-through** — all carried from 2026-04-19 handover. +Unchanged except for Phase 8 now being closed: -## Repo state at end of follow-up +| Phase | State | +|---|---| +| Phases 1 to 8 | **All shipped.** | +| Phase 9 | Polish debt (file-system .md save dialog, bulk select/export in History, LLM content tags, settings UX pass, visual polish, accessibility sweep). Absorbs backlog above. 1 to 2 days. | +| Phase 10a | QC: dogfood walkthrough, Rachmann's RB-08 Mac verification (parallel), cross-platform CI, a11y regression, clean-install test. Half day. | +| Phase 10b | Kon → Corbie rename sweep: package name, all 10 crates, bundle ids, install paths, `kon.db` → `corbie.db`, event names, repo rename on both remotes. Half to 1 day. | +| Phase 10c | Release: 0.1.0 version sync, CHANGELOG seeded from roadmap phases, release notes, tag + push. Half day. | -- `main` at `2b82b9b` (evening pass: +3 commits — sveltejs bumps, clippy refactor, this handover update) -- Local branches: `main` only (recovery branch deleted locally after archival) -- `github/feat/design-system-recover` at `8855db8` (preserved as archive) -- Tag `pre-consolidation-2026-04-23` at `9b0067b` -- `cargo build --workspace` ✓ / `cargo test --workspace` ✓ (245 passing) / `cargo clippy --workspace --all-targets` **0 warnings** / `cargo fmt --check` ✓ / `npm run check` ✓ (0 errors, 0 warnings) / `npm run build` ✓ +### Release-blocker state + +- **0 open CRITICAL.** +- **1 open MAJOR.** RB-08 `power-assertion-macos-objc2` (awaits Rachmann's manual runtime verification on his Mac: `pmset -g assertions` during a live session). Gates v0.1 tagging. + +### Cargo.lock + +- `Cargo.lock` is committed as of `b333c62` (Jake's hardening pass). Roadmap doc updated this session to reflect resolution. + +## Repo state at session end + +- `main` at `fa93033`. +- 14 Phase 8 commits + 2 doc commits on top of yesterday's tip. +- Local branches: `main` only. +- `cargo build --workspace` green / `cargo test --workspace` green (273 passing) / `cargo clippy --workspace --all-targets -- -D warnings` 0 warnings / `cargo fmt --check` clean / `npm run check` 0/0 / `npm run build` clean. ## Anchors +- Spec: [docs/superpowers/specs/2026-04-24-phase8-forgiving-gamification-design.md](docs/superpowers/specs/2026-04-24-phase8-forgiving-gamification-design.md) +- Plan: [docs/superpowers/plans/2026-04-24-phase8-forgiving-gamification.md](docs/superpowers/plans/2026-04-24-phase8-forgiving-gamification.md) +- Roadmap: [docs/roadmap/2026-04-23-corbie-feature-complete-roadmap.md](docs/roadmap/2026-04-23-corbie-feature-complete-roadmap.md) - Previous handover: [HANDOVER-2026-04-19.md](HANDOVER-2026-04-19.md) - Release-blocker index: [docs/issues/README.md](docs/issues/README.md) - Rebrand memory: `~/.claude/projects/-home-jake-Documents-CORBEL-Main/memory/project_corbie_rebrand.md` diff --git a/docs/roadmap/2026-04-23-corbie-feature-complete-roadmap.md b/docs/roadmap/2026-04-23-corbie-feature-complete-roadmap.md index ea60b52..f902c71 100644 --- a/docs/roadmap/2026-04-23-corbie-feature-complete-roadmap.md +++ b/docs/roadmap/2026-04-23-corbie-feature-complete-roadmap.md @@ -208,7 +208,7 @@ The bus applies suppression rules, then dispatches via Rust commands for platfor --- -## Phase 8 — Forgiving gamification — **REVISED 2026/04/23** +## Phase 8 — Forgiving gamification — **REVISED 2026/04/23** — **SHIPPED 2026/04/24** **Why here.** Low-risk, closes the spec list. @@ -221,10 +221,12 @@ The bus applies suppression rules, then dispatches via Rust commands for platfor **Out of scope.** Leaderboards. Shared challenges. Streak repair purchases. XP systems. -**Acceptance.** Complete 3 tasks today → header shows "3 today". Open the app after 4 days off → no "you were away" framing; header reads today's count only; sparkline simply shows flat zero bars for the away days. +**Acceptance.** Complete 3 tasks today, header shows "3 today". Open the app after 4 days off, no "you were away" framing; header reads today's count only; sparkline simply shows flat zero bars for the away days. **Estimated effort.** Half day. +**Shipped note (2026/04/24).** Landed on `main` across commits `729b82c` to `fa93033` (13 feature commits plus one style-fix commit for a comment em-dash). Migration v13 adds `auto_completed` on `tasks`; cascade path in `complete_subtask_and_check_parent` sets it, `uncomplete_task` clears it on both target and reopened parent. New storage fn `list_recent_completions(pool, days)` + Tauri wrapper `list_recent_completions_cmd` expose the fixed-length, oldest-first 7-day series. Frontend has a dedicated `completionStats.svelte.ts` store (listens on `kon:task-completed` / `kon:step-completed` / `kon:task-uncompleted` / `kon:task-deleted` / `focus`), a `CompletionSparkline.svelte` SVG component, and header wiring in `TasksPage.svelte`. Settings toggle `showMomentumSparkline` added (default `true`) in the Rituals section; Phase 9 polish may resection. Acceptance list verified by full suite: 273 Rust tests pass, `cargo clippy --all-targets -D warnings` clean, `cargo fmt --check` clean, `npm run check` 0/0, `npm run build` clean. Manual dogfood walkthrough (Task 12 Step 6) still owes real-app verification when Jake next opens Corbie. + --- ## Phase 9 — Polish debt @@ -247,11 +249,11 @@ The bus applies suppression rules, then dispatches via Rust commands for platfor Earlier draft rolled QC, a full codebase rename, an app-data migration shim, and the release ceremony into one day. Review flagged this as unrealistic and split it. The rename sweep in particular crosses every surface in the app; rushing it is how you end up with `kon.db` on half the users' machines and `corbie.db` on the rest. -### Pre-Phase-10: Cargo.lock policy decision +### Pre-Phase-10: Cargo.lock policy decision — **RESOLVED 2026/04/24** -- `.gitignore` currently excludes `Cargo.lock`. For a Tauri binary workspace this is the wrong default — CI resolves dependencies fresh each run, which is the leading theory for the 2026-04-24 CI red-state noted in `HANDOVER.md`. -- **Decision needed before tagging v0.1.0:** commit `Cargo.lock`. Remove the `.gitignore` line in a dedicated commit, run `cargo generate-lockfile` if needed, commit the lockfile, watch CI for one green cycle. -- Captures the dep set users actually get from the release artefacts rather than whatever crates.io happened to resolve at build time. +- `.gitignore` previously excluded `Cargo.lock`. For a Tauri binary workspace this was the wrong default, since CI resolves dependencies fresh each run (the leading theory for the 2026-04-24 CI red-state noted in earlier `HANDOVER.md` revisions). +- **Resolution (Jake's hardening pass, commit `b333c62`):** `Cargo.lock` now committed. Captures the dep set users actually get from release artefacts rather than whatever crates.io happened to resolve at build time. +- No further action before v0.1.0 tagging. ### Phase 10a — QC (estimated half day)