chore: enforce native stacked pull requests - #1
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5f356e754
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pull_request_target: | ||
| types: [opened, reopened, synchronize, edited, closed, ready_for_review, converted_to_draft, stacked, unstacked] | ||
| push: | ||
| branches: ["master"] |
There was a problem hiding this comment.
Trigger reconciliation on the actual default branch
When this setup is installed on this repository's main trunk—the available repository refs contain main and no master—merging the setup PR cannot trigger this workflow through pull_request_target because the workflow was not yet on the default branch, and the post-merge push is excluded by this master-only filter. Consequently, the initial policy reconciliation does not run automatically and subsequent default-branch pushes remain uncovered; generate this filter from the audited default branch or allow pushes to any branch.
AGENTS.md reference: AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
| const clean = (body || '').replace(/<!--[\s\S]*?-->/g, '').replace(/```[\s\S]*?```/g, ''); | ||
| const lines = clean.split(/\r?\n/).filter(x => /^Depends on:/i.test(x.trim())); |
There was a problem hiding this comment.
Ignore all Markdown code blocks when parsing declarations
For PR bodies that include a tilde-fenced or four-space-indented example containing Depends on:, this parser treats the example as a real declaration because it strips only triple-backtick fences and then trims indentation. Such a body can have exactly one declaration outside code blocks as required by docs/stacked-prs.md, yet the policy rejects it for having multiple lines; parse Markdown code blocks consistently or also exclude these supported block forms.
Useful? React with 👍 / 👎.
Dependent changes now use native GitHub stacks, while focused independent changes may use a standalone PR. Add shared Codex instructions, dependency declarations, a trusted metadata-only Stack policy controller, and the stack workflow runbook.
The controller validates native membership, immediate parents and ancestry, and rechecks open PRs after changes. It never checks out PR code. Branch protection is activated only after this setup lands and the controller succeeds.
Validation: policy unit and mocked-controller tests passed locally; existing repository CI must pass before merge.
Depends on: none