Skip to content

pre-pr-gate-hook: .quality-gate-pass marker friction in the sprint flow (per-item rewrite, unreachable env bypass, stale markers) #202

Description

@lwalden

Problem

The pre-pr-gate-hook blocks gh pr create unless a fresh .quality-gate-pass marker (within ~60 min, in the Bash-tool CWD) exists — a second artifact separate from the judge verdict the sprint flow already produces (.quality-review-result.json, decision=pass). Three frictions observed:

  1. Per-item rewrite required. The sprint TEST flow writes .quality-review-result.json but not the marker; the pipeliner must (re)write .quality-gate-pass for the current item before every gh pr create.
  2. Env bypass unreachable. AAM_PR_GATE_BYPASS=1 exported in the Bash-tool shell does not reach the hook — the hook runs as a harness-spawned process that doesn't inherit the tool shell's env.
  3. Stale markers falsely unlock. A leftover marker from a prior item (or prior sprint) is present on disk; it must be explicitly removed/overwritten so it can't gate the wrong item.

Evidence (dungeon-game Sprint 13)

Every one of the 5 PRs (#179#183) required the pipeliner to detect a stale marker (e.g. an S13-001 marker still on disk when creating the S13-004 PR), delete it, and write a fresh per-item marker before gh pr create would pass. The env-var bypass was tried and confirmed non-functional.

Impact

Each PR carries avoidable pipeliner steps + a failure-then-retry on the first gh pr create. Easy to get wrong (wrong-item marker → false pass).

Recommended fix (any one)

  1. Hook reads the judge verdict directly — have pre-pr-gate-hook consult .quality-review-result.json (item + decision) instead of requiring a separate freshness marker.
  2. Orchestrator stamps the marker during TEST — fold a per-item .quality-gate-pass write (with stale-marker removal) into the documented TEST→REVIEW handoff so the pipeliner never has to.
  3. Make the env bypass actually reach the hook, and document it.

Related: #200, #180 (docs-only PR gate handling).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions