Skip to content

Import CoBuilder orchestration-services pattern (ADR-0009)#50

Merged
BadGuyFranco merged 3 commits into
mainfrom
orchestration-services-import
May 28, 2026
Merged

Import CoBuilder orchestration-services pattern (ADR-0009)#50
BadGuyFranco merged 3 commits into
mainfrom
orchestration-services-import

Conversation

@BadGuyFranco
Copy link
Copy Markdown
Owner

What

Imports CoBuilder's non-persona orchestration services pattern: the lead orchestrator (Oscar) delegates repeatable, mechanical administrative work — wrap cleanup, handoff/priority compaction, run summaries, teardown/commit-boundary/startup-context audits, result-contract repair — to faster/cheaper models via bounded, write-audited service packets, instead of spending expensive lead-model context.

This realizes the "sub-agents/services that independently select CLI + model" clause already reserved in ADR-0008 point 6 — which is why Oz needs no changes: services run externally and surface as ordinary run artifacts.

Decision record: ADR-0009.

How it works

  • Declarations, not code — each service is a JSON file at packages/core/services/<id>.json (mode read-only | bounded-write, purpose, execution model guidance, allowedWriteScopes, requiredChecks). Adding a service is a new declaration, never a lib/services.mjs edit.
  • Packet binds one executionbuild-service-packet narrows the declaration's scopes to exact allowedWrites, freezes decisionAuthority: oscar-only + executionAuthority: orchestration-service + forbiddenDecisions.
  • Headless execute + write-auditexecute-service-packet runs the packet (default cursor-agent, argv array) under <runDir>/services/<packetId>/; a before/after git status audit blocks acceptance even on a claimed PASS if any write lands outside allowedWrites. Failures return diagnosis + proposedFix to Oscar.

Changes

  • 2 hand-written contracts (declaration + packet) via the existing lib/contracts.mjs validator — no AJV introduced (consistent with the other 12 core contracts; ADR-0004's Zod rule governs packages/schemas only).
  • 11 service declarations, write scopes path-scrubbed to CoCoder layout.
  • lib/services.mjs engine; 5 CLI commands; separate cursor-agent-service headless adapter (the interactive cursor-agent adapter is left untouched).
  • Debugger guidance (when to recommend a service) + session-wrap fragment bullet.
  • ADR-0009, v0.5-orchestration-services priority, PORT-NOTES scrub log, SESSION_LOG entry.

Decisions taken (founder-approved)

  • Scope: all 11 services · adapter: separate cursor-agent-service (interactive one untouched) · artifact layout: <runDir>/services/<packetId>/ (services aren't lanes).

Verification

  • core 346/346 (node scripts/test.mjs) · oz-daemon 8/8 · oz-dashboard 10/10
  • validate-orchestration-services green against all 11 shipped declarations end-to-end.

Follow-on (tracked in v0.5-orchestration-services)

Wire services into Oscar's live wrap/teardown flow, prove real headless cursor-agent execution end-to-end, confirm Oz run-detail surfacing, and founder sequencing of the slug.

🤖 Generated with Claude Code

Adds non-persona orchestration services so Oscar delegates repeatable
administrative work (wrap, handoff/priority compaction, teardown, audits) to
faster/cheaper models via bounded, write-audited service packets, instead of
spending lead-model context. Realizes the sub-agents/services clause already
in ADR-0008, so Oz is unchanged.

- lib/services.mjs engine: build/validate/execute packet + deterministic git
  write-audit (blocks out-of-scope writes even on a claimed PASS)
- 2 hand-written contracts (declaration + packet) via existing contracts.mjs
  (no AJV); 11 service declarations, paths scrubbed to CoCoder layout
- 5 CLI commands; separate cursor-agent-service headless adapter (interactive
  cursor-agent untouched); debugger guidance + session-wrap fragment bullet
- ADR-0009, v0.5-orchestration-services priority, PORT-NOTES scrub log

Tests: core 346/346, oz-daemon 8/8, oz-dashboard 10/10.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BadGuyFranco and others added 2 commits May 27, 2026 20:45
… 1-3)

Make v0.5-orchestration-services launch-ready on this branch so a fresh
oscar-lead run picks up the full plan:
- README "Next Session Start Here": Phase 1 (land PR #50 — Bob fixes
  wrap-execution requiredChecks, Oscar rebases onto main + squash-merges),
  Phase 2 (reconcile PR #51), Phase 3 (adoption + v0.1 carryover/ADR-0011 +
  archive v0.1-foundation + ghost/dangling guard). Route, broadened-Bob
  boundary, stop conditions, required tests, founder decisions recorded.
- Sequencing DECIDED: v0.5 runs before v0.4 (founder 2026-05-27).
- PRIORITIES.md: promote v0.5 to Active with Phase-1 next-action + parser
  block updated (launch from orchestration-services-import).

Context: PR #50 was orphaned (engine + ADR-0009 + this priority never merged
to main), leaving a ghost v0.5 row in the route + a dangling ADR-0009 ref.
Phase 1 fixes that.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…v0.5 launchable

Founder-authorized one-time config convergence (the orphaned-PR orchestration
failure). Merges current main into the PR #50 branch and adds the launch config
v0.5 was missing:
- wrap-execution.json: drop orchestrator-commit + finalize-run-status from
  requiredChecks (Oscar route-control steps, per CoBuilder prior-fix); purpose
  clarified (service must not commit/finalize/supersede).
- routes/oscar-lead.json: writePolicy one-writer -> bounded-writers; add
  v0.4 + v0.5 to supportedPriorityOwners (main code already honors bounded-writers
  — identical to oz-control-plane-design).
- priority-boundaries/v0.5-orchestration-services-oscar-lead.boundary.json brought.
- PRIORITIES.md: v0.5 promoted to Active (+ parser block); v0.1 row refreshed
  (v0.1.0 tagged; archival folded into v0.5 Phase 3).
- v0.5 README: Phase 1 marked done; next = Phase 2/3.
- SESSION_LOG: convergence entry.

After squash-merge to main, v0.5-orchestration-services is launchable from Oz.
Unrelated PrioritiesPage.tsx left unstaged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@BadGuyFranco BadGuyFranco merged commit 6c1a8fe into main May 28, 2026
2 checks passed
@BadGuyFranco BadGuyFranco deleted the orchestration-services-import branch May 28, 2026 03:08
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