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
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,42 @@ codex plugin add behavior-diff@spacedock

## Use Behavior Diff

1. Edit one instruction file. Keep the change uncommitted.
2. Ask Claude Code or Codex to run Behavior Diff on the change.
3. Review the report before you commit the instruction.
Use the shipped [`behavior-rehearse` skill](plugin/skills/behavior-rehearse/SKILL.md)
for a guided review of an instruction change or PR through a practical adoption
recommendation. It owns the journey; the underlying `behavior-diff` skill owns
comparison preparation and assessment, and the existing runner executes trials.

For example:
In Claude Code:

```text
Run behavior diff on my AGENTS.md change.
/behavior-diff:behavior-rehearse Review my AGENTS.md change and recommend whether to adopt it.
```

In Codex:

```text
$behavior-rehearse Review my AGENTS.md change and recommend whether to adopt it.
```

In Claude Code, you can also run:
Supply the change or PR and any context you permit the agent to inspect. The
agent reviews the change, follows the comparison through completion, and leads
its first final answer with what to do and why. Decision-changing risks stay
visible; detailed evidence and methodology stay in linked evidence. It reuses
existing authority and asks once for missing bounded run approval. Paid model
calls and external effects still require their own applicable authority; a
recommendation never authorizes commit, push, merge, release, or publication.

For a comparison without the guided review journey, keep an instruction edit
uncommitted and ask:

```text
/behavior-diff
Run behavior diff on my AGENTS.md change.
```

Or invoke `/behavior-diff:behavior-diff` in Claude Code or `$behavior-diff` in
Codex. Explicit PR or historical Git inputs are also supported; they do not
require an uncommitted edit.

Behavior Diff finds the changed instruction file and works out what the change
is meant to do and what it must preserve. From that intent, the agent designs a
neutral task and, when needed, coherent ordinary and edge-case test data, plus
Expand Down
61 changes: 42 additions & 19 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ scripts handle execution, evidence, and reporting.
+----------------------------+----------------------------+
v
+---------------------------------------------------------+
| Skill preparation (LLM; reference recipe) |
| behavior-rehearse: guided journey (optional entry) |
| Review context -> reuse authority / one bounded proposal|
| Delegate comparison to sibling behavior-diff skill |
+----------------------------+----------------------------+
v
+---------------------------------------------------------+
| behavior-diff preparation (LLM; reference recipe) |
| Change intent + preservation -> capabilities/premises |
| -> neutral task + ordinary/bounded edge data + private |
| case criteria; reuse sufficient project data |
Expand Down Expand Up @@ -59,6 +65,13 @@ scripts handle execution, evidence, and reporting.
| reached / missed / unknown; intent supported / |
| contradicted / insufficient evidence; run health apart; |
| report agreement or gap disclosed; user decides |
+---------------------------------------------------------+
v
+---------------------------------------------------------+
| behavior-rehearse: first final answer (guided entry) |
| Action + reason first; decision-changing risks visible |
| Detailed evidence and methodology linked; no adoption |
| action or external effect implied |
+---------------------------------------------------------+
```

Expand Down Expand Up @@ -1023,29 +1036,33 @@ synthetic local emulators only. An explicit publication-policy update and review
of actual outgoing content remain required before uploading any private session;
blinding and private repository visibility are not publication permission.

## Local verification handoff prototype
## Guided behavior rehearsal

The repository-local [maintainer skill](../.agents/skills/verification-handoff-prototype/SKILL.md)
owns the journey, the canonical Behavior Diff skill owns the comparison, and the
existing runner owns execution. These are responsibilities, not new processes
or an additional coordinator.
The shipped [`behavior-rehearse` skill](../plugin/skills/behavior-rehearse/SKILL.md)
is the guided user entry. It owns the journey, the sibling `behavior-diff`
skill owns the comparison, and the existing runner owns execution. These are
responsibilities, not new processes or an additional coordinator. Direct
`behavior-diff` requests still enter comparison preparation without the review
journey.

```text
Owner's question + selected change + existing authority
-> handoff: review context and delegate comparison to Behavior Diff
-> Behavior Diff: resolve inputs, feasibility, and missing run terms
-> handoff: one proposal only for missing authority or material decisions
-> behavior-rehearse: review context and delegate comparison to behavior-diff
-> behavior-diff: resolve inputs, feasibility, and missing run terms
-> behavior-rehearse: one proposal for missing authority or material decisions
-> Behavior Diff: prepare -> freeze -> verify
-> existing runner: fresh trials -> recorded evidence -> existing posttrial path
-> Behavior Diff: assess reached cases, findings, limits, and execution health
-> handoff: practical recommendation + adoption risk (no merge)
-> behavior-diff: assess reached cases, findings, limits, and execution health
-> behavior-rehearse: action-first recommendation + adoption risk (no merge)
```

The handoff follows delegated work through completion without owner reminders,
Behavior Rehearsal follows delegated work through completion without owner reminders,
but does not maintain another scenario recipe, launch command, or behavioral
assessment. It uses one resolved Behavior Diff version even when reviewing a
different repository. Existing frozen input records, run handles, status readers,
and evidence remain authoritative; this introduces no new handoff schema or
assessment. It resolves `behavior-diff` from the same installed plugin's sibling
skill directory, including when reviewing a different repository, rather than
from a maintainer `.agents` directory or the original source checkout.
Existing frozen input records, run handles, status readers, and evidence remain
authoritative; this introduces no new handoff schema or
automatic execution-resume promise.

Ordinary comparisons use the existing runner's supported host path. The optional
Expand All @@ -1058,6 +1075,11 @@ without prior discussion or outcomes. Required safety or evidence boundaries
cannot be waived merely to complete a journey.

The handoff reuses existing authorization and requests only missing terms.
When the goal is ambiguous, it first inspects the change, then offers 2–4
outcome-based options with a recommendation in the same proposal as the run terms.
Clear goals skip this menu. Explicit approval accepts the stated goal and covered
run terms; selecting a goal alone does not authorize execution. A changed goal
requires only uncovered terms to be approved, not a new stage-by-stage consent loop.
Paid runs, changed provider/data exposure, and expanded scope need bounded
authority. No global configuration writes or PR operations are implied.
An execution failure stops the affected work, not safe non-model diagnosis or
Expand All @@ -1066,10 +1088,11 @@ recovery; the handoff carries it through within authority or explains the
remaining decision. It does not build a replacement launcher.

The agreed question determines whether a simulation is sufficient or a live
service is required. The final answer explains what to do with the change, why,
and what remains unverified. Detailed evidence stays in private links; risks
that affect the decision remain visible. A useful null result can complete the
journey; missing required evidence or failed execution cannot.
service is required. The first final answer leads with what to do with the
change and why, followed by decision-changing risk and remaining required
evidence gaps. Non-decision-changing methodology and detailed evidence stay in
private links. A useful null result can complete the journey; missing required
evidence or failed execution cannot.

Explicit replay-only requests use saved evidence without new trials. Optional
`replay.py` owns private snapshots, correction invalidation, confirmed revisions
Expand Down
20 changes: 12 additions & 8 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,24 @@ Keep private sources, trials, reports, and temporary comparisons outside this
checkout. No model-backed verification runs in CI. Synthetic fixtures remain
the deterministic test set and supplemental edge-case examples.

## Local verification handoff prototype
## Behavior rehearsal and replay checks

For the isolated, conversational handoff-to-decision replay, explicitly load
[the maintainer skill source](../.agents/skills/verification-handoff-prototype/SKILL.md)
in Claude Code or Codex, then supply the change, permitted context and case root.
OMP can load that same path; this is not an installed-plugin or runtime-adapter claim.
The host operates the helper; the owner should not have to choose evidence IDs.
The shipped [`behavior-rehearse` skill](../plugin/skills/behavior-rehearse/SKILL.md)
is the guided review-to-recommendation entry. In Claude Code invoke
`/behavior-diff:behavior-rehearse`; in Codex invoke `$behavior-rehearse`, then supply
the selected change or PR and permitted context. It delegates comparison to the
sibling `behavior-diff` skill in the same installed plugin. No source-checkout
maintainer skill is needed. Live comparisons still require bounded model-cost
approval; replay-only requests do not run trials or external actions.

Python 3.10+ is sufficient. The skill includes the one-command helper invocation
For the conversational fixed-evidence replay, also supply the private case root.
The host operates the helper; the owner should not have to choose evidence IDs.
Python 3.10+ is sufficient for replay. The skill includes the helper invocation
and `fixtures/synthetic.json` for an offline, invented demonstration. Run its
deterministic behavior checks separately with:

```sh
python3 tests/verification-handoff-prototype-test.py
python3 tests/behavior-rehearse-test.py
```

Use a mode-0700 directory outside all Git trees for mode-0600 session/packet files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ No release, retirement of live mode, or reduction of host support is implied.
## References

- [Current architecture](../docs/architecture.md)
- [Verification handoff skill](../.agents/skills/verification-handoff-prototype/SKILL.md)
- [Current handoff execution instructions](../.agents/skills/verification-handoff-prototype/references/execution.md)
- [Behavior rehearsal skill](../plugin/skills/behavior-rehearse/SKILL.md)
- [Current handoff execution instructions](../plugin/skills/behavior-rehearse/references/execution.md)
- [Canonical Behavior Diff skill](../plugin/skills/behavior-diff/SKILL.md)
- [Canonical preparation and trusted launch recipe](../plugin/skills/behavior-diff/references/scenario-and-test-data.md)
- [Existing trial adapter](../plugin/skills/behavior-diff/scripts/run-trial.sh)
Expand Down
Loading
Loading