Skip to content

refactor(autonomy): simplify the setup prerequisite and signal-envelope scripts - #15117

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14419-42834287613-1
Nov 10, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14419

Summary

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

Finishes the second chunk the recorded decision on #14419 lists. In resolve-prerequisites.mjs, probeDocumentationCorpus, probeAdvisoryDatabase and probeUpstreamChangelog now build their records through the existing probeOutcome helper, and resolveNeed writes its declaration-provenance literal once. check-signal-envelope.mjs gains isPlainObject and isNonEmptyString helpers in place of a dozen repeated inline type checks, plus one loop for the three token-set checks. In generate-identity-prerequisites.mjs, the two identical tracker patterns are merged into one regex, needsFromProse builds each need by rest destructuring, and parseLeaf and extractPrerequisitesSection are condensed. fixture-harness.mjs was reviewed and left unchanged: it is 28 lines with nothing to remove that would not make it less clear. Output bytes, key order, finding order, messages, exit codes, flags and exports are unchanged.

Not verified

  • Node test suites (resolve-prerequisites.fixtures.test.mjs, check-security-binding.fixtures.test.mjs, generate-identity-prerequisites.test.sh, check-prerequisite-resolution-slice.test.sh) were not executed: this lane cannot run node. Left to the PR's CI.
  • validate-plugins identity-prerequisites drift check (generate-identity-prerequisites.mjs --check) was skipped by check-affected because it runs code from the checked tree. The review found the emission cannot change, but the run is left to the PR's CI.
  • fixture-harness.mjs left unchanged: it is 28 lines, and its only repetition is the two counter increments in pass/fail. Every rewrite considered was churn or less clear. The decision comment's checkbox for it is answered by this review, not by an edit.
  • tidy pass 5 (ai-slop): detect.sh could not run because the lane's Bash allows only the named wrappers, so only the rubric read covered the changelog fragment.
  • ci-status green is a PR check left to the PR's CI.
  • Review note, no change needed now: needsFromProse now copies every key of a NEED_PATTERNS entry except re, so a key added to an entry later would appear in the generated emission. The old code copied only the named keys.
  • The working tree has untracked home-directory files from the runner environment (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc). This run did not create them and they are not part of the change.

Fix

  • plugins/autonomy/skills/setup/scripts/resolve-prerequisites.mjs: probeDocumentationCorpus, probeAdvisoryDatabase and probeUpstreamChangelog return probeOutcome(...) instead of hand-built records; resolveNeed builds declarationProvenance once and reuses it (adding unprobeable: true in the…
  • plugins/autonomy/skills/setup/scripts/check-signal-envelope.mjs: add isPlainObject and isNonEmptyString and use them for the exact predicates they replace; fold the signal.class/transport/provenance token checks into one ordered loop with the same messages.
  • plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs: merge the two tracker NEED_PATTERNS entries into one alternation regex; needsFromProse uses { re, ...need } destructuring; parseLeaf is a single map; extractPrerequisitesSection computes the body start once.
  • .changes/autonomy/work-resolve-issue-issue-14419-42834287613-1-d1802a03.md: autonomy patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

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

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

The run reports:

  • check-changelog-fragments: All 9 changelog fragment(s) under .changes/ are valid (run before and after tidy).
  • check-changed-skills: CHECK-SKILL setup PASS, 0 errors, 4 pre-existing warnings about SKILL.md size and description length, none from this diff (run before and after tidy).
  • check-affected: 12 passed, 7 skipped over 4 changed files (run before and after tidy).
  • fresh-context review subagent over the whole diff against HEAD: no behavior change found. It checked probeOutcome's ran semantics and provenance key order, that the merged regex and rest destructuring give the same emitted JSON, that the token-loop messages and order are unchanged, and the…
  • tidy-diff over the 32 changed hunks: no edits; no comment or generated-code residue in the listed lines; changelog fragment passes the write-for-humans and ai-slop rubric reads.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42834287613

Left out: the items under Not verified.

Related

#14419

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

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

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of all 4 changed files. None of them is on a trusted path, and no plugin manifest changed.

resolve-prerequisites.mjs

  • probeOutcome (L156-L158) sets ran: result !== "unresolvable" and builds provenance with kind first.
  • With that, the rewritten probeDocumentationCorpus gives the same records as before: present/absent with ran: true, same keys in the same order.
  • probeAdvisoryDatabase and probeUpstreamChangelog also match: unresolvable with ran: false, and the probe_class and detail text still depend on machineContext the same way.
  • resolveNeed's declarationProvenance has the old key order. The unprobeable branch spreads a copy, and nothing mutates provenance afterwards, so reusing the object is safe.

check-signal-envelope.mjs

  • isPlainObject and isNonEmptyString match the inline predicates they replace.
  • The token loop checks signal.class, then signal.transport, then signal.provenance, the same order as before, and gives the same messages ("is not a surface-class / transport / provenance token").
  • signalClass is still declared before its later uses (L260, L277, L448, L453).
  • transport and provenance were never used anywhere else, so removing those locals is safe.

generate-identity-prerequisites.mjs

  • The merged tracker regex matches exactly what the two old patterns matched. Neither has the g flag, so .test keeps no state between calls.
  • Rest destructuring yields {id, probe_class, seam?|owner?} in the order each entry declares them, the same output as the old code. As the PR body itself points out, a key added to an entry later would now show up in the emission.
  • The rewritten extractPrerequisitesSection and parseLeaf compute the same values as before.

Closing issue #14419

  • The decision comment's checklist items for probeDocumentationCorpus, probeAdvisoryDatabase, probeUpstreamChangelog and resolveNeed, and the simplification of check-signal-envelope.mjs and generate-identity-prerequisites.mjs: met by reading the code, as described above.
  • fixture-harness.mjs was left unchanged. The PR body explains why, and the agent brief allows a no-change outcome.
  • The autonomy patch fragment uses the required ### Changed heading and text.
  • The diff is well under 400 lines.
  • ci-status green: left to CI, not checked here.
  • The test-suite and --check drift runs listed in the PR are claimed by the author and not checked here; this lane cannot run node.

No hold applies.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #15117 (head cb578fd)

No security issues found.

I read every hunk of all 4 changed files. None of them matches a trusted-path glob, and the diff doesn't touch any trust control, plugin manifest, workflow or standing instruction.

What I checked:

  • check-signal-envelope.mjs is a security-relevant validator for routine identity, run-link prefix and producer identity. It matters that no check got looser.
    • isPlainObject and isNonEmptyString are exact equivalents of the inline checks they replace.
    • The token-set loop keeps the same three checks and messages, in the same order.
    • signalClass is now declared after that loop, but nothing used it in between.
    • The routine, run-link-prefix, producer-identity and raw-link conditions still fail closed exactly as before. No check was dropped or weakened.
  • resolve-prerequisites.mjs: probeOutcome (resolve-prerequisites.mjs:156-158) sets ran: result !== "unresolvable" and kind: "probe" first. That reproduces the old literals: ran: true for present/absent and ran: false for the two unresolvable probes.
    • The shared declarationProvenance object is never mutated after it is assigned. The unprobeable branch uses a spread copy.
    • Declarations still narrow a result to absent, and a probe that ran and came back absent still overrides a "present" declaration.
  • generate-identity-prerequisites.mjs: the merged tracker regex and { re, ...need } produce the same need records.
    • The NEED_PATTERNS entries carry only id, probe_class and an optional seam/owner, so the key order and set are unchanged.
  • The changelog fragment is a prose-only patch note.

Prior findings: none (0 earlier heads reviewed), so this was a full review, not blocking only.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for cb578fd

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-15117-cb578fd052cd21794681195b0c2aaa3beac746cd, expires on 2026-12-10.

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 10, 2026
Merged via the queue into main with commit 1a6ba3f Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14419-42834287613-1 branch November 10, 2026 15:32
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 4, survived 3, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 57%; mutation score 57%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/autonomy/skills/setup/scripts/check-signal-envelope.mjs 1 2 0 0 0 0
plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs 2 0 0 0 0 0
plugins/autonomy/skills/setup/scripts/resolve-prerequisites.mjs 1 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/autonomy/skills/setup/scripts/check-signal-envelope.mjs:69 other productive input-gap
plugins/autonomy/skills/setup/scripts/check-signal-envelope.mjs:73 ROR productive input-gap
plugins/autonomy/skills/setup/scripts/resolve-prerequisites.mjs:416 UOI productive no-assertion

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 1a6ba3f519a8d1ae8bc66513520e016864557683; 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 setup autonomy plugin code (2 of 2)

0 participants