Skip to content

fix(testing): test judge marks a linked-worktree test UNKNOWN because its quotes are grounded against the wrong repository #6206

Closed

Description

@kyle-sexton

This was generated by AI during work-loop.

Context

The testing plugin's Stop-hook test judge returned an UNKNOWN for a test file that sits in a linked worktree a dispatched implementer was still editing. The UNKNOWN then blocked the orchestrator's Stop with "show the user each verdict ... wait for the user", even though the verdict had no finding in it.

Observed 2026-10-04T07:10:11Z in an orchestrator session rooted at the main checkout (C:/Projects/melodic/claude-code-plugins, branch main). Review file .work/reviews/main/20261004T071011Z-test-judge.md:

UNKNOWN C:/Projects/melodic/worktrees/melodic-software-claude-code-plugins-6187/plugins/harness-ops/skills/plugins/scripts/sync-run.test.sh (lines 1-1739)
Reason: a quoted line is in no file of the repository
Judge: sonnet at medium effort.

The reason string comes from the quote-grounding check in plugins/testing/hooks/judge-lib.sh (judge::quoted_in_repo, around line 605).

Suspected causes (unverified; reproduce first)

  1. Wrong repository for the quote check. The test file is in a linked worktree (worktrees/...-6187, branch feat/6187-plugins-sync-ask-installs), but the session's repository is the main checkout. If the grounding check searches the main checkout, a line that exists only on the worktree's branch is "in no file of the repository". This looks like the same family as fix(testing): test judge runs in the wrong repository and returns "Read permission denied" UNKNOWNs #6099 (judge in the wrong repository, closed by fix(testing): judge each test file in its own repository, with an absolute Read rule #6168), but on the quote-grounding path.
  2. The file changed under the judge. The implementer kept editing the file after the judge read it, so a quoted line may no longer exist when it is checked.
  3. Scope. The test was edited by a subagent working in another worktree, not by this session. The parent session's Stop hook arguably should not judge it at all, or should judge it against that worktree's repository.

Proposed work

Reproduce with a test file in a linked worktree that a subagent edits, then judge it from a session rooted elsewhere. Fix whichever cause holds. At minimum, resolve the grounding repository from the test file's own git rev-parse --show-toplevel, not the session's. Then decide whether an UNKNOWN produced by grounding failure alone should block Stop and ask the user to act.

Acceptance criteria

  • A regression test: a test file in a linked worktree, with a quoted line that exists only on that worktree's branch, is grounded successfully (no "in no file of the repository" UNKNOWN).
  • A stay-quiet test: a quote that really exists nowhere still yields the UNKNOWN.
  • An UNKNOWN that carries no finding does not block Stop with a request for user action, or the operator records why it should.

References

Metadata

Filed by the work-loop lane (instance melo-worker-1) at the operator's request. Not self-triaged.

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 4, 2026
  2. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor

    Thanks for the report. Automated triage handed this issue to a maintainer.

    Automated triage. A maintainer reviews it.

  3. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 4, 2026
  4. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    ContributorAuthor

    This was generated by AI during work-loop.

    Second occurrence, 2026-10-04T08:07:50Z: the same session (rooted at the main checkout) got the same UNKNOWN for the same linked-worktree file, now lines 1-1743, after the #6187 ready flow had pushed further commits there. Review file: .work/reviews/main/20261004T080750Z-test-judge.md. It recurs at every Stop while the worktree's test differs from main, so each recurrence blocks Stop again.

  5. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    ContributorAuthor

    This was generated by AI during triage.

    Triage verdict: cause 1 confirmed for the code that ran, and fixed by #6168 (testing 0.22.6, on origin/main). Cause 2 and acceptance criterion 3 remain open. Needs an operator decision on scope.

    Evidence

    • The stored verdict behind the 07:10:11Z review (judged 2026-10-04T07:10:10Z) records repo as the main checkout, not the -6187 worktree. The judge itself returned PASS; validation turned it UNKNOWN because a quoted line was not found in the main checkout. Basis: verified, the testing plugin's data directory verdict record for that file, repo: C:/Projects/melodic/claude-code-plugins, verdict: PASS (before validation).
    • The code that ran predates fix(testing): judge each test file in its own repository, with an absolute Read rule #6168: neither installed testing version (0.21.3 project scope, 0.22.5 user scope) has judge::file_repo, and the local main checkout the directory marketplace points at is 17 commits behind origin/main and does not contain fix(testing): judge each test file in its own repository, with an absolute Read rule #6168. The recurrence at 08:07:50Z is the same stale code.
    • On origin/main 79abd80, judge::run resolves the repository from the test file's own git rev-parse --show-toplevel and records it on the verdict, and judge::validate grounds quotes against that recorded repository. Basis: verified, origin/main plugins/testing/hooks/judge-lib.sh:567-571 and :662-667; plugins/testing/CHANGELOG.md 0.22.6 entry.
    • Acceptance criterion 1 is covered only indirectly: origin/main's test-judge.test.sh asserts a linked-worktree file is judged from the worktree and its verdict names the worktree as its repository (around :780-785), but no test grounds a quote that exists only on the worktree's branch. The stay-quiet half (a quote found nowhere still yields the UNKNOWN) is tested (around :323).
    • Cause 2 is still live: judge::validate filters quotes against the test file as it is at validation time, so if the file is edited after the judge read it, a quote can fail grounding even in the correct repository and produce this same UNKNOWN.
    • Acceptance criterion 3 is untouched: 0.22.5 exempts from blocking Stop only UNKNOWNs for no repository or no judge class; a grounding-failure UNKNOWN still blocks with a request for user action.

    Open question for the operator

    1. Narrow fix(testing): test judge marks a linked-worktree test UNKNOWN because its quotes are grounded against the wrong repository #6206 to cause 2 (a quote made stale by a later edit of the test file) plus acceptance criterion 3 (whether a grounding-failure UNKNOWN carrying no finding should block Stop), and add the explicit worktree-only-quote regression test. Recommended.
    2. Close fix(testing): test judge marks a linked-worktree test UNKNOWN because its quotes are grounded against the wrong repository #6206 as fixed by fix(testing): judge each test file in its own repository, with an absolute Read rule #6168, accepting that a later-edit UNKNOWN can still block Stop.

    Either way, the immediate recurrence stops only once the session runs testing 0.22.6 or later (update the local checkout and installed plugin).

    Routing: human-gated, needs a decision. Priority medium. Work class scoped (bug fix) for whatever remains after the decision.

  6. added
    priority: mediumReal value, no hard deadline; normal backlog flow.
    status: needs-decisionAwaiting a human or maintainer judgment call.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 4, 2026
  7. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    ContributorAuthor

    This was generated by AI during work-loop.

    Operator decision (2026-10-04): narrow this issue (option a, recommended in the triage comment).

    Cause 1 (grounding against the wrong repository) is fixed by #6168, shipped in testing 0.22.6; the occurrences reported here came from an older installed testing version. What stays in scope:

    1. A quote can fail grounding when the test file changes between the judge's read and validation.
    2. Whether an UNKNOWN that carries no finding should block Stop and ask the user to act.
    3. A regression test: a quote that exists only on a linked worktree's branch is grounded successfully.

    Acceptance: a test for each of 1 and 3, red before the fix, and a recorded decision for 2, implemented if the answer is no.

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

    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: mediumReal value, no hard deadline; normal backlog flow.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions