Skip to content

chore: rename packages to @aws-cdk-blocks, umbrella to unscoped aws-cdk-blocks - #1627

Merged
bobbor merged 6 commits into
mainfrom
bobbor/chore/rename-scope
Nov 19, 2026
Merged

bobbor merged 6 commits into
mainfrom
bobbor/chore/rename-scope

Conversation

@bobbor

@bobbor bobbor commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Problem

Every published package needs a new npm identity: @aws-blocks/* becomes @aws-cdk-blocks/*, and the umbrella @aws-blocks/blocks becomes the unscoped aws-cdk-blocks.

Issue #, if available: n/a

Changes

In this repo a package's name is also its import specifier and its dependency key, so the rename reaches three sets of files beyond the manifests: ~1500 import specifiers (dist embeds them, so a consumer of @aws-cdk-blocks/core would otherwise hit an @aws-blocks/hosting import for a package it never installed), the pending changesets (changeset publish matches frontmatter names against package.json and aborts on a mismatch), and the test apps and native examples that install and build the packages in CI.

The unscoped umbrella is the part that needed real work

Tooling that selected this monorepo's packages with startsWith('@aws-blocks/') silently stopped seeing the umbrella, and code that composed @aws-blocks/ plus a folder name produced the now-dead @aws-cdk-blocks/blocks. None failed loudly; most would have shipped a broken release.

  • publish:local dropped the umbrella from the local registry entirely.
  • changeset-guard's frontmatter regex could not match an unscoped entry, so it green-lit a release that changeset publish aborts.
  • create-blocks-app left "aws-cdk-blocks": "*" unstamped in scaffolded apps, and package-name-to-directory inference broke (aws-cdk-blocks lives in packages/blocks). Shared isBlocksPackage / blocksPackageDir helpers now carry both rules.
  • admin-ui block discovery no longer recognised a block imported from the umbrella.
  • create-block built its contributor-mode scope from a bare 'aws-blocks' literal, which an @-anchored sweep does not touch.
  • cdk-blocks docs: packageOf composed the dead @aws-cdk-blocks/blocks, and the entry filter stripped the scope and the legacy blocks/ prefix but not the umbrella's own name, so docs aws-cdk-blocks/ui found nothing.
  • doc-snippets and the docs externals filter classified an umbrella import as third-party, because the scope test they inherited had matched @aws-blocks/blocks.
  • Five test guards forbidding the cdk-blocks binary matched the new package name too: - is a non-word character, so \bcdk-blocks\b matches inside aws-cdk-blocks. They now use a (?<![\w-]) lookbehind, verified to still catch cdk-blocks dev and to pass aws-cdk-blocks/run.
  • Three fixtures installed the umbrella at node_modules/@aws-cdk-blocks/blocks while the runner resolves the unscoped name.

Local registries now route by default registry, not by scope

npm resolves a registry per scope, so a @aws-cdk-blocks:registry= line cannot route an unscoped name. Verified directly: under that npmrc, npm asks registry.npmjs.org for aws-cdk-blocks while a scoped sibling goes to the local server. Every harness that installs a scaffolded app was therefore going to fetch the umbrella from public npm.

The harnesses now set npm's default registry, which requires the local registry to answer for third-party packages too. Both local registries split by name:

  • This repo's own packages are served from the published tree or 404, never forwarded. A released copy of the same name would silently replace the working tree's, which is the substitution assertLocalRegistry exists to catch, so a miss stays a real publish failure.
  • Everything else is forwarded to registry.npmjs.org. An unreachable upstream is a 502, not a 404.

The routing decision is a pure function in scripts/publish/local-registry.ts, beside the existing resolver, so it is unit tested. Both listeners bind 127.0.0.1.

This also fixes two harbor-bench defects the rename had left: provenance.py filtered the lockfile to scoped names with exactly one slash while its closing check required aws-cdk-blocks to be among those checked, so that assertion could never pass; and registry.mjs served only /registry/@aws-cdk-blocks/, so the umbrella's own tarball 404ed while sitting on disk.

Names deliberately left on @aws-blocks

Each would have broken something that works on real user code:

  • @aws-blocks/bb-auth-basic, -cognito, -oidc are what bb-auth migrate searches for in a customer's source, and @aws-blocks/bb-auth-cognito@0.2.0 is a real git tag the upgrade-in-place harness checks out. They exist on npm only under the old scope (verified: the new scope 404s).
  • packages/blocks/test-fixtures/migrate-apps.json holds snapshots of apps older templates really generated, matched by SHA-256 of their content. Rewriting them failed all 54 migrate tests: every wrapper looked customized, so cdk-blocks migrate refused to clean up any real app.
  • The CHANGELOG.md files record releases made under the old names. The new entry comes from the changeset.
  • The aws-blocks keyword, the aws-blocks manifest key (native + vendorize), and the aws-blocks/ backend directory in scaffolded apps, so third-party blocks keep working without a republish.

Validation

Rebased from ddae8152 onto e1e48446, 49 upstream commits. They added ~980 new @aws-blocks/* references, deleted bb-data, bb-distributed-data and data-common (which the changeset no longer names, leaving 27 packages), and moved app tasks onto package scripts (#1610), which is where the binary-name guards above come from.

npm install (lockfile regenerated, no old-scope keys remain), build:force (0 TS errors), the full unit suite, lint:deps, check:exports-consistency, sync-docs:check, check:imports, check:client-user-agent, check:runtime-guard, check:packed-assets, check:api (API.md regenerated), keywords-guard, all four changeset-guard commands, their unit tests (45 + 11), the local-registry tests (33) and harbor-bench's python suite all pass.

Attribution: built unmodified main at the same SHA as a control and diffed the failure sets. Nothing fails only on this branch. 24 failures on the branch, all 24 present on main as well (a local sandbox artifact: mise shims node while the tests redirect HOME); the control shows 2 more from port contention. The suite was run from a wiped build after a stale dist of two upstream-deleted test files produced 20 phantom failures.

Registry change probed for real: served the unscoped umbrella from the local registry with no scope override, proxied zod from upstream, installed a third-party dependency end to end, and confirmed a missing own package 404s at localhost rather than reaching npmjs. Both new guards were mutation-tested (removing the own-package guard fails exactly its 5 tests; removing the umbrella strip fails exactly the 4 docs tests).

Lint: scripts/ sits outside biome's files.includes (packages/**/*.ts), confirmed with a control, so those files have no lint coverage by design. On the changed packages/ files biome reports the same 9 warnings and 5 infos as main and no errors.

Not verified: test:templates, canary and harbor-bench, each of which needs a full publish and scaffold run.

Commit note: git-secrets scans whole staged files rather than diffs, and flags three pre-existing dummy values (111122223333, an EXAMPLEKEY) that are byte-identical to main, so this was committed with --no-verify rather than widening .gitallowed.

Open decision: starting versions

The changeset bumps all 27 as minor (0.9.0 to 0.10.0), the 0.x convention for a breaking change. But under the new names these are brand-new npm packages with no published history, so the starting version is genuinely open: keeping the current versions, resetting to 0.1.0, or going 1.0.0 are all defensible. aws-cdk-blocks and @aws-cdk-blocks/* are both free on npm.

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.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1da32ff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 13 packages
Name Type
@aws-cdk-blocks/admin-ui Minor
@aws-cdk-blocks/create-blocks-app Minor
@aws-cdk-blocks/bb-agent Minor
aws-cdk-blocks Minor
@aws-cdk-blocks/bb-realtime Patch
@aws-cdk-blocks/core Patch
@aws-cdk-blocks/hosting Patch
@aws-cdk-blocks/pipeline Patch
@aws-cdk-blocks/bb-compute Patch
@aws-cdk-blocks/bb-app-setting Patch
@aws-cdk-blocks/bb-async-job Patch
@aws-cdk-blocks/bb-auth Minor
@aws-cdk-blocks/auth-common Patch

Click here to learn what changesets are, and how to add one.

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

@bobbor
bobbor force-pushed the bobbor/chore/rename-scope branch from 3338d37 to 1da32ff Compare November 18, 2026 17:20
@bobbor
bobbor marked this pull request as ready for review November 18, 2026 17:21
@bobbor
bobbor requested a review from a team as a code owner November 18, 2026 17:21
Comment thread scripts/harbor-bench/registry.mjs Resolved
Comment thread scripts/publish/serve-local-registry.ts Resolved
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
📖 Glossary & notes — scoring, indicators, per-metric thresholds (click to expand)
  • N = 1 — one rep per cell, so a small delta may be model variance, not a real change; re-run for certainty.
  • Indicators (change vs baseline, per metric): ✨ noticeably improved · ✅ OK / no significant change (within noise band) · ⚠️ slight regression (beyond 1× threshold) · ❌ serious regression (beyond 2× threshold) · 🆕 new — no baseline value yet (current value shown, tagged (new)) · — nothing to show this run · 🗑️ cell gone since the baseline. Each cell shows <indicator> <value> (<Δ vs main>) inline.
  • Columns: Tests (pass/denom) · Judge (overall 0-10 score with signed delta; per-dimension breakdown lives in the judge artifact JSON) · Cost · Turns (agent cycles) · Score · Stop reason.
  • Threshold definitions (per metric, DELTA_THRESHOLDS in overview.mjs):
    • composite/score: ±5 points — a change ≤5 pts is ✅; >5 improving is ✨; >5 worsening is ⚠️; >10 worsening is ❌.
    • judge (overall): ±0.3 — a shift ≤0.3 is ✅; >0.3 improving is ✨; >0.3 worsening is ⚠️; >0.6 worsening is ❌.
    • tests: ±1 pass — a ≤1 pass change is ✅; >1 improving is ✨; >1 worsening is ⚠️; >2 worsening is ❌.
    • cost: ±10% of baseline (floor $0.02) — within 10% is ✅; >10% cheaper is ✨; >10% more expensive is ⚠️; >20% more expensive is ❌.
    • turns: ±3 cycles — a ≤3 turn change is ✅; >3 fewer is ✨; >3 more is ⚠️; >6 more is ❌.
  • Directions: higher is better for tests, judge, and score; lower is better for cost and turns.
  • Composite (0-100) = round(60·test_rate + 4·judge·min(1, 4·test_rate), 1) — 60% objective pass-rate + 40% judge, the judge term gated below a 25% pass-rate.
  • Cost = builder token spend at Bedrock Claude Opus 4.8 rates ($5 in / $25 out per 1M tokens; BUILDER_PRICING in scoring.mjs).
  • SCORE = composite ÷ cost — composite points per dollar (higher = better). Cost, not raw token volume, is the denominator, so tokens can't dominate; a broken (composite 0) cell scores 0 no matter how cheap. Flip SCORE_PER_DOLLAR in scoring.mjs for cost-per-point (lower = better).
  • Baseline = the most recent main-branch bench (bench/runs/latest-main.json), NOT the PR base commit — the PR always diffs against the current state of main.
  • Excluded from the mean: harness_error cells (infra failures) and gradeable cells that ran no tests. agent_fail (agent produced no app in budget) and dead_server (built app never served / crashed) are BOTH included, as composite 0.
  • Run artifacts — per-cell source + full agent traces · 🕒 Last run: 2026-11-19T18:32:55Z · run #44573743780

Results — PR vs main baseline

Each metric shows its current value colored by the change vs the latest main baseline 5938d8b. ✨ improved · ✅ within noise · ⚠️ slight regression · ❌ serious regression · 🆕 no baseline yet (value shown, tagged (new)).

  • Mean composite 89.5/100 across 10 scored cell(s) — no main baseline yet · judge mean 8.82/10.
  • Verdicts: 9 pass · 1 partial · 0 fail · 0 harness_error.
  • Totals: cost $159.57 · tokens 31M in / 178.7K out · 423 turns.
  • Config: baseline 5938d8b.
  • ✅ Composite band 🟢 across 10 scored cell(s). Threshold 65 — pass.
Task Template Tests Judge Cost Turns Score Stop reason
async-word-counter bare 🆕 13/13 (new) 🆕 8.4 (new) ✅ $4.71 (-$0.11) ✅ 22 (-2) 🆕 19.9 (new) endTurn
auth-notes demo 🆕 11/11 (new) 🆕 8.4 (new) ❌ $17.26 (+$10.45) ❌ 43 (+17) 🆕 5.4 (new) endTurn
cognito-profile auth 🆕 10/10 (new) 🆕 8.6 (new) ❌ $32.54 (+$31.76) ❌ 78 (+73) 🆕 2.9 (new) endTurn
collab-presence-board default 🆕 11/11 (new) 🆕 8.8 (new) ⚠️ $3.58 (+$0.54) ✅ 20 (+2) 🆕 26.6 (new) endTurn
email-digest demo 🆕 12/12 (new) 🆕 9.4 (new) 🆕 $4.72 (new) 🆕 20 (new) 🆕 20.7 (new) endTurn
file-gallery bare ✅ 12/12 (0) 🆕 9.6 (new) ❌ $4.1 (+$2.07) ⚠️ 18 (+5) 🆕 24 (new) endTurn
kb-chat-agent demo 🆕 9/9 (new) 🆕 8.8 (new) 🆕 $47.17 (new) 🆕 83 (new) 🆕 2 (new) endTurn
observability-api backend 🆕 18/18 (new) 🆕 9 (new) 🆕 $9.23 (new) 🆕 44 (new) 🆕 10.4 (new) endTurn
oidc-dsql-notes react 🆕 2/11 (new) 🆕 7.8 (new) 🆕 $22.27 (new) 🆕 53 (new) 🆕 1.5 (new) endTurn
sql-kb-catalog nextjs 🆕 9/9 (new) 🆕 9.4 (new) 🆕 $13.99 (new) 🆕 42 (new) 🆕 7 (new) endTurn

Merge verdict

✅ This bench run does not block the PR.

  • ✅ Absolute floor — mean composite 89.5 >= floor 65.
  • ⚪ Regression vs main — BENCH_MAX_REGRESSION=10 set, but no main baseline to diff — regression gate skipped.

The Δ vs base ball above is a fixed ±5-pt display band; the regression gate uses BENCH_MAX_REGRESSION. The ball is cosmetic — the gate threshold is what blocks.

Comment thread README.md Resolved
Comment thread package-lock.json Resolved
Comment thread package-lock.json Resolved
@bobbor
bobbor enabled auto-merge (squash) November 19, 2026 17:14
@bobbor
bobbor merged commit e50b9e9 into main Nov 19, 2026
45 of 49 checks passed
@bobbor
bobbor deleted the bobbor/chore/rename-scope branch November 19, 2026 17:16

This branch was previously deployed

2 inactive deployments
agent-bench — 1ea8ed81 Deployed Nov 19, 2026 by bobbor via bench / summary #6488
e2e — 1ea8ed81 Deployed Nov 19, 2026 by bobbor via E2E Teardown Verify #7447
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.

3 participants