Skip to content

Green evidence is keyed on what was tested: git tree, pinned seed, host (D49) - #1223

Merged
ehartford merged 3 commits into
mainfrom
green-evidence-keyed-on-inputs
Sep 20, 2026
Merged

ehartford merged 3 commits into
mainfrom
green-evidence-keyed-on-inputs

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Why. #1222's battery passed in a staging worktree. After the squash-merge main's tree was byte-identical (git diff empty), and :install-user still required a second full battery, 25 minutes, over the same sources. Eric: "it is moronic that we are testing what we already tested."

Cause. last-green, require-last-green and the driver's :install-user gate accepted only the exact compiler binary that was tested (compiler_sha256). The binary names its commit (the version ends in -g<hash>, a post-link stamp) and, through debug paths, its worktree, so a squash-merge or another checkout of the same sources is a "different" compiler.

Change. What a battery tests is its inputs.

  • :last-green is now a group. last-green-record (the same action, verifying what it verified before) also records the source identity: git rev-parse HEAD^{tree}, the digest of the pinned seed that drove and seeded the chain, and the host. last-green-publish installs the store: $WITH_GREEN_DIR, else ~/.local/with-green/green.tsv, one line per identity. A dirty worktree has no identity and publishes nothing (untracked paths under examples/ excepted: a user's own programs are not build inputs).
  • require-last-green (build/retention.w) and the driver's install gate (src/main.w, with the lookup in src/compiler/GreenEvidence.w) accept a compiler when the local manifest names that binary, as before, or the worktree is clean, its stage chain was seeded by a compiler seed.lock pins, and its identity has a published green. The accepting line names the commit the green was recorded at.

After a squash-merge of a tested branch the reseed is git pull, src/main build, out/release/bin/with build :install-user. CI, the battery's contents and what counts as green are unchanged. D49 records the decision; CLAUDE.md and AGENTS.md carry the rule.

Evidence (pinned seed, head 433a600):

build rc=0   fixpoint rc=0   test rc=0   test-green rc=0   last-green rc=0

Proof, in a second worktree on a different commit (3ac8d31d) with the same tree, built only, no tests run and no local last-green.json:

1. clean, same tree        -> require-last-green rc=0: these sources are green: recorded at commit 433a600b…
2. uncommitted edit        -> rc=1 (refused)
3. committed 1-byte change -> rc=1 (refused)
driver gate (:install-user into a scratch HOME):
   [install-user] … <- out/release/bin/with (these sources are green: recorded at commit 433a600b…)
   dirty tree: error: missing last-green manifest, and no published green for these sources

Not done here. The test cache is still keyed on the stamped compiler (0 cached, N ran after any new commit). The reseed no longer needs a re-run; a developer who wants :test on main after a merge still pays for it.

Two batteries on this branch were red from my own edits before this one: git's --porcelain literal in src/main.w tripped spec-inventory-check (moved to its own module), and the renamed action kept the old write scope.

Eric Hartford added 3 commits September 20, 2026 01:57
…st (D49)

#1222's battery passed in a staging worktree; after the squash-merge main's
tree was byte-identical (git diff empty) and :install-user still demanded a
second 25-minute battery. last-green and the driver's install gate accepted
only the exact tested binary, and the binary names its commit (the version
ends in -g<hash>) and, through debug paths, its worktree.

- :last-green is now a group: last-green-record (the action, unchanged in
  what it verifies) also records the source identity — git rev-parse
  HEAD^{tree}, the pinned seed's digest, the host — and last-green-publish
  installs the store ($WITH_GREEN_DIR, else ~/.local/with-green/green.tsv),
  one line per identity. A dirty worktree has no identity and publishes
  nothing.
- require-last-green (build/retention.w) and the driver's :install-user gate
  (src/main.w cli_fast_install_blessed) accept a compiler when the local
  manifest names that binary, as before, or when the worktree is clean, its
  chain was seeded by a compiler seed.lock pins, and its identity has a
  published green. The accepting line names the commit the green was
  recorded at.

After a squash-merge of a tested branch the reseed is git pull, build,
:install-user.
…e CLI's flag file

spec-inventory-check reads string literals in src/main.w as `with` flags and
rightly reported git's "--porcelain" as an unspec'd one. The source-identity
lookup moves into its own module; src/main.w calls
green_by_source_identity(root).
The action's capture directory is out/command/<target name>; the renamed
target still declared out/command/last-green as its write scope.
@ehartford
ehartford merged commit e98553e into main Sep 20, 2026
5 checks passed
@ehartford
ehartford deleted the green-evidence-keyed-on-inputs branch September 24, 2026 16:56
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