Skip to content

Mutation base: --base, gates.base_ref, then origin/HEAD; no base fails under CI - #55

Merged
VirtualMachinist merged 5 commits into
mainfrom
hn/g1-base
Nov 20, 2026
Merged

VirtualMachinist merged 5 commits into
mainfrom
hn/g1-base

Conversation

@VirtualMachinist

Copy link
Copy Markdown
Member

Slice 1.2: the mutation layer gets a named base and stops passing silently when it has none.

  • Base order. --base, then gates.base_ref, then origin/HEAD. The hard-coded origin/main is gone from the gate path.
  • Unresolved base. A named base that does not resolve fails the layer and names the ref. A later source never stands in for it.
  • No base. Under CI (set, and not empty, false or 0) the layer fails, naming fetch-depth: 0 and --base. Outside CI it is vacuous, and the detail lists each source tried.
  • Report. The mutation row's judged.base holds {ref, source}.
  • Workflows. The kit workflow and the drop-in pass --base "origin/${{ github.base_ref || github.event.repository.default_branch }}". The eight init goldens were re-recorded with RUST_TOPS_BLESS.
  • Schema and spec. gates.base_ref in the schema and its copy; PROTOCOL.md §8.3 states the order and the CI rule.
  • Tests. tests/gate_base.rs has 21 cases, each with a real git repo: a trunk default branch, flag over key over origin/HEAD, --base nope, CI set and unset, and a dangling origin/HEAD.

Gate at the head: 51 mutants tested in 3m: 41 caught, 10 unviable, ok: 8 command(s) passed.

🤖 Generated with Claude Code

VirtualMachinist and others added 3 commits November 19, 2026 20:53
The mutation diff no longer assumes origin/main. The base is the --base
flag, else gates.base_ref, else the remote default branch (origin/HEAD).
A named base that is not a commit fails the layer and names the ref. With
no base the layer fails under CI, naming fetch-depth: 0 and --base, and is
vacuous otherwise, listing each source tried. The report names the base
and its source on the mutation row.

Both workflows pass --base. The schema, its copy, PROTOCOL.md 8.3 and the
init goldens follow. The laws_gate fixtures leave origin/HEAD as a clone
does and run without CI set.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Two mutants survived: git_line accepted a failed run or an empty line,
and the base was looked up for any layer but mutation. The lookup is now
base_for, and each has a test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
VirtualMachinist and others added 2 commits November 19, 2026 22:02
The no-base words had two owners: stdout knew about CI and the report did
not, so a CI failure showed the vacuous detail and a problem line about a
diff command that had not failed. steps::stop_note now words every stop
once. The run keeps it, and stdout, the row detail and the problem line
all print it.

- No base under CI: detail and problem name fetch-depth: 0 and --base.
- An unresolved base runs no git and counts no command; the problem names
  the ref.
- A direct origin/HEAD that names a commit is a base, not "not set".
- A base with no common history, as in a shallow checkout, gets the
  fetch-depth: 0 hint and a detail.
- The row keeps other judged keys when it adds the base.
- PROTOCOL.md states the CI rule evenly and the cookbook drops
  origin/main...HEAD.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
stop_note matched every base and diff pair in one function, which put its
CRAP over the new-code threshold. Each base kind now has its own small
function; the words and outcomes are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@VirtualMachinist
VirtualMachinist merged commit a2f8c60 into main Nov 20, 2026
17 checks passed
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.

1 participant