Skip to content

revert: storyboardContext on AssertionContext (#1142) - #1202

Merged
bokelley merged 1 commit into
mainfrom
bokelley/revert-storyboardcontext-on-assertions
May 1, 2026
Merged

bokelley merged 1 commit into
mainfrom
bokelley/revert-storyboardcontext-on-assertions

Conversation

@bokelley

@bokelley bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor

Reverts #1142.

Why

#1142 added storyboardContext?: StoryboardContext to AssertionContext plus per-step / final-step shallow-copy threading in the runner. After it merged, a closer look showed it's preemptive surface with no consumer:

The asymmetry is correct, not a gap to fill: declarative validators are stateless and need context exposure; imperative assertions have ctx.state and don't. Custom invariants that need cross-step state should continue using ctx.state.

Why now

The window for cheap removal is hours old. #1142 landed in 6.4.0 today; no docs advertised the field, no third-party consumer has had time to depend on it. Removing later means a deprecation cycle; removing now is just a clean revert.

The CLAUDE.md principle this reinforces: "Don't add features, refactor, or introduce abstractions beyond what the task requires."

Compatibility

Breaking-shape change to a public optional field on an exported interface. Shipped as minor while 6.x is still in its breaking phase (per project policy — same as the original #1142 changeset).

What was tested

  • npm run build — clean
  • npm run format:check — clean
  • npm run sync-version — clean
  • NODE_ENV=test node --test test/lib/storyboard-default-invariants.test.js test/lib/storyboard-runner-contract.test.js test/lib/storyboard-track-silent-rollup.test.js test/lib/storyboard-assertion-registry.test.js test/lib/compliance.test.js — 217/217 pass

Test plan

  • Confirm CI green
  • Sanity check: changeset rolls forward as 6.5.0 (minor) on the next Release PR

🤖 Generated with Claude Code

Reverts #1142. The field was preemptive surface with no consumer:

- None of the bundled invariants (`status.monotonic`,
  `idempotency.conflict_no_payload_leak`, `context.no_secret_echo`,
  `governance.denial_blocks_mutation`) read `ctx.storyboardContext`.
- Programmatic assertions already accumulate cross-step state through
  `ctx.state` (which is how `status.monotonic`'s `history` works).
- Issue #1140 was about YAML validators (the `check:` clause), not
  assertion handlers — that scope is fully covered by #1141, which
  reads from `ValidationContext.storyboardContext` (a separate
  interface that already existed).

The asymmetry is correct: declarative validators need context
exposure, imperative assertions don't. Custom invariants that need
cross-step state should continue using `ctx.state`.

Breaking-shape change shipped as minor while 6.x is in its breaking
phase. Window-of-removal is hours old — #1142 landed in 6.4.0, no
docs advertised it, no third-party consumer has had time to depend.

This reverts commit 7b804ea.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley
bokelley merged commit e114e3a into main May 1, 2026
9 of 10 checks passed
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.

1 participant