Skip to content

test: typecheck integration tests and fix their type imports - #378

Merged
developerz-ai[bot] merged 2 commits into
mainfrom
dz/include-integration-tests-in-test-typechecking--e325c9cf
Nov 3, 2026
Merged

developerz-ai[bot] merged 2 commits into
mainfrom
dz/include-integration-tests-in-test-typechecking--e325c9cf

Conversation

@developerz-ai

@developerz-ai developerz-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • 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.

Acceptance

  • bun run typecheck:tests (i.e. tsc --noEmit -p packages/aitm/tsconfig.test.json) reports no errors, with packages/aitm/tsconfig.test.json including test/**/*.ts alongside its existing src/**/*.ts coverage.
  • packages/aitm/tsconfig.test.json contains no relaxed compilerOption (strict stays true, no new exclude of test files, no skipLibCheck change) and no @ts-ignore / @ts-expect-error / // @ts-nocheck appears anywhere under packages/aitm/test.
  • Every integration import of PrGroup resolves to src/domain/pr-group.ts, every WorkerDelivery to src/domain/worker-delivery.ts, and every RunLoopInput / RunMergeFlowInput to src/composition/run-input.ts — no import of these four types remains pointing at src/state/schema.ts, `src/su [trimmed]
  • RunState and RunStateSchema are still imported from src/state/schema.ts in the integration tests (that module genuinely exports them), i.e. no import was moved to a module that does not export it.
  • Every PrGroup object literal in packages/aitm/test satisfies the real PrGroup type, including the schema-defaulted-but-output-required reviewGraceApplied (and stage where 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 --workspaces and npm run test:integration -w @developerz.ai/aitm remain 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" to include alongside 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: RunLoopInput from '../../src/cli/commands.ts' → '../../src/composition/run-input.ts' (the module that actually exports it), PrGroup from '../../src/state/schema.ts' → '../../src/domain/pr-group.ts', WorkerDelivery from '../../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 fields stage and reviewGraceApplied — add stage: 'pending' and reviewGraceApplied: false so the literal satisfies the real PrGroup type.
  • packages/aitm/test/integration/start-flow.test.ts (edit) — Re-point the wrong type imports: RunLoopInput from '../../src/cli/commands.ts' → '../../src/composition/run-input.ts', PrGroup from '../../src/state/schema.ts' → '../../src/domain/pr-group.ts', WorkerDelivery from '../../src/subagents/worker.ts' → '../../src/domain/worker-delivery.ts'. Then fix BOTH PrGroup literals (line ~73 and line ~269) which omit the output-required stage and reviewGraceApplied fields.
  • packages/aitm/test/integration/resume-flow.test.ts (edit) — Re-point the wrong type imports: RunLoopInput from '../../src/cli/commands.ts' → '../../src/composition/run-input.ts', PrGroup from '../../src/state/schema.ts' → '../../src/domain/pr-group.ts', WorkerDelivery from '../../src/subagents/worker.ts' → '../../src/domain/worker-delivery.ts'. Then fix the PrGroup literal (line ~81) which omits the output-required stage and reviewGraceApplied fields.
  • packages/aitm/test/integration/legacy-state.test.ts (edit) — Re-point the wrong type imports: RunLoopInput from '../../src/cli/commands.ts' → '../../src/composition/run-input.ts', PrGroup from '../../src/state/schema.ts' → '../../src/domain/pr-group.ts', WorkerDelivery from '../../src/subagents/worker.ts' → '../../src/domain/worker-delivery.ts'. Note RunState stays imported from '../../src/state/schema.ts' — that module DOES export it. Check for any PrGroup literal in this file needing the output-required stage / reviewGraceApplied fields.
  • packages/aitm/test/integration/crash-durability.test.ts (edit) — Re-point the wrong type imports: RunLoopInput from '../../src/cli/commands.ts' → '../../src/composition/run-input.ts', PrGroup from '../../src/state/schema.ts' → '../../src/domain/pr-group.ts'. Note RunState and RunStateSchema stay imported from '../../src/state/schema.ts' — that module DOES export both. Then fix the PrGroup literals: crashGroup() (line ~328) and twoTaskGroup (line ~582) omit the output-required reviewGraceApplied (and stage where absent) fields.
  • packages/aitm/test/integration/ci-fix-loop.test.ts (edit) — Re-point the wrong type imports: RunMergeFlowInput from '../../src/cli/commands.ts' → '../../src/composition/run-input.ts', PrGroup from '../../src/state/schema.ts' → '../../src/domain/pr-group.ts'. Note RunState and RunStateSchema stay imported from '../../src/state/schema.ts' — that module DOES export both. Then fix the ciFixGroup() PrGroup literal (line ~457) which omits the output-required reviewGraceApplied field.
  • packages/aitm/test/integration/concurrent-groups.test.ts (edit) — Re-point the wrong type import: PrGroup from '../../src/state/schema.ts' → '../../src/domain/pr-group.ts'. Note RunState and RunStateSchema stay imported from '../../src/state/schema.ts' — that module DOES export both. Then fix the makeGroup() PrGroup literal (line ~69) which omits the output-required reviewGraceApplied field.
  • packages/aitm/test/integration/sigint-cancellation.test.ts (edit) — Re-point the wrong type import: PrGroup from '../../src/state/schema.ts' → '../../src/domain/pr-group.ts'. Then fix the group PrGroup literal (line ~273) which omits the output-required stage and reviewGraceApplied fields.
  • 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. the CreateMcpClient/McpClientManager seam 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 the bash.execute cast at the top of the file) without suppressing them.
  • packages/aitm/CLAUDE.md (edit) — [docs] packages/aitm/CLAUDE.md:21 states "- typecheck (src) and typecheck: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, so typecheck:tests covers 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 makes typecheck:tests cover 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 that typecheck:tests additionally includes the test/integration suite, so the next maintainer reading the gate table knows integration-file drift now fails CI (the bun job runs bun run typecheck:tests — .github/workflows/ci.yml:48). Also worth adding one clause to the [trimmed]

Verification

./bin/check passed (exit 0) in 5m 47s.

Notes

Premises of the request the team disproved:

  • The request says to locate 'the integration imports of PrGroup, WorkerDelivery, RunLoopInput and RunMergeFlowInput and align them with their actual exporting modules' — this is confirmed, not falsified, but the fix set is exactly 9 files: adapter-start-flow.test.ts, start-flow.test.ts, resume-flow.test.ts, legacy-state.test.ts, crash-durability.test.ts, ci-fix-loop.test.ts, concurrent-gr [trimmed]
  • The request implies the only diagnostics are the four wrong type imports. That is incomplete: because PrGroup is z.infer<typeof PrGroupSchema> (packages/aitm/src/domain/pr-group.ts:69) and PrGroupSchema applies .default() to dependsOn (line 46), stage (line 54) and reviewGraceApplied (line 67), those three fields are REQUIRED in the output type. Every PrGroup literal in the i [trimmed]
  • A plausible reading of 'without ... coverage exclusions' is that the tsc program may only add the test files. Note the tsconfig.test.json include is currently ['src/**/*.ts'] (packages/aitm/tsconfig.test.json:8) and its own exclude is ['dist','node_modules'] (line 9) — it deliberately OVERRIDES the base tsconfig.json exclude of src/**/*.test.ts (packages/aitm/tsconfig.json:26), [trimmed]

🤖 Opened by developerz.ai for task tsk_e325c9cfcbb4eee26bb38ed92d7feea1 on developerz-ai/ai-task-master.

Raised automatically by the raw_task_triage lane.

🤖 developerz.ai, an automated agent, not a human — this PR is one slice of a stacked plan.
Dispatched automatically by the raw_task_triage lane
Model MiniMax-M3 on router.ai.developerz.ai via native, funded by account_key
Ran on box hv-dedicated-dev-din
Cost unknown: no list price on record for MiniMax-M3 on router.ai.developerz.ai
Run timeline run_62e63f8256d34095b6e9e4c9d728832a
Part 1/1 of plan rtk_f6700023c58c4afe950bf123bf129adb

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
@developerz-ai developerz-ai Bot added dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:MiniMax-M3 developerz.ai: model that wrote this bot PR. dz/provider:router.ai.developerz.ai developerz.ai: provider that served this bot PR. labels Nov 3, 2026
@developerz-ai

developerz-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Reviewed — nothing blocking

0 actionable comment(s) · grounded on your code

⏱ 1m 20s wall clock · gpt-6.1-sol via router · 3 model call(s) · 506 output token(s)

🤖 developerz.ai — automated review, running on your model and your box.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@developerz-ai

developerz-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

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 MiniMax-M3 on api.minimax.io

@developerz-ai

developerz-ai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

A fix round is working on this pull request. Nothing is needed from you right now.

  • Red on this head: no check is failing
  • What was done: Fix round tsk_56e9e3c1a93fd400c334efacef74acb8 is running against the failing check(s) and any open review findings.
  • What happens next: It pushes to this branch when it is done; CI and the review then run on the new head.

Status for head 677584905e62. This comment is updated in place.

🤖 Posted by developerz.ai — an automated agent, not a human.

Follow-up intent: Address review findings on #378

Dz-Task-Id: tsk_56e9e3c1a93fd400c334efacef74acb8

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@developerz-ai
developerz-ai Bot merged commit 9078096 into main Nov 3, 2026
4 checks passed
@developerz-ai
developerz-ai Bot deleted the dz/include-integration-tests-in-test-typechecking--e325c9cf branch November 3, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:MiniMax-M3 developerz.ai: model that wrote this bot PR. dz/provider:router.ai.developerz.ai developerz.ai: provider that served this bot PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants