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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ All notable changes to this project are documented here. The format follows

## Unreleased

### Changed

- `probbit live` (and `persona turn`) on a persona with `reward_from`: a reward without `src` is still refused (exit 2),
and the error now names the missing field `src`, lists the kinds `reward_from` allows and shows one line that is
accepted, e.g. `{"praise":true,"src":"env"}`. docs/persona.md §5.7 and the agent-harness README show `live` commands
with `src` for the shipped dispatch policy and an agent-harness persona; the three declare the same `reward_from`.
A goal win's example line shows a win the persona accepts (1, or `drives.expectation.win_max` when that is below 1).

### Fixed

- `bench/agentdojo/experiments/rerun.sh` stops at once (exit 2) with the exact `tar xzf tables/strands-A.tar.gz` command
when `strands/A` does not hold all 726 arm-A strands; before, E5 failed 0/726 and the tables differed.

### Documentation

- docs/persona.md §5.6 and the cheatsheet: under `on_conflict: yield`, a habit tested alone can be `unknown` to `prove`
and get a `fuzz` counterexample with `habits.violations: 0` and the habit in `habits.yielded` (the shipped tutor's
`after_error_check`, seeds 0-19); read `violations` and `yielded`, not only the verdict.
- docs/persona.md §2.8 and USE-CASES: mapping raw task success onto praise and criticism moves every learned trait with
one sign, so one global preference smears over all of them; a caution from the learning step, not a measured result.

## 0.15.0 - 2026-11-18

0.15.0 adds `probbit explain STRAND --event N`, a read-only receipt for one logged event, recomputed through the same
Expand Down
3 changes: 3 additions & 0 deletions USE-CASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Do not use it when:
- **you need raw search speed on a known puzzle class.** Backtracking counts sudoku solutions 15-102x faster per puzzle than probbit's
exact tier, and probbit's sampler refuses every generated sudoku (20/20; in the current build a puzzle that naked singles solve passes the gate (`diagnostics_passed`), §4).
- **you need the best cut or lowest energy.** Simulated annealing found better max-cuts at equal time (§3).
- **you plan to pay every learned trait with raw task success.** Mapped onto praise and criticism, its one sign moves every trait
the learning block names, so one global preference smears over all of them *(inferred)*: learn only the traits the feedback
judges ([docs/persona.md](docs/persona.md) §2.8).

## Catalogue by problem shape

Expand Down
8 changes: 8 additions & 0 deletions bench/agentdojo/experiments/rerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
# PYTHON=<python> experiments/rerun.sh runs an interpreter outside that range with a warning instead of a refusal.
set -euo pipefail
cd "$(dirname "$0")/.."
# E5 replays the 726 arm-A strands; without them every replay fails and E5 reads 0/726. Stop before any table is written.
want=$(tar tzf tables/strands-A.tar.gz | grep -c '\.strand$')
have=0; [ -d strands/A ] && have=$(find strands/A -name '*.strand' | wc -l | tr -d ' ')
if [ "$have" != "$want" ]; then
echo "stopped: strands/A holds $have of the $want arm-A strands that E5 replays. Extract them first, in $(pwd):" >&2
echo " tar xzf tables/strands-A.tar.gz" >&2
exit 2
fi
PY="${PYTHON:-${1:-venv011/bin/python}}"
# numpy 1.26.4 has wheels for CPython 3.9 to 3.12 only; a source build on 3.14 shifted three bars.tsv cells.
pyv=$("$PY" -c 'import sys; print("%d.%d" % sys.version_info[:2])') || { echo "cannot run $PY" >&2; exit 2; }
Expand Down
2 changes: 2 additions & 0 deletions docs/CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,6 @@ verdict}`, where `rules` is the `persona lint` document. In GitHub Actions: `use
- `lint`: contradicting habits; with `--props`, every rule proved or fuzzed;
- `fuzz`: "none found" is evidence over the scripts searched, not a proof;
- `prove`: `held by construction` (a habit implies it), `proved for every event sequence` (a sound bound) or `unknown`;
- with `on_conflict: yield`, a habit tested alone can be `unknown` and get a counterexample with `habits.violations: 0` and
the habit in `habits.yielded` (it gave way to a higher priority): read `violations` and `yielded`, not only the verdict;
- `live verify`: a strand replays byte for byte.
32 changes: 31 additions & 1 deletion docs/persona.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,15 @@ step 2), so the feedback turn's own stance already uses it. What learning can an
- A persona without the block has no `learned` or `credit` field, and every document it produces is the same, byte for byte,
as before the block existed.

**One sign for every learned trait.** The reward and the correction flags carry one sign for the whole turn, and each learned
trait the previous stance released steps with that sign, by its own credit. A host that maps raw task success onto them (a
passed task = praise, a failed one = criticism) therefore pushes every trait in `traits` toward the levels it happened to take
on passing turns and away from those it took on failing ones, whether or not that trait had anything to do with the
outcome: one global preference, smeared over every
trait the block names. This is a caution read from the step above, not a measured result. Scope the credit to what the
feedback judges: list in `traits` only the traits it is about, and with `learning.credit` (below) pay the decision the
outcome is about.

**Action-addressed feedback (`learning.credit`, optional).** Without it, feedback pays the previous stance. With it, the host
can name the decision an outcome is about, so a late or out-of-order outcome credits the stance the host acted on:

Expand Down Expand Up @@ -486,7 +495,7 @@ one of the kinds listed for that input; otherwise the event is **refused whole**
| the event | refused because |
|---|---|
| `{"praise": true, "src": "self"}` | a reward never comes from the individual itself |
| `{"praise": true}` | a reward needs a source |
| `{"praise": true}` | a reward needs a source (the error names the missing field `src` and shows one accepted line) |
| `{"goals": {"fun": {"win": 1}}, "src": "clock"}` | a source the persona does not list for it |
| `{"praise": true, "src": "human:"}` | a malformed source |

Expand Down Expand Up @@ -1441,6 +1450,17 @@ program leaves the exact tiers is `unknown`. `held by construction` relies on ev
every rule in force. A rule with raw `rules` (not `then`) is fuzzed but not proved. The bound is per cell with the moods at
the edges of their box, so a soft rule whose margin is small stays `unknown` even when no script breaks it.

**A habit that yields is not a broken habit.** Under `on_conflict: yield` (section 5.5) a lower-priority habit gives way on
a turn where it cannot hold together with a higher one. Test such a habit alone as a rule and `prove` can say `unknown` and
`fuzz` can print a counterexample whose stance has `habits.violations: 0` and the habit in `habits.yielded`. The shipped
tutor shows it: its `after_error_check` as `--never '{when: {error: true}, then: {caution: {at_least: prev+1}, verbosity:
{at_most: prev-1}}}'` is `unknown` to `prove` for seeds 0-19 (exit 1), and `fuzz` finds a 2-event counterexample on each of
those seeds (exit 1): the second event is a confused learner and an error at once, `confused_no_playful` (priority 10) wins,
and the stance says `"yielded":["after_error_check"]` and `"escalate":"habit conflict resolved by priority: after_error_check
yielded"`. Read `violations` and `yielded` in the counterexample's stance (`replay` prints it, `fuzz --json` has it under
`shortest.stance.habits`), not only the verdict: `violations` above 0 is a broken habit, a name in `yielded` is the priority
the persona declared.

**With a drives block** (section 2.9). A rule may name `pursue` in `then` and, in `when`, the goal conditions the persona's
habits use (the same goal, signal and range). `fuzz` adds goal signals to its events: per goal a win on `--grid` x `win_max`,
a cue, a deadline on each `--hours` value. `prove` reads the drives as boxes: the aggregates as number inputs over their whole
Expand Down Expand Up @@ -1530,6 +1550,16 @@ inputs as given, `goals` included, and `verify` replays them.
the previous stance took (section 2.8), never past ±total_cap per level. Without a block nothing learns, and every stance and
state is the one `persona turn` gives.

**Sources.** A persona with `reward_from` (section 2.10) needs `src` on every event whose reward is on. The shipped
`examples/persona/dispatch-policy.yaml` allows `human` or `env`, and the three `examples/agent-harness/` personas allow `env`:

```sh
printf '%s\n' '{"error":true}' '{"praise":true,"src":"env"}' | probbit live examples/persona/dispatch-policy.yaml --seed 2 --clock fixed
printf '%s\n' '{"praise":true,"src":"env"}' | probbit live examples/agent-harness/adaptive.json --seed 2 --clock fixed
```

Without it the event is refused (exit 2), and the error names the field and shows one line that is accepted.

**What never changes.** Genes, priors, couplings, input effects, history features, habits and every trait's allowed levels. The
learner's whole output is the Δ table, and habits are rules of every compiled program (section 3, step 6), so every stance obeys
every habit in force whatever Δ is: rule immunity is architectural, not trained or measured into it, and `prove` (section 5.6)
Expand Down
4 changes: 4 additions & 0 deletions examples/agent-harness/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ and Windows.

## Replaying generated counterexamples

The three personas here declare `reward_from: [env]`, so an event with `praise` on needs `"src":"env"`
(`echo '{"praise":true,"src":"env"}' | ./target/release/probbit live examples/agent-harness/adaptive.json --clock fixed`);
without it `probbit live` refuses the event (exit 2) and names the missing field.

When `reward_from` requires a source, fuzz searches an abstract accepted-source history.
It must not silently label that history as a production observation. Explicitly authorize
a synthetic fixture source when exporting a runnable counterexample:
Expand Down
32 changes: 31 additions & 1 deletion llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,15 @@ step 2), so the feedback turn's own stance already uses it. What learning can an
- A persona without the block has no `learned` or `credit` field, and every document it produces is the same, byte for byte,
as before the block existed.

**One sign for every learned trait.** The reward and the correction flags carry one sign for the whole turn, and each learned
trait the previous stance released steps with that sign, by its own credit. A host that maps raw task success onto them (a
passed task = praise, a failed one = criticism) therefore pushes every trait in `traits` toward the levels it happened to take
on passing turns and away from those it took on failing ones, whether or not that trait had anything to do with the
outcome: one global preference, smeared over every
trait the block names. This is a caution read from the step above, not a measured result. Scope the credit to what the
feedback judges: list in `traits` only the traits it is about, and with `learning.credit` (below) pay the decision the
outcome is about.

**Action-addressed feedback (`learning.credit`, optional).** Without it, feedback pays the previous stance. With it, the host
can name the decision an outcome is about, so a late or out-of-order outcome credits the stance the host acted on:

Expand Down Expand Up @@ -1521,7 +1530,7 @@ one of the kinds listed for that input; otherwise the event is **refused whole**
| the event | refused because |
|---|---|
| `{"praise": true, "src": "self"}` | a reward never comes from the individual itself |
| `{"praise": true}` | a reward needs a source |
| `{"praise": true}` | a reward needs a source (the error names the missing field `src` and shows one accepted line) |
| `{"goals": {"fun": {"win": 1}}, "src": "clock"}` | a source the persona does not list for it |
| `{"praise": true, "src": "human:"}` | a malformed source |

Expand Down Expand Up @@ -2476,6 +2485,17 @@ program leaves the exact tiers is `unknown`. `held by construction` relies on ev
every rule in force. A rule with raw `rules` (not `then`) is fuzzed but not proved. The bound is per cell with the moods at
the edges of their box, so a soft rule whose margin is small stays `unknown` even when no script breaks it.

**A habit that yields is not a broken habit.** Under `on_conflict: yield` (section 5.5) a lower-priority habit gives way on
a turn where it cannot hold together with a higher one. Test such a habit alone as a rule and `prove` can say `unknown` and
`fuzz` can print a counterexample whose stance has `habits.violations: 0` and the habit in `habits.yielded`. The shipped
tutor shows it: its `after_error_check` as `--never '{when: {error: true}, then: {caution: {at_least: prev+1}, verbosity:
{at_most: prev-1}}}'` is `unknown` to `prove` for seeds 0-19 (exit 1), and `fuzz` finds a 2-event counterexample on each of
those seeds (exit 1): the second event is a confused learner and an error at once, `confused_no_playful` (priority 10) wins,
and the stance says `"yielded":["after_error_check"]` and `"escalate":"habit conflict resolved by priority: after_error_check
yielded"`. Read `violations` and `yielded` in the counterexample's stance (`replay` prints it, `fuzz --json` has it under
`shortest.stance.habits`), not only the verdict: `violations` above 0 is a broken habit, a name in `yielded` is the priority
the persona declared.

**With a drives block** (section 2.9). A rule may name `pursue` in `then` and, in `when`, the goal conditions the persona's
habits use (the same goal, signal and range). `fuzz` adds goal signals to its events: per goal a win on `--grid` x `win_max`,
a cue, a deadline on each `--hours` value. `prove` reads the drives as boxes: the aggregates as number inputs over their whole
Expand Down Expand Up @@ -2565,6 +2585,16 @@ inputs as given, `goals` included, and `verify` replays them.
the previous stance took (section 2.8), never past ±total_cap per level. Without a block nothing learns, and every stance and
state is the one `persona turn` gives.

**Sources.** A persona with `reward_from` (section 2.10) needs `src` on every event whose reward is on. The shipped
`examples/persona/dispatch-policy.yaml` allows `human` or `env`, and the three `examples/agent-harness/` personas allow `env`:

```sh
printf '%s\n' '{"error":true}' '{"praise":true,"src":"env"}' | probbit live examples/persona/dispatch-policy.yaml --seed 2 --clock fixed
printf '%s\n' '{"praise":true,"src":"env"}' | probbit live examples/agent-harness/adaptive.json --seed 2 --clock fixed
```

Without it the event is refused (exit 2), and the error names the field and shows one line that is accepted.

**What never changes.** Genes, priors, couplings, input effects, history features, habits and every trait's allowed levels. The
learner's whole output is the Δ table, and habits are rules of every compiled program (section 3, step 6), so every stance obeys
every habit in force whatever Δ is: rule immunity is architectural, not trained or measured into it, and `prove` (section 5.6)
Expand Down
2 changes: 1 addition & 1 deletion probbit-cli/src/live.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ mod tests {
fn rewards_from_the_individual_itself_are_refused() {
let (p, doc) = kit(Some(r#"["human","env"]"#));
let (mut lv, _) = Live::start(p.clone(), &doc, persona::init(&p, Some(2), true, &run), Clock::Fixed, "t");
for (e, why) in [(r#"{"praise":true,"src":"self"}"#, "from the individual itself"), (r#"{"praise":true}"#, "needs a src"), (r#"{"criticism":true,"src":"clock"}"#, "from clock"),
for (e, why) in [(r#"{"praise":true,"src":"self"}"#, "from the individual itself"), (r#"{"praise":true}"#, "missing the field `src`"), (r#"{"criticism":true,"src":"clock"}"#, "from clock"),
(r#"{"goals":{"fun":{"win":0.5}},"src":"self"}"#, "goals.fun.win from the individual"), (r#"{"praise":true,"src":"human:"}"#, "a source"), (r#"{"src":7}"#, "a source")] {
let err = lv.event(&json::parse(e).unwrap(), &run).unwrap_err(); assert_eq!(err.path, "inputs.src", "{e}"); assert!(err.msg.contains(why), "{e}: {}", err.msg); }
assert_eq!(lv.n, 0, "a refused event changes nothing");
Expand Down
17 changes: 17 additions & 0 deletions probbit-cli/tests/persona.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,23 @@ fn src_without_reward_from_gives_0_8_0_bytes() {
for f in [&script, &st, &sd, &guarded, &gs] { let _ = std::fs::remove_file(f); }
}

/// The six shipped personas with `reward_from` (the dispatch policy, sensed, pacer and the three agent-harness personas): a
/// praise without `src` (and on pacer a goal win without it) exits 2 with an error that names the field and shows one accepted
/// line; that line, as shown, exits 0.
#[test]
fn reward_without_src_names_the_field() {
let praise = "{\"praise\":true}";
for (p, ev) in [("persona/dispatch-policy.yaml", praise), ("persona/sensed.yaml", praise), ("persona/pacer.yaml", praise),
("persona/pacer.yaml", "{\"goals\":{\"task\":{\"win\":1}}}"), ("agent-harness/adaptive.json", praise), ("agent-harness/addressed.json", praise),
("agent-harness/guarded.json", praise)] {
let p = format!("{}/../examples/{p}", env!("CARGO_MANIFEST_DIR"));
let (c, _, e) = probbit(&["live", &p, "--seed", "2", "--clock", "fixed"], &format!("{ev}\n")); assert_eq!(c, 2, "{p}: {e}");
assert!(e.contains("missing the field `src`"), "{p}: {e}");
let line = e.split("one line that is accepted: ").nth(1).and_then(|r| r.lines().next()).unwrap_or_else(|| panic!("{p}: {e}"));
let (c, _, e) = probbit(&["live", &p, "--seed", "2", "--clock", "fixed"], &format!("{line}\n")); assert_eq!(c, 0, "{p}: {line}: {e}");
}
}

/// The safety kit through the CLI: `--checkpoint-every` writes checkpoint lines that `verify` and `verify --from-checkpoint`
/// check; `live control` pauses (every event refused, exit 4, nothing written), resumes and retires (final); the individual cannot
/// control itself; a held lock refuses a second writer and a control line (exit 4) and changes nothing; no lock is left behind
Expand Down
Loading
Loading