Skip to content

Add audiences and availability gates - #1305

Merged
einari merged 14 commits into
mainfrom
feature/availability-gates
Nov 13, 2026
Merged

einari merged 14 commits into
mainfrom
feature/availability-gates

Conversation

@einari

@einari einari commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Screenplay models can now say whether a part of an application is there at all for a tenant, a user or the system, separately from who is allowed to use it.

Added

  • audience and reusable availability declarations with for, when and with lines, combined with and, or and parentheses, and available for, available when and available with gates on modules, features, slices, commands, queries and screens. Gates combine down the path and are decided before authorize; an unknown audience, availability or value never opens a gate (Audiences and availability: audience, availability, available for | when | with #1301)
  • Persona audience lines, for authoring only, and the $context.audiences value.
  • provide <name> <Type> from <source> for scope-driven context values readable in available when.
  • ESM v53, written only when a model uses availability or provided values.
  • Diagnostics PLAY1130 to PLAY1141 for malformed, duplicate, unknown and circular audiences and availabilities, unprovided values, and commands that can be unavailable to their invoker.
  • The same support in the TypeScript compiler, Monaco (hover, completion, go to definition, snippets), the VS Code grammar, rename and the MCP server. The event model board draws a gated slice for the personas that pass its gates and marks it.
  • A documentation page on audiences and availability, and gates in the Invoicing and Commerce samples.

Changed

  • provide is admitted when its source is a literal, the host or a query; provide from a file or code block stays a preview.

@einari einari added the minor New features, non-breaking additions label Nov 13, 2026
@einari einari self-assigned this Nov 13, 2026
@einari

einari commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Corpus impact: tracked in Cratis/AI#1144 (Cratis/AI#1144).

Reviewer notes:

  • Surfaces covered: C# and TypeScript compilers, ESM v53, printer, rename, MCP, Monaco, VS Code grammar, event model board, documentation, samples (Invoicing with the Monaco copy, Commerce).
  • Commerce shows a scope-driven gate: Fulfillment provides warehouse, Shipping gates on it.
  • provide from a file or code block remains a preview (Context values: provide at application, module, feature and slice #1300).
  • Verified locally: Screenplay.Specs 17703, Screenplay.Mcp 3608, TypeScript compiler 9743, Monaco, VS Code extension 1048, event model board 407, McpApp 133; Release build with warnings as errors for Screenplay, Specs, Mcp, Tool and Conformance.
  • Not run: Screenplay.CanonicalVectors.Specs (its LegacyReader project fails restore here with NU1507, a local NuGet source setting).

@einari einari added the ai-corpus: tracked Language change; the AI corpus update is tracked in a linked Cratis/AI issue or PR label Nov 13, 2026
@einari
einari merged commit f4e01e4 into main Nov 13, 2026
70 of 78 checks passed
@einari
einari deleted the feature/availability-gates branch November 13, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-corpus: tracked Language change; the AI corpus update is tracked in a linked Cratis/AI issue or PR minor New features, non-breaking additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant