Skip to content

feat(build): nodevoice-build-sha meta + post-deploy readback - #10

Merged
HomenShum merged 1 commit into
mainfrom
foyer/build-identity
Sep 12, 2026
Merged

feat(build): nodevoice-build-sha meta + post-deploy readback#10
HomenShum merged 1 commit into
mainfrom
foyer/build-identity

Conversation

@HomenShum

Copy link
Copy Markdown
Owner

Summary

  • Adds a Vite plugin (adapted from node-foyer/vite.config.ts's foyer-build-sha provenance) that stamps exactly one <meta name="nodevoice-build-sha" content="<sha>" data-provenance="commit"> into the built index.html. Precedence: VERCEL_GIT_COMMIT_SHA, then GITHUB_SHA, then git rev-parse HEAD. Non-strict — falls back to content="unavailable" data-provenance="unavailable" rather than throwing when no signal is available (unlike node-foyer's strict-in-production variant).
  • Adds .github/workflows/deploy-verify.yml (on: deployment_status) that polls https://nodevoice.vercel.app/ up to 3 minutes after a production deploy succeeds and fails the check if the live meta never equals the deployed commit sha.

This is the products worker's Task 2 for FOYER-V2 (Node Foyer's deployGate: live-dom requires a product's own deploy workflow to read its live identity back; NodeVoice currently has none — registry/adapters.json in node-foyer only has a text-presence check for it).

Event-shape evidence (gh api)

This repo has two Vercel projects deploying from it. gh api repos/HomenShum/NodeVoice/deployments?per_page=5 shows the nodevoice project's production environment name is not a bare "Production":

{"environment":"Production – local-collab-mvp", ...}
{"environment":"Production – nodevoice", ...}

and the matching status carries a real environment_url:

{"state":"success","environment":"Production – nodevoice","environment_url":"https://nodevoice-76v1rlbr5-hshum2018-gmailcoms-projects.vercel.app"}

So the workflow's job condition filters on startsWith(environment, 'Production') && contains(environment, 'nodevoice') instead of an exact "Production" match, so the sibling local-collab-mvp project's deploys don't gate this check.

Local proof

$ npm install --no-audit --no-fund
added 104 packages in 14s

$ npm run build
✓ built in 19.16s

$ grep -o '<meta name="nodevoice-build-sha"[^>]*>' dist/index.html
<meta name="nodevoice-build-sha" content="5de08a1ce45cc282ff58099c82bad7d10a284ebf" data-provenance="commit">

$ grep -c '<meta name="nodevoice-build-sha"' dist/index.html
1

$ git rev-parse HEAD
5de08a1ce45cc282ff58099c82bad7d10a284ebf

Exactly one tag, content equal to the checkout sha (no VERCEL_GIT_COMMIT_SHA/GITHUB_SHA set locally, so it fell through to git rev-parse).

$ npm run check:client
tsc --noEmit -p tsconfig.client.json
(exit 0, no output)

Test plan

  • npm install (fresh clone)
  • npm run build then grep the meta tag in dist/index.html
  • npm run check:client typecheck green
  • CI (ci.yml, node-platform-conformance.yml) green on this PR
  • After merge + a real Vercel production deploy, confirm deploy-verify.yml runs and passes on the deployment_status event

🤖 Generated with Claude Code

Adds a non-strict Vite plugin (adapted from node-foyer's build-provenance
plugin) that stamps exactly one <meta name="nodevoice-build-sha"> into the
built index.html, sourced from VERCEL_GIT_COMMIT_SHA, then GITHUB_SHA, then
git rev-parse HEAD, falling back to content="unavailable"
data-provenance="unavailable" when none resolve.

Adds .github/workflows/deploy-verify.yml, triggered on deployment_status,
that polls https://nodevoice.vercel.app/ for up to 3 minutes after a
successful production deploy and fails if the live meta never matches the
deployed commit sha. gh api repos/HomenShum/NodeVoice/deployments shows this
repo's Vercel production environment as "Production - nodevoice" (a sibling
project "local-collab-mvp" also deploys from this repo), so the job filters
on that environment name rather than a bare "Production".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
local-collab-mvp Ready Ready Preview Sep 12, 2026 7:21pm UTC
nodevoice Ready Ready Preview Sep 12, 2026 7:21pm UTC

Request Review

@HomenShum
HomenShum merged commit 05eb284 into main Sep 12, 2026
8 checks passed
@HomenShum
HomenShum deleted the foyer/build-identity branch September 12, 2026 19:45
HomenShum added a commit to HomenShum/agent-workspace-template that referenced this pull request Sep 13, 2026
)

Adopts the NodeVoice PR #10 pattern (HomenShum/NodeVoice#10) so this product
moves from reachable-only to verified in node-foyer's registry: a build-sha
meta tag rendered in server HTML, plus a workflow that reads it back after a
real production deploy.

- src/lib/build-identity.ts resolves the commit sha (VERCEL_GIT_COMMIT_SHA,
  then GITHUB_SHA, then `git rev-parse HEAD`, else "unavailable") the same
  way node-foyer's vite.config.ts and NodeVoice's vite plugin do it.
- src/app/layout.tsx's Metadata `other` field renders it as
  <meta name="agent-workspace-build-sha" content="<sha>"> in every page's
  server HTML (Next has no transformIndexHtml hook like Vite; `other` is the
  native equivalent and needs no client-side JS).
- .github/workflows/deploy-verify.yml polls the fixed production URL for up
  to 3 minutes on deployment_status success and fails if the live meta never
  matches github.event.deployment.sha. Unlike NodeVoice (two sibling Vercel
  projects sharing one repo), `gh api .../deployments` and its statuses
  endpoint show this repo has a single project with production environment
  exactly "Production", so the job condition is an exact match instead of a
  startsWith/contains filter.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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