Skip to content

refactor(ci): break the admit and size-split import cycle with issue-spec.mjs - #18440

Merged
kyle-sexton merged 4 commits into
mainfrom
refactor/issue-spec-module
Nov 23, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
refactor/issue-spec-module

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: candidate 14 of an /architecture:improve deepening pass over the CI lanes, run in a local session.

Summary

intake-triage/size-split.mjs imported 14 names from admit.mjs while admit.mjs imported size-split.mjs: an import cycle between the admission gate and the split rules.

Fix

  • The spec and trust readers both modules need (specOf, personChecks, taskItems, withoutItems, taskLinesOf, trustedTaskLines, parentOf and their helpers), the drift spec readers trustedSpecTexts calls, and splitChildBody with its helpers (it calls trustedTaskLines) move unchanged into the new .github/scripts/intake-triage/issue-spec.mjs: 81 declarations, 605 lines out of admit.mjs. The moved code is byte-identical apart from comments and export on 7 helpers admit.mjs still needs.
  • decide, charge detection, driftIssueId, driftShaped and authorTrust stay in admit.mjs.
  • size-split.mjs imports nothing from admit.mjs. admit.mjs (37 names) and size-split.mjs (8 names) re-export the moved names, so their other importers do not change.
  • resolve-pr.mjs, write-issue.mjs, check-blockers.mjs and refine.mjs import from issue-spec.mjs.
  • issue-spec.mjs joins the hold floor as enforcement, the class of its importers; sync-hold-floor.py regenerated the floor copies and the pins moved. No workflow sparse-checkout or copy list names these modules, so no trust path changes.

Reasons kept from deleted comments

  • A model eval run spends subscription usage or promotional credits, which stop at a limit and never bill (owner direction 2026-11-02), so it goes to the host queue; only one naming a billing account (BILLED) can bill the owner, so it is an owner decision. unrunnableCriteria tries a paid eval first so a billed eval on a named host still reaches the owner.
  • A live Claude Code CLI run is unrunnable: the lane's Bash runs only named wrappers, and a nested CLI gets no credential.
  • A comment in place of a file change is unrunnable: resolve-issue cannot write the tracker, and its pull request is the deliverable.
  • unrunnableRulesOf throws on a malformed rules file so admission fails closed rather than admit an item a row holds.
  • specOf reads the first SPEC_COMMENTS (100) comments because pr-verify reads those and stops on an issue with more.
  • refinementSpec counts only the newest lanes App refinement, and only while unedited; resolve-pr.mjs linkedIssues shares the rule and also requires the comment to predate the pull request.
  • personChecks honors a split record only when its items are exactly the ones the lane cannot perform and at least one is left, so a record never drops a runnable criterion; the body is never edited.
  • plainText drops invisible characters because a copied refinement breaks :// and www. with a zero-width space so no link renders.
  • trustedSpecTexts counts the texts pr-verify reads as spec; no other Bot or App text counts except a size-split sub-issue body.
  • vendoredDriftSpecText names no skill or script, so a new vendored row needs no change to the spec text.

Verification

  • New issue-spec.test.mjs walks the static imports: size-split.mjs reaches issue-spec.mjs but not admit.mjs, and issue-spec.mjs reaches neither. Re-adding an admit.mjs import to size-split.mjs fails it.
  • node --test --test-concurrency=4 over the size-split (with split-child.vectors.json), admit, refine, resolve-pr, write-issue, check-blockers and other importer suites: 3216 pass, 0 fail. The floor and trust Python suites pass.
  • plan-test-lanes.sh --base origin/main ends unmapped=0; the can't-fail scan passes on the 3 changed test files.

Follow-ups

  • Pre-existing (advisory): importers of the re-exported names (label-unblocked, fix-ci-context, apply-verdict, tests, and node calls in the Python and shell suites) can point at issue-spec.mjs directly so the re-exports drop; prose naming admit.mjs specOf or size-split.mjs splitChildBody (babysit_verify_evidence.py docstrings, pr-pipeline.schema.json:1187) still resolves through them.

Related

Part of the .github deepening series; follows #18349 (size-split module) and #18432 (lane vocabulary).

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 23, 2026 08:01
size-split.mjs imported 14 names from admit.mjs while admit.mjs imported
size-split.mjs. The spec and trust readers both need, plus splitChildBody
(trustedSpecTexts calls it and it calls trustedTaskLines), move unchanged
into intake-triage/issue-spec.mjs. size-split.mjs now imports nothing from
admit.mjs; admit.mjs and size-split.mjs re-export the moved names their
other importers still take from them. issue-spec.test.mjs walks the static
imports to prove the cycle is gone. issue-spec.mjs joins the hold floor as
enforcement, beside its importers.

Reasons kept from deleted comments:
- A model eval run spends subscription usage or promotional credits, which
  stop at a limit and never bill (owner direction 2026-11-02), so it goes
  to the host queue; only one naming a billing account (BILLED) can bill
  the owner, so it is an owner decision. unrunnableCriteria tries a paid
  eval first so a billed eval on a named host still reaches the owner.
- A live Claude Code CLI run is unrunnable: the lane's Bash runs only named
  wrappers, and a nested CLI gets no credential.
- A comment in place of a file change is unrunnable: resolve-issue cannot
  write the tracker, and its pull request is the deliverable.
- unrunnableRulesOf throws on a malformed rules file so admission fails
  closed rather than admit an item a row holds.
- specOf reads the first SPEC_COMMENTS (100) comments because pr-verify
  reads those and stops on an issue with more.
- refinementSpec counts only the newest lanes App refinement, and only
  while unedited; resolve-pr.mjs linkedIssues shares the rule and also
  requires the comment to predate the pull request.
- personChecks honors a split record only when its items are exactly the
  ones the lane cannot perform and at least one is left, so a record never
  drops a runnable criterion; the body is never edited.
- plainText drops invisible characters because a copied refinement breaks
  :// and www. with a zero-width space so no link renders.
- trustedSpecTexts counts the texts pr-verify reads as spec; no other Bot
  or App text counts except a size-split sub-issue body.
- vendoredDriftSpecText names no skill or script, so a new vendored row
  needs no change to the spec text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated hold-floor blocks taken from main and regenerated with
scripts/sync-hold-floor.py; floor pins recomputed as main's counts plus
the branch's issue-spec.mjs enforcement row (classes 162, enforcement 66,
review 66).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated hold-floor blocks taken from main and regenerated with
scripts/sync-hold-floor.py; floor pins recomputed as main's counts plus
the branch's issue-spec.mjs enforcement row (classes 165, enforcement 67,
review 67). Test-scope lines keep main's paths plus issue-spec.mjs;
engine-d.test.sh also scopes resolve-config predicate.mjs and
vocabulary.mjs, which the suite reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 23, 2026 18:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T18:23:01.222440Z 14d2225 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-review reviewed 14d222562db1a36b2f2b5e51c3c5c51ce63391e1: read 19 of 19 changed file(s); 0 finding(s), 0 as inline comments.

Code review: #18440, refactor(ci): break the admit and size-split import cycle with issue-spec.mjs

No findings. I read all 19 changed files in .claude-lane/pr.diff. Under "Inputs", the diff file was the only source: this lane has no shell or GitHub access.

What I checked

  • Code moved without changes. I compared each removed block in admit.mjs and size-split.mjs with its copy in the new issue-spec.mjs (spec readers, trust rules, the drift-spec texts, unrunnableCriteria and its pattern table, personChecks, trustedSpecTexts, splitChildBody and its helpers). Apart from removed comments and the added export keywords, the code matches. Two spacing typos (DRIFT_TITLE =/^…, driftIssue =() are left to the formatter.
  • Relative URLs still resolve. issue-spec.mjs sits in the same intake-triage/ directory. So the paths it builds from import.meta.url still point at the same files: ../../actions/resolve-config/unrunnable-rules.json, ../../actions/resolve-config/admission-rules.json and ../../../scripts/upstream-drift-vendored-report.sh.
  • Re-exports cover what was removed. All 37 names removed from admit.mjs are in its export { … } from "./issue-spec.mjs" list, and none is also declared locally in admit.mjs, so no export is duplicated. The 8 names removed from size-split.mjs are re-exported the same way. Nothing left in size-split.mjs uses humanActor, tickedForms, scopeTargets or SOURCE. admit.mjs still uses readFileSync and fileURLToPath (in readSchedule and the charge-word loader). createHash moved with bodyVersion.
  • No cycle. issue-spec.mjs imports only ../lib/lane-vocabulary.mjs. issue-spec.test.mjs checks this by walking the static imports.
  • Importers switched. resolve-pr.mjs, write-issue.mjs, check-blockers.mjs and refine.mjs now take the moved names from issue-spec.mjs and keep the rest from admit.mjs and size-split.mjs.
  • Hold floor. The new enforcement row appears in all four places: merge-holds.mjs HOLD_PATH_CLASSES, docs/conventions/pr-pipeline.yaml, the generated hold_patterns in pr-require-checks.yml, and the trusted-path lists in both hosted review workflows. The count pins went from 164 to 165 and from 66 to 67, and the digests changed to match.
  • Deleted comments (REVIEW.md, "A deleted comment that recorded why…"). Most of the design reasons in the removed comments are either listed under "Reasons kept from deleted comments" in the PR body or pinned by tests in admit.test.mjs and refine.test.mjs. Examples are the Open issues noun-phrase rule, the retention-period exemption and the page-host refusal. I found no reason that is recorded nowhere, so I raise no finding.

I did not run anything. The author's test results (3216 pass, unmapped=0) are their claim and I have not verified them.

Closing issue: none. The PR says it closes no issue, so there are no acceptance criteria to check.

Loosened checks. None found. The pin changes in test_floor_paths.py and test_diff_risk.py track one extra hold-floor path, which makes the floor stricter. The test-scope lines added in engine-d.test.sh and test_babysit_triage_verdict_trust.py widen what triggers those suites, which is also stricter. One thing the PR body does not mention: engine-d.test.sh also adds resolve-config/predicate.mjs and vocabulary.mjs to its test scope.
Loosened checks would be marked: fail (default; the prompt had no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. The prompt had no loosened_check_decision_record: line either, so I did not check whether a citation was required.

Plugin manifests: the diff changes none.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 14d222562db1a36b2f2b5e51c3c5c51ce63391e1: read 19 of 19 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #18440, the admit / size-split import-cycle refactor

I found no security issues. I read all 19 changed files in full.

What changed. The spec and trust readers move unchanged from admit.mjs and size-split.mjs into a new .github/scripts/intake-triage/issue-spec.mjs. I compared the moved code line by line with what was removed. Only comments, export keywords and whitespace differ (for example DRIFT_TITLE =/^…). This held for each of these:

  • the trust predicates writtenBy, humanActor, ownAgentText, actionsBotOnly, driftIssue / driftShape, refinementSpec / appRefinement, countedRefinement, personChecks, trustedSpecTexts, trustedTaskLines and splitChildBody with its helpers;
  • the unrunnableCriteria patterns, including BILLED and the paid-eval check;
  • loadRules and its own-agent identity checks;
  • specOf and SPEC_COMMENTS.

What the moved code still reads.

  • Config files. new URL("../../actions/resolve-config/…", import.meta.url) and REPORT_SCRIPT now resolve from issue-spec.mjs. That file sits in the same directory as admit.mjs, so they still reach the default branch's admission-rules.json, unrunnable-rules.json and scripts/upstream-drift-vendored-report.sh.
  • Imports. REFINE_MARKER and ACTIONS_BOT_ID come from ../lib/lane-vocabulary.mjs, the same module admit.mjs imports them from (admit.mjs:152).
  • Callers. resolve-pr.mjs, write-issue.mjs, check-blockers.mjs and refine.mjs import the same names from the new module, and admit.mjs and size-split.mjs re-export them for their other importers.

Trust controls.

  • Merge hold floor. The change only widens it. issue-spec.mjs is added as enforcement in four places:

    • merge-holds.mjs HOLD_PATH_CLASSES
    • docs/conventions/pr-pipeline.yaml merge path classes
    • the generated hold_patterns in pr-require-checks.yml
    • the review hold-path lists in pr-review-hosted.yml and pr-review-security-hosted.yml

    The floor pin and count tests move from 164 to 165 and from 66 to 67 to match. I found no glob removed or reclassified.

  • Trusted-base checkouts. No workflow sparse-checkout or copy list names admit.mjs or size-split.mjs (I searched .github/workflows). So the new import cannot mix base and head code in a trusted checkout.

  • Untouched controls. No trusted-actor list, token scope, kill switch, permissions: block or manifest changes. The test-scope header edits in engine-d.test.sh and the Python tests only decide which tests run.

Other checks. Prior findings: none (this is the lane's first review of the PR). The PR description contains no embedded instructions aimed at the lane.

critical-findings: 0

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 26545bd Nov 23, 2026
89 of 103 checks passed
@kyle-sexton
kyle-sexton deleted the refactor/issue-spec-module branch November 23, 2026 19:31
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant