Repository navigation
Conversation
.goreleaser.yml cross-builds proofrun for windows/amd64, linux/amd64+arm64, and darwin/amd64+arm64, ldflags-injecting version/commit/date into the binary (rootCmd.Version, exposed as --version — a flag, not a new subcommand, so the CLI surface stays at exactly the four planned commands). .github/workflows/release.yml runs goreleaser via goreleaser-action on any `v*` tag push and publishes to GitHub Releases. Verified: `go build`/`go vet`/`go test -v` all pass on ubuntu-latest, macos-latest, and windows-latest via the Day 5 CI workflow (this dev machine can only execute tests on Windows directly). Local cross-compiles for all four target platforms succeed.
README leads with the one-line pitch, an install/demo block, and the "an agent saying tests pass is a claim, not a fact" framing, then the CLI reference, .proofrun.yml format, explicit out-of-scope list, and how the fingerprint is computed. Checked in this repo's own .proofrun.yml (test: go test ./..., build: go build ./..., vet: go vet ./...) and dogfooded it directly: ran all three checks (all PASS), appended a comment to internal/git/git.go and confirmed all three immediately flipped to STALE, then reverted the edit and confirmed they returned to PASS — the fingerprint is content-addressed against current git state, not an event log, so reverting to byte-identical code makes the prior receipt valid again without a re-run.
goreleaser's default {{ .ProjectName }} resolves to the repo name's
actual casing (ProofRun), producing ProofRun_linux_amd64.tar.gz — but
the README's install command references lowercase proofrun_*.tar.gz,
which would 404. Caught this by actually checking the first release's
asset list instead of assuming the config was right.
Self-review (4-angle pass) on the Day 6-7 diff surfaced no correctness bugs but several release-pipeline robustness gaps: - release.yml now runs go build/go vet/go test before invoking goreleaser — previously a pushed tag would build and publish binaries from whatever commit it pointed at, without that commit necessarily having passed the main test.yml CI (a tag isn't required to point at a tested commit). - Tag trigger tightened from `v*` to `v[0-9]+.[0-9]+.[0-9]+*` so a stray non-semver tag can't kick off a release that goreleaser then fails to parse. - Removed `before.hooks: go mod tidy` from .goreleaser.yml — go.sum is already tidy, so the hook had no upside and a real downside: if it ever rewrote go.mod/go.sum mid-release, goreleaser's dirty-tree check would abort the release. - README: fixed a lowercase/uppercase inconsistency in the install URL (github.com/yebiguo/ProofRun -> proofrun, matching the module path everywhere else — cosmetic since GitHub URLs are case-insensitive, but worth being consistent) and documented the --version flag.
…/macOS-blind release gate External review (2 MUST FIX, 1 SHOULD FIX) verified against the actual binary before fixing anything — all three reproduced exactly as reported: MUST FIX 1 — receipt.Evaluate never checked that a stored result's actual command matched what .proofrun.yml declares for that check, so `proofrun run test -- true` recorded a real PASS for a check config declares as `test: go test ./...`, and `status --strict` happily let it through (verified: exit 0). Added EvaluateAgainstCommand: when a check is declared in config with a specific command, a stored result for any other command can never read as PASS or FAIL — only NOT RUN, with an Evaluation.Note explaining the mismatch (not a fifth status; Note is descriptive text alongside the existing four). Wired into status/report via evaluateAll. Re-ran the exact exploit against the fixed binary: now correctly NOT RUN, `--strict` exits 1. Added unit + integration regression tests for both the forged-PASS and forged-FAIL directions. MUST FIX 2 — the README's install curl command 404s. Root cause is deeper than the reported /latest-vs-prerelease issue: this repo is private (per the original plan: private until stable), so no unauthenticated curl can fetch release assets at all right now, regardless of URL casing or pinning — verified empirically (curl 404s even against the exact browser_download_url from the API). Rewrote the install section to lead with `gh release download` (verified working end-to-end against the real release) and note both the privacy and the prerelease/`/latest` caveats explicitly, with the plain curl form included as a comment for once the repo goes public. SHOULD FIX 3 — release.yml's test gate ran only on ubuntu-latest before invoking goreleaser, so a tagged commit's Windows/macOS-specific behavior (tree_windows.go / tree_unix.go) was never actually exercised by the release pipeline itself. Split into a `test` job running the full ubuntu/macos/windows matrix and a `goreleaser` job that `needs: test`.
Review responseVerified all 3 findings myself before fixing anything (reproduced each one against the actual binary rather than trusting the report text): MUST FIX 1 (command-forging) — confirmed exactly as reported: MUST FIX 2 (install URL) — confirmed the 404, but the root cause was deeper than the SHOULD FIX 3 (Ubuntu-only release gate) — confirmed by inspection. Split All three fixes verified end-to-end against the actual re-published Ready for another pass whenever convenient. |
EvaluateAgainstCommand (added last round) treats expectedCommand == "" identically to "not declared" — but .proofrun.yml has no non-empty validation on Check.Command, so `command: ""` with `required: true` was a legal config that re-opened exactly the hole the last fix closed: `proofrun run test -- true` + status --strict exited 0. Reproduced against the current binary before fixing. Root-caused rather than patched around: config.Load() now rejects any check with an empty (or whitespace-only) command outright. That's a stronger invariant than special-casing the empty string downstream — it means anything present in cfg.Checks is guaranteed to have a real command, so EvaluateAgainstCommand's `expectedCommand == ""` check is now only ever true for checks that genuinely aren't declared in config. status/report already propagate config.Load() errors, so an invalid config now fails loudly (`error: .proofrun.yml: check(s) with an empty command: test`, exit 1) instead of silently allowing a forged PASS. Re-verified against the rebuilt binary: the exact repro now errors instead of exiting 0. Verified no regression on this repo's own valid .proofrun.yml (build/test/vet all still PASS with --strict exit 0). The `strings.Join(argv, " ")` command-identity comparison was also flagged as a SHOULD FIX (false-negative NOT RUN for legitimately quoted arguments, not a false PASS) — deferred per reviewer guidance since it doesn't block this fix cycle.
Review response (round 2)Verified the MUST FIX before fixing (reproduced against the actual binary): Root-caused rather than patched at the evaluation layer again: On the SHOULD FIX (
|
…sion false PASS
Verified before fixing: []string{"go","test","-run","TestCritical","./..."}
and []string{"go","test","-run","TestCritical ./..."} are genuinely
different commands — the second runs zero tests (the "./..." got
absorbed into the -run regex by shell quoting) and exits 0 even in a repo
where the real test would fail — but strings.Join(argv, " ") collapses
both to the identical string "go test -run TestCritical ./...". Built a
repro repo with a test that fails when actually run, confirmed the
mis-quoted variant exits 0 with zero tests executed, and confirmed
`proofrun status --strict` accepted it as PASS. A genuine false PASS via
completely ordinary CLI usage, no receipt tampering involved.
Root-caused per reviewer guidance: don't patch the string comparison
(re-tokenizing with a shell parser isn't viable cross-platform, per
AGENTS.md's Windows/macOS/Linux target), change what's being compared.
.proofrun.yml's `command` field is now a YAML list (argv), not a
shell-style string:
command: [go, test, -run, TestCritical, ./...]
EvaluateAgainstCommand now compares with slices.Equal instead of
string-joining either side, so the two argvs above are correctly
distinguished. This is a breaking schema change, done deliberately now
rather than patched around later — the repo is still private/pre-1.0
with no external consumers of the old string format yet, so this is the
cheapest point at which to fix it.
Re-verified against the rebuilt binary: the exact repro now reports
NOT RUN with a diagnostic showing the differing argv, `--strict` exits 1.
No regression on this repo's own .proofrun.yml (converted to array
syntax; build/test/vet still PASS, `--strict` exits 0) or on the
round-1/round-2 exploits (still correctly blocked).
Review response (round 3)Verified the escalated MUST FIX before fixing (built a real repro repo with a test that fails when actually run): Fixed exactly as suggested: Re-verified against the actual re-published binary (commit
No regression: this repo's own |
Summary
Full v0.1 per the project plan: bind a check command's exit code and duration to the exact git state (HEAD + working-tree diff fingerprint) it ran against, so a receipt goes STALE the moment code changes by even one byte.
proofrun init/run <name> -- <cmd>/status [--strict]/report [--json]internal/receipt.Evaluate) — only ever PASS/FAIL/STALE/NOT RUN, never inferred--timeout; fixed withtaskkill /T/ process-group kill)go test, not just cross-compiling.proofrun.ymlchecked in): ran realgo test/go build/go vetchecks, confirmed all PASS, edited a tracked file and confirmed all three flipped to STALE, reverted and confirmed they returned to PASSDraft per the project's own collaboration workflow — opened for read-only review before merge.
Test plan
go test ./...passes (Windows locally; ubuntu/macos/windows via CI)status --strictexits 1