Verify Behavior
Given a behavioral claim about code, or a change that was just applied, decide the cheapest way to get executed proof, run it in isolation, and report the raw result as a receipt.
This skill is the execution engine six-plus call sites in this repo used to hand-roll independently: "detect the toolchain, run something, read pass or fail."
It replaces the ad hoc version in each of those with one shared ladder.
This SKILL.md is a thin index. Detailed rules live in rules/*.md and load on demand.
The execute-not-score boundary
This skill does not score — it never assigns a confidence score and never grades pass/fail against an intent.
It runs a command, captures the raw output, and classifies the result against the claim itself as confirms / contradicts / ambiguous / null.
confidence(code) owns the number — this skill supplies sharper evidence to that gate, it does not replace it.
- A calling agent's own grading (e.g.
bug-fix-verifier's FAIL_TO_PASS, the aw-executor Phase 4 expect comparison) stays with the caller — this skill supplies the run-and-observe mechanic underneath that grading, not the grading itself.
See rules/receipt.md for the full contract, including the hard invariant that a null or non-reproducing result drops or contradicts a finding and is never confirmation.
The two consumer shapes
| Shape |
Question it answers |
Consumers |
| Claim-verification |
"Is this specific behavioral assertion true?" — read-only, feeds confidence(code) as Evidence |
agents/shared/rules/verification-receipt.md (pr-reviewer Tier 2/3) |
| Change-verification |
"Did this applied change produce the expected green/red result?" — a post-apply gate |
bug-fix-verifier, feature-pr-verifier, aw-executor Phase 4 checks loop |
Both shapes share the same core: toolchain discovery, isolated execution, and the receipt format.
Only the output framing differs — see rules/receipt.md.
Mode Detection
Parse the first token of $ARGUMENTS.
| Mode |
Default |
Trigger |
What it does |
claim |
yes |
No mode token, or claim |
Verify one behavioral assertion. Returns a single receipt. Read-only. |
change |
|
First token change |
Verify a just-applied change against an expected outcome. Returns a green/red gate result with the same receipt shape underneath. |
Inputs
claim (claim mode) — the behavioral assertion in prose, e.g. "validateAuth throws on an invalid token."
target — the file(s) or symbol the claim or change concerns.
expected (change mode) — the expected post-change outcome (e.g. an expect: string from checks.yaml, or "the repro now passes").
review_relation — "self" | "cross" | "untrusted" (default "self" for a caller's own branch).
Governs the Tier 3 trust split — see rules/isolation-safety.md.
caller — the invoking agent or skill, for logging only.
The ladder (cheapest-first)
| Tier |
Name |
Cost |
Example tools |
| Tier 1 |
Syntactic |
Lowest |
grep, ast-grep, Read |
| Tier 2 |
Semantic-no-execution |
Low |
tsc --noEmit, go build/go vet/staticcheck, cargo check/clippy, pyright/mypy |
| Tier 3 |
Execution |
Highest |
Run the covering test, or synthesize and run a minimal repro |
Stop at the cheapest tier that can decide the claim — do not escalate to Tier 3 when Tier 1 or Tier 2 already confirms or contradicts it.
Full per-language mapping in rules/ladder.md.
Workflow
| Phase |
Name |
Rule file |
Gate |
| V1 |
Toolchain discovery |
rules/toolchain-discovery.md |
Discovery order resolved; never assume a global install |
| V2 |
Tier selection |
rules/ladder.md |
Cheapest tier that can decide the claim, per the per-language adapter table |
| V3 |
Isolated execution |
rules/isolation-safety.md |
Throwaway worktree (Tier 3), tracked files never modified, scratch deleted, relation-keyed trust split honored |
| V4 |
Receipt |
rules/receipt.md |
confirms/contradicts/ambiguous/null; null-is-never-confirmation invariant |
| V5 |
Report |
this file + rules/receipt.md |
Claim mode returns the receipt; change mode returns the receipt plus a green/red verdict |
V1 — Toolchain discovery
Resolve what to run before deciding how to run it: checks.yaml first, then the argent-environment-inspector detection pattern, then manifest scripts.
Never assume a tool is globally installed.
See rules/toolchain-discovery.md.
V2 — Tier selection
Walk the ladder Tier 1 → Tier 2 → Tier 3, stopping at the first tier that can decide the claim.
A claim about symbol absence or a missing guard is usually a Tier 1 grep.
A claim about a type contract is usually a Tier 2 typecheck.
A claim about runtime return value, thrown error, or side-effect ordering needs Tier 3.
See rules/ladder.md for the full per-language table.
V3 — Isolated execution
Tier 3 runs in a throwaway worktree, never touches tracked files, deletes its scratch harness after, defaults to no network, and never pipes a remote script into a shell.
Tier 3 is default-on only for the caller's own code (self relation); cross/untrusted callers need an explicit sandbox opt-in.
See rules/isolation-safety.md.
V4 — Receipt
Every run — regardless of tier or mode — produces a receipt: the raw command, its raw output, and one of four verdict tokens.
A null or empty result is dropped or contradicts; it is never read as confirmation.
See rules/receipt.md.
V5 — Report
- claim mode → return the receipt to the caller (typically
confidence(code) Evidence).
- change mode → return the receipt plus a green/red verdict against the caller-supplied
expected outcome.
The caller keeps its own grading semantics on top (e.g. checks.yaml's expect: comparison, FAIL_TO_PASS).
Required Reading by Phase
Load on demand — do not preload.
Core Principles
- Cheapest-first, always. Never reach for Tier 3 when Tier 1 or Tier 2 already decides the claim.
- Never assume a global install. Discover the project's actual toolchain before running anything (
rules/toolchain-discovery.md).
- Isolation is not optional for Tier 3. A throwaway worktree, no tracked-file mutation, scratch cleanup, no network by default, never
curl | sh (rules/isolation-safety.md).
- Trust is relation-keyed, not caller-configurable. Tier 3 on cross/untrusted code requires an explicit sandbox opt-in; this is a hard safety boundary, not a tuning knob.
- Execute, never score. The receipt reports what happened; it never assigns a confidence number or a pass/fail grade against intent — that stays with the caller.
- Null is never confirmation. A non-reproducing Tier 3 repro or a clean Tier 2 build on a claim asserting a problem exists DROPS or contradicts the finding.
Anti-patterns (one-liners — full list in the rules)
- Escalating straight to Tier 3 for a claim a
grep could decide.
- Assuming
tsc/go/cargo/pyright is on PATH without checking the project's actual toolchain.
- Running Tier 3 in the working tree instead of a throwaway worktree.
- Running Tier 3 on cross/untrusted code without an explicit sandbox opt-in.
- Treating a null or empty Tier 3 result as confirming the claim.
- Returning a confidence score or a verdict against intent instead of a receipt.
Definition of Done
1---2name: verify-behavior3description: Owns a cheapest-first three-tier verification ladder — Tier 1 syntactic (grep / ast-grep / read), Tier 2 semantic-no-execution (typecheck / build / lint), Tier 3 execution (run the covering test, or a minimal synthesized repro) — and reports the result as an evidence receipt (confirms / contradicts / ambiguous / null). It never scores; `confidence(code)` owns the number. Two consumer shapes: claim-verification (read-only, feeds `confidence(code)`) and change-verification (post-apply green/red gate). Called by `verification-receipt.md` (pr-reviewer Tier 2/3), `bug-fix-verifier`, `feature-pr-verifier`, and the `aw-executor` Phase 4 checks loop. Use when a finding or a change needs executed proof, not just a plausible-sounding claim. Triggers on "verify this claim", "does this actually happen at runtime", "prove this behavior", "run this to confirm", "/verify-behavior".4license: MIT5---67# Verify Behavior89Given a behavioral claim about code, or a change that was just applied, decide **the cheapest way to get executed proof**, run it in isolation, and report the raw result as a receipt.1011This skill is the execution engine six-plus call sites in this repo used to hand-roll independently: "detect the toolchain, run something, read pass or fail."12It replaces the ad hoc version in each of those with one shared ladder.1314> **This `SKILL.md` is a thin index.** Detailed rules live in `rules/*.md` and load on demand.1516---1718## The execute-not-score boundary1920This skill **does not score** — it never assigns a confidence score and never grades pass/fail against an intent.21It runs a command, captures the raw output, and classifies the result against the *claim itself* as `confirms` / `contradicts` / `ambiguous` / `null`.2223- `confidence(code)` owns the number — this skill supplies sharper evidence to that gate, it does not replace it.24- A calling agent's own grading (e.g. `bug-fix-verifier`'s `FAIL_TO_PASS`, the `aw-executor` Phase 4 `expect` comparison) stays with the caller — this skill supplies the run-and-observe mechanic underneath that grading, not the grading itself.2526See [`rules/receipt.md`](./rules/receipt.md) for the full contract, including the hard invariant that a null or non-reproducing result **drops or contradicts** a finding and is never confirmation.2728---2930## The two consumer shapes3132| Shape | Question it answers | Consumers |33| --- | --- | --- |34| **Claim-verification** | "Is this specific behavioral assertion true?" — read-only, feeds `confidence(code)` as Evidence | `agents/shared/rules/verification-receipt.md` (pr-reviewer Tier 2/3) |35| **Change-verification** | "Did this applied change produce the expected green/red result?" — a post-apply gate | `bug-fix-verifier`, `feature-pr-verifier`, `aw-executor` Phase 4 checks loop |3637Both shapes share the same core: toolchain discovery, isolated execution, and the receipt format.38Only the output framing differs — see [`rules/receipt.md`](./rules/receipt.md).3940---4142## Mode Detection4344Parse the **first token** of `$ARGUMENTS`.4546| Mode | Default | Trigger | What it does |47| --- | --- | --- | --- |48| `claim` | **yes** | No mode token, or `claim` | Verify one behavioral assertion. Returns a single receipt. Read-only. |49| `change` | | First token `change` | Verify a just-applied change against an expected outcome. Returns a green/red gate result with the same receipt shape underneath. |5051## Inputs5253- `claim` (claim mode) — the behavioral assertion in prose, e.g. "`validateAuth` throws on an invalid token."54- `target` — the file(s) or symbol the claim or change concerns.55- `expected` (change mode) — the expected post-change outcome (e.g. an `expect:` string from `checks.yaml`, or "the repro now passes").56- `review_relation` — `"self"` | `"cross"` | `"untrusted"` (default `"self"` for a caller's own branch).57 Governs the Tier 3 trust split — see [`rules/isolation-safety.md`](./rules/isolation-safety.md).58- `caller` — the invoking agent or skill, for logging only.5960## The ladder (cheapest-first)6162| Tier | Name | Cost | Example tools |63| --- | --- | --- | --- |64| Tier 1 | Syntactic | Lowest | `grep`, `ast-grep`, `Read` |65| Tier 2 | Semantic-no-execution | Low | `tsc --noEmit`, `go build`/`go vet`/`staticcheck`, `cargo check`/`clippy`, `pyright`/`mypy` |66| Tier 3 | Execution | Highest | Run the covering test, or synthesize and run a minimal repro |6768Stop at the cheapest tier that can **decide** the claim — do not escalate to Tier 3 when Tier 1 or Tier 2 already confirms or contradicts it.69Full per-language mapping in [`rules/ladder.md`](./rules/ladder.md).7071## Workflow7273| Phase | Name | Rule file | Gate |74| --- | --- | --- | --- |75| V1 | Toolchain discovery | [`rules/toolchain-discovery.md`](./rules/toolchain-discovery.md) | Discovery order resolved; never assume a global install |76| V2 | Tier selection | [`rules/ladder.md`](./rules/ladder.md) | Cheapest tier that can decide the claim, per the per-language adapter table |77| V3 | Isolated execution | [`rules/isolation-safety.md`](./rules/isolation-safety.md) | Throwaway worktree (Tier 3), tracked files never modified, scratch deleted, relation-keyed trust split honored |78| V4 | Receipt | [`rules/receipt.md`](./rules/receipt.md) | `confirms`/`contradicts`/`ambiguous`/`null`; null-is-never-confirmation invariant |79| V5 | Report | this file + [`rules/receipt.md`](./rules/receipt.md) | Claim mode returns the receipt; change mode returns the receipt plus a green/red verdict |8081### V1 — Toolchain discovery8283Resolve what to run before deciding how to run it: `checks.yaml` first, then the `argent-environment-inspector` detection pattern, then manifest scripts.84Never assume a tool is globally installed.85See [`rules/toolchain-discovery.md`](./rules/toolchain-discovery.md).8687### V2 — Tier selection8889Walk the ladder Tier 1 → Tier 2 → Tier 3, stopping at the first tier that can decide the claim.90A claim about symbol absence or a missing guard is usually a Tier 1 grep.91A claim about a type contract is usually a Tier 2 typecheck.92A claim about runtime return value, thrown error, or side-effect ordering needs Tier 3.93See [`rules/ladder.md`](./rules/ladder.md) for the full per-language table.9495### V3 — Isolated execution9697Tier 3 runs in a throwaway worktree, never touches tracked files, deletes its scratch harness after, defaults to no network, and never pipes a remote script into a shell.98Tier 3 is default-on only for the caller's own code (`self` relation); cross/untrusted callers need an explicit sandbox opt-in.99See [`rules/isolation-safety.md`](./rules/isolation-safety.md).100101### V4 — Receipt102103Every run — regardless of tier or mode — produces a receipt: the raw command, its raw output, and one of four verdict tokens.104A null or empty result is dropped or contradicts; it is never read as confirmation.105See [`rules/receipt.md`](./rules/receipt.md).106107### V5 — Report108109- **claim mode** → return the receipt to the caller (typically `confidence(code)` Evidence).110- **change mode** → return the receipt plus a green/red verdict against the caller-supplied `expected` outcome.111 The caller keeps its own grading semantics on top (e.g. `checks.yaml`'s `expect:` comparison, `FAIL_TO_PASS`).112113## Required Reading by Phase114115Load on demand — do not preload.116117| Phase | Files |118| --- | --- |119| V1 | [`rules/toolchain-discovery.md`](./rules/toolchain-discovery.md) |120| V2 | [`rules/ladder.md`](./rules/ladder.md) |121| V3 | [`rules/isolation-safety.md`](./rules/isolation-safety.md) |122| V4, V5 | [`rules/receipt.md`](./rules/receipt.md) |123| wiring | [`agents/shared/rules/verification-receipt.md`](../../../agents/shared/rules/verification-receipt.md) — how `pr-reviewer` calls this skill |124| diagnose | [`rules/diagnostic-surface.md`](./rules/diagnostic-surface.md) |125126## Core Principles1271281. **Cheapest-first, always.** Never reach for Tier 3 when Tier 1 or Tier 2 already decides the claim.1292. **Never assume a global install.** Discover the project's actual toolchain before running anything (`rules/toolchain-discovery.md`).1303. **Isolation is not optional for Tier 3.** A throwaway worktree, no tracked-file mutation, scratch cleanup, no network by default, never `curl | sh` (`rules/isolation-safety.md`).1314. **Trust is relation-keyed, not caller-configurable.** Tier 3 on cross/untrusted code requires an explicit sandbox opt-in; this is a hard safety boundary, not a tuning knob.1325. **Execute, never score.** The receipt reports what happened; it never assigns a confidence number or a pass/fail grade against intent — that stays with the caller.1336. **Null is never confirmation.** A non-reproducing Tier 3 repro or a clean Tier 2 build on a claim asserting a problem exists DROPS or contradicts the finding.134135## Anti-patterns (one-liners — full list in the rules)136137- Escalating straight to Tier 3 for a claim a `grep` could decide.138- Assuming `tsc`/`go`/`cargo`/`pyright` is on `PATH` without checking the project's actual toolchain.139- Running Tier 3 in the working tree instead of a throwaway worktree.140- Running Tier 3 on cross/untrusted code without an explicit sandbox opt-in.141- Treating a null or empty Tier 3 result as confirming the claim.142- Returning a confidence score or a verdict against intent instead of a receipt.143144## Definition of Done145146- [ ] Toolchain discovered per the documented order, never assumed global.147- [ ] Cheapest deciding tier used; no unnecessary Tier 3 escalation.148- [ ] Tier 3 (if run) executed in isolation, tracked files untouched, scratch deleted.149- [ ] Trust split honored — Tier 3 gated by `review_relation`.150- [ ] Receipt returned with a verdict token; null/contradicting results dropped, never confirmed.151- [ ] No confidence score or intent-grade emitted by this skill itself.