fix(workflows): refuse new placements of sunset blocks in workflow edits
Merged
WA
12d ago+220+220+012345678901234567890123456789-2-2-0123456789
Summary
- Workflow edits (CLI, Chat, MCP — all go through the same operations engine) now refuse a new block whose type is sunset (
legacy/deprecated), e.g.tableinstead oftable_v2 - Covers every creation path:
add, loop/parallelnestedNodeschildren,insert_into_subflow, and aneditthat switches a block's type - The refusal is a
block_not_allowedskipped item whose reason names the successor (use "table_v2" instead) and whosedetails.replacedBycarries it, so the agent self-corrects - Placed sunset blocks keep executing and stay editable; only new placements are refused, matching the catalog, which already hides sunset blocks from
blocks list - Agents were writing legacy block ids from memory; the catalog read side was already correct but the write side accepted them silently
Type of Change
- Bug fix
Testing
lib/workflows/editing+lib/workflows/applicationsuites: 542 passed- New tests in
operations.test.tsfail with each guard (add, nested, insert, type switch) reverted and pass with the fix bun run lint,check-block-registry.ts origin/staging- Type-check /
check:audits/ full suite left to CI
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing (new tests pass the
test-auditauthoring gate) - No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)