Skip to content

test(cli): bind editor-agent fixture artifacts to a validated concrete repository HEAD #2383

Closed

Description

@EffortlessSteven

Parents and context

Observed failure

The hosted Test Analytics run for PR #2382 failed exactly one test:

editor_agent_loop_fixture_outputs_match_expected

with:

ripr: agent verify before artifact has invalid repository HEAD `HEAD`

The same broad failure can block unrelated test-only PRs because the fixture helper currently runs:

git rev-parse HEAD

and accepts stdout without checking command status or validating that the result is a concrete 40-character hexadecimal commit ID. When Git cannot resolve the checkout, rev-parse can echo the unresolved token HEAD; the fixture then commits that symbolic value into an artifact that correctly requires a concrete repository identity.

Outcome

Make CLI smoke fixture artifact binding use one validated concrete repository-head helper.

The helper must:

  1. run git rev-parse --verify HEAD^{commit} in the intended repository root;
  2. require successful command status;
  3. require exactly 40 ASCII hexadecimal characters;
  4. include bounded stdout/stderr context when Git fails;
  5. optionally accept the GitHub Actions GITHUB_SHA only when it is itself valid and represents the current Actions checkout identity;
  6. never commit HEAD, an empty string, a branch name, or another unresolved revision into a canonical artifact.

Use the helper in every CLI smoke fixture writer that currently extracts repository HEAD without checking the command result.

Exact current seam

At minimum:

crates/ripr/tests/cli_smoke.rs
  write_bound_repo_exposure_fixture
  bind_repo_exposure_fixture_with_worktree

The editor-agent loop test must continue to use actual generated before/after artifacts and must retain byte/semantic comparison with the committed expected outputs.

Required regression proof

  • valid committed fixture repository returns its exact 40-character SHA
  • unresolved/unborn/non-repository HEAD fails with actionable context rather than returning HEAD
  • malformed GITHUB_SHA cannot become fixture authority
  • valid Actions checkout fallback is accepted only under the documented test boundary
  • editor_agent_loop_fixture_outputs_match_expected passes under ordinary cargo test
  • the same test passes under nextest/Test Analytics parallel execution
  • agent verify/receipt tamper and currentness tests remain green
  • no production artifact validation is weakened
  • cargo test --workspace and protected Ripr Rust Small Result pass under normal parallelism

Scope

Test support and CLI smoke fixtures only. Production receipt/artifact validation must remain strict.

Non-goals

  • accepting symbolic refs as canonical repository identity;
  • weakening exact current-head checks;
  • changing receipt schema or public output;
  • serializing the suite;
  • mixing the LSP or doctor fixture patches into this PR;
  • changing release version, support tier, candidate ref, or publication authority.

Release relationship

This is a candidate-qualification baseline blocker. #2381 and #2382 should be re-tested against main after this repair lands; neither patch should be widened to absorb it. #2379 includes the repair in the supplemental denominator when selecting the next immutable candidate.

Activity

  1. added
    status/needs-work
    on Jul 24, 2026
  2. coderabbitai commented on Jul 24, 2026

    @coderabbitai
    🔗 Related PRs

    #2381 - test(lsp): complete boundary-gap saved-workspace fixture isolation (#2371) [open]
    #2382 - test(doctor): publish the hanging-tool shim atomically under parallel load (#2378) [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. EffortlessSteven commented on Jul 24, 2026

    @EffortlessSteven
    MemberAuthor

    Active exclusive writer claim

    issue: 2383
    role: builder
    branch: fix/validated-cli-fixture-head-2383
    observed_main: 9ec0e2524a1531e8b532ca51ebeea1d1ed35739d
    write_resource: crates/ripr/tests/cli_smoke.rs::repository-head-fixture-binding
    status: active
    

    This is the second active writer lane alongside #2382. PR #2381 is parked as result_submitted with no active mutation. Read-only review may proceed concurrently; no second branch-mutating writer is authorized for this seam.

  4. removed
    status/needs-work
    on Jul 24, 2026
  5. EffortlessSteven commented on Jul 24, 2026

    @EffortlessSteven
    MemberAuthor

    Verification update

    PR #2384 revision 1d2d6273da6b133384127a674834f931feb00c69 now has:

    • focused concrete repository-head tests green;
    • the formerly failing editor_agent_loop_fixture_outputs_match_expected green;
    • adjacent agent verify/receipt tests green;
    • hosted Test Analytics and doc tests green;
    • Source of Truth and Security green;
    • no review threads;
    • one-file final diff.

    The protected Routed Rust Small job still has one command failure. Disposable read-only PR #2385 is running the exact current merge tree with every required command separated and transcripted. No #2384 source mutation will occur until that command is named.

  6. EffortlessSteven commented on Jul 25, 2026

    @EffortlessSteven
    MemberAuthor

    Accepted closeout

    Merged PR #2384 as squash commit:

    ab4b9d8a34bf383b2b89f1552588a05b8abbf5ad
    

    The merged tree includes the complete reviewed contract:

    • git rev-parse --verify HEAD^{commit} with status checking;
    • exactly 40 ASCII hexadecimal characters;
    • at most one optional LF or CRLF removed, with padded/multiple-line output rejected;
    • bounded stdout/stderr on failure;
    • GITHUB_SHA fallback only at the GitHub Actions workspace-root boundary after Git failure;
    • both CLI smoke artifact writers routed through the shared authority;
    • committed, unresolved, malformed-fallback, malformed-success, line-ending, and whitespace regressions.

    Evidence:

    • focused fixture-head and editor-agent tests green;
    • Test Analytics, Source of Truth, Security, and Coverage green;
    • exact merge tree 3a73ccc2… passed every protected command on a clean GitHub-hosted runner; diagnostic artifact diagnose-2384-final-30140987170, digest sha256:805eb0fa1cc4763e5a8568a0c2998aafa206b539cda20530639f27e5f44ca35a;
    • all material review threads resolved;
    • final diff contained one Rust test-support file.

    Claim boundary: this fixes fixture repository identity and does not weaken production artifact validation or complete 0.11 candidate qualification.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions