Skip to content

fix(hygiene): workspace overrides, NUL/LogSink cleanup, payment gating, class-export, studio (Wave 15: 189,191) - #200

Merged
prisis merged 17 commits into
alphafrom
advisor/wave15-hygiene
Jul 26, 2026
Merged

prisis merged 17 commits into
alphafrom
advisor/wave15-hygiene

Conversation

@prisis

@prisis prisis commented Jul 26, 2026 •

Copy link
Copy Markdown
Member

Wave 15 — repo wiring hygiene + small correctness fixes (plans 189, 191)

Two low-risk clusters with disjoint files (clean merge).

189 — monorepo wiring hygiene (HLTH-01/02/04/06/08/10, OBS-06)

  • @lunora/notify + @lunora/replica added to the overrides block → resolve from workspace source (link:), not the npm registry tarball (Studio was type-checking against a stale published @lunora/notify).
  • packages/runtime/src/memoize-identity.ts — literal NUL byte (made the new public auth-adjacent module a binary blob, invisible to git diff/review) replaced with `` (byte-identical at runtime).
  • Codegen stops emitting the @deprecated LogSink into generated _generated/shard.ts — emit.ts + golden fixture + a token-only swap of the 8 example trees (the full example regen, which sweeps unrelated pre-existing emitter drift, is deliberately deferred to a dedicated chore commit).
  • @lunora/notify added to the api-snapshot TIER_2 (+ notify.api.md); AGENTS.md gains a notify row and corrects the @lunora/ai "AI SDK v6" → "v7".

191 — small correctness (SURF-10/11/12/13, CLI-11)

  • Payments page gates on payment-store signature columns (providerSubscriptionId+state, providerEventId+processedAt), not the generic table names subscriptions/events (removed a false positive for newsletter/domain-event apps).
  • isTypeOnlyClassExport in @lunora/config — per-entry type detection + escaped/anchored regex fallback (a value class export no longer suppressed by a coexisting export type { … }, which had made wrangler deploy fail on a missing class_name).
  • Studio: Instruments panel surfaces RPC errors (was rendering null, indistinguishable from "no metrics"); Issues triage tracks busy state per row (Set + per-row error Map) instead of a global flag.
  • @lunora/db CheckpointRegistry.dispose() clears armed fallback timers explicitly on teardown (verified there was no actual leak — resolve(∞) already disarmed — so this is robustness/clarity; api-snapshot refreshed for the new method).

Verification (on the merged branch)

Full 48-package build:packages succeeds; relocked (notify/replica → link:); tsc clean; tests: codegen 881, config 462, studio 803, db 74; api:check matches all 39 snapshots.

Merge note: touches pnpm-lock.yaml — regenerate the lock after merging (never text-merge it).

Generated by the /improve advisor workflow (isolated-worktree Opus executors → tech-lead review). Plan text on improve/alpha-audit under plans/189-*, plans/191-*.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Payments now recognizes supported payment data using required table fields, improving setup detection.
    • Identity memoization supports custom cache keys for applications with nonstandard authentication.
    • Generated shard configurations now support telemetry sinks.
  • Bug Fixes

    • Issue triage actions can run independently, with busy states and errors shown per issue.
    • Payments displays a clearer unconfigured state when required data is unavailable.
    • Reports handle unavailable instrument metrics gracefully.
    • Worker export detection more accurately preserves runtime exports.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ad35a8e1-4782-40f7-a7a6-b3015c2cac75

📥 Commits

Reviewing files that changed from the base of the PR and between 8988d6c and 8e858ba.

⛔ Files ignored due to path filters (41)
  • AGENTS.md is excluded by none and included by none
  • api-snapshots/db.api.md is excluded by none and included by none
  • api-snapshots/notify.api.md is excluded by none and included by none
  • api-snapshots/runtime.api.md is excluded by none and included by none
  • examples/auth-playground/lunora/_generated/app.ts is excluded by !**/_generated/** and included by none
  • examples/auth-playground/lunora/_generated/dataModel.ts is excluded by !**/_generated/** and included by none
  • examples/auth-playground/lunora/_generated/server.ts is excluded by !**/_generated/** and included by none
  • examples/auth-playground/lunora/_generated/shard.ts is excluded by !**/_generated/** and included by none
  • examples/blog/lunora/_generated/app.ts is excluded by !**/_generated/** and included by none
  • examples/blog/lunora/_generated/dataModel.ts is excluded by !**/_generated/** and included by none
  • examples/blog/lunora/_generated/server.ts is excluded by !**/_generated/** and included by none
  • examples/blog/lunora/_generated/shard.ts is excluded by !**/_generated/** and included by none
  • examples/expo/lunora/_generated/shard.ts is excluded by !**/_generated/** and included by none
  • examples/notify-demo/lunora/_generated/shard.ts is excluded by !**/_generated/** and included by none
  • examples/offline-rejections/lunora/_generated/app.ts is excluded by !**/_generated/** and included by none
  • examples/offline-rejections/lunora/_generated/dataModel.ts is excluded by !**/_generated/** and included by none
  • examples/offline-rejections/lunora/_generated/server.ts is excluded by !**/_generated/** and included by none
  • examples/offline-rejections/lunora/_generated/shard.ts is excluded by !**/_generated/** and included by none
  • examples/payment-demo/lunora/_generated/app.ts is excluded by !**/_generated/** and included by none
  • examples/payment-demo/lunora/_generated/dataModel.ts is excluded by !**/_generated/** and included by none
  • examples/payment-demo/lunora/_generated/server.ts is excluded by !**/_generated/** and included by none
  • examples/payment-demo/lunora/_generated/shard.ts is excluded by !**/_generated/** and included by none
  • examples/realtime-cursors/lunora/_generated/app.ts is excluded by !**/_generated/** and included by none
  • examples/realtime-cursors/lunora/_generated/dataModel.ts is excluded by !**/_generated/** and included by none
  • examples/realtime-cursors/lunora/_generated/server.ts is excluded by !**/_generated/** and included by none
  • examples/realtime-cursors/lunora/_generated/shard.ts is excluded by !**/_generated/** and included by none
  • examples/todo-app/lunora/_generated/app.ts is excluded by !**/_generated/** and included by none
  • examples/todo-app/lunora/_generated/dataModel.ts is excluded by !**/_generated/** and included by none
  • examples/todo-app/lunora/_generated/server.ts is excluded by !**/_generated/** and included by none
  • examples/todo-app/lunora/_generated/shard.ts is excluded by !**/_generated/** and included by none
  • packages/codegen/__tests__/discover-feature-usage.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/codegen/__tests__/fixtures/simple/expected/_generated/shard.ts is excluded by !**/_generated/**, !**/__tests__/** and included by packages/**
  • packages/config/__tests__/infer-bindings.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/db/__tests__/collection-options.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/db/__tests__/define-mutators.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/payment/__tests__/schema.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/runtime/__tests__/memoize-identity.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/studio/__tests__/features/issues/issues-panel.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • packages/studio/__tests__/features/reports/instruments-table.test.tsx is excluded by !**/__tests__/** and included by packages/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none
  • pnpm-workspace.yaml is excluded by none and included by none
📒 Files selected for processing (11)
  • packages/codegen/src/discover-feature-usage.ts
  • packages/codegen/src/emit.ts
  • packages/codegen/src/run-codegen.ts
  • packages/config/src/infer-bindings.ts
  • packages/db/src/collection-options.ts
  • packages/runtime/src/memoize-identity.ts
  • packages/studio/src/features/issues/issues-panel.tsx
  • packages/studio/src/features/payments/payments-panel.tsx
  • packages/studio/src/features/reports/instruments-table.tsx
  • packages/studio/src/locales/en.ts
  • scripts/api-snapshot.js

Walkthrough

The changes refine payment table detection, generated observability types, worker export analysis, checkpoint cleanup, identity cache keys, Studio interaction states, Instruments error handling, and API snapshot coverage.

Changes

Code generation and payment feature detection

Layer / File(s) Summary
Payment store signature detection
packages/codegen/src/discover-feature-usage.ts, packages/codegen/src/run-codegen.ts
Payment tables are detected by required signature columns, and codegen uses this result for payments feature gating.
Generated observability type
packages/codegen/src/emit.ts
Generated ShardDOConfig.observability now returns TelemetrySink instead of LogSink.

Worker export detection

Layer / File(s) Summary
Per-entry runtime export analysis
packages/config/src/infer-bindings.ts
Class export detection now filters type-only exports per lexer entry, with a regex fallback for unparseable files.

Checkpoint registry teardown

Layer / File(s) Summary
Registry disposal lifecycle
packages/db/src/collection-options.ts
Checkpoint registries expose dispose(), clear fallback timers, and are disposed during shard checkpoint release.

Identity memoization keys

Layer / File(s) Summary
Configurable identity cache key
packages/runtime/src/memoize-identity.ts
memoizeIdentity accepts an optional cacheKey and uses it for cross-request memoization.

Studio feature and interaction handling

Layer / File(s) Summary
Payments availability gating
packages/studio/src/features/payments/payments-panel.tsx
Payment queries require the feature flag and both required runtime tables.
Per-issue triage state
packages/studio/src/features/issues/issues-panel.tsx
Busy and error state is tracked and rendered independently for each issue.
Instruments RPC error handling
packages/studio/src/features/reports/instruments-table.tsx, packages/studio/src/locales/en.ts
Missing pre-feature RPCs remain a silent empty state, while genuine errors render an unavailable message.

API snapshot coverage

Layer / File(s) Summary
Notify package snapshot coverage
scripts/api-snapshot.js
The notify package is included in stable API snapshot generation and checks.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: package: notify, package: replica

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch advisor/wave15-hygiene

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for confirming the Contributor License Agreement! 🙏

@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 8e858ba.

@netlify

netlify Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for lunorash ready!

Name Link
🔨 Latest commit 8e858ba
🔍 Latest deploy log https://app.netlify.com/projects/lunorash/deploys/6a65bc239e6a57000878d4f6
😎 Deploy Preview https://deploy-preview-200--lunorash.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codspeed

codspeed Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 6.1%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 2 regressed benchmarks
✅ 236 untouched benchmarks
⏩ 2 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ in-batch: single IN(...) query + id->doc re-projection 795.1 µs 946.8 µs -16.02%
❌ count, no attributes 57.6 µs 64.7 µs -10.96%
⚡ baseline (Object.keys + toInternal + path spread per field) 71.9 µs 64.9 µs +10.72%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing advisor/wave15-hygiene (8e858ba) with alpha (0eab929)2

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on alpha (8988d6c) during the generation of this report, so 0eab929 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@prisis prisis changed the title chore(hygiene)+fix: workspace overrides, NUL/LogSink cleanup, payment gating, class-export, studio (Wave 15: 189,191) fix(hygiene): workspace overrides, NUL/LogSink cleanup, payment gating, class-export, studio (Wave 15: 189,191) Jul 26, 2026
prisis and others added 15 commits July 26, 2026 09:49
…urce

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… trees

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Payments studio page gated on the bare table names `subscriptions` +
`events` — two of the most generic names in existence. A newsletter
`subscriptions` table plus a domain `events` table spuriously showed the page.

Match the @lunora/payment store by its signature columns
(providerSubscriptionId/state, providerEventId/processedAt) instead of names.
A real payment app mirrors the canonical columns, so this stays back-compatible
with older schemas while dropping the false positive. The studio panel now
consumes the codegen `payments` flag (useStudioFeatures) alongside its runtime
table-presence read guard, rather than a single hardcoded table name.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
isTypeOnlyClassExport ran three unanchored/unescaped whole-file regexes, so a
separate `export type { Foo }` anywhere in the worker entry suppressed a real
value export of `Foo` — the binding was reported unexported and `wrangler
deploy` failed on a missing `class_name`.

es-module-lexer already omits `export type Foo` and the separate
`export type { Foo }` from its export list; the only type-only shape it still
lists is the inline `export { type Foo }`, now dropped per export entry via the
local-name position. The whole-file regex survives only in the unparseable-file
catch fallback, with the class name escaped and the `u` flag added.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Instruments panel returned null on any getMetricSeries error, so a stale
admin token or permission failure was indistinguishable from "no custom
metrics" — the whole section just vanished. Render a one-line muted notice on
error while keeping silent-on-empty for a genuinely uninstrumented app.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A single `busyHash` / `actionError` made overlapping triage writes last-writer-
wins: the first write's completion cleared the second's busy flag (re-enabling a
row mid-flight) and one row's error overwrote another's. Key both off the issue
hash — a `ReadonlySet<string>` of busy hashes and a `ReadonlyMap<string,string>`
of per-row errors, mutated immutably — so each row disables and surfaces errors
independently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
releaseShardCheckpoints dropped a registry after resolving it to Infinity, which
happened to disarm the armed fallback timers as a side effect of resolve's
disarmUpTo. Make the teardown explicit and robust: a dispose() that clearTimeouts
every armed entry and empties the set, called from releaseShardCheckpoints after
settling parked waiters — so a discarded registry (Vite HMR dispose, sign-out)
can never keep a Node/SSR event loop alive through a pending timer's closure,
independent of resolve's behaviour.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The cross-request identity cache keyed only on Cookie+Authorization, so a
resolveIdentity that authenticates off another attribute (X-API-Key, request
origin, an Access JWT header) with colliding standard headers across principals
could be served the WRONG identity. Add an optional cacheKey(request) override
so such a resolver supplies a key covering exactly what it reads, and document
the default key's contract explicitly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A worker predating the getMetricSeries RPC answers FUNCTION_NOT_FOUND, which the
new error notice surfaced as a false 'Instruments unavailable' banner — the
sibling getMetricHistory read deliberately swallows that pre-feature case. Filter
the code so the pre-feature case renders nothing (same as an uninstrumented app)
and only genuine failures (stale token / permission) show the notice.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
codegen's discover-feature-usage hardcodes the payment store discriminator
columns (providerSubscriptionId/state on subscriptions, providerEventId/
processedAt on events) with nothing binding them to the real schema. Add a drift
guard over packages/payment/src/schema.ts so a rename fails loudly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
prisis and others added 2 commits July 26, 2026 09:49
The two type-only-export detectors had similar names hiding a primary-vs-fallback
split. Rename to isTypeOnlyExportEntry (primary, per-entry, lexer-based) and
isTypeOnlyExport_regexFallback (whole-file regex, unparseable-file path only), and
note the es-module-lexer offset coupling at the primary callsite. No logic change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Regenerate 7 examples' _generated/* through real codegen so they match the
emitter byte-for-byte, replacing the hand-swapped LogSink->TelemetrySink edit
(which put TelemetrySink at the old position 4 instead of its alphabetical slot).
This also pulls in the pre-existing emitter drift the examples hadn't picked up:
asId typing, AppTableName, AppBuilder<Env extends object>, and the observability
wiring (ctx.span, instrumented db/fetch). notify-demo is intentionally excluded:
its regen surfaces a pre-existing emitter type bug (see report).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 8, 2026

This branch was previously deployed

1 inactive deployment
benchmarks — 8e858ba9 Deployed Jul 26, 2026 by prisis via Benchmarks #991
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant