Skip to content

fix: recognize real static-analysis consumers - #183118

Merged
shakkernerd merged 1 commit into
mainfrom
fix/actual-analyzer-consumers-316
Oct 25, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/actual-analyzer-consumers-316

Conversation

@shakkernerd

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenClaw's unused-export checks report 17 live declarations as dead because their consumers sit behind package-script generators, build and test-runner configuration, generated type declarations, emitted child source, or module-loader hooks that Knip does not follow on its own. That makes the cleanup signal unsafe: removing these declarations would break real build, validator, benchmark, fixture, or type contracts, while broad suppressions would hide genuinely unused exports.

User Impact

There is no user-visible runtime change. Maintainers get accurate unused-export results for these real consumers while unrelated authored exports, production-only test seams, generated outputs, and strict production/full-tree/script boundaries remain detectable. No dependency, configuration option, schema, data, package API, runtime behavior, benchmark behavior, or migration changes.

Why This Change Was Made

The repair teaches each existing owner about the consumer it already has:

  • production analysis treats the maintained static-validator/runtime-asset generators and tsdown.config.ts as exact inputs;
  • the script pass delegates parity and retention configuration to Knip's Vitest integration and projects the existing UI Vite import across the excluded workspace boundary;
  • source-derived compiler edges model the exact names imported by generated benchmark child source and the team-report module hook, and derive the three runtime-manifest names from the live tsdown.config.ts import;
  • Synology and the generated Presence declaration use ordinary top-level type imports so the real type contracts remain visible without an exception.

The compiler projections disappear when their source consumer disappears, and no file-, directory-, or export-family ignore was added.

Evidence

On base 3270e6953055a12ceb9f8ad4a3dad908b5f27972, the repository-owned export wrapper reproduced the 17 unique declarations across 11 production rows, four full-tree rows, and five script rows, with expected overlap.

The exact committed tree bee8ae7bff50728d2e3e990314c56dd38675377a then passed the focused remote gate on a 32-CPU AWS runner:

  • changed-file format/lint and Control UI i18n verification passed;
  • pnpm static:validators:check reported every generated output fresh;
  • all 17 assigned rows disappeared from the three export scans;
  • unrelated authored-export controls (RELEASE_ONLY_RUNTIME_TEST_FILES, createReportRunFixtureFetch, and runtimeProcessStandaloneModules) remained visible;
  • production-only test seams for Abliteration, Feishu, and Zalouser remained visible, confirming the full-tree distinction was not weakened;
  • affected core, UI, extension, script, and root-test type graphs passed;
  • test/scripts/check-deadcode-exports.test.ts passed 17/17 tests.

The aggregate export wrapper still exits nonzero on unrelated pinned-base backlog; this PR does not relabel that backlog as green. Hosted CI, exact-head ClawSweeper evidence, and independent review are pending on the published head.

@clawsweeper

clawsweeper Bot commented Oct 25, 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-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@shakkernerd
shakkernerd merged commit 3940719 into main Oct 25, 2026
124 checks passed
@shakkernerd
shakkernerd deleted the fix/actual-analyzer-consumers-316 branch October 25, 2026 01:59
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: Static analysis now recognizes the 17 live consumer edges while preserving strict unused-export detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: synology-chat clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. gateway Gateway runtime scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant