feat(build): proofloop-build-sha meta + post-deploy readback - #25
Merged
Conversation
Copies the NodeVoice PR #10 pattern for Node Foyer's deployGate: live-dom identity lane. public/index.html is a static file (no bundler; vercel.json's buildCommand is `npm run build`, outputDirectory `public`), so scripts/stamp-build-sha.mjs stamps exactly one <meta name="proofloop-build-sha" content="<sha>" data-provenance="commit"> into it as a build step instead of a Vite transform. Precedence: VERCEL_GIT_COMMIT_SHA, then GITHUB_SHA, then `git rev-parse HEAD`, else "unavailable" (non-strict). Idempotent: strips any prior stamp before inserting, so repeated builds (pretest re-runs build) never duplicate the tag. Adds .github/workflows/deploy-verify.yml (on: deployment_status) that polls https://proofloop.live/ for up to 3 minutes after a production deploy succeeds, failing the check if the live meta never equals the deployed commit sha. This repo's own deployments (gh api repos/HomenShum/NodeProof/deployments) show every production environment as the bare string "Production" with no sibling project sharing the repo, so the job condition is a plain equality check. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
deployGate: live-domrequires a product's own deploy workflow to read its live identity back. NodeProof/proofloop had none —registry/adapters.jsonin node-foyer only has a reachable-only health check for it (/api/hosted/health).scripts/stamp-build-sha.mjs, wired intonpm run build(tsc -p tsconfig.json && node scripts/stamp-build-sha.mjs), which stamps exactly one<meta name="proofloop-build-sha" content="<sha>" data-provenance="commit">intopublic/index.html. Precedence:VERCEL_GIT_COMMIT_SHA, thenGITHUB_SHA, thengit rev-parse HEAD, elsecontent="unavailable" data-provenance="unavailable". Idempotent — strips any prior stamp before inserting, sopretestre-runningbuildnever duplicates the tag..github/workflows/deploy-verify.yml(on: deployment_status) that pollshttps://proofloop.live/for up to 3 minutes after a production deploy succeeds, failing if the live meta never equalsgithub.event.deployment.sha.tests/stampBuildSha.test.ts(3 cases: sha injected once,unavailableprovenance, idempotent re-stamp).STEP 1 — establishing the deploy source (required before any code change)
Two local clones exist that looked like candidates:
D:/VSCode Projects/proofloop(origingithub.com/HomenShum/proofloop.git) andD:/VSCode Projects/cafecorner_nodebench/nodebench_ai4/NodeProof(origingithub.com/HomenShum/NodeProof.git). Evidence shows these are the same GitHub repository, not two competing ones:HomenShum/proofloopis a pre-rename name that GitHub transparently redirects toHomenShum/NodeProof(same repo id1288678020on everydeploymentscall regardless of which name was queried —gh api repos/HomenShum/proofloop/deploymentsandgh api repos/HomenShum/NodeProof/deploymentsreturn byte-identical JSON, allrepository_urlfields sayNodeProof). TheD:/VSCode Projects/proofloopclone is simply stale — itsoriginuses the old pre-rename URL and its HEAD (8532ab3, 2026-07-07) is ~2 months behind; it is not a second deploy source.Confirmed which commit production actually serves, three independent ways:
gh api repos/HomenShum/NodeProof/deployments?per_page=10shows every production deploy'senvironmentas the bare string"Production"(8 of 8 sampled) — no sibling Vercel project shares this repo, sodeploy-verify.yml's condition is a plain equality check (nocontains(...)name filter needed, unlike NodeVoice PR #10 which shares its repo withlocal-collab-mvp).Established deploy source:
HomenShum/NodeProof(the repo's ownpackage.jsonname is"proofloop", and the live/api/hosted/healthself-report —{"owner":"HomenShum","repo":"proofloop", ...}— is that same hardcoded config string, not a different physical repo). Per the task instruction, the meta tag uses the health-reported product name:proofloop-build-sha.public/index.htmlis a static file —vercel.json'sbuildCommandisnpm run build/outputDirectoryispublic, and before this PRnpm run buildwastsc -p tsconfig.jsononly (never touchedpublic/). No framework/bundler owns the HTML, hence the plain Node stamp script instead of a Vite plugin.Local proof
Exactly one tag, content equal to the checkout sha (no
VERCEL_GIT_COMMIT_SHA/GITHUB_SHAset locally, fell through togit rev-parse).Served proof (this repo's own
scripts/serve-public.mjs, the one local server it measures itself through):Repo's own checks (matches
.github/workflows/ci.yml)Secret scan
git diff --cachedgrepped forsk-, api-key/token/secret patterns,BEGIN PRIVATE KEY,.env,.codex/config.toml,.vercel/before push — the only hit was a false positive (process.env.VERCEL_GIT_COMMIT_SHAcontains the substring.env); no real secret-like content in the diff.Test plan
npm install(fresh worktree cut fromorigin/main)npm run buildthen grep the meta tag inpublic/index.htmlpublic/index.htmllocally viascripts/serve-public.mjsand confirmed the meta tag round-tripsnpm test(268/268) andnode dist/cli.js gate(PASSED) greenci.yml) green on this PRdeploy-verify.ymlruns on thedeployment_statusevent and passes🤖 Generated with Claude Code