Skip to content

The open-source agent harness - the runtime layer that turns an LLM into a working agent.

4.4 KB
Raw Blame

TrueForge review rules

Repo-wide checks. Package-specific rules live in packages/trueforge-core/.cursor/BUGBOT.md and packages/trueforge/.cursor/BUGBOT.md.

Changeset (non-blocking)

If the diff changes code that ships in a published package and does not add a new .changeset/*.md file, add a non-blocking finding. Tell the author to run pnpm changeset and name only the packages that should bump:

  • packages/trueforge-core → @truefoundry/trueforge-core
  • packages/trueforge → @truefoundry/trueforge
  • packages/trueforge-ui → @truefoundry/trueforge-ui
  • packages/trueforge-sdk → @truefoundry/trueforge-sdk (SDK regen already adds this via pnpm changeset:sdk-regen)
  • packages/frontend → @truefoundry/trueforge (UI is bundled into the server tarball)

Skip when:

  • The PR already adds .changeset/*.md
  • Changes are docs, AGENTS.md, CI/workflows, charts, or docker-compose only
  • The PR is a Version Packages / changeset-release/* release PR

If a new or changed .changeset/*.md uses minor or major, flag it. Only patch bumps are allowed in PR changesets; minor/major version bumps are controlled by an external release process.

CI and release wiring

If a workspace package is added, renamed, or moved, flag unless CI package path filters, matrix package ids, and root test:* scripts in .github/workflows/ci.yml and root package.json stay synchronized.

If the change touches release, pack, or publish wiring, flag if it would break dist-free host development, pnpm smoke, or packed CJS/ESM consumers of @truefoundry/trueforge-core.

If docker-compose.yml or docker-compose.dev.yml changes, flag when shared Postgres/Redis settings (image versions, health checks, env_file) drift. Intentional differences (app services, data paths, project name, host ports, in-network POSTGRES_HOST / REDIS_URL) must stay explicit. docker-compose.yml may read packages/trueforge/.env but must override container connectivity so host-dev localhost values are not used inside the smoke-test stack.

Types, schemas, and ownership

If types or schemas change, flag when packages/trueforge-core, packages/frontend, packages/trueforge, or patches is updated without the other affected layers.

Flag TypeScript that uses as T, as unknown as T, non-null !, or as never to silence type errors. Implementations must use sound contracts, guards, or corrected types.

If a catch throws a new error, flag unless the new error sets { cause: caught }.

Flag duplicate type, schema, helper, or contract definitions and forwarding shims that hide ownership. Each must have one canonical owner.

AgentChatServer, AgentBuilderServer, catalog ports, session/turn DTOs, and stream events must be defined only in @truefoundry/trueforge-assistant-ui-runtime (src/server/types.ts / events.ts). Flag hand-written parallel definitions in @truefoundry/trueforge-ui. That package may only re-export them from src/server/types.ts. React wiring (ServerContext, ShellModeContext, TrueForgeServerConfig) may import those types; it must not redefine ports.

Flag runtime types backed by Zod schemas that are duplicated as hand-written interfaces or indirect utility-type chains. They must be named z.infer<typeof Schema> aliases.

Modules, dead code, generated files

Flag require(), require.resolve(), or lint suppressions used to bypass import checks. Modules must use static import and import type.

If a change makes code unused, flag leftover exports, files, documentation, duplicates, or “just in case” shims. Dead code must be removed in the same change.

Flag manual edits to .github/fern/openapi/openapi.json, docs/openapi.json, or packages/trueforge-sdk. Those are autogenerated in CI. Both OpenAPI copies must stay identical.

Tests and APIs

Flag tests inlined under src. Tests must live under a package-top-level test or tests directory that mirrors src.

Flag functions with more than one parameter of the same type passed positionally (e.g. f(a: string, b: string)). They must take a single options object.

Flag z.union when every member carries a shared literal discriminator field. Use z.discriminatedUnion in that case.

Flag HTTP/OpenAPI wire shapes (path params, query params, request/response JSON fields) and database identifiers (table/column names, persisted jsonb document keys) that are not snake_case.