Skip to content

Name only the comparisons that ran, and the set that was compared - #16

Merged
Rul1an merged 3 commits into
mainfrom
fix/refusal-message-names-evaluated-set
Aug 20, 2026
Merged

Rul1an merged 3 commits into
mainfrom
fix/refusal-message-names-evaluated-set

Conversation

@Rul1an

@Rul1an Rul1an commented Aug 20, 2026

Copy link
Copy Markdown
Owner

The carried-record sweep's refusal made three claims about work it had not done. All three are invisible to the conformance corpus: verdicts are unchanged either way, so they live entirely in the free-form reason the suite declares informative.

Found by applying astrogilda's proposed specification sentence from in-toto/attestation#570 to our own refusals: an implementation can name a condition in a refusal only where that condition was evaluated on that statement, and it cannot name a comparison whose operand set was empty.

What was wrong

  1. It named comparisons that never ran. check_sealed computed the clean-row conjuncts under &&, which short-circuits, and the caller named all three. bad-1003 through bad-1006 fail on four different conjuncts and emitted one byte-identical string.
  2. It named a comparison whose operand set was empty. all() over an empty set is vacuously true, so the arming term decided nothing. Measured: 22 of 66 evaluations over the pinned corpus reach the site with that set empty. Minimal witness ok-001-caught-intercepted-fail — one caught row, records [interception, sealed], no arming record.
  3. It described a set wider than the one compared. The operands come from the arming records the rows resolve; the message said "every carried arming record". That phrase appears nowhere in the specification, which says "every arming record the row resolves".

What changed

Each conjunct is evaluated on its own and only failures are named; the arming clause is omitted where its operand set is empty; the operands are described as the records the rows resolve, with their count. Message assembly moves into sealed_sweep_reason, a pure function, because a rule this file states about its own messages needs a test in this file and the old shape was unreachable from one.

bad-1003..bad-1006 now emit three distinct strings where they emitted one.

Verification

  • Verdicts untouched: 250/250 at suite 5019931, spec digest 759d2383 verified, reason parity 69/193 — unchanged.
  • Tests: src/check.rs had zero unit tests. Nine added; 21 pass.
  • Bite-tested: each new test was checked by mutating its property back. Short-circuit → 1 red; "carried arming" wording → 2 red; collapse to one fixed string → 4 red.

One guard is unforced, and says so

Deleting !arming_postures.is_empty() leaves all 21 green, because all() is already vacuously true on empty, so no input can distinguish the guard's presence. A structural zero, not an empirical one. Kept and documented beside the test rather than deleted or left implying coverage it does not have.

Summary by CodeRabbit

  • Bug Fixes
    • Improved sealed-record evaluation to identify all failed clean-row conditions.
    • Refusal messages now report only the comparisons that were actually evaluated.
    • Added clearer handling for row-specific arming posture comparisons and missing posture values.
  • Tests
    • Expanded coverage for condition-specific failures, operand wording, empty and agreement cases, and distinct refusal messages.

Rul1an added 2 commits August 20, 2026 21:53
The carried-record sweep's refusal made three claims about work it had not
done. All three are invisible to the corpus: verdicts are unchanged either
way, so they live entirely in the free-form reason.

1. It named all three record-local conjuncts although check_sealed computed
   them under &&, which short-circuits. bad-1003 through bad-1006 fail on
   four different conjuncts and emitted one byte-identical string. Each
   conjunct is now evaluated on its own and only the failures are named.

2. It named the arming comparison even where the operand set was empty, and
   all() over an empty set is vacuously true, so the term decided nothing.
   22 of 66 evaluations over the pinned corpus reach the site that way. The
   clause is now omitted rather than asserted.

3. It called the operands every carried arming record. The set is built from
   the records the rows resolve, a strict subset, and the phrase appears
   nowhere in the specification, which says every arming record the row
   resolves. The message now describes the set it compared and its size.

Message assembly moves into sealed_sweep_reason, a pure function, because a
rule this file states about its own messages needs a test in this file and
the old shape was unreachable from one. src/check.rs had no unit tests.

Verdicts unchanged: 250/250 at suite 5019931, spec digest 759d2383, reason
parity 69/193.
Bite-tested every new test by mutating the property back. Three bite; the
empty-operand-set guard does not. Deleting !arming_postures.is_empty()
leaves all 21 green, because all() is already vacuously true on empty, so
no input can distinguish the guard's presence. That is a structural zero
and the test pins the message contract rather than the guard.

Kept and documented rather than deleted or left implying coverage it does
not have: it states the rule where a reader meets it, and a formulation
that is not vacuously true on empty would need it without announcing so.
Copilot AI lite review requested due to automatic review settings August 20, 2026 20:10

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Rul1an, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a401dca9-b4de-4474-88a2-f8353d506f3a

📥 Commits

Reviewing files that changed from the base of the PR and between 53a6305 and 56c3190.

📒 Files selected for processing (2)
  • reports/INDEX.json
  • reports/v0.7-rev26-directed-run.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4aff5d7b-1f0a-4a57-a452-4a6efb4d910d

📥 Commits

Reviewing files that changed from the base of the PR and between b228348 and 53a6305.

📒 Files selected for processing (1)
  • src/check.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Sealed-record evaluation now collects individual failed comparisons instead of one boolean. Refusal messages identify evaluated failures, row-resolved operands, absent posture values, and disagreeing arming postures. Unit tests cover clean and refusal cases.

Changes

Sealed-record reporting

Layer / File(s) Summary
Collect sealed-record failures
src/check.rs
Coverage evaluation stores individual failure identifiers. Clean coverage depends on whether the failure list is empty. Each sealed-record conjunct is evaluated independently.
Generate detailed refusal reasons
src/check.rs
Refusal construction reports failed comparisons, absent posture values, and non-empty disagreeing arming postures. Carried sealed-record validation uses the detailed refusal reason.
Validate failure reporting
src/check.rs
Tests cover clean results, independent conjunct failures, operand wording, arming-set cases, disagreement counts, distinct refusal messages, and absent posture values.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Merge Risk: ⚪ Minimal · up to 53a63

This localized change refines refusal messages and adds tests without supplied evidence of a correctness, runtime, security, data, or availability regression; it is merge-ready after normal checks, with no actionable merge-blocking risk remaining.

Sequence Diagram(s)

sequenceDiagram
  participant CoverageEvaluation
  participant SealedRecordCheck
  participant RefusalReason
  CoverageEvaluation->>SealedRecordCheck: evaluate sealed-record comparisons
  SealedRecordCheck-->>CoverageEvaluation: return individual failures
  CoverageEvaluation->>RefusalReason: provide failures and posture values
  RefusalReason-->>CoverageEvaluation: return detailed refusal message
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: refusal messages now name only evaluated comparisons and the compared operand set.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/refusal-message-names-evaluated-set

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

CI caught this, which is the index doing its job: the record names the
source digest that produced it, and the refusal-message change moved the
source. Regenerated rather than re-labelled.

Verdicts are untouched, 0 of 250 differing, so what moved is the reason
strings and the source digest. bad-1003 through bad-1006 now emit three
distinct strings where they emitted one byte-identical one; reason parity
stays 69/193, since the carried-record-invalid family still collapses the
three kind-keyed names the corpus distinguishes, which is a separate
defect from naming comparisons that did not run.

checkerCommit is a placeholder on the pre-merge SHA and carries the note
saying so: it answers the GitHub API while not being reachable from a
fresh clone once this squash-merges, which is the access path a
reproduction uses. Repoint it to the commit on main after merge.
@Rul1an
Rul1an merged commit 1135a97 into main Aug 20, 2026
3 checks passed
@Rul1an
Rul1an deleted the fix/refusal-message-names-evaluated-set branch August 20, 2026 20:17
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.

2 participants