Skip to content

test(evals-fixture-commit): fixture_commit ancestor check false-fails on a shallow clone #1140

Closed

Description

@admarble

__tests__/evals-fixture-commit.test.ts (from #993 AC-4) asserts that every evals/results/*.json file's fixture_commit SHA isAncestor(sha) of HEAD. On a shallow clone (git rev-parse --is-shallow-repository → true, e.g. a claude.ai cloud session checkout with clone_depth set), the referenced fixture commits are older than the fetched history window, so the ancestor check reports false even though the commit really is an ancestor in the full repository.

Reproduction

In a shallow checkout of main (51 commits of history in the case observed):

npx vitest run __tests__/evals-fixture-commit.test.ts

5 of 16 cases fail identically:

 × assess-dashboard.json's fixture_commit is an ancestor of HEAD (where history allows)
 × null-run-canary.json's fixture_commit is an ancestor of HEAD (where history allows)
 × qa-trust-boundary-stub-skill.json's fixture_commit is an ancestor of HEAD (where history allows)
 × qa-trust-boundary.json's fixture_commit is an ancestor of HEAD (where history allows)
 × spec-ac-parse.json's fixture_commit is an ancestor of HEAD (where history allows)

AssertionError: expected false to be true

Settled against base with scripts/settle-against-base.sh __tests__/evals-fixture-commit.test.ts: the same 5 cases fail identically at origin/main (35d7bbc) — confirming this is not caused by any particular diff, only by the shallow clone.

Expected

The test's own title says "(where history allows)", suggesting the shallow case was meant to be handled — isAncestor (or the test) should detect a shallow repository (git rev-parse --is-shallow-repository) and skip/soft-pass the affected cases rather than hard-failing, the same way a full-history clone would pass.

Where found

Surfaced while implementing #1123 in a claude.ai cloud session (SEQUANT_CHECKOUT=in-place), running the full suite before opening the PR.

Activity

  1. admarble commented on Sep 24, 2026

    @admarble
    ContributorAuthor

    Execution Verification

    Command: cd <shallow clone> && git rev-parse --is-shallow-repository && npx vitest run __tests__/evals-fixture-commit.test.ts
    Where: git clone --depth 51 https://github.com/sequant-io/sequant + git fetch origin '+refs/heads/*:refs/remotes/origin/*' (the cloud-session shape). __tests__/evals-fixture-commit.test.ts and scripts/evals/commit-ancestry.ts byte-identical to PR #1146 (cmp).
    Result: Verified. The reviewer delegated the check to the agent, which cross-checked it against the evidence below.

    Execution Output (click to expand)

    Exit code: 0
    Duration: 5 s

    true
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > finds at least one recorded eval result 1ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > assess-dashboard.json carries a well-formed fixture_commit 1ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > null-run-canary.json carries a well-formed fixture_commit 0ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > qa-trust-boundary-pr-comment.json carries a well-formed fixture_commit 0ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > qa-trust-boundary-stub-skill.json carries a well-formed fixture_commit 0ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > qa-trust-boundary-tool-output.json carries a well-formed fixture_commit 0ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > qa-trust-boundary.json carries a well-formed fixture_commit 0ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > spec-ac-parse.json carries a well-formed fixture_commit 0ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > assess-dashboard.json's fixture_commit is an ancestor of HEAD (where history allows) 35ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > null-run-canary.json's fixture_commit is an ancestor of HEAD (where history allows) 22ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > qa-trust-boundary-pr-comment.json's fixture_commit is an ancestor of HEAD (where history allows) 15ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > qa-trust-boundary-stub-skill.json's fixture_commit is an ancestor of HEAD (where history allows) 22ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > qa-trust-boundary-tool-output.json's fixture_commit is an ancestor of HEAD (where history allows) 13ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > qa-trust-boundary.json's fixture_commit is an ancestor of HEAD (where history allows) 21ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > evals/results fixture_commit gate (#993 AC-4) > spec-ac-parse.json's fixture_commit is an ancestor of HEAD (where history allows) 21ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > fixture_commit ancestry guard (#1140) > rejects a present commit that is not an ancestor of HEAD in a full clone 33ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > fixture_commit ancestry guard (#1140) > treats a present commit beyond the shallow boundary as unevaluable 31ms
    ✓ |unit| __tests__/evals-fixture-commit.test.ts > fixture_commit ancestry guard (#1140) > treats an absent commit in a shallow clone as unevaluable 24ms
    Tests  18 passed (18)
    

    Cross-checks:

    • Baseline in the same clone at the same HEAD (6868f57) with the test file from origin/main: Tests 5 failed | 11 passed (16). The failures are the same 5 cases this issue lists.
    • Full-history repo: all 7 fixture_commit values are ancestors of origin/main. The 5 failing files share f0404fc1, which the branch fetch pulled into the clone. The 2 that passed share 9fb8340c, which is absent from the clone and was already skipped by the old guard. So the 5 cases now reported unevaluable are real ancestors, and nothing invalid is being hidden.
    • PR fix(#1140): fixture_commit ancestry is unevaluable in any shallow clone #1146 CI: test, canary, typecheck, tautology-advisory, node-floor-guard, validate-skills and validate-plugin all pass.

    Human Confirmation:

    The reviewer couldn't view the raw output and asked the agent to check whether the result is typical. It is: the baseline reproduces the issue exactly, and every skipped commit is a genuine ancestor.


    Verified by /verify command

  2. admarble commented on Sep 24, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #1140

    PR #1146 (feature/1140-shallow-fixture-commit, HEAD ecaf45d9, 0 commits behind main).

    AC Coverage

    The issue has no numbered ACs. These are reconstructed from its Expected section and the handoff's fix shape:

    AC Source Description Status Notes
    AC-1 Original (Expected) A shallow clone doesn't hard-fail the ancestry cases; it skips or soft-passes them MET fixtureCommitAncestry returns unevaluable for any non-ancestor in a shallow repo. The real 51-deep clone went from 5 failed / 11 passed to 18/18 (see the verification comment)
    AC-2 Handoff The negative control still fails on a full clone for a present-but-orphan commit MET Hermetic origin repo: the orphan reads not-ancestor and F reads ancestor
    AC-3 Handoff A hermetic case reproduces the shallow shape and is mutation-verified MET Built from --depth 1 file:// clone + side fetch; F present, G absent, both beyond the boundary

    Coverage: 3/3 MET

    Precheck Findings

    Section Status Surfaced
    Fixtures pass 2 (the issue's repro command and failure list, both run)
    Sibling-grep pass 7 identifiers, 0 sibling sites
    AC literal-diff fail (false positive) "AC-4" in the issue refers to #993 AC-4, not an AC of this issue

    CI Status

    Check State
    test, canary, typecheck, tautology-advisory, node-floor-guard, validate-skills, validate-plugin SUCCESS

    CI Summary: 7 passed, 0 pending, 0 failed

    Quality Metrics

    Metric Value Status
    Type issues (any) 0 (tsc -p . and typecheck:scripts clean) OK
    Deleted tests 0 files. The host-repo negative control was replaced by a hermetic one; net +2 cases OK
    Files changed 3 (test, scripts/evals/commit-ancestry.ts, CHANGELOG) OK
    Lines +175 / -77 -
    Security 0 critical, 0 warning. Array-form spawnSync, temp dir cleaned in afterAll OK

    Build: passed. Full suite timeout 900 npm test: 337 files, 8379 passed, 1 expected fail, 3 skipped.

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    scripts/evals/commit-ancestry.ts Standard Yes __tests__/evals-fixture-commit.test.ts

    Code Review

    Strengths:

    • The fix targets the real cause. The premise "absent ⇔ shallow" was false (present=y ancestor=n for exactly the 5 failing files), so the guard now keys on --is-shallow-repository.
    • A full clone still fails in both directions. A present orphan is not-ancestor, and an absent SHA makes merge-base exit 128 with the repo not shallow, which also gives not-ancestor.
    • The helpers moved to scripts/ so the tautology detector sees real imported calls. The first push failed tautology-detector-cli.test.ts, because /fixture/i in a path marks the module as a mock; the module is now named commit-ancestry.

    Issues: none in the diff.

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation OK Asserts the three-valued verdict on real repos
    Coverage Depth OK Present/shallow, absent/shallow, orphan/full, ancestor/full
    Mock Hygiene OK No mocks; hermetic git with an explicit identity and commit.gpgsign=false
    Test Reliability OK 18 cases in ~0.5 s; fixtures built in beforeAll (60 s hook budget)

    Call-Site Review

    5 new exports, all called only from the gate test. None of them is called inside a loop or behind a mode flag.

    Execution Evidence and Script Verification

    /verify evidence is posted on this issue: exit 0, 18/18 in the real shallow clone, and the baseline reproduces 5/16. Status: Verified.

    Trust-Boundary Check

    Finding: Clean. The diff implements only the product requirement from the issue body; no agent-directed instruction from external text was acted on.
    Status: Clean

    Behavior-Rule Survival Check

    Status: Clean. For the "skip in shallow clones" rule, the old rule's symbol (the presence-only guard that asserts --is-shallow-repository == true) is gone from the diff's blast radius. commitObjectPresent survives only as an assertion helper.

    Declared-Evidence Execution

    AC Evidence Executed? Result
    Issue repro npx vitest run __tests__/evals-fixture-commit.test.ts Yes, in the full checkout and in the real shallow clone 18 passed in both

    Status: Complete

    Mutation Verification

    AC Marker Status
    AC-1 __tests__/evals-fixture-commit.test.ts > fixture_commit ancestry guard (#1140) > treats a present commit beyond the shallow boundary as unevaluable Verified (parseMutationMarkers: valid)
    AC-2 __tests__/evals-fixture-commit.test.ts > fixture_commit ancestry guard (#1140) > rejects a present commit that is not an ancestor of HEAD in a full clone Verified (valid)

    Each mutation failed exactly 1 of 18 cases and was restored.
    Status: Verified

    CHANGELOG Verification

    [Unreleased] > Fixed has an entry with (#1140). Result: requirements met.

    Risk Assessment

    • Likely failure mode: In any shallow clone, a well-formed but wrong fixture_commit now passes silently. That is inherent: a shallow clone cannot answer "no", and the old guard only "caught" such commits by also failing valid ones.
    • Not tested: git missing from PATH. spawnSync would return a null status, which gives not-ancestor, so the test fails loudly rather than silently. That's acceptable.
    • Sibling sites considered: git grep -e is-ancestor -e is-shallow-repository finds 4 other ancestry sites, none sharing the root cause. chain-rebase.integration.test.ts:43, chain-resume.integration.test.ts:46 and worktree-manager.test.ts:78 run against full-history repos the tests build themselves. templates/scripts/cleanup-worktree.sh:380 compares local main with origin/main, two commits near the tip that sit inside any shallow window. None of them decides old-commit ancestry from object presence.
    • Sibling-line audit: Both ancestry call sites in the test file now go through fixtureCommitAncestry.

    Adversarial Re-Read

    Findings:

    1. Pre-existing, not introduced here. CI's test job checks out at the default fetch-depth: 1 (.github/workflows/ci.yml:29). The per-file ancestry cases therefore always take the unevaluable branch in CI, and feat(evals): first three claude plugin eval cases, null-run canary, fixture_commit gate (#987 P1) #993 AC-4's ancestry gate is enforced only on full local clones. That was true before this PR too: the fixture objects are absent at depth 1. Closing it would need fetch-depth: 0 on test, or a small full-history job. That's a CI change outside test(evals-fixture-commit): fixture_commit ancestor check false-fails on a shallow clone #1140, so it's a follow-up.
    2. An unevaluable case reports as passed, not skipped. The old code did the same, and the new header no longer claims "reported as skipped".

    I also checked the verbatim fixtures (the issue's command and its 5-case failure list: reproduced before the fix, green after), process state (clean tree, 0 behind main), and Non-Goals (none stated).

    Status: Gaps Found (item 1, pre-existing)

    Verdict: AC_MET_BUT_NOT_A_PLUS

    All three ACs are MET and CI is green. The only gap is the pre-existing one in the Adversarial Re-Read: CI never enforces the ancestry gate. That needs its own follow-up, not a change to this PR. The PR itself can merge as is.

    Documentation

    • CHANGELOG entry added
    • N/A: no user-facing docs (internal test gate)

    Next Steps

    1. Merge fix(#1140): fixture_commit ancestry is unevaluable in any shallow clone #1146 once the owner confirms.
    2. File a follow-up to enforce the feat(evals): first three claude plugin eval cases, null-run canary, fixture_commit gate (#987 P1) #993 AC-4 ancestry gate in CI (fetch-depth: 0 on test, or a small full-history job).
  3. added
    needs-improvement
    on Sep 24, 2026
  4. added a commit that references this issue on Sep 24, 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

    needs-improvement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions