test: combine existing branch cleanup checks #10

Merged
jercik merged 1 commit from test/combine-existing-branch-cleanup into main 2026-10-24 13:37:12 +00:00
Owner

Combines two tests that repeat the same Git fixture and setup failure, removing one repository setup and worktree lifecycle. The combined test retains the checkout-by-name and branch-preservation assertions.

Combines two tests that repeat the same Git fixture and setup failure, removing one repository setup and worktree lifecycle. The combined test retains the checkout-by-name and branch-preservation assertions.
test: combine existing branch cleanup checks
All checks were successful
Checks / pr-flow-canary (pull_request) Has been skipped
Checks / reuse (pull_request) Successful in 6s
commit-msg / commitlint (pull_request) Successful in 13s
Checks / quality-checks (24.15.0) (pull_request) Successful in 35s
Checks / quality-checks (26.5.0) (pull_request) Successful in 36s
Review / Review (pull_request_target) Successful in 3m0s
4d900d0bc6

Review 01M5Q1GXC1TB9QPSAF7HA6NPVD — head 4d900d0bc64727eb164fd68b85212b76889973a2

Review — j4k-oss/worktree-add @ 9c1c4f5320

Scope: diff against base tree b760cf357a4e
Review finished: 10 succeeded, 0 failed
Triage: settled
Facts: current review-wide projection

Computed under:

{
  "abandonment": "abandonment-v1",
  "anchor_recipe": 1,
  "batch_policy": "batch-v1",
  "coverage": "coverage-v3",
  "dispatch_policy": "dispatch-v2",
  "grounder_version": 1,
  "grounding_read_rule": "grounding-read-v1",
  "promotion_policy": "promotion-v1",
  "report": "report-v5",
  "tally": "tally-v1",
  "triage_settle": "triage-settle-v2"
}

Findings (1)

low — Unborn-repository tests accept an incorrect rejection of supported Git

  • claim: 01M5Q1MKGRJA8RREH14PP2SYJQ
  • anchor: src/cli/run-worktree-add.test.ts (snippet)
    const oldGitVersion = findTooOldGitForUnbornHead();
  • lens: test-trimming · arm: default
  • verdicts: 1 valid / 0 invalid / 0 uncertain
    • pass 01M5Q1N5NEAZYKG2B5PT777Q57 · valid: The grounded excerpt shows the test sets oldGitVersion from the production helper findTooOldGitForUnbornHead(). The reviewer's static trace holds together: the test picks between "created" and the refusal message, and between "feature/new" and "no worktree", using that helper's result, while runWorktreeAdd throws formatUnbornHeadGitMessage(oldGitVersion) whenever the same helper returns a value. So the test's oracle is the implementation's own decision, the 'expectation copied from the implementation' disconnect the test guidelines name. The claim gives all three required parts. Promised behavior: creation succeeds in an unborn repository on supported Git. Weakness: the expected outcome tracks the helper. Missed regression: changing the minor-version comparison to >= 99 misclassifies Git 2.47 as unsupported, production refuses, and both assertions shift to accept the refusal, so the test stays green. The cleanup test has the same weakness, since it derives its expected error from the helper and accepts an absent destination. The reviewer reports searching the test files and finding no independent unit coverage of the helper's version predicate. The batch offers nothing against that, so no other test is shown to catch the mutation. The proposed repair keeps both integration tests and replaces only the oracle with an independent capability probe. That follows the guidelines' preference for repair over deletion. This matches prior claim 01M5KYQPY3NZD1KME8DGD71ZFZ, judged valid on the same anchor. I reassessed it independently here and nothing in this batch suggests a fix or a changed condition. Low severity is appropriate.
  • disposition: none

The test named "creates the worktree" can stay green when the CLI refuses to create any worktree in an unborn repository on a supported Git version. Its expected outcome follows the same production predicate that controls the refusal, so this regression loses the intended success check.

The test obtains oldGitVersion = findTooOldGitForUnbornHead() and expects either "created" or the refusal message according to that result. Its branch assertion similarly expects either "feature/new" or "no worktree". In runWorktreeAdd, the same helper causes throw new Error(formatUnbornHeadGitMessage(oldGitVersion)) whenever its result is defined. For example, changing the helper's supported-minor comparison from version.minor >= UNBORN_HEAD_MIN_GIT.minor to version.minor >= 99 would misclassify Git 2.47 as unsupported. The CLI would reject before creation, and both assertions would accept that result. The nearby "removes the worktree in a repository with no commits yet" test also derives its expected error from this helper and accepts an absent destination, so it would not catch that regression either.

Keep the creation and cleanup checks, but determine the fixture's supported capability independently of findTooOldGitForUnbornHead, for example by probing Git's unborn-worktree operation in a separate scratch repository. On capable Git, require creation and require the injected setup failure to be reached in the cleanup case.

I traced both tests, runWorktreeAdd, findTooOldGitForUnbornHead, formatUnbornHeadGitMessage, and createWorktree, and searched all test files for unborn-repository/version coverage; the two tests above are the relevant checks found. This is a static trace, not an executed mutation: dependencies are absent from the supplied tree.

Running the two tests on supported Git with the described predicate mutation would establish the missed regression; an independent test that rejects that misclassification would reduce the protection gap. Git in this environment reports 2.47.3.

Other claims

  • grounding-pending (0)
  • ungrounded (0)
  • rejected (0)
  • duplicate-of (0)
  • unadjudicated (0)

Coverage

Coverage pass: 01M5Q1H568FYDQMN0DJPZ8RZ7F
Accounting: complete (all slots terminal; see slot results for failures)
Slot health: healthy

lens part arm unit status runs loss
general-bug whole default no-claims 1 no
writing-quality whole default no-claims 1 no
test-trimming whole default claims-emitted 1 no
restated-sets whole default no-claims 1 no
project-docs whole default no-claims 1 no
unix-cli whole default no-claims 1 no
use-effect whole default no-claims 1 no
module-design whole default no-claims 1 no
aposd-plain whole default no-claims 1 no
react whole default no-claims 1 no
<!-- review:summary --> **Review** `01M5Q1GXC1TB9QPSAF7HA6NPVD` — head `4d900d0bc64727eb164fd68b85212b76889973a2` # Review — j4k-oss/worktree-add @ 9c1c4f5320c0 Scope: diff against base tree `b760cf357a4e` Review finished: 10 succeeded, 0 failed Triage: settled Facts: current review-wide projection Computed under: ```json { "abandonment": "abandonment-v1", "anchor_recipe": 1, "batch_policy": "batch-v1", "coverage": "coverage-v3", "dispatch_policy": "dispatch-v2", "grounder_version": 1, "grounding_read_rule": "grounding-read-v1", "promotion_policy": "promotion-v1", "report": "report-v5", "tally": "tally-v1", "triage_settle": "triage-settle-v2" } ``` ## Findings (1) ### low — Unborn-repository tests accept an incorrect rejection of supported Git - claim: `01M5Q1MKGRJA8RREH14PP2SYJQ` - anchor: `src/cli/run-worktree-add.test.ts` (snippet) ``` const oldGitVersion = findTooOldGitForUnbornHead(); ``` - lens: test-trimming · arm: default - verdicts: 1 valid / 0 invalid / 0 uncertain - pass `01M5Q1N5NEAZYKG2B5PT777Q57` · valid: The grounded excerpt shows the test sets oldGitVersion from the production helper findTooOldGitForUnbornHead(). The reviewer's static trace holds together: the test picks between "created" and the refusal message, and between "feature/new" and "no worktree", using that helper's result, while runWorktreeAdd throws formatUnbornHeadGitMessage(oldGitVersion) whenever the same helper returns a value. So the test's oracle is the implementation's own decision, the 'expectation copied from the implementation' disconnect the test guidelines name. The claim gives all three required parts. Promised behavior: creation succeeds in an unborn repository on supported Git. Weakness: the expected outcome tracks the helper. Missed regression: changing the minor-version comparison to >= 99 misclassifies Git 2.47 as unsupported, production refuses, and both assertions shift to accept the refusal, so the test stays green. The cleanup test has the same weakness, since it derives its expected error from the helper and accepts an absent destination. The reviewer reports searching the test files and finding no independent unit coverage of the helper's version predicate. The batch offers nothing against that, so no other test is shown to catch the mutation. The proposed repair keeps both integration tests and replaces only the oracle with an independent capability probe. That follows the guidelines' preference for repair over deletion. This matches prior claim 01M5KYQPY3NZD1KME8DGD71ZFZ, judged valid on the same anchor. I reassessed it independently here and nothing in this batch suggests a fix or a changed condition. Low severity is appropriate. - disposition: none > The test named "creates the worktree" can stay green when the CLI refuses to create any worktree in an unborn repository on a supported Git version. Its expected outcome follows the same production predicate that controls the refusal, so this regression loses the intended success check. > > The test obtains `oldGitVersion = findTooOldGitForUnbornHead()` and expects either "created" or the refusal message according to that result. Its branch assertion similarly expects either "feature/new" or "no worktree". In `runWorktreeAdd`, the same helper causes `throw new Error(formatUnbornHeadGitMessage(oldGitVersion))` whenever its result is defined. For example, changing the helper's supported-minor comparison from `version.minor >= UNBORN_HEAD_MIN_GIT.minor` to `version.minor >= 99` would misclassify Git 2.47 as unsupported. The CLI would reject before creation, and both assertions would accept that result. The nearby "removes the worktree in a repository with no commits yet" test also derives its expected error from this helper and accepts an absent destination, so it would not catch that regression either. > > Keep the creation and cleanup checks, but determine the fixture's supported capability independently of `findTooOldGitForUnbornHead`, for example by probing Git's unborn-worktree operation in a separate scratch repository. On capable Git, require creation and require the injected setup failure to be reached in the cleanup case. > > I traced both tests, `runWorktreeAdd`, `findTooOldGitForUnbornHead`, `formatUnbornHeadGitMessage`, and `createWorktree`, and searched all test files for unborn-repository/version coverage; the two tests above are the relevant checks found. This is a static trace, not an executed mutation: dependencies are absent from the supplied tree. > > Running the two tests on supported Git with the described predicate mutation would establish the missed regression; an independent test that rejects that misclassification would reduce the protection gap. Git in this environment reports 2.47.3. ## Other claims - grounding-pending (0) - ungrounded (0) - rejected (0) - duplicate-of (0) - unadjudicated (0) ## Coverage Coverage pass: 01M5Q1H568FYDQMN0DJPZ8RZ7F Accounting: complete (all slots terminal; see slot results for failures) Slot health: healthy | lens | part | arm | unit status | runs | loss | | --- | --- | --- | --- | --- | --- | | general-bug | whole | default | no-claims | 1 | no | | writing-quality | whole | default | no-claims | 1 | no | | test-trimming | whole | default | claims-emitted | 1 | no | | restated-sets | whole | default | no-claims | 1 | no | | project-docs | whole | default | no-claims | 1 | no | | unix-cli | whole | default | no-claims | 1 | no | | use-effect | whole | default | no-claims | 1 | no | | module-design | whole | default | no-claims | 1 | no | | aposd-plain | whole | default | no-claims | 1 | no | | react | whole | default | no-claims | 1 | no |
Author
Owner

Claim 01M5Q1MKGRJA8RREH14PP2SYJQ identifies the existing unborn-HEAD test weakness already recorded in #5. Both affected tests and the production version guard are unchanged between base 9a9070d2df46c1d87ca9cfabdf862cc4959aa5fd and head 4d900d0bc64727eb164fd68b85212b76889973a2.

The weakness remains unfixed. This PR combines two committed-repository tests with identical setup and preserves their checkout and cleanup assertions. The existing user instruction is to report findings outside the accepted criteria without starting another round, so this finding remains outside this change; no follow-up PR or issue is created.

Claim `01M5Q1MKGRJA8RREH14PP2SYJQ` identifies the existing unborn-HEAD test weakness already recorded in [#5](https://code.j4k.dev/j4k-oss/worktree-add/pulls/5#issuecomment-179519). Both affected tests and the production version guard are unchanged between base `9a9070d2df46c1d87ca9cfabdf862cc4959aa5fd` and head `4d900d0bc64727eb164fd68b85212b76889973a2`. The weakness remains unfixed. This PR combines two committed-repository tests with identical setup and preserves their checkout and cleanup assertions. The existing user instruction is to report findings outside the accepted criteria without starting another round, so this finding remains outside this change; no follow-up PR or issue is created.
jercik merged commit 15369962d9 into main 2026-10-24 13:37:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
j4k-oss/worktree-add!10
No description provided.