Skip to content

fix(boatstack): key visual-evidence trust to product identity - #254

Merged
bigboateng merged 1 commit into
mainfrom
visual-evidence-1-product-diff-staleness
Jul 30, 2026
Merged

fix(boatstack): key visual-evidence trust to product identity#254
bigboateng merged 1 commit into
mainfrom
visual-evidence-1-product-diff-staleness

Conversation

@bigboateng

Copy link
Copy Markdown
Contributor

Why

resolvePRVisualEvidence trusted a manifest only when SourceCommit == headCommit && ProductDiffSHA256 == diffHash. That predicate has no fixpoint through publication: publish-pr requires committing the exact reviewed pr.md (clean-tree check), which moves HEAD — while productDiff explicitly excludes pr.md. So PASS evidence always degraded to NOT_VERIFIED on the mandatory preview commit, re-capturing changed the manifest fingerprint, the regenerated preview needed a new commit, and the loop never converged. Under require, publication with current screenshots was unreachable. Latent today because no test publishes with PASS evidence.

What changed

  • Trust is keyed to product identity only: ProductDiffSHA256 == diffHash. Pixels may only depend on product content; committing the reviewed preview (excluded from the product diff) can never invalidate them, and any product change stales them immediately.
  • SourceCommit stays recorded for provenance; the PR preview template's Visual-evidence Commit column now names the capture commit (falling back to HEAD when no manifest exists) instead of assuming HEAD.
  • resolvePRVisualEvidence drops the now-unused headCommit parameter; captureProductDiff docs updated to state the trust rule.

Invariants pinned

  • TestCommittingPreviewNeverInvalidatesPassVisualEvidence: PASS status and visual fingerprint are stable across the preview commit; the committed preview still checks; provenance keeps the capture commit and the template renders it.
  • TestProductDiffChangeInvalidatesPassVisualEvidence: a different product diff → NOT_VERIFIED; require coerces to BLOCKED.

Context

Slice 1 of 5 of the visual-evidence-as-deterministic-requirement program (auto-capture during ship, suggest→require escalation for plan-approved scenarios, attach-retry prescription, per-surface harnesses). This staleness fix is the enabler: auto-capture cannot be built on a trust rule that self-invalidates.

Verification

  • go build ./... && go vet ./... && go test ./... green in product-engineering-loop/
  • release_notes.py validate + preflight PASS (new note: 2026-07-30-visual-evidence-survives-preview-commit.md)

Trusting a manifest only at an identical head commit had no fixpoint:
publication requires committing the reviewed pr.md, which moves HEAD
while the product diff (which excludes pr.md) is unchanged, so PASS
evidence always degraded to NOT_VERIFIED before publish-pr could see
it. Trust is now keyed to ProductDiffSHA256 alone; SourceCommit stays
recorded for provenance and the preview template names the capture
commit instead of assuming HEAD.

Invariants pinned by tests:
- committing pr.md never invalidates PASS evidence (status and
  fingerprint stable across the preview commit)
- any product-diff change stales evidence immediately, and require
  coerces it to BLOCKED

Disclosure-Reviewed: reviewed — public-safe only, private facet kept out of this commit
@bigboateng
bigboateng merged commit d604f83 into main Jul 30, 2026
12 checks passed
@bigboateng
bigboateng deleted the visual-evidence-1-product-diff-staleness branch July 30, 2026 10:24
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