# ci: enforce runtime exports while allowing types and schemas · PR \#10171 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/10171)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: cleanup-packages/knip-gate

Target branch: cleanup-packages/domain-contracts

Head commit: a5c20f2b8bc93ac9510c331a3fcc0a188de158e8

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/10171)

[Commits](https://git.cafe/pingdotgg/t3code/pull/10171/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/10171/diffs?format=markdown)

## Description

---

Unused runtime exports should fail CI across all internal packages without forcing us to hide exported types or Effect schemas.

Expand the export gate to all seven packages under packages/. Set Knip's types/nsTypes rules to off so the --exports CLI option cannot re-enable them. Wire a repo-local preprocessor into the standard audit, production audit, and CI export command. It uses TypeScript's Effect schema marker to filter only schema export/duplicate findings and their counters, without executing application modules. Decoders, factories, ordinary constants, unused files, and dependencies remain checked.

The scripts workspace declares the existing TypeScript 6.0.3 catalog dependency. The lockfile adds only that importer entry, with no new dependency version or OXC package. No whole schema files or packages are ignored.

Verification on the integrated, rebased stack:

- `vp run knip:check` passes for all seven internal packages.
- One real-CLI integration test proves types, schema aliases/defaults/re-exports, namespace exports, schema classes, and pipelines pass. It proves runtime helpers, ordinary duplicates, unused files, and dependencies still fail with exit code 1. An import-time throw verifies that application modules are never evaluated.
- 2,321 focused tests pass. No existing test files were changed or removed.
- Shared, contracts, client-runtime, scripts, and web typechecks pass; focused lint/format checks pass.

The preceding cleanup PRs were reworked to preserve exported types and schemas. The six open PRs now total 69 files, +523/-548, including this preprocessor and its integration coverage. The already-merged ACP PR is unchanged. Tooling-only change; screenshots are not applicable.

Follows [#10170](https://github.com/pingdotgg/t3code/pull/10170).

<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope's pull request summary ends here -->

Model: gpt-6 astra. Harness: Codex in T3 Code.

