Skip to content

Truth gate reports bare invalid_payload and discards the collector's diagnostics, stranding ~47 open PRs #1286

Description

@groupthinking

Problem

47 of the 69 open PRs fail agent-completion/truth-gate with a bare invalid_payload and no remediation path. Authors cannot act on it, so PRs accumulate. Example — PR #1270:

{"verdict":"blocked","reasons":["invalid_payload"],
 "details":{"invalid_fields":["policy.agent_login","policy.run_id"]}}

Root cause

  1. agentTaskApplicable() (.github/workflows/pr-checks.yml:1904) classifies any branch matching /^(?:agent|claude|codex|copilot|jules)[/-]/i as agent work. Human-authored Claude Code worktree branches (claude/determined-maxwell-*) are therefore held to the full AgentTask provenance contract.
  2. With no linked AgentTask issue, expectedAgentLogin / expectedRunId (parsed from the issue body's Agent Login / Agent Run ID sections, pr-checks.yml:2162-2165) resolve empty, so the payload carries policy.agent_login: null and policy.run_id: null.
  3. The collector does record the real cause in collection_errors: missing_linked_issue, missing_closing_issue_reference, missing_agent_run_id, missing_agent_login (pr-checks.yml:2166-2176).
  4. evaluate() returns at the schema check (scripts/ci/agent_completion_gate.py:246) and discards themcollection_errors is only read at line 260, after the early return.

Confirmed by reproduction against the exact PR #1270 payload, and by the fact that this issue's own PR uses a fix/ branch prefix and passes the same gate with not_applicable: all rules passed.

Acceptance criteria

  • A blocked invalid_payload verdict includes the collector's collection_errors in details.
  • verdict and reasons are unchanged for every input — the gate stays fail-closed and no blocked verdict becomes ready.
  • Non-list, blank, and absent collection_errors are tolerated without raising.
  • Regression tests cover the real-world cascade and the tolerance cases.

Declared files

  • scripts/ci/agent_completion_gate.py
  • tests/unit/test_agent_completion_gate.py

Focused test paths

  • tests/unit/test_agent_completion_gate.py

Out of scope

Changing the agentTaskApplicable() branch-name heuristic itself. That over-triggering is real and worth a separate decision (should PR authorship gate it, rather than branch name alone?), but it changes which PRs are policed, whereas this issue only changes what the gate says.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions