Skip to content

feat(fairness): one-command public verifier + published methodology page - #9941

Merged
JSONbored merged 2 commits into
mainfrom
feat/public-verifier-9723
Jul 30, 2026
Merged

feat(fairness): one-command public verifier + published methodology page#9941
JSONbored merged 2 commits into
mainfrom
feat/public-verifier-9723

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Closes #9723
Closes #9725

Epic #9722. Two halves of the same goal: make the fairness numbers checkable by a stranger, and make the method behind them readable without opening the source.

The verifier (#9723)

npx -p @loopover/mcp loopover-verify

Fetches the public surfaces, recomputes every commitment, prints a per-claim PASS/FAIL table, exits non-zero on any failure. Four claims:

Claim What it recomputes
record-digests Every recordDigest, from the record minus the digest, under the same canonical serialization
corpus-commitments Every corpusChecksum, rehashed from the served cases — not trusted from the corpus's own checksum field. A record committing to the EMPTY corpus while reporting decided > 0 is a failure
anchor-checkpoint The signed checkpoint, offline, against the published key it names — plus that the displayed signingInput really is the preimage of the displayed payload
stats-parity Headline totals against the ledger-derived parity rollups

Zero credentials: every path is under /v1/public/, no Authorization header is ever set, and no token is read from the environment. There is a test asserting that on every request.

A claim that could not be checked reports SKIP and is never counted as a pass. Skips do not fail the run — a disabled surface is not a broken one — but the two are kept structurally distinct all the way to the exit code. (An earlier draft reported PASS with a detail line reading "unverified"; the regression test for that is in the suite.)

Why the contract package moved

For an outsider to recompute a digest they need the serialization rule, and it lived inside the Worker. So canonicalJson / sha256Hex / contentDigest, and the verifying half of ledger anchoring, move into @loopover/contract and are re-exported from their old homes — every existing call site is unchanged, and there is one definition rather than two that can drift.

Signing stays in the Worker; it needs the private key. The anchor verifier's own comment used to describe itself as "the function a third party's own verifier reimplements" — that reimplementation was the gap.

Behaviour-preserving: the existing digest and anchor suites pin concrete hex values and signature round-trips, and pass unchanged.

The methodology page (#9725)

/docs/fairness-methodology, linked from /fairness (rule table + parity block) and from the verify-this-review walkthrough.

Written against the code rather than from intent, which is why it says some things a marketing page would not:

  • The windows are flat. There is no time-decay or recency weighting anywhere.
  • Only the review-parity block is computed from the anchored ledger. Rule precision and accuracy come from audit history, which is retention-bounded and not itself anchored.
  • Coverage is computed but is not displayed on /fairness.
  • The only interval on the page is the headline accuracy CI, in the single-instance branch. Per-rule precision, the per-repository column, both weekly trends, and every parity figure are bare point estimates.
  • Implicit and explicit confirmations are pooled, though the underlying data tags them separately.
  • Reversals are undercounted by construction; the published corpus is capped and can be a prefix of what precision was computed over; reads fail soft.

Mislabel fixed in passing

The headline read "lifetime" while its accuracy pairing has always been bounded by audit-log retention — deliberately so, since a lifetime denominator drifts the ratio toward 100%. totals now publish accuracyWindowDays, derived from the retention policy rather than restated as a literal, and the page renders the real window.

Also

gen-contract-api-schemas scans the bin directory rather than one hardcoded filename, so a future bin cannot silently opt out of response validation. Output is byte-identical today — a latent fix, not a live one.

Validation

#9724 (nightly walkthrough CI job) is deliberately not included — its acceptance requires a deliberately-broken staging config turning the job red within one cycle, which is a production failure drill rather than a code change.

Closes #9723.

LoopOver publishes fairness numbers and says a stranger can check them, but
checking them meant reimplementing canonical JSON, reimplementing ECDSA over it,
and hand-diffing four endpoints -- so in practice nobody did, and a broken
commitment could sit published indefinitely.

  npx -p @loopover/mcp loopover-verify

Fetches the public surfaces, recomputes every commitment, prints a per-claim
PASS/FAIL table and exits non-zero on any failure. Four claims: every
recordDigest recomputes from its own record; every corpusChecksum rehashes to a
downloadable corpus, with a scored record committing to the EMPTY corpus treated
as a failure; the signed ledger checkpoint verifies offline against a published
key, including that the displayed signingInput really is the preimage of the
displayed payload; and the headline totals agree with the ledger-derived parity
rollups.

No credentials of any kind: every path is under /v1/public/ and no Authorization
header is ever set, asserted by a test.

To make that possible without a repo checkout, the digest primitives
(canonicalJson/sha256Hex/contentDigest) and the VERIFYING half of ledger
anchoring move into @loopover/contract, re-exported from their old homes so every
call site is unchanged. Signing stays in the Worker, which is the only thing that
may hold the private key. The anchor verifier's own comment used to say it was
'the function a third party reimplements' -- that reimplementation was the gap.

A claim that could not be checked reports SKIP and is never counted as a pass.

The api-schema generator now scans the bin directory rather than one hardcoded
filename, so a future bin cannot silently opt out of response validation. Output
is byte-identical today.
Closes #9725.

/fairness publishes precision, accuracy and parity figures whose method lived in
code and issue history, so a reader could see the number but not the rule behind
it. This is that page: the three disjoint data sources and which figures come
from each, the outcome-confirmation rules, every window, precision and coverage
definitions, sample floors, and a limitations section.

Linked from /fairness (both the rule table and the parity block) and from the
verify-this-review walkthrough, and kept next to the scoring code it describes so
a definition change and a doc change land in the same review.

Written against the code rather than from intent, which surfaced things worth
stating plainly: the windows are flat with no time-decay anywhere; only the
review-parity block is computed from the anchored ledger; coverage is computed
but not displayed here; and the only interval on the page is the headline
accuracy CI, in the single-instance branch -- per-rule precision, the
per-repository column, both weekly trends and every parity figure are bare point
estimates.

Also fixes a mislabel the write-up exposed: the headline read "lifetime" while
its accuracy pairing has always been bounded by audit-log retention, deliberately
so (a lifetime denominator drifts the ratio toward 100%). totals now publish
accuracyWindowDays, derived from the retention policy rather than restated as a
literal, and the page renders the real window.
@loopover-orb

loopover-orb Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Important

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏳ LoopOver is waiting…

LoopOver has seen this pull request and is waiting on CI checks to finish before reviewing it. This comment will update once the review runs.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟨 Waiting

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui ac3e597 Commit Preview URL

Branch Preview URL
Jul 30 2026, 06:50 PM

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 36.64kB (0.47%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
loopover-ui 7.88MB 36.64kB (0.47%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: loopover-ui

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/add-scalar-classes-CT6bNbkF.js (New) 2.16MB 2.16MB 100.0% 🚀
assets/tanstack-vendor-fwVX6YhF.js (New) 953.85kB 953.85kB 100.0% 🚀
openapi.json -264 bytes 757.89kB -0.03%
assets/docs.fumadocs-spike-api-reference-BC3ZbcwM.js (New) 443.45kB 443.45kB 100.0% 🚀
assets/AgentScalarChatInterface.vue-wvUIyOha.js (New) 201.69kB 201.69kB 100.0% 🚀
assets/modal-CabpvIY5.js (New) 184.5kB 184.5kB 100.0% 🚀
assets/client-CpmnER8n.js (New) 151.47kB 151.47kB 100.0% 🚀
assets/self-hosting-configuration-DwCFaekz.js (New) 116.4kB 116.4kB 100.0% 🚀
assets/maintainer-panel-BPCgpgxb.js (New) 78.97kB 78.97kB 100.0% 🚀
assets/verify-this-review-DeGBSn4c.js (New) 57.52kB 57.52kB 100.0% 🚀
assets/routes-CsR5HnTA.js (New) 35.88kB 35.88kB 100.0% 🚀
assets/fairness-methodology-B2-axDCa.js (New) 35.63kB 35.63kB 100.0% 🚀
assets/owner-panel-BP_UhXST.js (New) 28.26kB 28.26kB 100.0% 🚀
assets/app-BfknE9UR.js (New) 25.82kB 25.82kB 100.0% 🚀
assets/ui-vendor-DYmcLBM2.js (New) 24.57kB 24.57kB 100.0% 🚀
assets/miner-panel-CwBGLZtm.js (New) 20.49kB 20.49kB 100.0% 🚀
assets/fairness-Cihfv0Kc.js (New) 19.89kB 19.89kB 100.0% 🚀
assets/api._op-CQ_noP8z.js (New) 17.51kB 17.51kB 100.0% 🚀
assets/self-hosting-docs-audit-BIBpUTKX.js (New) 16.6kB 16.6kB 100.0% 🚀
assets/docs._slug-DB2z84UN.js (New) 15.79kB 15.79kB 100.0% 🚀
assets/playground-panel-C2iPwwJ2.js (New) 14.35kB 14.35kB 100.0% 🚀
assets/app.audit-CsDSeRWz.js (New) 10.22kB 10.22kB 100.0% 🚀
assets/app.config-generator-BoEZQKj3.js (New) 10.06kB 10.06kB 100.0% 🚀
assets/maintainers-BK5kA5tk.js (New) 8.06kB 8.06kB 100.0% 🚀
assets/miners-CIt-GOZC.js (New) 7.91kB 7.91kB 100.0% 🚀
assets/agents-CEm1hZyI.js (New) 7.74kB 7.74kB 100.0% 🚀
assets/commands-panel-B-oR2Yhb.js (New) 6.74kB 6.74kB 100.0% 🚀
assets/maintainer-workflow-DCyC43O9.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/digest-panel-DeOkua3A.js (New) 6.15kB 6.15kB 100.0% 🚀
assets/repos._owner._repo.quality-BSKMPL3_.js (New) 6.14kB 6.14kB 100.0% 🚀
assets/docs-nav-Ep8TJqak.js (New) 6.12kB 6.12kB 100.0% 🚀
assets/docs.index-DNKDcWvM.js (New) 6.01kB 6.01kB 100.0% 🚀
assets/api.index-B1r24a7_.js (New) 4.7kB 4.7kB 100.0% 🚀
assets/docs-DFsI65J1.js (New) 2.93kB 2.93kB 100.0% 🚀
assets/api-vO7pcFLz.js (New) 2.66kB 2.66kB 100.0% 🚀
assets/docs-page-CxcTkfKr.js (New) 2.1kB 2.1kB 100.0% 🚀
assets/table-P0QilBOn.js (New) 1.75kB 1.75kB 100.0% 🚀
assets/app.workbench-CQGSI_IY.js (New) 1.58kB 1.58kB 100.0% 🚀
assets/tabs-VWY1wUt9.js (New) 1.39kB 1.39kB 100.0% 🚀
assets/app.repos-BzN_z6Bk.js (New) 1.07kB 1.07kB 100.0% 🚀
assets/input-DjvRZ8XK.js (New) 796 bytes 796 bytes 100.0% 🚀
assets/file-cog-BcHkSh-6.js (New) 758 bytes 758 bytes 100.0% 🚀
assets/app.maintainer-B7oDNTjl.js (New) 502 bytes 502 bytes 100.0% 🚀
assets/app.owner-RnXhgSgP.js (New) 474 bytes 474 bytes 100.0% 🚀
assets/app.commands-bybhbnSD.js (New) 455 bytes 455 bytes 100.0% 🚀
assets/app.playground-Bdkqm3ru.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/index-Dy2M7yFc.js (New) 438 bytes 438 bytes 100.0% 🚀
assets/app.digest-CqOMQOmk.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/eye-off-DngJnVOU.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/app.miner-Bq7C2C2j.js (New) 422 bytes 422 bytes 100.0% 🚀
assets/key-round-C5hFM_Vl.js (New) 355 bytes 355 bytes 100.0% 🚀
assets/bot-HrPciv81.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/git-pull-request-arrow-pkDvg23R.js (New) 321 bytes 321 bytes 100.0% 🚀
assets/list-checks-CirdlbiN.js (New) 279 bytes 279 bytes 100.0% 🚀
assets/compass-CMJBgJLz.js (New) 251 bytes 251 bytes 100.0% 🚀
assets/history-CEGM69kn.js (New) 237 bytes 237 bytes 100.0% 🚀
assets/message-square-te5cQBmG.js (New) 233 bytes 233 bytes 100.0% 🚀
assets/lock-D1AXvvS8.js (New) 206 bytes 206 bytes 100.0% 🚀
assets/play-DE2l0OIU.js (New) 190 bytes 190 bytes 100.0% 🚀
assets/circle-check-Ae14Rb6E.js (New) 178 bytes 178 bytes 100.0% 🚀
assets/add-scalar-classes-DCBwHl1n.js (Deleted) -2.16MB 0 bytes -100.0% 🗑️
assets/tanstack-vendor-C_JJTCpD.js (Deleted) -954.12kB 0 bytes -100.0% 🗑️
assets/docs.fumadocs-spike-api-reference-CJXdiJYP.js (Deleted) -443.45kB 0 bytes -100.0% 🗑️
assets/AgentScalarChatInterface.vue-ChznU_bT.js (Deleted) -201.69kB 0 bytes -100.0% 🗑️
assets/modal-D8MkZNWo.js (Deleted) -184.5kB 0 bytes -100.0% 🗑️
assets/client-BwOa0FpN.js (Deleted) -151.47kB 0 bytes -100.0% 🗑️
assets/self-hosting-configuration-Cfy8pMsY.js (Deleted) -116.47kB 0 bytes -100.0% 🗑️
assets/maintainer-panel-WE5GIWkZ.js (Deleted) -78.97kB 0 bytes -100.0% 🗑️
assets/verify-this-review-BWmJVV0m.js (Deleted) -56.7kB 0 bytes -100.0% 🗑️
assets/routes-CFwUcuKA.js (Deleted) -35.88kB 0 bytes -100.0% 🗑️
assets/owner-panel-DwERlVyS.js (Deleted) -28.26kB 0 bytes -100.0% 🗑️
assets/app-CWjk07nf.js (Deleted) -25.82kB 0 bytes -100.0% 🗑️
assets/ui-vendor-CVP2eJng.js (Deleted) -24.57kB 0 bytes -100.0% 🗑️
assets/miner-panel-DCVRyzn6.js (Deleted) -20.49kB 0 bytes -100.0% 🗑️
assets/fairness-BZwHz3j8.js (Deleted) -19.37kB 0 bytes -100.0% 🗑️
assets/api._op-DZqhCvSM.js (Deleted) -17.51kB 0 bytes -100.0% 🗑️
assets/self-hosting-docs-audit-BlnKdRAx.js (Deleted) -16.6kB 0 bytes -100.0% 🗑️
assets/docs._slug-BCynTLab.js (Deleted) -15.63kB 0 bytes -100.0% 🗑️
assets/playground-panel-DVmHzBMX.js (Deleted) -14.35kB 0 bytes -100.0% 🗑️
assets/app.audit-CHJ8AkIa.js (Deleted) -10.22kB 0 bytes -100.0% 🗑️
assets/app.config-generator-DsvfNWQB.js (Deleted) -10.06kB 0 bytes -100.0% 🗑️
assets/maintainers-C6VnDNnW.js (Deleted) -8.06kB 0 bytes -100.0% 🗑️
assets/miners-ljnZUFWw.js (Deleted) -7.91kB 0 bytes -100.0% 🗑️
assets/agents-DIfoFbC3.js (Deleted) -7.74kB 0 bytes -100.0% 🗑️
assets/commands-panel-B-3mfJHO.js (Deleted) -6.74kB 0 bytes -100.0% 🗑️
assets/maintainer-workflow-jrekOIf3.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/digest-panel-BDWonmKD.js (Deleted) -6.15kB 0 bytes -100.0% 🗑️
assets/repos._owner._repo.quality-Dt3NIm8k.js (Deleted) -6.14kB 0 bytes -100.0% 🗑️
assets/docs-nav-DJ5Yoo7Q.js (Deleted) -6.06kB 0 bytes -100.0% 🗑️
assets/docs.index-Bxxunsxb.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/api.index-BnuMBtUe.js (Deleted) -4.7kB 0 bytes -100.0% 🗑️
assets/docs-CnB5Y4uk.js (Deleted) -2.93kB 0 bytes -100.0% 🗑️
assets/api-4hr5cqxd.js (Deleted) -2.66kB 0 bytes -100.0% 🗑️
assets/docs-page-BsYBngsG.js (Deleted) -2.1kB 0 bytes -100.0% 🗑️
assets/table-B9ILo6Bc.js (Deleted) -1.75kB 0 bytes -100.0% 🗑️
assets/app.workbench-aHy-hsiX.js (Deleted) -1.58kB 0 bytes -100.0% 🗑️
assets/tabs-m9NB7AQb.js (Deleted) -1.39kB 0 bytes -100.0% 🗑️
assets/app.repos-D1VzcTS5.js (Deleted) -1.07kB 0 bytes -100.0% 🗑️
assets/input-DlU1kCwA.js (Deleted) -796 bytes 0 bytes -100.0% 🗑️
assets/file-cog-B48XTzb8.js (Deleted) -758 bytes 0 bytes -100.0% 🗑️
assets/app.maintainer-DgfEt9Ck.js (Deleted) -502 bytes 0 bytes -100.0% 🗑️
assets/app.owner-Bduzcape.js (Deleted) -474 bytes 0 bytes -100.0% 🗑️
assets/app.commands-YwoZszPU.js (Deleted) -455 bytes 0 bytes -100.0% 🗑️
assets/app.playground-DJtxowiy.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/index-DvDC4zeo.js (Deleted) -438 bytes 0 bytes -100.0% 🗑️
assets/app.digest-Cgl3bEJl.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/eye-off-DkswwFZZ.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/app.miner-DxdDTEN3.js (Deleted) -422 bytes 0 bytes -100.0% 🗑️
assets/key-round-Div9vOJJ.js (Deleted) -355 bytes 0 bytes -100.0% 🗑️
assets/bot-ClgeNio_.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/git-pull-request-arrow-BsaM4GEu.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/list-checks-BGOTcpg0.js (Deleted) -279 bytes 0 bytes -100.0% 🗑️
assets/compass-CKUiCoGv.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/history-gS41X2ZR.js (Deleted) -237 bytes 0 bytes -100.0% 🗑️
assets/message-square-kFhXNqAq.js (Deleted) -233 bytes 0 bytes -100.0% 🗑️
assets/lock-CpQ7khwr.js (Deleted) -206 bytes 0 bytes -100.0% 🗑️
assets/play-j5OmoLCm.js (Deleted) -190 bytes 0 bytes -100.0% 🗑️
assets/circle-check-Cr51v0v9.js (Deleted) -178 bytes 0 bytes -100.0% 🗑️

@JSONbored JSONbored self-assigned this Jul 30, 2026
@JSONbored
JSONbored merged commit bae7b2f into main Jul 30, 2026
9 checks passed
@JSONbored
JSONbored deleted the feat/public-verifier-9723 branch July 30, 2026 19:02
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.97531% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.87%. Comparing base (edf7b37) to head (ac3e597).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/loopover-mcp/bin/loopover-verify.ts 84.31% 3 Missing and 5 partials ⚠️
packages/loopover-mcp/lib/verify-public-claims.ts 95.18% 0 Missing and 4 partials ⚠️
src/db/retention.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9941      +/-   ##
==========================================
- Coverage   91.87%   91.87%   -0.01%     
==========================================
  Files         923      927       +4     
  Lines      113436   113572     +136     
  Branches    27331    27377      +46     
==========================================
+ Hits       104219   104342     +123     
- Misses       7928     7931       +3     
- Partials     1289     1299      +10     
Flag Coverage Δ
backend 95.66% <91.97%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-contract/src/anchor-verify.ts 100.00% <100.00%> (ø)
packages/loopover-contract/src/digest.ts 100.00% <100.00%> (ø)
packages/loopover-contract/src/public-api.ts 100.00% <ø> (ø)
src/review/decision-record.ts 100.00% <ø> (ø)
src/review/ledger-anchor.ts 100.00% <ø> (ø)
src/review/public-stats.ts 97.41% <ø> (ø)
src/db/retention.ts 98.87% <0.00%> (-1.13%) ⬇️
packages/loopover-mcp/lib/verify-public-claims.ts 95.18% <95.18%> (ø)
packages/loopover-mcp/bin/loopover-verify.ts 84.31% <84.31%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant