Skip to content

feat(pipeline): load packs from config + create-from-pack over the wire - #209

Merged
saucam merged 1 commit into
mainfrom
feat/sdlc-pipeline-pack-wiring
Jul 20, 2026
Merged

feat(pipeline): load packs from config + create-from-pack over the wire#209
saucam merged 1 commit into
mainfrom
feat/sdlc-pipeline-pack-wiring

Conversation

@saucam

@saucam saucam commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

What

Makes packs reachable end-to-end from a client. #208 added the pack loader + create({ pack }) in-process, but nothing wired them to the daemon or the control plane — a client couldn't create a pipeline from a pack, and the daemon loaded no packs. This closes that gap.

The motivating consumer is the new private highflame-ai/ai-factory pack registry (packs/aif-sdlc/) — this PR is verified against that real pack.

Changes

  • Configpipeline.packs: [{ dir, trusted? }]. Each dir is loadPack'd + installPack'd at boot. Fail-soft: a malformed/missing pack logs and is skipped, never taking down boot. trusted (default false) gates command-gate execution. The pre-existing (inert) defaultPack is now honored.
  • Wirepipeline.create gains optional pack; phases becomes optional too. Exactly-one-of is enforced in the manager (the schema is a member of a type-discriminated union, so it can't use .refine()). Neither given → defaultPack.
  • Role on the wirePhaseDefWire / PipelinePhaseWire carry role; a phase's capability role is projected onto pipeline snapshots so a client can render its tool envelope (e.g. a read-only reviewer).

Tests

  • E2E (pipeline-pack-e2e.test.ts): pack on disk → loaded via config at boot → pipeline.create { pack } over the wire → advanced through a real worker turn (mock backend) → done. Plus: untrusted pack's command gate fails closed → halt; unknown pack → invalid_request; defaultPack fallback.
  • Wiring install + fail-soft; protocol-schema coverage for pack / role / optional phases.
  • Verified the real aif-sdlc pack loads via this path: spec[implementer] → architect[implementer] → implement[implementer] → review[reviewer] → ship[orchestrator].

tsc (main + protocol + core) + biome clean. Full suite: 1651 pass; the only failures are the live-ZeroID conductor integration tests (no server on this box — unrelated to this change).

Next (not in this PR)

Runtime capability enforcement: compile a phase's role → Cedar → Shield so an out-of-envelope tool call is denied at runtime (the pack carries the capability today; enforcement is the follow-on). Studio sandbox-screen pack selection.

Makes packs reachable end-to-end from a client. Before this, loadPack /
create({pack}) existed only in-process (#208); nothing wired them to the
daemon or the control plane.

- config: pipeline.packs = [{ dir, trusted? }] — each dir is loadPack'd +
  installPack'd at boot (fail-soft: a malformed pack logs and is skipped,
  it never takes down boot). trusted (default false) gates command-gate
  execution. The pre-existing defaultPack is now honored.
- wire: pipeline.create gains optional `pack` (phases now optional too —
  XOR enforced in the manager, since the schema is in a discriminated
  union and can't use .refine()). Neither given → defaultPack.
- PhaseDef/wire carry `role`; the phase's capability role is projected
  onto pipeline snapshots so a client can render its tool envelope.

Tests: full E2E (pack on disk → config load → wire create-from-pack →
advance through a mock backend → done; untrusted command gate fails
closed; unknown pack → invalid_request; defaultPack fallback), wiring
install + fail-soft, and protocol-schema coverage for pack/role/optional
phases. Verified the real ai-factory aif-sdlc pack loads via this path
(5 phases, roles intact). tsc (3 pkgs) + biome clean.
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.02%. Comparing base (d6e5505) to head (a0f4a07).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #209   +/-   ##
=======================================
  Coverage   88.01%   88.02%           
=======================================
  Files         129      129           
  Lines       22028    22045   +17     
=======================================
+ Hits        19388    19405   +17     
  Misses       2640     2640           
Flag Coverage Δ
daemon 88.02% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/protocol/src/schemas.ts 100.00% <100.00%> (ø)
packages/protocol/src/types.ts 100.00% <ø> (ø)
src/config.ts 93.04% <100.00%> (+0.03%) ⬆️
src/daemon/pipeline/wiring.ts 100.00% <100.00%> (ø)
src/daemon/session-manager.ts 76.93% <100.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@saucam
saucam merged commit e0f2f9e into main Jul 20, 2026
4 of 7 checks passed
saucam added a commit that referenced this pull request Jul 20, 2026
Bump package.json 0.3.1 → 0.3.2 and roll the 0.3.2 CHANGELOG section
(the release workflow gates on package.json matching the tag). 0.3.2 carries
the SDLC pipeline primitive (#204#209), the /settings MCP Servers surface
(#203), embedded-handoff ZeroID token consumption (#210), and the cross-cutting
audit fixes (#211).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant