Aller au contenu principal
BlueForge
Commencer gratuitement

Agent pack

architecture-sdk and how sidecars connect to it

The architecture SDK (arch-sdk) on packr, and how sidecars feed it.

Rendered from docs/agent-pack/architecture-sdk.mdrelease v0.2.0Edit on forge-git

@blueforge-studio/architecture-sdk (bin arch-sdk), on packr. Verified 2026-10-11 from source in the blueforge-org worktree haiku-5-5-options: 0.6.0 there, 0.5.4 on blueforge-org main; which is published is UNVERIFIED. arch-sdk --help printed nothing when run in the research environment, so the command list below is from printHelp in src/cli.ts, not from live output. Run --help yourself before relying on a flag. blueforge itself does not depend on it.

Install: pnpm add @blueforge-studio/architecture-sdk @blueforge-studio/arch-graph.

What it is

Code declares its architecture; the SDK turns that into a graph and checks it against what sidecars claim.

  • registerArch() chains (runtime) and a static parser for the same shape; a loader for the V3 sidecars.
  • Subpaths: /routes (defineRoutes, browser-safe), /test (verifies, underTest), /trace (computeCompletion).
  • Drift-free principle: code and tests carry no status field. Sidecars may only declare planned or deprecated; everything else is computed. Never hand-write a status that the graph can derive.

Commands (exit 0 clean, 1 findings, 2 usage error; --warn forces 0)

Command Purpose
new [--id --name --out-file] scaffold
codegen [--graph p | --source f.ts] [--sidecar yml…] [--target t1,t2] [--out-dir] [--wire-version 0.2|0.3] targets: forge-control-graph, mermaid, sidecar-yaml, appflow, test-scaffold
validate, check [--runtime json], index graph validity, drift vs runtime, index
detect-edges, detect-stories [--workspace] [--check] edges between packages; Storybook stories
sync-blueprint --graph <repo> [--workspace p] [--check] writes CLAUDE.md and .claude/ from blueforge/claude; --check reports drift (note --graph is reused as the repo name)
trace draft, trace index, trace validate [--cross] route/trace graph; index writes .forge/trace.json
routes check [--surface fe|be|cli] [--refs] [--served …] [--auth-prefix]… route table vs served routes

routes check cannot catch a route mislabelled public, and trace draft writes a low-confidence guess as a plain string. sync-user-flow appears only in plan docs, not in the CLI: treat it as unimplemented.

How sidecars reference the SDK

  • codegen --sidecar blueforge.app.yml (repeatable; also .package.yml, .tests.yml) loads and validates the sidecars, resolves extends (tsconfig-style: leaf wins, cycles fail) and layers them over the runtime graph to report drift. extends only inherits between sidecar files; the SDK never generates sidecars.
  • App sidecar flows: points at the flow directories (user, data), flows.critical lists critical flow ids, and flows.gates sets per-gate off|warn|fail. A feature bullet {feature: id} links features to the graph.
  • In code, arch.routeGroup(id, ref) and route-table implements: ["user-flow.x" | "data-flow.a.b"] (typed ids) create the edges implements, partOf, routedBy, servedBy; .feature(id, {refsFlow}) and .flow(id, ref) link features to flows.
  • Tests link back via blueforge.tests.yml verifies[] and verifies() / underTest() calls in test files.
  • Flow files use the suffixes .user-flows.yml and .data-flows.yml, with optional app: / product: scope.

What reaches the hub

The forge-control-graph output is POSTed to POST /api/architecture-graphs/ingest (arch-graph wire format, default 0.2). There is no /api/architecture/ingest (older blueprint text says there is). The hub MCP tools forge_devdb_* only see what was pushed. Cross-link rules are in docs/plans/2026-09-22-flows-plan.md; whether flows lint --cross exists is UNVERIFIED (trace validate --cross is real).

Adoption reality

V3 sidecars are adopted by several fleet repos (forge-control itself ships 15 blueforge.app.yml + 10 blueforge.package.yml as of 2026-11; no .tests.yml exists yet), but blueforge has no SDK dependency, so most repos have nothing to run codegen against. Do not tell an agent a repo "has" a graph; check for .forge/ or sidecar files first.

Restez informé

Notes de version et accès anticipé

Un e-mail à chaque nouveauté : fonctionnalités de la plateforme, nouvelles applications et invitations de lancement. Inscrivez-vous sur la liste d'attente pour accéder en avant-première à l'inscription en libre-service et aux sites de promotion.

Pas de spam. Désabonnement en un clic.