Packages and apps
The workspace has 11 packages under packages/ and 5 apps under apps/. All are scoped @agentforge/*. The list is
pinned: apps/smoke/test/boundaries.test.ts fails when a package directory is added without being added to its SDK
checks ("the package list is the reviewed one").
The documentation site in website/ is not a workspace package; it has its own lockfile.
Packages
| Package | Turbo tag | Workspace dependencies | Responsibility |
|---|---|---|---|
@agentforge/agent-types | types | none | Zod schemas and types shared everywhere: ErrorCode, RuntimeStatus, UsageStatus, AgentRequest, audit enums, factory and quality schemas and limits, the HTTP contract (./http subpath: routes, HTTP_STATUS, toResponse), gateway URL helpers |
@agentforge/agent-core | core | agent-types | The guarded runtime: decorators for redaction, kill switch, budget (with alerts), limits; DEFAULT_CONFIG; ./testing conformance helpers. Never reads env |
@agentforge/db | db | agent-types | Drizzle schema, SQL migrations (drizzle/), migrate(pool), and raw-SQL stores: PgLedgerStore, PgSettingsStore, PgAlertStore, PgAuditStore, PgSessionStore, PgFactoryStore, PgQualityStore |
@agentforge/agent-runtime-claude | adapter | agent-types (dev: agent-core) | The Claude runtime adapter (ClaudeRuntime, tool policy, event mapping). Declares the provider SDK via catalog:. Exports GATEWAY_UNAVAILABLE = 'gateway_unavailable' |
@agentforge/agent-workflows | workflows | agent-types | Temporal workflows (src/workflows/*, bundled by the worker only), the payload codec and data converter, failure converter, queue names, signal names, activity types |
@agentforge/agent-client | client | agent-types | Typed fetch client for apps/api built from the routes table. No retries and no polling helper; exposes AgentApiError.retryAfterSec |
@agentforge/agent-governance | governance | agent-types | Policy schema, loader (loadPolicies, MAX_POLICY_FILE_BYTES) and compiler (compile, merge) used by the gateway |
@agentforge/agent-mcp | mcp | agent-governance, agent-types | MCP registry loader (loadRegistry) and tool catalog compiler (compileCatalog, schemaSha256). No MCP SDK dependency |
@agentforge/agent-context | context | agent-types | Interface and stub for context retrieval: reads CLAUDE.md, AGENTS.md and docs/**/adr/*.md under a root (each file at most 256 KiB, at most 200 files), wraps content as untrusted |
@agentforge/quality-core | none (no turbo.json) | none | CodeCrucible pure analysis library: function discovery, complexity, coverage, CRAP, chunking, report parsing, gate. Imports only typescript, zod, node:crypto, node:zlib (ESLint rule) |
@agentforge/config | none | none | Shared tsconfig.base.json and ESLint config (eslint.js), including the provider-SDK no-restricted-imports rule and the runtimeAdapter opt-out |
Apps
| App | Turbo tag(s) | Workspace dependencies | Responsibility |
|---|---|---|---|
@agentforge/api | app | agent-core, agent-runtime-claude, agent-types, agent-workflows, db (dev: agent-client, config) | REST API (Hono). Entry src/server.ts; migrations via src/migrate.ts (dist/migrate.js, needs only DATABASE_URL) |
@agentforge/worker | app | agent-core, agent-runtime-claude, agent-types, agent-workflows, db, quality-core | Four entries: main.ts (session worker, plus quality core when enabled), exec-main.ts (fleet exec), factory-main.ts (factory), quality-exec-main.ts (quality exec) |
@agentforge/gateway | app | agent-core, agent-governance, agent-mcp, agent-types, db | The only provider-key holder: model and MCP proxy, control API, metering, audit |
@agentforge/sandbox-runner | app, sandbox | agent-runtime-claude, agent-types | Container entry for the per-job sandbox. Nothing depends on it |
@agentforge/smoke | app | agent-core, agent-runtime-claude, agent-types, db | P1 smoke harness (composeRuntime, guardRealRun) and home of the repository-wide boundary tests |
Dependency graph
Arrows point from a package to what it depends on (runtime dependencies; dev-only edges are dashed).
agent-context has no dependents in the workspace yet: it is an interface and a stub (P2.G plan section 9).
Turbo boundary tags
turbo.json declares, per tag, the tags a package with that tag may not depend on:
| Tag | Denied dependency tags |
|---|---|
types | core, adapter, db, app, governance, mcp, context |
core | adapter, db, app, governance, mcp, context |
db | core, adapter, app, governance, mcp, context |
adapter | db, app, governance, mcp, context |
workflows | core, adapter, db, app, governance, mcp, context |
client | core, adapter, db, app, workflows, governance, mcp, context |
governance | core, adapter, db, app, workflows, client, mcp |
mcp | core, adapter, db, app, workflows, client |
context | core, adapter, db, app, workflows, client, mcp, governance |
app and sandbox have no deny list. pnpm turbo boundaries is advisory in CI (the comment in
boundaries.test.ts says so, and CODING_STANDARDS.md section 7 records continue-on-error: true), so the deny lists
and dependency allowlists are re-asserted by blocking tests.
The diagram shows the edges the deny lists still allow and that are used; every edge not drawn between the non-app tags is denied.
Turbo tasks
| Task | Depends on | Notes |
|---|---|---|
build | ^build | outputs dist/** |
typecheck | ^build | worker overrides to ^build, build |
test | ^build | api overrides to ^build, build, @agentforge/worker#build; worker to ^build, build |
lint | ^build, build | |
test:real | ^build | cache: false |
globalEnv: NODE_ENV, TEMPORAL_TEST_ADDRESS, TEMPORAL_TEST_NAMESPACE. globalPassThroughEnv: RUN_REAL,
ANTHROPIC_API_KEY, DATABASE_URL, TEMPORAL_TEST_STARTUP_TIMEOUT_MS. globalDependencies: pnpm-lock.yaml,
pnpm-workspace.yaml.
Blocking boundary tests
apps/smoke/test/boundaries.test.ts has two suites.
P1-3 SDK boundary
| Test | Assertion |
|---|---|
| Declared SDK | Across the root and every package, the only @anthropic-ai/* declarations are @agentforge/agent-runtime-claude:@anthropic-ai/claude-agent-sdk@catalog: and @agentforge/sandbox-runner:...@catalog: |
| SDK does not resolve | require.resolve of the SDK fails (with NODE_PATH removed) from agent-core, agent-types, db, agent-workflows, agent-client, agent-governance, agent-mcp, agent-context, quality-core, api, worker, gateway |
| Control | The SDK resolves from agent-runtime-claude and sandbox-runner |
| Package list | The set of packages/* and apps/* directories equals the reviewed list of 16 |
| SB-ISO1 | @agentforge/sandbox-runner does not resolve from api, worker or gateway |
| pnpm isolation | pnpm-workspace.yaml has nodeLinker: isolated, publicHoistPattern: [], no shamefullyHoist: true |
| ESLint probes | Linting import { query } from '@anthropic-ai/claude-agent-sdk' gives exactly one no-restricted-imports error in agent-core and none in agent-runtime-claude and sandbox-runner (timeout ESLINT_PROBE_TIMEOUT_MS = 30_000) |
P2.G boundary tags and dependency allowlists
| Test | Assertion |
|---|---|
| New tag deny lists | governance, mcp, context carry exactly the deny lists in the table above |
| Old tags deny new ones | types, core, db, adapter, workflows, client each deny governance, mcp and context |
| agent-governance | tagged governance; dependencies exactly agent-types, yaml, zod |
| agent-mcp | tagged mcp; dependencies exactly agent-governance, agent-types, yaml, zod (no MCP SDK) |
| agent-context | tagged context; dependencies exactly agent-types |
| No reverse edges | no package tagged types, core, db, adapter, workflows or client depends (including dev) on governance, mcp or context |
| governance and mcp | governance does not depend on agent-mcp; neither depends on agent-context, nor it on them |
| sandbox-runner | tags exactly app, sandbox; dependencies exactly agent-runtime-claude, agent-types, the SDK, zod; no @agentforge/db, pg or @temporalio/*; no dependents |
| gateway | tag app; dependencies within agent-types, agent-core, db, agent-governance, agent-mcp, hono, @hono/node-server, @modelcontextprotocol/sdk, ajv, pg, pino, zod; none of agent-runtime-claude, agent-workflows, agent-client, agent-context, @anthropic-ai/*, @temporalio/* (dev included) |
Other rules recorded in CODING_STANDARDS.md section 7: an app builds its runtime through createAgentRuntime in
exactly one file (apps/smoke/src/compose.ts, checked by apps/smoke/test/guard.test.ts); in api and worker only
src/runtime.ts may import @agentforge/agent-runtime-claude (per-file ESLint override); workflow files under
packages/agent-workflows/src/workflows/** may import only @temporalio/workflow, type-only
@agentforge/agent-types and siblings.
Sources
turbo.json(tasks,boundaries.tags)apps/*/package.json,packages/*/package.json,apps/*/turbo.json,packages/*/turbo.jsonapps/smoke/test/boundaries.test.tspackages/agent-types/src/index.ts,packages/agent-core/src/index.ts,packages/db/src/index.ts,packages/agent-client/src/index.ts,packages/agent-governance/src/index.ts,packages/agent-mcp/src/index.ts,packages/agent-context/src/index.ts,packages/agent-workflows/src/index.ts,packages/agent-runtime-claude/src/runtime.ts(GATEWAY_UNAVAILABLE)packages/quality-core/README.mdCODING_STANDARDS.mdsection 7