Unit tests sit next to the code they test. This folder holds cross-package and end-to-end tests:
test/integration/: architecture and boundary checks (package imports, vendored Interchange revision, workspace exports) and Builder's contracts with vendored Interchange, such as the text its mail delivers. Runs inbun run testwith no database.test/e2e/: end-to-end tests against an isolated Postgres, the real hub and real sidecars (custom-provider.test.ts,oauth-model-login.test.ts,specialist-end-notices.test.tsandpipeline.test.ts).test/e2e/support/: shared harness (hub.ts), the recorded OpenAI-compatible model server (recorded-model.tsand its unit tests inrecorded-model.test.ts) and the fixture extractor (extract.ts).test/fixtures/pipeline/: recorded turns (scenario.jsonandruns/<runKey>/exchanges/<n>/) replayed bypipeline.test.ts.
pipeline.test.ts drives a whole project through the real hub, sidecars,
approvals, check_design and check-app by registering recorded-model.ts as
a custom OpenAI-compatible provider:
- Matching (
expect.json): each/v1/chat/completionsturn is matched structurally onlastMessageRole,userTextContains,requiredToolsandtoolResults(callId,toolName,isError,keys,contains) rather than full prompt text, so ordinary prompt wording edits do not break it. - Bindings (
{{bind:<key>}}): a tool result inexpect.jsoncan capture live values ("bind": { "brief_id": "artifactId" }) and substitute{{bind:brief_id}}into laterresponse.sseturns. - Updating the replay: tool names, tool result keys, specialist task framing,
approval gates and starter checks are verified during replay. Update
declarative approval or artifact steps in
pipeline.test.ts, or updateextract.tsand regenerate the fixtures from a throwaway local run:
bun --conditions=intx-src test/e2e/support/extract.tsWith the builder-e2e database running (docs/DEV.md):
bun run test:e2e
bun --conditions=intx-src test test/e2e/support/recorded-model.test.ts
bun --env-file=.env.hub --conditions=intx-src test test/e2e/custom-provider.test.ts test/e2e/oauth-model-login.test.ts test/e2e/specialist-end-notices.test.ts
bun --env-file=.env.hub --conditions=intx-src test test/e2e/pipeline.test.ts