From 7526917177dd717bc41563bc5650c82138b16444 Mon Sep 17 00:00:00 2001 From: Daniel Bannert Date: Sat, 8 Aug 2026 15:20:02 +0200 Subject: [PATCH 1/2] docs(plans): record the 265 encoding decision Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011sk9BLaUZDkPVAZ1sKhuDP --- plans/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plans/README.md b/plans/README.md index 56ce750aea..c5fbd8f5b7 100644 --- a/plans/README.md +++ b/plans/README.md @@ -1220,7 +1220,7 @@ surface, the other a data-corruption path on a first-party money schema. | Plan | Title | Findings | Pkg | Pri | Effort | Risk | Status | | ---- | ------------------------------------------------------------------ | ------------------- | ---------------------- | --- | ------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 265 | Make `v.bigint()`/`v.bytes()` round-trip on the DO row store | DO-01, SQL-01 | shard-engine/sql-store | P1 | M | MED | ⚠️ **SHIPPED WITH THE BLOCKERS UNFIXED — remediation on `fix/265-wire-codec-query-parity` (#365) is **itself blocked** — a thermo review found the `Number()` projection returns rows that are not equal above 2^53 and makes a `unique` index reject two distinct bigints, so it trades false negatives for false positives. Draft, do not merge. A BACKFILL IS REQUIRED, see the end of this cell.** The row previously read "BLOCKED — DO NOT MERGE"; that was wrong. The write side **did land on `alpha`** as `ab0afaf00` (#338) — `encodeDocJson`/`decodeDocJson` in `shard-engine/src/do-sql.ts`, called from six `ctx-db.ts` sites — but `serialize-sql.ts` and `estimate-bytes.ts` were **not in that commit**, so the thermos §11 findings are live defects on `alpha` today, not hypotheticals about a branch. Still live: **(a) `v.bigint()` is silently unqueryable** — storage holds `["$lunora.wire$","bigint","10"]` while `serializeSqlValue` (`serialize-sql.ts:21-23`) still renders the comparison as `"10"`, so `json_extract` never matches and `filter`/`withIndex`/`aggregate` return empty/0 on the `@lunora/payment` **money path**; **(b) CDC egress does not re-encode** (`ctx-db-cdc.ts:105` decodes, `shard-do.ts:2335` returns it raw), so bytes reach consumers as `{}`; **(c)** byte-identity is false for array-position `undefined`, `NaN`, `Infinity` and `Date`, and `patch` rewrites whole documents so the first patch silently migrates a legacy row. **Corrected since the review:** `estimateBytes` does _not_ throw or charge the 32 MiB cap — it returns `undefined` and `transaction-headroom.ts:100-110` raises `BAD_REQUEST` "not JSON-serializable", so with 270 landed (`d5721334a`) a bigint insert **fails loudly at the door**. The M1 introspect item is **resolved by decision**, not outstanding (`introspect.ts:842-862` documents why the admin path deliberately does not decode). The review missed all of this because the added test declares `indexes: []` and never filters or aggregates. See §11. **The remediation** projects top-level bigint/bytes to a SQL-comparable scalar (a JSON number / base64 string) inside `encodeDocJson` and parks the exact wire-tagged originals under a reserved `__sql__` key, with `serializeSqlValue` binding the same projection — teaching the query side the _tagged_ form was a 6-line diff but would have fixed equality only, leaving ranges, `ORDER BY`, `SUM` and `MIN`/`MAX` silently wrong, because a tagged array is still text to SQLite. Egress now re-encodes (`cdcSync` through `encodeWire`, `applyCdc` decoding it back). Two §11 items proved **not live**: `sql-store`'s `sqliteDecode` already has its bytes branch, and the introspect item is a documented decision from plan 300. A defect **introduced by the first remediation round and caught in review** is fixed in `250d0589e`: the reserved `__sql__` key silently destroyed a user field of that name (overwritten when a bigint was present, spread-and-dropped when not), defended by a docblock citing a "codegen column guard" that **does not exist** — `RESERVED_TABLE_NAMES` covers table names, `SYSTEM_INDEX_FIELDS` is just `["_creationTime","_id"]`. It now throws a typed `BAD_REQUEST` at the single write chokepoint. ⚠️ **Backfill**: rows written between `ab0afaf00` and this branch hold the bigint tagged in place — they decode fine, but `$.field` is still array text, so `filter`/`withIndex`/`ORDER BY`/`SUM` miss them. `patch`/`replace` re-project on write (pinned by test), so any rewrite migrates a row — but **a row nobody rewrites stays invisible to amount queries**, which for `paymentSessions` means exactly the completed sessions that are never touched again. A rewrite pass over affected tables is required before this reaches real payment data; the fix migrates nothing on its own | +| 265 | Make `v.bigint()`/`v.bytes()` round-trip on the DO row store | DO-01, SQL-01 | shard-engine/sql-store | P1 | M | MED | ⚠️ **SHIPPED WITH THE BLOCKERS UNFIXED — remediated in #365, ready for review. The first two rounds each shipped a fresh silent-wrong-answer bug — round two's `Number()` projection returned rows that are **not equal** above 2^53 and made a `unique` index reject two distinct bigints, trading false negatives for false positives. Round three stores a fixed-width order-preserving decimal key instead: exact `=`, numeric `ORDER BY`, writes past the 39-digit width refused rather than silently mis-sorted. The cost is `SUM` on the scan path, which now refuses a `v.bigint()` field rather than return the 1.5e40 that falls out of coercing padded text; `aggregateIndex` is the supported way to sum one. A BACKFILL IS REQUIRED, see the end of this cell.** The row previously read "BLOCKED — DO NOT MERGE"; that was wrong. The write side **did land on `alpha`** as `ab0afaf00` (#338) — `encodeDocJson`/`decodeDocJson` in `shard-engine/src/do-sql.ts`, called from six `ctx-db.ts` sites — but `serialize-sql.ts` and `estimate-bytes.ts` were **not in that commit**, so the thermos §11 findings are live defects on `alpha` today, not hypotheticals about a branch. Still live: **(a) `v.bigint()` is silently unqueryable** — storage holds `["$lunora.wire$","bigint","10"]` while `serializeSqlValue` (`serialize-sql.ts:21-23`) still renders the comparison as `"10"`, so `json_extract` never matches and `filter`/`withIndex`/`aggregate` return empty/0 on the `@lunora/payment` **money path**; **(b) CDC egress does not re-encode** (`ctx-db-cdc.ts:105` decodes, `shard-do.ts:2335` returns it raw), so bytes reach consumers as `{}`; **(c)** byte-identity is false for array-position `undefined`, `NaN`, `Infinity` and `Date`, and `patch` rewrites whole documents so the first patch silently migrates a legacy row. **Corrected since the review:** `estimateBytes` does _not_ throw or charge the 32 MiB cap — it returns `undefined` and `transaction-headroom.ts:100-110` raises `BAD_REQUEST` "not JSON-serializable", so with 270 landed (`d5721334a`) a bigint insert **fails loudly at the door**. The M1 introspect item is **resolved by decision**, not outstanding (`introspect.ts:842-862` documents why the admin path deliberately does not decode). The review missed all of this because the added test declares `indexes: []` and never filters or aggregates. See §11. **The remediation** projects top-level bigint/bytes to a SQL-comparable scalar (a JSON number / base64 string) inside `encodeDocJson` and parks the exact wire-tagged originals under a reserved `__sql__` key, with `serializeSqlValue` binding the same projection — teaching the query side the _tagged_ form was a 6-line diff but would have fixed equality only, leaving ranges, `ORDER BY`, `SUM` and `MIN`/`MAX` silently wrong, because a tagged array is still text to SQLite. Egress now re-encodes (`cdcSync` through `encodeWire`, `applyCdc` decoding it back). Two §11 items proved **not live**: `sql-store`'s `sqliteDecode` already has its bytes branch, and the introspect item is a documented decision from plan 300. A defect **introduced by the first remediation round and caught in review** is fixed in `250d0589e`: the reserved `__sql__` key silently destroyed a user field of that name (overwritten when a bigint was present, spread-and-dropped when not), defended by a docblock citing a "codegen column guard" that **does not exist** — `RESERVED_TABLE_NAMES` covers table names, `SYSTEM_INDEX_FIELDS` is just `["_creationTime","_id"]`. It now throws a typed `BAD_REQUEST` at the single write chokepoint. ⚠️ **Backfill**: rows written between `ab0afaf00` and this branch hold the bigint tagged in place — they decode fine, but `$.field` is still array text, so `filter`/`withIndex`/`ORDER BY`/`SUM` miss them. `patch`/`replace` re-project on write (pinned by test), so any rewrite migrates a row — but **a row nobody rewrites stays invisible to amount queries**, which for `paymentSessions` means exactly the completed sessions that are never touched again. A rewrite pass over affected tables is required before this reaches real payment data; the fix migrates nothing on its own | | 266 | Cross-tab cluster: offline queue, leadership handoff, watermarks | XTAB-01…03, DATA-01 | client | P1 | M | MED | ✅ **DONE — thermos-clean** — 8 commits ending `19c5685af`. Thermos found the branch hung EVERY optimistic overlay for 3 s on the plain single-tab path (`readClientWatermark` returns `0`, which is not nullish, so `frameWatermark ?? confirmedMutationWatermark` was permanently disabled — and delta frames carried no watermark at all). The executor's diagnosis improved on mine: the real defect was **stickiness**, not the `0`-vs-`undefined` ambiguity, since a boolean flag would still strand a demoted leader's stale value. Fixed with a **consume-once** `pendingFrameWatermark`, plus stamping the watermark on delta frames — closing the gap the original comment had waved off as "a follow-up", which was wrong because a `@lunora/db` list collection enters delta mode after frame one. Also hoisted the per-flush watermark read off the DO hot path, and `promoteImmediately()` removes the 3 s live-data blackout `setAuthToken` was causing on every JWT refresh. Reviewer re-ran client 630, do 518, db 85, api-check 43/43 | | 267 | Make the Node host's capability ratings + lifecycle tell the truth | NODE-01…03 | platform/platform-node | P1 | S–M | LOW–MED | **DONE** — `b46e94452` + `a4e126dae` on `advisor/…-platform`. Node `scheduler`/`shardAlarms` now rated **unsupported** with an honest note ("Jobs are stored and timed but never dispatched — no delivery, no retries"); `deadLetter` dropped (its presence was an at-least-once claim); `close()` made terminal; `transaction` given a dedicated `transactionTail` lane rather than the naive `runSerialized` routing that would deadlock. Reviewer re-ran platform 43, platform-node 50/4-skipped, codegen 1006. One REVISE round: the branch had edited a `plans/` file (already deleted here) — rewritten out, `packages/**` byte-identical | | 268 | Give the conformance TCK teeth (delivery, skips, cleanup) | TCK-01…03 | platform | P2 | M | MED | **DONE** — `8fca54701`, same branch. 43 bare `cleanup?.()` calls wrapped in `withHost` try/finally, 14 synthetic `expect(true).toBe(true)` skips converted to real `context.skip()`, and a new delivery leg that FAILS a host claiming `deadLetter` without provable dispatch. Verified against the **real workerd host** (`LUNORA_WORKERD_TESTS=1` → 570 passed/12 skipped) and reviewer confirmed the leg bites: reverting the Node timer body turns 2 skips into **3 failures**. ⚠ Environment finding: a bare `pnpm --filter "@lunora/do" run test` does NOT run the workerd project — set the env var for workerd-touching work | From c9c99370bb2e3c0c950dc1317fe16f7c6dd135b6 Mon Sep 17 00:00:00 2001 From: Daniel Bannert Date: Sat, 8 Aug 2026 15:34:41 +0200 Subject: [PATCH 2/2] fix(plans): restore prettier formatting in the plan index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The table-row rewrites in #366 left the column padding ragged, and the check that should have caught it was run from the main checkout against a path under .worktrees/, which prettier ignores — so it checked zero files and reported success. prettier --check . is a required lint job, and CI runs it against refs/pull/N/merge, so this failed every open PR rather than just the one that introduced it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011sk9BLaUZDkPVAZ1sKhuDP --- plans/README.md | 106 ++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/plans/README.md b/plans/README.md index c5fbd8f5b7..4c32fcd3e1 100644 --- a/plans/README.md +++ b/plans/README.md @@ -724,32 +724,32 @@ parameterization. ### Plans -| Plan | Title | Findings | Category | Pkg | Pri | Effort | Risk | Status | -| ---- | --------------------------------------------------------------------------- | ----------------------------- | ------------ | --------------- | ----- | ------ | ------- | ------ | -| 138 | Close mask() oracle on where-batch-writes + `baseWhere` reads | SERVER-01/02 | security | server | P1 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 139 | Fail RAG lexical store closed on all non-empty filters | AI-01 | security | ai | P1 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 140 | Harden x402 spend policy (asset, per-run race, unbounded allowlist) | X402-01/02/03 | security | x402 | P1 | S–M | MED | DONE | -| 141 | Bind agent tool-approval to thread+call; close id-less concurrency bypass | AGENT-01/02 | security | agent | P1 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 142 | Reconcile `triggers.crons` on deploy/prepare (crons never fire in prod) | CLI-01 | bug | cli | P1 | M | MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 143 | External-source ingest correctness (Date/bigint brick + edges) | DO-01…05 | bug | shard-engine | P1/P3 | M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below. Code has since moved `@lunora/do` → `@lunora/shard-engine` (`external-source-lift.ts`) | -| 144 | Scheduled actions get an ActionCtx in the harness | TESTING-01 | tests | testing | P2 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 145 | x402 charge: settle before committing paid mutations; deliver receipt sink | X402-04/05 | security/bug | x402 | P2 | M | MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 146 | Replica event-log: atomic/idempotent append, per-materializer watermark | REPLICA-02/03/04 | bug | replica | P2 | M | MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 147 | Bound agent memory hot-path `.collect()`s (graph seeds, thread messages) | AGENT-03/04 | perf | agent | P2 | M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 148 | Sourced-DO alarm re-arms at next-due, not the 2 s floor | DO-06 | perf | do/codegen | P3 | S–M | MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 149 | Agent-chat optimistic echo for repeated prompts (5 adapters) | REACT-01 | bug | react+4 | P2 | S–M | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below; the shared core was later extracted to `client/src/agent-chat-reconcile.ts` (plan 188) | -| 150 | Port pagination reentrancy guard to Svelte/Solid (sub leak) | SVELTE-01/SOLID-01 | bug | svelte/solid | P2 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 151 | Surface failures on Studio org-admin row actions | STUDIO-01 | bug | studio | P2 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 152 | Sanitize `fingerprintError` outputs (NUL/surrogate) + bucketer | FP-02/03 | bug | fingerprint | P3 | S | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 153 | Codegen agent-discovery guards (uniqueness/wrapped/cron/shadow) | CODEGEN-01…04 | bug | codegen | P3 | S–M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 154 | CLI correctness cluster (env-set dup, entry probe, loopback, PM cast) | CLI-02…05 | bug | cli | P3 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 155 | Dedup detectors/constants across config & codegen | CONFIG-01/02/03, CODEGEN-05 | tech-debt | config/codegen | P3 | S–M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 156 | Fix Creem email-recovery cross-tenant customer binding | PAY-01 | security | payment | P2 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 157 | RAG hybrid-scoring cliff, inert text-store importance, fail-fast index | AI-02/03/04 | bug/perf | ai | P3 | S–M | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 158 | Small client/react/rn fixes (reset, stream leak, resubscribe, native voice) | CLIENT-04/05, REACT-02, RN-01 | bug/perf | client/react/rn | P3 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | -| 159 | Replica remaining correctness (adapter/replay/growth/EventSource/sync) | REPLICA-01/05/06/07/08/09 | bug | replica | P3 | S–M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below, **except** REPLICA-06 (partial, per its STOP) and REPLICA-01 (fixture never run against real sqlite-wasm) | -| 160 | Consolidate the ~2k-line voice/agent surface across 5 adapters | CLIENT-06 | tech-debt | client+5 | P3 | M–L | LOW–MED | ⏸ DEFERRED — the one row of this wave that did NOT ship, and the plan file stays. Still five copies of `voice-audio.ts` (~327 lines each) and five of `use-voice-agent` (~490 each) across react/vue/solid/svelte/angular | -| 161 | Agent misc: discriminate as-tool create errors; container-gate scope | AGENT-05/06 | bug/docs | agent | P3 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| Plan | Title | Findings | Category | Pkg | Pri | Effort | Risk | Status | +| ---- | --------------------------------------------------------------------------- | ----------------------------- | ------------ | --------------- | ----- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 138 | Close mask() oracle on where-batch-writes + `baseWhere` reads | SERVER-01/02 | security | server | P1 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 139 | Fail RAG lexical store closed on all non-empty filters | AI-01 | security | ai | P1 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 140 | Harden x402 spend policy (asset, per-run race, unbounded allowlist) | X402-01/02/03 | security | x402 | P1 | S–M | MED | DONE | +| 141 | Bind agent tool-approval to thread+call; close id-less concurrency bypass | AGENT-01/02 | security | agent | P1 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 142 | Reconcile `triggers.crons` on deploy/prepare (crons never fire in prod) | CLI-01 | bug | cli | P1 | M | MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 143 | External-source ingest correctness (Date/bigint brick + edges) | DO-01…05 | bug | shard-engine | P1/P3 | M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below. Code has since moved `@lunora/do` → `@lunora/shard-engine` (`external-source-lift.ts`) | +| 144 | Scheduled actions get an ActionCtx in the harness | TESTING-01 | tests | testing | P2 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 145 | x402 charge: settle before committing paid mutations; deliver receipt sink | X402-04/05 | security/bug | x402 | P2 | M | MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 146 | Replica event-log: atomic/idempotent append, per-materializer watermark | REPLICA-02/03/04 | bug | replica | P2 | M | MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 147 | Bound agent memory hot-path `.collect()`s (graph seeds, thread messages) | AGENT-03/04 | perf | agent | P2 | M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 148 | Sourced-DO alarm re-arms at next-due, not the 2 s floor | DO-06 | perf | do/codegen | P3 | S–M | MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 149 | Agent-chat optimistic echo for repeated prompts (5 adapters) | REACT-01 | bug | react+4 | P2 | S–M | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below; the shared core was later extracted to `client/src/agent-chat-reconcile.ts` (plan 188) | +| 150 | Port pagination reentrancy guard to Svelte/Solid (sub leak) | SVELTE-01/SOLID-01 | bug | svelte/solid | P2 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 151 | Surface failures on Studio org-admin row actions | STUDIO-01 | bug | studio | P2 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 152 | Sanitize `fingerprintError` outputs (NUL/surrogate) + bucketer | FP-02/03 | bug | fingerprint | P3 | S | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 153 | Codegen agent-discovery guards (uniqueness/wrapped/cron/shadow) | CODEGEN-01…04 | bug | codegen | P3 | S–M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 154 | CLI correctness cluster (env-set dup, entry probe, loopback, PM cast) | CLI-02…05 | bug | cli | P3 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 155 | Dedup detectors/constants across config & codegen | CONFIG-01/02/03, CODEGEN-05 | tech-debt | config/codegen | P3 | S–M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 156 | Fix Creem email-recovery cross-tenant customer binding | PAY-01 | security | payment | P2 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 157 | RAG hybrid-scoring cliff, inert text-store importance, fail-fast index | AI-02/03/04 | bug/perf | ai | P3 | S–M | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 158 | Small client/react/rn fixes (reset, stream leak, resubscribe, native voice) | CLIENT-04/05, REACT-02, RN-01 | bug/perf | client/react/rn | P3 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | +| 159 | Replica remaining correctness (adapter/replay/growth/EventSource/sync) | REPLICA-01/05/06/07/08/09 | bug | replica | P3 | S–M | LOW–MED | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below, **except** REPLICA-06 (partial, per its STOP) and REPLICA-01 (fixture never run against real sqlite-wasm) | +| 160 | Consolidate the ~2k-line voice/agent surface across 5 adapters | CLIENT-06 | tech-debt | client+5 | P3 | M–L | LOW–MED | ⏸ DEFERRED — the one row of this wave that did NOT ship, and the plan file stays. Still five copies of `voice-audio.ts` (~327 lines each) and five of `use-voice-agent` (~490 each) across react/vue/solid/svelte/angular | +| 161 | Agent misc: discriminate as-tool create errors; container-gate scope | AGENT-05/06 | bug/docs | agent | P3 | S | LOW | ✅ DONE — shipped to `alpha` in the wave-13 squash `a2d60e529` (#146); per-plan gate results in the execution table below | | 162 | crossTabSync leader demotion + offline-queue FIFO; relay design | CLIENT-01/02/03 | bug/design | client | P3 | M–L | MED | ◐ PARTIAL — by design. Leader demotion (`client/src/cross-tab.ts`) and offline-queue FIFO shipped in the squash; **CLIENT-01 (subscribe relay) is design-only** — no follower→leader message exists in the wire union, the deliverable is [162-phase0-crosstabsync-design.md](162-phase0-crosstabsync-design.md) | ### Recommended execution order & dependencies @@ -1218,28 +1218,28 @@ surface, the other a data-corruption path on a first-party money schema. ### Tier 2 — correctness -| Plan | Title | Findings | Pkg | Pri | Effort | Risk | Status | -| ---- | ------------------------------------------------------------------ | ------------------- | ---------------------- | --- | ------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Plan | Title | Findings | Pkg | Pri | Effort | Risk | Status | +| ---- | ------------------------------------------------------------------ | ------------------- | ---------------------- | --- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 265 | Make `v.bigint()`/`v.bytes()` round-trip on the DO row store | DO-01, SQL-01 | shard-engine/sql-store | P1 | M | MED | ⚠️ **SHIPPED WITH THE BLOCKERS UNFIXED — remediated in #365, ready for review. The first two rounds each shipped a fresh silent-wrong-answer bug — round two's `Number()` projection returned rows that are **not equal** above 2^53 and made a `unique` index reject two distinct bigints, trading false negatives for false positives. Round three stores a fixed-width order-preserving decimal key instead: exact `=`, numeric `ORDER BY`, writes past the 39-digit width refused rather than silently mis-sorted. The cost is `SUM` on the scan path, which now refuses a `v.bigint()` field rather than return the 1.5e40 that falls out of coercing padded text; `aggregateIndex` is the supported way to sum one. A BACKFILL IS REQUIRED, see the end of this cell.** The row previously read "BLOCKED — DO NOT MERGE"; that was wrong. The write side **did land on `alpha`** as `ab0afaf00` (#338) — `encodeDocJson`/`decodeDocJson` in `shard-engine/src/do-sql.ts`, called from six `ctx-db.ts` sites — but `serialize-sql.ts` and `estimate-bytes.ts` were **not in that commit**, so the thermos §11 findings are live defects on `alpha` today, not hypotheticals about a branch. Still live: **(a) `v.bigint()` is silently unqueryable** — storage holds `["$lunora.wire$","bigint","10"]` while `serializeSqlValue` (`serialize-sql.ts:21-23`) still renders the comparison as `"10"`, so `json_extract` never matches and `filter`/`withIndex`/`aggregate` return empty/0 on the `@lunora/payment` **money path**; **(b) CDC egress does not re-encode** (`ctx-db-cdc.ts:105` decodes, `shard-do.ts:2335` returns it raw), so bytes reach consumers as `{}`; **(c)** byte-identity is false for array-position `undefined`, `NaN`, `Infinity` and `Date`, and `patch` rewrites whole documents so the first patch silently migrates a legacy row. **Corrected since the review:** `estimateBytes` does _not_ throw or charge the 32 MiB cap — it returns `undefined` and `transaction-headroom.ts:100-110` raises `BAD_REQUEST` "not JSON-serializable", so with 270 landed (`d5721334a`) a bigint insert **fails loudly at the door**. The M1 introspect item is **resolved by decision**, not outstanding (`introspect.ts:842-862` documents why the admin path deliberately does not decode). The review missed all of this because the added test declares `indexes: []` and never filters or aggregates. See §11. **The remediation** projects top-level bigint/bytes to a SQL-comparable scalar (a JSON number / base64 string) inside `encodeDocJson` and parks the exact wire-tagged originals under a reserved `__sql__` key, with `serializeSqlValue` binding the same projection — teaching the query side the _tagged_ form was a 6-line diff but would have fixed equality only, leaving ranges, `ORDER BY`, `SUM` and `MIN`/`MAX` silently wrong, because a tagged array is still text to SQLite. Egress now re-encodes (`cdcSync` through `encodeWire`, `applyCdc` decoding it back). Two §11 items proved **not live**: `sql-store`'s `sqliteDecode` already has its bytes branch, and the introspect item is a documented decision from plan 300. A defect **introduced by the first remediation round and caught in review** is fixed in `250d0589e`: the reserved `__sql__` key silently destroyed a user field of that name (overwritten when a bigint was present, spread-and-dropped when not), defended by a docblock citing a "codegen column guard" that **does not exist** — `RESERVED_TABLE_NAMES` covers table names, `SYSTEM_INDEX_FIELDS` is just `["_creationTime","_id"]`. It now throws a typed `BAD_REQUEST` at the single write chokepoint. ⚠️ **Backfill**: rows written between `ab0afaf00` and this branch hold the bigint tagged in place — they decode fine, but `$.field` is still array text, so `filter`/`withIndex`/`ORDER BY`/`SUM` miss them. `patch`/`replace` re-project on write (pinned by test), so any rewrite migrates a row — but **a row nobody rewrites stays invisible to amount queries**, which for `paymentSessions` means exactly the completed sessions that are never touched again. A rewrite pass over affected tables is required before this reaches real payment data; the fix migrates nothing on its own | -| 266 | Cross-tab cluster: offline queue, leadership handoff, watermarks | XTAB-01…03, DATA-01 | client | P1 | M | MED | ✅ **DONE — thermos-clean** — 8 commits ending `19c5685af`. Thermos found the branch hung EVERY optimistic overlay for 3 s on the plain single-tab path (`readClientWatermark` returns `0`, which is not nullish, so `frameWatermark ?? confirmedMutationWatermark` was permanently disabled — and delta frames carried no watermark at all). The executor's diagnosis improved on mine: the real defect was **stickiness**, not the `0`-vs-`undefined` ambiguity, since a boolean flag would still strand a demoted leader's stale value. Fixed with a **consume-once** `pendingFrameWatermark`, plus stamping the watermark on delta frames — closing the gap the original comment had waved off as "a follow-up", which was wrong because a `@lunora/db` list collection enters delta mode after frame one. Also hoisted the per-flush watermark read off the DO hot path, and `promoteImmediately()` removes the 3 s live-data blackout `setAuthToken` was causing on every JWT refresh. Reviewer re-ran client 630, do 518, db 85, api-check 43/43 | -| 267 | Make the Node host's capability ratings + lifecycle tell the truth | NODE-01…03 | platform/platform-node | P1 | S–M | LOW–MED | **DONE** — `b46e94452` + `a4e126dae` on `advisor/…-platform`. Node `scheduler`/`shardAlarms` now rated **unsupported** with an honest note ("Jobs are stored and timed but never dispatched — no delivery, no retries"); `deadLetter` dropped (its presence was an at-least-once claim); `close()` made terminal; `transaction` given a dedicated `transactionTail` lane rather than the naive `runSerialized` routing that would deadlock. Reviewer re-ran platform 43, platform-node 50/4-skipped, codegen 1006. One REVISE round: the branch had edited a `plans/` file (already deleted here) — rewritten out, `packages/**` byte-identical | -| 268 | Give the conformance TCK teeth (delivery, skips, cleanup) | TCK-01…03 | platform | P2 | M | MED | **DONE** — `8fca54701`, same branch. 43 bare `cleanup?.()` calls wrapped in `withHost` try/finally, 14 synthetic `expect(true).toBe(true)` skips converted to real `context.skip()`, and a new delivery leg that FAILS a host claiming `deadLetter` without provable dispatch. Verified against the **real workerd host** (`LUNORA_WORKERD_TESTS=1` → 570 passed/12 skipped) and reviewer confirmed the leg bites: reverting the Node timer body turns 2 skips into **3 failures**. ⚠ Environment finding: a bare `pnpm --filter "@lunora/do" run test` does NOT run the workerd project — set the env var for workerd-touching work | -| 269 | Let an RLS-guarded `query()` stage a search on a `.global()` table | RLS-01 | sql-store/server | P2 | S | LOW | **DONE** — `f7f13269f` on `advisor/269-rls-global-search`; the bare-reader `filter()` throw removed so RLS can stage a predicate before `.withSearchIndex()`, with `LEGACY_READER_ERROR` kept on the terminals where it belongs. Reviewer re-ran sql-store 97, server 542. §9.1 answered: the RLS harness stubs `withSearchIndex` to throw, so it genuinely cannot host this integration — coverage stays at the sql-store level | -| 270 | Masked-reader `asyncIterator` + unserializable-value byte estimate | MASK-02, EST-01 | server/shard-engine | P3 | S | LOW | **DONE** — `2cb6c89fa` + `186962855`, stacked on 269. Masked readers regain `[Symbol.asyncIterator]`; `estimateBytes` now returns `undefined` for an unserializable value so the meter throws `BAD_REQUEST` naming the real cause and the cache declines to memoize instead of charging the whole 4 MiB budget. The pinned `estimateBytes(cyclic, 999) === 999` assertion was updated to `toBeUndefined()` — the deliberate contract change, pre-authorized. Reviewer re-ran server 542, shard-engine 934, do 516 | -| 271 | Reject malformed geo inputs instead of silently-empty results | GEO-01 | shard-engine | P3 | S–M | LOW | **DONE** — `5635791a3` on `advisor/…-shard-engine`; `assertGeoPoint` + radius/transposed/antimeridian rejection in `createGeoBuilder`. Chose **reject** over split-the-box for the antimeridian (D2), recorded as an open question rather than silently deferred. Reviewer re-ran shard-engine 952, do 516 | -| 272 | Compute the search prefix bound by code point, not code unit | SEARCH-01 | search-core | P3 | S | LOW | **DONE** — `d4faa4deb`; prefix bound derived from the last **code point** with a refusal at the surrogate boundary. The executor caught its own mis-derived expected value (U+103FF successor is U+10400, a normal widen, not a refusal) **before** running it. Honest note: the astral E2E cases pass pre-fix too — the defect is only observable at the boundary tokens, which are unit-tested. Reviewer re-ran search-core 85 | -| 273 | Port the images `baseUrl`-has-a-path guard to `@lunora/storage` | STOR-01 | storage | P2 | S | LOW | **DONE** — `61d7c7670`; **improved on the plan**, which said to copy the images guard verbatim — that broke an existing multi-trailing-slash test (`https://cdn.test//` → pathname `"//"`), so it uses `ONLY_SLASHES_RE = /^\/+$/u` to match `trimTrailingSlashes`' semantics, with a regression test pinning bare/root/double-slash to identical URLs. The load-bearing scheme-less bare-host test still passes. Reviewer re-ran storage 109 | -| 274 | Restore same-table re-seeding + drop the render-phase facet write | STUDIO-01/02 | studio | P2 | M | MED | ✅ **DONE — thermos-clean** — `3ff68d967` + `5535f49bd` + `9db6af749`. Thermos found the fix was **worse than what it replaced**: `seededViewKey` only advanced inside the re-seed branch, so after the first URL echo it froze, the mirror guard short-circuited forever, and the next render misread further typing as an external apply — **reverting it and wiping staged inline edits, the open cell editor and page offset**. Fixed by advancing `seededViewKey` on the harmless echo, making the guard's stated invariant actually true. New test types, waits for the echo, stages an edit, types again, and asserts the second change survives WITH the staged edit — confirmed failing pre-fix. Reviewer re-ran studio 1001, and 68/68 in isolation | -| 275 | Bound the scheduler's record listing + cap queue batch fan-out | SCHED-01, Q-01 | scheduler/queue | P2 | M | MED | **DONE** — `83f8bc3ae` + `3f1d4f23a` on `advisor/275-scheduler-and-queue-bounds`. ⚠ **WIRE SHAPE CHANGE**: `/list` and the WS `jobs` message now carry `{ records, truncated }` with `records` capped at 100; `/status`/`/pool` keep exact counts via a bounded `limit`+`startAfter` cursor loop. A consumer sweep confirmed Studio and `@lunora/client` tolerate the new field but **cannot surface `truncated`** without a client-type change — recorded as a follow-up, not forced in scope. `MAX_QUEUE_BATCH=100` guards added to both batch producers. Reviewer re-ran scheduler 127, queue 43, api-snapshot 43/43 | -| 276 | Observability: evict rather than go blind, redact spans, fix prose | OBS-01…04 | observability | P2 | M | LOW–MED | ✅ **DONE — thermos-clean** — 7 commits ending `3a2223354`. **Policy reversed on review**: the LRU eviction was reverted to drop-on-full plus the missing `capped` signal, because the plan's actual finding was that the drop was _silent_, not that it was wrong — LRU inverted the protection (a flood would evict the app's real metrics) and put an unindexed sort on the shard's hottest write path. `query-metrics`' `last_seen_at` column removed with it rather than left as unused write cost. All three `admit*` helpers now return `boolean` with callers honouring it — `admitNewSeries` had been `void` and ignored, which had quietly turned `METRIC_HISTORY_MAX_SERIES` into a no-op cap. `describeFailure` un-exported (it was public solely for a test). Reviewer confirmed the worktree's cross-branch contamination cleared, `api:check` **43/43**, observability 224, do 516 | -| 277 | Memoize the agent tool-approval gate in a durable step | AGENT-01 | agent | P2 | S–M | LOW | **DONE** — `69d1f59cb`, stacked on 259's branch; reviewer independently confirmed 4 tests fail against base `agent-loop.ts` (the flip-flop case reproducing the real 5 s hang). In-scope deviation approved: `AgentApprovalContext` also exported from `index.ts` so the new public type is usable, alongside its sibling `AgentToolContext` | -| 278 | Honour `disableSignUp`, fix the invite bounce URL, keep form state | AUI-03…05 | auth-ui | P2 | S–M | MED | **DONE (2 of 3 fixed, 1 measured-and-accepted)** — `d0a5517e5` gates the sign-up card, route and footer link on the discovered flag across **all five ports**; `3e552be17` extracts `mergeQuery` and fixes the invitation bounce. **AUI-05 (discovery rebuild) was measured and ACCEPTED, not fixed** — the plan required measuring first; the decision is documented beside `discoveryKey` in `provider.tsx` and pinned by a characterization test. Vue/Angular share the mechanism; Solid/Svelte do not. Reviewer re-ran 316/316 | -| 279 | Make `broadcast({ limit: 0 })` reach nobody | NOTIFY-01 | notify | P3 | S | LOW | **DONE** — `7745981af`. Non-positive limits short-circuit in **both** `broadcast` and `broadcastPage` before the store or `deliverPage` is touched — the plan's §4 correction was honoured (a `Math.max(1, …)` clamp would still have delivered to one recipient at a zero budget). Reviewer re-ran notify 114 | -| 280 | Record the auth events that actually authenticate + validate reads | AUTH-01/02 | auth | P2 | M | MED | 🟡 **MOSTLY DONE** — `1bf5ff3b1`. Reclassification shipped (`/sign-in/social` + `/sign-in/magic-link` → `sign-in-initiated`; `/callback/:id`, `/magic-link/verify`, the three `/two-factor/verify-*` → `sign-in`, previously unrecorded) plus `targetEmail` as a top-level column and validated audit-read options. **One sub-feature dropped with cause**: the S0 gate proved better-auth runs the app's own `hooks.after` BEFORE a plugin's, so this hook structurally _cannot_ observe `twoFactor`'s `{twoFactorRedirect:true}` rewrite — "sign-in-challenged" needs a different seam and its own plan. Also corrected the plan's `/oauth2/callback/*` claim against the installed dist. **⚠ Surfaced a live alpha bug — see below** | -| 281 | Make the Nuxt `worker.ts` guard check what it claims to check | NUXT-01 | nuxt | P3 | S | LOW | ✅ **DONE** — `6a64f838e`; the inert `existsSync` guard now reads the entry (try/catch, degrading to a "could not read" warning) and checks for a `ShardDO` export, mirroring the Astro sibling. `templates/nuxt/worker.ts` verified to pass. 7 tests, nuxt 22/22 | -| 282 | Guard Vue and Svelte eager subscriptions against SSR | VUE-01, SVELTE-01 | vue/svelte | P2 | S | LOW | **DONE** — `f6c251720` + `caf9cae9d` on `advisor/…-adapters`. One shared `shared/is-browser.ts` replaces four inline copies; Vue's `useQuery`/`useSubscription`/paginated watcher and Svelte's `agent()`/`rate-limit` now no-op during SSR. **Hit a real STOP** (the guard broke 33 pre-existing tests across 7 files, incl. agent composables the audit never identified as consumers) — adjudicated: the tests encoded the bug, since `vitest.config.ts` is `environment: "node"` and `use-presence.test.ts` already stubs `window` for the one composable that was already guarded. Solid/Angular verified already-safe and pinned as non-goals. Reviewer confirmed 4 Vue tests fail against base | -| 283 | Reset the Angular upload signals on restart | NG-01 | angular | P3 | S | LOW | **DONE** — `0c8ced8b4`; `start()` resets error/result/progress/isPaused, and `pause()`/`resume()` are guarded on an in-flight upload. The existing `:157` test paused from `"idle"` — i.e. it encoded the bug — and was updated to drive `setOnStart` first, recorded in the commit body. Reviewer confirmed 5 Angular tests fail against base; angular 105/105 | -| 284 | Wake `EventSource.events()` on abort | REPL-01 | replica | P3 | S | LOW | **DONE** — `4ea3f5f87`; the idle park now settles on abort and the listener is removed in `finally`. **The speculative half was correctly NOT built**: the phase-1 re-yield repro passed even pre-fix (`getSince`'s snapshot-at-fetch-time semantics make the overlap unreachable), so no dedup was added — the repro is kept as a regression pin. Reviewer re-ran replica 337 | +| 266 | Cross-tab cluster: offline queue, leadership handoff, watermarks | XTAB-01…03, DATA-01 | client | P1 | M | MED | ✅ **DONE — thermos-clean** — 8 commits ending `19c5685af`. Thermos found the branch hung EVERY optimistic overlay for 3 s on the plain single-tab path (`readClientWatermark` returns `0`, which is not nullish, so `frameWatermark ?? confirmedMutationWatermark` was permanently disabled — and delta frames carried no watermark at all). The executor's diagnosis improved on mine: the real defect was **stickiness**, not the `0`-vs-`undefined` ambiguity, since a boolean flag would still strand a demoted leader's stale value. Fixed with a **consume-once** `pendingFrameWatermark`, plus stamping the watermark on delta frames — closing the gap the original comment had waved off as "a follow-up", which was wrong because a `@lunora/db` list collection enters delta mode after frame one. Also hoisted the per-flush watermark read off the DO hot path, and `promoteImmediately()` removes the 3 s live-data blackout `setAuthToken` was causing on every JWT refresh. Reviewer re-ran client 630, do 518, db 85, api-check 43/43 | +| 267 | Make the Node host's capability ratings + lifecycle tell the truth | NODE-01…03 | platform/platform-node | P1 | S–M | LOW–MED | **DONE** — `b46e94452` + `a4e126dae` on `advisor/…-platform`. Node `scheduler`/`shardAlarms` now rated **unsupported** with an honest note ("Jobs are stored and timed but never dispatched — no delivery, no retries"); `deadLetter` dropped (its presence was an at-least-once claim); `close()` made terminal; `transaction` given a dedicated `transactionTail` lane rather than the naive `runSerialized` routing that would deadlock. Reviewer re-ran platform 43, platform-node 50/4-skipped, codegen 1006. One REVISE round: the branch had edited a `plans/` file (already deleted here) — rewritten out, `packages/**` byte-identical | +| 268 | Give the conformance TCK teeth (delivery, skips, cleanup) | TCK-01…03 | platform | P2 | M | MED | **DONE** — `8fca54701`, same branch. 43 bare `cleanup?.()` calls wrapped in `withHost` try/finally, 14 synthetic `expect(true).toBe(true)` skips converted to real `context.skip()`, and a new delivery leg that FAILS a host claiming `deadLetter` without provable dispatch. Verified against the **real workerd host** (`LUNORA_WORKERD_TESTS=1` → 570 passed/12 skipped) and reviewer confirmed the leg bites: reverting the Node timer body turns 2 skips into **3 failures**. ⚠ Environment finding: a bare `pnpm --filter "@lunora/do" run test` does NOT run the workerd project — set the env var for workerd-touching work | +| 269 | Let an RLS-guarded `query()` stage a search on a `.global()` table | RLS-01 | sql-store/server | P2 | S | LOW | **DONE** — `f7f13269f` on `advisor/269-rls-global-search`; the bare-reader `filter()` throw removed so RLS can stage a predicate before `.withSearchIndex()`, with `LEGACY_READER_ERROR` kept on the terminals where it belongs. Reviewer re-ran sql-store 97, server 542. §9.1 answered: the RLS harness stubs `withSearchIndex` to throw, so it genuinely cannot host this integration — coverage stays at the sql-store level | +| 270 | Masked-reader `asyncIterator` + unserializable-value byte estimate | MASK-02, EST-01 | server/shard-engine | P3 | S | LOW | **DONE** — `2cb6c89fa` + `186962855`, stacked on 269. Masked readers regain `[Symbol.asyncIterator]`; `estimateBytes` now returns `undefined` for an unserializable value so the meter throws `BAD_REQUEST` naming the real cause and the cache declines to memoize instead of charging the whole 4 MiB budget. The pinned `estimateBytes(cyclic, 999) === 999` assertion was updated to `toBeUndefined()` — the deliberate contract change, pre-authorized. Reviewer re-ran server 542, shard-engine 934, do 516 | +| 271 | Reject malformed geo inputs instead of silently-empty results | GEO-01 | shard-engine | P3 | S–M | LOW | **DONE** — `5635791a3` on `advisor/…-shard-engine`; `assertGeoPoint` + radius/transposed/antimeridian rejection in `createGeoBuilder`. Chose **reject** over split-the-box for the antimeridian (D2), recorded as an open question rather than silently deferred. Reviewer re-ran shard-engine 952, do 516 | +| 272 | Compute the search prefix bound by code point, not code unit | SEARCH-01 | search-core | P3 | S | LOW | **DONE** — `d4faa4deb`; prefix bound derived from the last **code point** with a refusal at the surrogate boundary. The executor caught its own mis-derived expected value (U+103FF successor is U+10400, a normal widen, not a refusal) **before** running it. Honest note: the astral E2E cases pass pre-fix too — the defect is only observable at the boundary tokens, which are unit-tested. Reviewer re-ran search-core 85 | +| 273 | Port the images `baseUrl`-has-a-path guard to `@lunora/storage` | STOR-01 | storage | P2 | S | LOW | **DONE** — `61d7c7670`; **improved on the plan**, which said to copy the images guard verbatim — that broke an existing multi-trailing-slash test (`https://cdn.test//` → pathname `"//"`), so it uses `ONLY_SLASHES_RE = /^\/+$/u` to match `trimTrailingSlashes`' semantics, with a regression test pinning bare/root/double-slash to identical URLs. The load-bearing scheme-less bare-host test still passes. Reviewer re-ran storage 109 | +| 274 | Restore same-table re-seeding + drop the render-phase facet write | STUDIO-01/02 | studio | P2 | M | MED | ✅ **DONE — thermos-clean** — `3ff68d967` + `5535f49bd` + `9db6af749`. Thermos found the fix was **worse than what it replaced**: `seededViewKey` only advanced inside the re-seed branch, so after the first URL echo it froze, the mirror guard short-circuited forever, and the next render misread further typing as an external apply — **reverting it and wiping staged inline edits, the open cell editor and page offset**. Fixed by advancing `seededViewKey` on the harmless echo, making the guard's stated invariant actually true. New test types, waits for the echo, stages an edit, types again, and asserts the second change survives WITH the staged edit — confirmed failing pre-fix. Reviewer re-ran studio 1001, and 68/68 in isolation | +| 275 | Bound the scheduler's record listing + cap queue batch fan-out | SCHED-01, Q-01 | scheduler/queue | P2 | M | MED | **DONE** — `83f8bc3ae` + `3f1d4f23a` on `advisor/275-scheduler-and-queue-bounds`. ⚠ **WIRE SHAPE CHANGE**: `/list` and the WS `jobs` message now carry `{ records, truncated }` with `records` capped at 100; `/status`/`/pool` keep exact counts via a bounded `limit`+`startAfter` cursor loop. A consumer sweep confirmed Studio and `@lunora/client` tolerate the new field but **cannot surface `truncated`** without a client-type change — recorded as a follow-up, not forced in scope. `MAX_QUEUE_BATCH=100` guards added to both batch producers. Reviewer re-ran scheduler 127, queue 43, api-snapshot 43/43 | +| 276 | Observability: evict rather than go blind, redact spans, fix prose | OBS-01…04 | observability | P2 | M | LOW–MED | ✅ **DONE — thermos-clean** — 7 commits ending `3a2223354`. **Policy reversed on review**: the LRU eviction was reverted to drop-on-full plus the missing `capped` signal, because the plan's actual finding was that the drop was _silent_, not that it was wrong — LRU inverted the protection (a flood would evict the app's real metrics) and put an unindexed sort on the shard's hottest write path. `query-metrics`' `last_seen_at` column removed with it rather than left as unused write cost. All three `admit*` helpers now return `boolean` with callers honouring it — `admitNewSeries` had been `void` and ignored, which had quietly turned `METRIC_HISTORY_MAX_SERIES` into a no-op cap. `describeFailure` un-exported (it was public solely for a test). Reviewer confirmed the worktree's cross-branch contamination cleared, `api:check` **43/43**, observability 224, do 516 | +| 277 | Memoize the agent tool-approval gate in a durable step | AGENT-01 | agent | P2 | S–M | LOW | **DONE** — `69d1f59cb`, stacked on 259's branch; reviewer independently confirmed 4 tests fail against base `agent-loop.ts` (the flip-flop case reproducing the real 5 s hang). In-scope deviation approved: `AgentApprovalContext` also exported from `index.ts` so the new public type is usable, alongside its sibling `AgentToolContext` | +| 278 | Honour `disableSignUp`, fix the invite bounce URL, keep form state | AUI-03…05 | auth-ui | P2 | S–M | MED | **DONE (2 of 3 fixed, 1 measured-and-accepted)** — `d0a5517e5` gates the sign-up card, route and footer link on the discovered flag across **all five ports**; `3e552be17` extracts `mergeQuery` and fixes the invitation bounce. **AUI-05 (discovery rebuild) was measured and ACCEPTED, not fixed** — the plan required measuring first; the decision is documented beside `discoveryKey` in `provider.tsx` and pinned by a characterization test. Vue/Angular share the mechanism; Solid/Svelte do not. Reviewer re-ran 316/316 | +| 279 | Make `broadcast({ limit: 0 })` reach nobody | NOTIFY-01 | notify | P3 | S | LOW | **DONE** — `7745981af`. Non-positive limits short-circuit in **both** `broadcast` and `broadcastPage` before the store or `deliverPage` is touched — the plan's §4 correction was honoured (a `Math.max(1, …)` clamp would still have delivered to one recipient at a zero budget). Reviewer re-ran notify 114 | +| 280 | Record the auth events that actually authenticate + validate reads | AUTH-01/02 | auth | P2 | M | MED | 🟡 **MOSTLY DONE** — `1bf5ff3b1`. Reclassification shipped (`/sign-in/social` + `/sign-in/magic-link` → `sign-in-initiated`; `/callback/:id`, `/magic-link/verify`, the three `/two-factor/verify-*` → `sign-in`, previously unrecorded) plus `targetEmail` as a top-level column and validated audit-read options. **One sub-feature dropped with cause**: the S0 gate proved better-auth runs the app's own `hooks.after` BEFORE a plugin's, so this hook structurally _cannot_ observe `twoFactor`'s `{twoFactorRedirect:true}` rewrite — "sign-in-challenged" needs a different seam and its own plan. Also corrected the plan's `/oauth2/callback/*` claim against the installed dist. **⚠ Surfaced a live alpha bug — see below** | +| 281 | Make the Nuxt `worker.ts` guard check what it claims to check | NUXT-01 | nuxt | P3 | S | LOW | ✅ **DONE** — `6a64f838e`; the inert `existsSync` guard now reads the entry (try/catch, degrading to a "could not read" warning) and checks for a `ShardDO` export, mirroring the Astro sibling. `templates/nuxt/worker.ts` verified to pass. 7 tests, nuxt 22/22 | +| 282 | Guard Vue and Svelte eager subscriptions against SSR | VUE-01, SVELTE-01 | vue/svelte | P2 | S | LOW | **DONE** — `f6c251720` + `caf9cae9d` on `advisor/…-adapters`. One shared `shared/is-browser.ts` replaces four inline copies; Vue's `useQuery`/`useSubscription`/paginated watcher and Svelte's `agent()`/`rate-limit` now no-op during SSR. **Hit a real STOP** (the guard broke 33 pre-existing tests across 7 files, incl. agent composables the audit never identified as consumers) — adjudicated: the tests encoded the bug, since `vitest.config.ts` is `environment: "node"` and `use-presence.test.ts` already stubs `window` for the one composable that was already guarded. Solid/Angular verified already-safe and pinned as non-goals. Reviewer confirmed 4 Vue tests fail against base | +| 283 | Reset the Angular upload signals on restart | NG-01 | angular | P3 | S | LOW | **DONE** — `0c8ced8b4`; `start()` resets error/result/progress/isPaused, and `pause()`/`resume()` are guarded on an in-flight upload. The existing `:157` test paused from `"idle"` — i.e. it encoded the bug — and was updated to drive `setOnStart` first, recorded in the commit body. Reviewer confirmed 5 Angular tests fail against base; angular 105/105 | +| 284 | Wake `EventSource.events()` on abort | REPL-01 | replica | P3 | S | LOW | **DONE** — `4ea3f5f87`; the idle park now settles on abort and the listener is removed in `finally`. **The speculative half was correctly NOT built**: the phase-1 re-yield repro passed even pre-fix (`getSince`'s snapshot-at-fetch-time semantics make the overlap unreachable), so no dedup was added — the repro is kept as a regression pin. Reviewer re-ran replica 337 | ### Follow-ups surfaced during execution @@ -1250,10 +1250,10 @@ surface, the other a data-corruption path on a first-party money schema. ### Follow-on filed during Wave-18 execution -| Plan | Title | Category | Pkg | Pri | Effort | Risk | Status | -| ---- | ------------------------------------------------------------- | ------------ | -------- | --- | ------ | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 302 | Repo lint gate reports success for ten projects it never runs | ci/tech-debt | repo/vis | P1 | M–L | LOW | **ALL PHASES DONE — two branches awaiting merge.** Phase 1 (root cause + the two already-clean packages) shipped with plan 290 (`596dd3c3d`); **phases 2–5** (`container`, `auth`, `vue`, `advisor`) shipped 2026-08-04 as `a4c6522eb` (#343) — the plan's own "phases 2+ TODO" status line was stale. Remaining work landed 2026-08-08 on **`ci/302-unskip-lint-small`** (phase 6, `svelte`) and **`ci/302-unskip-lint-large`** (phases 7–9 `db`/`ai`/`replica`, plus phase 10). ⚠️ **Merge order is load-bearing**: the phase-10 check allowlists `packages/svelte` in `KNOWN_UNMIGRATED`, and it fails on a _stale_ allowance too, so whichever branch lands second must delete that entry in the merge. **Re-measured counts differ from the plan**: db **38** (not 40), ai **117**, replica **303**, svelte **24** — and most are warnings, failing only because of `--max-warnings=0`. Phase 10 shipped as `scripts/check-project-json-targets.js`, wired as the first step of the Lint workflow's `eslint` job (**not** the root `postinstall`, where a failure turns all ~20 CI jobs red in their setup step), with `**/project.json` added to the path filter so a PR touching only a `project.json` cannot skip the job that catches this. Ten `packages/*/project.json` carry an nx-shaped `lint:eslint` target (`executor` + nested `options.command`); vis finds no top-level `command`, prints `No command configured`, and reports it as a **success** in 13 ms, so the declared target shadows the manifest script. They are stale nx leftovers — the nested command points at a `{workspaceRoot}/eslint.config.js` that does not exist and drops `--max-warnings=0`. Hidden behind the green tick: **523 errors across 8 packages** (replica 303, ai 118, db 40, svelte 24, advisor 21, auth 7, vue 7, container 3). CI's required context is that aggregate run. Phases 2–9 land one package at a time behind its own cleanup so the gate never goes red; phase 10 adds a check that fails on a reintroduced `executor` key. See [302-vis-lint-gate-skips-ten-projects.md](302-vis-lint-gate-skips-ten-projects.md) | -| 303 | Wire-codec display leftovers from plan 300 | bug | studio | P3 | S | LOW | TODO — two items the 300 review surfaced and 300 deliberately did not widen to cover. **(a) The SQL console still shows raw `__doc__` text.** Plan 300 §9 Q2 claimed the console shares `expandDocumentRows`; it does not — `readAdminRunSql` → `runReadonlySql` (`shard-engine/src/sql-console.ts`) is a separate path that never expands, so `SELECT * FROM paymentSessions` renders the stored tagged JSON as a string. Decide whether a SQL console _should_ decode (it is showing the database, not the model) before changing it; the studio's own saved-query template selects `__doc__` explicitly. **(b) A legacy `__proto__` field is dropped by an untouched save.** `onRowEdit` seeds the editor with `encodeWire(doc)`, whose plain-object branch assigns by key, so a `__proto__` key fires the prototype setter instead of landing as an own property and the field vanishes from the editor text; saving without typing deletes it. Only reachable for pre-codec rows (`encodeDocJson` drops it on write too), which is why 300 left it — silent data loss all the same | +| Plan | Title | Category | Pkg | Pri | Effort | Risk | Status | +| ---- | ------------------------------------------------------------- | ------------ | -------- | --- | ------ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 302 | Repo lint gate reports success for ten projects it never runs | ci/tech-debt | repo/vis | P1 | M–L | LOW | **ALL PHASES DONE — two branches awaiting merge.** Phase 1 (root cause + the two already-clean packages) shipped with plan 290 (`596dd3c3d`); **phases 2–5** (`container`, `auth`, `vue`, `advisor`) shipped 2026-08-04 as `a4c6522eb` (#343) — the plan's own "phases 2+ TODO" status line was stale. Remaining work landed 2026-08-08 on **`ci/302-unskip-lint-small`** (phase 6, `svelte`) and **`ci/302-unskip-lint-large`** (phases 7–9 `db`/`ai`/`replica`, plus phase 10). ⚠️ **Merge order is load-bearing**: the phase-10 check allowlists `packages/svelte` in `KNOWN_UNMIGRATED`, and it fails on a _stale_ allowance too, so whichever branch lands second must delete that entry in the merge. **Re-measured counts differ from the plan**: db **38** (not 40), ai **117**, replica **303**, svelte **24** — and most are warnings, failing only because of `--max-warnings=0`. Phase 10 shipped as `scripts/check-project-json-targets.js`, wired as the first step of the Lint workflow's `eslint` job (**not** the root `postinstall`, where a failure turns all ~20 CI jobs red in their setup step), with `**/project.json` added to the path filter so a PR touching only a `project.json` cannot skip the job that catches this. Ten `packages/*/project.json` carry an nx-shaped `lint:eslint` target (`executor` + nested `options.command`); vis finds no top-level `command`, prints `No command configured`, and reports it as a **success** in 13 ms, so the declared target shadows the manifest script. They are stale nx leftovers — the nested command points at a `{workspaceRoot}/eslint.config.js` that does not exist and drops `--max-warnings=0`. Hidden behind the green tick: **523 errors across 8 packages** (replica 303, ai 118, db 40, svelte 24, advisor 21, auth 7, vue 7, container 3). CI's required context is that aggregate run. Phases 2–9 land one package at a time behind its own cleanup so the gate never goes red; phase 10 adds a check that fails on a reintroduced `executor` key. See [302-vis-lint-gate-skips-ten-projects.md](302-vis-lint-gate-skips-ten-projects.md) | +| 303 | Wire-codec display leftovers from plan 300 | bug | studio | P3 | S | LOW | TODO — two items the 300 review surfaced and 300 deliberately did not widen to cover. **(a) The SQL console still shows raw `__doc__` text.** Plan 300 §9 Q2 claimed the console shares `expandDocumentRows`; it does not — `readAdminRunSql` → `runReadonlySql` (`shard-engine/src/sql-console.ts`) is a separate path that never expands, so `SELECT * FROM paymentSessions` renders the stored tagged JSON as a string. Decide whether a SQL console _should_ decode (it is showing the database, not the model) before changing it; the studio's own saved-query template selects `__doc__` explicitly. **(b) A legacy `__proto__` field is dropped by an untouched save.** `onRowEdit` seeds the editor with `encodeWire(doc)`, whose plain-object branch assigns by key, so a `__proto__` key fires the prototype setter instead of landing as an own property and the field vanishes from the editor text; saving without typing deletes it. Only reachable for pre-codec rows (`encodeDocJson` drops it on write too), which is why 300 left it — silent data loss all the same | ### Tier 3 — tech debt, DX, docs @@ -1564,8 +1564,8 @@ a later wave. ## Filed outside a wave -| Plan | Title | Category | Pkg | Pri | Effort | Risk | Status | -| ---- | ------------------------------------------------------------- | ---------------- | ---------------------- | --- | ------ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Plan | Title | Category | Pkg | Pri | Effort | Risk | Status | +| ---- | ----------------------------------------------------------------------- | --------------- | ------------------- | --- | ------ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 306 | A pluggable queue-driver package, so a deployment picks its own backend | platform/queues | queue/platform-node | P2 | L | MED | TODO — filed with the Node host (`370994075`), no wave. Headline: **no general-purpose Node job library delivers a batch whose members settle independently** (twelve checked); every one is one-job-per-handler. `@lunora/queue` is message-shaped, so the adapters worth writing are message-**broker** adapters (SQS, Pub/Sub, Service Bus, AMQP, JetStream), not job-library wrappers. Batch assembly, the implicit-ack rule, `attempts` accounting and the dead-letter threshold must live above any adapter — that engine already exists inside `createNodeQueueHost`, and extracting it is most of the first release. See [306-pluggable-queue-drivers.md](306-pluggable-queue-drivers.md) | Worth reading before picking this up: it only pays off if a non-Cloudflare