FORGE-217: stage-scoped health receipts, a real promote, changesets on manual deploys #967
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!967
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "FORGE-217-stage-health-receipts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Kanbanger: https://tasks.gmac.io/gmacko/issue/FORGE-217. Unblocks LOOM-13, LOOM-15, LOOM-16, LOOM-17, LOOM-18 and LOOM-19.
Root cause (checked against live data, read-only)
Loom's
health.urlis the relative/.well-known/forge-health, and its targets have nohealthCheckUrl. So:activereceipts (9d0d4cd1, 49ac2dda) carry no healthforge receipts backfill --app loom --dry-runrefusesBoth production deployments also have
changesetId: null.Changes
urlor the workers.dev URL of the stage's main target (its first enabled target). Endpoints recordstage_idandtarget_id, added by migration0139.health.urlis unchanged.forge deploy promoteis real: it creates a deployment of the same commit in the next stage (the pipeline order), inheriting the changeset, through the normal deploy route with every gate. It refuses clearly for the last stage, an inactive source, or a source with no commit.Migration (apply before the server deploy)
packages/db/drizzle/0139_stage_health_endpoints.sqlis additive and idempotent: two nullable FK columns and an index. Apply it toforgegraphandforgegraph_betafirst, ordeploy.yml's drift gate fails.Tests
After deploy
forge apply(no manifest change) to create stage health endpoints.forge receipts backfill --app loom --dry-run, expecting #22, #24, #25, #26 and #27 aswould_credit, then run it for real.🤖 Generated with Claude Code
Loom has a staging and a production Worker and `health.url: /.well-known/forge-health`. A path was not probeable, so Loom had no health endpoint, the poll handed the agent no health URL, its `active` reports carried no health, coverage credit never started, and `forge receipts backfill --app loom` refused ("Configure a healthCheckUrl"). Any app with a second gated stage hit the same wall: the one app-wide endpoint could not say which stage it proved. - app_health_endpoints gains nullable stage_id and target_id (drizzle/0139_stage_health_endpoints.sql, with its D1 twin). - Config apply resolves a relative health path once per stage, against the stage's declared url, else the workers.dev URL of the stage's health target (its first enabled target, never a one-box, jobs runner or later auxiliary Worker such as Loom's preview tier), read from Cloudflare and only when the Worker's workers.dev route is on. Stages it cannot resolve, or that share one URL, are reported as warnings. An absolute health URL keeps its app-wide endpoint, as before. - The agent poll, the agent report's receipt and the receipts probe (health_deploy, backfill_active) use the stage endpoint for the deployment's own stage and target, so a staging deploy probes and signs staging. - The cron probe and agent heartbeats record the endpoint's stage on every check, and stage endpoints emit attestation evidence for their own stage and target only; an app-wide endpoint keeps the ambiguity guard. A serving deployment without a changeset is identified by its commit. Coverage receipts are unchanged: once a production receipt carries health, FORGE-164's ancestor credit sends each contained, merged PR its own signed inclusion receipt, once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>forge deploy promotepromoteWorker Preview: https://pr-967.previews.forgegraf.com (updates on every push; behind Cloudflare Access; shared previews database, the banner shows which PR owns it)