Skip to content

test(cli): require concrete fixture repository HEADs (#2383) - #2384

Merged
EffortlessSteven merged 16 commits into
mainfrom
fix/validated-cli-fixture-head-2383
Jul 25, 2026
Merged

EffortlessSteven merged 16 commits into
mainfrom
fix/validated-cli-fixture-head-2383

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Swarm / Source Boundary

  • repair or follow-up for a same-repo swarm PR
  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm
  • swarm-only CI, runner, routing, source-of-truth, or agent-operating surface
  • other swarm-scoped work

No source release, publishing, signing, marketplace, asset, secret, or repository-settings authority moves in this PR.

Source-of-truth Links

Scope

One test-support file:

crates/ripr/tests/cli_smoke.rs
  • run git rev-parse --verify HEAD^{commit};
  • require successful output to be exactly 40 ASCII hexadecimal characters;
  • preserve bounded stdout/stderr context on failure;
  • allow a validated GITHUB_SHA fallback only when:
    • Git failed;
    • the requested root canonicalizes to the repository workspace root;
    • GITHUB_ACTIONS=true;
    • GITHUB_SHA is itself a concrete 40-character hexadecimal commit ID;
  • never use fallback to hide malformed successful Git output;
  • route both repo-exposure fixture writers through the shared helper;
  • add focused committed, unresolved, malformed-fallback, valid-Actions-fallback, and malformed-success tests.

Scope Classification

  • One production behavior
  • One public contract
  • One architectural seam
  • Docs/spec/test-only evidence package
  • Other

Production delta:

  • none

Evidence/support delta:

  • generated CLI smoke artifacts cannot contain symbolic HEAD, branch names, empty output, or another unresolved revision as repository identity

Single acceptance criterion:

  • the editor-agent fixture and adjacent verify/receipt corpus run with concrete repository identity under ordinary and hosted test execution

Non-goals:

Support-tier Impact

  • none
  • updates docs/status/SUPPORT_TIERS.md
  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim

Claim/proof notes:

Policy Impact

  • none
  • doc artifacts
  • CI lane
  • package boundary
  • lint / Clippy
  • no-panic
  • file policy
  • generated artifact
  • dependency
  • process/network

Ledger or exception notes:

  • no persistent workflow, dependency, process, network, or allowlist change

Proof

The read-only validation job passed before the final commit:

cargo test -p ripr --test cli_smoke fixture_repository_head -- --test-threads=1
cargo test -p ripr --test cli_smoke editor_agent_loop_fixture_outputs_match_expected -- --exact --test-threads=1
cargo test -p ripr --test cli_smoke agent_verify -- --test-threads=4
cargo test -p ripr --test cli_smoke agent_receipt -- --test-threads=4
cargo fmt --all -- --check
git diff --check

Result, failures, or skipped proof:

  • concrete repository-head tests: pass;
  • previously failing editor-agent loop: pass;
  • adjacent verify/receipt tests: pass;
  • formatting and one-file cage: pass;
  • validated artifact digest handoff and same-branch commit: pass;
  • ordinary protected and Test Analytics proof: pending.

Claim Boundary

After merge, we may claim that CLI smoke fixture artifacts bind to a concrete repository commit or fail with bounded command context.

We may not claim changed production validation, universal repository currentness, or release readiness.

Rollback

Revert the squash commit. The previous unchecked fixture helper returns, and Test Analytics can again fabricate HEAD as artifact identity when Git resolution fails.

Spec-Test-Code Traceability

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in the added tests.
  • No non-Rust programming files remain in the final diff.
  • No generated, dependency, process-spawn, or network surface change remains in the final diff.
  • Errors retain bounded actionable context.
  • No public JSON/schema change.

Gates

  • focused concrete-HEAD tests
  • previously failing editor-agent loop
  • adjacent agent verify/receipt tests
  • cargo fmt --check
  • protected Ripr Rust Small Result
  • Test Analytics
  • material review threads resolved
  • final diff contains no temporary workflow or transformation file

All package, publish, extension, dependency, documentation, and public-contract gates are n/a to this one-file test-only delta unless the protected route selects them.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @EffortlessSteven, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@github-actions[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2e31efc7-a40a-4d1d-99d6-155c4d0027f7

📥 Commits

Reviewing files that changed from the base of the PR and between 2c33438 and 6dcc5f8.

📒 Files selected for processing (1)
  • crates/ripr/tests/cli_smoke.rs

Walkthrough

The CLI smoke fixtures now resolve repository heads through validated concrete commit IDs, optionally use a valid GitHub Actions checkout SHA, and include bounded Git command context on failure. Both fixture writers use the helper, with regression tests and a one-off validation workflow.

Changes

Fixture repository HEAD validation

Layer / File(s) Summary
Concrete HEAD resolution and fixture integration
.github/workflows/..., crates/ripr/tests/cli_smoke.rs
Git head resolution validates 40-character hexadecimal commits, reports bounded command output, supports valid Actions fallback, and is used by both fixture writers.
Repository HEAD regression coverage
crates/ripr/tests/cli_smoke.rs
Tests cover valid commits, unresolved or malformed output, valid fallback, and rejection of malformed successful output.
One-off branch validation workflow
.github/workflows/fix-2384-lowercase.yml
The workflow verifies branch history, applies stdout normalization, runs formatting, lint, and targeted tests, then commits and pushes the staged change while deleting itself.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

I’m a rabbit with a commit in my paws,
No fuzzy HEAD, just hex-code laws.
Tests hop through Git, workflows gleam,
Fixtures bind to a concrete stream.
With checks all green, I thump and cheer!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: requiring concrete repository HEADs for CLI smoke fixtures.
Description check ✅ Passed The description mostly follows the template and includes the required scope, proof, rollback, and traceability sections.
Linked Issues check ✅ Passed The changes satisfy #2383 by validating concrete commit IDs, adding bounded failure context, using the helper in both fixture writers, and adding regression tests.
Out of Scope Changes check ✅ Passed The final diff stays within test-support fixture repair work and does not introduce unrelated scope changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/validated-cli-fixture-head-2383

Comment @coderabbitai help to get the list of available commands.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review July 24, 2026 21:20
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @EffortlessSteven, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The protected Rust gate failed on `-D clippy::collapsible_if` for the
Actions fallback branch in the concrete-HEAD helper. Collapse the nested
`if let` / `if` into a single let chain. Behavior is unchanged: the
fallback is still only accepted when it is a syntactically concrete
commit id.
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Protected-gate red was a real defect in this diff, not an aggregation artifact

Correcting the earlier diagnosis on this PR. The required Ripr Rust Small on CX43 failure was not a status-aggregation problem — it was a genuine lint failure in the code added here:

error: this `if` statement can be collapsed
  --> crates/ripr/tests/cli_smoke.rs:73:5
  = note: `-D clippy::collapsible-if` implied by `-D warnings`
error: could not compile `ripr` (test "cli_smoke") due to 1 previous error
##[error]Process completed with exit code 101.

Two things this explains:

  • The build died at the clippy stage, so cargo test never ran on that runner. The green hosted Test Analytics result was therefore not evidence that the protected matrix would pass.
  • Disposable diagnostic ci(debug): split #2384 required-gate failure into named commands #2385 reported this exact clippy invocation as PASS, which is what produced the wrong conclusion. That PR is now closed and its outcome matrix should not be cited as evidence.

Fix

1afea7f2 collapses the nested guard into a let chain:

if let Some(fallback) = actions_fallback
    && is_concrete_commit_id(fallback)
{
    return Ok(fallback.to_ascii_lowercase());
}

Behavior is unchanged — the GITHUB_SHA fallback is still accepted only when it is a syntactically concrete commit id, and still only inside the Actions workspace-root boundary. No lint was suppressed and no #[allow] was added.

Local proof on the fixed tree

  • cargo fmt --check — pass
  • cargo clippy --workspace --all-targets -- -D warnings — pass (was exit 101)
  • cargo test -p ripr --test cli_smoke — 147 passed, including the target test editor_agent_loop_fixture_outputs_match_expected

One unrelated local failure, diff_json_reports_changed_surface_before_full_repo_context, asserts src\lib.rs vs src/lib.rs. That is a Windows path-separator artifact of the local run, untouched by this diff, and this test passes on the Linux runners.

Awaiting an ordinary protected result on 1afea7f2 before merge.

Comment thread crates/ripr/tests/cli_smoke.rs Resolved
This was referenced Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant