Skip to content

fix(blueprints): preserve bindings on code-only updates - #149

Open
ai-yang wants to merge 1 commit into
cloudflare:mainfrom
ai-yang:codex/fix-blueprint-code-preserves-bindings
Open

fix(blueprints): preserve bindings on code-only updates#149
ai-yang wants to merge 1 commit into
cloudflare:mainfrom
ai-yang:codex/fix-blueprint-code-preserves-bindings

Conversation

@ai-yang

@ai-yang ai-yang commented Aug 11, 2026

Copy link
Copy Markdown

Fixes #147

Summary

Make Overseer.updateBlueprint() refresh binding metadata only when callers explicitly pass updateBindings: true.

The API already treats updateCode and updateBindings as independent flags, and the Workshop's Update code action sends only { updateCode: true }. Previously, that call still collected and replaced binding metadata, which could silently change the published blueprint contract or reject on an unrelated invalid annotation.

The production change is intentionally limited to guarding the existing binding collection. Code-only, bindings-only, and combined updates otherwise retain their existing propagation behavior.

Regression coverage

The new tests verify that:

  • a code-only update never calls collectBindingMetadata(), preserves existing bindings, and still succeeds when collection would throw;
  • a bindings-only update refreshes bindings without taking a code snapshot; and
  • a combined update refreshes both code and bindings in one propagation pass.

Test plan

  • pnpm --filter @gadgets/workshop-backend exec vitest run __tests__/blueprint-update.test.ts — 1 test file / 3 tests passed
  • pnpm --filter @gadgets/workshop-backend test — 26 unit-test files / 282 tests passed; 4 environment-dependent integration tests skipped by the existing configuration
  • pnpm --filter @gadgets/workshop-backend types:check
  • pnpm exec oxlint packages/workshop-backend/src/overseer.ts packages/workshop-backend/__tests__/blueprint-update.test.ts — exit 0; pre-existing warnings in overseer.ts are unchanged
  • git diff --check

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the kernel Changes to the Workshop kernel label Aug 11, 2026
@ai-yang

ai-yang commented Aug 11, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Aug 11, 2026
@ai-yang
ai-yang marked this pull request as ready for review August 11, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Changes to the Workshop kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code-only blueprint updates unexpectedly rewrite binding metadata

1 participant