Goal
Finish A6: fix the remaining test type errors, run npm run typecheck:tests in CI so tests cannot drift from the API again, and prove that a consumer with skipLibCheck: false gets clean types from the published declarations. Plan row A6 ("Type-check the test files in CI; skipLibCheck: false consumers get clean types").
Current state
Verified on main at cc5ddb8:
- After A6a,
tsconfig.tests.json and npm run typecheck:tests exist, and src/execution/, src/context/, src/session/, src/subagents/, src/acp/, src/testing/ are clean.
- Remaining errors on
cc5ddb8 (78): src/tools/ 29 (15 in src/tools/built-in/index.test.ts, for example :33 "Argument of type '{}' is not assignable to parameter of type 'ToolExecutionOptions'", :52 "'dayNameTool.tool.execute' is possibly 'undefined'"), src/providers/ 14, src/triggers/ 6, src/multimodalInput.test.ts 6, src/cli/ 5, src/evals/ 4, and 1-2 each in src/utils/, src/spec/, src/flows/ (FlowExecutor.test.ts:41: "'type' does not exist in type 'AgentConfig'"), src/deploy/, src/channels/, src/ui/, src/schedules/, src/memory/, src/dynamicConfig.test.ts.
- CI:
.github/workflows/ci.yml:24 npx tsc --noEmit, :42 npm run test:types; the typecheck-zod4 job (:78-92) runs tsc --noEmit and test:types with zod 4.
- Published declarations:
scripts/pack-smoke.ts:228-255 checkTypes() type-checks an entry file importing the root, ./testing, ./tools, ./hooks from the installed tarball with skipLibCheck: true (:247), in bundler and node16 modes. Nothing checks the declarations with skipLibCheck: false. A local check of dist/*.d.ts for every entry with skipLibCheck: false against the repository's node_modules gave 0 errors on cc5ddb8, so this is a guard, not a fix.
Scope
In:
- Fix every remaining
npm run typecheck:tests error (same rules as A6a: change tests, not source; no any, no @ts-ignore; @ts-expect-error only with a reason; open an issue for a real public-type bug instead of fixing it here).
- CI: in
.github/workflows/ci.yml, add - run: npm run typecheck:tests right after npx tsc --noEmit in the main job, and in the typecheck-zod4 job after its tsc --noEmit.
scripts/pack-smoke.ts checkTypes(): add a third mode strict-libs (module: 'esnext', moduleResolution: 'bundler', skipLibCheck: false) whose entry imports a type or value from every exports subpath whose optional peer is installed in the smoke project (read the list with the existing listExports(); skip ./react, ./vue, ./svelte, ./otel, ./sqlite unless their peer resolves in the temp project, and log each skip). The log line names the subpaths checked.
CONTRIBUTING.md: one line in the checks list: npm run typecheck:tests (tests are type-checked).
- BRIEF-2's verification list is not in this repository; mention in the pull request that
npm run typecheck:tests should be added to it.
Out:
examples/** and Agent Forge tests.
- Changing
tsconfig.json's exclude (the build config must keep excluding tests from dist).
Acceptance criteria
Live test
None: this ticket spends nothing.
Dependencies
- A6a must merge first. A1, A3 and A5 should have merged (they rename or move code these tests import; fixing types before them means fixing twice).
- Conflicts: open tickets that edit tests in
src/tools/, src/providers/, src/triggers/ (M1, M2, M8, N1, N2, N13a); rebase before merging.
ci.yml is CI configuration but not a release step, so no owner decision is needed.
Notes for the implementer
src/tools/built-in/index.test.ts calls tool.execute({}, {}) on the legacy tool.execute; use getToolExecute() (src/tools/toolContract.ts) or pass a minimal ToolExecutionOptions built once at the top of the file.
FlowExecutor.test.ts:41 builds an AgentConfig with type; check what the test meant (probably the flow's agent definition) before deleting the field.
- The
typecheck-zod4 job installs zod 4 with --no-save; tests that build zod schemas may report different errors there. Run npm install --no-save zod@4 && npm run typecheck:tests locally once, then restore with npm ci.
- pack-smoke's temp project installs the SDK tarball plus the peers it lists (
scripts/pack-smoke.ts:281); @types/react is not among them, so ./react must be skipped in strict-libs unless you add it to that install.
Round 2 ticket A6b. Before starting, read the agent brief (worktree rules, verification list, live-test budget) and the plan. One ticket is one pull request; put Closes #<this issue> in it.
Goal
Finish A6: fix the remaining test type errors, run
npm run typecheck:testsin CI so tests cannot drift from the API again, and prove that a consumer withskipLibCheck: falsegets clean types from the published declarations. Plan row A6 ("Type-check the test files in CI;skipLibCheck: falseconsumers get clean types").Current state
Verified on
mainatcc5ddb8:tsconfig.tests.jsonandnpm run typecheck:testsexist, andsrc/execution/,src/context/,src/session/,src/subagents/,src/acp/,src/testing/are clean.cc5ddb8(78):src/tools/29 (15 insrc/tools/built-in/index.test.ts, for example:33"Argument of type '{}' is not assignable to parameter of type 'ToolExecutionOptions'",:52"'dayNameTool.tool.execute' is possibly 'undefined'"),src/providers/14,src/triggers/6,src/multimodalInput.test.ts6,src/cli/5,src/evals/4, and 1-2 each insrc/utils/,src/spec/,src/flows/(FlowExecutor.test.ts:41: "'type' does not exist in type 'AgentConfig'"),src/deploy/,src/channels/,src/ui/,src/schedules/,src/memory/,src/dynamicConfig.test.ts..github/workflows/ci.yml:24npx tsc --noEmit,:42npm run test:types; thetypecheck-zod4job (:78-92) runstsc --noEmitandtest:typeswith zod 4.scripts/pack-smoke.ts:228-255checkTypes()type-checks an entry file importing the root,./testing,./tools,./hooksfrom the installed tarball withskipLibCheck: true(:247), inbundlerandnode16modes. Nothing checks the declarations withskipLibCheck: false. A local check ofdist/*.d.tsfor every entry withskipLibCheck: falseagainst the repository'snode_modulesgave 0 errors oncc5ddb8, so this is a guard, not a fix.Scope
In:
npm run typecheck:testserror (same rules as A6a: change tests, not source; noany, no@ts-ignore;@ts-expect-erroronly with a reason; open an issue for a real public-type bug instead of fixing it here)..github/workflows/ci.yml, add- run: npm run typecheck:testsright afternpx tsc --noEmitin the main job, and in thetypecheck-zod4job after itstsc --noEmit.scripts/pack-smoke.tscheckTypes(): add a third modestrict-libs(module: 'esnext',moduleResolution: 'bundler',skipLibCheck: false) whose entry imports a type or value from everyexportssubpath whose optional peer is installed in the smoke project (read the list with the existinglistExports(); skip./react,./vue,./svelte,./otel,./sqliteunless their peer resolves in the temp project, and log each skip). The log line names the subpaths checked.CONTRIBUTING.md: one line in the checks list:npm run typecheck:tests(tests are type-checked).npm run typecheck:testsshould be added to it.Out:
examples/**and Agent Forge tests.tsconfig.json'sexclude(the build config must keep excluding tests fromdist).Acceptance criteria
npm run typecheck:testsexits 0; the before and after counts are in the pull request.ci.ymlruns it in the main job and intypecheck-zod4.npm run pack-smokepasses and prints thestrict-libsline with the subpaths checked.### Changed(maintainers): "Test files are type-checked (npm run typecheck:tests, in CI);pack-smokealso checks the published declarations withskipLibCheck: false."Live test
None: this ticket spends nothing.
Dependencies
src/tools/,src/providers/,src/triggers/(M1, M2, M8, N1, N2, N13a); rebase before merging.ci.ymlis CI configuration but not a release step, so no owner decision is needed.Notes for the implementer
src/tools/built-in/index.test.tscallstool.execute({}, {})on the legacytool.execute; usegetToolExecute()(src/tools/toolContract.ts) or pass a minimalToolExecutionOptionsbuilt once at the top of the file.FlowExecutor.test.ts:41builds anAgentConfigwithtype; check what the test meant (probably the flow's agent definition) before deleting the field.typecheck-zod4job installs zod 4 with--no-save; tests that build zod schemas may report different errors there. Runnpm install --no-save zod@4 && npm run typecheck:testslocally once, then restore withnpm ci.scripts/pack-smoke.ts:281);@types/reactis not among them, so./reactmust be skipped instrict-libsunless you add it to that install.Round 2 ticket
A6b. Before starting, read the agent brief (worktree rules, verification list, live-test budget) and the plan. One ticket is one pull request; putCloses #<this issue>in it.