Skip to content

v1.1: formal-verification findings and fixes - #4

Merged
gabehamilton merged 38 commits into
mainfrom
gabehamilton/v1.1-verification-findings
Nov 14, 2026
Merged

gabehamilton merged 38 commits into
mainfrom
gabehamilton/v1.1-verification-findings

Conversation

@gabehamilton

@gabehamilton gabehamilton commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An outside verification (difflabai/formalver, draft PR #31, projects/shared-pool/ at b9c495b) checked this contract at a4bb5c3. The core, contract and executor there are byte-identical to v1.0.0 (80fb89e), so every finding applies to v1.0.0.

This PR documents the findings and fixes them as v1.1.0. Each fix commit rewrites the test that pinned its finding into a regression test of the fixed behaviour. The repository owner has answered the four questions below. Question 4 adds a change to the synthetic executor (4d69f19 to cc0e95c).

Not re-verified. The formal results (TLA+, Lean, Prolog, conformance traces) apply to v1.0.0. v1.1.0 has not been formally re-verified. Its fixes are checked by unit tests, seeded random tests and the sandbox suite in this repository.

Owner decisions

Questions 1 to 3 came from the design's open questions; question 4 came up in review. The repository owner answered all four.

  1. Record window (F-3), commit 1f01d43: accepted as implemented. v1.0.0 chose "256 lifetime commitments, no pruning, rotate the deployment". v1.1.0 keeps a window of the 256 most recent records and prunes the oldest once it is terminal; older history stays in the event log. The cost stays: while the oldest retained record is open, submit fails Full, even if the other 255 are terminal (see Known limits).
  2. Stricter admission (F-1, F-2), commit 59e404f: accepted as implemented. In a disturbed state a reservation can no longer reduce a violated metric; only a completion can. A request that is in bounds only while another open record's reservation stays in place is refused. In the risk fixture, with one credit position open, the largest admitted selloff hedge is 6 units, not 8.
  3. Owner as executor (F-4), commit dc774f8: the owner may be a recipe's executor. This is the owner's decision, not an open question. v1.1.0 rejects only a recipe whose actor is its executor; there is no code change. The README, the findings page, the judges' guide and the CHANGELOG say so (171a65f).
  4. Executor job cap: implemented in 4d69f19 (code, unit tests), 4e1a4e1 (sandbox test), b954c50 and e583781 (gas), and e0aad49 and 171a65f (docs); review fixes in 765465b (doc comments and unit tests; the Wasm is unchanged) and cc0e95c (docs). finish and confirm_not_executed still record the job's outcome first and then call the lock's settle. They now chain a new private callback, on_settled, to that call. If the lock accepted, on_settled raises the executor's newest id, as execute does, and the executor forgets every job 256 or more behind it. An accepted settle proves the lock held that record, so it has pruned every id 256 or more below. The transaction's outcome is unchanged: both methods still return the lock's settle, so a refusal still reports the lock's error (such as NotFound). A confirmation the lock refuses changes nothing else and keeps its job (see Known limits). The executor gains three imports (promise_result, promise_results_count, promise_then; 16 in all), and finish and confirm_not_executed now need 70 Tgas attached.

Please merge with a merge commit, not a squash. The findings page cites the commits of this PR by hash.

Findings and fixes

ID Severity Fix Commit
F-1 high Admission counts every outcome of every open record (stay open, complete, release) and compares each metric's interval violation with the smaller of its violation before and after the reservation. Every open record can be resolved. 59e404f
F-2, F-2b high Same change. A hedge must stay in bounds if the position it would offset is reported unexecuted; a release stays inside the value range. 59e404f
F-3 low Window of the 256 most recent records (question 1, accepted). The synthetic executor forgets a job once the newest id the lock vouched for, by an execute that created a job or an accepted settle, is 256 or more past it (question 4). 1f01d43, 4d69f19
F-4 low new rejects a recipe whose actor is its executor (InvalidConfig). The owner may be an executor (owner's decision). dc774f8
F-5 low Submit, dispatch, pause and observe stop at VERSION_CAP = u32::MAX - 768; acknowledgment, settlement and cancellation always remain available. da43188
F-6 low The owner can restate the current values at any time, which renews the snapshot. 3eaf1cb
NT-F1 medium (diagnostics) build.sh sets --cfg near and fails if a Wasm does not import env.panic_utf8. effd174
NT-F2 low reconcile rejects a deposit. 1d441c5
NT-F3 informational Low-level promises; the 15 action imports are gone. build.sh fails on any import outside the reviewed list (18 contract, 16 executor). 3598902, 2a1506c, 4d69f19
NT-F4 low on_result reads the raw result; anything but one JSON string of at most 64 bytes becomes Unknown. Tested on the mock runtime and, through a hand-made Wasm executor, in the sandbox. 1d441c5, d9f6605
div-cancel, div-ack docs vs code Cancel of a Completed record fails InvalidState; the ack no-op is documented. 138ef98

What changes for callers

  • Admission is stricter (question 2, accepted). Any request the new bounds check admits, the v1.0.0 check admitted too. The only admissions v1.1.0 adds are past 256 records (the window).
  • Record window (question 1, accepted). get_pool gains first_id and completed_units. get_commitments.from is an id. A pruned id is NotFound, including a repeated executor settle (v1.0.0 returned Ok).
  • cancel of a Completed record fails InvalidState (was Pending).
  • At VERSION_CAP, submit, dispatch, set_paused and observe fail Arithmetic; preview reports it.
  • new rejects actor == executor. The owner may still be a recipe's executor (question 3).
  • Synthetic executor (question 4). It forgets a job once its id is 256 or more behind its newest id: the largest id for which the lock's execute created a job, or whose settle from this executor the lock accepted. An execute of an id that already has a job (a repeat, or a confirmation's) returns the stored status and moves nothing. The new private callback on_settled({id}) records the second kind; only the executor itself can call it. execute of a forgotten id returns "cancelled"; confirm_not_executed of one fails stale id; finish fails unknown job. At most 512 jobs. finish and confirm_not_executed attach 40 Tgas to the lock's settle and 10 to on_settled; attach 70 Tgas to them.
  • dispatch, reconcile, finish and confirm_not_executed return () in Rust; on chain the result is still that of the promise each returns: on_result for dispatch and reconcile, the lock's settle for finish and confirm_not_executed.
  • Storage: Pool +2 fields, executor +1. A v1.0.0 deployment cannot be upgraded in place; deploy fresh accounts (no migration, nothing is deployed). Event shapes and the event format version (1.0.0) are unchanged.

Known limits

  • Head-of-line Full from the window (question 1, accepted): while the oldest retained record is dispatched and its executor stays silent, submit fails Full.
  • Executor job cap. Job ids are distinct, so at most 256 jobs have ids at or below the newest id, and honest use holds at most 256 jobs plus confirmations in flight. The cap of 512 needs at least 256 jobs above the newest id (more if fewer sit at or below it): confirmations the lock refused, or confirmations whose on_settled has not run. The lock refuses a confirmation of an unassigned or pruned id (NotFound), of a record still Reserved (InvalidState), of one whose other outcome is recorded (InvalidState), or of another executor's recipe (Unauthorized). Such a job is forgotten only once the newest id is 256 or more past its id.
    • A typo of a far id (1000000, u32::MAX) keeps its job for good: no executor method removes a job, so only replacing the executor account's state clears it.
    • A confirmation of a still-Reserved record pre-cancels that record: the lock cancels it when it is dispatched. After that, finish(id, false) is accepted and moves the newest id (tested in the sandbox).
    • With enough refused jobs, confirm_not_executed fails full. If executes then keep failing, the wedge described in docs/api.md (Executor protocol) can still form: their records stay Unknown, and once one of them is the oldest of 256, submit fails Full. The exits are as in docs/api.md: a settle signed with the executor account's key, or an accepted finish(id, false) of a refused job whose record the lock now holds as cancelled or open.
    • If an on_settled ran out of gas, the newest id would not move for that id until the lock accepts or executes a higher one. RES-1 measured on_settled at 3.68 of its 10 Tgas with 512 jobs.
  • No rollback is the implementer's choice, for the owner to weigh. The executor cannot tell why the lock refused a settle (a failed promise result carries no reason). Removing the job on a refusal would drop the executor's evidence on any failed settle, a gas failure included, although the spec has it store terminal evidence before notifying the lock so a failed notification can be reconciled later. If you prefer it, a callback that removes the job when the lock refuses a confirmation is a contained follow-up: removing jobs does not weaken the argument that a forgotten id was pruned. A production adapter needs its own retention rule.

Gas

docs/api.md now has a gas table, measured on the v1.1.0 Wasm in near-sandbox 2.13.4 at the largest state (32 metrics, 64 terms, 32 recipes, 256 retained records: all open for dispatch and reconcile, 251 to 254 for the executor calls). For finish the executor held 256 jobs, and then 512, its cap. Each Attach figure is a round number at least 10 Tgas above the least that succeeded. The test is crates/sandbox/tests/res1.rs. It takes about eight minutes, so scripts/sandbox.sh skips it; run it with cargo test -p pool-sandbox --locked --test res1 -- --ignored --nocapture after scripts/build.sh.

Call Least that succeeded Attach
dispatch 70 Tgas 100 Tgas
reconcile 46 Tgas 60 Tgas
executor finish, confirm_not_executed 55 Tgas (confirm_not_executed with 254 jobs, finish with 256); finish with 512 jobs: 56 70 Tgas
submit, cancel, settle, observe, set_paused largest receipt 14.81 Tgas 30 Tgas

confirm_not_executed was not swept near the cap; its executor receipt from 511 to 512 jobs burnt 4.39 Tgas, the same as finish's with 512 jobs, so count on 56 for both there. These were first measured with a scratch copy of the test; the in-repo test reproduced every figure and added the 512-job ones. Question 4 changed the executor, so RES-1 was re-run at b954c50: dispatch, reconcile and the largest receipt are unchanged, and the executor calls need 12 Tgas more (they were 43 and 44, under an Attach of 60), because they now attach 10 Tgas to on_settled. The contract Wasm has not changed since 34ec9d4 (e6383aab...). The executor Wasm is b92f1469... from 4d69f19 (it was 72aea30b...); later commits do not change it.

Checks

  • scripts/check.sh (fmt, tests with and without default features, clippy -D warnings, node --check) passes after every commit. For question 4 it ran at 4d69f19, 4e1a4e1, b954c50, 171a65f and 765465b; e583781, e0aad49 and the head cc0e95c change only Markdown.
  • scripts/build.sh at b954c50 and at the head cc0e95c: 18 contract and 16 executor imports, the same two Wasm hashes (765465b changes only executor comments and tests, keeping every line above the tests in place, so no panic location moves). The previous allowlist (13 executor imports) fails on the new executor Wasm and names the three new imports.
  • scripts/sandbox.sh with near-sandbox 2.13.4: passes at 4e1a4e1 (5 tests, 507 s: six fixtures through the real gate; unknown outcomes, stale requests, reconcile and its deposit check; non-string executor results; a window of 300 records through the executor; and the new test that confirmed failed executes keep the executor at 256 jobs, with a refused confirmation, the private callback, and a Reserved record confirmed too early, then recovered with finish). Later commits change only comments, unit tests, the ignored RES-1 test and docs; both Wasm hashes are unchanged since 4d69f19.
  • Controls for the new sandbox test, on the host: with the previous executor (72aea30b...) it fails at "executor jobs after the confirmation of 256: 257 jobs"; with on_settled chained only for confirm_not_executed, it fails at "finish moved the newest id". Five unit mutations each fail the unit tests written for them: advance on a refused settle, a no-op callback, advance without forgetting, the callback only for confirmations, and rollback on a refusal. Two more for the review fixes: on_settled advancing only on an empty success, and execute advancing for an id that already has a job.
  • RES-1 (res1.rs, ignored by default): passes at b954c50 (524 s).
  • Not run: Kani, TLC, and the formalver suites on v1.1.0.

Next

  • Formal re-verification of v1.1.0 in formalver (re-pin, new invariants for the envelope, window and version reserve, and the executor's retention rule; the conformance trace format needs ids that do not equal record indices).
  • The owner's call on rolling back refused confirmations (Known limits).
  • Tag v1.1.0 after merge.

🤖 Generated with Claude Code

gabehamilton and others added 23 commits November 12, 2026 12:16
Add crates/core/src/findings.rs, a #[cfg(test)] module with one test per
core finding from the formalver verification (F-1, F-2, F-2b, F-3, F-4,
F-5, F-6) and one for the cancel error name (div-cancel-terminal-name).
Each test asserts what v1.0.0 returns today, including the faulty
results, so CI stays green and each v1.1 fix flips the test that pins it.
No non-test code changes; lib.rs only wires the module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/verification-findings.md lists the findings of the formalver
verification (difflabai/formalver PR #31): what happens, which doc line it
contradicts, a core call sequence, the reproducer test and where the
formal evidence lives. It also covers the docs-vs-code items, the measured
minimum prepaid gas at the maximum state, and the version u32::MAX
preview/submit observation. Linked from the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Trace 207 replays F-3 on a smaller config than the gpu fixture the
reproducer uses, so label it "(a smaller config)" as F-4 and F-6 already
do; the test doc comments for traces 207, 210 and 211 say the same.

The Evidence paragraphs cite TLC, Lean, Prolog, shell and sandbox results
from formalver strategy.md section 4. Say so, mark the per-trace equality
claims "reported", and state that only the findings.rs tests run here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… diff list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…error text (NT-F1)

scripts/build.sh now builds both Wasm files with RUSTFLAGS="--cfg near"
(and unsets CARGO_ENCODED_RUSTFLAGS). Without the flag near-sdk's
panic_str traps without calling panic_utf8, so every failed call lost
its error name. A small wasm import-section parser in the manifest step
fails the build unless each Wasm imports env.panic_utf8, and
artifacts/build.json records the flags and each Wasm's sorted imports.

The sandbox helper fail() takes the expected panic text and asserts the
failure carries it ("Pending", "Unauthorized", "only lock may execute",
"Method on_result is private"). Run against the v1.0.0 plain build it
fails on the bare unreachable trap, so it now catches NT-F1.

api.md deployment step 1 and the README build note describe the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1, F-2, F-2b)

envelope() now counts each open record's release (-reserve x units) as
well as its completion, and check_bounds compares each metric's interval
violation with min(violation now, violation at the candidate). Together
they keep every open record resolvable: a Reserved record can always be
cancelled, and a dispatched one settled either way.

Admission is stricter. A reservation that by itself cures a violated
metric is refused; recovery must come from completion. An admission that
is in bounds only while another record's reservation stays in place is
refused too. In the risk fixture a hedge next to an open credit position
is now at most 6 units, not 8.

findings.rs: the F-1, F-2 and F-2b reproducers become regression tests
(f1_hedge_that_cures_by_reservation_is_refused,
f1_recovery_by_completion_is_admitted_and_live,
f2_hedge_cannot_rely_on_an_unexecuted_position,
f2_reserved_position_can_always_be_cancelled,
f2b_release_stays_in_the_value_range). New assert_live helper and
live_all_on_random_runs: 300 seeded configs x 60 calls, checking after
every call LIVE, HARD-STEP, INV-RES, preview/submit agreement and atomic
errors. It fails on v1.0.0 and on either half of the fix alone.

Docs: spec admission, recovery, release and risk text; handoff RISK row,
new LIVE row and nuances; README boundary; implementation-plan steps 4-5.
Scenario exports are unchanged. Not formally re-verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Config::validate rejects a recipe whose actor is its executor
(InvalidConfig). Submit and dispatch need the actor; settle needs the
executor. With the two distinct, no account both starts and attests one
recipe's work. The owner may still be an actor or an executor.

The F-4 reproducer becomes f4_actor_cannot_be_its_own_executor: both
v1.0.0 mutations are rejected, owner-as-actor with an independent
executor works, and all six fixtures validate. spec and api deployment
step 3 say the two accounts must differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
observe returns Pending only when the values differ and a record is
open. The owner can always restate the current values: values and
records stay, the snapshot timestamp is renewed and the version moves by
one, so submit and dispatch resume after max_age. New values still wait
for every record to be terminal.

The F-6 reproducer becomes f6_owner_refreshes_the_snapshot_with_records_open.
The F-5 reproducer's observe line changes from Pending to Arithmetic (a
restatement now reaches the version bump; F-5 rewrites that test next).
live_all_on_random_runs also checks that an observe with a record open
changes no value or record. spec, api, implementation-plan, README and
handoff describe the refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New VERSION_CAP = u32::MAX - 3 * MAX_RECORDS. submit (last guard in
candidate, so preview reports it), dispatch, set_paused and observe fail
Arithmetic from the cap on. Acknowledgment, settlement and cancellation
keep the plain checked increment. An open record needs at most three more
increments and there are at most 256 records, so they never overflow and
every open record still resolves at the cap.

The F-5 reproducers become f5_open_records_resolve_above_the_version_cap
and f5_paused_pool_at_the_cap_still_settles; new f5_reserve_is_exactly_enough
resolves 256 Dispatched records from the cap by the longest path and ends
at exactly u32::MAX. spec, api and handoff describe the reserve; the
handoff's liveness premise no longer names the version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…v-cancel, div-ack)

cancel of a Completed record returns InvalidState, the name settle uses
for conflicting terminal evidence. Dispatched, Active and Unknown keep
Pending (the executor's evidence is pending); a repeated cancel stays an
Ok no-op.

The div-cancel reproducer becomes
cancel_names_conflicting_and_in_flight_states (every status, by the
actor, the owner and a stranger; the pool is unchanged). spec and api
now say that calls which change nothing (repeated settlement or cancel,
an acknowledgment that does not change the status, a late
acknowledgment) return Ok without a version change; the code already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and logs unknown ids (NT-F2, NT-F4)

reconcile is &self, so near-sdk generates no nonpayable check for it; it
now requires a zero deposit with near-sdk's own message. on_result drops
#[callback_result] and reads the promise result itself: anything but one
JSON string of at most 64 bytes (a failure, a number, null, an object,
invalid bytes, a longer result, a result count other than 1) is
"unknown" and the record goes Unknown. A result for an id with no record
is logged with error NotFound instead of panicking. Pool::record is now
public; it still indexes by id.

Tests: nt_f2_reconcile_rejects_deposit, reconcile_without_deposit_is_open_to_anyone,
nt_f4_non_string_result_becomes_unknown (16 result shapes, incl. the 64/65
byte bound), nt_f4_result_for_unknown_id_is_logged; sandbox: a 1 yocto
reconcile fails with the deposit message. api.md lines 3, 18 and 34.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…all imports (NT-F3)

Both contracts create their promises with env::promise_create,
promise_then and promise_return instead of near_sdk::Promise, whose
action code linked 15 host functions for deploy, keys, transfer, stake,
accounts and global contracts. Same targets, arguments, deposit (0),
static gas (execute 30 + on_result 30, status 10 + on_result 30, settle
40) and unused-gas weight (0); new unit tests pin these receipts and
pass on both the old Promise code and the new code. dispatch, reconcile,
finish and confirm_not_executed return () in Rust; on chain the result
is still the callback's (promise_return).

build.sh now also fails if a wasm imports any of the 15, or any
promise_batch_* function. Imports: contract 36 -> 18, executor 32 -> 13.
Docs: handoff boundary checks, api.md build step, README build note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… records (F-3)

The pool keeps its 256 most recent records. A submit into a full window
prunes the oldest record when it is terminal and fails Full while it is
open. Ids keep counting (records[k].id == first_id + k) and a pruned id is
NotFound for every call. Prerequisites read completed_units, a lifetime
per-recipe count updated by settle(true), so pruning cannot undo them.

The contract looks records up by id in dispatch and reconcile, and
get_commitments pages by id. The synthetic executor forgets a job once its
id is 256 behind the newest id it executed for the lock: execute of such an
id returns "cancelled" and starts nothing, confirm_not_executed fails
"stale id". Only execute moves the newest id. Job cap 512.

The F-3 reproducer becomes f3_window_frees_terminal_records_and_keeps_ids.
New: f3_prerequisites_survive_pruning, window_on_random_runs, contract and
executor window tests, and a 300-record sandbox run through the executor.
arithmetic_and_record_limits expects Full only with an open oldest record.
Scenario traces gain first_id and completed_units when they are regenerated
in the next commit. Tested, not formally re-verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sm (gas)

The six trace.json files gain only "first_id": 0 and "completed_units" in
every serialized pool (276 lines added, none removed); every decision,
reason, value and version is unchanged. config.json files are unchanged.

api.md gets a Gas section. A scratch sandbox test adapted from formalver's
RES-1 measured the v1.1 wasm at a maximum-size state (32 metrics, 64 terms,
32 recipes, 256 retained records, all open; executor at 256 jobs). Least
prepaid gas that succeeds: dispatch 70, reconcile 46, finish and
confirm_not_executed 43 Tgas; largest single receipt 14.81 Tgas (submit
with 255 open records). Recommended: 100, 60, 60 and 30 Tgas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6, NT-F1 to NT-F4)

Workspace version 1.1.0; Cargo.lock refreshed with cargo update -w (only
the five workspace crates change). New CHANGELOG.md with 1.1.0 (Fixed,
Changed, Docs) and the 1.0.0 baseline. docs/verification-findings.md gets
a status line per finding with its fixing commit and regression tests.
README, spec, api, judges-guide and nearhackathon.md say this is v1.1.0:
the formal results apply to v1.0.0 (a4bb5c3), and v1.1.0 fixes the
findings but has not been re-verified.

The wasm code sections are byte-identical to the build measured for the
gas table; only the embedded NEP-330 version string and symbol names change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the nearhackathon.md conflict. Keeps main's Submission,
Formal verification and Live site rows and its "part of the submission"
sentence, and keeps the v1.1 sentence: the formal results apply to
v1.0.0, and v1.1.0 fixes the findings, tested but not re-verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The import check only named known action imports. A host function such
as promise_yield_create or promise_set_refund_to, or one a later
near-sdk adds, would have passed. build.sh now also fails on any import
that is not on the reviewed list: the current 18 contract and 13
executor imports, all env functions. A non-function import carries its
kind, so it cannot match. The denylist stays as a second guard. The
Wasm files and their hashes are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NT-F4 was tested with the mock runtime only, because the bundled
executor always returns strings. A hand-assembled Wasm executor
(one import, env.value_return) now returns the JSON number 5 from
execute and a 70-byte JSON string from status. Through the deployed
lock, dispatch and reconcile both succeed, log outcome "unknown", and
leave the record Unknown with its reservation held; the executor
account's settle(false) then releases it. With a valid string the test
fails, so it sees the result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The docs said the oldest record "can always be closed". That holds for
a Reserved record, which its actor or the owner can cancel. A
Dispatched, Active or Unknown record closes only when its executor
reports, so a silent executor holds submit at Full even if the other
255 records are terminal. README, api.md, the handoff, CHANGELOG and
the F-1 and F-3 status lines now say so. No code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The site still said the verification reports F-1 and F-2, with no word
that v1.1.0 fixes them, and still described 256 lifetime commitments
and rotating the pool. Each verification sentence now says the formal
work covers v1.0.0 and that v1.1.0 fixes the findings, tested but not
yet formally re-verified. The limits sentence describes the window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (NT-F2)

- verification-findings.md: the Formal evidence paragraph still said
  only the reproducer tests run here. They are regression tests now,
  beside the new unit, build and sandbox tests; the formal results were
  not re-run and do not cover v1.1.0. The commit hashes are named as
  PR #4 commits, which the PR keeps listing even after a squash merge.
- api.md: the events and their format version, which stays 1.0.0
  because no event shape changed. The read methods (get_pool, preview,
  get_commitments, executor status and get_jobs) have no deposit check,
  so a transaction to them keeps a deposit; do not attach one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (gas)

The gas table in api.md came from a scratch test outside the
repository, so it could not be reproduced here, and the executor at
its 512-job cap was not measured. crates/sandbox/tests/res1.rs is that
test, adapted to read the build.sh Wasm and write artifacts/res1.json.
It takes about eight minutes, so it is #[ignore] and sandbox.sh skips
it; run it with --ignored.

It now also fills the executor to 512 jobs (operator confirmations of
ids the lock has not assigned) and checks that one more fails "full".
At 512 jobs: finish needs 44 Tgas (43 at 256), status burns 2.29 of
its 10 Tgas and execute 3.64 of its 30. The documented 60 Tgas still
holds. Every v1.1 figure measured before was reproduced exactly
(dispatch 70, reconcile 46, confirm and finish 43, worst receipt
14.81).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
api.md said one execute "of a higher id" frees the executor's space.
The RES-1 run shows an execute of an id below the confirmed ones frees
only one job (512 before and after). Only an execute of an id at least
as high as the confirmed ones brings it to at most 256 jobs.

While the executor is full, a failed execute leaves its record Unknown
and confirm_not_executed fails "full". If failures continue until the
lock's 256 records are such records or terminal, with none Reserved,
no execute can arrive again; only a settle signed with the executor
account's key resolves them. api.md now says so. No code change; the
synthetic executor keeps the design's rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabehamilton

gabehamilton commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded. The repository owner has answered all four questions, so none is open: see the later comment and "Owner decisions" in the description. Question 3 is decided: the owner may be a recipe's executor.

Owner decisions needed before this leaves draft (details under "Owner decisions to confirm" in the description):

  1. Record window (F-3, 1f01d43). Replaces "256 lifetime commitments, no pruning" with a window of the 256 most recent records. Cost: head-of-line Full while the oldest record is open. Declining means dropping 1f01d43 (self-contained, last code change) and using a per-recipe share instead.
  2. Stricter admission (F-1, F-2, 59e404f). A reservation can no longer cure a violated metric, and a hedge cannot rely on an unexecuted position (risk fixture: 6 units, not 8).
  3. Owner as executor (F-4, dc774f8). Only actor == executor is rejected. Should executor == owner be rejected too?

Please merge with a merge commit: docs/verification-findings.md cites this PR's commits by hash.

v1.1.0 is tested (unit, seeded random, sandbox) but not formally re-verified; the formal results apply to v1.0.0.

🤖 Generated with Claude Code

gabehamilton and others added 6 commits November 12, 2026 15:47
…F-3)

SECURITY.md still said terminal records are retained for replay
protection. Since the window (1f01d43) the pool prunes its oldest
terminal record; ids keep counting, and replay protection is the version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…E (F-3)

The handoff's EXEC row said the executor never refuses an id whose
record the lock retains. At its 512-job cap it does: confirm_not_executed
fails `full`, and with failing executes the lock can stay at `Full` until
the executor account signs a settle. The row now states the exception, a
nuance bullet explains it, and the CHANGELOG and README name the limit.
docs/api.md already described it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(F-3)

The window (F-3) adds first_id and completed_units to the lock's pool
and newest to the executor, so v1.0.0 state does not load under v1.1.0
code. The CHANGELOG and the deployment steps in docs/api.md now say so:
deploy fresh accounts, no migration is provided.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The findings summary, README and judges' guide said every finding is
fixed. For F-4, v1.1.0 rejects only a recipe whose actor is its executor;
the owner may still be a recipe's executor (owner question 3 on PR #4).
The F-4 Status paragraph already said so; the summary row, the page's
Status line, the CHANGELOG and the two overviews now say it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
api.md said each figure is the least that succeeded plus at least 10
Tgas, rounded up; that rule gives 80 for dispatch, not the 100 in the
table. It now gives the margins actually used (dispatch 30, reconcile 14,
finish and confirm_not_executed 16, other calls 15 over the largest
receipt). The findings page said v1.1 was measured at "the same
configuration" as v1.0.0, but the open records differ: all 256 for
dispatch and reconcile, 251 to 254 for the executor calls (v1.0.0: 225).
Figures from artifacts/res1.json of the ffed738 run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…F-3)

Wraps the CHANGELOG record-window bullet and two findings paragraphs
that had one over-long line each. The F-3 status now says the executor
holds at most 512 jobs and links to api.md for when that blocks
confirmations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabehamilton

gabehamilton commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded. The owner chose to implement question 4: since 4d69f19 the executor's newest id also moves when the lock accepts its settle, so the job cap is changed. See the later comment and the description.

One more owner decision, added to the description as question 4:

  1. Executor job cap (not changed). If many executes fail in a row and the operator confirms each, the synthetic executor reaches its 512-job cap. Then confirm_not_executed fails full, and the lock can stay at Full until the executor account itself signs a settle. This PR documents the limit (api.md, the handoff's EXEC row, CHANGELOG, README) and keeps the design's rule that only execute moves the executor's newest id. A follow-up could also move it when the lock accepts a confirmation's settle; that adds a callback and three host imports to the executor and needs the gas table re-measured.

The commits after 0941116 change only docs: SECURITY.md (pruning, ids never reused), the job-cap limit, the stored-state change (deploy fresh accounts), F-4's scope, and the gas margin rule.

@gabehamilton

gabehamilton commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Note, added later: this summary predates question 4. Since 4d69f19 the executor's newest id also moves when the lock accepts its settle (private callback on_settled), so retention is no longer keyed to the highest executed id alone. See the later comment and the description.

Summary of Changes

Hello @gabehamilton, I'm the pr-review agent. I've reviewed this pull request — here's a summary to help you and other reviewers get up to speed, with the full code review to follow.

This PR delivers the v1.1 follow-up to the external verification findings. The core now admits work against a conservative envelope of all open-record outcomes, retains a sliding window of 256 terminal-prunable records, reserves versions so open records can resolve near u32 exhaustion, and tracks completed prerequisites across pruning. The NEAR wrapper and synthetic executor are updated to match that state model, including safer promise-result decoding and bounded executor retention.

The implementation is accompanied by focused core regressions, seeded state-machine tests, real-Wasm integration coverage, regenerated scenario traces, build-time Wasm import validation, and documentation that explicitly limits the formal-verification claims to v1.0.0.

Highlights

  • Outcome envelope: Admission now accounts for open records staying open, completing, or releasing so later terminal transitions remain admissible.
  • Stable record ids: The pool retains a 256-record terminal-prunable window while preserving monotonic ids and lifetime prerequisite accounting.
  • Async boundary hardening: Callbacks consume bounded raw promise results and reconciliation rejects attached deposits.
  • Build surface: The build script requires cfg(near) and rejects Wasm imports outside the reviewed host-function allowlist.
Changelog
  • CHANGELOG.md
    • Adds the v1.1.0 release notes, behavior changes, verification scope, and known executor retention limits.
  • Cargo.lock
    • Updates workspace package version entries to 1.1.0.
  • Cargo.toml
    • Bumps the workspace package version to 1.1.0.
  • README.md
    • Updates project status, retention-window behavior, build checks, and verification caveats.
  • SECURITY.md
    • Updates security posture language for the record window and non-reused ids.
  • crates/contract/src/lib.rs
    • Adds id-based record paging, nonpayable reconciliation, bounded raw callback-result handling, and low-level promise construction with regression tests.
  • crates/core/src/findings.rs
    • Adds regression and seeded randomized tests for the verification findings, retention window, liveness, version reserve, and snapshot refresh.
  • crates/core/src/lib.rs
    • Implements conservative outcome envelopes, record-window pruning, lifetime completion counters, version reserve, actor/executor separation, and refreshed observations.
  • crates/core/src/tests.rs
    • Updates capacity-limit expectations for the sliding record window.
  • crates/demo/src/main.rs
    • Resolves commitments by stable record id rather than vector index.
  • crates/executor/src/lib.rs
    • Adds bounded job retention keyed to the highest executed id, a 512-job cap, and low-level settlement promises with tests.
  • crates/sandbox/tests/integration.rs
    • Extends real-Wasm coverage for panic diagnostics, deposits, retention-window behavior, and malformed executor results.
  • crates/sandbox/tests/res1.rs
    • Adds the ignored maximum-state gas-measurement and executor-cap regression suite.
  • docs/api.md
    • Documents id pagination, callback behavior, executor retention/cap semantics, deposits, and gas guidance.
  • docs/implementation-plan.md
    • Aligns implementation planning language with stricter admission and retention behavior.
  • docs/judges-guide.md
    • Updates the judge workflow and verification-status wording.
  • docs/spec.md
    • Revises the state-machine specification for windows, envelopes, version reserve, and executor rules.
  • docs/verification-findings.md
    • Adds the detailed verification findings, their fixes, test evidence, and formal re-verification caveat.
  • docs/verification-handoff.md
    • Updates stated invariants and review guidance for liveness, windows, version reserve, and executor retention.
  • nearhackathon.md
    • Updates submission claims to distinguish v1.0 verification from v1.1 fixes.
  • scenarios/friday/trace.json
    • Regenerates the Friday scenario trace with the expanded pool state.
  • scenarios/gpu/trace.json
    • Regenerates the GPU scenario trace with the expanded pool state.
  • scenarios/hiring/trace.json
    • Regenerates the hiring scenario trace with the expanded pool state.
  • scenarios/inventory/trace.json
    • Regenerates the inventory scenario trace with the expanded pool state.
  • scenarios/risk/trace.json
    • Regenerates the risk scenario trace with the expanded pool state.
  • scenarios/station/trace.json
    • Regenerates the station scenario trace with the expanded pool state.
  • scripts/build.sh
    • Builds Wasm under cfg(near) and validates the reviewed Wasm import surface before writing the build manifest.
  • ui/index.html
    • Updates public-facing v1.1, retention-window, and formal-verification-status copy.

Automated review by the pr-review agent (Codex CLI + GPT-5.6 Terra). Reply on any review thread to discuss a finding.

@gabehamilton gabehamilton left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The PR implements its stated v1.1 safety and liveness fixes coherently across the core state machine, NEAR shell, executor, regression tests, scenario artifacts, and documentation. I traced the changed public paths for record lookup, dispatch/reconciliation callbacks, settlement, pruning, prerequisites, and executor retention; the changed callers consistently use stable ids rather than record-vector positions. I found no concrete correctness, security, concurrency, performance, or test-coverage defect in the changed code that meets the reporting bar. The environment lacks Cargo, so Rust tests could not be executed here; static diff checks and JavaScript syntax checks completed successfully.

No inline findings were raised. Note for reviewers: Validated with git diff --check and node --check for ui/app.js and ui/live.js. Focused cargo tests could not run because the cargo executable is unavailable in the provided environment.

gabehamilton and others added 6 commits November 12, 2026 22:48
Owner decision Q4 on PR #4. `finish` and `confirm_not_executed` now chain
a private callback `on_settled({id})` (10 Tgas) on the lock's `settle`
(40 Tgas). When the lock accepted the settle, `on_settled` raises `newest`
to `id` and forgets every job 256 or more below it, as `execute` does: the
lock accepts a settle only for a record it retains, so every id 256 or
more below was already pruned. A refused settle changes nothing and the
job stays (no rollback). The call still returns the lock's `settle`, so
the transaction outcome (success, or the lock's error) is unchanged.

Accepted confirmations now keep the executor at 256 jobs plus those in
flight; the 512-job cap needs at least 256 jobs above `newest`, i.e.
refused confirmations or callbacks not yet run.

- scripts/build.sh: the executor may import promise_then,
  promise_results_count and promise_result (13 -> 16).
- Unit tests: settle + on_settled receipts for both methods; accepted,
  refused and missing results; the finish retry path; refused jobs kept
  until 256 past their id; 1,000 accepted confirmations hold 256 jobs;
  the cap with full and partial windows; callback order.
- docs/spec.md: the forgetting rule.

Contract Wasm unchanged (e6383aab...); executor Wasm b92f1469...

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s (D-1)

On the real host: 300 records whose execute fails (panic mode), each
confirmed not executed. After the confirmation of id N the executor holds
jobs max(0, N-255)..=N (v1.1.0 before 4d69f19 held 257 at N = 256 and
would reach its 512-job cap). The lock ends with first_id 44 and 256
Cancelled records; the executor with jobs 44..=299.

Also on the host: the confirmation's receipts (executor call and
on_settled, lock settle); a refused confirmation fails with the lock's
`NotFound`, its on_settled runs and changes nothing, the job stays; owner
-> `Method on_settled is private`, the executor account -> `not a settle
callback`; a Reserved record confirmed too early (`InvalidState`) is
cancelled at dispatch, then `finish(id, false)` is accepted and its
on_settled forgets job 44; the next record runs end to end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (gas)

`finish` and `confirm_not_executed` now create three receipts: the
executor's call, the lock's `settle` (40 Tgas) and the executor's
`on_settled` (10 Tgas). `Gas::add` takes one budget per receipt, so both
callbacks are checked against their static gas. Sections E and F assert
the new receipt shape (executor call and on_settled succeed; the lock's
settle succeeds, or in F fails NotFound) and that every measured
on_settled burns under 6 Tgas. F still reaches 512 jobs through 256
confirmations the lock refuses; the comment says honest use no longer
gets there. `finish` at 512 jobs measures the costliest on_settled
(accepted, scans 512 jobs). artifacts/res1.json gains the on_settled
figures, the margin and the confirm minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RES-1 (crates/sandbox/tests/res1.rs) at b954c50, 524 s, pass. The figures
apply to these Wasm files (scripts/build.sh at b954c50, clean tree, rustc
1.98.1, --cfg near): pool_contract.wasm e6383aabed62dcf694ac2f97da4520a0
19b18c9db637b1ee2afc7180c697e2ea (unchanged since 34ec9d4) and
pool_executor.wasm b92f146919be69f36f517edc10f1e04e6ee96430ba0d745e44221
32615634e83 (new in 4d69f19). A later change to either Wasm voids them.

- finish and confirm_not_executed: least 55 Tgas (finish with 512 jobs
  56; was 43 and 44). Attach 70 (was 60); margin 14 or more.
- on_settled burnt 2.47 of its 10 Tgas, 3.68 with 512 jobs, 3.66 after a
  refused settle.
- dispatch 70, reconcile 46 and the largest receipt (14.81) unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (D-1, F-3)

After 4d69f19 the executor forgets a job once the newest id the lock has
vouched for (sent to execute, or accepted a settle for) is 256 or more
past it. Job ids are distinct, so at most 256 jobs sit at or below that
id, and honest use holds 256 jobs plus confirmations in flight. The
512-job cap needs at least 256 jobs above it (more if fewer sit at or
below): refused confirmations (operator error; a far typo keeps its job
for good, no method removes it) or callbacks not yet run.

- docs/api.md (Executor protocol): on_settled, the forgetting rule, the
  result is still the lock's settle, what the lock refuses, the
  Reserved-too-early recovery (finish(id, false)), the cap and the exits
  from the wedge; 16 executor imports.
- docs/verification-handoff.md: EXEC row, record-window and job-cap
  nuances, on_settled in the boundary checks, 16 imports.
- README limits, findings F-3 and NT-F3 status, CHANGELOG executor
  retention, import count and on-chain results of finish and
  confirm_not_executed (the lock's settle, not a callback's).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…utor (F-1, F-3, F-4)

The repository owner answered PR #4's questions: the record window (F-3,
1f01d43) and the stricter admission (F-1, F-2, 59e404f) are accepted as
implemented, and the owner may remain a recipe's executor (F-4; v1.1.0
rejects only actor == executor, no code change). The docs now state these
as the owner's decisions, not open questions: findings Status, F-4 row and
F-4 Status; README; judges guide; CHANGELOG F-4 entry and "Confirmed by
the repository owner" on the admission and window bullets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabehamilton

Copy link
Copy Markdown
Contributor Author

Owner decisions recorded (PR body and docs updated):

  1. Record window (1f01d43): accepted as implemented.
  2. Stricter admission (59e404f): accepted as implemented.
  3. The owner may be a recipe's executor: the owner's decision; no code change. The docs say so (171a65f).
  4. The executor's newest id now moves when the lock accepts a confirmation's settle: implemented.

New commits for question 4:

  • 4d69f19 fix(executor): an accepted settle moves the newest id (D-1, F-3)
  • 4e1a4e1 test(sandbox): confirmed failed executes keep the executor at 256 jobs (D-1)
  • b954c50 test(sandbox): RES-1 measures on_settled; finish and confirm minimums (gas)
  • e583781 fix(docs): gas for finish and confirm_not_executed with on_settled (gas)
  • e0aad49 fix(docs): honest confirmations no longer fill the executor's job cap (D-1, F-3)
  • 171a65f fix(docs): owner decisions on the window, admission and owner as executor (F-1, F-3, F-4)

finish and confirm_not_executed now need 70 Tgas attached (least measured 55, or 56 with 512 jobs). A confirmation the lock refuses still keeps its job. That is the implementer's choice, not a rollback; "Known limits" in the PR body puts it to you. The PR stays a draft.

gabehamilton and others added 3 commits November 12, 2026 23:52
…ttle counts (D-1)

Doc comments and tests only; the executor Wasm is unchanged
(b92f146919be69f36f517edc10f1e04e6ee96430ba0d745e4422132615634e83,
rebuilt with scripts/build.sh and compared). The edits above the test
module keep their line counts, so no panic location moves.

- `newest` and `execute` docs: the newest id is the largest one for which
  the lock's `execute` created a job, or whose `settle` it accepted. An
  `execute` of an id that already has a job (a repeat, or a
  confirmation's) returns the stored status and moves nothing.
- `confirm_not_executed` doc: the lock also refuses another executor's
  recipe (`Unauthorized`).
- `on_settled`: a success with a value counts (`Err(TooLong)`).
- New test `d1_a_settle_success_with_a_value_counts_as_accepted`; a
  mutant that advances only on `Ok` fails it.
- `d1_finish_moves_newest_too` now checks that the lock's `execute` of a
  refused confirmation's id answers "cancelled" and moves nothing; a
  mutant that advances before the stored-job return fails it.
- The mock cannot see which promise `notify` returns; a test doc names
  the sandbox test that checks it. Sandbox comment at the dispatch of 300
  says why job 44 stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…als (D-1, gas)

- api.md, spec.md, handoff (EXEC row, record-window bullet), CHANGELOG,
  README, findings F-3: the executor's newest id is the largest id for
  which the lock's `execute` created a job, or whose `settle` the lock
  accepted; an `execute` of an id that already has a job moves nothing
  (it was "the largest id the lock has sent to `execute`").
- api.md and the handoff's job-cap bullet: the lock also refuses a
  confirmation of another executor's recipe (`Unauthorized`).
- Gas: the 55 Tgas for `confirm_not_executed` was swept with 254 jobs
  (`finish` with 256); `finish` with 512 jobs needs 56, and
  `confirm_not_executed`'s executor receipt at the cap burnt the same
  4.39 Tgas, so count on 56 for both there. CHANGELOG: least measured 55;
  56 for `finish` with 512 jobs. Attach stays 70. No figure re-measured:
  the Wasm is unchanged.
- README: the forgetting rule is stated with the newest id, not "once the
  lock has pruned its record".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he record Unknown (D-1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabehamilton

Copy link
Copy Markdown
Contributor Author

Summary of Changes

Hello @gabehamilton, I'm the pr-review agent. I've reviewed this pull request (re-review of commits 4be9dab..6fcbd56) — here's a summary to help you and other reviewers get up to speed, with the full code review to follow.

This v1.1 PR turns the reported verification findings into concrete core, contract, executor, test, and documentation changes. Its highest-risk new path is the synthetic executor: finish and confirm_not_executed persist evidence, invoke the lock settle call, return that settle promise to preserve caller-visible success/failure, and separately schedule a private callback to advance retention only after a successful settle.

Highlights

  • Settlement-gated retention: The executor advances newest only after the lock reports a successful settle, then removes jobs at least 256 ids behind it.
  • Promise-result preservation: notify returns the lock settle promise rather than the bookkeeping callback, preserving lock errors to the original caller.
  • Bounded behavior coverage: Unit and sandbox tests exercise successful and refused callbacks, callback privacy, stored-job replay behavior, and the 256/512 job boundaries.
Changelog
  • CHANGELOG.md
    • Adds the v1.1 release notes, including the executor-retention behavior, gas requirement, and owner decisions.
  • Cargo.lock
    • Refreshes workspace package version metadata to 1.1.0.
  • Cargo.toml
    • Bumps the workspace package version to 1.1.0.
  • README.md
    • Documents the verified v1.0 scope, v1.1 behavior, record window, and executor retention limits.
  • SECURITY.md
    • Updates the retention/replay-protection security boundary for the record window.
  • crates/contract/src/lib.rs
    • Adds bounded record-window APIs and lifecycle/async-result hardening in the NEAR contract shell.
  • crates/core/src/findings.rs
    • Converts verification reproductions into regression coverage for the repaired core behavior.
  • crates/core/src/lib.rs
    • Implements the bounded record window, stricter envelope admission, version reserve, and snapshot restatement behavior.
  • crates/core/src/tests.rs
    • Extends core unit and randomized coverage for the new admission, retention, and lifecycle rules.
  • crates/demo/src/main.rs
    • Adapts the local demonstration to the updated core API and record semantics.
  • crates/executor/src/lib.rs
    • Chains private on_settled callbacks after settle, advances the watermark only on successful settles, and bounds retained jobs.
  • crates/sandbox/tests/integration.rs
    • Adds real-receipt coverage for confirmations, callback privacy, refusal handling, and 256-job executor retention.
  • crates/sandbox/tests/res1.rs
    • Re-measures executor callback and notify gas at maximum retained state.
  • docs/api.md
    • Documents the revised executor protocol, failure modes, and 70 Tgas recommendation.
  • docs/implementation-plan.md
    • Updates implementation planning material for the completed verification-finding fixes.
  • docs/judges-guide.md
    • Updates reviewer guidance for v1.1 verification outcomes and owner decisions.
  • docs/spec.md
    • Aligns the state-machine specification with record-window and lifecycle semantics.
  • docs/verification-findings.md
    • Records statuses, regressions, and owner decisions for the verification findings.
  • docs/verification-handoff.md
    • Updates proof/review invariants for envelope, window, version, and executor retention behavior.
  • nearhackathon.md
    • Updates hackathon-facing project documentation for the v1.1 release.
  • scenarios/friday/trace.json
    • Refreshes the Friday scenario trace for the updated admission behavior.
  • scenarios/gpu/trace.json
    • Refreshes the GPU scenario trace for the updated admission behavior.
  • scenarios/hiring/trace.json
    • Refreshes the hiring scenario trace for the updated admission behavior.
  • scenarios/inventory/trace.json
    • Refreshes the inventory scenario trace for the updated admission behavior.
  • scenarios/risk/trace.json
    • Refreshes the risk scenario trace for the stricter admission envelope.
  • scenarios/station/trace.json
    • Refreshes the station scenario trace for the updated admission behavior.
  • scripts/build.sh
    • Expands the reviewed executor Wasm import allowlist for promise-result callback support.
  • ui/index.html
    • Updates the static UI copy/data for the revised v1.1 behavior.

Automated review by the pr-review agent (Codex CLI + GPT-5.6 Terra). Reply on any review thread to discuss a finding.

@gabehamilton gabehamilton left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The PR’s intent is to make the v1.1 verification fixes operationally safe, especially by ensuring successful executor confirmations cannot fill retention indefinitely while refused settlements do not falsely advance the watermark. The focused executor implementation follows that model: it authenticates the callback, distinguishes failed promise results, preserves the lock settle result, and uses a shared monotonic pruning helper. I found no actionable correctness, security, concurrency, performance, testing, maintainability, or documentation defect in the reviewed changes.

The new executor commits (private on_settled callback chained after settle, settle promise returned, shared advance helper) look correct on review; a manual read of the 4be9dab..6fcbd56 executor and build.sh diff found no defects either. Targeted Rust tests were not run in the review sandbox (no cargo available).

@gabehamilton
gabehamilton marked this pull request as ready for review November 14, 2026 03:01
@gabehamilton
gabehamilton merged commit 57b3f02 into main Nov 14, 2026
5 checks passed
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