Skip to main content

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​

PackageTurbo tagWorkspace dependenciesResponsibility
@agentforge/agent-typestypesnoneZod 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-corecoreagent-typesThe guarded runtime: decorators for redaction, kill switch, budget (with alerts), limits; DEFAULT_CONFIG; ./testing conformance helpers. Never reads env
@agentforge/dbdbagent-typesDrizzle schema, SQL migrations (drizzle/), migrate(pool), and raw-SQL stores: PgLedgerStore, PgSettingsStore, PgAlertStore, PgAuditStore, PgSessionStore, PgFactoryStore, PgQualityStore
@agentforge/agent-runtime-claudeadapteragent-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-workflowsworkflowsagent-typesTemporal workflows (src/workflows/*, bundled by the worker only), the payload codec and data converter, failure converter, queue names, signal names, activity types
@agentforge/agent-clientclientagent-typesTyped fetch client for apps/api built from the routes table. No retries and no polling helper; exposes AgentApiError.retryAfterSec
@agentforge/agent-governancegovernanceagent-typesPolicy schema, loader (loadPolicies, MAX_POLICY_FILE_BYTES) and compiler (compile, merge) used by the gateway
@agentforge/agent-mcpmcpagent-governance, agent-typesMCP registry loader (loadRegistry) and tool catalog compiler (compileCatalog, schemaSha256). No MCP SDK dependency
@agentforge/agent-contextcontextagent-typesInterface 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-corenone (no turbo.json)noneCodeCrucible pure analysis library: function discovery, complexity, coverage, CRAP, chunking, report parsing, gate. Imports only typescript, zod, node:crypto, node:zlib (ESLint rule)
@agentforge/confignonenoneShared tsconfig.base.json and ESLint config (eslint.js), including the provider-SDK no-restricted-imports rule and the runtimeAdapter opt-out

Apps​

AppTurbo tag(s)Workspace dependenciesResponsibility
@agentforge/apiappagent-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/workerappagent-core, agent-runtime-claude, agent-types, agent-workflows, db, quality-coreFour 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/gatewayappagent-core, agent-governance, agent-mcp, agent-types, dbThe only provider-key holder: model and MCP proxy, control API, metering, audit
@agentforge/sandbox-runnerapp, sandboxagent-runtime-claude, agent-typesContainer entry for the per-job sandbox. Nothing depends on it
@agentforge/smokeappagent-core, agent-runtime-claude, agent-types, dbP1 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:

TagDenied dependency tags
typescore, adapter, db, app, governance, mcp, context
coreadapter, db, app, governance, mcp, context
dbcore, adapter, app, governance, mcp, context
adapterdb, app, governance, mcp, context
workflowscore, adapter, db, app, governance, mcp, context
clientcore, adapter, db, app, workflows, governance, mcp, context
governancecore, adapter, db, app, workflows, client, mcp
mcpcore, adapter, db, app, workflows, client
contextcore, 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​

TaskDepends onNotes
build^buildoutputs dist/**
typecheck^buildworker overrides to ^build, build
test^buildapi overrides to ^build, build, @agentforge/worker#build; worker to ^build, build
lint^build, build
test:real^buildcache: 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​

TestAssertion
Declared SDKAcross 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 resolverequire.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
ControlThe SDK resolves from agent-runtime-claude and sandbox-runner
Package listThe 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 isolationpnpm-workspace.yaml has nodeLinker: isolated, publicHoistPattern: [], no shamefullyHoist: true
ESLint probesLinting 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​

TestAssertion
New tag deny listsgovernance, mcp, context carry exactly the deny lists in the table above
Old tags deny new onestypes, core, db, adapter, workflows, client each deny governance, mcp and context
agent-governancetagged governance; dependencies exactly agent-types, yaml, zod
agent-mcptagged mcp; dependencies exactly agent-governance, agent-types, yaml, zod (no MCP SDK)
agent-contexttagged context; dependencies exactly agent-types
No reverse edgesno package tagged types, core, db, adapter, workflows or client depends (including dev) on governance, mcp or context
governance and mcpgovernance does not depend on agent-mcp; neither depends on agent-context, nor it on them
sandbox-runnertags exactly app, sandbox; dependencies exactly agent-runtime-claude, agent-types, the SDK, zod; no @agentforge/db, pg or @temporalio/*; no dependents
gatewaytag 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.json
  • apps/smoke/test/boundaries.test.ts
  • packages/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.md
  • CODING_STANDARDS.md section 7