Checks subsystem audit: live and fully wired, not dead infrastructure (statuses, wct_ tokens, checks page, merge gating) #504
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#504
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Verdict: checks is a LIVE, fully-wired subsystem — not dead infrastructure
Investigated whether anything in walhub writes to or consumes the checks subsystem today (statuses,
wct_tokens, checks page, merge gating). Conclusion: every layer is composed, routed, and consumed on both the write and read paths. No dead code found. The only "quiet" aspect is that nothing inside walhub produces statuses — they arrive exclusively from external CI callers via thewct_token API, which is by design (05 is the consumer half of an external-CI contract, the same shape as Forgejo statuses + Woodpecker).Evidence (commit
8819057)Write path — external CI via
wct_tokens:cmd/walhub/checks.go—chainChecksregisters thewct_credential in the server auth chain (checks.ClaimToken/ParseCIToken→ unprivilegedchecks.CIPrincipalNameprincipal), prefix-disjoint fromwgt_/Bearer/Basic.cmd/walhub/checks.go:37—api.RegisterExposed(checks.ExposedTemplates...);internal/checks/exposed_test.gopins the discovery templates incl./{owner}/{repo}/api/checks/statuses/{sha}(POST = the status writer) and the admin token-management pair…/api/checks/tokens,…/api/checks/tokens/{id}.internal/checks/auth.go— bearer/Basic extraction, secret verification against the repo's token record, real 401 on malformedwct_shapes.internal/server/auth_extra_test.go:11— server Seams test names checks'wct_tokens as the seam's first consumer.Composition:
cmd/walhub/collab.go:184-193—newChecksService(st, ident, pullsSvc, reg, cfg.Git.Binary)wired at composition;collab.go:335-336chains the handler onto the server.cmd/walhub/notify.go:89-92—wireNotifyFanoutsubscribes the notify fanout tochecks.Notify/checks.Streamevents (05 §8 failure/error fan-out);internal/notify/emit.go:88(EmitCheck).Merge gating (fail-closed consumer):
internal/pulls/checks.go:18-53—ChecksGateseam;pulls.Service.checkRequiredChecksGateis fail-closed: arequire_checksrule with no checks backend fails the merge.internal/pulls/merge.go:174—runMergeinvokescheckRequiredChecksGateon every merge.internal/pulls/pulls.go:180-182—Checksfield on the pulls service, satisfied by*checks.Service(asserted atcmd/walhub/checks.go:109).UI consumption:
web/src/pages/Checks.jsx— the/:owner/:name/checkspage (paged index, state pills, expandable per-context rows, state/context filters); live frames ride the repo collab stream and invalidate index + sha views. Exports the sharedCheckPill.web/src/pages/Repo.jsx:167— "Checks" tab in the repo navigation.web/src/pages/Settings.jsx:809-902— admin-only CI-tokens tab (tab 5): list/create/revoke ofwct_tokens.web/src/pages/Pull.jsx:584-764— head-sha combined view + per-context rows,require_checksadvisory union over policy rules matching the base branch, and "blocking merge: …" display ofchecksBlockers; merge flow invalidateschecksKey().web/src/pages/Commit.jsx:218-220— per-commit checks toggle (CheckDetail.jsx).web/sdk/src/checks.js— full SDK surface: combined, statuses, paged index (all no-store), plus CI-token admin calls, riding/{o}/{r}/api/checks….What "in use" would require
Nothing in walhub itself. The write path is already open to external CI: create a
wct_token in repo Settings → CI tokens, thenPOST /{owner}/{repo}/api/checks/statuses/{sha}withAuthorization: Bearer wct_…. "In use" on any real repo is purely an ops/CI-configuration step (point Woodpecker or a script at the endpoint) — there is no implementation prerequisite inside walhub. The only internal consumer that can create check data is that external POST; nothing else in the tree writes statuses.Acceptance criteria
Verdict recorded for review in PR #509 (#509): docs-only Decisions entry in docs/features/05_checks_statuses.md. Key claims spot-checked before recording — checks.ClaimToken wiring (cmd/walhub/checks.go:61-72), ExposedTemplates registration (cmd/walhub/checks.go:37), ChecksGate fail-closed (internal/pulls/checks.go:18-50), merge call site (internal/pulls/merge.go:174), composition (cmd/walhub/collab.go:193,336). No code changes.
Review of PR #509 (branch fix/issue-504, commit
c3af8ce) — docs-only verdict record for #504.SCOPE: one file, one insertion — docs/features/05_checks_statuses.md Decisions entry. No code touched. Matches the issue acceptance criteria (verdict recorded, file:line evidence, no code changes).
VERDICT FIDELITY: entry accurately records the issue verdict — live/composed/routed/consumed on write+read paths, external-CI-by-design (nothing inside walhub produces statuses; wct_ token POST is the only writer), no dead code, static-investigation-only. No overclaim found.
SPOT-CHECKS (main checkout, independent):
STYLE: Decisions-section format matches neighbors (bold lead + Forgejo #504 ref + rationale), appended after the #271 entry, before Explicitly-out-of-scope. AGENTS.md law 12 satisfied (decision appended with rationale in same change as the work it records; docs-only change needs no code companion).
MERGE HYGIENE: branch is exactly 1 commit ahead of main; hunk context matches main tip (applies cleanly). Main worktree left untouched (read-only review).
No findings blocking merge.
Recorded by PR #509 (review clean; verdict fidelity + independent spot-checks pass), merged. Closing.