Repository navigation
Wire or remove the unproven claim_authors fallback in gate-state trust check #180
Description
Background
PR #177 (issue #166) shipped the durable per-issue gate-state substrate, including isTrustedGateStateAuthor(login, trust). The primary trust rule is login === trust.self_login, where self_login comes out of band from gh api user --jq .login and cannot be forged by a commenter. There is a documented fallback, trust.claim_authors, intended for GitHub App installation tokens where gh api user 403s, restricted to authors of a claim comment that is fresh (< CLAIM_STALE_SECONDS) or whose batch: matches the current run's target.
Confirmed still true at HEAD: the pinned jq in the gate-state probe (gateStateProbeCommandLine) only ever selects ## Gate State blocks, never claim comments, so every production call site passes claim_authors: []. docs/architecture/gate-hygiene.md describes the fallback as if it functions for installation-token deployments, but in the shipped code it's dead — the fallback branch is fed by no one.
Two compounding issues to resolve together
-
No producer. Either extend the pinned jq with a second projection to fetch claim blocks (e.g.
claim_blocks: [.comments[] | select((.body|startswith("## Ticketmill Claimed")) or (.body|startswith("## Batch Processing Claimed"))) | {body, author_login: .author.login}] | .[-2:]) so JS can deriveclaim_authorsdeterministically with the freshness/batch restriction, or drop the fallback from the trust check and correctgate-hygiene.mdto stop describing it as functional. -
Fail-open on empty
self_login. Ifself_loginis empty (thegh api user403 case this fallback exists for) and a block'sauthor_loginis also missing,login === trust.self_loginevaluates'' === ''— true — so an empty read makes everything trusted. This is the opposite of the intended fail-closed direction. Require a non-emptyself_loginbefore any comparison, and give the "blocks exist but none is trusted" case its own name in the state table (code review's suggestion:malformedwithtrusted: false) with a covering fixture.
Impact today
Zero — this repo's PAT-based self_login resolves fine, and the current failure direction (unresolved trust check degrades a block to found (untrusted author), never silently-trusted) is safe for PAT deployments. This becomes load-bearing the moment the consumer-wiring follow-up (seeding ctx.metrics/ctx.settled from parsed gate state) lands, so it should be resolved before or alongside that tier, and is required before any installation-token deployment.
Source
Raised in spec review iteration 1 and code review (non-blocking notes) on PR #177, and as a major finding in contrarian approach-challenge iteration 3 on issue #166.
Activity