Skip to content

Test each Floor loader call's own program and authority checks (finding 111) - #119

Merged
shuv-amp merged 2 commits into
mainfrom
auto/A/floor-check-calls-r2
Oct 19, 2026
Merged

shuv-amp merged 2 commits into
mainfrom
auto/A/floor-check-calls-r2

Conversation

@shuv-amp

@shuv-amp shuv-amp commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Opened by the Bulkhead autopilot agents: one reviewed unit of work. Every commit was reviewed adversarially by the other agent, with mutants, and passes tools/claims.py on its own.
Stacked on #118: merge that first; this PR is then rebased onto main.
The agents never merge. The owner reviews and merges.

What changed

Program tests (programs/tests/tests/floor.rs) and docs. No program change (Floor 8ca8a608). Two commits.

Finding 110's run deleted the returns of Floor's two shared checks, check_program_accounts and check_authority, but not their eight calls. With each call replaced on its own by let _ = …, the two in a stop were KILLED, but six survived with every program test green: in a snapshot restore (stop.rs:211, :216), a close (:293), an upgrade (proposals.rs:261, :270) and a release (:339). The loader still refused the CPI, with no Floor code, and the sweep checks only that a step fails.

  • b3e62f9: new test each_loader_call_names_its_own_program_and_authority. A second protected program supplies a programdata, program and Floor authority that pass every other check, and each is swapped in on its own into restore, close, upgrade and release. Each must be refused with Floor's own code (PROGRAM_MISMATCH or WRONG_AUTHORITY_ADDRESS), and the other program must still work afterwards.
  • 0a3084a: records finding 111.

Proof

  • K1–K8, whole program suite per mutant: all KILLED. K3–K8 are killed only by the new test, each failing because the loader's error comes back instead of Floor's code (for example "account 2: PrivilegeEscalation"). K3–K8 pass the parent's test file (autopilot tasks/floor-check-calls/r2/).
  • Each commit green; programs/tests clippy clean; scripts/check.sh ALL CHECKS PASSED (findings 111, Floor 58, programs 173).
  • Reviewed by B: APPROVE at 47c096f (REVIEWS/auto-A-floor-check-calls.md). Restacked onto floor-error-tests-r6, with the docs/09 rows 110/111 and §3 conflict resolved by script. An independent review confirmed the rows match r6's and 47c096f's exactly and that none of r5's text is left, rebuilt K3 and K8 to confirm only the new test kills them, and approved (REVIEWS/auto-A-floor-check-calls-r2.md).

Limits

  • The close and the release swap in only the Floor authority here. Their programdata checks are pinned by each_instruction_names_its_own_accounts_and_state and a_proposal_has_a_known_kind_and_a_release_its_own_programdata.

Hashes after the sync onto main (17 Oct)

sync-main-97 replayed the stack onto main d7b9bdb (#97), after the owner's README redesign (#115). Each commit's own diff is unchanged, except README hunks ported to the new README. Outside README, every old/new pair differs only by main's own changes (autopilot tasks/sync-main-115/per-commit-tree.log treebad=0, tasks/sync-main-97/pairs.log bad=0). The ids under What changed are the new ones; the runs and reviews quoted elsewhere were done at the old ones. Old = new: 5081b4d = 73ddc78, a133186 = 70eee34. On the synced chain: bin/check-each-commit.sh 60/60 green, and scripts/check.sh ALL CHECKS PASSED at its tip 2fa7a7f (tasks/sync-main-97/each-commit.log, check-tip.log). Agent B reviewed the sync: REVIEWS/auto-A-sync-main-97.md (APPROVE).

Hashes after the sync onto main (19 Oct)

The sync replayed the stack onto main bb55c15 (#114), whose tree is auto/B/failover-snapshot-r2's (8506759); #113's is auto/B/floor-follow-each's (51d20d3), both built on the main they merged into. The owner's #107 edited one sentence in README.md, docs/08 and docs/09 (the devnet job, and with it ci, fails for Floor and Vault until finding 107 is deployed); and #99's merge changed README's devnet line and the guardians figure (3-8 -> 4-8 keys). Each commit's own message is unchanged. Every old/new pair's trees differ by exactly that: README.md, docs/08, docs/09, docs/assets/src/figures.py and the two PNGs, the same +/- lines for all 38 synced commits (autopilot tasks/sync-main-114/per-commit-tree.log and map.txt). The ids under What changed are the new ones; the runs and reviews quoted elsewhere were done at the old ones. Old = new: 73ddc78 = b3e62f9, 70eee34 = 0a3084a. On the synced chain: bin/check-each-commit.sh bb55c15 41/41 green (the 38 synced commits, then the murmur3 exclusion fix, finding 106's citation and the full-ledger fuzz target), and scripts/check.sh ALL CHECKS PASSED at their tip (tasks/sync-main-114/each-commit.log, check-tip.log). Agent B reviewed the sync: REVIEWS/auto-A-sync-main-114.md.

🤖 Generated with Claude Code

@shuv-amp
shuv-amp force-pushed the auto/A/floor-error-tests-r6 branch from 5466cca to 66d1afd Compare October 17, 2026 22:54
@shuv-amp
shuv-amp force-pushed the auto/A/floor-check-calls-r2 branch from a133186 to 70eee34 Compare October 17, 2026 22:55
@shuv-amp
shuv-amp force-pushed the auto/A/floor-error-tests-r6 branch from 66d1afd to ada0239 Compare October 18, 2026 20:04
@shuv-amp
shuv-amp force-pushed the auto/A/floor-check-calls-r2 branch from 70eee34 to 0a3084a Compare October 18, 2026 20:04
@shuv-amp
shuv-amp force-pushed the auto/A/floor-error-tests-r6 branch from ada0239 to c90d85a Compare October 19, 2026 17:02
Base automatically changed from auto/A/floor-error-tests-r6 to main October 19, 2026 17:11
shuv-amp and others added 2 commits October 19, 2026 22:56
Floor's two shared checks, check_program_accounts (loader.rs:135) and
check_authority (lib.rs:198), are called at eight places. With each
call replaced by `let _ = ...` on its own (tasks/floor-check-calls/
mutants.log, STATE=tip, base 7f8c9ff, 17 Oct), the two in a stop were
KILLED (a_stop_names_its_own_program_sysvars_and_authority), and six
SURVIVED with every program test green, the sweep included:

  K3 stop.rs:211       restore_snapshot  check_program_accounts
  K4 stop.rs:216       restore_snapshot  check_authority
  K5 stop.rs:293       close_buffer      check_authority
  K6 proposals.rs:261  execute_code      check_program_accounts
  K7 proposals.rs:270  execute_code      check_authority
  K8 proposals.rs:339  execute_release   check_authority

Root cause: the sweep checks only that a substituted account fails,
and without the check the loader still refuses the CPI, so nothing
pinned Floor's own code at these six sites. The rules held; no test
could fail if one went. Same class as finding 110.

New test each_loader_call_names_its_own_program_and_authority. A
second protected program supplies a programdata, program and Floor
authority that pass every other check; each is substituted on its own
in a snapshot restore, a close of a cancelled proposal's buffer, an
upgrade after its delay and a release, and must fail with
PROGRAM_MISMATCH or WRONG_AUTHORITY_ADDRESS. Each instruction then
succeeds unchanged, and the other program's authority stays Floor's.

Evidence (STATE=g3, full program suite per mutant, mutants-frozen.sh):
K3-K8 each KILLED by the new test, whose swap then gets the loader's
error instead of Floor's (InvalidArgument for K3 and K6,
PrivilegeEscalation for K4, K5, K7 and K8); K1, K2 still KILLED by the
stop test. Floor sha256 8ca8a608 after restoring, unchanged.
Re-run after the restack onto floor-error-tests-r6 (tasks/floor-check-
calls/r2/mutants.log): STATE=r2, K1-K8 KILLED as above; STATE=r2parent,
the parent's test file, K3-K8 SURVIVED. The first run's base 7f8c9ff
is an earlier head of floor-error-tests-r5 (kept as branch
auto/A/floor-error-tests-r5-7f8c9ff), not of this history; its
programs and core equal this commit's (git diff --stat 7f8c9ff HEAD --
programs/floor/src programs/vault/src programs/harbor/src crates/:
empty).
programs/tests clippy --release --tests -D warnings: clean.

Sibling search: `grep -n "check_program_accounts\|check_authority"
programs/floor/src` lists the eight calls and the two definitions;
the four programdata-only checks (returns at stop.rs:35, :68, :296,
proposals.rs:337) are already asserted by code (finding 110's tests
and a_proposal_has_a_known_kind_and_a_release_its_own_programdata).

Docs: the §3 row "Floor refusals deleted one at a time" said the calls
were not deleted; it now says, dated 17 Oct, that each was, and in its
result column what that did, on the same build as the 16 Oct run
(Floor 8ca8a608 in both mutants.log files). docs/08's list of what the other Floor
tests cover gains another program's accounts refused by Floor's code.
Counts: Floor 57 -> 58, programs 172 -> 173 (claims.py OK).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Finding 110's deletion run removed the returns of Floor's two shared
checks, check_program_accounts and check_authority, but not their
calls. Each of the eight calls, replaced on its own by `let _ = ...`
with the whole program suite run against it (tasks/floor-check-calls/
mutants.log, 17 Oct), showed six with no test that could fail: in a
snapshot restore (stop.rs:211, :216), a close (:293), an upgrade
(proposals.rs:261, :270) and a release (:339). The loader refused the
CPI with no Floor code, and the sweep checks only that a step fails.

The previous commit adds the test that fails under each; this one
records the finding in 09 §4 and moves the counts: README 110 -> 111
findings, "96–111 were recorded" and 111 among the fixed (Floor tests),
docs/12's range 96–111 with 111 fixed (Floor tests).

Docs only: claims.py OK, findings 111.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shuv-amp
shuv-amp force-pushed the auto/A/floor-check-calls-r2 branch from 0a3084a to dbf3099 Compare October 19, 2026 17:11
@shuv-amp
shuv-amp merged commit f0cdc78 into main Oct 19, 2026
11 checks passed
@shuv-amp
shuv-amp deleted the auto/A/floor-check-calls-r2 branch October 19, 2026 17:20
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