Skip to content

fix(harness-ops): leave Bun's bootstrap stub out of the parser reader's module spans - #12293

Merged
kyle-sexton merged 3 commits into
mainfrom
work-resolve-issue/issue-12278-41391902779-1
Nov 2, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
work-resolve-issue/issue-12278-41391902779-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #12278

Summary

Opened by the work-resolve-issue lane. The run's own summary:

read_bundle now decodes Bun's standalone module graph once, with its byte range (_graph_modules). When the graph decodes, a // bun run outside that range is not added as a module span, and meta\["marker_runs_outside_graph"\] counts the runs left out. Builds with no graph behave as before. A module that does not parse still makes keys_used read every name. On 2.1.316 the failing span 0 was Bun's own // bun bootstrap stub: it has no /$bunfs/ path, so it is not in the graph, and the runtime's string literals are joined onto it with no separator. Choice of means: the issue's unverified pointer suggested splitting the span inside read_bundle, but nothing in the binary records where the stub's JavaScript ends. A split found by trial parsing would also cut a genuinely broken module down to a prefix that parses, which breaks the soundness rule the issue keeps. So the split is by the module graph: runs inside the graph stay modules, and the runtime run outside it is left out. Basis: the #5901 comment says span 0 has no /$bunfs/ path and line 4 begins Failed to run script. Bun's run_command.rs shows that text is Bun's own Rust error strings, and that its REPL loads an embedded bootstrap (eval/node-repl.ts).

Remaining work

  • Host-run follow-up (label host-run, separate check): inventory.py --reader compare --self-check on the current build reports all modules parsing, and Explore/Plan disallowed_tools read literal with 9 names, or the comment names the next blocker.

Not verified

  • Unit tests (test_parser_reader.py, test_inventory.py) were not run here: the lane allows no interpreter. Left to the PR's CI, where INVENTORY_REQUIRE_ACORN=1 runs the two live-helper tests.
  • The issue's host-run follow-up (inventory.py --reader compare --self-check on the current build, Explore/Plan disallowed_tools reading literal with 9 names) needs a host with Claude Code installed. The issue scopes it to a separate host-run check, not this PR.
  • Fix found no boundary for the stub's own JavaScript inside span 0. The stub is left out, not cut down to a parsing prefix, so keys_used does not read Bun's REPL bootstrap. That code is Bun runtime, not a Claude Code module.
  • Tidy's ai-slop pass ran its rubric by hand only: the lane cannot run the deterministic detector (detect.sh), so no findings file was written. One tidy proposal was not applied: _graph_sources is now a one-call wrapper used only by tests.
  • review-venue.txt was absent, so the review ran locally in one fresh-context subagent.
  • Changes are left uncommitted in the working tree, as the runner's instructions require. The runner's patch carries them.

Fix

  • plugins/harness-ops/skills/inventory/scripts/inventory.py: new _graph_modules returns the module graph's byte range plus each module's path by source offset, and _graph_sources now wraps it. _select_region leaves out a // bun run outside a decoded graph and records `marker_runs_outside_grap
  • plugins/harness-ops/skills/inventory/scripts/test_parser_reader.py: new TestBootstrapStub with a 2.1.316-shaped fixture: a // bun stub whose line 4 is runtime string text, followed by a module graph. Tests: the stub is no module and the graph module keeps its path; with no graph the stub stays
  • plugins/harness-ops/skills/inventory/reference/extraction.md: section 12 defines a module span and the outside-the-graph rule, with marker_runs_outside_graph.
  • .changes/harness-ops/work-resolve-issue-issue-12278-41391902779-1-b3d056ca.md: patch changelog fragment (Fixed).

Verification

The runner ran each check from the base copy against 7cbc402:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: all 4 fragments valid (run after the edits, after tidy, and after the review fixes)
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changed-skills: inventory PASS, 0 errors, 2 warnings about SKILL.md size that this change did not touch
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 12 passed, 6 skipped over 4 changed files (run three times, same result)
  • fresh-context review subagent: no correctness bugs. It traced the fixture's byte layout through _select_region and _graph_modules (stub outside the graph range [1399, end), module span at 367 mapped to the CLI path) and acorn's Unexpected token (4:7) in module mode. It raised two wording nits
  • read https: //github.com/melodic-software/claude-code-plugins/issues /5901#issuecomment-6562946766: span 0 is [0, 1238) with no /$bunfs/ path, opens with // bun, fails with Unexpected token (4:7), and line 4 begins Failed to run script "<b>{}<r>"Missing script to execute
  • read https: //raw.githubusercontent.com/oven-sh/bun/main/src/runtime/cli/run_command.rs: Bun's CLI is Rust; Failed to run script <b>{}<r> and Missing script to execute. Pass --interactive to start the Node.js-compatible REPL. are Bun's own error strings, and exec_node_repl loads it
  • read https: //github.com/oven-sh/bun/pull /47242/files: no // bun stub literal in that diff (no help in locating the stub's text)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41391902779

Left out: the items under Not verified.

Related

#12278

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #12293 (incremental since 7cbc402)

I found no security issues in the change since the last review.

What changed since 7cbc402.

  • plugins/harness-ops/skills/inventory/reference/extraction.md: the paragraph on module spans now says a // @bun run outside the module graph "is never parsed". The 2.1.316 detail about Bun's bootstrap stub moved out of that paragraph and into a new four-column claim table that cites fix(harness-ops): split bundle module spans so Bun's bootstrap stub parses in the parser reader #12278 and TestBootstrapStub, with an as-of date and a recheck trigger.
  • plugins/harness-ops/skills/inventory/scripts/test_parser_reader.py: one test method was renamed (unparseable became unparsable). Its body is unchanged.

What I checked.

  • Trusted paths: neither file matches a trusted-path glob. No trust control is touched: no trusted-actor list, token request, kill switch, merge hold, resolve-config file or .github/actions/ change.
  • Plugin manifests: no plugin.json or marketplace.json changed.
  • Instruction surface: the extraction.md edit is reference documentation describing what the reader does. It deletes, narrows or softens no standing guardrail. The removed sentence was explanation, and it now lives in the claim table, so nothing it said is lost.
  • Code: the only code change is the test rename. Nothing new runs, and no subprocess, network, credential or GitHub surface is added.
  • PR context: I found no embedded instructions aimed at this lane.
  • Prior findings: this lane's only earlier post is the summary for 7cbc402, which reported 0 findings, so nothing carries over. This is round 0 of a cap of 3, so the cap does not apply.

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 7cbc40262aec4a8b4b3cf0ed1c69aa9096ce97b9; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #12293 (incremental, 7cbc402 → 6037f6b)

I read every hunk of both files in the incremental diff (reference/extraction.md and scripts/test_parser_reader.py). I found nothing new to flag.

The prior finding is fixed. The earlier advisory (discussion_r4439172045) said a 2.1.316-specific observation had no record, which broke .claude/rules/skill-bodies-state-current-rules.md. The change addresses it as suggested:

  • The paragraph now states only the rule: a marker run outside a decoded module graph is not a module and is never parsed.
  • The per-build observation moved into a Claim / Basis / As of / Recheck trigger table, laid out like the tables earlier in the file.
  • The table's Basis points to fix(harness-ops): split bundle module spans so Bun's bootstrap stub parses in the parser reader #12278 and TestBootstrapStub. That class exists at test_parser_reader.py:1106, and marker_runs_outside_graph is asserted at lines 1146 and 1152.
  • The As of entry is 2026-11, Claude Code 2.1.316.
  • The recheck trigger is concrete: the count goes to 0 or above 1, or a run inside the graph starts reporting Unexpected token again.

Test rename. test_an_unparseable_module_still_reads_every_name became test_an_unparsable_module_still_reads_every_name, a spelling change only. It matches the spelling of the other tests in the file (test_an_unparsable_module_resolves_nothing, test_an_unparsable_module_breaks_the_report). A search of plugins/harness-ops finds no remaining reference to the old name.

Not run. This lane has no interpreter, so I ran no tests. The PR's Verification section is the author's claim and is unverified.

Closing issue. The PR says Refs: #12278, not Closes. The PR context file has no closing-issue section, so there were no acceptance criteria to check.

Plugin manifests. No plugin.json or marketplace.json changed in this increment.

Prior findings and embedded text. The PR has had 1 round with findings, against a cap of 3, so the cap did not apply. The PR context and prior-findings files contain no directives aimed at this lane.

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 6037f6bf14cde2baa78dde8f894f5c17493b0bac. The lanes clear this reason on their own; the next scheduled run judges it again.

a pr-unblock lane stopped its head (pr-unblock/address-feedback is failure), which ci-status fails
  in the merge queue

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6yiyjw
@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 2, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the pull request has an unresolved review thread the lane does not take (a reviewer it does not act on, a review of an older head, or a thread it already answered), so no lane resolves it and a session builder takes it. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/address-feedback 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=12293 -f activity=address-feedback

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
@kyle-sexton kyle-sexton removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 2, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 6037f6bf14cde2baa78dde8f894f5c17493b0bac.

Merged via the queue into main with commit d428252 Nov 2, 2026
88 of 89 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-12278-41391902779-1 branch November 2, 2026 08:12
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