Skip to content

test(pr-merge): pin clear-escalations' lane causes against the person codes - #10392

Merged
kyle-sexton merged 1 commit into
mainfrom
test/lane-causes-person-codes-agree
Oct 27, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
test/lane-causes-person-codes-agree

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: decided follow-up to #10198/#10249 (LANE_CAUSES vs babysit_risk.PERSON_CODES SSOT)

Summary

clear-escalations.mjs lifts a recorded hold only when its cause is on LANE_CAUSES, an explicit list kept apart from babysit_risk.PERSON_CODES and PERSON_PREFIXES, the reasons only a person clears. Nothing checked that the two lists never overlap, so a person reason added to LANE_CAUSES.risk would have been cleared automatically.

Fix

  • New lane-causes-person-codes.test.mjs reads PERSON_CODES and PERSON_PREFIXES from babysit_risk (python3 -I) and asserts for every LANE_CAUSES.risk entry: an exact entry is not a person code and does not start with a person prefix; a prefix entry (ending in ":") neither prefixes nor is prefixed by any person code or prefix.
  • A separate test asserts the Python read returned non-empty sets, so a broken import cannot pass vacuously.
  • The LANE_CAUSES comment now says the test pins the explicit list against the person sets (the list stays explicit, so it fails closed).

Verification

  • node --test .github/scripts/pr-merge/*.test.mjs: 520 tests, 520 pass, 0 fail.
  • Fail-first: adding "files-capped" to LANE_CAUSES.risk fails with lane cause files-capped is a person code; adding "high-path:" fails with lane prefix high-path: overlaps person high-path:. Both reverted.
  • scripts/check-cant-fail-scan.sh against the merge base: PASS, 1 changed test file, no gating findings.
  • scripts/check-changelog-fragments.sh --check-required origin/main: no fragment required.

Left out: CI lanes, which run on the PR.

Related

Follows #10198 and #10249.

🤖 Generated with Claude Code

… codes

A node test reads babysit_risk.PERSON_CODES and PERSON_PREFIXES and fails when a
LANE_CAUSES.risk entry is a person reason or a prefix that overlaps one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 27, 2026 01:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T01:02:36.429320Z 8e610eb Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 8e610eb64f55b51400d848ab1c1b3b256197e7b0: 0 finding(s), 0 as inline comments.

No security issues found.

critical-findings: 0

  • .github/scripts/pr-merge/clear-escalations.mjs is a trusted path and a merge-hold control. I read the whole change and it only rewrites a comment above LANE_CAUSES. No code, list entry or constant changes, so the control does not widen or weaken. I judged that from the code, not from the PR text.
  • The new lane-causes-person-codes.test.mjs only adds a check. It fails if a LANE_CAUSES.risk entry overlaps babysit_risk.PERSON_CODES or PERSON_PREFIXES. It runs python3 -I -c with fixed arguments and a path derived from import.meta.url. No PR-controlled or untrusted input reaches the subprocess or the shell. It imports only repository code, and -I isolates the interpreter.
  • The test has a guard against passing vacuously: a separate test fails if the Python read returns empty code or prefix sets.
  • No plugin manifests changed, so there are no manifest lines to report.
  • No prepaid-spend or cost change.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 8e610eb64f55b51400d848ab1c1b3b256197e7b0: 0 finding(s), 0 as inline comments.

No findings. The PR adds lane-causes-person-codes.test.mjs and updates the LANE_CAUSES comment in clear-escalations.mjs. I read both changes against babysit_risk.py.

  • Person sets: PERSON_CODES is at line 1084 and PERSON_PREFIXES at line 1085, and both are non-empty at import. The test reads them correctly, and its non-empty guard stops a broken Python read from passing vacuously.
  • Overlap logic: for exact LANE_CAUSES.risk entries it checks both exact membership in PERSON_CODES and the person-prefix match. For prefix entries (ending in :) it checks overlap in both directions. That matches how laneCause matches codes (code.startsWith(entry) for prefixes, === otherwise).
  • Scope: the test checks only LANE_CAUSES.risk, which is correct because every person code is a risk reason. verdict entries are verify:* codes and are not person-set members.
  • Comment change: it is accurate and removes the stale "to become the single source" note.
  • Verification: I did not run the tests. The 520-pass and fail-first results in the PR description are the author's claims and unverified by me.
  • Cost: none. The change adds a test only and spends no billed resources.
  • Closing issues: the PR closes none.

@kyle-sexton
kyle-sexton enabled auto-merge October 27, 2026 01:04
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit f897d77 Oct 27, 2026
70 checks passed
@kyle-sexton
kyle-sexton deleted the test/lane-causes-person-codes-agree branch October 27, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant