Skip to content

refactor(scripts): simplify lane-transcripts pull and store without behavior change - #14526

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14370-42595272051-1
Nov 9, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14370-42595272051-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14370

Summary

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

Simplified scripts/lane-transcripts/pull.mjs and store.mjs without changing behavior: removed repeated literals and repeated stale-alert blocks, added one small string guard helper per file, and removed a redundant catch assignment and repeated map lookups. scripts/vendor_gitleaks_rules.py is unchanged. It is already compact, and the one candidate edit (a walrus operator in vendor()) would turn the exit-2 version message on Python 3.7 into a SyntaxError, so I left it out.

Not verified

  • pull.test.mjs and the vendor_gitleaks_rules tests were not run directly here (the lane runs only its wrappers, and check-affected's output does not name the suites it ran); left to the PR's CI
  • tidy: not run, because the change is under scripts/, a listed shared path for the tidy cutoffs
  • ci-status green: left to the PR's CI

Fix

  • scripts/lane-transcripts/pull.mjs: shared CHUNKS list for the review chunk suffixes; pr-unblock.yml ids built with the existing legs() helper (same ids, same order); one loop for the three ensureDir calls; dropped the redundant messages = null in the gunzip/parse catch; local asString() guard for…
  • scripts/lane-transcripts/store.mjs: module-level asString() guard used for the transcript's model and subtype; appendRow() writes to its already-resolved file; prune() looks each row up once instead of has()+get() twice.

Verification

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

  • 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

#14370

Merge-Risk: max=MEDIUM demote=false head=8de396d2c0eec93feebb0b630ea5cf1b3d003667 rubric=8.1.4 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14526 (head 8de396d)

I found no security issues.

I read every hunk of both changed files, scripts/lane-transcripts/pull.mjs and scripts/lane-transcripts/store.mjs. Neither file is on the trusted-path list, and neither is a trust control, merge hold, plugin manifest or instruction surface. The PR is a refactor, and I checked that each change keeps the old behavior:

  • TRANSCRIPT_JOB_IDS: the shared CHUNKS list and legs() produce the same job ids in the same order as the old inline arrays. The pr-unblock.yml entries still come out as adjudicate-feedback-N, then -subscription, then -fallback.
  • Directory setup in pullWithin: the loop makes the same three directories in the same order.
  • Gunzip/parse catch: removing messages = null leaves messages at the null it already held, as the new comment says.
  • asString() helpers: they make the same typeof === "string" check as the inline code they replace.
  • appendRow(): it now writes to file, which is already set to paths(sink).metrics at store.mjs#L95. The target is unchanged and the file is still opened with mode: 0o600.
  • prune(): it looks each row up once instead of calling has() and then get(), with the same result.
  • alertIfStale in main(): the alert text, its stream (stderr), and the exit codes are unchanged. In the error path the return value is still 1 no matter what the helper returns.

The handling of LANE_TRANSCRIPT_PRIVATE_KEY is unchanged: the key is still read and deleted from env before the deps are built. The error-kind reporting is also unchanged, so it still names a kind and never a value.

The PR context file holds no embedded instructions.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read both changed files in full (scripts/lane-transcripts/pull.mjs and scripts/lane-transcripts/store.mjs) along with the unchanged code they call. Every edit keeps the old behavior.

  • pr-unblock.yml ids: legs("adjudicate-feedback-<n>") builds the same three ids as the hand-written list, in the same order ("", -subscription, -fallback, since LEGS is in that order).
  • CHUNKS: the same ["", "-2", "-3", "-4"] list, in the same position for both REVIEW_CHUNKS and the ci-workflows/pr-review-cli.yml ids.
  • ensureDir loop: paths() has no side effects, so working out the three paths before any mkdirSync changes nothing. The directories are still created in the order sink, transcripts, tmp.
  • Dropped messages = null: messages already starts as null (pull.mjs:273), and a throw in gunzipSync or JSON.parse leaves it there. transcriptMetrics still returns unreadable for it.
  • asString: works the same as the inline typeof … === "string" checks it replaces, in both files.
  • appendRow: file is paths(sink).metrics (store.mjs:95), so it writes to the same path.
  • prune: every value in byPath is a row object (rows with no transcript are filtered out first), so row ? … : … gives the same result as byPath.has(f.file).
  • alertIfStale: the stderr text and exit codes are the same on the status, successful-pull and failed-pull paths. If status() throws, it goes to the same place as before: inside the try it reaches the catch, and inside the catch it propagates. The failed-pull path still returns 1 no matter what alertIfStale returns.

Closing issue #14370, checked against its acceptance criteria:

  • Behavior unchanged: met, by the analysis above. pull.test.mjs covers this code: TRANSCRIPT_JOB_IDS, the alert text, prune and appendRow all appear in it. I did not run the suite, because this lane has no shell.
  • Only the listed files are edited: met. The PR touches 2 of the 3 listed files and explains why it leaves scripts/vendor_gitleaks_rules.py alone.
  • Within 400 changed lines and 15 files: met.
  • ci-status green: not something this lane can see. The PR leaves it to CI.

The verification in the PR description (check-affected results, the fresh-context subagent review) is the author's claim and I did not verify it.

No embedded instructions were found in the PR context. No API or billing spend is involved.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 8de396d

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-14526-8de396d2c0eec93feebb0b630ea5cf1b3d003667, expires on 2026-12-09.

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 9, 2026
Merged via the queue into main with commit 0a4a835 Nov 9, 2026
59 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14370-42595272051-1 branch November 9, 2026 11:54
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

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

File Killed Survived Timeout No coverage Invalid Not run
scripts/lane-transcripts/pull.mjs 4 1 0 0 0 0
scripts/lane-transcripts/store.mjs 2 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
scripts/lane-transcripts/pull.mjs:204 SBR productive no-assertion

The run's summary has the full report.

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 vendor_gitleaks_rules.py and lane-transcripts repository scripts

1 participant