Skip to content

Commit 065cf33

Browse files
author
Mikhail Orlov
committed
Clarify orchestrator role boundary
1 parent 321ef29 commit 065cf33

4 files changed

Lines changed: 213 additions & 7 deletions

File tree

AGENTS.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,54 @@ If docs are stale or missing for the requested work, refresh `docs_project/` fir
3131

3232
## Agent Roles
3333

34+
### Architect
35+
36+
- Creates or updates one `specs/<feature-id>/` folder for each repository-changing user request before implementation begins.
37+
- Owns `spec.md`, `plan.md`, and `tasks.md` creation and updates for the assigned feature memory.
38+
- Ensures feature memory names goal, scope, acceptance criteria, negative scenario, and verification evidence.
39+
- Splits independent goals into separate feature folders instead of bundling unrelated changes into one process record.
40+
- Hands complete feature memory to the Orchestrator for coordination and enforcement.
41+
3442
### Orchestrator
3543

3644
- Reads repository memory before starting.
37-
- Creates or updates feature memory before product-code changes.
38-
- Ensures feature memory names goal, scope, acceptance criteria, negative scenario, and verification evidence.
39-
- Slices work into one branch and one PR per task.
40-
- Keeps docs, specs, and PR state aligned.
45+
- Coordinates assigned agents and enforces the repository workflow.
46+
- Confirms each repository-changing user request has its own Architect-owned `specs/<feature-id>/` folder before implementation starts.
47+
- Slices work into one branch and one PR per task, then delegates repository file changes to assigned agents.
48+
- Keeps docs, specs, and PR state aligned through coordination and verification.
49+
- Must not directly edit repository files, including code, docs, specs, workflow files, or scripts.
4150
- Does not declare completion until the PR is merge-ready.
4251

4352
### Implementation Agent
4453

54+
- Starts from assigned feature memory and does not begin implementation if `spec.md`, `plan.md`, or `tasks.md` is missing.
4555
- Works only from an assigned isolated worktree.
4656
- Stays within one branch and one PR per task slice.
47-
- Updates `specs/<feature-id>/tasks.md` in the same PR.
57+
- Keeps `specs/<feature-id>/tasks.md` current in the same PR.
4858
- Records dead ends, decisions, and known issues in the active feature memory.
4959
- Updates durable docs when behavior, architecture, workflows, or deploy rules change.
5060
- Never merges directly to the default branch.
5161

5262
### Review Agent
5363

5464
- Reviews pull request diffs for bugs, regressions, missing tests, and contract violations.
65+
- Checks that repository-changing work has complete feature memory and follows Architect, Orchestrator, Implementation Agent, and Review Agent role boundaries.
5566
- Does not implement unrelated features during review.
5667
- Emits review output in the configured backend format.
5768

5869
## Agent Boundaries
5970

6071
- One worker equals one worktree.
6172
- One implementation loop equals one branch and one PR.
62-
- Product-code PRs require complete feature memory: `spec.md`, `plan.md`, and `tasks.md`.
73+
- Every repository-changing user request must be represented by its own `specs/<feature-id>/` folder before implementation.
74+
- Repository-changing PRs require complete feature memory: `spec.md`, `plan.md`, and `tasks.md`.
6375
- Acceptance criteria must be verified with evidence, not only an AI-written summary.
6476
- `docs_project/`, `.specify/`, `specs/`, and `docs/specify/` are durable memory, not disposable session notes.
6577
- Do not edit secrets or production resources directly.
6678

6779
## Delivery Workflow
6880

69-
- Product changes land through pull requests; do not push directly to `main`.
81+
- Repository-changing work lands through pull requests; do not push directly to `main`.
7082
- Required checks for this repository are defined in `.unicorn-hub/config.json` (`requiredChecks`) and applied to branch protection via `scripts/apply-branch-protection.mjs`.
7183
- Run local preflight before pushing.
7284
- Follow the Docker-only contract for runtime-affecting work (`make build`, `make up`, `make down`) once runtime scaffolding is present.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Plan: Orchestrator Role Boundary
2+
3+
## Summary
4+
5+
Update Cabadrive durable agent instructions so the repository workflow reflects the corrected division of responsibility: Architect creates feature memory for each request, Orchestrator coordinates and enforces the flow, Implementation Agents implement from assigned memory, and Review Agents verify compliance.
6+
7+
This feature is intentionally documentation/process scoped. It does not alter product code, runtime behavior, CI workflows, or repository automation scripts.
8+
9+
## Technical Context
10+
11+
- runtime: none; process documentation only.
12+
- dependencies: none.
13+
- product paths: none.
14+
- expected documentation paths: `AGENTS.md` and any other durable agent-rule files that repeat the old Orchestrator ownership model.
15+
- feature memory path: `specs/002-orchestrator-role-boundary/`.
16+
17+
## Scope Boundaries
18+
19+
- in scope: role definitions, request intake flow, feature-memory ownership, process acceptance criteria, review expectations.
20+
- out of scope: product UI, content pipeline, Docker runtime scaffold, CI/workflow script changes, branch-protection logic, automated enforcement.
21+
22+
## Constitution Check
23+
24+
- Spec-first: yes; this feature memory is created before repository-rule edits.
25+
- Testable boundaries: yes; verification is a constrained diff review plus text checks for old/new role language.
26+
- Test-first bias: not applicable to executable tests because this is documentation-only; verification will use reviewable textual evidence.
27+
- Supervised verification: yes; acceptance criteria map to explicit documentation checks.
28+
- PR-only: yes; implementation should land through a branch and PR.
29+
- One worktree per task: yes; implementation should happen in the assigned worktree only.
30+
- Deployability: neutral; no runtime behavior changes.
31+
- Simplicity: yes; no new tooling or abstractions.
32+
- Process memory: yes; decisions and known issues are recorded in `tasks.md`.
33+
34+
## Implementation Approach
35+
36+
1. Review current durable agent instructions for statements assigning feature-memory creation to the Orchestrator.
37+
2. Update role descriptions to introduce or clarify the Architect role.
38+
3. Update request intake guidance so every repository-changing request is routed to a separate `specs/<feature-id>/` folder before implementation.
39+
4. Update Implementation Agent and Review Agent guidance only where needed to preserve handoff and compliance expectations.
40+
5. Confirm the diff does not touch product code, workflow scripts, runtime files, or CI automation.
41+
42+
## Verification
43+
44+
| Acceptance criterion | Planned evidence |
45+
| --- | --- |
46+
| AC-001 | Text review shows the Orchestrator role says coordination/enforcement only and no direct repository edits. |
47+
| AC-002 | Text review shows new request guidance requires a separate `specs/<feature-id>/` folder before implementation. |
48+
| AC-003 | Text review shows the Architect role owns creation or update of `spec.md`, `plan.md`, and `tasks.md`. |
49+
| AC-004 | Text review shows Implementation Agent guidance starts from assigned feature memory. |
50+
| AC-005 | Text review shows Review Agent guidance can verify role-boundary and feature-memory compliance. |
51+
| AC-006 | `git diff --name-only` for the implementation PR contains only process documentation and `specs/002-orchestrator-role-boundary/` files. |
52+
53+
Negative scenario evidence:
54+
55+
- Search output confirms no remaining durable instruction says the Orchestrator creates or updates feature memory.
56+
- Search output confirms missing feature memory is treated as a blocker before implementation.
57+
58+
## Risks
59+
60+
- Risk: multiple durable docs may repeat the old role model.
61+
- Mitigation: search for `Orchestrator`, `feature memory`, `feature-memory`, `spec.md`, `plan.md`, and `tasks.md` before finalizing the documentation update.
62+
63+
- Risk: "every request" could be interpreted too broadly for read-only questions.
64+
- Mitigation: document the assumption that the rule applies to repository-changing requests; read-only discussion can remain outside implementation flow unless it becomes a change request.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Spec: Orchestrator Role Boundary
2+
3+
## Goal
4+
5+
Clarify Cabadrive repository agent instructions so every user request starts as a separate feature under `specs/`, the Architect owns feature-memory creation, and the Orchestrator coordinates subagents and enforces workflow without directly editing repository files.
6+
7+
## Scope
8+
9+
In scope:
10+
11+
- Update durable repository agent instructions and rules that define agent roles and request intake flow.
12+
- Make the Orchestrator boundary explicit: coordination, assignment, sequencing, and enforcement only.
13+
- Make the Architect responsibility explicit: create or update feature memory before any implementation work.
14+
- Require each user request to map to its own `specs/<feature-id>/` folder with `spec.md`, `plan.md`, and `tasks.md` before implementation.
15+
- Preserve implementation and review responsibilities for their respective agents.
16+
17+
Out of scope:
18+
19+
- Product code changes.
20+
- Workflow script changes.
21+
- CI, branch-protection, or automation behavior changes.
22+
- Runtime scaffold, Docker contract, or app feature implementation.
23+
24+
## User Stories
25+
26+
### User Story 1
27+
28+
As a project owner, I want every request captured as a separate feature memory folder before work starts, so that no implementation begins from ad hoc session context.
29+
30+
### User Story 2
31+
32+
As an Orchestrator, I want my role boundary to be explicit, so that I coordinate assigned agents and enforce repository process without directly editing docs, code, or workflow files.
33+
34+
### User Story 3
35+
36+
As an Architect, I want feature-memory ownership documented, so that I can create the spec, plan, and task checklist required before implementation agents begin work.
37+
38+
## Acceptance Criteria
39+
40+
1. Given repository agent instructions, when an agent reads the Orchestrator role, then the Orchestrator is described as a coordinator/enforcer that does not directly edit repository files.
41+
2. Given a new user request, when repository workflow guidance is followed, then the request is represented by a separate `specs/<feature-id>/` folder before implementation starts.
42+
3. Given feature-memory guidance, when an Architect role is used, then the Architect is explicitly responsible for creating or updating `spec.md`, `plan.md`, and `tasks.md`.
43+
4. Given implementation guidance, when an Implementation Agent starts work, then it is instructed to work from assigned feature memory rather than creating the request-level memory itself.
44+
5. Given review guidance, when a Review Agent checks a PR, then it can verify that role boundaries and feature-memory requirements were followed.
45+
6. Given this process-rule feature, when the change is implemented, then no product code, workflow scripts, CI automation, or runtime files are modified.
46+
47+
## Negative Scenarios
48+
49+
1. Given an Orchestrator receives a user request, when no feature memory exists, then the Orchestrator must route the request to Architect work instead of directly editing files.
50+
2. Given a request touches multiple independent goals, when feature memory is created, then the goals must be split into separate feature folders rather than bundled into one vague process record.
51+
3. Given an Implementation Agent is assigned work, when `spec.md`, `plan.md`, or `tasks.md` is missing, then implementation must not begin.
52+
53+
## Requirements
54+
55+
- FR-001: Agent instructions must state that every user request becomes a separate feature under `specs/` before implementation.
56+
- FR-002: Agent instructions must define an Architect role responsible for feature-memory creation and updates.
57+
- FR-003: Agent instructions must define the Orchestrator as responsible for coordinating agents, enforcing flow, and keeping PR/process state aligned.
58+
- FR-004: Agent instructions must state that the Orchestrator must not directly edit code, docs, specs, workflow files, or scripts.
59+
- FR-005: Implementation Agent instructions must refer to assigned feature memory as input and keep `tasks.md` current during implementation.
60+
- FR-006: Review Agent instructions must include checking role-boundary compliance for process-rule changes.
61+
- FR-007: The feature implementation must avoid product-code and workflow-script changes.
62+
63+
## Success Criteria
64+
65+
- SC-001: The updated durable instructions remove or replace any statement that says the Orchestrator creates or updates feature memory.
66+
- SC-002: The updated durable instructions identify Architect-owned feature memory as the required first step for every request.
67+
- SC-003: The feature PR diff is limited to agent/process documentation and this feature memory.
68+
69+
## Assumptions
70+
71+
- "Every request" means every repository-changing request, including process-rule changes, documentation changes, product changes, and workflow changes.
72+
- The Orchestrator may request or coordinate edits through assigned agents, but does not perform direct repository edits itself.
73+
- This change is governance/process documentation only; executable enforcement can be considered in a later feature if needed.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Tasks: Orchestrator Role Boundary
2+
3+
## Setup
4+
5+
- [x] T001 Create feature memory folder for this process-rule change.
6+
- [x] T002 Record goal, scope, acceptance criteria, negative scenarios, and verification plan.
7+
- [x] T003 Confirm implementation branch/worktree before editing durable agent instructions.
8+
9+
## Implementation
10+
11+
- [x] T004 Search durable docs for old Orchestrator ownership language.
12+
- [x] T005 Update agent role instructions so the Architect owns feature-memory creation.
13+
- [x] T006 Update Orchestrator instructions so the role is coordination and enforcement only, with no direct repository edits.
14+
- [x] T007 Update request intake guidance so each repository-changing request maps to a separate `specs/<feature-id>/` folder before implementation.
15+
- [x] T008 Update Implementation Agent handoff language to start from assigned feature memory.
16+
- [x] T009 Update Review Agent guidance to check feature-memory and role-boundary compliance.
17+
18+
## Verification
19+
20+
- [x] T010 Verify no product code, workflow scripts, runtime files, CI files, or automation scripts changed.
21+
- [x] T011 Verify no durable instruction still says the Orchestrator creates or updates feature memory.
22+
- [x] T012 Verify acceptance criteria are covered with concrete documentation evidence.
23+
- [x] T013 Update process memory with final decisions, dead ends, known issues, and verification evidence.
24+
25+
## Process Memory
26+
27+
### Dead Ends
28+
29+
- None.
30+
31+
### Decisions
32+
33+
- Treat this as a process documentation feature, not an executable workflow-enforcement feature.
34+
- Apply "every request" to repository-changing requests, including process-rule and documentation changes.
35+
- Keep implementation out of product code and workflow scripts.
36+
- Use `AGENTS.md` as the durable role-boundary source for this change because the targeted search found the stale Orchestrator ownership language there.
37+
- Leave unrelated untracked build artifact directories untouched: `dist/`, `node_modules/`, `public/`, and `test-results/`.
38+
- Rebase onto `origin/main` before final PR handoff and resolve the single `AGENTS.md` conflict by preserving both the repository-changing scope and the no-direct-push-to-main rule.
39+
40+
### Known Issues
41+
42+
- Executable enforcement of this boundary is not part of this feature.
43+
- `specs/002-orchestrator-role-boundary/` remains untracked in this worktree, so `git diff --name-only` shows only tracked-file changes; `git status --short` is needed to see this feature-memory update.
44+
45+
### Verification Evidence
46+
47+
- Branch/worktree: `git switch -c codex/002-orchestrator-role-boundary` succeeded before file edits.
48+
- Old Orchestrator ownership search: `rg -n "Creates or updates feature memory|Creates or updates feature-memory|Orchestrator.*Creates|Orchestrator.*updates feature memory|Orchestrator.*create.*feature memory|Orchestrator.*update.*feature memory" AGENTS.md docs_project .specify/memory/constitution.md` returned no matches.
49+
- Release old-language search: `rg -n "Creates or updates feature memory before product-code changes|Creates or updates feature memory before|Orchestrator.*Creates or updates feature memory|Orchestrator.*feature memory before product-code" AGENTS.md docs_project .specify/memory/constitution.md` returned no matches.
50+
- New role-boundary search: `rg -n "### Architect|repository-changing user request|Must not directly edit|must not directly edit|Starts from assigned feature memory|complete feature memory|role boundaries|Coordinates assigned agents" AGENTS.md` found the Architect role, repository-changing request rule, Orchestrator no-direct-edit rule, Implementation Agent handoff rule, and Review Agent compliance rule.
51+
- Scope check: `git diff --name-only` returned only `AGENTS.md` among tracked files.
52+
- Worktree check: `git status --short` showed `M AGENTS.md`, untracked `specs/002-orchestrator-role-boundary/`, and unrelated untracked artifact directories `dist/`, `node_modules/`, `public/`, and `test-results/`.
53+
- Whitespace check: `git diff --check` passed.
54+
- Feature-memory check: `node scripts/check-feature-memory.mjs --worktree` passed with `No configured product paths changed; feature-memory gate passes.`
55+
- Local preflight: `pnpm run preflight` passed, including `check:feature-memory` and `check:repo`.
56+
- Documentation evidence: `AGENTS.md` lines 34-40 define Architect ownership of `spec.md`, `plan.md`, and `tasks.md`; lines 42-50 define Orchestrator coordination/enforcement and no direct repository edits; lines 54-57 define Implementation Agent handoff and task upkeep; lines 62-65 define Review Agent compliance checks; lines 73-74 require one feature folder and complete feature memory for repository-changing requests.
57+
- Rebase evidence: `git rebase origin/main` found one `AGENTS.md` conflict in Delivery Workflow, resolved as `Repository-changing work lands through pull requests; do not push directly to main`.

0 commit comments

Comments
 (0)