Repository navigation
refactor(deadcode): enforce repository hard zero - #108641
Conversation
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6eec96da51
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "*.config.{js,mjs,cjs,ts,mts,cts}!", | ||
| "*.mjs!", | ||
| ], | ||
| entry: [...rootEntries, "test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts}!"], |
There was a problem hiding this comment.
Keep tests out of production Knip entries
When a src/** export is imported only from a test, this production scan now follows test/**/*.test.ts as an entrypoint, and the full-tree scan also includes tests, so no pass reports that production export as dead. Knip’s project-file docs describe production mode as excluding tests and entry files as the roots of the used graph, so this line weakens the hard-zero production audit instead of leaving test-aware coverage to config/knip.all-exports.config.ts.
Useful? React with 👍 / 👎.
| const ACTIONS_ARTIFACT_API_VERSION = "2026-03-10"; | ||
| const DEFAULT_MAX_ACTIONS_ARTIFACT_BYTES = 256 * 1024 * 1024; | ||
| const DEFAULT_MAX_ACTIONS_ARTIFACT_EXPANDED_BYTES = 512 * 1024 * 1024; |
There was a problem hiding this comment.
Keep artifact archive declarations in sync
These constants are still declared as exports in scripts/lib/actions-artifact-archive.d.mts, so a TypeScript script can compile an import like ACTIONS_ARTIFACT_API_VERSION but Node now fails at module instantiation because the .mjs no longer exports it. Either keep these runtime exports or remove the matching declarations so typed consumers are not given a broken API.
Useful? React with 👍 / 👎.
The repository hard-zero sweep (bae9752, #108641) left five CI lanes red on every PR: a stale max-lines baseline entry for the shrunken live-cache-regression-runner, session-accessor debt baseline above the real count, two sqlite-reliability contract types un-exported while scripts/lib still imports them, a deleted-file entry on the production lint-suppression allowlist, and a stale wildcard-barrel assertion in the parallels smoke model test.
The repository hard-zero sweep (f54279f, openclaw#108641) left five CI lanes red on every PR: a stale max-lines baseline entry for the shrunken live-cache-regression-runner, session-accessor debt baseline above the real count, two sqlite-reliability contract types un-exported while scripts/lib still imports them, a deleted-file entry on the production lint-suppression allowlist, and a stale wildcard-barrel assertion in the parallels smoke model test.
The repository hard-zero sweep (bae9752, openclaw#108641) left five CI lanes red on every PR: a stale max-lines baseline entry for the shrunken live-cache-regression-runner, session-accessor debt baseline above the real count, two sqlite-reliability contract types un-exported while scripts/lib still imports them, a deleted-file entry on the production lint-suppression allowlist, and a stale wildcard-barrel assertion in the parallels smoke model test.
What Problem This Solves
The dead-code gate only modeled production roots and a shrink-only export baseline. Test helpers, script entry exports, YAML-dispatched QA runtime files, and unused files could therefore remain invisible or be grandfathered indefinitely.
Why This Change Was Made
This replaces the export baseline and unused-file allowlist with hard-zero production, full-tree, and script scans. It models real dynamic roots explicitly, removes verified dead files and exports, and makes any Knip process failure fail the gate even when compact-output parsing cannot recover a finding.
AI-assisted maintainer work. No user-facing runtime contract change intended.
User Impact
Maintainers now get a hard failure for newly unused exports or files across production, tests, scripts, skills, and QA runtime fixtures. The repository starts at zero grandfathered findings.
Evidence
tbx_01kxmptzyd8ywb3qm3d1bs5w9s, Actions run 29474355325: production exports 0; full-tree exports 0; script entry exports 0; production unused files 0; full-tree unused files 0.3afbd8dd45c4fe91d61eeec309f612b82c522892:codex-rs/app-server-protocol/src/protocol/common.rs:864-867,codex-rs/app-server-protocol/src/protocol/v2/model.rs:43,130,codex-rs/app-server/src/request_processors/catalog_processor.rs:252-299, andcodex-rs/app-server/README.md:202confirm the modeled protocol/catalog boundaries.