Skip to content

Guide Email Routing lane retries#27

Merged
rogu3bear merged 1 commit into
mainfrom
build/email-routing-lane-guidance
Jun 30, 2026
Merged

Guide Email Routing lane retries#27
rogu3bear merged 1 commit into
mainfrom
build/email-routing-lane-guidance

Conversation

@rogu3bear

Copy link
Copy Markdown
Owner

Behavioral changes

  • Adds cfctl failure guidance for Email Routing and other zone-scoped apply failures when permission probing reports zone_resolution_failed.
  • Emits an actionable recommended_lane, next_step, and rerunnable --plan command when another lane can resolve the zone.
  • Wires apply backend failures through the shared guidance builder so mutation-script failures are not dead-end execution_failed envelopes.
  • Adds static contract coverage for email.routing_rule upsert guidance using a synthetic dev/global lane comparison.

Why

Maildesk provisioning preview showed dev-lane Email Routing plans failing because the dev token could not resolve the zone, while the same plan-only operation succeeded with CF_TOKEN_LANE=global. cfctl had enough lane context to guide the operator but returned null guidance in the apply failure envelope.

Proof

  • ./scripts/verify_static_contract.sh passed
  • ./scripts/verify_maildesk_cf_contract.sh passed
  • python3 scripts/verify_permission_catalog.py --cfctl ./cfctl passed
  • git diff --check passed
  • Plan-only readback: dev-lane email.routing_rule upsert --plan now returns basis=zone_resolution_failed, recommended_lane=global, and a global-lane --plan retry command

Implications and risk

  • No Cloudflare mutation is introduced; this changes error guidance only.
  • Preview and ack gates stay intact. The recommended command remains plan-only.
  • Main risk is over-recommending a lane if lane comparison is stale or a zone selector is genuinely wrong; the next step text keeps selector correction explicit.

Confidence

  • Guidance shape: high, covered by static contract and live plan-only readback.
  • Maildesk surface compatibility: high, covered by maildesk contract.
  • Runtime safety: high, no apply path bypass or gate weakening.

Next steps

  • Review command wording and lane recommendation semantics.
  • After merge, rerun the maildesk plan lane so blocked storage/sender-domain operations remain separated from actionable Email Routing previews.

Maildesk provisioning exposed a cfctl UX gap: dev-lane Email Routing plans could fail with zone_resolution_failed even though the global lane could plan the same routing-rule preview cleanly. The failure envelope reported execution_failed with no recommended command, leaving the operator to infer the lane switch manually.

Teach cfctl_failure_guidance_json to treat zone_resolution_failed as a selector/lane remediation class, producing a rerunnable plan command with the recommended lane when lane comparison finds one. Wire apply backend failures through that guidance builder so mutation-script failures preserve the same actionable error contract.

The change does not weaken preview or ack gates and does not perform Cloudflare mutation. Static coverage adds a synthetic lane-comparison assertion for email.routing_rule upsert so future regressions keep recommended_lane, next_step, and --plan command shape intact.
@rogu3bear

Copy link
Copy Markdown
Owner Author

@codex Please review the lane-guidance semantics in this PR, especially whether zone_resolution_failed should always prefer a lane-resolvable plan retry before selector correction, and whether the emitted retry command remains appropriately plan-only for Email Routing apply failures.

@rogu3bear

Copy link
Copy Markdown
Owner Author

Local proof for this PR is green; GitHub static contract did not execute code. The check run has no runner/steps and its only annotation is: "The job was not started because your account is locked due to a billing issue."

Proof run locally on 2026-06-30:

  • ./scripts/verify_static_contract.sh passed
  • ./scripts/verify_maildesk_cf_contract.sh passed
  • python3 scripts/verify_permission_catalog.py --cfctl ./cfctl passed
  • git diff --check passed
  • Plan-only dev-lane Email Routing readback now emits basis=zone_resolution_failed, recommended_lane=global, and a CF_TOKEN_LANE=global ... --plan retry command

No Cloudflare mutation was performed.

@rogu3bear rogu3bear merged commit ac19884 into main Jun 30, 2026
1 of 2 checks passed
@rogu3bear rogu3bear deleted the build/email-routing-lane-guidance branch June 30, 2026 21:51
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