Skip to content

Print key-validator details in text mode; fix RunAuction doc and a duplicate floor test case - #96

Merged
nickpell merged 2 commits into
mainfrom
nick/oa-validator-details-doc-test
Oct 8, 2026
Merged

nickpell merged 2 commits into
mainfrom
nick/oa-validator-details-doc-test

Conversation

@nickpell

@nickpell nickpell commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

  • key-validator text output lists the validation details. outputText printed the "Validation Results:" header and the boolean summary but never result.ValidationDetails, so a failed check in the default text mode showed only false with no reason. It now prints a Details: list after the summary, in the same place and form as auction-validator's text output; JSON mode already included details. TestOutputTextPrintsDetails captures stdout and asserts the list, and fails if the loop is removed.
  • RunAuction doc no longer mentions a "full ranking". AuctionResult has no ranking field and never had one; the Returns line now lists winner, runner-up, eligible bids and rejected bids.
  • TestBidMeetsFloor no longer has a duplicate case. "decimal precision edge case - fails" and "very small difference - fails" both used 2.4999, 2.5, false. The decimal-precision case now uses 2.49994, which is just below the half-step of the 4-decimal rounding and rounds down to 2.4999, so it is the failing counterpart of 2.499999999 (which rounds up to the floor). Unlike 2.4999, it fails if BidMeetsFloor rounds up instead of to nearest.

Example text output for an attestation with unknown PCRs, no certificate and a mismatched key:

Details:
  - PCR0: aaaa…aaaa (no match)
  - PCR1: bbbb…bbbb (no match)
  - PCR2: cccc…cccc (no match)
  - Missing certificate
  - COSE signature verification failed: parse certificate: x509: malformed certificate
  - Public key mismatch: provided key does not match attested key

Notes for reviewers

Pre-merge checklist

  • Build passes (go build ./..., go vet ./...)
  • Lint passes (mise run //:lint, mise run //:tidy; CI lint and Ratchet Lint green)
  • Tests pass (mise run //:test; CI test green)
  • TestOutputTextPrintsDetails fails with the Details: loop removed
  • The new TestBidMeetsFloor case fails with Round replaced by RoundCeil in BidMeetsFloor, which the previous duplicate did not catch
  • Diff contains no unintended changes

Post-deploy/apply verification

  • The EIF build run on main for the merge commit is green, including update-pcrs (Go 37852655284, Docker Build 37852709564 and EIF build 37853130748 all succeeded; Build EIF and Update PCR validation file jobs green; PCR commit 4eacd33)

…plicate floor test case

- key-validator's text output now lists ValidationDetails under a Details: heading, as auction-validator's does, so a failed check shows its reason without --format json.
- The RunAuction doc no longer claims AuctionResult carries a full ranking; the type has no ranking field.
- TestBidMeetsFloor's "decimal precision edge case - fails" duplicated the 2.4999 input of "very small difference - fails"; it now uses 2.49994, just below the 4-decimal rounding half-step, as the failing counterpart of 2.499999999.
@nickpell
nickpell requested a balanced review from Copilot October 8, 2026 22:01

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.

@nickpell
nickpell merged commit 5e60275 into main Oct 8, 2026
3 checks passed
@nickpell
nickpell deleted the nick/oa-validator-details-doc-test branch October 8, 2026 22:18
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