Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions openspec/specs/agentic-harness/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -3604,3 +3604,75 @@ working on that change.

- **WHEN** a later run of the same change completed
- **THEN** the suggestion is no longer made

### Requirement: The supervisor acts only where a change allows it

`supervisor.mode: "act"` SHALL be accepted only in a change's own
`harness.json`, only where that file sets `autonomyLevel: "autonomous"`,
and only where the resolved `maxStageAttempts` is above 1. Otherwise it
SHALL be refused where the configuration resolves, naming the rule.

`supervisor.allowCostIncrease` and `supervisor.allowProviderChange` SHALL
be accepted only in a change's own file and SHALL mean false where absent.
`supervisor.fallback` SHALL be accepted in either file, as an ordered list
of registered agents per agent stage, without `vscode-chat` and without a
repeated id.

#### Scenario: Act in the global file

- **WHEN** `openspec/agent-harness.json` sets `supervisor.mode: "act"`
- **THEN** resolving the configuration fails and says act is set per change

#### Scenario: Act without an attempt to spend

- **WHEN** a change's file sets `act` and `maxStageAttempts` resolves to 1
- **THEN** resolving the configuration fails and names `maxStageAttempts`

### Requirement: A failed stage is repeated or moved under act, and said

Under `act`, when a chain's stage fails and an attempt is left, the chain
SHALL:

- attempt the stage again on the same agent where the failure's diagnosis
says repeating is likely to help;
- move the stage to the first agent of `supervisor.fallback.<stage>` not
yet tried in it that the policy allows, where the diagnosis says
repeating will not help;
- otherwise end with the stage's failure, as without `act`.

A move to an agent of another provider SHALL need
`allowProviderChange`, and a move to any agent that is not the local model
SHALL need `allowCostIncrease`. A moved stage SHALL run its new agent with
that agent's defaults.

Every repeat and move SHALL be said in the chain's events and recorded in
the audit log, with the agent, the cause and, for a fallback refused, the
rule that refused it. A chain SHALL yield no `failed` event for a stage it
goes on to attempt again.

#### Scenario: Not signed in, with a fallback allowed

- **WHEN** under `act`, `apply` fails on `copilot-cli-acp` diagnosed as not
signed in, its fallback is `claude-cli-acp`, and both allowances are true
- **THEN** the chain says it moved apply to `claude-cli-acp` because the
agent is not signed in, records it, and attempts apply on
`claude-cli-acp`

#### Scenario: A fallback the policy refuses

- **WHEN** the same happens with `allowProviderChange` false
- **THEN** the chain ends with apply's failure, and says the fallback
`claude-cli-acp` was refused because it is another provider

#### Scenario: A rate limit

- **WHEN** under `act`, a stage fails diagnosed as rate-limited with an
attempt left
- **THEN** the stage is attempted again on the same agent, and the chain
says why

#### Scenario: Advise names the fallback

- **WHEN** under `advise`, a change's last run failed at apply for a cause
repeating cannot fix, and apply has an allowed fallback
- **THEN** the supervisor's suggestion names that agent and changes nothing
11 changes: 11 additions & 0 deletions openspec/specs/ci-cli/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1050,3 +1050,14 @@ worktree. They SHALL exit 0 on success, 1 on a refusal with its reason, and
- **WHEN** `task done the-change 6.4` is run and 6.4 is Human-only
- **THEN** nothing is written, the reason is printed, and the command
exits 1

### Requirement: The terminal says when the supervisor moved a stage

`openspec-ui-cli run` SHALL print, under a repeated or moved stage's
heading, why it was attempted again and on which agent.

#### Scenario: A moved stage in the terminal

- **WHEN** a chain run from the terminal moves apply to another agent
- **THEN** the heading names the new agent and the attempt, and the line
under it says the supervisor moved it and why
18 changes: 18 additions & 0 deletions openspec/specs/shared-ui/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -2284,3 +2284,21 @@ next one, into view when it opens.

- **WHEN** a person hides done tasks on an open card
- **THEN** only open tasks are listed, and the choice holds after a reload

### Requirement: A change's Harness Settings set what the supervisor may do

A change's Harness Settings SHALL offer Act among the supervisor's modes
only where the change's own autonomy level is Autonomous, with a note that
under Act the supervisor may start another agent, which can cost money and
send the change's files to another provider. They SHALL offer each agent
stage's fallback agents and the two allowances, and SHALL save them with
the rest. The global Harness Settings SHALL NOT offer Act or the
allowances.

#### Scenario: Turning Act on

- **WHEN** a person sets a change's autonomy level to Autonomous, chooses
Act, names `claude-cli-acp` as apply's fallback and saves
- **THEN** the change's `harness.json` carries `supervisor.mode: "act"` and
`supervisor.fallback.apply: ["claude-cli-acp"]`, and the note about cost
and providers was shown beside the choice
Loading