Skip to content

fix(cli): no panic on a malformed strand header; explain lists wrapped readings - #95

Draft
BitmapAsset wants to merge 6 commits into
fix/plugin-checkpoint-tailfrom
fix/explain-header-hardening
Draft

BitmapAsset wants to merge 6 commits into
fix/plugin-checkpoint-tailfrom
fix/explain-header-hardening

Conversation

@BitmapAsset

Copy link
Copy Markdown
Owner

Two fixes to how probbit live verify and probbit explain answer damaged or unusual strands, a test that damages a
strand one place at a time, and the documented exit codes of explain. No change to strand formats, digests or the
output for a healthy strand.

Stacked on #94 (fix/plugin-checkpoint-tail).

  • No panic on a non-ASCII persona digest (probbit-persona/src/persona.rs). When a state's persona.digest does
    not match the persona, the error message showed its first 19 bytes. A digest with a multi-byte character at that
    offset (for example ten é) made live verify and explain panic (exit 101). The message now cuts by
    characters; both commands exit 1 and name the mismatch (live verify and explain --json print it as a JSON
    document). This was in 0.14.0 too.
  • A bounded no-panic sweep (probbit-cli/tests/damaged.rs). The test writes a small strand with the engine (the
    sensed example's first 3 events, a checkpoint after the 2nd: 5 lines) and makes every variant with one damage: each
    string value of each line set to ten é, to "" and to "x", and each line cut in the middle. That is 467
    variants; each goes through live verify, explain --event 1 and explain --event 3 (1,401 runs, about 7 seconds
    on a debug build). Every run must exit 0, 1, 2 or 5 with one JSON document on stdout; a run that panics, dies of a
    signal or takes longer than 20 seconds fails the test. The variant count is capped at 600 with an even stride. With
    the digest fix reverted the sweep reports exactly three failures, all the panic above; with it, none.
  • explain lists wrapped Boolean sense readings (probbit-cli/src/explain.rs). A reading may be bare
    ("tool_fail": true) or wrapped ({"v": true, "src": "env:runner"}, docs/persona.md section 2.11; v and src are
    the only keys the engine accepts). explain looked for a key value, so a wrapped Boolean was missing from
    flags. It reads v now; a test checks both forms and fails without the fix.
  • explain's exit codes as they behave (CHANGELOG, docs/CHEATSHEET.md). 1: the selected event, or a line before
    it, does not recompute, as live verify reports it (a changed digest, a broken chain, inputs of an earlier event
    that the engine rejects, a damaged copy of the sealing line in a segment file). 2: a bad flag or out-of-range
    --event, an unreadable file, a line that is not JSON or an event line without its fields, or inputs of the
    selected event that the engine rejects. The behaviour is unchanged; the text said "1 differs, 2 bad input". The
    command's help lists no exit codes, so the help and the man page are unchanged.

Validation on the host (macOS arm64), run on this branch's Rust code and tests before its last rebase (the rebase
changed only the plugin below it, in #94):

  • Rust cargo test --offline -p probbit-cli: 308 passed, 0 failed, 3 ignored (305 before; 3 new tests).
  • Rust cargo test --offline -p probbit-persona: 81 passed, 0 failed, 1 ignored (at the commit with the digest fix;
    later commits touch no persona code).
  • Plugin npm test against this branch's release build: 165 tests (from fix(openclaw): read a strand's tail past checkpoint lines; pause a sealed lane #94); the only failures seen were the known 500 ms
    spawn-budget timing tests.
  • scripts/generate_llms_full.py --check passes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant