Skip to content

The shared library Bats suites are retired where Go already covers them #927

Open

Description

@tbhb-agent

Problem

The three suites in tests/skills/source/lib/ (lib.bats, gates.bats, masked-status.bats, about 1,150 lines of code between them) test shell behavior in packages/agents/source/lib/lib.sh, agent.sh, signing.sh and gates.py. Much of that behavior already has a Go owner on main (internal/config, agentrepo config) or is covered by a Go test, so the Bats cases are duplicate coverage that slows the suite and has to be edited by every later port. The cleanup does not depend on the N-2 window, because it deletes tests, not the shell or its fallback, so it merges first.

Part of #588 and #321. Deletes test cases only; no shell under packages/agents/source/lib/ changes.

Acceptance criteria

  1. AC1: Given every case in the three suites, when the retirement ledger is read, then each case is marked deleted with the Go test that covers it, kept with the later child that will retire it, or kept with the reason it needs a real shell, and no case is unaccounted for.
  2. AC2: Given the merged change, then every case marked deleted is absent from the suites, and every kept case still passes.
  3. AC3: Given the shell under packages/agents/source/lib/ and the generated skills, then neither changes, and mise run check-generated-skills passes.
  4. AC4: Given the ledger, when it is read, then each deleted case is marked as covered by a native Go test or by a shell-integration Go test (one that drives the generated wrappers), and each covering test is marked with the platforms on which it executes and not skips.
  5. AC5: Given the Go tests named in the ledger, when CI runs on the merged head, then each executes (is not skipped) on every platform the ledger promises for it, among Linux, macOS and Windows, and passes.
  6. AC6: Non-functional: the pull request reports the median wall time of three Bats runs of the three suites before and after the change, on the same runner, as a measurement with no pass threshold, and no coverage of still-shipped shell behavior is lost.

Scope and non-goals

Scope: the ledger and the deletion of duplicate cases in the three suites.

Non-goal: deleting any shell, the capability probe or the fallback; child 10 owns the area's non-owner fallbacks after the N-2 window, and the cutover issues under #588 delete the protected ones. Non-goal: porting new behavior to Go. Out of scope: suites outside tests/skills/source/lib/.

Approach

Meet AC1 to AC6. Build the ledger from the case names first, delete only cases whose Go coverage already exists on main, and leave the rest for the change that ports them. The mechanism is the implementer's choice within those outcomes. If the deleted cases would exceed the size limit, the remainder goes to a follow-up issue filed from this one.

Dependencies

Blocked by: none, for the cases whose Go coverage is on main.

Prerequisite: the Go tests for internal/config and agentrepo config are on main. Child 08 and child 09 extend this child's ledger.

The pull request stays below 800 lines of code and 2,000 prose lines; excess goes to a follow-up issue, not to a later retirement child.

Size

S. One pull request, deletions only, at most 800 lines of code.

Verify plan

  • AC1: a script or test lists the case names in the three suites and checks each against the ledger.
  • AC2: git diff shows only deletions of ledger-marked cases, and the Bats run for the suites passes.
  • AC3: git diff --stat shows no file outside tests/skills/source/lib/ and the ledger, and mise run check-generated-skills passes.
  • AC4: a check that every deleted ledger row names its covering test, its coverage kind and its executing platforms.
  • AC5: the CI job logs for the named Go tests on each promised platform, showing the tests ran and were not skipped.
  • AC6: the three-run median Bats timings before and after are recorded in the pull request, with the coverage diff of the ledger.
  • 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

Deleting a case whose Go equivalent is weaker loses coverage. The ledger names the covering test for each deletion, and the review checks it. Undo: revert the change, which restores the cases.

Operator authority

None.

Activity

  1. tbhb-agent commented on Oct 27, 2026

    @tbhb-agent
    ContributorAuthor

    Refinement: READY — The shared library Bats suites are retired where Go already covers them
    Model: gpt-6-astra

    Child 01 The shared library Bats suites are retired where Go already covers them

    Verdict: READY

    Checked: Prior coverage findings remain closed; refresh the acknowledged child references when filing. Gaps: None. Split: None.

    Definition of done

    The definition of done for this issue (Chore). 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: 1 of 3

  2. added theissue type on Oct 27, 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

    Type

    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