feat(policy): enforce strict PR ready contract#39
Merged
Conversation
Add a shared PR contract validator, local agent preflight/ready wrappers, and route reusable policy workflows through the same validator. Gate expensive repo-required-gate jobs behind the cheap PR contract on pull_request events and make bot body injection scaffold-only so placeholders cannot pass accidentally. Refs #36
Declare repo-required-gate doc-only inputs consumed by the shared PR contract validator, and let run-pr-contract=false explicitly bypass contract-gated downstream jobs. Refs #36 Co-Authored-By: Codex <noreply@openai.com>
ArchonVII
marked this pull request as ready for review
May 31, 2026 21:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent:close-preflightandagent:pr-readywrappers so agents cannot promote malformed PRs through the blessed path.repo-required-gateandpr-policythrough the shared validator, and gate expensive PR jobs behind the cheap PR contract while preserving the explicit opt-out path.Verification
npm testVerification Notes
Vitest completed locally with 5 files and 76 assertions. The PR-contract CLI accepted a valid synthetic pull_request payload. The close-preflight and pr-ready wrapper scripts both validated PR #39 successfully; pr-ready was run with
--dry-run. PyYAML parsed the modified reusable workflows and caller examples.actionlintwas unavailable locally through PATH,npx actionlint, and Go tooling in this environment, so syntax coverage uses YAML parsing plus repository tests.Docs / Changelog
README and
contracts/pr-template.mddocument the new wrapper path and canonical scaffold. This repo does not currently use changelog fragments.Linked Issue
Closes #36