Skip to content

ci: call core's pr-triage workflow and move the risk list to levels (v2) - #252

Merged
bketelsen merged 3 commits into
mainfrom
duncan/pr-triage-caller
Nov 9, 2026
Merged

bketelsen merged 3 commits into
mainfrom
duncan/pr-triage-caller

Conversation

@frostyard-machines

Copy link
Copy Markdown
Contributor

Summary

This pull request moves frostyard/pilothouse to frostyard/core's PR triage workflow, as the owner wave of core ADR-0076, ADR-0077 and ADR-0078 asks (background: core#218).

  • Caller. .github/workflows/risk-paths.yml (workflow name now PR triage, job pr-triage) calls frostyard/core/.github/workflows/pr-triage.yml at c996ea3fb54bcf1a3c621113522213702a7673e2 (core#225). On each pull request it adds 1 label level:L1 to level:L4 and risk:high for L1 and L2 (ADR-0078), removes ready-for-human when the head moves after the label or when the label comes while CI is not green (ADR-0077), and writes a shadow comment on patch and minor Dependabot updates (it never merges). The labeled trigger is new; the file keeps its name.
  • List. .github/risk-paths.json moves to schema version 2: default_level L3, governance: entries L2, all other entries L1. No glob is removed.
  • Vendored matcher. scripts/lib/risk-paths.mjs is copied again from core at c996ea3 and pinned in scripts/check-template.mjs.
  • Template gate. scripts/check-template.mjs and test/check-template.test.mjs take the change of bketelsen/agentic-template#9 at 712c29a: the list must be version 2, the caller must call core's pr-triage.yml at a full SHA in the job pr-triage, and the list and the caller globs must be L1 or L2 (rule C of core's risk-paths spec). The template pull request is still open; if it changes before it merges, a later copy takes the merged version.
  • Docs. AGENTS.md (Security and risk paths), docs/design/agent-workflows.md, docs/quality.md and docs/org-adrs.md describe the levels, the PR triage caller and head-bound readiness, and list core ADR-0076, ADR-0077 and ADR-0078. The rules stay: never remove risk:high (or a level label) to make a pull request ready, and name each matched path in the body.
  • No CI change: Lint, Security Scan, Unit Tests, Race Detection, Verify and both Build jobs already run on every pull request with no path filter and no secret. packaging.yml, image-tier and vm-boot stay out of the required checks.
  • Why texts. 9 why texts started with words that are not categories of core's risk-paths spec, rule B (which v2 checks for L1 and L2 entries). They now start with spec categories: supply chain: to update verification: (mise.toml, mise.lock), release: to publication: (.svu.yml, .goreleaser.yaml, scripts/bump.sh), and install:/privileged:/security: to auth: (packaging/**, cmd/pilothoused/**, internal/broker/**, internal/auth/**). The globs do not change, and all 9 stay at L1.

The required status check names for this repository go on frostyard/core#222 (ADR-0076) after this pull request's CI is green. Until an admin creates the level labels, the caller adds only risk:high and writes a warning (ADR-0078).

Risk tier

  • Risk tier: 4 (Critical), per docs/risk-tiers.md.
  • Rationale: the change edits a pull_request_target workflow that holds pull-requests: write, and the risk-path list that guards the root broker, PAM auth, packaging and release paths; a safeguard takes the tier of what it protects, and risk:high applies.
  • Tier 3/4 evidence: token permissions stay least-privilege (top-level permissions: {}, the job keeps contents: read and pull-requests: write, as before). Threat: pull_request_target runs the base caller and the base list; core's reusable workflow checks out nothing and runs no PR code, so a PR cannot change its own level or labels. It cannot approve or merge. Every Tier 4 path stays in the list at L1, so it still gets risk:high. Rollback: revert this pull request; the old caller pin in git history works unchanged.

Matched risk paths (list at the base) and why each change is safe

Path Matching glob (why) Why the change is safe
.github/risk-paths.json .github/risk-paths.json (governance: the high-risk path list) Schema version 2 by core ADR-0078's grading rule: default_level L3, each governance: entry L2, every other entry L1. No glob is removed and none is looser than L2, so each path that gets risk:high today still gets it.
.github/workflows/risk-paths.yml .github/workflows/** (governance: CI, the risk-paths caller and token permissions) Same trigger (pull_request_target, plus labeled), permissions: {} at the top, the job keeps contents: read and pull-requests: write only. It calls core's pr-triage.yml at the full SHA c996ea3 (core#225); the reusable workflow checks out nothing and runs no code from the PR. It is not a required check.
scripts/check-template.mjs scripts/check-template.mjs (governance: the template verification gate) Taken from bketelsen/agentic-template#9 (head 712c29a): it pins the new risk-paths.mjs copy and adds checks (list at schema version 2, caller pin and job name, rule C levels). It only makes the gate stricter.
scripts/lib/risk-paths.mjs scripts/lib/** (governance: the vendored risk-path validator and matcher) A byte copy of frostyard/core scripts/lib/risk-paths.mjs at c996ea3 (sha256 6df0af00…cdfa43, pinned in scripts/check-template.mjs). The old exports keep their v1 results.

Verification

  • make verify (umask 022): the template gate (33 Node tests), tidy, vet, format, golangci-lint (0 issues), govulncheck and go test ./... pass. The sdjournal tag build fails on this host only: it has no systemd/sd-journal.h (unchanged by this pull request); CI builds it.
  • Revert test (rule C and the caller checks): in a scratch worktree at the head, scripts/check-template.mjs from main (its risk-paths.mjs pin moved to c996ea3 only), then node --test test/check-template.test.mjs fails 4 tests on their assertions: caller glob at level L3 exits 1, caller that renames the job exits 1, caller that still pins core's risk-paths workflow exits 1, risk-path list of schema version 1 exits 1.

The caller now pins frostyard/core/.github/workflows/pr-triage.yml at
c996ea3 (core#225): it adds a level label and risk:high for L1 and L2,
and removes ready-for-human when the head moves (core ADR-0077, ADR-0078).
.github/risk-paths.json moves to schema version 2 by ADR-0078's grading
rule (governance entries L2, the others L1, default L3).
scripts/lib/risk-paths.mjs is copied again from core c996ea3 with its pin,
and the template gate checks rule C through checkRequiredPaths, so a list
or caller glob at L3 or L4 fails (core docs/specs/risk-paths.md, C).
The caller now runs core's pr-triage.yml: it adds a level label and
risk:high for L1 and L2, and removes ready-for-human when the head moves
(core ADR-0077, ADR-0078). docs/org-adrs.md lists core ADR-0076 to
ADR-0078.
scripts/check-template.mjs and its test now match the template's change at
712c29a: the list must be schema version 2 and the caller must run core's
pr-triage.yml at a full SHA in the job pr-triage, besides rule C.
@github-actions github-actions Bot added the risk:high Touches a high-risk path (ADR-0068) label Nov 9, 2026
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@frostyard-machines

Copy link
Copy Markdown
Contributor Author

Cross-review: openai/gpt-6.1-sol (read-only), at head 7ce7c55955022a15bd87d0d4037a4969cb94fdac. Coders: claude-opus-5.5 (common commit, template gate copied from bketelsen/agentic-template#9) and deepseek-flash (docs). Result: Ready, blocking: none, findings: none. Checked: all 15 v1 globs unchanged and in order at L1 or L2 (governance at L2), the new why categories are valid under core's risk-paths rule B and fit their paths, the list and caller are L1/L2, the caller matches core's documented caller, and scripts/lib/risk-paths.mjs matches core at c996ea3 (sha256 6df0af00…cdfa43; excluded from the line-by-line review). Revert test: 4 targeted template tests fail with the old scripts/check-template.mjs (see the body).

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 9, 2026
@bketelsen
bketelsen merged commit 8e5376b into main Nov 9, 2026
20 checks passed
@frostyard-machines
frostyard-machines deleted the duncan/pr-triage-caller branch November 9, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a high-risk path (ADR-0068)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants