Skip to content

feat(proof): public per-repo proof summary, endpoint and README badge (#9569) - #9608

Merged
JSONbored merged 8 commits into
mainfrom
feat/proof-page-9569
Jul 29, 2026
Merged

feat(proof): public per-repo proof summary, endpoint and README badge (#9569)#9608
JSONbored merged 8 commits into
mainfrom
feat/proof-page-9569

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

The shareable, unauthenticated twin of the in-app trust panel. One composition serves both, so the public page and #9193's panel can't disagree about a figure — which is precisely the property this page exists to demonstrate.

The privacy boundary is structural, not a filter

Every field is built by naming it, never by spreading a wider object. A blocklist has to anticipate every field a future upstream type might grow, and silently leaks the one it didn't; an allowlisted shape can't leak a field nobody wrote down. Tested by feeding hostile records carrying hotkey/walletAddress/rewardTao/trustScore/privateRank and asserting none of it reaches the serialized page — while the named fields do come through, so the test proves allowlisting rather than an empty object.

Never a bare scalar

Any accuracy figure carries its coverage and a Wilson interval. Below a 20-decision floor there is no rate at all — an explicit insufficient_data state that still publishes the count, because "we have 7 decisions, too few to claim a rate" is more honest than hiding both. A perfect record over 19 decisions must not render as 100%. Wilson rather than Wald because a gate metric lives near p→1, exactly where Wald claims impossible certainty.

Honest boundary states

An empty ledger is empty, not verified — different claims. A failed read is unavailable, not broken, which would accuse the operator of tampering. A failed anchor attempt is not an anchor: the public attempt log is where failures are legible, and presenting one here would claim corroboration that doesn't exist. The verification-contract boundary statement travels in the payload, so a screenshot or embed can't shed it the way a footer caption can.

The badge reports the ledger's state, not an accuracy percentage — a badge is a one-glance claim, and an accuracy number without the interval that makes it honest doesn't fit in one. Disabled and errored both render a neutral SVG, because a broken image in a README is worse than an honest "unavailable".

The opt-out decision (requirement 6)

Recorded in the module beside the code that implements it, not only here:

Opt-out per repo, default ON once the operator's fleet-wide flag (default OFF) is on. Every figure is already publicly fetchable through /v1/public/decision-ledger/verify, /…/anchors and /…/decision-records/… — gating a page over data anyone can already curl adds friction without privacy, and makes a verification story look less confident than it is. The per-repo switch still exists because a page is a genuinely different artifact from an API: discoverable, linkable, indexable, and it markets a repo's numbers whether or not the maintainer wants that. A repo can opt out but cannot opt in when the operator hasn't, which keeps the fleet switch a real switch.

A real bug the tests caught

DB.prepare() throws synchronously on a driver-level failure, so my .catch() chain never ran — a D1 outage would have 503'd the entire public page instead of degrading section by section. Each section is now a real try/catch. That's the difference between the fail-safe-per-section contract being documented and being true, and there's a test that breaks prepare outright plus one for a driver returning no results array.

Tests (19, 100% of branches on both new modules)

Accuracy with coverage+interval and the floor in both directions; failed-attempt-is-not-an-anchor and newest-wins regardless of list order; all four ledger states including the unknown-position break; the privacy-boundary regression; sample bounding and the in-payload caveat; every badge message and color including the neutral not-yet-decided case; the flag's truthy parsing and the full opt-out matrix; end-to-end route 404-while-off / 200-when-on with cache headers; per-section degradation; and a real recorded anchor flowing through to anchored.

Auth exemptions and OpenAPI operations are added in this PR alongside the routes, per the #9120 lesson.

Backend half of #9569 — the /proof/:owner/:repo UI route renders this payload and lands separately, so I've left the issue open.

…#9569)

The shareable, unauthenticated twin of the in-app trust panel. One
composition serves both, so the public page and #9193's panel cannot
disagree about a figure -- which is the property the page exists to
demonstrate.

THE PRIVACY BOUNDARY IS STRUCTURAL. Every field is built by NAMING it,
never by filtering a wider object. A blocklist has to anticipate every
field a future upstream type might grow and silently leaks the one it did
not; an allowlisted shape cannot leak a field nobody wrote down. Tested by
feeding hostile records carrying hotkey/wallet/reward/trust-score/private-
rank and asserting none of it reaches the serialized page -- while the
named fields do, so the test proves allowlisting rather than an empty
object.

NEVER A BARE SCALAR. Any accuracy figure carries its coverage and a Wilson
interval; below a 20-decision floor there is no rate at all, only an
explicit insufficient_data state that still publishes the count. A perfect
record over 19 decisions must not render as 100%. Wilson rather than Wald
because a gate metric lives near p->1, exactly where Wald claims
impossible certainty.

HONEST BOUNDARY STATES. An empty ledger is `empty`, not `verified` --
different claims. A failed read is `unavailable`, not `broken`, which
would accuse the operator of tampering. A FAILED anchor attempt is not an
anchor: the public attempt log is where failures are legible, and
presenting one here would claim corroboration that does not exist. The
verification-contract boundary statement travels IN the payload, so a
screenshot or embed cannot shed it the way a footer caption can.

The badge reports the LEDGER's state rather than an accuracy percentage: a
badge is a one-glance claim, and an accuracy number without the interval
that makes it honest does not fit in one. Disabled and errored both render
a neutral SVG -- a broken image in a README is worse than an honest
"unavailable".

DECISION (requirement 6), recorded beside the code that implements it: the
page is opt-OUT per repo, default ON once the operator's fleet-wide flag
(default OFF) is on. Every figure is already publicly fetchable through
the ledger-verify / anchors / decision-record endpoints, so gating a page
over it would add friction without privacy. The per-repo switch still
exists because a page is a different artifact from an API -- discoverable,
linkable, and it markets a repo's numbers whether or not the maintainer
wants that. A repo can opt out but cannot opt IN when the operator has
not, which keeps the fleet switch a real switch.

Found and fixed while testing: `DB.prepare()` throws SYNCHRONOUSLY on a
driver-level failure, so the `.catch()` chain never ran and a D1 outage
would have 503'd the whole public page instead of degrading. Each section
is now a real try/catch, which is the difference between the
fail-safe-per-section contract being documented and being true.

Backend half of #9569; the /proof/:owner/:repo UI route renders this
payload and lands separately.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 28, 2026

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 3f15c03 Commit Preview URL

Branch Preview URL
Jul 29 2026, 06:56 AM

@loopover-orb

loopover-orb Bot commented Jul 28, 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.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle name Size Change
loopover-ui 7.81MB 3.88kB (0.05%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: loopover-ui

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/add-scalar-classes-BnTfhquB.js (New) 2.16MB 2.16MB 100.0% 🚀
assets/tanstack-vendor-DHteDKaR.js (New) 915.66kB 915.66kB 100.0% 🚀
openapi.json 2.36kB 717.11kB 0.33%
assets/docs.fumadocs-spike-api-reference-BCtMoOWT.js (New) 443.45kB 443.45kB 100.0% 🚀
assets/AgentScalarChatInterface.vue-C2D1ztHn.js (New) 201.7kB 201.7kB 100.0% 🚀
assets/modal-Dagy12us.js (New) 184.5kB 184.5kB 100.0% 🚀
assets/client-Dqmgi0ZO.js (New) 151.47kB 151.47kB 100.0% 🚀
assets/maintainer-panel-D04N3YlR.js (New) 78.99kB 78.99kB 100.0% 🚀
assets/routes-Dx6-NJ6U.js (New) 35.96kB 35.96kB 100.0% 🚀
assets/owner-panel-5k4hfRjq.js (New) 27.97kB 27.97kB 100.0% 🚀
assets/app-CXlATF_7.js (New) 25.78kB 25.78kB 100.0% 🚀
assets/ui-vendor-dlIH5EhE.js (New) 24.57kB 24.57kB 100.0% 🚀
assets/miner-panel-vVmTUJAo.js (New) 20.24kB 20.24kB 100.0% 🚀
assets/app.runs-DrMOlb_z.js (New) 20.22kB 20.22kB 100.0% 🚀
assets/api._op-1rTY5jD_.js (New) 17.57kB 17.57kB 100.0% 🚀
assets/self-hosting-docs-audit-CFqjWuIs.js (New) 16.6kB 16.6kB 100.0% 🚀
assets/docs._slug-DCWmFxrh.js (New) 15.52kB 15.52kB 100.0% 🚀
assets/playground-panel-BDqJmn4o.js (New) 14.42kB 14.42kB 100.0% 🚀
assets/fairness-CsHwagU3.js (New) 12.16kB 12.16kB 100.0% 🚀
assets/app.audit-DM1OMC1o.js (New) 10.08kB 10.08kB 100.0% 🚀
assets/app.config-generator-CjCxpxhV.js (New) 10.06kB 10.06kB 100.0% 🚀
assets/maintainers-BKF7bFXR.js (New) 8.06kB 8.06kB 100.0% 🚀
assets/miners-CfettF97.js (New) 7.91kB 7.91kB 100.0% 🚀
assets/agents-v8nshneK.js (New) 7.74kB 7.74kB 100.0% 🚀
assets/commands-panel-vsrEAGog.js (New) 6.65kB 6.65kB 100.0% 🚀
assets/maintainer-workflow-Id77S-4b.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/digest-panel-BcgalAxr.js (New) 6.15kB 6.15kB 100.0% 🚀
assets/repos._owner._repo.quality-C2hPbirN.js (New) 6.14kB 6.14kB 100.0% 🚀
assets/docs-nav-BPBAlD5L.js (New) 6.01kB 6.01kB 100.0% 🚀
assets/docs.index-dHO6Qf49.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/api.index-BhI8m3nj.js (New) 4.7kB 4.7kB 100.0% 🚀
assets/docs-BF5McryK.js (New) 2.7kB 2.7kB 100.0% 🚀
assets/api-BERMPSBd.js (New) 2.69kB 2.69kB 100.0% 🚀
assets/docs-page-D6d-eixj.js (New) 2.1kB 2.1kB 100.0% 🚀
assets/table-BibLd14d.js (New) 1.75kB 1.75kB 100.0% 🚀
assets/app.workbench-fMjHsMok.js (New) 1.58kB 1.58kB 100.0% 🚀
assets/tabs-CqVMGCaY.js (New) 1.39kB 1.39kB 100.0% 🚀
assets/app.repos-DPxZfUFA.js (New) 1.07kB 1.07kB 100.0% 🚀
assets/input-DRGWS31B.js (New) 796 bytes 796 bytes 100.0% 🚀
assets/file-cog-BHM9OwT2.js (New) 758 bytes 758 bytes 100.0% 🚀
assets/app.maintainer-Hyj0DaBh.js (New) 502 bytes 502 bytes 100.0% 🚀
assets/app.owner-CeITeuix.js (New) 474 bytes 474 bytes 100.0% 🚀
assets/app.commands-D5BtXmgD.js (New) 455 bytes 455 bytes 100.0% 🚀
assets/app.playground-B0lCwogu.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/index-CCklUZzZ.js (New) 438 bytes 438 bytes 100.0% 🚀
assets/app.digest-Lf4qKaUG.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/eye-off-D57JtDUm.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/app.miner-B9LKRi3n.js (New) 422 bytes 422 bytes 100.0% 🚀
assets/key-round-Dn81zMF1.js (New) 355 bytes 355 bytes 100.0% 🚀
assets/bot-BX3ZJRKk.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/trash-2-7uwfgbui.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/save-B9ij8oLF.js (New) 327 bytes 327 bytes 100.0% 🚀
assets/git-pull-request-arrow-ctcXjQxB.js (New) 321 bytes 321 bytes 100.0% 🚀
assets/list-checks-C9ihUo4j.js (New) 279 bytes 279 bytes 100.0% 🚀
assets/compass-BsTQePc8.js (New) 251 bytes 251 bytes 100.0% 🚀
assets/history-C1wcLLkH.js (New) 237 bytes 237 bytes 100.0% 🚀
assets/message-square-DAHDL9NG.js (New) 233 bytes 233 bytes 100.0% 🚀
assets/lock-zkRDC2_3.js (New) 206 bytes 206 bytes 100.0% 🚀
assets/rotate-cw-CllLB8L3.js (New) 201 bytes 201 bytes 100.0% 🚀
assets/play-DlyhiskF.js (New) 190 bytes 190 bytes 100.0% 🚀
assets/circle-check-z1JAdYiE.js (New) 178 bytes 178 bytes 100.0% 🚀
assets/search-BZ71ot9M.js (New) 174 bytes 174 bytes 100.0% 🚀
assets/add-scalar-classes-2SL-Rzs2.js (Deleted) -2.16MB 0 bytes -100.0% 🗑️
assets/tanstack-vendor-BwlvtABd.js (Deleted) -914.18kB 0 bytes -100.0% 🗑️
assets/docs.fumadocs-spike-api-reference-BRXvqice.js (Deleted) -443.45kB 0 bytes -100.0% 🗑️
assets/AgentScalarChatInterface.vue-JTsh0nvN.js (Deleted) -201.7kB 0 bytes -100.0% 🗑️
assets/modal-CIC-O_5q.js (Deleted) -184.5kB 0 bytes -100.0% 🗑️
assets/client-Cyr7nRmY.js (Deleted) -151.47kB 0 bytes -100.0% 🗑️
assets/maintainer-panel-Cp0aaZo7.js (Deleted) -78.99kB 0 bytes -100.0% 🗑️
assets/routes-D0DSNxQw.js (Deleted) -35.96kB 0 bytes -100.0% 🗑️
assets/owner-panel-CqBS3rDM.js (Deleted) -27.92kB 0 bytes -100.0% 🗑️
assets/app-Cojn4Gvu.js (Deleted) -25.78kB 0 bytes -100.0% 🗑️
assets/ui-vendor-Dt6M7DxF.js (Deleted) -24.57kB 0 bytes -100.0% 🗑️
assets/miner-panel-CQvjOZXh.js (Deleted) -20.24kB 0 bytes -100.0% 🗑️
assets/app.runs-BzEyLeQ8.js (Deleted) -20.22kB 0 bytes -100.0% 🗑️
assets/api._op-BbLM0eAQ.js (Deleted) -17.57kB 0 bytes -100.0% 🗑️
assets/self-hosting-docs-audit-c9PnxQeV.js (Deleted) -16.6kB 0 bytes -100.0% 🗑️
assets/docs._slug-C_jeRW4p.js (Deleted) -15.52kB 0 bytes -100.0% 🗑️
assets/playground-panel-kz0_aeDT.js (Deleted) -14.42kB 0 bytes -100.0% 🗑️
assets/fairness-DvZUVzLG.js (Deleted) -12.16kB 0 bytes -100.0% 🗑️
assets/app.audit-*.js (Deleted) -10.08kB 0 bytes -100.0% 🗑️
assets/app.config-generator-Coh7tzzI.js (Deleted) -10.06kB 0 bytes -100.0% 🗑️
assets/maintainers-5t-HpI9d.js (Deleted) -8.06kB 0 bytes -100.0% 🗑️
assets/miners-CCzRuLBu.js (Deleted) -7.91kB 0 bytes -100.0% 🗑️
assets/agents-CrQZUoJD.js (Deleted) -7.74kB 0 bytes -100.0% 🗑️
assets/commands-panel-oQKf-h-q.js (Deleted) -6.65kB 0 bytes -100.0% 🗑️
assets/maintainer-workflow-DXgdGxxw.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/digest-panel-CCbk6rTm.js (Deleted) -6.15kB 0 bytes -100.0% 🗑️
assets/repos._owner._repo.quality-S7Qkc1PF.js (Deleted) -6.14kB 0 bytes -100.0% 🗑️
assets/docs-nav-BlIzMLO8.js (Deleted) -6.01kB 0 bytes -100.0% 🗑️
assets/docs.index-B0WcOk-b.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/api.index-DLwpJvJk.js (Deleted) -4.7kB 0 bytes -100.0% 🗑️
assets/docs-CK5pbQGa.js (Deleted) -2.7kB 0 bytes -100.0% 🗑️
assets/api-CyG75yOm.js (Deleted) -2.69kB 0 bytes -100.0% 🗑️
assets/docs-page-C3G0iEfn.js (Deleted) -2.1kB 0 bytes -100.0% 🗑️
assets/table-CZv0xQge.js (Deleted) -1.75kB 0 bytes -100.0% 🗑️
assets/app.workbench-61yEF8-c.js (Deleted) -1.58kB 0 bytes -100.0% 🗑️
assets/tabs-4WGVrzeG.js (Deleted) -1.39kB 0 bytes -100.0% 🗑️
assets/app.repos-DVj6_oee.js (Deleted) -1.07kB 0 bytes -100.0% 🗑️
assets/input-D9J2WXQd.js (Deleted) -796 bytes 0 bytes -100.0% 🗑️
assets/file-cog-Dop_7mwQ.js (Deleted) -758 bytes 0 bytes -100.0% 🗑️
assets/app.maintainer-Dm8n-jh-.js (Deleted) -502 bytes 0 bytes -100.0% 🗑️
assets/app.owner-IVMtAv_5.js (Deleted) -474 bytes 0 bytes -100.0% 🗑️
assets/app.commands-BWAUUWOc.js (Deleted) -455 bytes 0 bytes -100.0% 🗑️
assets/app.playground-DMsq4Zar.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/index-Dbsba8fU.js (Deleted) -438 bytes 0 bytes -100.0% 🗑️
assets/app.digest-Dtbar_vt.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/eye-off-B6WzhEjg.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/app.miner-1XOFPe9a.js (Deleted) -422 bytes 0 bytes -100.0% 🗑️
assets/key-round-DH1JGu5F.js (Deleted) -355 bytes 0 bytes -100.0% 🗑️
assets/bot-denl_M7C.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/trash-2-DaR2EU1B.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/save-BJ-b5LyN.js (Deleted) -327 bytes 0 bytes -100.0% 🗑️
assets/git-pull-request-arrow-irQTyjxI.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/list-checks-BHEhNgEx.js (Deleted) -279 bytes 0 bytes -100.0% 🗑️
assets/compass-Be02QJ3n.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/history-BL3pWnqF.js (Deleted) -237 bytes 0 bytes -100.0% 🗑️
assets/message-square-BGcb528s.js (Deleted) -233 bytes 0 bytes -100.0% 🗑️
assets/lock-JqKClIvJ.js (Deleted) -206 bytes 0 bytes -100.0% 🗑️
assets/rotate-cw-BZoK1WU4.js (Deleted) -201 bytes 0 bytes -100.0% 🗑️
assets/play-DvF2zpmk.js (Deleted) -190 bytes 0 bytes -100.0% 🗑️
assets/circle-check-DMw1swAr.js (Deleted) -178 bytes 0 bytes -100.0% 🗑️
assets/search-DxPOWxyH.js (Deleted) -174 bytes 0 bytes -100.0% 🗑️

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
packages/loopover-engine/src/focus-manifest.ts 93.33% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9608      +/-   ##
==========================================
- Coverage   90.27%   90.27%   -0.01%     
==========================================
  Files         904      906       +2     
  Lines      113213   113284      +71     
  Branches    26859    26881      +22     
==========================================
+ Hits       102202   102265      +63     
- Misses       9680     9684       +4     
- Partials     1331     1335       +4     
Flag Coverage Δ
backend 95.54% <100.00%> (+<0.01%) ⬆️
engine 67.87% <77.77%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
src/api/proof-badge.ts 100.00% <100.00%> (ø)
src/api/routes.ts 95.62% <100.00%> (+0.02%) ⬆️
src/auth/route-auth.ts 100.00% <100.00%> (ø)
src/openapi/spec.ts 99.31% <100.00%> (+<0.01%) ⬆️
src/review/proof-summary.ts 100.00% <100.00%> (ø)
src/signals/focus-manifest-loader.ts 95.83% <ø> (ø)
src/signals/focus-manifest.ts 99.60% <ø> (ø)
packages/loopover-engine/src/focus-manifest.ts 79.97% <93.33%> (+0.12%) ⬆️

... and 3 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 29, 2026
…d to honor (#9569)

Review caught the real defect: both handlers called
isProofPageEnabledForRepo(c.env) with no second argument, so the
ProofPageRepoOverride documented at length in proof-summary.ts and in the
PR body was never loaded or passed. Every repo was effectively
opt-out-less once the fleet flag was on -- a gate that is described,
typed, and unit-tested as a pure function, but never reachable from the
surface it governs. That is the registered-but-unreachable class, and the
long comment made it worse rather than better by making it look done.

- Adds a real `publicProof:` focus-manifest block (engine parser + toJson
  + loader snapshot), mirroring `publicStats:`/`ops:`. Precedence is
  deliberately the opposite of those two: read from the TARGET repo's
  manifest rather than the operator's self-repo, because the thing being
  opted out of is that repo's own page.
- loadProofPageRepoOverride resolves it, degrading a failed manifest load
  to "no override" -- a broken manifest never takes a page DOWN, which is
  the failure direction worth accepting here and is now stated in the
  doc comment rather than left implicit.
- Both routes load the override BEFORE anything else, so a repo that
  turned its page off does not have its decision records queried to build
  a summary that will be discarded.
- Documents the block in .loopover.yml.example, including the precedence
  and the opt-out default.

Tests that would have caught it: a repo opting out in its manifest now
gets 404 from BOTH routes with the fleet flag on, while a different repo
in the same fleet still serves 200 (the opt-out is per repo, not a kill
switch); explicit opt-in and no-block-at-all both serve; and the resolver
is covered across absent/explicit/failing loads.
…dflare Workers build

The Workers build for loopover-ui has been failing on every PR since #9521
(merged as #9590) made src/openapi/schemas.ts import
@loopover/contract/public-api:

  Cannot find module '.../node_modules/@loopover/contract/dist/public-api.js'
    imported from /opt/buildhome/repo/src/openapi/schemas.ts

ui:build builds ui-kit and engine, then runs ui:openapi -- but never builds
the contract package, so the import resolves to a dist/ that does not
exist. CI did not catch it because the GitHub workflow has its own
separate "Build contract package" step (ci.yml:361) before the drift
checks; the Cloudflare build runs npm run build:cloudflare -> ui:build
directly and gets no such step. The two paths had silently diverged.

Add @loopover/contract to the same turbo invocation that already builds
the engine, so the one script both paths share produces everything
ui:openapi imports.

Reproduced locally by deleting packages/loopover-contract/dist and running
ui:openapi (identical ERR_MODULE_NOT_FOUND), then confirmed the fixed
chain builds the package and writes the spec with no drift.
…ync the example template

Two failures from the #9569 manifest block, both mine.

1. The unknown-top-level-field validator never learned about `publicProof`,
   so every manifest carrying it warned "Manifest contains unknown
   top-level field: publicProof." That was invisible on the first pass and
   appeared on every LATER one, because the first pass parses a manifest
   with no such key while later passes reload the persisted snapshot --
   which my loader change now serializes the field into. The warning lands
   in the published review comment, so an unchanged PR got a fresh comment
   PATCH on every regate sweep: exactly the #3379 churn that test exists to
   prevent, reintroduced by a field the writer knew about and the reader
   did not.

   Found by instrumenting the test's PATCH interception to diff the two
   comment bodies rather than guessing at the cause; the added line named
   itself.

2. config/examples/loopover.full.yml must mirror .loopover.yml.example
   from "WHERE IT LIVES" onward, and I documented the block in only one of
   the two.

Verified against origin/main first to confirm both were regressions from
this branch rather than pre-existing.
…ow the gap exposed

Codecov flagged 8 uncovered changed lines across focus-manifest.ts and
routes.ts. I had measured coverage on proof-summary.ts and proof-badge.ts
only, and never on the two files the manifest block and the routes
actually touched -- so the gap was in my own verification, not just the
tests.

Closing it turned up a real defect rather than only missing assertions:
loadProofPageRepoOverride used `.catch()` on the injected manifest loader,
so a loader throwing SYNCHRONOUSLY (a driver-level failure before it ever
returns a promise) skipped the handler entirely and would have escaped to
the route -- 503ing a public page over a manifest read that is supposed to
be optional. That is the same defect this file already had in
loadProofSummary's section reads, which I fixed there and then
reintroduced here. Now a real try/catch, with a regression test using a
synchronously-throwing loader.

Coverage:
- parsePublicProofConfig / publicProofConfigToJson: explicit on/off, a
  present-but-empty block (present-but-false, which the resolver keys on),
  absence, three non-mapping shapes warning rather than throwing, and a
  snapshot round-trip.
- A regression test asserting publicProof is a KNOWN top-level field, so
  the writer/reader split behind the #3379 regate churn cannot return.
- The two route 503 arms are unreachable today (every inner read is
  individually fail-safe), so they are excluded with the house v8 pragma
  and a note on why they are kept: a future unguarded read should degrade
  to 503 rather than 500 on an unauthenticated public route. The badge arm
  uses ignore start/stop -- `next 2` miscounts across a multi-line comment
  and left the return uncovered.

All three changed files now report zero uncovered changed lines.
…e unreachable arms

Replaces the coverage pragmas with the fix they were papering over.

The gate, the read and the outcome now live in ONE resolver
(resolveProofPage) that both handlers render. That is not tidiness: the
gate previously lived inline in both route bodies and exactly one of them
was wired to the per-repo opt-out, which is the defect review caught. A
shared resolver makes "the page and the badge agree about whether this
repo is published" true by construction instead of by two call sites
remembering the same thing.

With that in place the two 503 arms were provably unreachable, because
loadProofSummary is TOTAL -- every read is wrapped per section, so a
failing ledger/anchor/record read degrades to that section's honest
neutral state and the page still composes. Rather than excluding dead
branches from coverage, the outcome is gone from the type: ProofPageResult
is `ok | disabled`. A test asserts the totality directly -- every
dependency failing at once, including a DB binding that throws on property
access, still resolves to a rendered page in its neutral states.

Same treatment for buildProofAccuracy's `!interval` guard: wilsonInterval
returns null exactly when there are no trials, which IS the
nothing-decided case, so one reachable guard covers both reasons a rate is
unpublishable instead of a dead branch behind a pragma.

Net: no `v8 ignore` pragmas anywhere in the #9569 code, and zero
uncovered changed lines or branches across proof-summary.ts, routes.ts and
focus-manifest.ts.
One import conflict in src/api/routes.ts: main widened the ledger-anchor
import with `publicAnchorStatus` (#9755's empty-anchor-list reason) while
this branch added the proof-summary and proof-badge imports beside it.
Both sides kept -- neither change displaces the other, and
`publicAnchorStatus` is used at routes.ts:1362 on main's side of the merge.

Verified after resolving rather than assuming a clean textual merge means
a clean semantic one: regenerated the OpenAPI spec (no drift), and ran
both sides' suites -- proof-summary, ledger-anchor-persistence, the
route/spec ratchet and auth -- 98 passing. docs-drift, engine-parity and
dead-source-files all clean.
@JSONbored
JSONbored merged commit 7ffb51e into main Jul 29, 2026
3 of 4 checks passed
@JSONbored
JSONbored deleted the feat/proof-page-9569 branch July 29, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant