Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .corbits-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ rules:
- id: empty-fallback
language: typescript
message: Invented fallback (an empty string, list, object or zero); handle the missing value instead.
ignores: ["**/*.test.ts", "**/*.test.tsx", "tests/**"]
ignores: ["**/*.test.ts", "**/*.test.tsx", "test/**"]
rule:
any:
- pattern: $X || []
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ change follows, whether a person or a coding agent writes it.
- **Tests are load-bearing.** Write one when it guards an invariant (an
approval binds to an exact version, a secret never reaches a response) or
proves behaviour end to end through the real API. Unit tests live beside
their code; cross-module checks go in `tests/integration`, real service
tests in `tests/e2e`.
their code; cross-module checks go in `test/integration`, real service
tests in `test/e2e`.
- **Model-agnostic.** Every role runs on any supported provider and model.
- **No secrets.** The `.env.*.example` files are the only tracked env files.
- **`vendor/interchange` is upstream code**, pinned at
Expand Down
2 changes: 1 addition & 1 deletion apps/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ design and watches the app being built.
The interface reaches the hub only through its HTTP API, using the typed
client in [`packages/client`][client] and the shared types in
[`packages/schemas`][schemas]. It never imports the hub, Postgres or
Drizzle; `tests/integration/architecture.test.ts` fails on that. In
Drizzle; `test/integration/architecture.test.ts` fails on that. In
development Vite proxies `/api` to the hub at `UI_HUB_ORIGIN`; a deployed hub
serves the built `dist/` on its own origin.

Expand Down
30 changes: 15 additions & 15 deletions docs/IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,27 +111,27 @@ Environment files, installs and build output never leave the workspace.

## Package layout

| Path | Package | What it holds |
| -------------------------- | ------------------------------ | ---------------------------------------------------------------- |
| `apps/hub` | `@corbits-builder/hub` | The server: routes, services, hub tools, provisioning, live app. |
| `packages/client` | `@corbits-builder/client` | The typed client for the hub's API. |
| `apps/web` | `@corbits-builder/web` | The interface, built only on the client and the schemas. |
| `workflows/coordinator` | `@corbits-builder/coordinator` | The coordinator's agent, prompt and workflow. |
| `workflows/writer` | `@corbits-builder/writer` | The document writer and its per-kind skills. |
| `workflows/reviewer` | `@corbits-builder/reviewer` | The document reviewer. |
| `workflows/designer` | `@corbits-builder/designer` | The designer, its starter, themes and skills. |
| `workflows/coder` | `@corbits-builder/coder` | The coder, its app starter and `check-app`. |
| `packages/schemas` | `@corbits-builder/schemas` | Types and schemas shared by the hub, client and workflows. |
| `vendor/interchange` | | Interchange at the pinned revision. |
| `deploy/` | | The Dockerfile and Compose files. |
| `tests/integration`, `e2e` | | Cross-module and full-stack tests. |
| Path | Package | What it holds |
| ------------------------- | ------------------------------ | ---------------------------------------------------------------- |
| `apps/hub` | `@corbits-builder/hub` | The server: routes, services, hub tools, provisioning, live app. |
| `packages/client` | `@corbits-builder/client` | The typed client for the hub's API. |
| `apps/web` | `@corbits-builder/web` | The interface, built only on the client and the schemas. |
| `workflows/coordinator` | `@corbits-builder/coordinator` | The coordinator's agent, prompt and workflow. |
| `workflows/writer` | `@corbits-builder/writer` | The document writer and its per-kind skills. |
| `workflows/reviewer` | `@corbits-builder/reviewer` | The document reviewer. |
| `workflows/designer` | `@corbits-builder/designer` | The designer, its starter, themes and skills. |
| `workflows/coder` | `@corbits-builder/coder` | The coder, its app starter and `check-app`. |
| `packages/schemas` | `@corbits-builder/schemas` | Types and schemas shared by the hub, client and workflows. |
| `vendor/interchange` | | Interchange at the pinned revision. |
| `deploy/` | | The Dockerfile and Compose files. |
| `test/integration`, `e2e` | | Cross-module and full-stack tests. |

Workflow packages declare their agents and workflows with Interchange's
definition exports (`@intx/agent/authoring`, `@intx/workflow/definition`).
Cross-workspace
imports use declared `@corbits-builder/*` exports and `workspace:*`
dependencies;
[tests/integration/architecture.test.ts](https://github.com/corbitsdev/corbits-builder/blob/main/tests/integration/architecture.test.ts)
[test/integration/architecture.test.ts](https://github.com/corbitsdev/corbits-builder/blob/main/test/integration/architecture.test.ts)
checks that code imports Interchange by package name and that the interface
never imports the server or the database.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"format": "bun fmt --no-script",
"format:check": "bun fmt --no-script --check",
"typecheck": "bun check --no-script && bun check --no-script -p packages/client && bun check --no-script -p apps/web",
"test": "bun --conditions=intx-src test ./apps/hub ./apps/web/src ./packages ./workflows ./tests/integration",
"test:e2e": "bun --env-file=.env.hub --conditions=intx-src test ./tests/e2e",
"test": "bun --conditions=intx-src test ./apps/hub ./apps/web/src ./packages ./workflows ./test/integration",
"test:e2e": "bun --env-file=.env.hub --conditions=intx-src test ./test/e2e",
"vendor:verify": "bun scripts/verify-vendor.ts",
"pins:verify": "bun scripts/verify-pins.ts",
"skills:react-ui": "bun scripts/react-ui-api.ts"
Expand Down
11 changes: 11 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Tests

Unit tests sit next to the code they test. This folder holds the tests that
cross modules:

- `integration/` checks contracts and architecture across packages; `bun run test` runs it.
- `e2e/` runs the hub against a real Postgres; `bun run test:e2e` runs it.

Later folders, added with their first file: `ux/` for interface tests,
`workflows/` for agent-loop tests, `fixtures/` for recorded model sessions,
`harness/` and `support/` for what those tests share.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test("workspace imports use declared package exports and local dependencies", as
"apps",
"packages",
"workflows",
"tests",
"test",
"scripts",
]) {
for (const path of await sources(resolve(root, directory))) {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"skipLibCheck": true,
"allowImportingTsExtensions": true
},
"include": ["apps/hub", "scripts", "packages", "workflows", "tests"],
"include": ["apps/hub", "scripts", "packages", "workflows", "test"],
"exclude": [
"node_modules",
"vendor",
Expand Down