Skip to content

feat(api): say why the public anchor list is empty instead of implying health - #9721

Merged
JSONbored merged 1 commit into
mainfrom
fix/anchor-status-visibility
Jul 29, 2026
Merged

feat(api): say why the public anchor list is empty instead of implying health#9721
JSONbored merged 1 commit into
mainfrom
fix/anchor-status-visibility

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

GET /v1/public/decision-ledger/anchors returns {"anchors":[]} — and has for the entire life of the endpoint — for three completely different situations:

  • anchoring was never configured (LOOPOVER_LEDGER_ANCHOR_KEYS unset; live /anchor-key returns {"keys":[],"currentKeyId":null}),
  • there is no ledger to anchor (live /verify reports tipSeq: 0, totalCount: 0),
  • it is configured and simply has not run yet.

From outside they are indistinguishable, and an empty list reads as a healthy one — so a silently misconfigured deployment looks exactly like a working one.

That is precisely the gap ledger-anchor-persistence.ts:1-6 set out to close ("an operator whose anchoring silently fails could quietly regress the ledger back to tamper-evident-only with no visible signal"). The guarantee only held after the scheduler's two guards passed, and both return without writing anything a reader can see: ledger-anchor-scheduler.ts:37 returns empty_ledger with no row, and :113-121 writes only a console.log.

The response now carries status: anchored | empty_ledger | unconfigured | pending. publicAnchorStatus is pure, and its guard order deliberately mirrors runScheduledLedgerAnchor's own — tip first, then signing key — so the published status always names the same reason the scheduler would act on, never a second opinion.

status is omitted on a filtered page: with ?backend= or ?before=, an empty result means "none matched", which is a different question from "is anchoring running at all", so answering the second one there would be misleading.

This is additive — existing consumers of anchors/nextBefore are unaffected — and it does not make anchoring work. Production will report empty_ledger, which is the honest answer; the two blockers behind that (deployment topology and an unprovisioned keypair) are #9719.

Refs #9719

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Coverage measured scoped: vitest run --coverage over public-ledger-anchors-route.test.ts + ledger-anchor.test.ts, restricted to src/review/ledger-anchor.ts100% statements / branches / functions / lines (51/51, 25/25, 16/16, 39/39). All four status arms are exercised end-to-end through the route, plus both sides of the filtered/unfiltered branch and both sides of the signing-key predicate (published key with no private half is still unconfigured).
  • OpenAPI regenerated and committed (ui:openapi), since the documented response shape changed.
  • No UI files touched, so ui:lint/ui:typecheck/ui:build were not run. test:workers, build:mcp, test:mcp-pack untouched by this diff; left to CI.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

status is a four-value enum derived from counts and a boolean — it publishes no key material, no private key state beyond configured-or-not, and no ledger content. unconfigured is exactly what /v1/public/decision-ledger/anchor-key already discloses by returning an empty key list, so this reveals nothing that endpoint does not. The route remains unauthenticated like its /v1/public/* siblings; the existing negative-path suite (public-decision-ledger-routes.test.ts) is unchanged and still passes. No UI file is touched, hence no UI Evidence table.

@loopover-orb

loopover-orb Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-29 06:37:55 UTC

5 files · 1 AI reviewer · 2 blockers · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This PR adds a `status` field (anchored/empty_ledger/unconfigured/pending) to the public anchors listing so an empty list can be disambiguated from a misconfigured or not-yet-run anchoring pipeline. The guard order in `publicAnchorStatus` deliberately mirrors `runScheduledLedgerAnchor`'s own checks (tip first, then signing key), which is a real trace-to-source correctness win, and the `status` field is correctly omitted on filtered pages where empty just means 'no match'. The extra `loadDecisionLedgerTip`/`parseAnchorPublicKeys` calls only run on the unfiltered first page, so there's no added cost on the common filtered/paginated path.

Nits — 5 non-blocking
  • src/api/routes.ts: `currentAnchorKey(keys) !== null && Boolean(c.env.LOOPOVER_LEDGER_ANCHOR_PRIVATE_KEY)` duplicates the exact predicate `runScheduledLedgerAnchor` uses inline (ledger-anchor-scheduler.ts) — consider extracting a shared `hasAnchorSigningConfigured(env)` helper so the two guard orders can't drift apart later.
  • The FAILED 'Workers Builds: loopover-ui' check has no detail provided and this branch is 1 commit behind default — likely caused by something that landed on default after this branch diverged rather than a defect in this diff; worth rebasing to confirm.
  • src/openapi/spec.ts:1906 (per external brief) — the literal `200` in the response map is standard OpenAPI convention, not a magic number needing a named constant; safe to ignore that flag.
  • Consider extracting the repeated 'has a usable signing key' predicate (private key + current published key) into one exported helper used by both `publicAnchorStatus`'s caller in routes.ts and `runScheduledLedgerAnchor`, to guarantee the two can never silently diverge.
  • The four new tests in `public-ledger-anchors-route.test.ts` cover all four status branches plus the filtered-page omission, which is exactly the coverage this change needs.

Concerns raised — review before merging

  • No linked issue detected: No closing reference or linked issue number was found in the PR metadata/body. — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue: This repo's maintainer focus manifest requires every PR to reference a tracked issue. — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected: No closing reference or linked issue number was found in the PR metadata/body. — If this PR is intended to solve an issue, link it explicitly in the PR body.

2. Maintainer requires a linked issue: This repo's maintainer focus manifest requires every PR to reference a tracked issue. — Link the relevant issue (for example `Closes #123`) before opening the PR.

Decision drivers

  • ❌ Code review — 2 blockers (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 14 registered-repo PR(s), 13 merged, 359 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 14 PR(s), 359 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is registered but has no active allocation in the current snapshot.
  • Public profile languages: not available
  • Official Gittensor activity: 14 PR(s), 359 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Then work through the remaining 4 steps in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Decision record
  • action: hold · clause: missing_linked_issue
  • config: a3b904ad2db66fa04eb3074b94fdc9ae63b7c24c2a340a61b41db78b6113eac5 · pack: oss-anti-slop · ci: passed
  • record: 07908037e4b09cc1ae0f2fc9132d9691f56fb6c849d44bdb0fbe917c5ae99833 (schema v5, head 612452f)
Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

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


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 29, 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 612452f Commit Preview URL

Branch Preview URL
Jul 29 2026, 06:23 AM

@JSONbored JSONbored self-assigned this Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 532 bytes (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
loopover-ui 7.8MB 532 bytes (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: loopover-ui

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/add-scalar-classes-B8jkvIOC.js (New) 2.16MB 2.16MB 100.0% 🚀
assets/tanstack-vendor-CbXPjA4n.js (New) 914.18kB 914.18kB 100.0% 🚀
openapi.json 265 bytes 714.75kB 0.04%
assets/docs.fumadocs-spike-api-reference-CmafM2sB.js (New) 443.45kB 443.45kB 100.0% 🚀
assets/AgentScalarChatInterface.vue-DpgaXYHW.js (New) 201.7kB 201.7kB 100.0% 🚀
assets/modal-CUMEquRb.js (New) 184.5kB 184.5kB 100.0% 🚀
assets/client-PGXnf1ab.js (New) 151.47kB 151.47kB 100.0% 🚀
assets/maintainer-panel-Br1divnW.js (New) 78.99kB 78.99kB 100.0% 🚀
assets/routes-NNo3zEi-.js (New) 35.96kB 35.96kB 100.0% 🚀
assets/owner-panel-BnXGn_cW.js (New) 27.92kB 27.92kB 100.0% 🚀
assets/app-C1oiDLp8.js (New) 25.78kB 25.78kB 100.0% 🚀
assets/ui-vendor-Bv8E9TLY.js (New) 24.57kB 24.57kB 100.0% 🚀
assets/miner-panel-D7XETEzT.js (New) 20.24kB 20.24kB 100.0% 🚀
assets/app.runs-z1syhmb4.js (New) 20.22kB 20.22kB 100.0% 🚀
assets/api._op-HVqlC0gN.js (New) 17.57kB 17.57kB 100.0% 🚀
assets/self-hosting-docs-audit-C-RHqLms.js (New) 16.6kB 16.6kB 100.0% 🚀
assets/docs._slug-Dyv5TniN.js (New) 15.52kB 15.52kB 100.0% 🚀
assets/playground-panel-IsIHUXPY.js (New) 14.42kB 14.42kB 100.0% 🚀
assets/fairness-DN3IcDMj.js (New) 10.73kB 10.73kB 100.0% 🚀
assets/app.audit-C_iO7XJV.js (New) 10.08kB 10.08kB 100.0% 🚀
assets/app.config-generator-EmKVVOif.js (New) 10.06kB 10.06kB 100.0% 🚀
assets/maintainers-diTdxcdM.js (New) 8.06kB 8.06kB 100.0% 🚀
assets/miners-z6A9gOTm.js (New) 7.91kB 7.91kB 100.0% 🚀
assets/agents-6Yq8QJTp.js (New) 7.74kB 7.74kB 100.0% 🚀
assets/commands-panel-D7u0DpBw.js (New) 6.65kB 6.65kB 100.0% 🚀
assets/maintainer-workflow-C-VJrimP.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/digest-panel-Cv8-DBZ1.js (New) 6.15kB 6.15kB 100.0% 🚀
assets/repos._owner._repo.quality-gYHp51EA.js (New) 6.14kB 6.14kB 100.0% 🚀
assets/docs-nav-DYdtMDg0.js (New) 6.01kB 6.01kB 100.0% 🚀
assets/docs.index-3KeyjlGo.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/api.index-CbZNmQKY.js (New) 4.7kB 4.7kB 100.0% 🚀
assets/docs-Pt2Gybdj.js (New) 2.7kB 2.7kB 100.0% 🚀
assets/api-sy9OYKlq.js (New) 2.69kB 2.69kB 100.0% 🚀
assets/docs-page-D2XN-jEy.js (New) 2.1kB 2.1kB 100.0% 🚀
assets/table-Du0hy88I.js (New) 1.75kB 1.75kB 100.0% 🚀
assets/app.workbench-ePyYVuZh.js (New) 1.58kB 1.58kB 100.0% 🚀
assets/tabs-CRmxscWf.js (New) 1.39kB 1.39kB 100.0% 🚀
assets/app.repos-_KArObCf.js (New) 1.07kB 1.07kB 100.0% 🚀
assets/input-BShMk9_D.js (New) 796 bytes 796 bytes 100.0% 🚀
assets/file-cog-BEIl5Oqb.js (New) 758 bytes 758 bytes 100.0% 🚀
assets/app.maintainer-BJwgwyPm.js (New) 502 bytes 502 bytes 100.0% 🚀
assets/app.owner-DlC9AeOR.js (New) 474 bytes 474 bytes 100.0% 🚀
assets/app.commands-B1WDDMiE.js (New) 455 bytes 455 bytes 100.0% 🚀
assets/app.playground-CTK0tAxr.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/index-CMvWI8d8.js (New) 438 bytes 438 bytes 100.0% 🚀
assets/app.digest-DDZbhbyh.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/eye-off-DjVl_MzB.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/app.miner-C3LxN3da.js (New) 422 bytes 422 bytes 100.0% 🚀
assets/key-round-DwkZyc2u.js (New) 355 bytes 355 bytes 100.0% 🚀
assets/bot-WXgFwPAA.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/trash-2-BvfVxnxI.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/save-CVWr0z8_.js (New) 327 bytes 327 bytes 100.0% 🚀
assets/git-pull-request-arrow-Bn2xV0OW.js (New) 321 bytes 321 bytes 100.0% 🚀
assets/list-checks-988MeTt_.js (New) 279 bytes 279 bytes 100.0% 🚀
assets/compass-DbJ4pD1l.js (New) 251 bytes 251 bytes 100.0% 🚀
assets/history-DB7NOJt2.js (New) 237 bytes 237 bytes 100.0% 🚀
assets/message-square-CxSMtwHk.js (New) 233 bytes 233 bytes 100.0% 🚀
assets/lock-9idW3DJz.js (New) 206 bytes 206 bytes 100.0% 🚀
assets/rotate-cw-DdND1Exv.js (New) 201 bytes 201 bytes 100.0% 🚀
assets/play-CNrdHCfA.js (New) 190 bytes 190 bytes 100.0% 🚀
assets/circle-check-ClWatChr.js (New) 178 bytes 178 bytes 100.0% 🚀
assets/search-DMls5ngy.js (New) 174 bytes 174 bytes 100.0% 🚀
assets/add-scalar-classes-Be7dtln8.js (Deleted) -2.16MB 0 bytes -100.0% 🗑️
assets/tanstack-vendor-CGSpsB5i.js (Deleted) -913.91kB 0 bytes -100.0% 🗑️
assets/docs.fumadocs-spike-api-reference-DTLtPPeF.js (Deleted) -443.45kB 0 bytes -100.0% 🗑️
assets/AgentScalarChatInterface.vue-iGEdSZeI.js (Deleted) -201.7kB 0 bytes -100.0% 🗑️
assets/modal-*.js (Deleted) -184.5kB 0 bytes -100.0% 🗑️
assets/client-CVCtmw1n.js (Deleted) -151.47kB 0 bytes -100.0% 🗑️
assets/maintainer-panel-BjOTlahS.js (Deleted) -78.99kB 0 bytes -100.0% 🗑️
assets/routes-DA54I6Le.js (Deleted) -35.96kB 0 bytes -100.0% 🗑️
assets/owner-panel-BxuMiuCn.js (Deleted) -27.92kB 0 bytes -100.0% 🗑️
assets/app-AU--k-vI.js (Deleted) -25.78kB 0 bytes -100.0% 🗑️
assets/ui-vendor-BQS1Zftn.js (Deleted) -24.57kB 0 bytes -100.0% 🗑️
assets/miner-panel-CqM7MPS5.js (Deleted) -20.24kB 0 bytes -100.0% 🗑️
assets/app.runs-CeYgmORT.js (Deleted) -20.22kB 0 bytes -100.0% 🗑️
assets/api._op-BFQWfcn9.js (Deleted) -17.57kB 0 bytes -100.0% 🗑️
assets/self-hosting-docs-audit-CvXT8jki.js (Deleted) -16.6kB 0 bytes -100.0% 🗑️
assets/docs._slug-DgmQKj7f.js (Deleted) -15.52kB 0 bytes -100.0% 🗑️
assets/playground-panel-Dj7muM7P.js (Deleted) -14.42kB 0 bytes -100.0% 🗑️
assets/fairness-dmwQ4n4o.js (Deleted) -10.73kB 0 bytes -100.0% 🗑️
assets/app.audit-DpZEfpKc.js (Deleted) -10.08kB 0 bytes -100.0% 🗑️
assets/app.config-generator-BlMIdWhd.js (Deleted) -10.06kB 0 bytes -100.0% 🗑️
assets/maintainers-Dst5ojPo.js (Deleted) -8.06kB 0 bytes -100.0% 🗑️
assets/miners-Dzmljb2C.js (Deleted) -7.91kB 0 bytes -100.0% 🗑️
assets/agents-Dpk_gj0x.js (Deleted) -7.74kB 0 bytes -100.0% 🗑️
assets/commands-panel-B8Gi4y1P.js (Deleted) -6.65kB 0 bytes -100.0% 🗑️
assets/maintainer-workflow-C0crBeos.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/digest-panel-BXuwCicO.js (Deleted) -6.15kB 0 bytes -100.0% 🗑️
assets/repos._owner._repo.quality-CCza5CtT.js (Deleted) -6.14kB 0 bytes -100.0% 🗑️
assets/docs-nav-tyQcMghf.js (Deleted) -6.01kB 0 bytes -100.0% 🗑️
assets/docs.index-Cj6CZCAs.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/api.index-Be00UFYE.js (Deleted) -4.7kB 0 bytes -100.0% 🗑️
assets/docs-DI0mpBC2.js (Deleted) -2.7kB 0 bytes -100.0% 🗑️
assets/api-De8cjXIF.js (Deleted) -2.69kB 0 bytes -100.0% 🗑️
assets/docs-page-DdqdagYF.js (Deleted) -2.1kB 0 bytes -100.0% 🗑️
assets/table-CEn13uEB.js (Deleted) -1.75kB 0 bytes -100.0% 🗑️
assets/app.workbench-CCXUmRT5.js (Deleted) -1.58kB 0 bytes -100.0% 🗑️
assets/tabs-CsSviwlD.js (Deleted) -1.39kB 0 bytes -100.0% 🗑️
assets/app.repos-DAdwTweL.js (Deleted) -1.07kB 0 bytes -100.0% 🗑️
assets/input-BqPvSDz1.js (Deleted) -796 bytes 0 bytes -100.0% 🗑️
assets/file-cog-DUOq-S_7.js (Deleted) -758 bytes 0 bytes -100.0% 🗑️
assets/app.maintainer-DNYF1pQP.js (Deleted) -502 bytes 0 bytes -100.0% 🗑️
assets/app.owner-CHOzQ_gj.js (Deleted) -474 bytes 0 bytes -100.0% 🗑️
assets/app.commands-ByWQs0vO.js (Deleted) -455 bytes 0 bytes -100.0% 🗑️
assets/app.playground-DNsmpRJM.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/index-Cz0cCEOv.js (Deleted) -438 bytes 0 bytes -100.0% 🗑️
assets/app.digest-BM904ls-.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/eye-off-dAjfDE0F.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/app.miner-rRCgHu8S.js (Deleted) -422 bytes 0 bytes -100.0% 🗑️
assets/key-round-lxONSK7S.js (Deleted) -355 bytes 0 bytes -100.0% 🗑️
assets/bot-DPCo-rju.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/trash-2-DZtAjewF.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/save-9KzIkFPF.js (Deleted) -327 bytes 0 bytes -100.0% 🗑️
assets/git-pull-request-arrow-x6aMbwhE.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/list-checks-D_5FQ8RJ.js (Deleted) -279 bytes 0 bytes -100.0% 🗑️
assets/compass-Cf1utcRQ.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/history--DHChrMH.js (Deleted) -237 bytes 0 bytes -100.0% 🗑️
assets/message-square-ByGHetBo.js (Deleted) -233 bytes 0 bytes -100.0% 🗑️
assets/lock-DJ30kMKk.js (Deleted) -206 bytes 0 bytes -100.0% 🗑️
assets/rotate-cw-G_yqUkAE.js (Deleted) -201 bytes 0 bytes -100.0% 🗑️
assets/play-BERm0GS4.js (Deleted) -190 bytes 0 bytes -100.0% 🗑️
assets/circle-check-CrXj_H86.js (Deleted) -178 bytes 0 bytes -100.0% 🗑️
assets/search-Ssscojx0.js (Deleted) -174 bytes 0 bytes -100.0% 🗑️

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.45%. Comparing base (5ecb771) to head (612452f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9721      +/-   ##
==========================================
- Coverage   90.27%   89.45%   -0.82%     
==========================================
  Files         904      904              
  Lines      113177   113185       +8     
  Branches    26840    26847       +7     
==========================================
- Hits       102171   101255     -916     
- Misses       9676    10842    +1166     
+ Partials     1330     1088     -242     
Flag Coverage Δ
backend 94.06% <100.00%> (-1.48%) ⬇️

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

Files with missing lines Coverage Δ
src/api/routes.ts 95.59% <100.00%> (+<0.01%) ⬆️
src/openapi/spec.ts 99.30% <ø> (ø)
src/review/ledger-anchor.ts 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

…g health

`GET /v1/public/decision-ledger/anchors` returned `{"anchors":[]}` for three
completely different situations — anchoring was never configured, there is no
ledger to anchor, or it is configured and simply has not run yet. From outside
they were indistinguishable, and an empty list reads as a healthy one, so a
silently misconfigured deployment looked exactly like a working one.

That is the gap ledger-anchor-persistence.ts's own header set out to close
("an operator whose anchoring silently fails could quietly regress the ledger
back to tamper-evident-only with no visible signal"): the guarantee only held
AFTER the scheduler's two guards passed, and both of those return without
writing anything a reader can see.

The response now carries `status`: anchored | empty_ledger | unconfigured |
pending. The predicate is pure and its guard order deliberately mirrors
runScheduledLedgerAnchor's own — tip first, then signing key — so the published
status always names the same reason the scheduler would act on rather than
offering a second opinion.

Only computed for an unfiltered first page: with a backend/before filter an
empty page means "none matched", which is a different question from "is
anchoring running at all", so `status` is omitted there rather than answering
the wrong one.

Refs #9719
@JSONbored
JSONbored force-pushed the fix/anchor-status-visibility branch from d8117a5 to 612452f Compare July 29, 2026 06:21
@JSONbored
JSONbored merged commit e95afc0 into main Jul 29, 2026
11 checks passed
@JSONbored
JSONbored deleted the fix/anchor-status-visibility branch July 29, 2026 06:47
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