fix(create): recover the atomic-byok-create commit dropped from #2617 (main lifecycle e2e is red) #2640
Reference in New Issue
Block a user
Delete Branch "fix/2617-recover-atomic-byok-create"
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?
Main is currently red on the required Local Provision Lifecycle E2E (stub) gate, blocking every open PR. Root cause: the merge queue landed #2617 at its FIRST commit only (the hard-fail gate), dropping the follow-up
1e782880that made create atomic for byok — the exact same first-commit-only behavior that split #2603/#2605. With the hard-fail in but the atomic fix out, the lifecycle e2e'screate(model=byok)with no payload key 422s as designed, and main went red.This cherry-picks the dropped commit verbatim: the create-scope vendor-key guard derives billing from CREATE inputs (so a byok payload may carry its own key), the gate accepts a payload key without the global scan, the lifecycle e2e passes the dummy key in the create body, and the rollback test mock is updated. Clean cherry-pick, builds + create tests green,
bash -nclean.Unblocks main's required gate and every in-flight PR (incl. #2639).
Refs #2608, #2617.
🤖 Generated with Claude Code
The lifecycle e2e exposed the deadlock the hard-fail gate creates with the OLD ordering: a byok model now REQUIRES a credential at create, but the create-scope vendor-key guard rejected that credential because it resolved billing from the not-yet-stored MODEL secret (always platform_managed mid-create). Net: no way to express create(model=byok, secrets={key}) in one call. - Gate: a payload secret the derived arm accepts satisfies it outright (no global_secrets query — atomic creates stay DB-free). - Guard: derive from CREATE inputs (runtime, payload.Model, payload keys); a non-platform derivation allows vendor keys in the same payload. Platform-resolving creates keep the full guard. - lifecycle e2e: dummy key rides in the create body (the shape the script's own comment wished for); flip+write steps stay as the restart-path belt-and-suspenders. - Rollback test: billing-mode query expectation dropped (the new guard derives without DB). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>APPROVED on current head
871a156ead.Fast SOP / 5-axis review for the red-main unblock:
runtime, payload model, payload secret names) before persisted MODEL exists, and the lifecycle stub create request now sends the dummy key in the create body.Status note: the main-unblocking
Local Provision Lifecycle E2E (stub)is green on this head, as are Handlers Postgres, Canvas, Shellcheck, secret scan, and lint-required-no-paths. E2E API still showed running during review; real-image Local Provision remains advisory red, and qa/security gates should clear from approval.