Skip to content

pr-schema-gate: an exit-0 validator that printed UNCHECKED is not a clean run - #469

Merged
EdbertChan merged 1 commit into
mainfrom
stack/EdbertChan/fix/unchecked-is-not-clean/pr-schema-gate-exit-0-validator-printed-unchecked--02517d06
Sep 12, 2026
Merged

pr-schema-gate: an exit-0 validator that printed UNCHECKED is not a clean run#469
EdbertChan merged 1 commit into
mainfrom
stack/EdbertChan/fix/unchecked-is-not-clean/pr-schema-gate-exit-0-validator-printed-unchecked--02517d06

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

The PR-text gate now speaks up when a validator exits 0 without actually checking anything.

Tonight a PR description went to GitHub after the validator printed UNCHECKED: PR body rules not checked (drafter-core not installed) and exited 0. The gate saw exit 0 and said nothing, so an unchecked body read as a checked one.

The gate already had an unchecked outcome for this exact situation; the exit-0 branch just never looked at the output it had already collected. It does now, and a matching rule says the same thing for any tool that can answer from a degraded source.

Review Claim

An exit-0 validator run that prints an unchecked or skipped marker is reported as unchecked, not clean.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

The hook stays advisory: this path routes into the existing unchecked message and blocks nothing. A genuine exit-0 pass with no marker still reports clean, pinned by the negative test.

Slice Rationale

One claim, one hook, plus the always-loaded rule it enforces. The prose and the code ship together so the rule is not documented without a check behind it.

Non-goals

  • No change to the failure path or to any blocking behavior.
  • No new hook; the degraded-source detector for other tools stays on the backlog.
  • No change to which validator the gate runs.

Test Plan

Test Plan
  • python3 -m unittest test_advisory -k exit_zero_with_an_unchecked against origin/main's detect.py — AssertionError: 'could not check' not found in '', FAILED (failures=1), exit 1
  • python3 -m unittest discover -s engine/hooks/pr-schema-gate/tests -v with the fix — Ran 99 tests … OK, exit 0
  • python3 engine/skills/make-pr/scripts/preflight.py --base origin/mainunit engine-runtime: 3 file(s), ok preflight passed, exit 0

Revert Plan

Revert Plan
  • Safe to revert? Yes
  • Revert command: git revert <sha>
  • Post-revert steps: None; the gate returns to reporting clean on exit 0
  • Data migration? No

🤖 Generated with Claude Code

https://claude.ai/code/session_01DtqAxtTmdoRE7CD5BXdGbp


Note

Low Risk
Advisory-only hook behavior fix with unit tests; no blocking paths or validator selection changes.

Overview
pr-schema-gate no longer treats a validator that exits 0 as a clean pass when its stdout/stderr says the PR body was never checked (e.g. UNCHECKED: … not installed). Those runs now use the existing unchecked advisory path with a message that the validator exited 0 without checking.

The hook scans collected validator output with VACUOUS_PASS_RE (UNCHECKED, SKIPPED, not installed, no rules loaded) before returning clean. A genuine pass with no such markers stays silent; tests cover the false pass and the negative case.

engine/CLAUDE.core.md adds a matching evidence rule: exit 0 and printed data are not enough when a tool can answer from a cache, replica, or offline mode—show stderr/exit code or name the source, and re-read after restarts.

Reviewed by Cursor Bugbot for commit c4e55c0. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_a8f9e190-f368-4b38-a49b-254f93bf27ad)

…lean run

A PR description was written to GitHub after the validator printed
"UNCHECKED: PR body rules not checked (drafter-core not installed)" and
exited 0. check_body_file returned "clean" on exit 0 without reading the
output lines it had already collected.

Also adds the always-loaded rule this enforces: a command can succeed and
still answer from a degraded source.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtqAxtTmdoRE7CD5BXdGbp
Change-Id: I02517d067693d20cac52b5f67ddde1e7bbe6b563
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/fix/unchecked-is-not-clean/pr-schema-gate-exit-0-validator-printed-unchecked--02517d06 branch from 3561b7d to c4e55c0 Compare September 12, 2026 06:35
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5989d203-b0d8-4155-981a-01119d777863)

@mergify

mergify Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@EdbertChan
EdbertChan merged commit 9f08b69 into main Sep 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant