You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(proof): public per-repo proof summary, endpoint and README badge (#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.
Copy file name to clipboardExpand all lines: apps/loopover-ui/public/openapi.json
+76Lines changed: 76 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26252,6 +26252,82 @@
26252
26252
}
26253
26253
}
26254
26254
}
26255
+
},
26256
+
"/v1/public/repos/{owner}/{repo}/proof": {
26257
+
"get": {
26258
+
"operationId": "getPublicRepoProof",
26259
+
"tags": [
26260
+
"Public"
26261
+
],
26262
+
"summary": "Public proof summary for one repo — ledger status, anchor, calibration with coverage and interval, sample records",
26263
+
"parameters": [
26264
+
{
26265
+
"schema": {
26266
+
"type": "string"
26267
+
},
26268
+
"required": true,
26269
+
"name": "owner",
26270
+
"in": "path"
26271
+
},
26272
+
{
26273
+
"schema": {
26274
+
"type": "string"
26275
+
},
26276
+
"required": true,
26277
+
"name": "repo",
26278
+
"in": "path"
26279
+
}
26280
+
],
26281
+
"responses": {
26282
+
"200": {
26283
+
"description": "ProofSummary. Any accuracy figure carries its coverage AND a Wilson confidence interval; below the sample floor it is an explicit `insufficient_data` state, never a bare percentage. Carries the verification-boundary statement in the payload"
26284
+
},
26285
+
"404": {
26286
+
"description": "The proof page is disabled fleet-wide, or this repo has opted out"
26287
+
},
26288
+
"503": {
26289
+
"description": "Composition failed — no partial or fabricated summary is served"
Copy file name to clipboardExpand all lines: src/openapi/spec.ts
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1906,6 +1906,32 @@ export function buildOpenApiSpec() {
1906
1906
200: {description: "{ anchors: [{ id, seq, rowHash, keyId, backend, backendRef, status, error, createdAt }], nextBefore } — a failed attempt is returned identically to a successful one, never filtered out or reshaped"},
1907
1907
},
1908
1908
});
1909
+
registry.registerPath({
1910
+
method: "get",
1911
+
path: "/v1/public/repos/{owner}/{repo}/proof",
1912
+
operationId: "getPublicRepoProof",
1913
+
tags: ["Public"],
1914
+
summary: "Public proof summary for one repo — ledger status, anchor, calibration with coverage and interval, sample records",
200: {description: "ProofSummary. Any accuracy figure carries its coverage AND a Wilson confidence interval; below the sample floor it is an explicit `insufficient_data` state, never a bare percentage. Carries the verification-boundary statement in the payload"},
1918
+
404: {description: "The proof page is disabled fleet-wide, or this repo has opted out"},
1919
+
503: {description: "Composition failed — no partial or fabricated summary is served"},
0 commit comments