Repository navigation
test: typecheck integration tests and fix their type imports - #378
developerz-ai[bot] merged 2 commits into
Conversation
Extend the typecheck:tests program (packages/aitm/tsconfig.test.json) to
include packages/aitm/test TypeScript files alongside the existing
src/**/*.ts coverage, so integration tests that drift from package
source fail CI instead of only surfacing at runtime.
Re-point the integration imports that named a module which no longer
exports the type:
- PrGroup src/state/schema.ts -> src/domain/pr-group.ts
- WorkerDelivery src/subagents/worker.ts -> src/domain/worker-delivery.ts
- RunLoopInput / RunMergeFlowInput
src/cli/commands.ts -> src/composition/run-input.ts
Fix the diagnostics the new coverage exposes: PrGroup is the zod output
type, so the schema-defaulted fields dependsOn, stage and
reviewGraceApplied are required in it; the integration PrGroup literals
now carry them.
No compiler settings weakened, no diagnostics suppressed, no tests
excluded, and no Bun test runner added to CI.
Dz-Task-Id: tsk_e325c9cfcbb4eee26bb38ed92d7feea1
✅ Reviewed — nothing blocking0 actionable comment(s) · grounded on your code ⏱ 1m 20s wall clock · 🤖 developerz.ai — automated review, running on your model and your box. |
There was a problem hiding this comment.
Review summary — 13 file(s), 1 finding(s).
Critical 0 · Major 1 · Minor 0 · Nit 0
completed — Extends typechecking to integration tests and aligns their fixtures with current contracts. One cancellation-test change bypasses the signal-forwarding contract it previously exercised.
🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/gpt-6.1-sol on box hv-dedicated-dev-marshall — 540.5k in / 3.69k out over 8 calls; cost unknown: no price on record for router/gpt-6.1-sol.
|
Address review findings on #378
Work landed on #378 — watching it toward merge. 25m · 27 tool calls · 18 messages Sessions: coding run · review 1 🤖 developerz.ai, an automated agent, not a human — hv-dedicated-4 (developerz-ai[bot]) · model |
|
A fix round is working on this pull request. Nothing is needed from you right now.
Status for head 🤖 Posted by developerz.ai — an automated agent, not a human. |
Follow-up intent: Address review findings on #378 Dz-Task-Id: tsk_56e9e3c1a93fd400c334efacef74acb8
There was a problem hiding this comment.
Review summary — 1 file(s), 0 finding(s).
Completed The incremental diff verifies that runMergePr forwards the original abort signal and uses that signal in the cancellation flow. No blocking defects found.
🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/gpt-6.1-sol on box hv-dedicated-dev-din — 86.9k in / 506 out over 3 calls; cost unknown: no price on record for router/gpt-6.1-sol.
What
Extend the typecheck:tests program (packages/aitm/tsconfig.test.json) to
include packages/aitm/test TypeScript files alongside the existing
src/**/*.ts coverage, so integration tests that drift from package
source fail CI instead of only surfacing at runtime.
Re-point the integration imports that named a module which no longer
exports the type:
src/cli/commands.ts -> src/composition/run-input.ts
Fix the diagnostics the new coverage exposes: PrGroup is the zod output
type, so the schema-defaulted fields dependsOn, stage and
reviewGraceApplied are required in it; the integration PrGroup literals
now carry them.
No compiler settings weakened, no diagnostics suppressed, no tests
excluded, and no Bun test runner added to CI.
Acceptance
bun run typecheck:tests(i.e.tsc --noEmit -p packages/aitm/tsconfig.test.json) reports no errors, withpackages/aitm/tsconfig.test.jsonincludingtest/**/*.tsalongside its existingsrc/**/*.tscoverage.packages/aitm/tsconfig.test.jsoncontains no relaxed compilerOption (strict stays true, no newexcludeof test files, noskipLibCheckchange) and no@ts-ignore/@ts-expect-error/// @ts-nocheckappears anywhere under packages/aitm/test.src/domain/pr-group.ts, every WorkerDelivery tosrc/domain/worker-delivery.ts, and every RunLoopInput / RunMergeFlowInput tosrc/composition/run-input.ts— no import of these four types remains pointing atsrc/state/schema.ts, `src/su [trimmed]RunStateandRunStateSchemaare still imported fromsrc/state/schema.tsin the integration tests (that module genuinely exports them), i.e. no import was moved to a module that does not export it.PrGrouptype, including the schema-defaulted-but-output-requiredreviewGraceApplied(andstagewhere it was absent) — proved by the clean typecheck:tests run, not by a loosened type.bun run typecheck(the src project) is unchanged and still passes; the change does not touch packages/aitm/tsconfig.json or tsconfig.build.json.bun run lint(biome check .) passes on the changed test files, and no Bun test runner was added to .github/workflows/ci.yml.npm run test:node --workspacesandnpm run test:integration -w @developerz.ai/aitmremain the authoritative runners and pass as before (the integration job self-skips e2e-smoke without secrets, as it did before).Changes
packages/aitm/tsconfig.test.json(edit) — Widen the typecheck:tests program to also include packages/aitm/test TypeScript files: add "test//*.ts" toincludealongside the existing "src//*.ts". Do NOT relax any compilerOption (no noUnusedLocals off, no skipLibCheck change, no exclude of test files) and do NOT add any @ts-expect-error / @ts-ignore — the point is that the integration files typecheck cleanly.packages/aitm/test/integration/adapter-start-flow.test.ts(edit) — Re-point the wrong type imports:RunLoopInputfrom '../../src/cli/commands.ts' → '../../src/composition/run-input.ts' (the module that actually exports it),PrGroupfrom '../../src/state/schema.ts' → '../../src/domain/pr-group.ts',WorkerDeliveryfrom '../../src/subagents/worker.ts' → '../../src/domain/worker-delivery.ts'. Then fix the PrGroup literal at line 57 (PLAN_GROUP) which omits the schema-defaulted-but-output-required fieldsstageandreviewGraceApplied— addstage: 'pending'andreviewGraceApplied: falseso the literal satisfies the real PrGroup type.packages/aitm/test/integration/start-flow.test.ts(edit) — Re-point the wrong type imports:RunLoopInputfrom '../../src/cli/commands.ts' → '../../src/composition/run-input.ts',PrGroupfrom '../../src/state/schema.ts' → '../../src/domain/pr-group.ts',WorkerDeliveryfrom '../../src/subagents/worker.ts' → '../../src/domain/worker-delivery.ts'. Then fix BOTH PrGroup literals (line ~73 and line ~269) which omit the output-requiredstageandreviewGraceAppliedfields.packages/aitm/test/integration/resume-flow.test.ts(edit) — Re-point the wrong type imports:RunLoopInputfrom '../../src/cli/commands.ts' → '../../src/composition/run-input.ts',PrGroupfrom '../../src/state/schema.ts' → '../../src/domain/pr-group.ts',WorkerDeliveryfrom '../../src/subagents/worker.ts' → '../../src/domain/worker-delivery.ts'. Then fix the PrGroup literal (line ~81) which omits the output-requiredstageandreviewGraceAppliedfields.packages/aitm/test/integration/legacy-state.test.ts(edit) — Re-point the wrong type imports:RunLoopInputfrom '../../src/cli/commands.ts' → '../../src/composition/run-input.ts',PrGroupfrom '../../src/state/schema.ts' → '../../src/domain/pr-group.ts',WorkerDeliveryfrom '../../src/subagents/worker.ts' → '../../src/domain/worker-delivery.ts'. NoteRunStatestays imported from '../../src/state/schema.ts' — that module DOES export it. Check for any PrGroup literal in this file needing the output-requiredstage/reviewGraceAppliedfields.packages/aitm/test/integration/crash-durability.test.ts(edit) — Re-point the wrong type imports:RunLoopInputfrom '../../src/cli/commands.ts' → '../../src/composition/run-input.ts',PrGroupfrom '../../src/state/schema.ts' → '../../src/domain/pr-group.ts'. NoteRunStateandRunStateSchemastay imported from '../../src/state/schema.ts' — that module DOES export both. Then fix the PrGroup literals:crashGroup()(line ~328) andtwoTaskGroup(line ~582) omit the output-requiredreviewGraceApplied(andstagewhere absent) fields.packages/aitm/test/integration/ci-fix-loop.test.ts(edit) — Re-point the wrong type imports:RunMergeFlowInputfrom '../../src/cli/commands.ts' → '../../src/composition/run-input.ts',PrGroupfrom '../../src/state/schema.ts' → '../../src/domain/pr-group.ts'. NoteRunStateandRunStateSchemastay imported from '../../src/state/schema.ts' — that module DOES export both. Then fix theciFixGroup()PrGroup literal (line ~457) which omits the output-requiredreviewGraceAppliedfield.packages/aitm/test/integration/concurrent-groups.test.ts(edit) — Re-point the wrong type import:PrGroupfrom '../../src/state/schema.ts' → '../../src/domain/pr-group.ts'. NoteRunStateandRunStateSchemastay imported from '../../src/state/schema.ts' — that module DOES export both. Then fix themakeGroup()PrGroup literal (line ~69) which omits the output-requiredreviewGraceAppliedfield.packages/aitm/test/integration/sigint-cancellation.test.ts(edit) — Re-point the wrong type import:PrGroupfrom '../../src/state/schema.ts' → '../../src/domain/pr-group.ts'. Then fix thegroupPrGroup literal (line ~273) which omits the output-requiredstageandreviewGraceAppliedfields.packages/aitm/test/integration/hostile-repo.test.ts(edit) — No wrong type imports to fix, but this file is newly covered by typecheck:tests — read it and fix any type diagnostics it exposes (e.g. theCreateMcpClient/McpClientManagerseam usage) without suppressing them.packages/aitm/test/integration/tool-output-spill.test.ts(edit) — No wrong type imports to fix, but this file is newly covered by typecheck:tests — read it and fix any type diagnostics it exposes (notably thebash.executecast at the top of the file) without suppressing them.packages/aitm/CLAUDE.md(edit) — [docs] packages/aitm/CLAUDE.md:21 states "-typecheck(src) andtypecheck:tests(test files) are separate tsc projects — both must pass." That parenthetical is now false: this diff adds "test/**/*.ts" to packages/aitm/tsconfig.test.json:8, sotypecheck:testscovers src AND the packages/aitm/test integration suite, not only "test files" in the src-tree sense. Update the line so it names what the two projects actually cover (e.g.typecheck= src product code;typecheck:tests= src test files + the test/integration suite) — a maintainer reading this today would assume the inte [trimmed]CLAUDE.md(edit) — [docs] CLAUDE.md:42 states "|typecheck/typecheck:tests| Separate tsc projects for src and test files — both must pass |". This diff makestypecheck:testscover src PLUS packages/aitm/test/** (the real-git integration suite), so "src and test files" no longer describes the split. Update the cell to state thattypecheck:testsadditionally includes the test/integration suite, so the next maintainer reading the gate table knows integration-file drift now fails CI (thebunjob runsbun run typecheck:tests— .github/workflows/ci.yml:48). Also worth adding one clause to the [trimmed]Verification
./bin/checkpassed (exit 0) in 5m 47s.Notes
Premises of the request the team disproved:
PrGroupisz.infer<typeof PrGroupSchema>(packages/aitm/src/domain/pr-group.ts:69) and PrGroupSchema applies.default()todependsOn(line 46),stage(line 54) andreviewGraceApplied(line 67), those three fields are REQUIRED in the output type. Every PrGroup literal in the i [trimmed]includeis currently['src/**/*.ts'](packages/aitm/tsconfig.test.json:8) and its ownexcludeis['dist','node_modules'](line 9) — it deliberately OVERRIDES the base tsconfig.json exclude ofsrc/**/*.test.ts(packages/aitm/tsconfig.json:26), [trimmed]🤖 Opened by developerz.ai for task
tsk_e325c9cfcbb4eee26bb38ed92d7feea1on developerz-ai/ai-task-master.Raised automatically by the
raw_task_triagelane.