Skip to content

fix(core): dev server and sandbox robustness fixes - #1218

Merged
xyos merged 74 commits into
mainfrom
feat/blocks-cli-5-core-fixes
Nov 16, 2026
Merged

xyos merged 74 commits into
mainfrom
feat/blocks-cli-5-core-fixes

Conversation

@xyos

@xyos xyos commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Command renamed to cdk-blocks; there is no blocks command. Inside an app: npx --no -- cdk-blocks <command> or the npm scripts. Without installing: npx -p @aws-blocks/blocks cdk-blocks <command> (a plain npx @aws-blocks/blocks cannot pick a command until the package is renamed to @aws/cdk-blocks). Global: npm i -g @aws-blocks/blocks gives cdk-blocks.

Problem

These dev server, sandbox and destroy bugs already exist on main. The new cdk-blocks CLI makes them easy to hit: cdk-blocks dev | head, cdk-blocks dev stop right after an edit, a second cdk-blocks dev on the same port, a project path with a space, or a destroy without a Region.

Issue #, if available: stack #1204

Changes

Port reclaim safety

  • The dev server frees a port only from the leftover frontend of this app's own crashed or reloaded dev server, using the process group recorded in its pidfile. A foreign listener on the port is refused and named, never killed.
  • dev stop names a foreign process that still holds the port and leaves it alone. It drops an unreadable pidfile, and prints its warnings on stderr.

Pidfile and startup lock

  • A second or failed dev-server start exits 1 with the reason, and the pidfile is taken exclusively, so only one of two simultaneous starts wins.
  • The pidfile is kept through a tsx watch restart, so dev stop right after an edit still finds the session.
  • A reload replaces its predecessor's pidfile in one step (temp file and rename), so the pidfile never goes missing during the takeover. Every record carries a random token, and a record the pidfile holds is changed only by the single holder of <pidfile>.reap-<token> (created with link), which re-reads the pidfile and acts only if it still holds that record. A stale record is removed that way, and a live one is replaced in one step only by its successor (the reload, the cdk-blocks dev handover). Nothing moves the pidfile aside, so a live record is never moved or removed, even for a moment. dev stop and the hand-off watcher remove only the record they read, once nothing it names is alive. This is the protocol of bb-data's local database lock (fix(bb-data): run the local CLI on the dev database #1217).
  • On a file system without hard links (FAT, exFAT, some shared folders), an exclusively created pidfile exists for a moment before its record is written. A start and cdk-blocks dev stop leave such an unreadable pidfile alone, because it may belong to a dev server that is starting, and the start is refused with the files to delete if none is.
  • After a SIGTERM stop (the CLI signals the dev server and then tsx watch, or tsx watch relays a SIGTERM), a small detached watcher removes the kept pidfile once tsx watch exits without a successor. It exits when a successor takes the pidfile over, when the pidfile is gone, or after 10 minutes at most.

Closed output

  • The dev server, sandbox, deploy and destroy ignore EPIPE/EIO on stdout and stderr, so a closed pipe or terminal no longer crashes them. The sandbox reaps cdk watch and the dev server before it prints anything on shutdown.
  • blocks itself drops EPIPE/EIO on its own streams, so cdk-blocks dev | head -1 leaves the server running.
  • cdk-blocks dev stop sends a still-bound port to stderr (exit 1) and reports the holders as stopped[].holders in JSON and --query.

Host and CORS

  • The dev server uses its bound host in its URLs, config.json and CORS.

Amplify generateClient

  • blocks.dev.generateClient: false skips the dev server's client generation. The Amplify overlay and cdk-blocks migrate (for the overlay's server.ts) set it, so the overlay's own aws-blocks/client.js is kept.

Sandbox --app command

  • Synth, the deploy fallback, cdk watch and the sandbox destroy share one --app command that names no path. The backend path goes to the cdk child in BLOCKS_CDK_APP_ENTRY, and the shell reads it inside double quotes. A project path with a space, a quote, $ or % stays one word, and no library input is part of a shell command.

SSM connection string

  • sandbox destroy deletes the sandbox's /<stack>-db-url parameter once the stack is gone, never the production name. An app whose .blocks/config.json gives no stack name is skipped: the deploy derives the name the same way, so it wrote no parameter.

Fail-fast destroy

  • destroy and sandbox destroy stop at once when no Region is set, or when the CDK output shows a credential or Region error, instead of retrying for minutes. sandbox destroy loads .env.local before the check. The messages name the command that was run (cdk-blocks destroy, cdk-blocks sandbox destroy).

Failure hints

  • A failed sandbox deploy gets the hint that fits its cause: a failed synth, a cdk.out lock, a stack still *_IN_PROGRESS, a failed stack, an unknown state, or a healthy stack. Only a failed or unknown stack gets the destroy advice. The hints name the commands that were run.

Bundling paths

  • bb-data and bb-distributed-data quote the migrations copy in the bundling hook, so an app with migrationsPath synthesizes from a path with a space.

Each fix has a changeset. The changesets on this PR:

  • amplify-overlay-keeps-client.md, blocks-cli-closed-output.md, blocks-dev-stop-warnings.md, sandbox-deploy-script.md, data-migrations-path-with-space.md
  • core-bootstrap-hint-profile.md, core-closed-output.md, core-deploy-config-per-stage.md, core-destroy-fail-fast.md
  • core-dev-bound-host.md, core-dev-close-engines.md, core-dev-generate-client-option.md, core-dev-port-ownership.md, core-dev-singleton.md, core-dev-singleton-per-app.md, core-dev-wildcard-host.md
  • core-dev-pidfile-after-stop.md, core-dev-pidfile-reload-in-place.md, core-dev-pidfile-startup-stop.md
  • core-dev-stop-after-reload.md, core-dev-stop-during-startup.md, core-dev-stop-hung-watcher.md, core-dev-stop-messages.md, core-dev-stop-orphaned-frontend.md
  • core-sandbox-destroy-secrets.md, core-sandbox-ends-with-dev-server.md, core-sandbox-failure-hint.md, core-sandbox-path-with-space.md, core-sandbox-signal-deferral.md, core-sandbox-watch-own-assembly.md

Fixes from end-to-end CLI testing

  • Conflict markers. The cdk-blocks migrate section of the @aws-blocks/blocks README had conflict markers left from a rebase; it now reads as one text again. A new blocks test fails on a conflict-marker line in any tracked Markdown or TypeScript file.
  • dev stop during startup. cdk-blocks dev claims the session in the pidfile before it starts tsx watch (from the new, light @aws-blocks/core/scripts/dev-pidfile module), and the dev server takes the record over when it loads. A dev stop in the first second or so now stops cdk-blocks dev and everything it started, and exits 0. Before, it reported nothing to stop and the server kept running. Such a stop reports via: "cli". A second cdk-blocks dev is refused at once, before it starts anything. When tsx watch would hang after its runner died, the CLI force-kills it.
  • Wildcard host. A dev server bound to 0.0.0.0 or :: serves apiUrl: "/aws-blocks/api" in /.blocks-sandbox/config.json (the file on disk keeps the absolute URL), and CORS echoes an Origin equal to http://<Host header>. So an app opened by the machine's address calls its own API, and other origins are still refused.
  • Old Amplify overlays. cdk-blocks migrate recognises an overlay from before it shipped a server.ts (0.1.0 to 0.1.15) by its generated aws-blocks/scripts/generate-client.ts. It gives it the same {"port": 3001, "frontend": false, "generateClient": false} as newer overlays. devConfig.generateClient is now a valid --query path.
  • Live-record displacement. The old stale takeover renamed the pidfile aside before checking it: if B had judged a record stale, A had claimed it, and C took the empty path while B held A's record aside, B's restore failed and A's record was deleted, so A served on, invisible to dev stop. The reap-by-token takeover above replaces it.

Each fix has a test. The marker guard and the overlay test failed before their fixes, and the startup stop was reproduced on the built CLI before its fix. The new changesets are core-dev-stop-during-startup.md and core-dev-wildcard-host.md.

Round-3 fixes

  • The local dev loop never targets a deployed stack (critical). Every deploy rewrote .blocks-sandbox/config.json with its AWS apiUrl, and the Node.js client reads that file. So with npm run dev running, npm run test:e2e after a cdk-blocks deploy or cdk-blocks sandbox deploy signed up users and wrote items in the deployed stack, production included, and a Next.js Server Component rendered from the deployed Lambda. Now a deploy records its URL in .blocks-sandbox/config.production.json or config.sandbox.json, and only a dev server writes config.json. The dev server sets BLOCKS_API_URL to its own front door on the frontend command. The template e2e tests pin the client to the dev server on blocks.dev.port, or to TEST_URL when you set it. cdk-blocks generate spec takes a deployed server only with BLOCKS_SPEC_STAGE=sandbox|production. Destroy removes the stage's config.<stage>.json. The comprehensive suite, the native-sdk-e2e workflow, the db-pull guide and the docs read or name the stage files.

  • Upgraded apps. An app deployed before this change still has the deploy's AWS URL in config.json. The Node.js client now refuses such a file and never calls the stack it names. That means environment: production, or sandbox with an https: URL, which no dev server writes. The error says: start the dev server, or set BLOCKS_API_URL to target that stack on purpose. cdk-blocks dev rewrites the file, and deploy, sandbox deploy and both destroys first move it to config.<stage>.json (a newer record wins) and remove it. Tests seed a legacy file pointing at a stub server. The client refuses it with 0 calls, calls the stub with BLOCKS_API_URL, uses a dev server's own file, and the dev server replaces the legacy file. A deploy with a stubbed cdk migrates the legacy file. The client and deploy tests fail against the previous head.

  • One cdk-blocks dev per app (critical). Two dev servers on different ports of one app shared .bb-data, and PGlite's stale-lock cleanup unlinked the live postmaster.pid, so acknowledged writes were lost. A second cdk-blocks dev in the same app is now refused whatever its port, and the error names the port and the dev stop command for it. On a stop, the dev server closes its local data engines, so a leftover postmaster.pid means a crash.

  • cdk-blocks sandbox deploy and both destroys defer a first stray SIGTERM or a SIGHUP, as deploy does. A second SIGTERM or a Ctrl-C stops the whole cdk tree.

  • After a SIGKILL of the dev group, dev stop stops the frontend the killed server left behind. A port error names a command.

  • dev stop waits for tsx watch and SIGKILLs it when its runner is dead.

  • cdk-blocks sandbox ends with its dev server, so cdk-blocks dev stop ends the whole sandbox session, cdk watch included, and says so.

  • The cdk watch of cdk-blocks sandbox writes its own assembly (.blocks-sandbox/cdk.out), and the templates' cdk.json watch ignores aws-blocks/client.js, so cdk-blocks deploy works while a sandbox watch runs. sandbox destroy refuses while a sandbox session runs.

  • The CDK bootstrap command that the preflight prints names AWS_PROFILE.

  • A stop during startup, or a failed load, leaves no stale pidfile.

  • Test only: sandbox-destroy-secrets.test.ts keeps its progress lines off stdout. They broke the test runner's IPC in about 1 run in 6 (Unable to deserialize cloned data); with the fix, 0 of 30 runs failed.

  • Test only: the cdk-output deferral test passes the fake cdk's paths to sh -c as its arguments, not inside the script (CodeQL: incomplete escaping).

  • Test only: the reload-pidfile lifecycle test edits the backend again until tsx watch reloads. On CI runners the first edit, written as soon as the server answered, went unseen.

  • Test only: the telemetry E2E stops each dev server's whole process group, and waits for it, before the next case starts one. With one dev server per app, the leftovers of earlier cases refused the later ones.

Each fix has a changeset and a test.

Not fixed

Lambda log groups recreated after a destroy. A stack-owned log group for the CDK custom-resource Lambdas was tried and reverted. On a real destroy the stack deleted the groups, but log delivery from the custom-resource calls made during the delete recreated them, with no retention. A working fix records the stack's function and log-group names before cdk destroy and deletes exactly those afterwards. Prefix matching isn't safe, because function names carry a truncated stack-name prefix that other sandboxes of the same app share. Aurora's /aws/rds/cluster/…/postgresql group also remains; that predates this work.

Windows fixes

A run on a GitHub windows-latest runner showed that cdk-blocks dev stop did not end cdk-blocks dev on Windows, and that a backend save took an app with a frontend down. Some of the causes were already on main: pidCommand() returns '' on win32, and netstat -p tcp lists IPv4 only. Each fix has a test with win32 injected:

  • dev stop / dev stop --all left the cdk-blocks dev CLI and tsx watch running, and the next save started the dev server again. The dev server records the CLI at the top of its session (session, from BLOCKS_DEV_SESSION). On Windows the stop ends that CLI with its whole tree (taskkill /T /F), then waits for both ports and removes the pidfile. The CLI is ended only while the recorded tsx watch still descends from it, checked by one CIM query of parent pids and creation times; otherwise the tsx watch is ended, if the runner still descends from it. A pid that Windows has given to another process is never ended. POSIX is unchanged.

  • A backend save, or a hard kill of the CLI, orphaned Vite and esbuild on the frontend port, and nothing could reclaim it (port … is in use (its owner could not be found)). On Windows, once the frontend listens, the dev server records the listeners of its tree, with their CIM creation times. A start's reclaim and dev stop own a listener only while its pid still has that creation time, and they end its tree with taskkill /T. findListenerPids reads netstat -ano, so it sees TCPv6 ([::1], where Vite's localhost binds) and also works on a Windows that does not print LISTENING.

  • A failed first start hung: failDevStartup also ends tsx watch when the CLI sets BLOCKS_DEV_UNDER_WATCH=1 (feat(blocks): add the blocks CLI #1203), so cdk-blocks dev exits 1.

  • The port-in-use hints printed kill and lsof: on Windows they print taskkill /PID <pid> /T /F and netstat -ano | findstr :<port>.

  • CI: on the per-PR Windows lane, scripts/ci/templates-e2e.mjs now runs scripts/ci/windows-dev-lifecycle.mjs on the default app. It checks, with bounded waits:

    • cdk-blocks dev → HTTP 200 → a backend edit → 200;
    • cdk-blocks dev stop → no node, tsx, vite or esbuild process of the app (Get-CimInstance Win32_Process), both ports free, no pidfile, and a later save does not restart it;
    • a hard kill of the CLI, then a new cdk-blocks dev that starts and stops cleanly;
    • a first start with its port held exits non-zero.

    This changes a script that CI runs, so it needs a Guardian review. No workflow file changed.

Not changed: after a Windows dev stop, the CLI is ended by TerminateProcess, so its finally does not run, and its %TEMP%\blocks-dev-* failure directory is left behind. npm run dev reports the CLI's exit code 1.

Validation

At 45010c30e (65 commits, rebased onto main 5f55dac36), Node 22.23.1, from a clean npm ci and full rebuild:

  • npm run build, lint, lint:deps, check:api: all pass (API reports up-to-date).
  • Injection sink guards (scripts/sink-guards): 35/35. The rebases moved this branch's allowlisted sites, and the branch's new Windows CIM process query needed an entry; the allowlist is re-pinned in test(sink-guards).
  • npm test: a whole-suite rerun with CI's NODE_OPTIONS='--test-reporter=spec' passes — 11146 tests, 11136 pass, 0 fail, 10 skipped. (The first TAP-reporter run on the same head lost hosting/dist/secret-cli.test.js to the node:test IPC crash tracked in test(hosting,blocks): keep CLI and adapter output off the test runner's stdout #1330 — untouched by this PR, 3/3 standalone — 11141 tests, 11130 pass, 1 fail, 10 skipped.)
  • CI on this head (PR Checks run 43156211203): green on the first attempt — 88 checks pass, 2 skipped (E2E VPC Smoke; E2E Upgrade In Place), 0 failed.
  • npm run test:e2e:local: 544 tests, 539 pass, 0 fail, 5 skipped (comprehensive + background suites + vendorize/iam-boundary).
  • The new no-hard-links pidfile tests fail at the parent commit (3 of 3) and pass at head (3 of 3).
  • main's new auth template (feat(auth)!: one Auth block replaces AuthBasic, AuthCognito and AuthOIDC #1259) now gets the same e2e client pinning as the other templates (BLOCKS_API_URL to the dev server or TEST_URL before the client loads); the template guard in cli.test.ts failed on it before the port and passes after.
  • Test only: the comprehensive auth suites feat(auth)!: one Auth block replaces AuthBasic, AuthCognito and AuthOIDC #1259 brought in (browser-client, auth-social-local, auth-validate-user, callRpc) read .blocks-sandbox/config.json, which a deploy no longer writes, so E2E Sandbox/Production hit ENOENT the moment they ran on AWS. They now use the api-url.js stage-config helpers; a new regression exercises callRpc per deployed stage against a loopback stub with no config.json on disk (red before the fix), and a source guard keeps future suites off config.json (it named all four files).

Earlier, at 85eca73c and e4aa84ed: build, lint, lint:deps and check:api passed; core 2270 tests (2269 pass, 1 skipped), blocks 475 (473 pass, 2 skipped; umbrella 30/30), hosting 1655/1655, bb-data 533 (529 pass, 4 skipped), data-common 67/67, create-blocks-app 236/236.

Smoke test with the built CLI, on apps scaffolded from this branch (npm install --install-links):

  • One dev per app: with npm run dev on :42600, cdk-blocks dev --port 42610 exits 1 with a dev server of this app is already running on :42600 (pid …) and Try: npx --no -- cdk-blocks dev stop --port 42600.
  • Orphaned frontend: after a kill -9 of the react dev group, Vite still held :42621. cdk-blocks dev stop stopped it, and the next npm run dev started.
  • Dead runner: after a kill -9 of the runner, dev stop printed its tsx watch had lost its runner and ignored SIGTERM, so it was killed. cdk-blocks dev exited 0, with no port and no process left.
  • Stop during startup: a group SIGTERM at 1.5, 2.5, 2.8, 3, 3.5 and 5 s left no pidfile and no process each time.

AWS (one sandbox, us-east-1):

  • With npm run dev running, cdk-blocks sandbox deploy succeeded. config.json kept http://localhost:42600/aws-blocks/api, and config.sandbox.json got the API Gateway URL.
  • npm run test:e2e then printed Using API (env BLOCKS_API_URL): http://localhost:42600/aws-blocks/api and passed 13/13, and the calls appeared in dev.log.
  • A Node.js script that imports aws-blocks printed Using API (config.json file): http://localhost:42600/….
  • TEST_URL=<sandbox>/prod npm run test:e2e targeted the sandbox (12 pass, 1 skipped) and made no local calls.
  • cdk-blocks sandbox (watch), then cdk-blocks dev stop: Stopped the cdk-blocks sandbox session on :42600 …: its dev server and its cdk watch. No process of the app was left.
  • cdk-blocks sandbox destroy: the stack is DELETE_COMPLETE. No tables, buckets, SSM parameters or secrets were left. The five custom-resource Lambda log groups were recreated, as described under Not fixed; I deleted them by hand.

Upgraded-app AWS check (a second sandbox): a hand-written legacy config.json pointed at the deployed sandbox, and no dev server was running.

  • A Node.js script that imports aws-blocks failed with .blocks-sandbox/config.json points at the deployed sandbox stack (https://…), written by an older deploy. Start the dev server ….
  • npm run test:e2e started its own dev server, printed Using API (env BLOCKS_API_URL): http://localhost:42630/aws-blocks/api and passed 13/13. The dev server rewrote config.json to the local URL.
  • TEST_URL=<sandbox>/prod npm run test:e2e targeted the sandbox: 12 pass, 1 skipped. This needs aws-blocks/client.js generated for that target; the client the local dev server generated has the mock realtime middleware, and the two realtime tests time out with it.
  • Seeded again, cdk-blocks sandbox destroy printed Moved the sandbox API URL an older deploy wrote … into config.sandbox.json, then destroyed the stack. Nothing remained besides the custom-resource log groups, which I deleted.

Earlier heads of this PR were also checked with a startup-stop loop, the pidfile-takeover tests, a sql-app sandbox deploy from a path with a space, and a destroy that deleted the SSM parameter.

Stack

Stack: 5 of 5 (#1204). Builds on #1212, now merged into main. Top of the stack.

Checklist

  • PR description included
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@xyos
xyos added this pull request to stack #1204 November 1, 2026 02:34
@changeset-bot

changeset-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81d824

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 28 packages
Name Type
@aws-blocks/create-blocks-app Patch
@aws-blocks/blocks Patch
@aws-blocks/core Minor
@aws-blocks/admin-ui Patch
@aws-blocks/data-common Patch
@aws-blocks/bb-logger Patch
@aws-blocks/bb-kv-store Patch
@aws-blocks/bb-distributed-table Patch
@aws-blocks/auth-common Patch
@aws-blocks/bb-app-setting Patch
@aws-blocks/bb-secret Patch
@aws-blocks/bb-data Patch
@aws-blocks/bb-distributed-data Patch
@aws-blocks/bb-database Patch
@aws-blocks/bb-auth Patch
@aws-blocks/bb-realtime Patch
@aws-blocks/bb-async-job Patch
@aws-blocks/bb-dashboard Patch
@aws-blocks/bb-cron-job Patch
@aws-blocks/bb-file-bucket Patch
@aws-blocks/bb-agent Patch
@aws-blocks/bb-knowledge-base Patch
@aws-blocks/bb-email-client Patch
@aws-blocks/bb-tracer Patch
@aws-blocks/bb-metrics Patch
@aws-blocks/bb-lambda-compute Patch
@aws-blocks/bb-container-compute Patch
@aws-blocks/bb-compute Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@xyos xyos changed the title feat/blocks cli 5 core fixes fix(core): dev server and sandbox robustness fixes Nov 1, 2026
Comment thread packages/core/src/scripts/sandbox.ts Dismissed
xyos added 27 commits November 16, 2026 13:18
Invocation strings, port-in-use and dev stop hints, the Windows dev
lifecycle check and the changesets name cdk-blocks.
… secret

sandbox destroy calls DeleteParameter for every app once the stack is gone,
so an AccessDenied or a throttle failed the command even for an app that
never had an external database. Every error except ParameterNotFound is now
a warning that names the parameter and the aws ssm delete-parameter command,
and the destroy exits 0.
… dev, before the deploy

cdk-blocks sandbox checked only for another sandbox before it deployed. Beside
a cdk-blocks dev of the app, the deploy ran, then the sandbox's dev server was
refused by the app's dev-server claim and the sandbox ended with it. When the
sandbox will start a dev server (neither deploy-only nor preview),
startSandbox now refuses first while any dev session of the app is live,
starting ones included, naming its port and the dev stop command.
procps-ng 3.3.10 (CentOS 7, AL2) reads `ps -o pid=,ppid=` as a single pid
column, so childPids found no runner and a SIGTERM to cdk-blocks dev skipped
the runner's cleanup. Pass `-o pid= -o ppid=`, in context.ts and in the
test's helper.
…has exited

stopDevServer ignored waitExit for a starting record: with a free port it
returned portFree: true, and dev stop exited 0 and reported a stop, while the
CLI was still alive. The port counts as free, and the record is reaped, only
when the CLI exited; otherwise stopMessage warns that it has not ended yet.
… alive

runnerAlive() checked the runner named by the record read when the stop
began. Mid-reload that is the runner that exited for the reload, so the
watcher got the 2 s no-runner grace and was SIGKILLed, orphaning the new
runner, which skipped its cleanup and kept the port. Before the SIGKILL,
re-read the pidfile: a live successor under the same watcher gets the 8 s
runner grace, and the watcher is not SIGKILLed while it lives.
…s a literal

The CLI may run against an app whose installed core predates the
deployedConfigFile export, so it keeps the fixed file name.
…rote the deploy URL to config.json

Core 0.8.0 is released and still writes it; the change ships in the next
release.
… the bundling hook

Double quotes still let sh expand $ and backticks and broke on a " in the
project path. Both hooks now build the command with a POSIX single-quote
helper, tested with a path that holds ", $, a backtick and a quote.
Deploys no longer write config.json and the Node client refuses an old one,
an on-disk contract change.
Each superproject is a strict ancestor of the work tree before it, so the walk in gitRepoFiles reaches the filesystem root at the latest and needs no depth cap.
applyMigration rewrites package.json before it deletes the wrappers, so a wrapper left behind is unused rather than a script running a deleted file. A delete that failed with anything but ENOENT (EACCES in a read-only aws-blocks/scripts) escaped raw after the rewrite. Migrate now tries every delete, removes the emptied directory as before, and then throws a CliError naming each wrapper with its error code, with a hint to fix the permissions and rerun with --force, which deletes them. --output json prints the message in the {"error"} document; the README, the help and the doc comments no longer say such an error wrote nothing.
…v server or TEST_URL

As the other templates do: the e2e test sets BLOCKS_API_URL to the dev server on blocks.dev.port after it starts one, or to TEST_URL, so a deploy's recorded URL never redirects it. With TEST_URL it starts no dev server and skips the local readiness check; the canned-provider tests skip as before outside the local mock.
…mplate's cdk watch

As the other templates do: a deploy regenerates aws-blocks/client.js, which the deployed backend does not use, so a running sandbox watch must not synthesize on it.
…rd links

Without hard links (FAT, exFAT, some shared folders) createFileExclusive
creates the pidfile first and writes the record afterwards, so a reader can
see it empty. A start or dev stop that took that moment for a corrupt record
removed the live pidfile and two dev servers then owned the port. Such a
create is now reported as 'in-place', an unreadable record found that way is
left alone ('unreadable'), and the refused start says which files to delete
if no dev server is starting.
…wo new sites

The rebase onto main moved three allowlisted sites (cdk-output.ts regex join,
the dev-server and sandbox frontend commands), and two sites were unguarded on
main itself: bb-database's hashSuffixed separator regex (a module-literal '-'
or '_') and this branch's Windows CIM process query (pids through Math.trunc
into a fixed Get-CimInstance filter, argv array, -NoProfile -NonInteractive).
The stub IdP form-action entry is re-pinned to its current line too.
… server or TEST_URL

main's new auth template (#1259) predates this branch's rule that a template
e2e test never follows a URL a deploy recorded: it imported aws-blocks without
setting BLOCKS_API_URL, read no TEST_URL, and started a dev server even when
TEST_URL names a deployed app. It now gets the same pin, guard and readiness
skip as the other templates. The template guard in cli.test.ts anchors on the
awaited import('aws-blocks'): #1259 declares `let app: typeof import(…)`, a
type annotation the old indexOf matched first, which hid every template from
the pin-before-load check. Red: the guard named auth three ways before the
port; green after.
…fig.json

The browser-client, auth-social-local, auth-validate-user and test-support
callRpc helpers that #1259 brought in read .blocks-sandbox/config.json, which
a deploy no longer writes, so E2E Sandbox and E2E Production failed with
ENOENT the moment those suites ran on AWS. They now use the api-url.js
helpers like every other suite. New regression: callRpc is exercised per
deployed stage in a child process whose cwd holds only that stage's config,
pointing at a loopback stub (ENOENT before the fix), and a source guard keeps
every test file off the dev server's config.json (it named all four files
before the fix).
…SQL blocks

bb-data and bb-distributed-data each carried an identical copy of the shell-quoting helper for the bundling hook's cp command, and of its test. It now lives once in @aws-blocks/data-common/internal, and both blocks import it from there, so a later quoting fix cannot reach only one of them.
…er's config.json

When a stack publishes no ApiUrl output, the RPC playground fell back to .blocks-sandbox/config.json. A deploy no longer writes that file: only a dev server does, with its local URL, so a sandbox or production call could have gone to the local dev server. The fallback now reads .blocks-sandbox/config.<stage>.json for the requested stage.
The fallback read .blocks-sandbox/config.<stage>.json with the request's stage in the file name. Only sandbox and production ever reached it, but the check sat in another function. The stage is now narrowed to those two once, and the narrowed value selects one of two constant paths, as OUTPUTS_FILE does.
bin.ts carried its own EPIPE/EIO/ERR_STREAM_DESTROYED check, because it can't load @aws-blocks/core/scripts on every command. The list is now a named constant, core exports its own as CLOSED_OUTPUT_CODES, and a blocks test fails when the two differ.
… one

The rebase onto the React Native client change left runScript with two cwd options. A caller's directory wins; without one the script still runs in a fresh directory, so no config.json of the working directory answers first.
…t run

The Node.js client refuses a config.json that an older deploy wrote. The changeset now states the step after an upgrade, and why the client does not move the file itself.
… is gone

The dev server rewrote its pidfile with a bare {pid, ppid, port} record once it listened, for a dev server that another start had displaced. With the exclusive claim, two starts of this version can't displace each other, and the bare record dropped the command lines, token, session and sandbox fields that dev stop and the liveness checks read. The server now claims the pidfile again, with its whole record, only when the file no longer holds its own.
A bare {pid, ppid, port} written when the server starts listening would pass the pidfile test and drop the token and command lines that dev stop and the reap protocol read. The test now checks both are there.
…ine after the rebase

Main's cross-origin refusal added two characterization snapshots that pin the old http://localhost:3000 fallback origin; the dev server now answers with its own origin. The frontend command's shell: true moved to dev-server.ts:1282.

This branch had an error being deployed

1 failed and 1 inactive deployments
e2e — d81d8246 Deployed Nov 16, 2026 by xyos via E2E Teardown Verify #6671
agent-bench — d81d8246 Deployed Nov 16, 2026 by xyos via bench / summary #5887
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.

4 participants