Skip to content

Turn the commit skill scripts into wrappers over agentrepo commit #856

Description

@tbhb-agent

Problem

After children 01 to 06 the commit logic exists in Go, but the commit and agent-commit skill entry points still run only the shell implementations, agent-commit still runs the sibling commit skill's scripts, and the skill text and PRECONDITIONS.md describe the old layout. Switching the callers is one change, made once, so no entry point is half migrated. The shell is kept as a frozen fallback with no new logic, because devtools bumps must need zero configuration changes through the N-2 compatibility window, and is deleted afterwards.

Part of #322, within #588. Child 07 in #322's Children list. Turns the preflight.sh, commit.sh and review.sh entry points of packages/agents/source/skills/commit/shared/scripts and the three agent-commit scripts into short wrappers that exec agentrepo commit and otherwise run the frozen shell.

Acceptance criteria

  1. AC1: Given the commit and agent-commit skill entry-point scripts, when generation runs, then each is a short wrapper that execs the matching agentrepo commit subcommand when the binary is present and new enough, and otherwise runs the frozen shell implementation; the frozen shell receives no new logic.
  2. AC2: Given the agent-commit wrappers and a binary that is present and new enough, when they run, then they call agentrepo commit --unattended, work with only agent-commit deployed (no commit skill beside it), and do not set DEVTOOLS_UNATTENDED or DT_UNATTENDED.
  3. AC3: Given the binary is absent or older than the first release that has the subcommand, when a wrapper runs, then it runs the frozen shell and behaves exactly as the scripts did before this change, including the environment variables the shell sets today.
  4. AC4: Given each affected generated artifact (skill packages, local deployments, token records and lock output), when the change lands, then it is current when produced by the documented generate, measure and deploy sequence, and the generated-skills check passes.
  5. AC5: Given old and new implementations on the same fixtures, when exit codes, standard output and error, files written and refusals are compared, then they match across preflight, review and commit, attended and unattended, including --dry-run output. Parity compares stdout, stderr and exit status of the shell script and the Go command on the same inputs, except for exactly one warning line on stderr, emitted once per invocation by the Go command and defined in AC10; stdout and exit status stay identical. No other input or behavior difference is authorized, and any difference found is a defect.
  6. AC6: Given the skill text and PRECONDITIONS.md, when the change lands, then they name the agentrepo commit commands and the retained fallback, and no longer point at deleted script paths.
  7. AC7: Given the commit guard hook, when the wrappers change, then the guard still recognizes the wrapper paths and refuses whole-tree staging and hand-written commits, and no guard hook or shared-library source file is edited.
  8. AC8: Given the shared libraries lib.sh and agent.sh, when generation runs after the wrappers change, then the generated copies of both in every skill package and deployment are byte-identical to the copies before this change.
  9. AC9: Non-functional: the Go tests for the commit packages pass on macOS, Linux and Windows in CI.
  10. AC10: Given the change switches the callers away from agent.sh and signing.sh, when the pull request is published, then its ## Risk section declares Compatibility: deprecates agent.sh since <version> and Compatibility: deprecates signing.sh since <version>, where <version> is the release that first ships the switch, in the form docs/compatibility.md accepts; and the released callers print a one-line deprecation warning naming the replacement. The warning contract: its fixed text lives in one Go constant in the agentrepo package, naming the deprecated script, since <release> and the replacement command; the Go command writes it to stderr only, once per invocation, before any other output, with no flag or env switch.

Scope and non-goals

Scope: the skill entry-point sources, their generated output, and the skill text and docs for the commit area. This is the only child that switches callers.

Non-goal: porting or editing guard-git.sh, which the guard-hook migration in #588 owns. Non-goal: deleting the frozen shell, lib.sh, agent.sh or their generated copies; one final cutover issue directly under #588, after the N-2 window and as its own pull request, does that, and because those are constitutional paths that pull request gets the owner exact-head review. Non-goal: deleting Bats cases, which children 08 and 09 own.

Approach

Meet AC1 to AC9 by editing canonical sources only, then running generation, token measurement and deployment in the documented order. Never repair generated copies by hand. Release availability of the binary comes first. Keeping the frozen shell means the generator still finds the shared-library references in the scripts and keeps including the libraries.

Dependencies

Blocked by: #851, #854, #855, #333, #544 (and so #850, #852, #853, and #753 through #850).

Prerequisites: the release carrying every new subcommand is published (#333) and installable on consumers with diagnostics (#544), before any caller is switched.

Size

M. One pull request. Estimated code SLOC with scc: about 45 added wrapper lines plus about 300 lines of skill and reference prose; generated paths excluded by the size rule are the token files and skill copies. The Bats deletions are split into 08 and 09 to stay under the 800 limit.

Verify plan

  • AC1, AC2: a test greps each generated entry point for the exec line, the fallback path and the absence of new logic, and a Bats case deploys only agent-commit with the binary present and runs it, checking neither variable is set.
  • AC3: a Bats case with an absent-binary stub and an old-version stub, comparing the run with the pre-change scripts.
  • AC4: the documented generate, measure and deploy sequence, then the generated-skills check, with each affected artifact compared after the run.
  • AC5: a Go test in internal/agentrepo, next to the command, runs a parity comparison against the shell on shared fixtures from the earlier children, including --dry-run; it strips exactly the one AC10 warning line from stderr and asserts the remainder, stdout and exit status are byte-identical to the shell output, so any other stderr difference still fails. No Bats case covers it.
  • AC6: a test reads the skill text for the commands and the fallback, and for dead paths.
  • AC7: the existing guard tests run against the new wrappers, and a diff check lists no guard hook or shared-library source path.
  • AC8: a checksum comparison of every generated lib.sh and agent.sh copy before and after generation.
  • AC9: the CI matrix.
  • AC10: mise run lint-pr-description accepts the declarations, and a Go test in internal/agentrepo, next to the command, asserts the constant's exact bytes on stderr and its single occurrence. No Bats case covers it.
  • 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

A wrapper against a consumer without the new binary falls back to the frozen shell, so commits there keep working; the fallback cases are the control. The generated output is large and a hand edit fails the check. Undo: revert the change; the previous scripts and generated copies return.

Operator authority

None. This child edits no guard hook, shared-library or other owner-tier path, because the fallback keeps those libraries in place; their deletion is the separate cutover issue named above.

Activity

  1. tbhb-agent commented on Oct 27, 2026

    @tbhb-agent
    ContributorAuthor

    Refinement: READY — Turn the commit skill scripts into wrappers over agentrepo commit
    Model: gpt-6-astra

    Child 07 Turn the commit skill scripts into wrappers over agentrepo commit

    Verdict: READY

    Checked: The binding frozen-fallback decision resolves the earlier compatibility and generated-library conflict. Retained scripts can preserve the references that cause generation to include the libraries; recursive reference detection is at tools/generate-skills.sh:111. AC8 now requires generated lib.sh and agent.sh copies to remain byte-identical, with checksum verification.

    The six entry points have one switching owner. Standalone unattended operation is correctly limited to a sufficiently new binary; fallback retains existing behavior. The release/install prerequisites, generation sequence and artifact checks are explicit, consistent with mise.toml:469 and live #333/#544.

    AC1–AC9 have checks. No fallback-file layout is prescribed. Guard and protected-library edits are excluded, so “None” under authority is consistent with .agents/agent-skills.conf:9.

    Gaps: None.

    Split: None. M remains plausible with frozen code retained and Bats retirement separated into 08 and 09.

    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. added
    refinement:activeA refinement round is open; not ready for implementation
    and removed
    refinement:readyPassed the Definition of Ready; may be picked up
    on Oct 31, 2026
  3. tbhb-dev-reviews commented on Oct 31, 2026

    @tbhb-dev-reviews

    Refinement: NOT READY — reconcile strict stream parity with the new deprecation warning

    Checked:

    Gaps:

    1. AC5 requires identical stdout/stderr and calls every behavior difference a defect; AC10 requires released callers to print a new deprecation warning. Both cannot pass on the same invocation. docs/compatibility.md:5 requires the warning period, so dropping the warning is insufficient. Amend AC5 and its parity check to authorize precisely the AC10 warning, and specify its stream, triggering invocations and frequency. Assert the warning separately and compare all remaining output without broadly filtering diagnostics. Keep AC3's absent/old-binary fallback unchanged. Put warning behavior in tested Go to honor Replace complex shell with tested Go, starting with gates and merging #588's shell freeze and the frozen-library constraint; include that behavior in Scope/Size or identify the prerequisite delivering it. Current scope names only entry-point sources, generated output and prose.

    Split: None required. Resolve the warning contract within this bounded change; retain separate Bats-retirement and post-N-2 deletion issues.

    Definition of done

    Ticks mean the issue's ACs/Verify plan cover the requirement, not that implementation or merge has occurred.

    • D1 — Merged-head verification with AC-ID evidence is required, but AC5/AC10 prescribe incompatible results.
    • D2 — Verify requires independent exact-head review and recorded finding dispositions.
    • D3 — Verify requires passing checks without gate loosening.
    • D4 — Verify requires repository leak scans and leak review of each post.
    • D5 — Verify requires signed commits, including the eventual squash.
    • D6 — AC6 and Verify require matching documentation.
    • D7 — Verify requires Assisted-by trailers and the provenance:agent-assisted label; include the squash.
    • D8 — Size and Verify require one M-sized PR within size limits.
    • D9 — Verify requires follow-up issues under Related; apply the base DoD's Problem/numbered-AC and in-code issue-link requirements where applicable.
    • D10 — Verify requires a closing reference, board Done and a final Status comment naming the merge commit.

    Round: 2 of 3

  4. tbhb-dev-reviews commented on Oct 31, 2026

    @tbhb-dev-reviews

    Refinement: READY — the single warning-line exception resolves AC5/AC10

    Checked:

    Gaps: None blocking readiness. The warning is the only permitted stream difference; its constant and Go tests are part of this issue's explicit AC10 deliverable.

    Split: None. One M-sized PR remains plausible with existing fixture reuse and a small Go warning addition. Keep Bats retirement in #857/#858 and frozen-shell/library deletion in the separate post-N-2 cutover.

    Definition of done

    Ticks mean the ACs and Verify plan cover these requirements; they do not claim implementation or merge has occurred. The base requirements also apply to the eventual squash.

    • D1 — Verify each AC on the merged head and cite its command/result or evidence link in the PR's Verification. All ten ACs are traced, and AC5/AC10 are now compatible.
    • D2 — Obtain independent approval of the exact merged head and record each finding's disposition.
    • D3 — Pass required checks without loosening gates.
    • D4 — Pass repository leak scans and the leak review of each post.
    • D5 — Sign each commit, including the squash.
    • D6 — Match documentation to behavior or explain no impact; AC6 supplies the documentation checks.
    • D7 — Include Assisted-by trailers on commits and the squash, and the provenance:agent-assisted PR label.
    • D8 — Stay within the PR size limits; the body specifies one M-sized PR below the hard limit.
    • D9 — File follow-ups as issues and list them under Related; retain the base requirement for a Problem, numbered ACs and issue links for deferred work left in code.
    • D10 — Close the issue through the merge reference, set the board to Done and post a final Status comment naming the merge commit.

    Round: 3 of 3

  5. added
    refinement:readyPassed the Definition of Ready; may be picked up
    and removed
    refinement:activeA refinement round is open; not ready for implementation
    on Oct 31, 2026
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