Skip to content

Opt-in strict string operands for Contains guards - #279

Merged
woksin merged 2 commits into
mainfrom
scene-276-strict-contains
Oct 30, 2026
Merged

woksin merged 2 commits into
mainfrom
scene-276-strict-contains

Conversation

@woksin

@woksin woksin commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Added

  • Guards can opt in to strict operand checking for Contains, by setting guards: { strictOperands: true } on the InteractionScope context. In strict mode, a null or missing field evaluates to false, and the fallback runs. A collection, number, boolean, object or other non-string operand is reported as unevaluable, so neither the command nor the fallback runs. Without the setting, Contains behaves exactly as before. (Enforce Screenplay string-only contains semantics in native guard selection #276)

@woksin woksin added the minor label Oct 30, 2026
@woksin woksin self-assigned this Oct 30, 2026
@woksin

woksin commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Reviewer notes

  • Contract decision (L0, under woksin's delegation): in strict mode, a null or missing field in Contains(string) evaluates to false, following Screenplay's documentation (Documentation/screenplay/screens.md, lines 86–90, "Subject and conditions"). Unsupported non-string operand shapes are unevaluable (SCENE-GUARD-001). The type check runs on the raw operands, before enumeration normalization.
  • Paths covered: native guard selection for core:guarded-action, interaction alternatives (runActions/branchActions), every useInteractions path including interval findings, and the click-time recheck in CoreGuardedAction.
  • Local: full yarn ci and yarn verify-packages passed at d2660ca. Under heavy load, one yarn ci run timed out on the unrelated primereact/for_editor/when_sanitizing_hostile_html spec, which has a 5 s limit. It passes at normal load (see Show why a guarded command failed #278 notes).
  • Review: one full round passed. One quick delta round for the enumeration fix also passed. A non-blocking advisory was left as is: the numeric-ordinal spec could discriminate more sharply.
  • Consumer: Stage enables guards: { strictOperands: true }. L51 will run the Stage proof inside the train-8 candidate using locally packed tarballs from this commit. Stage won't move to this version until that proof passes.

@woksin
woksin merged commit d4794a9 into main Oct 30, 2026
7 of 8 checks passed
@woksin
woksin deleted the scene-276-strict-contains branch October 30, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant