Skip to content

fix(cloudflare/rulesets): putPhas redirect status_code is a number - #380

Merged
sam-goodwin merged 1 commit into
mainfrom
claude/rulesets-redirect-status-code
Jul 15, 2026
Merged

fix(cloudflare/rulesets): putPhas redirect status_code is a number#380
sam-goodwin merged 1 commit into
mainfrom
claude/rulesets-redirect-status-code

Conversation

@sam-goodwin

Copy link
Copy Markdown
Collaborator

The upstream spec types from_value.status_code as numeric enums (301|302|303|307|308), but the generated putPhas request schema stringified them, so encoding a redirect rule with a numeric status code failed — and the wire value would have been a string Cloudflare rejects.

 interface FromValue2 {
   targetUrl: { expression?: string | null; value?: string | null };
   preserveQueryString?: boolean | null;
-  statusCode?: "301" | "302" | "303" | "307" | "308" | (string & {}) | null;
+  statusCode?: number | null;
 }
  • request: replace status_code with number (patch on putPhas)
  • response: append number to the union, mirroring the existing getPhas patch

Surfaced by alchemy-run/alchemy#806, which deploys a http_request_dynamic_redirect phase entrypoint via putPhasForZone.

🤖 Generated with Claude Code

The upstream spec types from_value.status_code as numeric enums
(301|302|303|307|308), but the generated putPhas request schema
stringified them ("301" | ...), so encoding a numeric status code
failed and the wire value would have been a string Cloudflare rejects.

- request: replace status_code with number (patch on putPhas)
- response: append number to the union, same as the existing getPhas patch

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sam-goodwin added a commit to alchemy-run/alchemy that referenced this pull request Jul 15, 2026
…view-aware

- Stack error message and AUTH_LANDING_HOST (/auth/success, /auth/error
  landing pages) move to alchemy.run; stale tutorial URLs in test
  comments updated
- agent prompt is now built from the page's own origin after hydration,
  so PR previews produce prompts that point at themselves
- the Worker rewrites llms.txt's baked canonical origin to the request
  origin on non-canonical hosts (same treatment as HTML canonical tags)
- blog homepage link is relative
- distilled: putPhas redirect status_code patched to number
  (alchemy-run/distilled#380) — required for the V2Redirect ruleset to
  encode and decode

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alchemy-version-bot

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

@distilled.cloud/core

bun add @distilled.cloud/core@https://pkg.distilled.cloud/core/37327de

@distilled.cloud/aws

bun add @distilled.cloud/aws@https://pkg.distilled.cloud/aws/37327de

@distilled.cloud/axiom

bun add @distilled.cloud/axiom@https://pkg.distilled.cloud/axiom/37327de

@distilled.cloud/azure

bun add @distilled.cloud/azure@https://pkg.distilled.cloud/azure/37327de

@distilled.cloud/cloudflare

bun add @distilled.cloud/cloudflare@https://pkg.distilled.cloud/cloudflare/37327de

@distilled.cloud/coinbase

bun add @distilled.cloud/coinbase@https://pkg.distilled.cloud/coinbase/37327de

@distilled.cloud/expo-eas

bun add @distilled.cloud/expo-eas@https://pkg.distilled.cloud/expo-eas/37327de

@distilled.cloud/fly-io

bun add @distilled.cloud/fly-io@https://pkg.distilled.cloud/fly-io/37327de

@distilled.cloud/gcp

bun add @distilled.cloud/gcp@https://pkg.distilled.cloud/gcp/37327de

@distilled.cloud/kubernetes

bun add @distilled.cloud/kubernetes@https://pkg.distilled.cloud/kubernetes/37327de

@distilled.cloud/mongodb-atlas

bun add @distilled.cloud/mongodb-atlas@https://pkg.distilled.cloud/mongodb-atlas/37327de

@distilled.cloud/neon

bun add @distilled.cloud/neon@https://pkg.distilled.cloud/neon/37327de

@distilled.cloud/planetscale

bun add @distilled.cloud/planetscale@https://pkg.distilled.cloud/planetscale/37327de

@distilled.cloud/posthog

bun add @distilled.cloud/posthog@https://pkg.distilled.cloud/posthog/37327de

@distilled.cloud/prisma-postgres

bun add @distilled.cloud/prisma-postgres@https://pkg.distilled.cloud/prisma-postgres/37327de

@distilled.cloud/stripe

bun add @distilled.cloud/stripe@https://pkg.distilled.cloud/stripe/37327de

@distilled.cloud/supabase

bun add @distilled.cloud/supabase@https://pkg.distilled.cloud/supabase/37327de

@distilled.cloud/turso

bun add @distilled.cloud/turso@https://pkg.distilled.cloud/turso/37327de

@distilled.cloud/typesense

bun add @distilled.cloud/typesense@https://pkg.distilled.cloud/typesense/37327de

@distilled.cloud/workos

bun add @distilled.cloud/workos@https://pkg.distilled.cloud/workos/37327de

@sam-goodwin
sam-goodwin merged commit 1446979 into main Jul 15, 2026
43 of 44 checks passed
@sam-goodwin
sam-goodwin deleted the claude/rulesets-redirect-status-code branch July 15, 2026 21:03
Mkassabov added a commit that referenced this pull request Jul 20, 2026
From v0 main (bb54823..c9a7779), everything applicable:

#369 (broad AWS fan-out): full machinery delta — synthetic errors
(message-matcher-carved tags, spec-schema + response-parser + generator
support), legacy SigV2 for SimpleDB (signed-body request built in
AwsProtocol.encode; core executes it), smithy.api#endpoint
hostPrefix (label substitution + double-prefix guard; carried through
core OperationConfig as endpointHostPrefix), streaming-input
UNSIGNED-PAYLOAD with the service denylist, S3 Control/Glacier payload
SHA-256 precompute, the new Presign module + export, union
overrides / sensitive / errorHttpStatus spec-patch capabilities, and
the complete aws patches dir (which includes #383's ec2 duplicate
security-group synthetic errors — 16 typed variants emitted).

#374: single /*@__PURE__*/ annotation (Rolldown 1.1+ treats
/*#__PURE__*/ as unknown) — both generators, all services re-emitted.

#379: core pagination isTerminalToken (empty-string continuation
tokens end pagination instead of looping); bodyMediaType on core's
HttpTrait + raw-body path in protocol-http; Vectorize insert/upsert
gain their previously-unmodeled application/x-ndjson body via manual
patches; D1 params retyped string[] -> unknown[] (JSON values).

#368: workers createRoute error 10019 typed as RouteScriptNotFound.

#380 (rulesets status_code) not ported: v1's docs-derived model
already types every status_code as a number — the string bug was in
v0's openapi source. Planetscale/stripe PRs N/A (no such v1 packages);
the typescript-7 migration is not taken (v1 stays on tsgo).

Verified: typecheck + offline wire sanity across all four families.
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