Skip to content

feat(risk-paths): check the category of each L1 and L2 why in the gate (rule B) - #255

Merged
bketelsen merged 1 commit into
mainfrom
lucilla/risk-paths-why-categories
Nov 14, 2026
Merged

bketelsen merged 1 commit into
mainfrom
lucilla/risk-paths-why-categories

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rule B of the risk-paths spec says that each why of an entry at L1 or L2 (each entry of a version 1 list) names 1 category, or 1 protected-boundary identifier where policies/agent-governance.json has boundaries. Until now only a review checked it, so lists with supply chain, security, native code or filesystem passed every gate.

  • scripts/lib/risk-paths.mjs: new exports WHY_CATEGORIES, protectedBoundaryIds(policy) (reads protected_boundaries[].id and protectedBoundaries[]) and checkWhyCategories(list, boundaries). A why names a name when, trimmed, it is the name or starts with the name and a colon. validateRiskPaths is unchanged, so its version 1 results stay the same for the repositories that vendor it. The levels step does not call the new check.
  • scripts/check-risk-paths.mjs: runs rule B with the boundaries of policies/agent-governance.json (new --policy PATH), skips it when the policy does not parse, and reports the number of L1/L2 entries it checked.
  • .github/workflows/pr-triage.yml: the embedded library copy, rewritten by npm run sync:risk-paths-workflow (no hand edit).
  • docs/specs/risk-paths.md: rule B says which gate checks the name, and how; the derived-artifacts rows list the new exports.
  • docs/specs/pr-triage.md: 1 line: a PR that a workflow opens or pushes with GITHUB_TOKEN starts no workflow (GitHub docs).

Lists that fail the new check today

Source: .github/risk-paths.json and policies/agent-governance.json at the default branch of every non-archived repository of frostyard and bketelsen (gh repo list, 333 repositories; 36 have a list, all version 2, all valid), checked with checkWhyCategories from this branch on 2026-11-14. 3 lists fail; none of them has a governance policy with boundaries:

Repository Failing L1/L2 entries Names used
bketelsen/agentic-template 2 supply chain (mise.toml, mise.lock)
frostyard/frostui 7 supply chain, security, native code
frostyard/pocket 14 supply chain, secrets, security, filesystem, filesystem and destructive operations

The 33 other lists pass, snosi and lab included (their names are boundaries of their own policies). This PR changes none of these repositories: their gates use a vendored copy of the library pinned by sha256, so nothing turns red until an owner re-vendors and calls checkWhyCategories.

Risk tier

Risk tier: 3 — risk:high: the PR touches risk paths.

Matched paths in core's .github/risk-paths.json at the base, and why the change is safe:

  • scripts/lib/risk-paths.mjs (L2, quality-gates): only adds exports; no existing function changes. The levels and readiness steps do not call the new code, so the labels that the workflow adds do not change.
  • scripts/check-risk-paths.mjs (L2, quality-gates): the gate gets stricter, not looser; core's own list passes it (17 of 17 entries name a boundary of core's policy).
  • .github/workflows/pr-triage.yml (L2, workflow-and-permissions; org floor): only the embedded library text changes, written by the sync script; no step, trigger, permission or action pin changes.

Docs housekeeping

  • No new doc; the 2 edited specs keep their links.

Verification

  • make ci green (942 tests, 0 failures), before the first push
  • node scripts/check-corrections.mjs --root . --base origin/main: ok corrections: 53 records, append-only vs origin/main
  • node scripts/check-risk-paths.mjs: ok risk_paths: 17 entries, 17 at L1 or L2 name a category or boundary, workflow in sync
  • Docs-site skill unchanged (scaffold test not run)
  • No hand-written text reader is added (the inputs are parsed JSON)
  • Workflow change is the synced library copy only

Revert test (scratch worktree from the PR head, tests kept):

  • scripts/check-risk-paths.mjs from origin/main: node --test test/risk-paths.test.mjs fails 5 tests on assertions, among them check-risk-paths fails on an L1 why with no category, such as supply chain and check-risk-paths checks the protected boundaries of the governance policy.
  • checkWhyCategories that returns []: 10 tests fail, among them checkWhyCategories: a v1 entry with no category fails, such as supply chain and checkWhyCategories: the category must start the why and end or meet a colon.

Corrections report (node scripts/corrections-report.mjs --root . --ref HEAD --json): 53 records, 0 pending, so core has no record with an empty promoted_to to fill.

…e (rule B)

Rule B of docs/specs/risk-paths.md says that each why of an entry at L1 or
L2 names 1 category, or 1 protected-boundary identifier where the
governance policy has boundaries. Only a review checked it, and lists with
'supply chain', 'security' and 'native code' passed every gate.

Add WHY_CATEGORIES, protectedBoundaryIds and checkWhyCategories to the
library, and call them from scripts/check-risk-paths.mjs with the
boundaries of policies/agent-governance.json. validateRiskPaths keeps its
version 1 results, and the pr-triage levels step does not call the check.

Also state in docs/specs/pr-triage.md that a PR made with GITHUB_TOKEN
starts no workflow.
@github-actions github-actions Bot added level:L2 Read the diff risk:high Touches a path in .github/risk-paths.json labels Nov 14, 2026
@frostyard-machines

Copy link
Copy Markdown
Contributor Author

Cross-review

  • Reviewer: openai/gpt-6.1-sol (read-only). Coder: anthropic/claude-opus-5-5.
  • Base 433f9e6b7903b993a8b1b506fccbfd363757ae9d, head 9ac81d2b160b21248af929691763dbc8ae9f8d56; all 6 changed paths read, the risk paths first. The reviewer compared the embedded copy in .github/workflows/pr-triage.yml with the library: verbatim, and no other workflow line changed.
  • Result: Ready, no findings. Blocking: none.
  • CI at this head: docs-gate, fleet-conventions, scaffold-e2e, pr-triage / pr-triage pass.

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 14, 2026
@bketelsen
bketelsen merged commit 2210957 into main Nov 14, 2026
6 checks passed
@bketelsen
bketelsen deleted the lucilla/risk-paths-why-categories branch November 14, 2026 12:57
bketelsen pushed a commit to frostyard/frostui that referenced this pull request Nov 14, 2026
Core's risk-path spec, rule B, lists the categories that the why of an
L1 or L2 entry must start with, and core's checkWhyCategories
(frostyard/core#255) rejects any other word. Three entries used words
that rule B does not have:

- opener.go: security -> auth (what the system's handlers may open)
- appid_linux.go: native code -> auth (the program identity that the
  desktop sees); the native-code reason stays in the text
- launch_linux.go: native code -> auth (which desktop app the kit
  starts); the native-code reason stays in the text

Every glob and every level stays the same. AGENTS.md now says that an
L1 or L2 why starts with a rule B category.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L2 Read the diff ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants