Skip to content

fix(ci): model every Solid lazy named-export loader in the UI for Knip - #204389

Merged
obviyus merged 1 commit into
mainfrom
fix/knip-solid-lazy-exports
Nov 24, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/knip-solid-lazy-exports

Conversation

@obviyus

@obviyus obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Result

The check-dependencies job on main passes again. It has been red since #204200 (first red: scheduled run 45319833099 on a21974c). Knip reported a false unused export:

Unused exports are not allowed:
  ui/src/pages/chat/components/chat-read-aloud-status.tsx: RecordingApiKeyNotice

Cause

RecordingApiKeyNotice has one real production consumer: chat-message-bubble-view.tsx loads it with lazy(() => import("./chat-read-aloud-status.tsx"), { export: "RecordingApiKeyNotice" }). Solid selects the export by a string, which Knip cannot see. config/knip-vite-consumers.mjs modeled that pattern for exactly one hard-coded loader (settings-sidebar-lazy.tsx). Every other lazy named-export loader either had an ignore entry or broke the gate, as this one did.

Change

The consumer model now derives a named import edge from every non-test UI source file that contains a lazy(() => import("…"), { export: "…" }) loader. A new loader needs no registration, and deleting a loader still removes its edge, so a truly unused export is still reported.

Evidence

  • check-deadcode-exports.test.ts: 36 passed. The updated case (two loaders in different directories, test files excluded, deleted loader dropped) fails on main.
  • pnpm deadcode:report on this head: script, production and full-tree Knip reports all pass. On main, the production and full-tree reports fail with the error above.

@clawsweeper

clawsweeper Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 24, 2026
@clawsweeper

clawsweeper Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR extends Knip’s existing consumer model to discover Solid named-export lazy loaders throughout UI TypeScript sources.

Example: The chat bubble lazily loads RecordingApiKeyNotice from chat-read-aloud-status.tsx.

  • Before: Knip reports RecordingApiKeyNotice as unused because only the settings sidebar loader is modeled.
  • After: The compiler derives a named import edge from the chat loader and removes that edge when the loader disappears.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported, with useful regression coverage; reported audit success is not independently replayed and the required lint failure remains unexplained.
Proof confidence 🦐 gold shrimp (3/6) This tooling-only change requires no user-facing runtime demonstration; the author reports successful audit execution, and the inspected regression exercises the real compiler with filesystem fixtures.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter a failing dependency gate for a UI export that has a real production consumer.
Reason: The maintainer-authored direction repairs a verified tooling blind spot using the existing source-derived modeling contract.

Merge readiness

✅ Ready for maintainer review

This PR provides a focused repair for a real dependency-audit false positive; no actionable patch defects were found, but the failing required lint check remains unattributed.

Priority: P2
Reviewed head: 77b6480502ce68c5688152a59d2692d373bef510

Before merge

None.

Findings

None.

Agent review details

How this fits together

Knip’s custom compiler reads UI loader source and supplies synthetic named imports to the repository’s dependency and unused-export audits.

flowchart LR
  A[UI source files] --> B[Existing consumer compiler]
  B --> C[Derived named imports]
  C --> D[Knip analysis]
  D --> E[Deadcode reports]
  E --> F[Dependency CI gate]
Loading

Technical review

Best possible solution:

Keep the generalized source-derived edges in the existing compiler and land after the required CI failure is resolved or established as inherited.

Do we have a high-confidence way to reproduce the issue?

Current-main source establishes the missing consumer edge, and the body supplies the precise Knip diagnostic; no target code was executed during this read-only review.

Is this the best way to solve the issue?

This is a small, complete repair in the existing consumer owner: it generalizes discovery without adding ignore entries, runtime imports, registrations, or another implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0956e14e6814.

Provenance checked

  • Solid named lazy consumer modeling and its regression test keeps the original intent (3ef76f6: Model the live Solid loader rather than suppress its export, preserving detection when the loader is deleted.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Introduced patch: The pinned introduction diff replaces the single settings-sidebar path with recursive UI discovery inside the existing compiler and extends its existing regression test. (config/knip-vite-consumers.mjs:61, 77b6480502ce)
  • Current-main failure path: Current main still models only settings-sidebar-lazy.tsx, while chat-message-bubble-view.tsx selects the exported RecordingApiKeyNotice by string. (ui/src/pages/chat/components/chat-message-bubble-view.tsx:82, 0956e14e6814)
  • Original intent preserved: Commit 3ef76f6 introduced source-derived Solid consumer edges so deleted loaders remain detectable; this PR preserves that design. (config/knip-vite-consumers.mjs:58, 3ef76f600bfe)
  • Regression coverage: The updated compiler contract test covers loaders in different directories, exclusion of test-only consumers, and removal of a deleted loader’s edge; the body reports base failure, 36 passing tests, and passing deadcode reports on the head. (test/scripts/check-deadcode-exports.test.ts:340, 77b6480502ce)
  • Required CI remains red: The exact-head check-lint-core-3 job failed and ci-gate propagates that failure; annotations identify line-count warnings in untouched session files but do not establish the failure’s cause. Full log retrieval was blocked at the redirected Azure storage host. (77b6480502ce)
  • Related change and media: The merged voice-notice change at fix: explain when OpenAI voice needs an API key #204200 supplies the affected loader; its prepared screenshots show speech-key guidance and settings navigation, not this PR’s Knip behavior. (86fcb81e64c0)

Likely related people:

  • Peter Steinberger: Raw commit 3ef76f6 adds config/knip-vite-consumers.mjs:44 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3ef76f600bfe; files: config/knip-vite-consumers.mjs)
  • Shakker: Raw commit 3940719 adds config/knip-vite-consumers.mjs:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 3940719bedc7; files: config/knip-vite-consumers.mjs)
  • jalehman: Raw commit 238afe4 adds config/knip-vite-consumers.mjs:34 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 238afe41b9f9; files: config/knip-vite-consumers.mjs)

PR surface

Tests +27, Other +9. Total +36 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 33 6 +27
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 24 15 +9
Total 2 57 21 +36

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A concrete false positive blocks the dependency audit, with no demonstrated end-user runtime failure.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A concrete false positive blocks the dependency audit, with no demonstrated end-user runtime failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attribute the failing check-lint-core-3 job and restore the required gate or document verified inherited-failure evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 23, 2026, 11:47 PM ET / November 24, 2026, 04:47 UTC.

@obviyus

obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: the one red check on 77b6480 is not caused by this change.

Check File Evidence
check-lint-core-3 src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:3 (typescript/unbound-method) Introduced on main by #202514 (ad2f629). Reproduced on clean origin/main with node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions. This PR touches only config/knip-vite-consumers.mjs and its test. Fix: #204397.

openclaw/ci-gate is red only because of that check.

@obviyus
obviyus merged commit f85e586 into main Nov 24, 2026
87 of 90 checks passed
@obviyus
obviyus deleted the fix/knip-solid-lazy-exports branch November 24, 2026 04:54
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
openclaw#204389)

## Result

The `check-dependencies` job on `main` passes again. It has been red since openclaw#204200 (first red: scheduled run 45319833099 on 1461dee). Knip reported a false unused export:

```
Unused exports are not allowed:
  ui/src/pages/chat/components/chat-read-aloud-status.tsx: RecordingApiKeyNotice
```

## Cause

`RecordingApiKeyNotice` has one real production consumer: `chat-message-bubble-view.tsx` loads it with `lazy(() => import("./chat-read-aloud-status.tsx"), { export: "RecordingApiKeyNotice" })`. Solid selects the export by a string, which Knip cannot see. `config/knip-vite-consumers.mjs` modeled that pattern for exactly one hard-coded loader (`settings-sidebar-lazy.tsx`). Every other lazy named-export loader either had an ignore entry or broke the gate, as this one did.

## Change

The consumer model now derives a named import edge from every non-test UI source file that contains a `lazy(() => import("…"), { export: "…" })` loader. A new loader needs no registration, and deleting a loader still removes its edge, so a truly unused export is still reported.

## Evidence

- `check-deadcode-exports.test.ts`: 36 passed. The updated case (two loaders in different directories, test files excluded, deleted loader dropped) fails on `main`.
- `pnpm deadcode:report` on this head: script, production and full-tree Knip reports all pass. On `main`, the production and full-tree reports fail with the error above.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant