Conversation
…EAD~1..HEAD Sentinel CHARTER-07 was implemented as 8 commits on a feature branch. With the previous default `HEAD~1..HEAD`, both auditors processed only the last (metadata-only) commit and converged on "0 substantive findings" vacuously — they never saw the migrations, SQLC, scaffolding, or PII guard test that constituted the actual ~4150 lines of implementation. This is R11(A) of issue #102. Fix in `cli/src/commands/charter/audit.rs`: - New `resolve_default_range(project_root)` helper that probes upstream branches in priority order — `origin/main` first, then `origin/master` (legacy convention) — via `git rev-parse --verify --quiet`. Returns `<upstream>..HEAD` when one is found, capturing the full implementation set since the feature branch diverged from main. - Falls back to the v0 default `HEAD~1..HEAD` when no upstream is reachable (freshly-cloned repo without remote, disconnected branch, operator hasn't `git fetch`-ed yet) with a warning to stderr that explains the limitation and suggests `--range <REV..REV>` explicitly. - The `--range` flag is unchanged: explicit operator override still wins, and no upstream probe is attempted in that case (no warning). Tests in `cli/tests/charter_audit_test.rs`: - New helper `init_repo_with_remote_main(dir) -> TempDir` creates a bare remote in its own tempdir (avoiding parallel-test collision on shared `/tmp` parents), pushes main, and spawns a feature branch with multiple commits. Returns the remote's TempDir so the caller keeps it alive for the duration of the test. - `audit_default_range_uses_origin_main_when_available` — verifies the resolved prompt contains `origin/main..HEAD`, NOT the literal `HEAD~1..HEAD` fallback. - `audit_default_range_falls_back_to_head_minus_one_without_remote` — verifies stderr warning text and that prompt contains `HEAD~1..HEAD`. - `audit_explicit_range_overrides_default_resolution` — backwards-compat sanity: `--range HEAD~1..HEAD` still wins over the new resolution logic and produces NO fallback warning. Test plan: - cargo test → 14 charter_audit (11 + 3 new) + 276 unit + all suites green. - cargo build → 3.65s. - No version bump (lands together with PRs 3-8 in the integrated v1 release per Propuesta/devtrail-audit-cli-flow.md v0.2 §5). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second of 8 PRs implementing the integrated v1 audit-skills iteration described in `Propuesta/devtrail-audit-cli-flow.md` v0.2. Closes R11(A) of issue #102 — default `git_range` was `HEAD~1..HEAD` which fails on multi-commit feature branches.
What was wrong
Sentinel CHARTER-07 was implemented as 8 commits on a feature branch. With the previous default, both auditors processed only the last (metadata-only) commit and converged on "0 substantive findings" vacuously — they never saw the migrations, SQLC, scaffolding, or PII guard test that constituted the actual ~4150 lines of implementation.
What changed
In `cli/src/commands/charter/audit.rs`:
Tests
Test plan
Phase v1 progress
🤖 Generated with Claude Code