fix(e2e): green prod LIVE suite — fingerprint bypass + real CLI-poll contract#175
Merged
Conversation
…contract
Prod doesn't trust X-Forwarded-For, so the runner's anon provisions shared
one fingerprint and tripped the free-tier recycle gate (402
free_tier_recycle_requires_claim). Add the api's X-E2E-Test-Token bypass
(api internal/middleware/fingerprint.go) on every anonymous provision via a
shared anonProvisionHeaders() helper, gated on E2E_TEST_TOKEN, and always
send a cohort name (required by /db & /vector, harmless elsewhere).
Also fix the CLI device-flow poll assertion to the REAL prod contract:
pre-approval returns HTTP 202 {ok:true, pending:true} (no `status` field).
Workflow exports E2E_TEST_TOKEN to the run step.
Files: cohort.ts (helper), live-anon-provision / live-provision-smoke /
live-claim-deploy / live-auth specs, e2e-prod.yml.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mastermanas805
enabled auto-merge (squash)
June 5, 2026 05:27
size-limit report 📦
|
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.
What
Makes the prod LIVE E2E workflow (
e2e-prod.yml) go GREEN againstapi.instanode.dev. The endpoint mint/reap + auth specs already pass; this closes the two remaining failure classes plus the workflow env wiring.Fixes
ISSUE 1 — anon provisions 402
free_tier_recycle_requires_claim. Prod does NOT trustX-Forwarded-For, so the runner's many anon provisions share ONE real fingerprint (rule 6) and trip the free-tier recycle gate. The api's real bypass is theX-E2E-Test-Tokenheader (apiinternal/middleware/fingerprint.go). Added a sharedanonProvisionHeaders()helper incohort.tsthat:X-E2E-Test-Token: $E2E_TEST_TOKENwhen the secret is set (the only thing that gets past prod's gate),X-Forwarded-For(harmless; varies the fingerprint on staging/local where the proxy is trusted).Wired into every anonymous provision:
live-anon-provision,live-provision-smoke,live-claim-deploy(provisionAnonCache),live-auth(provisionAndClaim). Every anon provision now also sends a cohort-brandedname(required by/db/new&/vector/newper CLAUDE.md; harmless + cohort-tagging on the rest). Per-service expected-scheme assertions are unchanged and still hold.ISSUE 2 — CLI device-flow poll assertion. The real prod contract for the pre-approval poll (verified against
api.instanode.dev) is HTTP202{ok:true, pending:true}— there is NOstatusfield. Assertion now checksok===true+pending===true(and still asserts noapi_tokenpre-approval).ISSUE 3 — workflow env. The run step now exports
E2E_TEST_TOKEN: ${{ secrets.E2E_TEST_TOKEN }}so the specs can read the bypass token.Verification
{"ok":true,"pending":true}(HTTP 202).npm run gateGREEN (tsc --noEmit + build + vitest: 80 files / 1115 tests pass, 3 skipped). Mocked suite untouched.🤖 Generated with Claude Code