Problem
agent-completion/truth-gate scores a pull request against the frozen intent snapshot on its linked issue. That snapshot is written only by the snapshot-agent-task-intent job, which is gated on:
if: >-
github.event_name == 'issues' &&
(github.event.action == 'labeled' || 'edited' || 'unlabeled')
It never runs on pull_request_target. So a PR with no linked issue has no snapshot, no declared agent_login, and no declared run_id. scripts/ci/agent_completion_gate.py then hard-requires all three:
for field in ("agent_login", "run_id"):
value = policy.get(field)
if not isinstance(value, str) or not value.strip():
invalid_fields.append("policy." + field)
The verdict is invalid_payload, permanently, and no action available to the author can change it.
agentTaskApplicable() arms that state from pull-side provenance alone — a claude/, codex/, jules/ or agent/ branch prefix, a known bot author, or a lock manifest. A branch naming convention is not a dispatch, so PRs that never had a contract to satisfy get measured against one that was never written.
Impact
The check is red on essentially every PR, including merged ones. #1368 — the current tip of main — merged with:
context: agent-completion/truth-gate/pr-1368
state: failure
desc: gate-owner:51596082965 invalid_payload
A check that is red on everything gates nothing and hides real failures behind constant noise. .github/workflows/agent-completion-enforcement.yml already warns about exactly this in its own comments:
Reporting those as failure makes this check permanently red on 100% of pull requests, which destroys its signal value and hides real build/test failures behind constant noise.
Its sibling workflow handles the same situation correctly, reporting neutral when the trust policy is unprovisioned. The truth gate reports failure.
Downstream, this contributed to PRs never leaving draft and being re-created rather than landed — the backlog drained in #1377 (61 open → 28).
Expected behaviour
Pull-side provenance should arm the gate only when a linked issue exists to verify against. With no linked issue there is nothing to measure, so the verdict should be not_applicable, not blocked.
This must not weaken enforcement: a PR that links a dispatched issue stays fully gated, and the requirement that a PR bind to a focused issue at all is separately owned by the Canonical issue and evidence / PR Governance checks, which state requirements an author can actually satisfy.
Acceptance criteria
Scope
.github/workflows/pr-checks.yml — agentTaskApplicable() (both copies)
tests/unit/test_agent_completion_gate.py
Related
Supersedes the two competing implementations #1154 and #1364, consolidated in #1377.
Problem
agent-completion/truth-gatescores a pull request against the frozen intent snapshot on its linked issue. That snapshot is written only by thesnapshot-agent-task-intentjob, which is gated on:It never runs on
pull_request_target. So a PR with no linked issue has no snapshot, no declaredagent_login, and no declaredrun_id.scripts/ci/agent_completion_gate.pythen hard-requires all three:The verdict is
invalid_payload, permanently, and no action available to the author can change it.agentTaskApplicable()arms that state from pull-side provenance alone — aclaude/,codex/,jules/oragent/branch prefix, a known bot author, or a lock manifest. A branch naming convention is not a dispatch, so PRs that never had a contract to satisfy get measured against one that was never written.Impact
The check is red on essentially every PR, including merged ones. #1368 — the current tip of
main— merged with:A check that is red on everything gates nothing and hides real failures behind constant noise.
.github/workflows/agent-completion-enforcement.ymlalready warns about exactly this in its own comments:Its sibling workflow handles the same situation correctly, reporting
neutralwhen the trust policy is unprovisioned. The truth gate reportsfailure.Downstream, this contributed to PRs never leaving draft and being re-created rather than landed — the backlog drained in #1377 (61 open → 28).
Expected behaviour
Pull-side provenance should arm the gate only when a linked issue exists to verify against. With no linked issue there is nothing to measure, so the verdict should be
not_applicable, notblocked.This must not weaken enforcement: a PR that links a dispatched issue stays fully gated, and the requirement that a PR bind to a focused issue at all is separately owned by the
Canonical issue and evidence/PR Governancechecks, which state requirements an author can actually satisfy.Acceptance criteria
not_applicable[aw]issue #1130)tests/unit/test_agent_completion_gate.pycovers both directions of the linked-issue ruleScope
.github/workflows/pr-checks.yml—agentTaskApplicable()(both copies)tests/unit/test_agent_completion_gate.pyRelated
Supersedes the two competing implementations #1154 and #1364, consolidated in #1377.