Problem
DIFF-SYNC batches silently re-introduce imports from gutted modules (pi-embedded, model-catalog, memory, skills, etc.). These imports compile because stub files exist, but they exercise dead code paths. The existing gates (build, lint, rebrand) don't catch this.
Proposed Solution
A CI check script (similar to check-no-random-messaging-tmp.mjs and the rebrand gate) that:
-
Maintains a list of known-dead module patterns:
agents/pi-embedded
agents/model-catalog
agents/model-fallback
agents/model-selection
agents/skills
agents/sandbox
agents/pi-embedded-runner
memory/
acp/control-plane
acp/runtime
-
Greps all .ts files for from ".*{pattern}" or import.*{pattern}
-
Allows exceptions list (e.g., test files that mock for negative testing, the system-prompt.test.ts negative assertion)
-
Fails CI if any non-excepted import from a dead module is found
Implementation
- Script:
scripts/check-no-zombie-imports.mjs (matches naming of existing check-no-random-messaging-tmp.mjs)
- CI integration: Add as a step in the CI workflow, alongside rebrand-gate
- Dead module list: maintain in the script (or a config file)
- Exception list: inline comments
// zombie-gate-allow: {reason} or a separate config
Why CI, not just DIFF-SYNC
- DIFF-SYNC gates run only during sync batches
- Manual changes (feature work, bug fixes) can also accidentally import from dead modules
- CI catches ALL paths — sync, manual, cherry-pick, hotfix
Relationship to #2192
Issue #2192 (stub audit) eliminates the stub FILES. This gate prevents new IMPORTS. Together they close both vectors:
Priority
Should be implemented alongside or after #2192. The gate is most valuable once stubs are eliminated — at that point, any import from a dead module is a guaranteed build break, but the gate provides earlier, clearer feedback than a type error.
Problem
DIFF-SYNC batches silently re-introduce imports from gutted modules (pi-embedded, model-catalog, memory, skills, etc.). These imports compile because stub files exist, but they exercise dead code paths. The existing gates (build, lint, rebrand) don't catch this.
Proposed Solution
A CI check script (similar to
check-no-random-messaging-tmp.mjsand the rebrand gate) that:Maintains a list of known-dead module patterns:
Greps all
.tsfiles forfrom ".*{pattern}"orimport.*{pattern}Allows exceptions list (e.g., test files that mock for negative testing, the
system-prompt.test.tsnegative assertion)Fails CI if any non-excepted import from a dead module is found
Implementation
scripts/check-no-zombie-imports.mjs(matches naming of existingcheck-no-random-messaging-tmp.mjs)// zombie-gate-allow: {reason}or a separate configWhy CI, not just DIFF-SYNC
Relationship to #2192
Issue #2192 (stub audit) eliminates the stub FILES. This gate prevents new IMPORTS. Together they close both vectors:
Priority
Should be implemented alongside or after #2192. The gate is most valuable once stubs are eliminated — at that point, any import from a dead module is a guaranteed build break, but the gate provides earlier, clearer feedback than a type error.