8000 feat(bep): refuse off-set authorities, off-port connections and expired or revoked values by minimal-foundry[bot] · Pull Request #2448 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

feat(bep): refuse off-set authorities, off-port connections and expired or revoked values - #2448

Merged
norrietaylor merged 1 commit into
mainfrom
agent/2266-refuse-authorities-outside-both-host-sets-off-po
Oct 20, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
agent/2266-refuse-authorities-outside-both-host-sets-off-po

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T5 — Refuse authorities outside both host sets, off-port connections, and expired or revoked values

slice: S0
kind: task
covers: BEP-021, BEP-024, BEP-031
size: L
est: 150 code, 360 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: every refusal names its first failing check in the audit record's marker, which min box audit <box> shows
observability: the connection span and the audit marker name a refusal's first failing check
layers:
- decide:
- crates/bep/src/redeem.rs: the BEP-021, BEP-024 and BEP-031 checks
- scripts/kani.sh: the added harnesses' count
test: cargo nextest run -p bep prop_authority_outside_bound_or_current_set_is_refused
test: cargo nextest run -p bep prop_expired_or_revoked_value_is_refused
test: cargo nextest run -p bep prop_off_port_connection_is_refused
test (deferred: kani): cargo nextest run -p bep kani_redeem_requires_authority_in_both_sets
test (deferred: kani): cargo nextest run -p bep kani_redeem_refuses_expired_or_revoked
test (deferred: kani): cargo nextest run -p bep kani_redeem_enforces_port_discipline
produces: none
consumes:
- crates/bep/src/redeem.rs
proof: A request outside either host set, on another port, or with an expired or revoked value is refused.
depends on:
- blocked by #2260

Proof

redeem::decide now refuses a request when the connection authority is outside the value's bound host set (outside_bound_set) or the module's current host set (outside_current_set). It also refuses a credentialed hostname on an undeclared port (off_port), a value at or past its expiry (expired), and a value whose box a revocation in force names (revoked). Each marker is the audit record's marker for the refusal.

Notes from the agent: Deferred (lane: kani): kani_redeem_requires_authority_in_both_sets, kani_redeem_refuses_expired_or_revoked and kani_redeem_enforces_port_discipline are written in redeem.rs, but they did not run on this box. scripts/kani.sh now expects 6 bep harnesses. All six bep harnesses carry #[kani::unwind(6)], because the redemption now holds host sets of at most 4 authorities and at most 2 revocations as Vecs. The memory use of the existing three harnesses with this wider input is not measured. Design decisions: Redemption is now Redemption<B, H> and has new fields now, revoked (the box ids that the revocations in force name, which the shell selects), authority, bound_set and current_set. Authority is a host id with a port. Unsealed has a new Expired variant, which from_open maps from OpenError::Expired. Opened carries the earlier of the context and member expiry. The check order after attribution is expired, revoked, off_port, outside_bound_set, outside_current_set. off_port fires only when the current set has the hostname on another port. A hostname absent from the current set is outside_current_set (or outside_bound_set first). The connection span is not in this change: no TLS and socket shell exists yet to carry it, so the marker is the only surface today. The run of the redeem tests (12) passed.

Tests

line exit tail
cargo nextest run -p bep prop_authority_outside_bound_or_current_set_is_refused 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-e692... Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test' profile [unoptimized] target(s) in 7.73s ──────────── Nextest run ID fe409460-867b-498c-b92d-18cc37f34f17 with nextes
cargo nextest run -p bep prop_expired_or_revoked_value_is_refused 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-df59... 8000 Finished 'test' profile [unoptimized] target(s) in 0.44s ──────────── Nextest run ID c185750b-60ee-4944-9156-3535bd46856f with nextest profile: default Starting 1 test across 2
cargo nextest run -p bep prop_off_port_connection_is_refused 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-1048... Finished 'test' profile [unoptimized] target(s) in 0.41s ──────────── Nextest run ID dfcefde8-0276-4c70-86bc-ac698a65807f with nextest profile: default Starting 1 test across 2

Verify

min task run agent-verify passed ([tasks.verify]).

Deferred

The plan marked these test lines deferred: the executor lacks the lane, so nothing here ran them and they still owe evidence.

line lane
cargo nextest run -p bep kani_redeem_requires_authority_in_both_sets kani
cargo nextest run -p bep kani_redeem_refuses_expired_or_revoked kani
cargo nextest run -p bep kani_redeem_enforces_port_discipline kani

Closes #2266

decide now refuses a value whose clock is at or after its expiry, or
whose box a revocation in force names (BEP-024). It refuses a connection
to a credentialed hostname on an undeclared port (BEP-031), and an
authority outside the bound or the current host set (BEP-021). Each
refusal names its check as an audit marker: expired, revoked, off_port,
outside_bound_set or outside_current_set. Add three Kani harnesses and
expect six in scripts/kani.sh.
@coderabbitai
coderabbitai Bot commented Oct 20, 2026
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 18eae130-9416-437d-964a-5b69493ffb8a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry
minimal-foundry Bot commented Oct 20, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: 1 finding, none above this repo's threshold at 75978eda07df.

Nothing to do.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot 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.

minimal-review — approved

Verdict APPROVE — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/bep/src/redeem.rs Resolved
@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 20, 2026
@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arch-review: PASS · the full ruling

The change conforms to Gatehouse §6.10. decide admits a value only when the authority is in both the bound set and the current set (line 851). It refuses a credentialed hostname on an undeclared port (line 851). It refuses an expired blob and a box that a revocation in force names (lines 823 and 839). Every new path fails closed. The Kani harnesses are still deferred to the advisory lane, the same as #2359.

Ruled at 75978ed against gominimal/arch@3dab1097cda1 by claude-opus-5-5.

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Own review of 75978ed against the T5 plan block (BEP-021, BEP-024, BEP-031).

  • BEP-021 (prop_authority_outside_bound_or_current_set_is_refused): decide admits only when authority is in bound_set and in current_set; the property asserts admitted == in_bound && in_current over every bound set, current set and authority, which is the spec's property verbatim. Refusal markers outside_bound_set / outside_current_set name the first failing check.
  • BEP-024 (prop_expired_or_revoked_value_is_refused): now >= expiry refuses as expired, a revocation in force naming the box refuses as revoked; Unsealed::Expired from OpenError::Expired is refused as expired after attribution, and an opened value carries the earlier of the value and member expiry (from_open_expired_is_refused_as_expired checks 2 000). Property matches the spec's.
  • BEP-031 (prop_off_port_connection_is_refused): a hostname present in the current set on an undeclared port refuses as off_port; a hostname absent from the set is not credentialed and falls to the set checks. Property matches the spec's.
  • Harnesses: kani_redeem_requires_authority_in_both_sets, kani_redeem_refuses_expired_or_revoked, kani_redeem_enforces_port_discipline present, scripts/kani.sh expects 6 bep harnesses, and the Kani lane is green on this head, which supplies the evidence the PR body lists as deferred.
  • Purity and order: decide stays pure over owned values; the check order after attribution is expired, revoked, off_port, outside_bound_set, outside_current_set, and every refusal names its first failing check (Check::marker, markers test updated).
  • Layers: crates/bep/src/redeem.rs and scripts/kani.sh only, as the plan lists. The connection span is not wired (no TLS/socket shell yet); the marker is the surface today, as the agent note says.
  • Threads: the one runtime NIT (doc wording on check order) is verified true and resolved as optional.

minimal-arch ruled PASS on this head. Approval follows the macOS lane.


Generated by Claude Code

@norrietaylor norrietaylor changed the title T5 — Refuse authorities outside both host sets, off-port connections, and expired or revoked values feat(bep): refuse off-set authorities, off-port connections and expired or revoked values Oct 20, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving for merge: T5 on 75978ed (arch PASS 118478880516, own review, Kani lane green). Gate passes on 75978ed (arch PASS, review concluded with no open threads, lanes green, squash subject lint-clean).


Generated by Claude Code

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 03466f7 Oct 20, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2266-refuse-authorities-outside-both-host-sets-off-po branch October 20, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T5 — Refuse authorities outside both host sets, off-port connections, and expired or revoked values

1 participant

0