Skip to content

fix: clear the hidden lint backlog in 4 packages, then un-skip them (plan 302 phases 2–5) - #343

Merged
prisis merged 8 commits into
alphafrom
fix/302-lint-cleanup
Aug 4, 2026
Merged

prisis merged 8 commits into
alphafrom
fix/302-lint-cleanup

Conversation

@prisis

@prisis prisis commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Stacked on #340, which carries plan 302 phase 1. Retarget to alpha once #340 merges.

Plan: plans/302-vis-lint-gate-skips-ten-projects.md.

Four of the eight packages whose lint was being reported as a green ✓ without ever running. Each commit fixes that package's own errors and deletes its nx-shaped targets block in the same change, so the repo gate never goes red.

Package Was Now
container 3 clean, 139 tests
auth 7 clean, 350 tests
vue 7 clean, 95 tests
advisor 21 clean, 458 tests

Remaining for later phases: svelte (24), db (40), ai (118), replica (303).

Real fixes, not blanket suppressions

  • advisor/filter-without-index — {...}[shardKind as "global" | "root"] cast away the very case the comment above it documents. The cast made the ?? fallback look dead to the type checker, and shardKind can be an unrecognised tier or undefined outright. Replaced with a typed Record<string, string> plus an explicit undefined check.
  • advisor/hot-shard — the run body did three jobs (filter, group, score). Extracted groupByShardGroup and hotShardsInGroup, with the lint passed in so neither helper needs a forward reference.
  • advisor/circular-fk — circuit repeated the same in-subgraph neighbour filter across two loops; extracted subgraphNeighbors and blockOnNeighbors.
  • Three no-op awaits on a synchronous run(), two sorts given comparators, one in-place .sort() on a derived array made toSorted.

One thing worth flagging

In container, --fix breaks the test. The vitest/valid-expect finding there is a false positive: the assertion is stored deliberately so fake timers can advance before it settles, and it is awaited three lines down. Autofix inserts await, which deadlocks — the promise cannot settle until the timer advance that follows it. Reverted and suppressed with that reason.

Suppressions

Every one is per-line with a checked reason, and no ESLint rule was disabled to reach green:

  • capped in circular-fk is mutated inside a closure, so TS narrows it to its initializer and calls the loop guard always-truthy — the guard is the cycle cap.
  • The namespace import in lint-registration.test.ts is the point of that test: it asserts every exported lint is registered, so it must see the whole barrel.
  • Three no-secrets hits on lint/function names quoted in prose, matching the idiom already in sql-store/src/ctx-db.ts.
  • import/prefer-default-export, matching the repo's no-default-exports convention.
  • @typescript-eslint/no-unsafe-assignment in auth: LunoraAuthClientPlugin is ReturnType<typeof organizationClient>, and better-auth types that as any — confirmed with a const check: never = p probe. Not fixable locally without hand-writing a plugin type that would then drift.

Each package verified with vis run lint:eslint --query "project=<p>" — advisor now takes 8.7 s instead of reporting success in 13 ms.

🤖 Generated with Claude Code

https://claude.ai/code/session_019WfuWNN3cWJE6beZjng347

Summary by CodeRabbit

  • Refactor

    • Improved consistency and determinism in advisor diagnostics while preserving existing findings, thresholds, messages, and metadata.
    • Strengthened handling of unrecognized configuration values with clearer fallback behavior.
  • Documentation

    • Corrected the documented format for registered function paths.
    • Improved explanations for intentional development-time warnings and lint exceptions.
  • Chores

    • Streamlined package project configuration by removing redundant lint targets.
    • Applied formatting and static-analysis cleanup without changing runtime behavior.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@prisis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 96174eba-ef6c-4499-8b41-bca3d8a2c9c9

📥 Commits

Reviewing files that changed from the base of the PR and between f282b24 and ef8cf6e.

⛔ Files ignored due to path filters (1)
  • packages/advisor/__tests__/filter-scope.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
📒 Files selected for processing (1)
  • packages/advisor/src/lints/static/filter-without-index.ts

Walkthrough

The PR removes package-level ESLint targets, extracts helper functions in advisor lints, updates shard-scope handling, adds targeted ESLint suppressions, and corrects documentation formatting across advisor, auth, and vue packages.

Changes

Advisor lint and package cleanup

Layer / File(s) Summary
Advisor lint helper refactors
packages/advisor/src/lints/runtime/hot-shard.ts, packages/advisor/src/lints/static/*
Advisor lints use typed helpers for shard grouping, hot-shard finding generation, circular-FK traversal, deterministic ordering, and shard-scope message lookup.
Package ESLint target removal
packages/*/project.json
The advisor, auth, container, and vue project configurations remove their ESLint lint and auto-fix targets.
Targeted ESLint suppressions
packages/advisor/src/*, packages/auth/src/auth-client-plugins.ts, packages/vue/src/*.ts
Source comments document intentional exceptions for secret scans, named exports, Better Auth plugin types, and development-only warnings.
Documentation and declaration formatting
packages/advisor/src/function-metrics.ts, packages/advisor/src/owner-field-writes.ts, packages/advisor/src/queries.ts, packages/advisor/src/storage-key-accesses.ts, packages/auth/src/auth-client-plugins.ts
Documentation markup and spacing are corrected without changing public declarations or runtime behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • anolilab/lunora#289: Changes the finding logic in the same storage-key-from-user-args.ts lint.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes clearing the lint backlog and unski​pping four packages, which matches the primary changes.
Description check ✅ Passed The description gives a detailed summary, linked plan, test results, lint verification, reviewer notes, and remaining work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/302-lint-cleanup

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

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for confirming the Contributor License Agreement! 🙏

Base automatically changed from advisor/290-eslint-markdown-crash to alpha August 4, 2026 07:50
prisis and others added 3 commits August 4, 2026 10:05
… un-skip them

Plan 302 phases 2-4. Each package's own `lint:eslint` now passes, so its
nx-shaped `targets` block can go and vis actually runs the target instead of
reporting a 13 ms green tick for it.

- **container** — an `arrow-body-style` cleanup, `toEqual` → `toStrictEqual`,
  and a `vitest/valid-expect` suppression. That last one is a false positive
  worth naming: the assertion is stored deliberately so the fake timers can
  advance before it settles, and it IS awaited three lines down. `--fix`
  "corrects" it by inserting `await`, which deadlocks the test — the returned
  promise cannot settle until the timer advance that follows it. Reverted.
- **auth** — `oneTapClient()`'s spread is genuinely unsafe: `LunoraAuthClientPlugin`
  is `ReturnType<typeof organizationClient>`, and better-auth types that as
  `any`, confirmed with a `const check: never = p` probe. Suppressed once at
  the array with that reason rather than hand-writing a plugin type that would
  drift. Plus a JSDoc indentation fix and four typed `vi.fn` mocks.
- **vue** — three deliberate dev-only `console.warn`s (already gated on
  `NODE_ENV !== "production"`) annotated with the repo's existing
  `no-console -- reason` idiom, and four typed `vi.fn` mocks.

No ESLint rule was disabled to reach green; every suppression is per-line with
a stated, checked reason. Suites: container 139, auth 350, vue 95.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WfuWNN3cWJE6beZjng347
…e package

Plan 302 phase 5. These were invisible twice over: the Markdown crash aborted
the run before it could report, and vis was reporting a 13 ms green tick for a
target it never executed.

Real fixes rather than suppressions where the code was actually wrong:

- **`filter-without-index`** — `{...}[shardKind as "global" | "root"]` cast away
  the very case the comment above it documents. The cast made the `??` fallback
  look dead to the type checker; `shardKind` can be an unrecognised tier *or*
  `undefined` outright. Replaced with a typed `Record<string, string>` and an
  explicit undefined check, so the fallback is reachable and provably needed.
- **`hot-shard`** — the `run` body did three jobs (filter, group, score).
  Extracted `groupByShardGroup` and `hotShardsInGroup`; the lint is passed in
  rather than closed over, so neither helper needs a forward reference.
- **`circular-fk`** — `circuit` repeated the same in-subgraph neighbour filter
  in two loops. Extracted `subgraphNeighbors` and `blockOnNeighbors`.
- Three no-op `await`s on a synchronous `run()`, two alphabetical sorts given
  comparators, and an in-place `.sort()` on a derived array made `toSorted`.

Suppressions, each per-line with a checked reason:

- `capped` in `circular-fk` is mutated inside a closure, so TS narrows it to its
  initializer and calls the loop guard always-truthy. The guard IS the cycle cap.
- The namespace import in `lint-registration.test.ts` is the point of that test —
  it asserts every exported lint is registered, so it must see the whole barrel.
- Three `no-secrets` hits on lint/function names quoted in prose, matching the
  idiom already in `sql-store/src/ctx-db.ts`.
- `import/prefer-default-export`, matching the repo's no-default-exports rule.

advisor 458/458, `lint:types` clean, and `vis run lint:eslint` now takes 8.7 s
instead of reporting success in 13 ms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WfuWNN3cWJE6beZjng347
The `project.json` edits were written programmatically and the test file gained
a long line, so both diverged from prettier. Caught locally this time rather
than by the Lint job.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WfuWNN3cWJE6beZjng347
@prisis
prisis force-pushed the fix/302-lint-cleanup branch from 553035f to f282b24 Compare August 4, 2026 08:07
@netlify

netlify Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for lunorash ready!

Name Link
🔨 Latest commit ef8cf6e
🔍 Latest deploy log https://app.netlify.com/projects/lunorash/deploys/6a71a4dded001d00086df15b
😎 Deploy Preview https://deploy-preview-343--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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/advisor/src/lints/static/filter-without-index.ts`:
- Around line 74-78: Update the scopeByKind lookup in the filter-without-index
lint to be prototype-safe, using Map.get or an own-property check with proper
TypeScript typing. Ensure unrecognized shard kinds such as "toString",
"constructor", or "__proto__" resolve to the existing neutral fallback message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9644ee44-3206-4607-972f-a0338a54432e

📥 Commits

Reviewing files that changed from the base of the PR and between 52c4bac and f282b24.

⛔ Files ignored due to path filters (8)
  • packages/advisor/__tests__/auth-config-lints.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/advisor/__tests__/lint-registration.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/advisor/__tests__/runtime-lints.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/advisor/__tests__/storage-key-from-user-args.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/auth/__tests__/auth-client-plugins.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/container/__tests__/lunora-container.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/container/__tests__/workerd/container-smoke.workerd.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/vue/__tests__/use-auth.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
📒 Files selected for processing (19)
  • packages/advisor/project.json
  • packages/advisor/src/ae-metrics.ts
  • packages/advisor/src/dedupe-cache-keys.ts
  • packages/advisor/src/function-metrics.ts
  • packages/advisor/src/index.ts
  • packages/advisor/src/lints/runtime/hot-shard.ts
  • packages/advisor/src/lints/static/circular-fk.ts
  • packages/advisor/src/lints/static/filter-without-index.ts
  • packages/advisor/src/lints/static/storage-key-from-user-args.ts
  • packages/advisor/src/owner-field-writes.ts
  • packages/advisor/src/queries.ts
  • packages/advisor/src/storage-key-accesses.ts
  • packages/auth/project.json
  • packages/auth/src/auth-client-plugins.ts
  • packages/container/project.json
  • packages/vue/project.json
  • packages/vue/src/use-connection-status.ts
  • packages/vue/src/use-presence.ts
  • packages/vue/src/use-query.ts

@codspeed

codspeed Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 28.8%

❌ 2 regressed benchmarks
✅ 10 untouched benchmarks
⏩ 251 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ circular_fk (worst case: every table in one FK ring) 11.2 ms 16.6 ms -32.61%
❌ circular_fk (relation-graph walk, realistic fan-out) 869.9 µs 1,156.3 µs -24.77%

Tip

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


Comparing fix/302-lint-cleanup (ef8cf6e) with alpha (596dd3c)2

Open in CodSpeed

Footnotes

  1. 251 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 (3d1e99d) during the generation of this report, so 596dd3c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

prisis and others added 2 commits August 4, 2026 10:35
Review catch. Keying an object literal by `shardKind` exposes
`Object.prototype`: a kind of `"toString"` / `"constructor"` / `"valueOf"` /
`"__proto__"` resolves to an inherited member, which is truthy, so the `??`
neutral fallback is skipped and a stringified function lands in the
operator-facing detail text.

A `Map` has no inherited keys, and it also drops the `shardKind === undefined`
dance the object version needed. `shardKind` is declared as a union, so this
guards a value that slipped past the declared type rather than a supported
configuration — but the lookup costs nothing to make safe either way.

Four cases pinned, demonstrated to fail against the object-literal version:
each currently produced a detail string with neither "loads every row" nor the
tier wording.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WfuWNN3cWJE6beZjng347
@prisis
prisis merged commit a4c6522 into alpha Aug 4, 2026
12 of 13 checks passed
@prisis
prisis deleted the fix/302-lint-cleanup branch August 4, 2026 08:38
prisis added a commit that referenced this pull request Aug 8, 2026
* docs(plans): correct stale statuses in the index

The Wave 13 table listed all 24 rows as TODO. 22 of them shipped on
2026-07-19 in the squash a2d60e5 (#146) — the file already contained
the contradicting record in its own execution-status table 60 lines
below, which is now what the rows point at. 160 stays deferred (five
copies of voice-audio.ts are still live) and 162 is partial by design
(its relay half was answered as a design doc). 143's Pkg column moves
from do to shard-engine, where that code now lives.

Plan 265 read BLOCKED - DO NOT MERGE. It is not blocked, it landed:
ab0afaf (#338) shipped encodeDocJson/decodeDocJson without touching
serialize-sql.ts or estimate-bytes.ts, so the review's findings are
live defects on alpha rather than warnings about a branch. Two of them
are restated as such, one is corrected (estimateBytes does not throw or
charge the 32 MiB cap - transaction-headroom raises BAD_REQUEST, so a
bigint insert fails loudly) and one is closed (the introspect item is a
documented decision from plan 300).

Plan 306 had no row anywhere in the file; it gets one. The remaining
files list named 235 and 248, deleted by the same commit that wrote the
list, and omitted five files that exist. Three wave preambles asserted
none executed yet above tables of shipped rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sk9BLaUZDkPVAZ1sKhuDP

* docs(plans): record the 302 outcome and the cold-tree trap

Phases 2-5 had already shipped as a4c6522 (#343); the remaining work
is on two branches whose merge order matters, because the phase-10
check fails on a stale allowlist entry as well as a missing one.

Re-measured counts differ from the plan's, and the reason is worth
carrying: a cold tree reports 455 eslint findings for svelte against 24
after build:packages, and 109 against 38 for db. The extra ones are
no-unsafe-* cascades from a missing dependency dist.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sk9BLaUZDkPVAZ1sKhuDP

* docs(plans): record the 265 remediation and its backfill

The row now carries the design decision (project to a SQL-comparable
scalar, park the exact original) and the reason the cheaper fix was
rejected: a tagged array is still text to SQLite, so equality would
have worked while ranges, ORDER BY and SUM stayed silently wrong.

The backfill is the part that must not get lost. Rows written between
ab0afaf and the fix hold the bigint tagged in place; patch and
replace re-project on write, but a row nobody rewrites stays invisible
to amount queries - completed payment sessions being the exact shape
that is never touched again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sk9BLaUZDkPVAZ1sKhuDP

* docs(plans): mark the 265 remediation blocked by review

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sk9BLaUZDkPVAZ1sKhuDP

---------

Co-authored-by: Claude Opus 5 <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 — ef8cf6e5 Deployed Aug 4, 2026 by prisis via Benchmarks #1444
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