Skip to content

The lint, populate-description, squash-message and review scripts become wrappers over agentrepo merge #874

Description

@tbhb-agent

Problem

Children 01 to 13, 21 and 25 add agentrepo merge beside the shell scripts and leave those scripts as the parity oracle. This child makes the Go commands the implementation for the first four merge-pr scripts, lint-squash-msg.sh, populate-description.sh, squash-message.sh and review.sh, and for their unattended agent-merge-pr counterparts (lint-squash-msg.sh, squash-message.sh and review.sh), which today re-run the merge-pr scripts under DEVTOOLS_UNATTENDED. The scripts become short wrappers that run the matching agentrepo merge subcommand. The frozen behavior stays reachable as the fallback for the N-2 window with no new logic; child 20 makes it unreachable and children 22 and 23 delete the non-owner shell after the window. Consumers that still run the fallback must be warned for at least two releases (docs/compatibility.md) before it goes. preflight.sh is child 27 and squash-merge.sh with merge.sh is child 26.

These four scripts hold 351 code lines in packages/agents/source/skills/merge-pr/shared/scripts/ (25, 62, 156 and 108). No file on the owner-tier or constitutional lists of .agents/agent-skills.conf is edited, moved or deleted here: merge-agent.sh, merge-policy.py and lib.sh stay as they are until the single cutover under #588.

Part of #324, within #588. Child 14 in #324's Children list. Replaces the logic in the four script bodies named above and their agent-merge-pr counterparts.

Acceptance criteria

  1. AC1: Given a deployed merge-pr skill, when lint-squash-msg.sh, populate-description.sh, squash-message.sh or review.sh runs, then it runs the matching agentrepo merge subcommand with the same arguments and returns its exit status and streams, with no logic of its own.
  2. AC2: Given the installed agentrepo lacks the merge subcommand, when one of these wrappers runs, then the frozen behavior of that script runs with no new logic added to it, a deprecation warning names the release in which the fallback ends, and a consumer configuration that release N-2 accepted is still accepted.
  3. AC3: Given the agent-merge-pr counterparts of the lint, squash-message and review scripts, when they run, then each runs the matching agentrepo merge subcommand in unattended mode and preserves the unattended behavior of the shell entry points.
  4. AC4: Given DEVTOOLS_UNATTENDED or the deprecated DT_UNATTENDED set, when a wrapper runs, then the Go command honors them with DEVTOOLS_UNATTENDED taking precedence.
  5. AC5: Given the protection of build(agents): protect replacement Go enforcement paths #753 merged, when the new Go merge and policy files exist, then the protected-path scan flags a change to each of them as that issue defines, and this change adds no pattern work of its own.
  6. AC6: Given the complete regeneration sequence of mise.toml (regen-generated: generate-skills, skill-tokens, apm install, followed by check-generated-skills), when it runs, then both harness packages and both deployments contain the wrappers, tokens.json is re-measured, the deployments and apm.lock.yaml are current, and the check is clean afterwards.
  7. AC7: Given the guard-merge.sh hook, when the skills are regenerated, then it still blocks mutating gh pr calls and is otherwise unchanged.
  8. AC8: Given parity fixtures recorded from the frozen scripts before their bodies change, when the wrappers run against the Go commands, then exit codes, stdout and stderr shape, files written and refusals match.
  9. AC9: Given the release that first ships a wrapper, when it is published, then its notes carry the consumer deprecation warning for the fallback, and the release that is the earliest end of the two-release window is recorded in the pull request.
  10. AC10: Non-functional: the binary is available before the skill deployment requires it (Ship the Go binaries as release assets installed through mise's github backend #333), CI passes on macOS, Linux and Windows, and the pull request stays within the size limits, with only generated output under packages/agents/claude/.apm/skills/, packages/agents/codex/.apm/skills/, .claude/skills/, .agents/skills/ and tokens.json excluded from the count.
  11. AC11: Non-functional: no path matched by constitutional_paths or owner_paths in .agents/agent-skills.conf is changed, so the protected-path scan reports none.

Scope and non-goals

Scope: the four merge-pr wrappers and three agent-merge-pr counterparts named above, the frozen fallback of the four scripts, the deprecation warning and the parity record.

Non-goal: porting guard-merge.sh (a later item in the #588 hooks phase). Non-goal: protection patterns, which #753 owns. Non-goal: preflight.sh (child 27) and squash-merge.sh with merge.sh (child 26). Non-goal: deleting Bats suites (children 15 to 19) or any frozen shell (children 20, 22 and 23, and the cutover). Non-goal: new fallback logic.

Approach

Meet AC1 to AC11 in this order: record parity against the frozen scripts, replace the entry points, regenerate. Where the fallback behavior is kept is the implementer's choice, within AC2 and AC11.

Dependencies

Blocked by: #859, #860, #861, #862, #864, #865, #866, #867, #868, #869, #871, #872, #873, #863, #870, #333, #753, #1010.

Prerequisites: #333 (binary distribution), #1010 (refusal of a missing or below-floor pinned agentrepo, which precedes the frozen fallback), #753 merged (its protection coverage is verified here, not redone), and the merge behavior contracts of #321.

Size

M. One pull request. Measured on origin/main with a physical-line code count (non-blank, non-comment lines, the metric of tools/script_lines.py): the four bodies are 351 code lines; counting them twice (once moved or removed, once added) gives 702, plus about 25 lines of wrappers, tests and documentation, under 800. Only generated output on the paths named in AC10 is excluded; the source copy always counts.

Verify plan

  • AC1, AC3, AC4, AC8: wrapper tests with a stub agentrepo recording arguments, environment and exit status, plus the recorded parity run.
  • AC2: a Bats case with a binary stub lacking the subcommand, asserting the warning text and the unchanged fallback behavior.
  • AC5: the protected-path scan run on a change to each new path, citing the build(agents): protect replacement Go enforcement paths #753 coverage.
  • AC6: mise run regen-generated followed by mise run check-generated-skills, with the tokens, deployments and lock diff cited.
  • AC7: the existing guard cases.
  • AC9: the release notes text and the recorded window.
  • AC10: the CI matrix run and the counted line total, listing the excluded paths.
  • AC11: the protected-path scan output on the pull request's file list.
  • Definition of done: D1 each AC is verified at the merged head, with the commands and results cited in the pull request's Verification. D2 an independent review approves the exact merged head, and every finding has a recorded disposition. D3 required checks pass with no gate loosened. D4 the leak scans the repository specifies are clean, and every post made for this work passes the per-post leak review before it is posted. D5 every commit is signed. D6 the documentation matches the change or the Verification says why there is no impact. D7 every commit has an Assisted-by trailer and the pull request has the provenance:agent-assisted label. D8 the pull request stays within the size limits. D9 follow-ups are filed as issues and listed under Related. D10 the merge closes the issue through a closing reference, the board shows Done, and the final Status: comment names the merge commit.

Risks

This switches part of the merge path to Go for every consumer. The recorded parity run, the N-2 fallback and the exact-head review are the controls. Undo: revert; the previous shell bodies return and the Go commands stay unused.

Operator authority

None. AC11 holds that no owner-tier or constitutional path is touched.

Activity

  1. tbhb-agent commented on Oct 27, 2026

    @tbhb-agent
    ContributorAuthor

    Refinement: READY — The lint, populate-description, squash-message and review scripts become wrappers over agentrepo merge
    Model: gpt-6-astra

    Child 14 The lint, populate-description, squash-message and review scripts become wrappers over agentrepo merge

    Verdict: READY

    Checked: The split into children 14, 26 and 27 resolves the former oversized cutover. Child 14’s four maintained bodies total 351 code lines under tools/script_lines.py:19; its budget counts their preservation conservatively and uses only the authorized generated-output exclusions.

    The complete regeneration sequence now matches mise.toml:469. Fallback placement is no longer prescribed, protected helpers remain untouched, and AC11 verifies that boundary against .agents/agent-skills.conf:5 and .agents/agent-skills.conf:9. #753 owns protection changes. Warning and N-2 requirements match docs/compatibility.md:3 and docs/compatibility.md:5.

    Gaps: None.

    Split: The existing three-child wrapper split is sufficient.

    Definition of done

    The definition of done for this issue (Feature). Tick each item and give its evidence.

    • D1 The author verified each AC on the merged head, and the Verification section of the pull request cites each AC ID with its evidence: the command and its result, or a link.
    • D2 An independent reviewer approved the exact merged head, and the author resolved each finding or filed it as a follow-up.
    • D3 The required checks pass on that head, and any loosened gate has the owner's approval of that exact head.
    • D4 The leak scans come back clean: gitleaks, devtools' check-leaks.sh with the repository's private-strings list, and the leak review of each post.
    • D5 The author signed each commit, the squash included.
    • D6 The docs match the change (README, docs/, CHANGELOG or help text), or the Verification section says "No doc impact" and why.
    • D7 The commits and the squash have Assisted-by trailers, and the pull request has the provenance:agent-assisted label.
    • D8 The pull request stays within the size limits, or the owner approved its exact head over the hard limit.
    • D9 The author files follow-ups and deferred findings as issues with at least a Problem and numbered AC and lists them under the Related section of the pull request. Any work left in the code links its issue.
    • D10 The merge closes the issue through a closing reference and the board shows Done. The final Status: comment names the merge commit.
    • devtools-1 mise run check is green, and so are the coverage floors mise run cover-go-check and mise run cover-py-check, which check doesn't run.
    • devtools-2 A change to skill sources under packages/agents/source/ commits what mise run generate-skills, then mise run skill-tokens, then apm install rewrite, in that order, and check-generated-skills (part of lint) passes.
    • devtools-3 A consumer-visible change (the vendored payload, a skill, a reusable workflow, a task or a pin) has its consumer steps in docs/agent-skills-migration.md or the adoption docs, or the PR's Verification says "No consumer impact" and why.

    Round: 3 of 3

  2. 1 remaining item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refinement:readyPassed the Definition of Ready; may be picked up

    Fields

    Priority

    None yet

    Work type

    None yet

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions