From dea1bae776b7e06a6355c2b82aba308d72aae251 Mon Sep 17 00:00:00 2001 From: transparent-pegasus <258247454+transparent-pegasus@users.noreply.github.com> Date: Wed, 11 Nov 2026 06:30:09 +0900 Subject: [PATCH 1/2] feat: allow profile routing overrides and revise presets --- .herdrpowers/profiles/README.md | 23 ++++---- .herdrpowers/profiles/astra-sol.yaml | 11 ---- ...-opus-panel.yaml => fable-opus-ultra.yaml} | 0 .herdrpowers/profiles/fable-opus.yaml | 11 ---- ...le-sol-panel.yaml => fable-sol-ultra.yaml} | 0 .herdrpowers/profiles/opus-fable.yaml | 17 ++++++ .herdrpowers/profiles/sol-astra.yaml | 17 ++++++ CLAUDE.md | 2 +- README.md | 14 +++-- ...026-11-11-profile-overrides-and-presets.md | 25 ++++++++ commands/execute.md | 2 +- commands/execute_parallel.md | 2 +- commands/full_cycle.md | 2 +- commands/init.md | 18 +++--- commands/plan.md | 2 +- commands/quick.md | 2 +- docs/development_cycle.md | 2 +- docs/instruction_snippet.md | 3 +- docs/roles.md | 15 +++-- docs/skills.md | 2 +- docs/workflows.md | 2 +- skills/orchestration/README.md | 12 ++-- skills/orchestration/SKILL.md | 18 +++--- skills/orchestration/references/profiles.md | 57 +++++++++++++------ skills/orchestration/references/routing.md | 4 +- skills/orchestration/roles.yaml | 7 ++- .../references/assignments.md | 2 +- skills/requesting-code-review/SKILL.md | 2 +- skills/test-driven-development/SKILL.md | 2 +- skills/using-herdr-sibling-panes/SKILL.md | 2 +- .../references/agent-lifecycle.md | 11 +++- .../scripts/agent-lifecycle.sh | 14 ++++- skills/writing-plans/SKILL.md | 4 +- tests/agent-lifecycle/lifecycle.test.mjs | 25 +++++++- .../orchestration-profiles/profiles.test.mjs | 47 ++++++++++++--- 35 files changed, 264 insertions(+), 115 deletions(-) delete mode 100644 .herdrpowers/profiles/astra-sol.yaml rename .herdrpowers/profiles/{fable-opus-panel.yaml => fable-opus-ultra.yaml} (100%) delete mode 100644 .herdrpowers/profiles/fable-opus.yaml rename .herdrpowers/profiles/{fable-sol-panel.yaml => fable-sol-ultra.yaml} (100%) create mode 100644 .herdrpowers/profiles/opus-fable.yaml create mode 100644 .herdrpowers/profiles/sol-astra.yaml create mode 100644 changelogs/2026-11-11-profile-overrides-and-presets.md diff --git a/.herdrpowers/profiles/README.md b/.herdrpowers/profiles/README.md index 4ec7d3a..e14b66b 100644 --- a/.herdrpowers/profiles/README.md +++ b/.herdrpowers/profiles/README.md @@ -1,24 +1,27 @@ # Profiles -Names follow the owner-coder pattern (orchestrator-implementer). `panel` means four external reviewers; `solo` means no separate coder. +Names put the owner first. `ultra` means four external reviewers; `solo` means no separate coder. | File | Composition and purpose | |---|---| -| `fable-sol-panel.yaml` | `Fable 5.2` owner, `GPT-6.1-Sol` coder, four external reviewers. Largest composition. | -| `fable-opus-panel.yaml` | `Fable 5.2` owner, separate `Opus 5.5` coder, four external reviewers. Largest composition. | -| `astra-sol.yaml` | `GPT-6-Astra` owner, `GPT-6.1-Sol` coder; the owner reviews. Conserves Codex tokens. | -| `fable-opus.yaml` | `Fable 5.2` owner, `Opus 5.5` coder; the owner reviews. Conserves Claude tokens. | +| `fable-sol-ultra.yaml` | `Fable 5.2` owner, `GPT-6.1-Sol` coder, four external reviewers. Largest composition. | +| `fable-opus-ultra.yaml` | `Fable 5.2` owner, separate `Opus 5.5` coder, four external reviewers. Largest composition. | +| `sol-astra.yaml` | `GPT-6.1-Sol` owner executes; `GPT-6-Astra` handles planning and reviews. Conserves Codex tokens. | +| `opus-fable.yaml` | `Opus 5.5` owner executes; `Fable 5.2` handles planning and reviews. Conserves Claude tokens. | | `sol-solo.yaml` | `GPT-6.1-Sol` only. | | `opus-solo.yaml` | `Opus 5.5` only. | For the two largest compositions, choose the coder from whichever subscription has the larger token allowance. -The smaller compositions use owner reviews to leave more tokens available for reviewing heavier work. +The two smaller compositions keep execution on the cheaper owner and delegate only planning and reviews to the upper model. +They override `assignments.plan-and-design.mode` to `delegate`; other assignment fields retain config/default values. Use `solo` for tasks that need neither complex decisions nor coding. - Select a profile by setting `profile` in `.herdrpowers/config.yaml` to the filename without its extension. Naming a profile in the task instructions selects it for that run only; leave the config unchanged. - Profiles contain only the `planning-design`, `orchestrator`, `coder`, `reviewers`, and `generalist` composition keys. - Omitted `coder` and `reviewers` keep the resolved role bindings; an omitted `orchestrator` keeps the reception pane as owner. + Profiles allow `planning-design`, `orchestrator`, `coder`, `reviewers`, `generalist`, `fallbacks`, `delegation`, and `assignments`. + Composition slots replace bindings; override maps merge per key, including each assignment's fields. Omitted keys keep config/default values. + Lists replace, including `[]`; empty override maps change nothing. Null, scalars, and lists are invalid override maps. + An omitted `orchestrator` keeps the reception pane as owner. Lifecycle permission remains config-only. - `allow_agent_lifecycle` is a config boolean. Use literal `true` or `false`; `"true"` and `yes` are errors. `false` (default): no agent starts, exits, or restarts. Set up any missing agents manually. `true`: the owner starts missing targets in available shell panes within scope and ends only idle agents it started. @@ -36,9 +39,9 @@ Use `solo` for tasks that need neither complex decisions nor coding. `planning-design`/`coder`/`generalist`: `orchestrator` / `null` / `[]` / `none` binds to the owner. `reviewers: [orchestrator]` / `[]` / `null` / `none` selects owner review; it does not disable reviews. - `delegate` requires a fresh subagent every time, even when targeting the owner. An empty composition does not waive this requirement. - Disabled gates stay disabled. Selecting a composition must not change modes or gates. + Apply resolved modes and gates after profile overrides; a resolved disabled gate stays off. - If the reception pane does not match the owner, always ask whether it should be `unused` or a `relay` before handoff or startup. -- Fallback strings belong in the config or default roles. They do not inherit the original target's `effort`. +- Fallback strings may be overridden per key in a profile. They do not inherit the original target's `effort`. Preserve `Calude`, `muse-1.0-wonder`, and `muse-wonder-1.0` exactly. Do not merge distinct names through fuzzy matching or spelling repairs. See the [composition, selection, and handoff contract](https://github.com/transparent-pegasus/herdrpowers/blob/main/skills/orchestration/references/profiles.md) for details. diff --git a/.herdrpowers/profiles/astra-sol.yaml b/.herdrpowers/profiles/astra-sol.yaml deleted file mode 100644 index 425e37e..0000000 --- a/.herdrpowers/profiles/astra-sol.yaml +++ /dev/null @@ -1,11 +0,0 @@ -planning-design: orchestrator -orchestrator: - codex: - model: GPT-6-Astra - effort: max -coder: - codex: - model: GPT-6.1-Sol - effort: max -reviewers: [orchestrator] -generalist: orchestrator diff --git a/.herdrpowers/profiles/fable-opus-panel.yaml b/.herdrpowers/profiles/fable-opus-ultra.yaml similarity index 100% rename from .herdrpowers/profiles/fable-opus-panel.yaml rename to .herdrpowers/profiles/fable-opus-ultra.yaml diff --git a/.herdrpowers/profiles/fable-opus.yaml b/.herdrpowers/profiles/fable-opus.yaml deleted file mode 100644 index 9d08e1c..0000000 --- a/.herdrpowers/profiles/fable-opus.yaml +++ /dev/null @@ -1,11 +0,0 @@ -planning-design: orchestrator -orchestrator: - claude: - model: Fable 5.2 - effort: max -coder: - claude: - model: Opus 5.5 - effort: max -reviewers: [orchestrator] -generalist: orchestrator diff --git a/.herdrpowers/profiles/fable-sol-panel.yaml b/.herdrpowers/profiles/fable-sol-ultra.yaml similarity index 100% rename from .herdrpowers/profiles/fable-sol-panel.yaml rename to .herdrpowers/profiles/fable-sol-ultra.yaml diff --git a/.herdrpowers/profiles/opus-fable.yaml b/.herdrpowers/profiles/opus-fable.yaml new file mode 100644 index 0000000..cd3357d --- /dev/null +++ b/.herdrpowers/profiles/opus-fable.yaml @@ -0,0 +1,17 @@ +planning-design: + claude: + model: Fable 5.2 + effort: max +orchestrator: + claude: + model: Opus 5.5 + effort: max +coder: orchestrator +reviewers: + - claude: + model: Fable 5.2 + effort: max +assignments: + plan-and-design: + mode: delegate +generalist: orchestrator diff --git a/.herdrpowers/profiles/sol-astra.yaml b/.herdrpowers/profiles/sol-astra.yaml new file mode 100644 index 0000000..e4c844e --- /dev/null +++ b/.herdrpowers/profiles/sol-astra.yaml @@ -0,0 +1,17 @@ +planning-design: + codex: + model: GPT-6-Astra + effort: max +orchestrator: + codex: + model: GPT-6.1-Sol + effort: max +coder: orchestrator +reviewers: + - codex: + model: GPT-6-Astra + effort: max +assignments: + plan-and-design: + mode: delegate +generalist: orchestrator diff --git a/CLAUDE.md b/CLAUDE.md index 2347c6c..3b27700 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,7 +7,7 @@ When editing pack behavior, edit `skills/` or `commands/` directly. `docs/` hold ## Pack Invariants - **Dispatch follows the canonical profiles contract.** Read `skills/orchestration/references/profiles.md` before routing. Separate delegated targets use reset-backed Herdr panes through `using-herdr-sibling-panes`. With a selected profile, self-target `delegate` requires a fresh in-process subagent for work and reviews, including solo coder/empty reviewers; other owner-session modes permit inline work/self-review and optional subagents at the active owner's judgment. Missing mandatory subagent capability is inability, never inline delegation or a passed gate. Without a profile, preserve legacy routing and fresh-subagent orchestrator-mode reviews. Workers never re-delegate. Skill-authorship testing still uses fresh API/reset-pane samples under `writing-skills`, never in-session sampling. -- **Roles and task names, not tool names.** Skills name roles and delegation tasks. Resolve repo `.herdrpowers/config.yaml` over shipped `skills/orchestration/roles.yaml`, then overlay only composition keys present in the selected profile. Preserve custom roles, planning-design/generalist bindings, assignments, modes, and gates. Bare `orchestrator` is a dynamic active-owner alias. `roles.yaml` is the default layer, never a consumer customization point. This checkout is the upstream plugin; do not initialize it as a consumer merely to edit payload behavior. +- **Roles and task names, not tool names.** Skills name roles and delegation tasks. Resolve repo `.herdrpowers/config.yaml` over shipped `skills/orchestration/roles.yaml`, then overlay only keys present in the selected profile. Composition slots replace bindings; fallbacks, delegation, and assignments merge per key, including task fields. Preserve custom roles and omitted bindings/settings; lists replace, including empty lists. Bare `orchestrator` is a dynamic active-owner alias. `roles.yaml` is the default layer, never a consumer customization point. This checkout is the upstream plugin; do not initialize it as a consumer merely to edit payload behavior. - **The YAML is the source of truth for defaults; prose points at it.** No skill, command, or doc restates a shipped `role`/`mode` value — they name what a task covers and say "read the resolved assignment". A `| Default |` column in a payload table is a bug: it goes stale silently and gives agents a second, wrong answer. Adding a role, a delegation task, or a `delegation:` key means updating `roles.yaml` plus the tables in `skills/orchestration/SKILL.md`, `commands/init.md`, and `docs/roles.md` — the tables, not defaults inside them. - **Delegation never crosses the orchestrator's tab unless the repo says so.** `delegation.pane_scope` defaults to `tab`; an out-of-scope pane is not a candidate, not a fallback target, and not counted toward an agent type's availability. A payload file that selects panes without filtering on `tab_id` is a bug. Scope is never widened mid-run — that is a configuration change, and configuration is read-only inside a run. - **Targets and list slots are explicit.** New role/profile targets use nested `{kind: {model: ..., effort: ...}}`; effort requires model. Legacy non-fallback `kind@model` is migration input only. Separate list slots need distinct kinds or distinct pinned models (case-insensitive, neither containing the other); effort alone adds no independence. Model/effort must match live footer evidence before keys and after reset; unknown evidence fails closed. Never switch an existing agent's settings. Fallback keys/substitutes retain exact effort-free strings; a matched empty list is authoritative and primary effort is discarded. Preserve `Calude` and the unequal Muse spellings. diff --git a/README.md b/README.md index fc2742e..329dd55 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Coordinates planning, implementation, testing, and review across agent panes. | task loop | `subagent-driven-development` | `pane-driven-development` | | parallel work | `dispatching-parallel-agents` | panes, bounded by idle panes and worktrees | | entry point | skills trigger themselves | `commands/` workflows, plus the same skills | -| routing | fixed in the skill | `.herdrpowers/config.yaml` over `roles.yaml`, plus an optional composition profile | +| routing | fixed in the skill | `.herdrpowers/config.yaml` over `roles.yaml`, plus an optional profile | | who writes tests | the implementer, always | the `test-authoring` assignment | | review | one reviewer subagent | a role bound to a list of agent types: one review per entry | @@ -86,18 +86,20 @@ Repository settings stay outside the plugin and survive updates: worktree directory (`WORKTREE_DIRECTORY`, default `.worktrees/`). - `.herdrpowers/config.yaml`: agent roles, task assignments, delegation scope, review settings, the selected `profile`, and `allow_agent_lifecycle`. -- `.herdrpowers/profiles/`: composition profiles — who orchestrates, codes, - and reviews, each with a model and reasoning effort. Init installs the six +- `.herdrpowers/profiles/`: presets for role targets, models/effort, and + optional fallback, delegation, and assignment overrides. Init installs the six shipped ones without overwriting yours; their [README](.herdrpowers/profiles/README.md) explains the names. ```yaml -profile: fable-sol-panel # or name one in the task; null selects none +profile: fable-sol-ultra # or name one in the task; null selects none allow_agent_lifecycle: false # true: the orchestrator may start and end agents in panes ``` -A profile replaces only the roles it names; assignments and review gates stay -as configured. Model and effort must match what each pane shows in its +A profile overrides only present keys. Omitted keys keep config/default +values; maps merge per key and lists replace, including empty lists. +Assignment overrides may change modes and review gates; lifecycle permission +remains config-only. Model and effort must match what each pane shows in its footer. With `allow_agent_lifecycle: true` the orchestrator starts the selected composition's missing agents in idle shell panes and ends the ones it started; with `false`, the default, it never starts or ends an agent. See diff --git a/changelogs/2026-11-11-profile-overrides-and-presets.md b/changelogs/2026-11-11-profile-overrides-and-presets.md new file mode 100644 index 0000000..aaea28d --- /dev/null +++ b/changelogs/2026-11-11-profile-overrides-and-presets.md @@ -0,0 +1,25 @@ +--- +change_type: pack-native +date: 2026-11-11 +--- + +# Profile overrides and revised presets + +Profiles can override `fallbacks`, `delegation`, and `assignments` per key, +including individual assignment fields. Omitted keys keep config/default +values; lists replace, including empty lists. Lifecycle permission remains +config-only. The lifecycle helper accepts the frozen resolved pane scope +through `HERDRPOWERS_PANE_SCOPE`, preserving profile scope overrides while +keeping its permission and scope guards. + +Rename `fable-sol-panel.yaml` and `fable-opus-panel.yaml` to +`fable-sol-ultra.yaml` and `fable-opus-ultra.yaml` without changing their +targets. Replace `astra-sol.yaml` and `fable-opus.yaml` with `sol-astra.yaml` +and `opus-fable.yaml`: Sol/Opus owns execution, Astra/Fable handles planning +and one review, all at `max` effort. Both set `coder` and `generalist` to +`orchestrator` and override only `assignments.plan-and-design.mode` to +`delegate`. Every preset keeps `planning-design` first and `generalist` last. + +Synchronize workflow/skill instructions, configuration docs, preset names, +and npm package expectations. Add regression coverage for resolved lifecycle +scope, including narrowing, invalid values, and unchanged permission denial. diff --git a/commands/execute.md b/commands/execute.md index 3da571b..13a4ec6 100644 --- a/commands/execute.md +++ b/commands/execute.md @@ -20,7 +20,7 @@ Do not edit workflow files unless the user's current request explicitly asks to ## Orchestration -Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing work. Resolve repo config over shipped roles, then only composition keys present in the selected profile. Freeze the active owner, targets, assignments, gates, scope, strategy, and lifecycle policy. A profile never rewrites modes or gate enablement; a disabled gate is skipped and named in the report. +Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing work. Resolve repo config over shipped roles, then only keys present in the selected profile. Freeze the active owner, targets, assignments, gates, scope, strategy, and lifecycle policy. Profile assignment overrides resolve before routing; a resolved disabled gate is skipped and named in the report. Routing comes from `assignments:`, not from this file, and the resolved YAML is the source of truth for every default — read each task's `role` and `mode` there rather than recalling one. This workflow touches `complex-coding` / `simple-coding`, `test-authoring`, `fix-round-test-authoring`, `review-fixes`, `chores`, `verification`, `documentation-impact-review`, `task-review`, `fix-round-re-review`, and `final-branch-review`. A review task whose effective role binds to a list runs once per entry. - Plan revisions follow `plan-and-design`; final synthesis stays with the active owner. diff --git a/commands/execute_parallel.md b/commands/execute_parallel.md index 2eead07..b82bd9e 100644 --- a/commands/execute_parallel.md +++ b/commands/execute_parallel.md @@ -20,7 +20,7 @@ Do not edit workflow files unless the user's current request explicitly asks to ## Orchestration -Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing work. Resolve repo config over shipped roles, then only composition keys present in the selected profile. Freeze the active owner, targets, assignments, gates, scope, strategy, and lifecycle policy. A profile never rewrites modes or gate enablement; a disabled gate is skipped and named in the report. +Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing work. Resolve repo config over shipped roles, then only keys present in the selected profile. Freeze the active owner, targets, assignments, gates, scope, strategy, and lifecycle policy. Profile assignment overrides resolve before routing; a resolved disabled gate is skipped and named in the report. Routing comes from `assignments:`, not from this file, and the resolved YAML is the source of truth for every default — read each task's `role` and `mode` there rather than recalling one. This workflow touches implementation tracks (`complex-coding` / `simple-coding`), `test-authoring`, `fix-round-test-authoring`, `review-fixes`, `chores`, `verification`, `documentation-impact-review`, `task-review`, `fix-round-re-review`, and `final-branch-review`. A review task whose effective role binds to a list runs once per entry. - Track extraction, integration, and final synthesis stay with the orchestrator. diff --git a/commands/full_cycle.md b/commands/full_cycle.md index 17b91fa..135c18a 100644 --- a/commands/full_cycle.md +++ b/commands/full_cycle.md @@ -20,7 +20,7 @@ Do not edit workflow files unless the user's current request explicitly asks to ## Orchestration -Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing work. Resolve repo config over shipped roles, then only composition keys present in the selected profile. Freeze the active owner, targets, assignments, gates, scope, strategy, and lifecycle policy. A profile never rewrites modes or gate enablement; a disabled gate is skipped and named in the report. +Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing work. Resolve repo config over shipped roles, then only keys present in the selected profile. Freeze the active owner, targets, assignments, gates, scope, strategy, and lifecycle policy. Profile assignment overrides resolve before routing; a resolved disabled gate is skipped and named in the report. Routing comes from `assignments:`, not from this file, and the resolved YAML is the source of truth for every default — read each task's `role` and `mode` there rather than recalling one. This workflow touches `plan-and-design`, `complex-coding` / `simple-coding`, `test-authoring`, `fix-round-test-authoring`, `review-fixes`, `chores`, `verification`, and every review gate from `plan-review` through `final-branch-review`. A review task whose effective role binds to a list runs once per entry. - Separate delegated targets use reset-backed Herdr panes, even when a concrete target matches the owner's model. With a selected profile, self-target `delegate` requires a fresh in-process subagent for work and reviews, including empty reviewers; other owner-session modes permit inline work/self-review and optional subagents at the active owner's judgment. Report self-review honestly. Without a profile, keep legacy routing and fresh-subagent orchestrator-mode reviews. Workers never re-delegate. diff --git a/commands/init.md b/commands/init.md index 1c9a11f..ce4b63a 100644 --- a/commands/init.md +++ b/commands/init.md @@ -88,8 +88,11 @@ top-level `allow_agent_lifecycle` boolean. A new config selects no profile Repeat init preserves the existing selection and permission. Installing templates does not select one; a profile named in a task selects only that run. Explain that a selected profile overrides -only composition keys present in its file; missing keys retain resolved -roles, explicit empties override them, and modes/gate enablement stay intact. +only keys present in its file. Composition slots replace bindings; +`fallbacks`, `delegation`, and `assignments` merge per key, including each +task's fields. Missing keys retain config/default values, lists replace +(including `[]`), and explicit assignment fields may change modes or gates. +Lifecycle permission remains config-only. Validate any selected name/file per the profiles reference; invalid or missing selection is an explicit error, not a reason to silently clear it. @@ -126,7 +129,7 @@ fresh in-process subagent, for reviews too, even with empty reviewers. `orchestrator` uses the active owner: a selected profile permits same-session self-review or an optional subagent, while no-profile reviews still require a fresh subagent. `implementer` continues in the session owning the task. -Profile selection never rewrites these modes or gate enablement. +Resolve profile assignment overrides before presenting modes and gate enablement. **Read the shipped defaults out of `skills/orchestration/roles.yaml` and propose those values** — that file is the source of truth for what the pack ships, and it changes across releases. Do not propose defaults from memory or from this file; the tables below say only what each task covers. @@ -307,9 +310,10 @@ Install profile templates by iterating the actual shipped if needed and copy a template **only when its destination is absent**. Preserve every existing file byte for byte, including a customized profile with a shipped filename; do not overwrite, merge, or refresh it on repeat -init. Preserve custom profile filenames too. Profiles contain composition -only, never assignments, delegation, fallbacks, lifecycle policy, or session -pane IDs/scope. Installing templates is independent of selecting a profile. +init. Preserve custom profile filenames too. Profiles allow composition slots +and per-key `assignments`, `delegation`, and `fallbacks` overrides, never +lifecycle policy, profile selection, or session pane IDs. Installing templates +is independent of selecting a profile. Copy `/.herdrpowers/profiles/README.md` to the local profiles directory only when `.herdrpowers/profiles/README.md` is absent. Preserve an existing local README byte for byte on repeat init; do not overwrite, merge, or refresh it. @@ -322,7 +326,7 @@ Re-read every written file and confirm: - top-level `profile` is null/`none` or a valid simple name whose selected local/shipped file exists and validates; errors remain explicit rather than clearing selection; - top-level `allow_agent_lifecycle` is a YAML boolean, not a string, null, or a field nested in a profile or `delegation`, and `bash /skills/using-herdr-sibling-panes/scripts/agent-lifecycle.sh policy`, run from the repository, prints the approved value — that helper is what enforces it at runtime; - new role targets are one-kind mappings with only optional nonempty model/effort strings, effort requires model, and bare `orchestrator` aliases/custom bindings were preserved; -- profiles contain only the five composition keys with the absent/empty semantics above; original string spelling and reviewer order are intact; +- profiles contain only the five composition keys and optional `fallbacks`, `delegation`, and `assignments` maps; validate their entries per the profiles reference, preserving omitted keys, original strings, and reviewer order; - all missing shipped templates were installed, every pre-existing profile file is byte-identical, and repeat init preserved the chosen profile, assignments, gate enablement, delegation, and permission; - the shipped profiles README was installed only if absent; any pre-existing local README is byte-identical; - `delegation.pane_scope` is one of `tab`, `workspace`, `session`, and `delegation.execution` is one of `parallel`, `serial`; diff --git a/commands/plan.md b/commands/plan.md index b942df2..65d06e8 100644 --- a/commands/plan.md +++ b/commands/plan.md @@ -20,7 +20,7 @@ Do not edit workflow files unless the user's current request explicitly asks to ## Orchestration -Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing. Resolve repo config over shipped roles, then only present profile composition keys; freeze targets, modes, gates, scope, and lifecycle policy. Drafting follows `plan-and-design`; the active owner keeps decisions. Separate delegated targets use reset-backed panes. With a selected profile, self-target `delegate` requires fresh in-process subagents for work and reviews, even with empty reviewers; other owner-session modes permit inline work/self-review and optional subagents at the owner's judgment. Without a profile, preserve legacy independence, including fresh-subagent orchestrator-mode reviews. Workers never re-delegate. An explicit profile-owner handoff transfers ownership under the canonical contract; ordinary worker delegation does not. +Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing. Resolve repo config over shipped roles, then only present profile keys; freeze targets, modes, gates, scope, and lifecycle policy. Drafting follows `plan-and-design`; the active owner keeps decisions. Separate delegated targets use reset-backed panes. With a selected profile, self-target `delegate` requires fresh in-process subagents for work and reviews, even with empty reviewers; other owner-session modes permit inline work/self-review and optional subagents at the owner's judgment. Without a profile, preserve legacy independence, including fresh-subagent orchestrator-mode reviews. Workers never re-delegate. An explicit profile-owner handoff transfers ownership under the canonical contract; ordinary worker delegation does not. ## Execution Steps diff --git a/commands/quick.md b/commands/quick.md index bff712c..4cb98db 100644 --- a/commands/quick.md +++ b/commands/quick.md @@ -22,7 +22,7 @@ Do not edit workflow files unless the user's current request explicitly asks to `/quick` omits the separate plan and its review. Read `orchestration`, its [profiles contract](../skills/orchestration/references/profiles.md), and `using-herdr-sibling-panes` before routing the remaining work and gates. -Resolve repo config over shipped roles, then only profile composition keys present. Freeze the owner, targets, modes, gates, scope, and lifecycle policy. A profile never changes modes or enablement. A gate set to `enabled: false` is skipped and named in the report; empty profile reviewers instead select the owner. +Resolve repo config over shipped roles, then only profile keys present. Freeze the owner, targets, modes, gates, scope, and lifecycle policy. Profile assignment overrides resolve before routing. A gate resolved to `enabled: false` is skipped and named in the report; empty profile reviewers instead select the owner. Routing comes from `assignments:` and effective targets. Without a profile, retain the legacy small-scope inline implementation choice. With a profile, read `complex-coding` / `simple-coding` and preserve their modes; small scope cannot replace required delegation with inline work. `test-authoring`, `chores`, `verification`, and review assignments follow their resolved routes. List roles run once per effective entry. - Separate delegated targets use reset-backed Herdr panes, even when a concrete target matches the owner's model. With a selected profile, self-target `delegate` requires a fresh in-process subagent for work and reviews, including empty reviewers; other owner-session modes permit inline work/self-review and optional subagents at the active owner's judgment. Report self-review honestly. Without a profile, keep legacy routing and fresh-subagent orchestrator-mode reviews. Workers never re-delegate. diff --git a/docs/development_cycle.md b/docs/development_cycle.md index 1cbd37a..6e0d5b0 100644 --- a/docs/development_cycle.md +++ b/docs/development_cycle.md @@ -4,7 +4,7 @@ This guide describes the 7-phase herdrpowers development cycle. The full cycle i Every phase routes work through `orchestration` and its [profiles contract](../skills/orchestration/references/profiles.md). Separate delegated targets use reset-backed Herdr panes. With a selected profile, self-target `delegate` requires fresh in-process subagents for work and reviews, even with empty reviewers; other owner-session modes permit inline work/self-review and optional subagents. Missing mandatory subagent capability is inability, never inline substitution or a passed gate. Without a profile, preserve legacy routing, independence, and unavailable-pane degradation. Workers never re-delegate. -Resolve config over shipped roles, then only present profile composition keys. +Resolve config over shipped roles, then only present profile keys. Freeze modes, gates, scope, and lifecycle policy. A mismatched reception pane always asks unused versus relay before explicit owner handoff or startup. Lifecycle false forbids start/exit/restart even in recovery. True lets the diff --git a/docs/instruction_snippet.md b/docs/instruction_snippet.md index e1dec0b..88c225f 100644 --- a/docs/instruction_snippet.md +++ b/docs/instruction_snippet.md @@ -37,7 +37,8 @@ Rules: on failures, use `systematic-debugging`. 9. `` placeholders resolve from the `Herdrpowers Configuration` section in this file. Resolve repo config over shipped roles, then only present selected - profile composition slots. Preserve custom roles/bindings, modes, and gates. + profile keys. Merge fallback/delegation/assignment maps per key; preserve + custom roles and omitted bindings/settings. Empty profile reviewers select the owner; disabled gates stay off. New targets use nested kind/model/effort settings and verified live footers; fallback strings stay exact and effort-free. Freeze configuration for the run diff --git a/docs/roles.md b/docs/roles.md index bdc3964..3d67aa1 100644 --- a/docs/roles.md +++ b/docs/roles.md @@ -18,17 +18,20 @@ Both share one schema — a **role list**, a fallback map, and a **role assigned Customize the repo file, not `roles.yaml` — plugin installs are read-only, and editing a checked-in copy makes the pack diff-dirty against upstream. The skills speak in role and task names, never in tool names. -## Profile Composition and Ownership +## Profile Overrides and Ownership After merging repo config over shipped roles, overlay only keys present in the selected `.herdrpowers/profiles/.yaml`, repo-local first and shipped only if absent locally. Invalid names, files, or targets are explicit errors. Profiles -contain only `planning-design`, `orchestrator`, `coder`, `reviewers`, and `generalist`; -omitted slots keep resolved roles. Planning-design/coder/generalist `orchestrator`, `null`, `[]`, or `none` binds to the +allow `planning-design`, `orchestrator`, `coder`, `reviewers`, `generalist`, +`fallbacks`, `delegation`, and `assignments`. Omitted slots keep resolved roles. Planning-design/coder/generalist `orchestrator`, `null`, `[]`, or `none` binds to the owner (solo coder); owner reviewers (`[orchestrator]`, `[]`, null, `none`) select the owner without disabling a gate. Lists replace. -Preserve planning-design/generalist bindings the profile omits, -added roles, assignments, modes, and gates. A concrete coder matching the owner +Merge profile `fallbacks`, `delegation`, and `assignments` per key, including +each task's fields; omitted keys retain config/default values. Empty maps +change nothing; fallback lists replace, including `[]`. Composition keys alone +leave modes and gates intact; explicit assignment fields can override them. +Preserve custom roles and omitted bindings. A concrete coder matching the owner is still a separate worker. A mismatched reception pane always asks **unused or relay** before owner handoff @@ -101,7 +104,7 @@ Separate list targets need different kinds or distinct pinned models of one kind - **Separate targets and no-profile `review-fixes` keep rounds 4-5 escalation.** Profile self-targets retain their resolved mode, including mandatory fresh subagents for `delegate`; the five-round cap stays fixed. - **The report names the test writer and transport**, whatever test-authoring assignments resolve to. Disabled gates remain off (except strict mode's enabled-only override). -**Every assignment the repo config changed away from the shipped default, and every disabled review, is named in the final report**, alongside any role that fell back and any review that degraded for lack of panes — so nobody later mistakes an unreviewed branch for a reviewed one. Configuration is input: it is read once before the first delegation and never written from inside a run. +**Every assignment the repo config or profile changed away from the shipped default, and every disabled review, is named in the final report**, alongside any role that fell back and any review that degraded for lack of panes — so nobody later mistakes an unreviewed branch for a reviewed one. Configuration is input: it is read once before the first delegation and never written from inside a run. ## Delegation Scope and Execution Strategy diff --git a/docs/skills.md b/docs/skills.md index ba6a9e1..db170c2 100644 --- a/docs/skills.md +++ b/docs/skills.md @@ -9,7 +9,7 @@ Skills live in a single tree at `skills//SKILL.md`. Claude Code, Codex, an ## Herdr & Orchestration - **`herdr`** — Loads the installed guide with `herdr --skill` after checking `HERDR_ENV=1`. Reads the canonical lifecycle policy before agent start/exit/restart: false forbids these actions; true permits only guarded in-scope process management, preserving unrelated/working agents and topology. -- **`orchestration`** — Resolves repo config over shipped [roles.yaml](../skills/orchestration/roles.yaml), then only present selected-profile composition slots. Its [profiles contract](../skills/orchestration/references/profiles.md) owns nested model/effort targets, owner handoff, lifecycle permission, self-target routes, exact effort-free fallbacks, and reporting. Separate delegation uses reset-backed panes; profile self-target `delegate` requires fresh subagents; other owner-session modes permit reported self-review. No-profile independence and disabled gates remain intact; workers never re-delegate. +- **`orchestration`** — Resolves repo config over shipped [roles.yaml](../skills/orchestration/roles.yaml), then only present selected-profile keys. Its [profiles contract](../skills/orchestration/references/profiles.md) owns nested model/effort targets, owner handoff, lifecycle permission, self-target routes, exact effort-free fallbacks, and reporting. Separate delegation uses reset-backed panes; profile self-target `delegate` requires fresh subagents; other owner-session modes permit reported self-review. No-profile independence and disabled gates remain intact; workers never re-delegate. - **`using-herdr-sibling-panes`** — Transports separate targets through composer-safe `composer-submit.sh` with live footer model/effort verification before keys and after reset, completion markers, file reports, guarded recovery, and CLI probes. Its `agent-lifecycle.sh` starts and ends agents in panes only while the repository's `allow_agent_lifecycle` is `true`. Profile self-target subagents use orchestration's route instead of pane transport. ## Strategic & Planning diff --git a/docs/workflows.md b/docs/workflows.md index c4a02ea..7109ba3 100644 --- a/docs/workflows.md +++ b/docs/workflows.md @@ -2,7 +2,7 @@ Workflows tie roles and skills into end-to-end development procedures. They live in `commands/`, the default command directory of the Claude Code, Codex, and Cursor plugin conventions; the OpenCode plugin registers them at startup. Each file carries YAML frontmatter `description: ...` so supporting platforms expose it as a slash command. -Every development workflow reads `orchestration` and its [profiles contract](../skills/orchestration/references/profiles.md), resolving repo config over shipped roles and then only present composition slots. Separate delegated targets use reset-backed in-scope Herdr panes. Profile self-target `delegate` requires fresh subagents for work and reviews, even with empty reviewers; other owner-session modes permit inline work/self-review and optional subagents. Without a profile, legacy independence and unavailable-pane degradation remain. Workers never re-delegate. Scope, modes, gates, and lifecycle permission stay frozen. +Every development workflow reads `orchestration` and its [profiles contract](../skills/orchestration/references/profiles.md), resolving repo config over shipped roles and then only present selected-profile keys. Separate delegated targets use reset-backed in-scope Herdr panes. Profile self-target `delegate` requires fresh subagents for work and reviews, even with empty reviewers; other owner-session modes permit inline work/self-review and optional subagents. Without a profile, legacy independence and unavailable-pane degradation remain. Workers never re-delegate. Scope, modes, gates, and lifecycle permission stay frozen. ## Available Workflows diff --git a/skills/orchestration/README.md b/skills/orchestration/README.md index 206467e..7df0b6e 100644 --- a/skills/orchestration/README.md +++ b/skills/orchestration/README.md @@ -11,16 +11,18 @@ the effective owner, routes, review context, and configuration changes. - [`roles.yaml`](roles.yaml) — the pack's **shipped defaults**: the `roles:` list, the `fallbacks:` map of substitutes for exhausted agents, the `delegation:` block (`pane_scope`, `execution`), and the `assignments:` table giving every delegation task a role and a mode. - [`references/profiles.md`](references/profiles.md) — required before routing: selection/precedence, nested targets and migration, owner handoff, lifecycle permission, self-target execution, and fallback lookup. - [`references/routing.md`](references/routing.md) — task classification, workflow mapping, and the coding boundary. -- [`../../.herdrpowers/profiles/`](../../.herdrpowers/profiles/) — six shipped composition-only templates, included in npm distribution and installed only when missing during init. +- [`../../.herdrpowers/profiles/`](../../.herdrpowers/profiles/) — six shipped profile templates, included in npm distribution and installed only when missing during init. - [`agents/openai.yaml`](agents/openai.yaml) — interface metadata for OpenAI-compatible agent runners. ## Configuration `roles.yaml` is the default layer. Customize a consumer repo through its own `.herdrpowers/config.yaml`, not the plugin installation. Merge config per key, -then overlay only composition fields present in the selected local profile -(shipped template is the second lookup). Lists replace; explicit empties do -not inherit. Invalid/missing selections error explicitly. Freeze configuration +then overlay only keys present in the selected local profile +(shipped template is the second lookup). Composition slots replace bindings; +fallback/delegation/assignment maps merge per key, including task fields. +Lists replace, including `[]`; empty maps change nothing. Invalid/missing +selections error explicitly. Freeze configuration before routing; do not rewrite it during a run. Top-level `profile` selects no composition when absent/null/`none`. @@ -38,7 +40,7 @@ selection. See [`commands/init.md`](../../commands/init.md). - Nested targets preserve kind/model/effort strings; effort requires model, and matching uses verified live footer evidence before keys and after reset. Legacy bare kinds/owner aliases remain readable; old non-fallback `kind@model` pins are normalized with deprecation notices. - A selected owner must match the receiving pane or prompt for unused versus relay, then receive explicit authority and frozen settings. A relay retains no decision authority. Custom planning-design/generalist targets remain intact; their owner aliases follow the selected owner. - Separate review independence comes from reset. With a selected profile, a delegated owner target requires a fresh subagent, including solo tasks and empty reviewers; other owner-session modes may self-review and report that honestly. Without a profile, the legacy fresh-subagent rule for orchestrator-mode reviews remains. -- Profile empty reviewers choose the owner rather than disable gates; empty coder means no separate coder. Omitted keys preserve roles, including legacy empty-role task disabling. Selection changes neither assignments nor gate enablement. +- Profile empty reviewers choose the owner rather than disable gates; empty coder means no separate coder. Omitted keys preserve roles, including legacy empty-role task disabling. Explicit profile assignment fields override config values; omitted fields retain them. - Lifecycle false prohibits start/exit/restart, including handoff and fallback. True lets the active owner start a resolved target that has no live in-scope match — the primary before any substitute — in an available shell pane, and end idle agents the task started with no pending work. `agent-lifecycle.sh` enforces the value, the scope, and the live footer check. - Every delegation task is reassignable and every review individually togglable. Any assignment the repo changed, any non-default `delegation:` value, and any disabled review is named in the final report; `/strict_full_cycle` is the only thing that overrides `enabled`, and it touches nothing else. - Fallback lookup uses exact `kind@model` before bare kind only when absent; matched `[]` is authoritative. Substitutes retain string syntax with no effort constraint. Preserve `Calude` and the unequal profile `muse-1.0-wonder` / fallback `muse-wonder-1.0` strings; the report names the fallback and lost constraint. diff --git a/skills/orchestration/SKILL.md b/skills/orchestration/SKILL.md index 7cee803..ded5726 100644 --- a/skills/orchestration/SKILL.md +++ b/skills/orchestration/SKILL.md @@ -20,21 +20,22 @@ The base configuration answers "who does what, and which reviews run": 2. **[`roles.yaml`](roles.yaml)** — the pack's shipped defaults. Supplies every key the repo file omits. Read both at the start of every orchestrated task (the repo file may be absent). -Then overlay only composition keys present in the selected profile, if any. +Then overlay only keys present in the selected profile, per the profiles reference. The base files share this schema: - **`roles:`** — each role's `agent` or `agents` binding. New targets use `{kind: {model: , effort: }}`; settings are optional, effort requires model. The bare `orchestrator` alias resolves to the active owner. Legacy bare kinds and non-fallback `kind@model` remain readable, with a deprecation notice for the latter; init writes nested targets. Validate and normalize per the profiles reference, not by silently ignoring invalid fields. - **`fallbacks:`** — agent → ordered substitutes, for when an agent cannot take work. Keys and substitutes may be pinned too. - **`delegation:`** — defaults that apply to every task: `pane_scope` (which panes are eligible at all) and `execution` (parallel or serial by default). - **`assignments:`** — every delegation task, each with the role that performs it. -- **`profile`** — optional composition name, not an assignment or a gate switch. +- **`profile`** — optional preset name; its present composition and routing entries override the base configuration. - **`allow_agent_lifecycle`** — top-level strict boolean, separate from composition/delegation; defaults false. False starts and ends no agent. True lets the active owner start a resolved target that has no live match and end idle agents the task started, only through `agent-lifecycle.sh`, which enforces the value. Read the profiles reference before any startup, exit, or recovery action, including owner handoff and fallback. Merging is per key, not per file. Lists replace rather than concatenate. -Profile keys override the planning-design, orchestrator, coder, reviewer, or generalist binding -only when present; omitted keys preserve them. A profile never changes -assignments, gate enablement, or delegation defaults. Empty profile reviewers select the owner, while a legacy -empty role list keeps its disabling semantics if no profile overrides it. +Present profile composition keys replace their role bindings. Profile +`fallbacks`, `delegation`, and `assignments` merge per key, including assignment +fields; omitted entries retain config/default values. Resolve modes and gate +enablement after the overlay. Empty profile reviewers select the owner, while +a legacy empty role list keeps its disabling semantics if no profile overrides it. Report assignment keys not defined by `roles.yaml`: otherwise their intended task silently uses a default and can revive a disabled review. Honor legacy @@ -49,7 +50,8 @@ report degradation instead. ## Delegation scope `delegation.pane_scope` filters eligible panes before selecting a role target -or an owner handoff recipient. Read its resolved value; profiles do not widen it. +or an owner handoff recipient. Read its resolved value after the profile overlay +and freeze it; never widen it during the run. | value | eligible panes | |---|---| @@ -112,7 +114,7 @@ Resolve every task the workflow will touch before its first delegation, not when **`/strict_full_cycle` ignores `enabled` and runs every gate in this table**, naming each one it forced on in its report. It is the pack's only override of the resolved configuration, and it touches nothing but `enabled` — never a `role`, a `mode`, or an invariant. -**Every assignment the repo config changed away from `roles.yaml`, every non-default `delegation:` value, and every disabled review, is named in the final report**, next to any role that fell back and any review that degraded for lack of panes. The user configured it; the report says so, every run, so nobody later mistakes an unreviewed branch for a reviewed one, or a self-tested one for independently tested. +**Every assignment the repo config or profile changed away from `roles.yaml`, every non-default `delegation:` value, and every disabled review, is named in the final report**, next to any role that fell back and any review that degraded for lack of panes. The user configured it; the report says so, every run, so nobody later mistakes an unreviewed branch for a reviewed one, or a self-tested one for independently tested. ### Roles that bind to a list diff --git a/skills/orchestration/references/profiles.md b/skills/orchestration/references/profiles.md index 6ab8a50..efaa98e 100644 --- a/skills/orchestration/references/profiles.md +++ b/skills/orchestration/references/profiles.md @@ -1,7 +1,7 @@ # Profiles, Targets, and Active Ownership Read this reference before resolving ownership or routing any task. It is the -composition contract for `orchestration`; configuration is interpreted by the +routing contract for `orchestration`; configuration is interpreted by the skills, not by a separate parser or execution service. Paths below distinguish the target repository (``) from the installed plugin (``): the directory holding `skills/`, three levels above this file. @@ -25,8 +25,8 @@ the directory holding `skills/`, three levels above this file. A lifecycle policy nested under `delegation` or inside a profile is invalid and cannot authorize lifecycle actions. - A profile the user names in the task itself ("run this with `fable-opus`"), - or an explicit request to use none, selects the composition for that run + A profile the user names in the task itself ("run this with `sol-astra`"), + or an explicit request to use none, selects the profile for that run and takes precedence over the configured `profile`. Validate it the same way and leave the configuration file unchanged. This covers selection only: lifecycle permission comes from configuration alone, never from chat. @@ -36,20 +36,22 @@ the directory holding `skills/`, three levels above this file. not permission to use the shipped copy. Missing selected files, malformed YAML, invalid targets, and extra profile keys must be reported explicitly; stop profile routing instead of silently using legacy defaults. -4. Overlay only keys **present** in that profile, using the table below. Do - not use truthiness, fill missing profile keys from another profile, or - expand the profile into assignments. Resolve owner aliases after this - overlay. A selected profile never rewrites `assignments.*.role`, `mode`, - `enabled`, `delegation`, or `fallbacks`. +4. Overlay only keys **present** in that profile, using the table below. + Merge maps per key, including each assignment's fields; replace lists, + including `[]`. Omitted keys retain the resolved config/default value. + Do not use truthiness or fill missing keys from another profile. Composition + keys alone do not change assignments; explicit `assignments`, `delegation`, + and `fallbacks` entries override their corresponding values. Resolve owner + aliases and gate enablement after this overlay. 5. Reconcile the reception pane with the selected owner as described below, then freeze the selected file, effective targets, assignments, scope, execution strategy, and lifecycle permission for the run. Do not rewrite configuration or switch profiles to escape a missing agent or a gate. -Profiles contain only `planning-design`, `orchestrator`, `coder`, `reviewers`, -and `generalist`. -Each is optional in a custom profile; shipped compositions live in the six YAML -assets, which are the source of truth for their values and reviewer order. +Profiles allow `planning-design`, `orchestrator`, `coder`, `reviewers`, +`generalist`, `fallbacks`, `delegation`, and `assignments`. +Each is optional; the six shipped YAML assets are the source of truth for +preset values and reviewer order. | Profile key | When absent | When present | |---|---|---| @@ -58,11 +60,28 @@ assets, which are the source of truth for their values and reviewer order. | `generalist` | Keep the resolved `roles.generalist` binding | One nested target replaces that binding; bare `orchestrator`, null, `[]`, or literal `none` binds it to the active owner | | `coder` | Keep the resolved `roles.coder` binding | One nested target replaces that binding; bare `orchestrator`, null, `[]`, or literal `none` binds it to the active owner, with no separate coder | | `reviewers` | Keep the resolved `roles.reviewer` binding | A nonempty list of nested targets replaces that binding in order; `[orchestrator]`, `[]`, null, or literal `none` binds it to the active owner, with no external reviewers | +| `fallbacks` | Keep the resolved fallback map | Override each present string key's entire substitute list, including `[]`; keep omitted entries | +| `delegation` | Keep the resolved delegation settings | Override each present `pane_scope` or `execution`; keep omitted settings | +| `assignments` | Keep the resolved task assignments | Override each present task's `role`, `mode`, or review `enabled` field; keep omitted tasks and fields | + +These three override blocks must be maps; `{}` changes nothing, while null, +scalars, and lists are errors. Their entries use the config schema: fallback +values are lists of effort-free target strings; `pane_scope` is `tab`, +`workspace`, or `session`; `execution` is `parallel` or `serial`; assignment +roles must exist, modes are `delegate`, `orchestrator`, or `implementer`, and +review `enabled` is a strict boolean. Report unknown settings, tasks, or +assignment fields rather than silently ignoring them. Work tasks cannot be +disabled. A profile cannot contain `profile` or `allow_agent_lifecycle`; +lifecycle permission remains config-only. + +For example, `assignments: {plan-and-design: {mode: delegate}}` changes only +that mode. It preserves the task's role, every other task, and every review +gate. Resolve these overrides before freezing the run; never edit config. **Empty profile reviewers choose a reviewer; they do not disable a gate.** An enabled review still runs, and an explicitly delegated review still needs -a fresh subagent when its target is the owner. An `enabled: false` gate stays -off (except the existing `/strict_full_cycle` enabled-only override). +a fresh subagent when its target is the owner. A resolved `enabled: false` +gate stays off (except the existing `/strict_full_cycle` enabled-only override). Legacy `roles..agents: []` still disables tasks using that binding when the selected profile has not overridden it; profile omission must not reactivate it. The profile's explicit empty `coder` or `reviewers` replaces @@ -230,8 +249,9 @@ stop command. Workers never start or end agents. ## Profile routing: mode takes precedence -Apply gate enablement first. Then resolve the assignment and its effective -target. A selected composition changes targets, never assignment modes. +After the profile overlay, apply resolved gate enablement first. Then route +by the resolved assignment and its effective target. Composition keys change +targets; explicit assignment fields can change modes and gates. | Resolved route with a selected profile | Execution | |---|---| @@ -260,7 +280,7 @@ here; they do not grant worker re-delegation or revive disabled gates. ## Fallback lookup and effort -Read fallback data from the resolved `fallbacks` map, never from profiles. +Read fallback data from the resolved `fallbacks` map after the profile overlay. These lookup rules apply to owner selection and worker targets alike; owner fallback still obeys the reception-role question and explicit handoff above. For a nested primary target, form its `kind@model` key using the preserved @@ -279,7 +299,8 @@ The shipped strings deliberately include `Calude`. The profile model `muse-1.0-wonder` and fallback key model `muse-wonder-1.0` deliberately differ; they do not match each other. Leave both spellings intact and report that lookup result rather than silently unifying them. The exact shipped map is -in `roles.yaml` and must not be duplicated into profile assets. +in `roles.yaml`; profiles contain only intentional overrides, not copies of +inherited entries. ## Init and run record diff --git a/skills/orchestration/references/routing.md b/skills/orchestration/references/routing.md index 32a1ee2..8928d29 100644 --- a/skills/orchestration/references/routing.md +++ b/skills/orchestration/references/routing.md @@ -7,11 +7,11 @@ target repository. Resolve them before invoking a script. ## Task routing Before classifying or routing, read [profiles.md](profiles.md) and resolve the -active owner, per-key composition overlay, and separate lifecycle policy. +active owner, per-key profile overlay, and separate lifecycle policy. Freeze them for the run. Routing then names the task and reads its assignment. 1. **Name the task.** Classify the work against the task list in [SKILL.md](../SKILL.md#delegation-tasks-and-their-assignments): design work is `plan-and-design`; coding splits into `complex-coding` and `simple-coding` at the boundary below; lookups, moves, log gathering, and lint/format runs are `chores`; running verification commands is `verification`. When a piece of work spans tasks, use the heavier one (`plan-and-design` > `complex-coding` > `simple-coding` > `chores`). -2. **Read its assignment.** Take `role` and `mode` from `assignments:`; the profile never rewrites them. `delegate` to a separate target uses a matching idle in-scope pane and reset-backed submission. With a selected profile, `delegate` resolved to the active owner requires a fresh in-process subagent, including empty-reviewer reviews; lack of that capability is a reported inability, never inline delegation. `orchestrator` uses the active owner: profile-selected self-review may be same-session or use an optional subagent; no-profile reviews still require a fresh subagent. `implementer` continues in the task's existing session. Follow the profile routing table for self-targets; do not substitute a different route. +2. **Read its assignment.** Take `role` and `mode` from resolved `assignments:` after the profile overlay. `delegate` to a separate target uses a matching idle in-scope pane and reset-backed submission. With a selected profile, `delegate` resolved to the active owner requires a fresh in-process subagent, including empty-reviewer reviews; lack of that capability is a reported inability, never inline delegation. `orchestrator` uses the active owner: profile-selected self-review may be same-session or use an optional subagent; no-profile reviews still require a fresh subagent. `implementer` continues in the task's existing session. Follow the profile routing table for self-targets; do not substitute a different route. Every worker receives the [delegation contract](../SKILL.md#delegation-contract) and executes without re-delegation. Owner handoff uses the separate contract diff --git a/skills/orchestration/roles.yaml b/skills/orchestration/roles.yaml index a6f1cde..56e1dcb 100644 --- a/skills/orchestration/roles.yaml +++ b/skills/orchestration/roles.yaml @@ -4,14 +4,15 @@ # THIS FILE IS THE PACK'S DEFAULT, NOT THE PLACE TO CUSTOMIZE A REPO. # A target repository overrides any key below in its own # `.herdrpowers/config.yaml` (written by the init workflow) — that file wins -# key by key, and anything it omits falls back here. Plugin installations are -# read-only, so the repo file is the only editable layer on those installs. +# key by key, and anything it omits falls back here. A selected profile then +# overrides its present composition, fallback, delegation, and assignment keys. +# Customize the consumer config/profiles, not the read-only plugin installation. # See "Configuration resolution" in SKILL.md and references/profiles.md. # Composition selection and process lifecycle are separate from delegation. # Init installs missing templates, but selects none unless the user chooses. # using-herdr-sibling-panes/scripts/agent-lifecycle.sh reads this boolean (and -# delegation.pane_scope) as written here: only a literal `true` in the +# the frozen resolved delegation.pane_scope): only a literal `true` in the # repository's config lets the orchestrator start or end agents in panes. profile: null allow_agent_lifecycle: false diff --git a/skills/pane-driven-development/references/assignments.md b/skills/pane-driven-development/references/assignments.md index cf5f6d3..cb32864 100644 --- a/skills/pane-driven-development/references/assignments.md +++ b/skills/pane-driven-development/references/assignments.md @@ -9,7 +9,7 @@ not this directory or the target repository. Routing is `orchestration`'s job, not this skill's. Resolve the whole `assignments:` table at the start of execution from the merged configuration it describes, including its [profiles contract](../../orchestration/references/profiles.md): -repo config over shipped roles, then only composition keys present in the +repo config over shipped roles, then only keys present in the selected profile. Freeze effective targets, modes, gates, scope, and lifecycle policy up front; do not resolve them anew per task. diff --git a/skills/requesting-code-review/SKILL.md b/skills/requesting-code-review/SKILL.md index e9cbf42..69963d7 100644 --- a/skills/requesting-code-review/SKILL.md +++ b/skills/requesting-code-review/SKILL.md @@ -11,7 +11,7 @@ Read `orchestration` and its [profiles contract](../orchestration/references/pro **Core principle:** Review early, through the resolved route. Report same-session self-review honestly; it is not independent review. Missing mandatory subagent capability is a reported inability, never inline substitution or a passed gate. -**Gate:** whole-branch review uses `assignments.final-branch-review`; per-task review uses `assignments.task-review`. Resolve repo config over shipped roles, then the selected profile's present composition keys. Keep assignment modes and gate enablement. List roles run once per effective entry; merge their findings. A disabled gate does not run and is named in the report. Empty profile reviewers instead select the active owner and leave the gate enabled. +**Gate:** whole-branch review uses `assignments.final-branch-review`; per-task review uses `assignments.task-review`. Resolve repo config over shipped roles, then the selected profile's present keys. Resolve assignment fields per key before applying modes and gates. List roles run once per effective entry; merge their findings. A disabled gate does not run and is named in the report. Empty profile reviewers instead select the active owner and leave the gate enabled. ## When to Request Review diff --git a/skills/test-driven-development/SKILL.md b/skills/test-driven-development/SKILL.md index 11f26e0..92ac696 100644 --- a/skills/test-driven-development/SKILL.md +++ b/skills/test-driven-development/SKILL.md @@ -7,7 +7,7 @@ description: Use when implementing any feature or bugfix, before writing impleme ## Who Writes the Test (READ FIRST) -**The resolved `test-authoring` assignment says** — read it through `orchestration` and its [profiles contract](../orchestration/references/profiles.md), including the selected composition. Profiles never rewrite modes or gate enablement. The writer's session determines the rules below. +**The resolved `test-authoring` assignment says** — read it through `orchestration` and its [profiles contract](../orchestration/references/profiles.md), including the selected composition. Apply present profile assignment overrides before choosing the writer. The writer's session determines the rules below. **A fresh worker writes them (`mode: delegate`).** Separate targets use reset-backed Herdr panes; selected-profile owner targets require fresh in-process subagents, including solo composition. Missing subagent capability is a reported inability, never inline test authoring. The worker gets the task brief alone in its own worktree at BASE and never sees implementation. `pane-driven-development`'s test-author contract binds it: tests only, never production code, expected RED evidence, and no re-delegation. The implementer follows the exact stated interface and does not write those tests. diff --git a/skills/using-herdr-sibling-panes/SKILL.md b/skills/using-herdr-sibling-panes/SKILL.md index f3fafc7..eda1755 100644 --- a/skills/using-herdr-sibling-panes/SKILL.md +++ b/skills/using-herdr-sibling-panes/SKILL.md @@ -54,7 +54,7 @@ What to delegate depends on how this skill was entered: **Delegation stays inside the orchestrator's own tab unless the repository widens it.** A tab is how a herdr user separates projects: every pane carries its own `cwd`, and a pane one tab over is usually sitting in a different repository, in a session its own user is mid-task in. `composer-submit.sh` resets the target session, so a cross-tab delegation destroys that work — silently, and in a repo the task has no business touching. -The scope comes from `delegation.pane_scope` in the merged configuration (`.herdrpowers/config.yaml` over `orchestration/roles.yaml`), and defaults to `tab` — including standalone use, where no configuration was resolved at all. +The scope comes from resolved `delegation.pane_scope` after repo config and present profile overrides over `orchestration/roles.yaml`, and defaults to `tab` — including standalone use, where no configuration was resolved at all. | value | eligible panes | |---|---| diff --git a/skills/using-herdr-sibling-panes/references/agent-lifecycle.md b/skills/using-herdr-sibling-panes/references/agent-lifecycle.md index 9b82f69..44481c9 100644 --- a/skills/using-herdr-sibling-panes/references/agent-lifecycle.md +++ b/skills/using-herdr-sibling-panes/references/agent-lifecycle.md @@ -31,7 +31,11 @@ bash "$LIFECYCLE" policy # prints true or false; exit 2 on an invalid value The helper reads block-style YAML as init writes it. It resolves the repository from `HERDRPOWERS_REPO_ROOT`, else the git toplevel of the current directory; -run it from the task's repository or worktree. +run it from the task's repository or worktree. For `start`, pass the frozen +resolved `delegation.pane_scope` as `HERDRPOWERS_PANE_SCOPE`, including any +profile override. Only `tab`, `workspace`, and `session` are accepted; empty +or invalid values fail closed. If omitted, the helper reads config/default +scope for standalone use. This value cannot grant lifecycle permission. ## Start an agent @@ -60,11 +64,12 @@ reuse a ledger an earlier task left behind. strings alone. They are an attempt, never evidence. 3. Start it. `NAME` matches `[a-z][a-z0-9_-]{0,31}` and is unique among live agents; pass the resolved model and effort unchanged, and native arguments - after `--`: + after `--`. `RESOLVED_PANE_SCOPE` is the frozen effective scope: ```bash LEDGER="/lifecycle-agents.tsv" - bash "$LIFECYCLE" start "$LEDGER" "$PANE" codex hp-coder-1 "GPT-6.1-Sol" max \ + HERDRPOWERS_PANE_SCOPE="$RESOLVED_PANE_SCOPE" \ + bash "$LIFECYCLE" start "$LEDGER" "$PANE" codex hp-coder-1 "GPT-6.1-Sol" max \ -- -m gpt-6.1-sol -c 'model_reasoning_effort="max"' ``` diff --git a/skills/using-herdr-sibling-panes/scripts/agent-lifecycle.sh b/skills/using-herdr-sibling-panes/scripts/agent-lifecycle.sh index 8e71c11..56e759d 100755 --- a/skills/using-herdr-sibling-panes/scripts/agent-lifecycle.sh +++ b/skills/using-herdr-sibling-panes/scripts/agent-lifecycle.sh @@ -14,6 +14,10 @@ set -euo pipefail # instruction, a profile, or a nested key cannot. is # $HERDRPOWERS_REPO_ROOT, else the git toplevel of the cwd, else the cwd. # +# HERDRPOWERS_PANE_SCOPE supplies the frozen resolved delegation.pane_scope, +# including a profile override. Omission reads config/default scope; invalid +# values fail closed. It cannot grant lifecycle permission. +# # is this task's own file (keep it in the run's report directory). # `start` appends the agents it launched; `stop` ends only those, and only # while the pane still runs the very process that was started and — when the @@ -218,7 +222,15 @@ start() { require_permission local scope fields tab workspace agent cwd - scope=$(resolve nested delegation.pane_scope tab tab workspace session) || exit 2 + if [[ ${HERDRPOWERS_PANE_SCOPE+x} ]]; then + scope=$HERDRPOWERS_PANE_SCOPE + case $scope in + tab|workspace|session) ;; + *) echo 'HERDRPOWERS_PANE_SCOPE must be tab, workspace, or session' >&2; exit 2 ;; + esac + else + scope=$(resolve nested delegation.pane_scope tab tab workspace session) || exit 2 + fi if ! fields=$(pane_fields "$pane" tab_id workspace_id agent foreground_cwd); then echo "unknown pane: $pane" >&2 exit 2 diff --git a/skills/writing-plans/SKILL.md b/skills/writing-plans/SKILL.md index 8272677..7209239 100644 --- a/skills/writing-plans/SKILL.md +++ b/skills/writing-plans/SKILL.md @@ -226,8 +226,8 @@ If you find issues, fix them inline. No need to re-review — just fix and move Before offering execution methods, read `orchestration` and its [profiles contract](../orchestration/references/profiles.md). Resolve the active -owner, targets, and modes; a profile changes composition, not assignments or -gate enablement. A concrete coder matching the owner's model remains separate. +owner, targets, and modes after applying present profile composition and +routing overrides per key, including assignment fields. A concrete coder matching the owner's model remains separate. Do not offer inline execution as a substitute for profile `delegate` routes: owner targets require fresh subagents, separate targets reset-backed workers. Other owner-session modes permit inline work/self-review and optional subagents diff --git a/tests/agent-lifecycle/lifecycle.test.mjs b/tests/agent-lifecycle/lifecycle.test.mjs index a484c9e..12269b4 100644 --- a/tests/agent-lifecycle/lifecycle.test.mjs +++ b/tests/agent-lifecycle/lifecycle.test.mjs @@ -15,7 +15,7 @@ const fixture = (name) => resolve(here, '../pane-model/fixtures', name); const ALLOW = 'allow_agent_lifecycle: true\n'; const AGENT_PID = 4242; -function lifecycle(args, { config, panes = {}, start = 'ready', startScreen, ledger, git = false } = {}) { +function lifecycle(args, { config, scope, panes = {}, start = 'ready', startScreen, ledger, git = false } = {}) { const dir = mkdtempSync(join(tmpdir(), 'herdr-lifecycle-test-')); try { const repo = join(dir, 'repo'); @@ -51,6 +51,7 @@ function lifecycle(args, { config, panes = {}, start = 'ready', startScreen, led HERDR_TAB_ID: 'w1:t1', HERDR_WORKSPACE_ID: 'w1', HERDRPOWERS_REPO_ROOT: repo, + ...(scope === undefined ? {} : { HERDRPOWERS_PANE_SCOPE: scope }), HERDR_TEST_LOG: log, HERDR_TEST_STATE: join(dir, 'state.json'), HERDR_LIFECYCLE_SETTLE_SECONDS: '0', @@ -150,6 +151,28 @@ test('workspace scope permits a shell pane in another tab of the same workspace' assert.deepEqual(result.sent, [discardLine, agentStart('codex')]); }); +for (const [name, scope, pane, config, status] of [ + ['workspace permits another tab', 'workspace', { tab: 'w1:t9' }, ALLOW, 0], + ['session permits another workspace', 'session', { tab: 'w2:t1', workspace: 'w2' }, ALLOW, 0], + ['tab refuses another tab despite session config', 'tab', { tab: 'w1:t9' }, `${ALLOW}delegation:\n pane_scope: session\n`, 2], + ['an invalid value refuses the start', 'everywhere', {}, ALLOW, 2], + ['an explicit empty value refuses the start', '', {}, ALLOW, 2], +]) { + test(`resolved profile scope: ${name}`, () => { + const result = lifecycle(startCodex, { config, scope, panes: { 'w1:p2': pane } }); + assert.equal(result.status, status, result.stderr); + assert.deepEqual(result.sent, status === 0 ? [discardLine, agentStart('codex')] : []); + assert.equal(result.ledger, status === 0 ? entry('codex') : ''); + }); +} + +test('resolved profile scope cannot grant lifecycle permission', () => { + const result = lifecycle(startCodex, { config: 'allow_agent_lifecycle: false\n', scope: 'session', panes: shell }); + assert.equal(result.status, 6, result.stderr); + assert.deepEqual(result.sent, []); + assert.equal(result.ledger, ''); +}); + for (const [name, cwd, status] of [['a subdirectory of the same git repository', 'REPO/sub', 0], ['a different git repository', 'ELSEWHERE', 2]]) { test(`git: start in ${name} exits ${status}`, () => { const result = lifecycle(startCodex, { config: ALLOW, git: true, panes: { 'w1:p2': { cwd } } }); diff --git a/tests/orchestration-profiles/profiles.test.mjs b/tests/orchestration-profiles/profiles.test.mjs index 14cd2b3..db95fe4 100644 --- a/tests/orchestration-profiles/profiles.test.mjs +++ b/tests/orchestration-profiles/profiles.test.mjs @@ -9,11 +9,11 @@ import test from 'node:test'; const root = fileURLToPath(new URL('../../', import.meta.url)); const profiles = join(root, '.herdrpowers/profiles'); const names = [ - 'astra-sol.yaml', - 'fable-opus-panel.yaml', - 'fable-opus.yaml', - 'fable-sol-panel.yaml', + 'fable-opus-ultra.yaml', + 'fable-sol-ultra.yaml', + 'opus-fable.yaml', 'opus-solo.yaml', + 'sol-astra.yaml', 'sol-solo.yaml', ]; @@ -25,11 +25,44 @@ test('the six named profile templates are available as files', () => { for (const name of names) assert.ok(statSync(join(profiles, name)).isFile(), `${name} must be a file`); }); -test('every shipped profile routes planning-design and generalist tasks to its selected owner', () => { +test('every shipped profile starts with planning-design and ends with the owner generalist', () => { for (const name of names) { const source = readFileSync(join(profiles, name), 'utf8'); - assert.match(source, /^planning-design: orchestrator\n/, `${name} must start with planning-design: orchestrator`); - assert.match(source, /^generalist: orchestrator$/m, `${name} must bind generalist to the orchestrator`); + assert.match(source, /^planning-design:/, name); + assert.ok(source.endsWith('generalist: orchestrator\n'), name); + } +}); + +for (const [name, kind, owner, model] of [ + ['sol-astra.yaml', 'codex', 'GPT-6.1-Sol', 'GPT-6-Astra'], + ['opus-fable.yaml', 'claude', 'Opus 5.5', 'Fable 5.2'], +]) { + test(`${name} delegates planning and review while keeping execution with its cheaper owner`, () => { + const source = readFileSync(join(profiles, name), 'utf8'); + assert.equal(source, `planning-design: + ${kind}: + model: ${model} + effort: max +orchestrator: + ${kind}: + model: ${owner} + effort: max +coder: orchestrator +reviewers: + - ${kind}: + model: ${model} + effort: max +assignments: + plan-and-design: + mode: delegate +generalist: orchestrator +`); + }); +} + +test('ultra and solo profiles keep planning with their selected owner', () => { + for (const name of names.filter((name) => /-(ultra|solo)\.yaml$/.test(name))) { + assert.match(readFileSync(join(profiles, name), 'utf8'), /^planning-design: orchestrator\n/, name); } }); From b90fe210c65786ba0651707d9531cc36402760b7 Mon Sep 17 00:00:00 2001 From: transparent-pegasus <258247454+transparent-pegasus@users.noreply.github.com> Date: Wed, 11 Nov 2026 06:34:39 +0900 Subject: [PATCH 2/2] chore: put orchestrator first in profile presets --- .herdrpowers/profiles/README.md | 1 + .herdrpowers/profiles/fable-opus-ultra.yaml | 2 +- .herdrpowers/profiles/fable-sol-ultra.yaml | 2 +- .herdrpowers/profiles/opus-fable.yaml | 8 ++++---- .herdrpowers/profiles/opus-solo.yaml | 2 +- .herdrpowers/profiles/sol-astra.yaml | 8 ++++---- .herdrpowers/profiles/sol-solo.yaml | 2 +- .../2026-11-11-profile-overrides-and-presets.md | 3 ++- skills/orchestration/references/profiles.md | 2 ++ tests/orchestration-profiles/profiles.test.mjs | 17 ++++++++++------- 10 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.herdrpowers/profiles/README.md b/.herdrpowers/profiles/README.md index e14b66b..3f78c72 100644 --- a/.herdrpowers/profiles/README.md +++ b/.herdrpowers/profiles/README.md @@ -1,6 +1,7 @@ # Profiles Names put the owner first. `ultra` means four external reviewers; `solo` means no separate coder. +YAML keys start with `orchestrator` when present, then `planning-design`; `generalist` stays last. | File | Composition and purpose | |---|---| diff --git a/.herdrpowers/profiles/fable-opus-ultra.yaml b/.herdrpowers/profiles/fable-opus-ultra.yaml index 62430fb..03e0efc 100644 --- a/.herdrpowers/profiles/fable-opus-ultra.yaml +++ b/.herdrpowers/profiles/fable-opus-ultra.yaml @@ -1,8 +1,8 @@ -planning-design: orchestrator orchestrator: claude: model: Fable 5.2 effort: max +planning-design: orchestrator coder: claude: model: Opus 5.5 diff --git a/.herdrpowers/profiles/fable-sol-ultra.yaml b/.herdrpowers/profiles/fable-sol-ultra.yaml index 6097df1..1d9e8b9 100644 --- a/.herdrpowers/profiles/fable-sol-ultra.yaml +++ b/.herdrpowers/profiles/fable-sol-ultra.yaml @@ -1,8 +1,8 @@ -planning-design: orchestrator orchestrator: claude: model: Fable 5.2 effort: max +planning-design: orchestrator coder: codex: model: GPT-6.1-Sol diff --git a/.herdrpowers/profiles/opus-fable.yaml b/.herdrpowers/profiles/opus-fable.yaml index cd3357d..ec4b7d8 100644 --- a/.herdrpowers/profiles/opus-fable.yaml +++ b/.herdrpowers/profiles/opus-fable.yaml @@ -1,11 +1,11 @@ -planning-design: - claude: - model: Fable 5.2 - effort: max orchestrator: claude: model: Opus 5.5 effort: max +planning-design: + claude: + model: Fable 5.2 + effort: max coder: orchestrator reviewers: - claude: diff --git a/.herdrpowers/profiles/opus-solo.yaml b/.herdrpowers/profiles/opus-solo.yaml index 860296f..6da15b4 100644 --- a/.herdrpowers/profiles/opus-solo.yaml +++ b/.herdrpowers/profiles/opus-solo.yaml @@ -1,8 +1,8 @@ -planning-design: orchestrator orchestrator: claude: model: Opus 5.5 effort: max +planning-design: orchestrator coder: orchestrator reviewers: [orchestrator] generalist: orchestrator diff --git a/.herdrpowers/profiles/sol-astra.yaml b/.herdrpowers/profiles/sol-astra.yaml index e4c844e..cf58626 100644 --- a/.herdrpowers/profiles/sol-astra.yaml +++ b/.herdrpowers/profiles/sol-astra.yaml @@ -1,11 +1,11 @@ -planning-design: - codex: - model: GPT-6-Astra - effort: max orchestrator: codex: model: GPT-6.1-Sol effort: max +planning-design: + codex: + model: GPT-6-Astra + effort: max coder: orchestrator reviewers: - codex: diff --git a/.herdrpowers/profiles/sol-solo.yaml b/.herdrpowers/profiles/sol-solo.yaml index f564a9c..43f4dcd 100644 --- a/.herdrpowers/profiles/sol-solo.yaml +++ b/.herdrpowers/profiles/sol-solo.yaml @@ -1,8 +1,8 @@ -planning-design: orchestrator orchestrator: codex: model: GPT-6.1-Sol effort: max +planning-design: orchestrator coder: orchestrator reviewers: [orchestrator] generalist: orchestrator diff --git a/changelogs/2026-11-11-profile-overrides-and-presets.md b/changelogs/2026-11-11-profile-overrides-and-presets.md index aaea28d..2e603f6 100644 --- a/changelogs/2026-11-11-profile-overrides-and-presets.md +++ b/changelogs/2026-11-11-profile-overrides-and-presets.md @@ -18,7 +18,8 @@ targets. Replace `astra-sol.yaml` and `fable-opus.yaml` with `sol-astra.yaml` and `opus-fable.yaml`: Sol/Opus owns execution, Astra/Fable handles planning and one review, all at `max` effort. Both set `coder` and `generalist` to `orchestrator` and override only `assignments.plan-and-design.mode` to -`delegate`. Every preset keeps `planning-design` first and `generalist` last. +`delegate`. Presets put `orchestrator` first when present, then +`planning-design`; `generalist` remains last. Synchronize workflow/skill instructions, configuration docs, preset names, and npm package expectations. Add regression coverage for resolved lifecycle diff --git a/skills/orchestration/references/profiles.md b/skills/orchestration/references/profiles.md index efaa98e..65e7087 100644 --- a/skills/orchestration/references/profiles.md +++ b/skills/orchestration/references/profiles.md @@ -52,6 +52,8 @@ Profiles allow `planning-design`, `orchestrator`, `coder`, `reviewers`, `generalist`, `fallbacks`, `delegation`, and `assignments`. Each is optional; the six shipped YAML assets are the source of truth for preset values and reviewer order. +Keep preset keys ordered: `orchestrator` when present, then `planning-design`, +remaining keys, and `generalist` last. | Profile key | When absent | When present | |---|---|---| diff --git a/tests/orchestration-profiles/profiles.test.mjs b/tests/orchestration-profiles/profiles.test.mjs index db95fe4..b7e238e 100644 --- a/tests/orchestration-profiles/profiles.test.mjs +++ b/tests/orchestration-profiles/profiles.test.mjs @@ -25,10 +25,13 @@ test('the six named profile templates are available as files', () => { for (const name of names) assert.ok(statSync(join(profiles, name)).isFile(), `${name} must be a file`); }); -test('every shipped profile starts with planning-design and ends with the owner generalist', () => { +test('every shipped profile orders owner before planning and ends with the owner generalist', () => { for (const name of names) { const source = readFileSync(join(profiles, name), 'utf8'); - assert.match(source, /^planning-design:/, name); + const keys = [...source.matchAll(/^([a-z-]+):/gm)].map((match) => match[1]); + const first = keys.includes('orchestrator') ? ['orchestrator', 'planning-design'] : ['planning-design']; + assert.ok(source.startsWith(`${first[0]}:`), name); + assert.deepEqual(keys.slice(0, first.length), first, name); assert.ok(source.endsWith('generalist: orchestrator\n'), name); } }); @@ -39,13 +42,13 @@ for (const [name, kind, owner, model] of [ ]) { test(`${name} delegates planning and review while keeping execution with its cheaper owner`, () => { const source = readFileSync(join(profiles, name), 'utf8'); - assert.equal(source, `planning-design: + assert.equal(source, `orchestrator: ${kind}: - model: ${model} + model: ${owner} effort: max -orchestrator: +planning-design: ${kind}: - model: ${owner} + model: ${model} effort: max coder: orchestrator reviewers: @@ -62,7 +65,7 @@ generalist: orchestrator test('ultra and solo profiles keep planning with their selected owner', () => { for (const name of names.filter((name) => /-(ultra|solo)\.yaml$/.test(name))) { - assert.match(readFileSync(join(profiles, name), 'utf8'), /^planning-design: orchestrator\n/, name); + assert.match(readFileSync(join(profiles, name), 'utf8'), /^planning-design: orchestrator$/m, name); } });