Skip to content

fix(pr-unblock): stage every module a base-script activity loads - #18664

Merged
kyle-sexton merged 15 commits into
mainfrom
fix/stage-base-activity-import-closure
Nov 24, 2026
Merged

kyle-sexton merged 15 commits into
mainfrom
fix/stage-base-activity-import-closure

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

No related issue: staging gaps found by the test in #18660

Summary

A script activity runs from a base copy under $RUNNER_TEMP, staged by collect-base-activity. That copy held the script's own directory at base-script/, plus a hand-kept list of siblings (lib/, pr-merge/merge-holds.mjs, apply-patch/cdn-paths.mjs, and the write runner's apply-base copies). Any load outside that list failed at run time:

  • report-escalation.sh could not load ../pr-merge/refire-refused.mjs. Its stderr goes to /dev/null, so the workflow-modified refusal hold never fired. It also skipped the API budget wrapper, because ../../../.github/actions/log-api-budget/api-budget.bash did not resolve.
  • declare-test-scope.mjs (fix-test-scope) could not load ../maintenance-reconcile-lost-runs/infra-failure.mjs or rate-guard.mjs.
  • address-feedback.mjs's dynamic imports of pr-verify/resolve-pr.mjs, intake-triage/admit.mjs and rate-guard.mjs failed. The scripts that import it are apply-dependency-verdict, publish-feedback, resolve-threads and report-escalation.

Fix

  • New .github/actions/collect-base-activity/stage-closure.mjs. It walks the script's loads transitively: static and literal dynamic imports and import.meta.url resources in a module, and paths beside BASH_SOURCE in a shell script. Under $RUNNER_TEMP/base-script, at each file's repository path, it copies the entry script's own directory one level deep (no subdirectories), where a sibling read by a computed path happens. Every other loaded file, module or data, is copied as that single file, so one import of lib/publish-gate.mjs no longer stages all of lib/ and admit.mjs's read of .github/recurring-schedule.json no longer stages all of .github/. resolve-config's installed node_modules is copied whole beside any resolve-config module the closure loads, and a directory load (docs/upstream/) copies that directory recursively. Nothing outside the base is read or copied.
  • Both activity runners run the script as $RUNNER_TEMP/base-script/$SCRIPT. The base tracker-config and trusted-actors copies keep their paths at the staging root.
  • The write runner's apply-base step no longer hand-copies apply-patch's sibling modules (lib/, pr-unblock/, pr-merge/), since the closure carries them. It still copies patch-rules.json and dependabot.yml.
  • Design: a mirror of the whole base tree resolves everything, but it is about 190 MB tracked (155 MB of it plugins/). It also costs the test one full copy per script. A mirror of .github/ alone misses four loads outside it: lib/publish-gate.mjs, scripts/upstream-drift-vendored-report.sh, plugins/work-items/scripts/charge-words.json and docs/upstream/. The directory-granular closure stages what each script loads and nothing else.

Security

Every staged file comes from $BASE_PATH, which is .base: the default-branch tip checked out with persist-credentials: false, never the PR head. The stager runs from $GITHUB_ACTION_PATH, which is the action loaded from ./.base. Staging more base files does not change what PR-head content can reach. In the read runner, head code and the model already share $RUNNER_TEMP with base-script/, as before. In the write runner, no step after the head checkout runs head code (write-runner-never-rules.test.sh). The stager copies symlinks verbatim and skips any load that resolves outside the base.

Loosened checks

  • scripts/write-runner-never-rules.test.sh: the assertion "the apply-patch base copy holds every sibling-directory module apply-patch.mjs and its predicates import" is removed. Its subject, the apply-base step's hand-written mkdir/cp lines for apply-patch's sibling modules, no longer exists. The same property is now checked more strictly by collect-base-activity.test.mjs, which runs the real stager on apply-patch.mjs (and every other runner script) and requires every transitive load to resolve. The hand-listed assertion covered only direct ../<dir>/<module> imports.

Verification

  • collect-base-activity.test.mjs has a new test. It runs the real staging step for every script activity in a lane that uses the read or write runner, with the entry path taken from the runners' own invocation line. It then walks every load and requires all of them to resolve. The UNSTAGED_DECLARE_TEST_SCOPE_IMPORTS pin is gone; the gap is empty.
  • A second new test stages admit.mjs and requires .github/recurring-schedule.json to be the only top-level .github/ file copied; it fails on the directory-per-load stager. Three more: staging issue-spec.mjs copies scripts/upstream-drift-vendored-report.sh alone and staging write-verdict.mjs copies lib/publish-gate.mjs alone (both fail on a stager that copies a module's directory); staging publish-feedback.mjs leaves pr-unblock/fixtures/ out; and a staged resolve.mjs still imports yaml and ajv from the copied node_modules.
  • address-feedback.test.mjs declares .github/scripts/pr-unblock/* and docs/upstream/*, and publish-feedback.test.mjs declares docs/upstream/*: the reads scripts/selection-audit.sh trace --strict still reported for the staged closure.
  • Red first: with the old action and runners restored, the same test reports unresolved loads for seven scripts. These include report-escalation.sh (api-budget.bash, pr-merge/refire-refused.mjs, rate-guard.mjs, trusted-actors.json and others), declare-test-scope.mjs, apply-dependency-verdict.mjs, publish-feedback.mjs, resolve-threads.mjs, report-outcome.mjs and apply-patch.mjs.
  • The load tests in apply-patch, address-feedback, publish-feedback and report-outcome now import each module from a real stage() output, not a hand-built layout.
  • write-runner-never-rules.test.sh checks the new invocation path.
  • After merging main, each run alone: collect-base-activity.test.mjs 163, apply-patch.test.mjs 446, address-feedback.test.mjs 213, publish-feedback.test.mjs 164, report-outcome.test.mjs 437 and callers.test.mjs 306 pass; scripts/check-affected.sh --base origin/main: 20 passed, 4 skipped.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 23, 2026 20:38
…vities

collect-base-activity copies a script activity's directory to
$RUNNER_TEMP/base-script with lib/ and pr-merge/merge-holds.mjs beside
it, but not apply-patch/cdn-paths.mjs. apply-dependency-verdict.mjs and
cdn-pins-sync.mjs (which review-dependency.mjs imports) load it as
../apply-patch/cdn-paths.mjs, so apply-dependency-verdict failed with
ERR_MODULE_NOT_FOUND on every Dependabot pull request since #18336.

Stage cdn-paths.mjs into $RUNNER_TEMP/apply-patch/ in the same shape as
merge-holds.mjs. A new test runs the staging step for every .mjs script
activity a lane runs through pr-run-activity-read or -write and checks
that each static relative import resolves in the staged layout. It pins
the one remaining gap, declare-test-scope.mjs, which this change leaves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
collect-base-activity staged a script's own directory plus a hand-kept
list of siblings, so report-escalation.sh could not load
pr-merge/refire-refused.mjs or source the API budget wrapper,
declare-test-scope.mjs could not load, and address-feedback.mjs's
dynamic imports failed.

stage-closure.mjs now copies the directory of the script and of every
file it loads, transitively, to its repository path under
$RUNNER_TEMP/base-script, always from the base checkout. Both runners
run the script as $RUNNER_TEMP/base-script/$SCRIPT, and the write
runner drops its hand-copied apply-patch siblings. The collect test
walks every load of every runner script activity in the real staged
layout and the declare-test-scope pin is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UJUn7JjbzH3qP4NugM6Ns5
Base automatically changed from fix/stage-cdn-paths-for-base-scripts to main November 24, 2026 03:42
…ty-import-closure

# Conflicts:
#	.github/actions/collect-base-activity/action.yml
#	.github/actions/collect-base-activity/collect-base-activity.test.mjs
#	.github/scripts/apply-patch/apply-patch.test.mjs
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 24, 2026 06:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 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-24T06:30:25.876198Z 9748dc4 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

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: no security issues found

This lane already reviewed an earlier head (f929bbe9), so this review reported only CRITICAL and IMPORTANT findings. It found none.

Scope. This was an incremental review of the 3 files listed in .claude-lane/incremental-files.txt. I read every hunk of each one in .claude-lane/incremental.diff.

What I checked.

  • collect-base-activity/collect-base-activity.test.mjs. The test used to check only that fewer workflow files were staged than the repository holds. It now asserts that the staged .github tree has no workflows entry at all. That is a stricter check, so it weakens nothing, and only test code changed. The stager itself (stage-closure.mjs) is unchanged since the last review.
  • pr-unblock/address-feedback.test.mjs and work-resolve-issue/report-outcome.test.mjs. Each change adds or widens a // test-scope: comment, which tells the test runner which files the test reads. Declaring more files can only make the test run more often. It does not touch a hold, a token, a trusted-actor check or what text reaches a lane.

The change touches no permissions: block, token request, trusted-trigger check, kill switch, merge hold, plugin manifest or standing instruction. The only prior post is the last review's summary comment, which had no findings, so nothing is restated.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 9748dc41f565d86cd00055167a5f3bc336644ed6; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed eaa6046205dfd404d11f44fae45d81bafad448a2: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

CI code review: PR #18664 (incremental, blocking only)

No blocking findings. This review covers what changed since f929bbe9. This lane already reviewed earlier heads of this PR, so it reports blocking findings only.

What changed, in three files:

  • collect-base-activity.test.mjs: brings back the original assertion that no .github/workflows entry is staged at all (assert.ok(!top.some((e) => e.name === "workflows"), ...)). It replaces the weaker check that allowed any staged count below the repository's total. That fixes my earlier loosened-check finding at line 213 (thread), because the change itself is undone. The assertion's new failure message lists the staged top-level names, which makes a failure easier to diagnose. existsSync is still used elsewhere in the file, so it was not imported for nothing.
  • address-feedback.test.mjs: its test-scope line now also names .github/scripts/lib/conflict-record.mjs. That file exists at head.
  • report-outcome.test.mjs: adds a new leading test-scope line naming .github/scripts/work-resolve-issue/*, .github/scripts/branch-cleanup/* and .github/actions/check-born-triaged/check-born-triaged.mjs. Every path it names exists at head.

What I checked: leadingBlock in test-scope.mjs splits each // test-scope: line on whitespace into globs, so lines with several paths and globs parse correctly. The stricter single-path DECLARATION pattern only applies to automated inserts (declarationRefusal), not to hand-written lines. Declared paths only add triggers for a suite. Neither new line narrows when a suite runs, so neither is a loosened check.

Scope: I read every hunk of the three files in the incremental diff. I ran nothing; all of this comes from reading the files.

Closing issue: none, so there are no acceptance criteria to check.

Loosened checks would be marked: fail (default; the prompt has no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. The prompt also has no loosened_check_decision_record: line, so I did not check the citation requirement. The PR body's ## Loosened checks section still gives the reason for removing the write-runner-never-rules.test.sh assertion. The collect-base-activity.test.mjs loosening is reverted.

No plugin manifest changed.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The pr-unblock lane stopped resolve-conflicts on this pull request: the merge stages the pull request's own .github/workflows/ changes together with the base's, which the lane token cannot push, so a session merges main by hand. The lane sets no label: the run ends in a failing pr-unblock/conflict status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=18664 -f activity=resolve-conflicts

kyle-sexton and others added 8 commits November 24, 2026 02:14
main's callers.test.mjs case "the script step passes apply-patch's
test-scope reasons out and refuses another row's" wrote its fake
apply-patch.mjs as base-script/apply-patch.mjs, the basename layout this
branch replaces: the step now runs $RUNNER_TEMP/base-script/$SCRIPT, so
the fake was not found (exit 127). The fake now sits at
base-script/.github/scripts/apply-patch/apply-patch.mjs; every assertion
is unchanged, and the other row's reason is still refused.

apply-patch.test.mjs stages apply-patch's closure, which copies
.github/scripts/pr-merge/ and pr-unblock/ whole; it declares both.

Findings: https://github.com/melodic-software/claude-code-plugins/actions/runs/45340727053/job/138263845528
https://github.com/melodic-software/claude-code-plugins/actions/runs/45340727053/job/138263845585

Co-Authored-By: Claude Opus 5.5 <[email protected]>
stage() copied the whole directory of every file a script loads, so
intake-triage/admit.mjs's read of .github/recurring-schedule.json
staged all of .github/ for apply-dependency-verdict and publish-feedback.
A loaded file that is not a JS or shell module (JSON and other data,
docs, a new URL resource) is now copied as that one file at its
repository path; a module still brings its whole directory, which keeps
computed-path sibling reads and resolve-config's node_modules working.

collect-base-activity.test.mjs gains a test that staging admit.mjs copies
.github/recurring-schedule.json and no other top-level .github file; it
fails on the previous stage().

Finding: https://github.com/melodic-software/claude-code-plugins/actions/runs/45340727053/job/138263845585

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ty-import-closure

# Conflicts:
#	.github/scripts/work-resolve-issue/report-outcome.test.mjs
stage() copied a loaded module's directory recursively, so every
fixtures/, probe/ and reentry-eval/ subtree beside a module was staged.
It now copies only the files directly in a module's directory; a
subdirectory is staged only when something in the closure loads a file
in it. .github/actions/resolve-config/node_modules stays the one kept
recursive copy, and a directory load (docs/upstream/) stays recursive
for that directory alone.

collect-base-activity.test.mjs gains a test that staging
publish-feedback.mjs leaves pr-unblock/fixtures/ out (it fails on the
previous stage()), and one that a staged resolve.mjs still imports yaml
and ajv from the copied node_modules.

Finding: https://github.com/melodic-software/claude-code-plugins/actions/runs/45340727053/job/138263845585

Co-Authored-By: Claude Opus 5.5 <[email protected]>
stage() still copied the files beside every loaded module, so one import
of lib/publish-gate.mjs staged all of lib/ and one `new URL` of
scripts/upstream-drift-vendored-report.sh staged all of scripts/. It now
copies the entry script's own directory one level deep (where a
computed-path sibling read happens), every other loaded file, module or
data, as that single file at its repository path, resolve-config's
node_modules beside any resolve-config module it loads, and a directory
load (docs/upstream/) recursively.

collect-base-activity.test.mjs gains a test that staging issue-spec.mjs
copies scripts/upstream-drift-vendored-report.sh alone and staging
write-verdict.mjs copies lib/publish-gate.mjs alone; it fails on the
previous stage(). address-feedback.test.mjs declares
.github/scripts/pr-unblock/* and docs/upstream/*, and
publish-feedback.test.mjs declares docs/upstream/*, the reads the strict
trace still reported.

Finding: https://github.com/melodic-software/claude-code-plugins/actions/runs/45340727053/job/138263845585

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The staging tests copy files from .github/actions/resolve-config/,
.github/scripts/intake-triage/, pr-unblock/, pr-verify/,
work-resolve-issue/package.json and docs/upstream/. The suite now
declares each in a test-scope line, and the strict trace reports no gap.

Finding: https://github.com/melodic-software/claude-code-plugins/actions/runs/45349918725/job/138293818756

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The claude-review IMPORTANT finding on collect-base-activity's action.yml
description: it and pr-run-activity.md step 8 still described copying the
directory of every loaded file, while stage-closure.mjs copies the files in
the entry script's own directory and each other loaded file on its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t outside the base

The claude-review suggestion that the closure test shares the stager's own
loads() detector held: resolve-config.mjs read lane-rules.json and its four
sibling rule files by a name passed through readOwn, which loads() cannot
see, so a staged declare-test-scope.mjs failed with ENOENT in
testScopeFromBase. Each rule file is now a literal new URL() the stager
follows. Two tests check the staged tree without loads(): every runner .mjs
entry imports from it, and a staged declare-test-scope reads the base config.

The claude-review and claude-security-review suggestions on the
entry-directory copy: stage() now refuses a script path that is absolute or
resolves outside the base before it reads or copies anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author

Review findings on head 09bf9b9 (claude-review findings=3, claude-security-review findings=1, critical=0): all four are fixed in two new commits.

1. IMPORTANT (claude-review), the action description and convention doc describe directory-per-load staging. Fixed. The collect-base-activity/action.yml description and pr-run-activity.md step 8 now say what stage-closure.mjs does: it copies the files in the script's own directory, then every file the script loads, transitively, each on its own at its repository path.

2. SUGGESTION (claude-review), the closure test uses the stager's own loads() detector. Fixed. This one hid a real miss. I staged each runner script activity and searched the staged trees for computed-path reads. resolve-config.mjs reads lane-rules.json, effect-grants.json, activity-rules.json, patch-rules.json and patch-rules.schema.json through readOwn(name), and loads() cannot see a load written that way. declare-test-scope.mjs reaches those reads through testScopeFromBase. Run from the staged tree, it failed with ENOENT ... .github/actions/resolve-config/lane-rules.json. resolve-config.mjs now builds each rule file's URL as a literal new URL("./<file>", import.meta.url), which the stager follows. Two new tests in collect-base-activity.test.mjs check the staged tree without loads():

  • every runner .mjs entry imports from its staged tree, so Node resolves each static import;
  • a staged declare-test-scope.mjs reads the base config.

The second test failed before the fix and passes after it. The search's other hits are not reached from a runner script activity: address-feedback.mjs's ROOT reads run in the select job, verify-cap.mjs is imported by the dispatchers, and nothing calls relock-requirements.sh. I did not add a negative loads() fixture: the new tests catch a missed static import or rule-file read directly, so the fixture would only restate the regex.

3. SUGGESTION (claude-review) and 4. SUGGESTION (claude-security-review), the entry-directory copy does not apply the outside-base check. Fixed. stage() now throws <script> is outside the base before it reads or copies anything when the script path is absolute or resolves outside the base. A new test covers ../outside/run.sh, .github/../../outside/run.sh and an absolute path, and checks that nothing was copied. The action's case already rejects a leading / and any .. segment (action.yml, the "/$SCRIPT/" case before the node call), so this check is defense in depth. The runners' "$RUNNER_TEMP/base-script/$SCRIPT" therefore stays within the staged tree on both layers.

Verification: node --test --test-concurrency=4 over collect-base-activity.test.mjs, resolve-config.test.mjs and callers.test.mjs passes. scripts/check-affected.sh --base origin/main result: 20 passed and 4 skipped over 14 changed files.

kyle-sexton and others added 2 commits November 24, 2026 04:09
…listed rule files

Round-two claude-review suggestions on the base-script stager:

- Shell entries were checked only by loads(). A new test counts each
  BASH_SOURCE[0] or dirname "$0" reference in every shell file a runner
  shell entry reaches, and fails when loads() follows fewer, so a
  `here=$(dirname "${BASH_SOURCE[0]}")` load cannot be skipped silently.
- resolve-config.mjs's readOwn names OWN_FILES and the stager in its error
  for a name the map does not list, in place of readFileSync(undefined).
- The reason the write runner's apply-base step copies patch-rules.json and
  dependabot.yml out of .base, which the deleted comment held: the head
  checkout replaces .base, and apply-patch reads patch-rules.json and the
  dependency-manifests rule reads dependabot.yml's pairs after it. The
  comment-lint hook refuses that comment, so the reason lives here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author

Round two on head 8c89616 (claude-review findings=3, critical=0): two findings are fixed in a new commit, and the third is dispositioned below.

1. SUGGESTION: shell entries are checked only by loads(). Fixed. A new test in collect-base-activity.test.mjs walks every shell file a runner shell entry reaches. In each one, it counts the BASH_SOURCE[0] and dirname "$0" references outside comments and checks that loads() follows the same number. The here=$(dirname "${BASH_SOURCE[0]}"); node "$here/..." form from the finding adds a reference that loads() does not follow, so the test fails on it. All current runner shell closures pass. In report-escalation.sh, all six references are forms the stager follows. The test does not run the shell entries in a dry mode. They call the GitHub API and have no no-op mode, so adding one would be new design.

2. SUGGESTION: OWN_FILES fails with an unclear error on an unlisted name. Fixed. For a name the map does not list, readOwn now throws <name> is not in OWN_FILES, the literal URLs collect-base-activity's stager follows. Before, it called readFileSync(undefined). The error message now gives the map's reason. A source comment would not survive: the repository's comment-lint pre-commit hook refuses it. Folding the map back into new URL(name, ...) also fails the round-one test where a staged declare-test-scope.mjs reads the base config.

3. SUGGESTION: the deleted workflow comment held the reason apply-base copies patch-rules.json and dependabot.yml. Dispositioned: the reason now lives in the commit message. I restored the patch-rules/dependabot half of the comment, but the comment-lint pre-commit hook refused it ("move the reason into the code or the commit message"). The reason is now in the new commit's message: the head checkout replaces .base, and apply-patch reads patch-rules.json and the dependency-manifests rule reads dependabot.yml's pairs after that checkout. standards/review/comments.md accepts a commit message as the record. The step's own lines still show what it copies: cp ".base/$RULES" "$DEST/$RULES" and the dependabot copy.

Verification: node --test --test-concurrency=4 over collect-base-activity.test.mjs, resolve-config.test.mjs and callers.test.mjs passes. After merging main (fbaa789, no conflicts), the head is 5378943. The same suites pass, and scripts/check-affected.sh --base origin/main gives 20 passed, 4 skipped, 0 failed (stale-base-overlap included).

…are staged

pr-review-main SUGGESTION at 5378943: stage() copied every file beside
the entry script but never walked them, so a sibling reached by a computed
path (an `import(./${name}.mjs)` or `node "$here/$tool"`) was staged while
its own imports outside the entry directory were not, and failed at run
time with ENOENT or ERR_MODULE_NOT_FOUND.

Each sibling is now visited like a loaded file, so its loads are staged as
single files. Test files beside the script (*.test.mjs, *.test.sh) are
copied but not walked: nothing in an activity runs them, and walking them
staged their fixtures/ subtrees. A new test stages an entry whose sibling
imports ../lib/x.mjs; it fails on the previous stager and passes now. The
data-file test now allows the one workflow file a sibling loads
(intake-triage.yml, 1 of 43) and still fails on a whole-directory copy.
Two new single-file test-scope lines cover check-born-triaged.mjs and
check-wip-cap.mjs, which the walk now reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author

pr-review-main claude-review SUGGESTION at 5378943 (stage-closure.mjs:32, entry-directory siblings copied but never walked): fixed in f929bbe. Each sibling is now visited like a loaded file, so a sibling reached by a computed path brings its own imports outside the entry directory as single files. Test files beside the script are copied but not walked; walking them staged their fixtures/ subtrees, and nothing in an activity runs them. A new test stages an entry whose sibling imports ../lib/x.mjs. It fails on the previous stager ("the sibling's import is staged") and passes now. collect-base-activity.test.mjs 168/168. The strict Test Selection trace found two new single-file reads (check-born-triaged.mjs, check-wip-cap.mjs), now declared; scripts/check-affected.sh --base origin/main passes.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on f929bbe9e434a89f305e978c36fc9096d6a4e92e; the summary is in this lane's pull request comment.

claude-lane: claude-review

… the walk's reads

claude-review at f929bbe flagged the admit.mjs staging test's relaxed
workflows assertion as a loosened check. With test files no longer walked,
no workflow file is staged at all, so the original assertion (no
.github/workflows entry) holds again and is restored unchanged.

Test Selection at f929bbe failed on address-feedback.test.mjs reading
lib/conflict-record.mjs undeclared; the strict trace over all five stager
suites also found 15 reads in report-outcome.test.mjs. Declared:
conflict-record.mjs in address-feedback.test.mjs, and
work-resolve-issue/*, branch-cleanup/* and check-born-triaged.mjs in
report-outcome.test.mjs. The trace over the five suites now reports no gap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit ae32f74 Nov 24, 2026
60 checks passed
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