Skip to content

fix: Simplify the log-api-budget and open-lane-output actions - #14224

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14097-42514604406-1
Nov 8, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14097-42514604406-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14097

Summary

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

Behavior-preserving simplification of the log-api-budget and open-lane-output actions. action.yml folds four copies of 'print notice lines, then write them to the step summary without the notice prefix' into one emit helper. rate-guard.mjs reads headers through one headerReader in classify and in the latch's read-floor warning, computes the graphql pool once in classify, and computes a segment's {n}/{sha} placeholder once in routeOf. open.mjs builds the opened map in one expression. api-budget.bash was left as it is on purpose: pr-require-checks.yml carries a verbatim copy of it, log-api-budget.test.mjs requires the two to match, and this lane cannot edit workflow files. api-budget.mjs (a one-line re-export), pace.mjs, keygen.mjs and open-lane-output/action.yml had nothing worth changing.

Not verified

  • api-budget.bash was not simplified: .github/workflows/pr-require-checks.yml carries it verbatim in API_BUDGET_SH (log-api-budget.test.mjs checks they match), and that workflow is a path this lane cannot edit. Simplifying it needs a change that edits both together.
  • The node test suites (log-api-budget.test.mjs, rate-guard.test.mjs, pace.test.mjs, open.test.mjs) were not run here because the lane does not allow running node; left to the PR's CI.
  • ci-status green is a PR CI check; left to the PR's CI.
  • Tidy not run: the change sits entirely under .github/, which is a listed shared path for tidy.
  • Build/lint of the touched files (actionlint, editorconfig) are CI-only per check-affected; left to the PR's CI.

Fix

  • .github/actions/log-api-budget/action.yml: one emit <lines> <title> <summary-prefix> helper now writes the api-uncounted, api-routes, content-creation and per-reading api-budget lines; the log and summary text, their order and the outputs are unchanged.
  • .github/actions/log-api-budget/rate-guard.mjs: added a headerReader helper, used by classify and by the latch's low-floor warning; classify computes poolOf(url) === 'graphql' once; routeOf computes each segment's numeric/hex placeholder once for both branches; removed a stray double blank line.
  • .github/actions/open-lane-output/open.mjs: main builds opened as one const conditional expression instead of a let plus an if block; same predicate and same call order.

Verification

The runner ran each check from the base copy against cfa48ce:

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

The run reports:

Left out: the items under Not verified.

Related

#14097

Merge-Risk: max=MEDIUM demote=false head=cfa48ce297df2240b538bbaaffcf5b43dd3a2c37 rubric=8.1.2 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Security review: no security issues found

I read every hunk of all 3 changed files. Two are trusted paths: .github/actions/log-api-budget/rate-guard.mjs matches a glob directly. .github/actions/open-lane-output/open.mjs is under the open-lane-output trust control, which decides what untrusted text reaches a lane. I read both changes in full and checked what they gate.

  • .github/actions/log-api-budget/action.yml: four inline "print to log, then write to the step summary with the prefix rewritten" blocks are now one emit helper. The sed pattern gets its title and prefix only from fixed literals at each call site (api-uncounted, api-routes, api-budget). Untrusted data reaches it only as sed input, never as the pattern. The outside step names that reach emit still pass the unchanged ^[A-Za-z0-9._/:-]{1,80}$ check first. The text written to the summary is the same as at base, including api-uncounted github-token …. No injection path, and no change to what the step outputs (calls=, costs).

  • .github/actions/log-api-budget/rate-guard.mjs: three behavior-preserving refactors:

    • headerReader is the same expression that classify and the latch's low-floor warning each wrote out before.
    • graphqlPool computes poolOf(url) === "graphql" once and is used in the same two places.
    • The {n}/{sha} placeholder in routeOf is computed once. The repos/{repo} branch is still checked before the numeric and hex branches, so the order is unchanged.

    Rate-limit classification and the read floor behave exactly as before.

  • .github/actions/open-lane-output/open.mjs: the let plus if block is now one const conditional. The predicate is the same (lengthText !== "" || parts.some((part) => part !== "")), and so are the arguments to openBundle(recipient, expected, caps, joinChunks(...), runId, jobId). openBundle still runs before the directory is created and its emptiness checked, and the wx / 0o444 write flags are unchanged. Nothing new gets through the sealed-output check: the change does not widen this control.

No trust control is widened. No token scope, secret handling, merge hold or kill switch is touched. The PR context file holds no embedded instructions aimed at this lane. The change can't cause a real charge.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14224, simplify the log-api-budget and open-lane-output actions

No findings. I read every hunk of all 3 changed files. rate-guard.mjs is a trusted path, so I read its whole change and the code around it. Each edit keeps the existing behavior.

.github/actions/log-api-budget/action.yml

  • What changed. One emit helper now writes the four blocks that print lines to the log and to the step summary.
  • Command substitution. The old code assigned lines=$(...), which would trip -e if the inner call failed. The new code passes the call's output straight to emit. Both api_budget_emit_routes and api_budget_emit_content end in return 0 (api-budget.bash#L545, #L590), so losing that exit status changes nothing.
  • Empty lines. budget[] entries are added only when non-empty (action.yml#L87), so the new empty-line guard in emit drops no output.
  • api-uncounted line. It now reaches the summary through the sed prefix swap and comes out byte-identical. The titles and replacement strings are fixed literals with no / or &, so they can't break the sed pattern.
  • Tests. log-api-budget.test.mjs runs this script and checks both the log and the summary text, including api-uncounted and api-routes.

.github/actions/log-api-budget/rate-guard.mjs

  • routeOf still tests for a number before a hex string. The placeholder it computes is used only in the two branches that used it before.
  • poolOf has no side effects, so computing it once at the top of classify changes nothing.
  • headerReader is the same expression that appeared inline in two places.

.github/actions/open-lane-output/open.mjs

  • The condition and the order of the joinChunks and openBundle calls are unchanged.

Closing issue #14097

  • Behavior unchanged: met, from reading the code. The existing tests check the outputs.
  • Diff edits only the listed files: met.
  • Size limits: met.
  • ci-status green: left to CI. I could not run the tests here.
  • The author's verification and test-run claims in the PR body are author-claimed and unverified.

Not applicable: no plugin manifests changed, and there are no prior findings or settled threads. I found no embedded instructions in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head cfa48ce297df2240b538bbaaffcf5b43dd3a2c37, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for cfa48ce

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14224-cfa48ce297df2240b538bbaaffcf5b43dd3a2c37, expires on 2026-12-08.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 57b03ad Nov 8, 2026
67 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14097-42514604406-1 branch November 8, 2026 20:20
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 0, survived 1, timeout 0, no coverage 0, invalid 0, not run 6.
Covered-code score 0%; mutation score 0%.

File Killed Survived Timeout No coverage Invalid Not run
.github/actions/log-api-budget/rate-guard.mjs 0 0 0 0 0 6
.github/actions/open-lane-output/open.mjs 0 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
.github/actions/open-lane-output/open.mjs:153 LCR productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 57b03ad80650f9182b86c0a27048b66474a993c9; later checks count it verified from this comment.

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.

Simplify the log-api-budget and open-lane-output actions

0 participants