fix(ci): restore marketing Pages deployments - #1806
Merged
simple-agent-manager[bot] merged 8 commits intoAug 11, 2026
Merged
Conversation
Contributor
|
simple-agent-manager
Bot
deleted the
sam/looks-merged-couple-prs-sgpvq2
branch
August 11, 2026 12:14
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.



Summary
apps/wwwdirectly own the catalog-pinned Wrangler 4.118.0 executable and invoking it through that workspace in both marketing workflows.npx wrangler, missing dependency ownership, or weakened provisioning behavior.Validation
pnpm lint— 13/13 tasks passed; 8 pre-existing warnings and zero errorspnpm typecheck— 19/19 tasks passedpnpm test— 21/21 tasks passedpnpm build— 9/9 tasks passedpnpm check:fast;git diff --checkStaging Verification (REQUIRED for all code changes — merge-blocking)
scripts/deploypath changed, so VM provisioning is N/A. The Pages deployment boundary passed live; the fail-closed Pages list/create branches were exercised locally for existing, missing/create, malformed JSON, list failure, and create failure.Staging Verification Evidence
The
Deploy Marketing Siteworkflow ran against branch commit47774d3deb5a4f12789211c263ccdca812a29d53. Wrangler 4.118.0 uploaded successfully, andhttps://fbc054e7.sam-www.pages.dev/plushttps://sam-looks-merged-couple-prs.sam-www.pages.dev/both returned HTTP 200. The current head differs only by task evidence and the merge of unrelatedmainexperiment files; the workflow, package, lockfile, and regression-test changes are identical.UI Compliance Checklist (Required for UI changes)
End-to-End Verification (Required for multi-component changes)
Data Flow Trace
apps/www/package.jsondeclareswrangler: catalog:;pnpm-lock.yamlresolves the workspace dependency to 4.118.0 during the frozen install.deploy-www.ymlinstalls the lockfile, buildsapps/www, then runs the marketing workspace's binary against itsdistdirectory at line 71.CF_API_TOKENandCF_ACCOUNT_ID, uploads to the unchanged Pages project, and returns the immutable/branch deployment URLs.provision-www.ymluses that same binary to list projects, validates an array response, skips an exactProject Namematch, or creates the missing project while allowing failures to terminate the job.deployment-workflow-hardening.test.tsfreezes the dependency owner, pinned invocations, fail-closed checks, and ban onnpx wrangleracross both workflows.Untested Gaps
The production custom-domain alias cannot represent the merged revision before merge. After merge, the exact merge SHA's
Deploy Marketing Siterun will be monitored andhttps://www.simple-agent-manager.org/checked before completion is reported.Post-Mortem (Required for bug fix PRs)
What broke
Every affected
mainmarketing deployment since PR #1784 built successfully and then failed withsh: 1: wrangler: not found, leaving the public site available but stale.Root cause
The workflow relied on
npxregistry fallback instead of declaring and invoking a repository-owned executable. PR #1784 changed the dependency graph so npm detected a transitive Wrangler that pnpm did not link at the repository root, exposing the hidden executable-resolution assumption.Class of bug
Package-manager executable-resolution ambiguity in a post-merge deployment workflow.
Why it wasn't caught
PR validation did not enforce the same pinned-Wrangler contract across the separate marketing workflows. The marketing deployment itself runs after merge and was not a required pull-request check.
Process fix included in this PR
scripts/quality/deployment-workflow-hardening.test.tsnow requires direct marketing-workspace dependency ownership, exact pinned deployment/provisioning invocations, strict failure semantics, and rejectsnpx wrangleranywhere in either workflow. The two.github/workflows/files now encode the repository-owned invocation directly.Post-mortem file
tasks/active/2026-08-11-fix-marketing-pages-wrangler-resolution.mdSpecialist Review Evidence (Required for agent-authored PRs)
needs-human-reviewlabel added and merge deferred to human — N/A: every reviewer completed.npxguard added; focused 9/9 and quality 297/297 pass with no merge-blocking gap.Exceptions (If any)
main; branch verification used a real isolated Pages preview.Agent Preflight (Required)
Classification
External References
Official documentation consulted before coding: Cloudflare Wrangler Pages commands, covering
pages deploy,pages project list --json, andpages project create --production-branch.Codebase Impact Analysis
apps/www/package.jsonandpnpm-lock.yamlestablish executable ownership;.github/workflows/deploy-www.ymland.github/workflows/provision-www.ymluse it;scripts/quality/deployment-workflow-hardening.test.tsandscripts/quality/direct-dependency-evidence.jsonfreeze the contract; the active task records the incident and evidence.Documentation & Specs
N/A: the fix changes internal executable resolution and failure handling without changing public commands, configuration inputs, environment variables, permissions, secrets, or product behavior. The incident/post-mortem is recorded in the active task file.
Constitution & Risk Check
Checked Principles II, III, XI, XII, XIII, XIV, XVII, XVIII, XXIII, and XXV. Primary risks were hidden executable resolution, registry fallback, false-success provisioning, accidental project-name matches, and documentation drift. Direct catalog ownership, frozen-install proof, strict shell/error propagation, response-shape validation, exact matching, contract tests, live preview deployment, and specialist review mitigate them without expanding permissions or secret handling.