Repository navigation
fix(ci): dependency checks fail on diagnostic test reset exports - #176285
Conversation
#175223 moved the aggregate diagnostic reset into diagnostic.test-support.ts, which removed the only production consumer of seven per-module reset hooks. Knip production mode then reported them as unused exports. Tag them @internal, as container-environment.ts does, so the production scan skips them while the full-tree scan still audits their test-support consumer.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR marks seven diagnostic test-reset exports as internal so Knip excludes them from production-only scans. Example: Knip scans resetDiagnosticMemoryForTest after its caller moves into diagnostic.test-support.ts.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR narrowly corrects diagnostic export classification, preserves full-tree auditing, and introduces no actionable defect. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherDiagnostic modules own in-memory observations and lifecycle state; test fixtures call their reset hooks, and Knip audits production and test-aware import graphs separately. flowchart TD
A[Diagnostic modules] --> B[Seven reset exports]
C[Test fixtures] --> B
A --> D[Production Knip scan]
C --> E[Full-tree Knip scan]
B --> E
D --> F[Dead-code checks]
E --> F
Technical reviewBest possible solution: Keep the symbol-level annotations so production scans exclude only the seven test hooks while full-tree scans retain their coverage. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the failure path: the merged refactor moved all seven callers into production-excluded test support, leaving their exports reportable by production Knip; no local reproduction was run. Is this the best way to solve the issue? The annotations match Knip 6.40.0's intended test-hook contract and are more precise than file-wide exceptions, without restoring test sequencing to production. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 621f574e6639. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +7. Total +7 across 7 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 18, 2026, 12:47 PM ET / 16:47 UTC. |
|
Landed as fab581e. Bug: after #175223 moved the aggregate diagnostic reset into test-support, Knip's production scan reported 7 per-module |
…nclaw#176285) ## What Problem This Solves Fixes: `check-dependencies` fails on main because Knip reports 7 unused `reset*ForTest` exports in `src/logging/diagnostic-*.ts`. openclaw#175223 moved the aggregate reset into `diagnostic.test-support.ts`, which Knip's production scan ignores, so the per-module resets lost their only production consumer. ## User Impact No user-visible change. The dependency and export deadcode scans pass again. ## Why This Change Was Made These resets are test-support hooks by design. Each export now carries `/** @internal */`, the pattern main already uses for test helpers (for example `src/infra/container-environment.ts`). The production scan skips them, and the full-tree scan still checks them against their test-support caller. No logic changes. ## Evidence - Before: hourly CI runs 39136213920 and 39140721112 fail `deadcode:dependencies` and `deadcode:exports` with these 7 entries. They first appear in run 39010956087, the first run after openclaw#175223. - After: `pnpm run deadcode:dependencies` and `pnpm run deadcode:exports` pass with 0 entries. - `pnpm exec vitest run src/logging/diagnostic.test.ts src/logging/diagnostic-memory.test.ts src/logging/diagnostic-stability.test.ts src/logging/diagnostic.incognito.test.ts`: 94 passed. `oxfmt` and `oxlint` are clean. Co-authored-by: Ayaan Zaidi <[email protected]>
Requested by Ayaan
What Problem This Solves
Fixes:
check-dependenciesfails on main because Knip reports 7 unusedreset*ForTestexports insrc/logging/diagnostic-*.ts. #175223 moved the aggregate reset intodiagnostic.test-support.ts, which Knip's production scan ignores, so the per-module resets lost their only production consumer.User Impact
No user-visible change. The dependency and export deadcode scans pass again.
Why This Change Was Made
These resets are test-support hooks by design. Each export now carries
/** @internal */, the pattern main already uses for test helpers (for examplesrc/infra/container-environment.ts). The production scan skips them, and the full-tree scan still checks them against their test-support caller. No logic changes.Evidence
deadcode:dependenciesanddeadcode:exportswith these 7 entries. They first appear in run 39010956087, the first run after refactor(logging): move diagnostic aggregate test resets into fixtures #175223.pnpm run deadcode:dependenciesandpnpm run deadcode:exportspass with 0 entries.pnpm exec vitest run src/logging/diagnostic.test.ts src/logging/diagnostic-memory.test.ts src/logging/diagnostic-stability.test.ts src/logging/diagnostic.incognito.test.ts: 94 passed.oxfmtandoxlintare clean.