Skip to content

refactor(deadcode): enforce repository hard zero - #108641

Merged
steipete merged 1 commit into
mainfrom
codex/hard-zero-full-deadcode
Jul 16, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/hard-zero-full-deadcode

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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

  • Blacksmith Testbox 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.
  • Full extension sweep: all 34 shards covered. Thirty-three passed directly; the QA shard exposed two stale test assumptions, then passed its focused rerun after correction.
  • Focused tooling tests: dead-export checks 20, unused-file checks 15, skill scripts 56, provider-drift tests 5, QA checks 4.
  • Type/lint proof: core, core-test, extensions, extension-test, and root-test type lanes green; touched-file type-aware lint green.
  • Fresh autoreview after source freeze: no accepted or actionable findings; overall confidence 0.86.
  • Upstream Codex dependency inspection at sibling SHA 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, and codex-rs/app-server/README.md:202 confirm the modeled protocol/catalog boundaries.
  • Diff: 187 files, +1,413/-2,284. No visual change.

@steipete
steipete requested a review from a team as a code owner July 16, 2026 05:39
@steipete
steipete merged commit bae9752 into main Jul 16, 2026
41 of 42 checks passed
@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: twitch Channel integration: twitch channel: qqbot extensions: qa-lab extensions: codex labels Jul 16, 2026
@steipete
steipete deleted the codex/hard-zero-full-deadcode branch July 16, 2026 05:40
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/copilot/package.json
  • extensions/msteams/package.json
  • extensions/qa-lab/package.json
  • package.json
  • packages/memory-host-sdk/package.json
  • pnpm-lock.yaml
  • ui/package.json

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: 6eec96da5133eee8eb7af7083749fbc0523dbe91
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Jul 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 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".

Comment thread config/knip.config.ts
"*.config.{js,mjs,cjs,ts,mts,cts}!",
"*.mjs!",
],
entry: [...rootEntries, "test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts}!"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +6 to +8
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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

steipete added a commit that referenced this pull request Jul 16, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 16, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 16, 2026
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.
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr channel: qqbot channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: twitch Channel integration: twitch channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web cli CLI command changes commands Command implementations dependencies-changed PR changes dependency-related files docker Docker and sandbox tooling extensions: codex extensions: copilot extensions: policy extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant