Skip to content

Event-source capture keys (ESM v33) and clock syntax preview - #1054

Merged
woksin merged 39 commits into
mainfrom
screenplay-train-next
Oct 24, 2026
Merged

woksin merged 39 commits into
mainfrom
screenplay-train-next

Conversation

@woksin

@woksin woksin commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Added

  • Source-events captures can declare key <property> is event source: every captured event is then sourced by the capture's key, a fixture without for takes the key, and a fixture whose source disagrees is rejected. Only a source events capture with a single property key may declare it (PLAY0809). Models that use it select ESM v33; other models keep their version and bytes. (Let an events capture declare that its key is the captured events' event source #1042)
  • Authoring syntax and diagnostics for clock offsets (today - 7 days, now + 2 hours), date operands (date of occurred), application time zones, command calendars and specification time zones (PLAY0812, PLAY0813, PLAY0814). Executable binding still refuses them with PLAY0268; bare today and now remain ordinary property paths. (part of Admit today / now operands in command conditions (needs a consumer) #824)

woksin added 30 commits October 23, 2026 21:05
0108, 0109 and 0111 are accepted after small text revisions; 0110, 0112 and 0113 await the product owner.
A source events capture can declare 'key <property> is event source'.
The flag is parsed, printed, bound, serialized as keyIsEventSource and
enforced by the reference runner; PLAY0809 refuses it elsewhere.
Declared query arguments and `where` both change canonical bytes, so each
selects the new ESM version under 0105; a query with neither keeps its
bytes. Settles the argument spelling as `argument`, which every example
in the record already uses.

Evidence: SemanticModelCanonicalJson.WriteQuery
(Source/DotNET/Screenplay/Semantics/Serialization/SemanticModelCanonicalJson.cs:427-457)
writes only present optional members (keyParts, filters, authorization) and
writes filters in declaration order; 0069 consequences (filters select v14,
filter-free models keep bytes) set the same pattern. Query line shape from
Documentation/screenplay/queries.md:16 and grammar.md:1173.
Decision 2 started a new epoch on a calendar-setting change while decision
9 left the choice to Arc. Arc decision 0012 (accepted 2026-10-23 on
Arc origin/arc-3521-calendar cedfc37c2, lines 185-187 and open question 2;
still `status: proposed` on Arc origin/main 37b8701ec) fixes the zone per
subscription: an application zone change needs a restart, a tenant zone
change applies to new subscriptions and reconnects. Epochs now start only
on data changes and clock boundaries, item 9 states the Arc rule and how it
qualifies item 1, and the rejected alternative is listed. The boundary rule
(every local-date change in either direction, St John's example) is kept.
…0111

Item 4 gains the default-choice syntax, `choose <Concept> from <Query>
[value <key>] [show <path>]`, a document-level line beside concepts with
the field clauses of item 1, and its rules (applies to inputs of the
concept and its arrays, argument-free query, field override and opt-out).
Item 8 replaces the unverified claim with the evidence and the rule the
implementation must follow; open points 1 and 2 are settled.

Evidence (Screenplay 95522ad):
- SemanticModelCanonicalJson.cs:393-400 and :212-224 write read models
  from the bound SemanticProperty (id, name, type, identifier) only.
- SemanticModelBinder.Identity.cs:21-31 binds owner, name, type and
  identifier; no PropertySyntax display member exists today.
- Identifiers.cs:283-284 hashes the revision from the canonical bytes.
- Documentation/screenplay/ast-compatibility.md:34 sets the
  omitted-when-absent syntax JSON pattern; grammar.md:29-32 places
  document-level declarations, :550-552 the form field line.
The consequence "apply to the receipt instant, not to the event's occurred
time" read as covering every command. Item 2 already gives reaction-invoked
commands the triggering instant (the event's occurred time for an event
trigger), so the consequence now names client commands and points to
item 2 for reaction-invoked ones. Status and decided lines untouched.

Tracks #1048.
Step 4 said "only the first word is capitalized", which contradicted the
"Register SKU" example in step 3. Sentence case now lower-cases later
words but keeps a run of two or more capitals as written anywhere; a
single capital letter is an ordinary word. The Stage consequence names
where Stage already matches and where it still differs.

Evidence: Stage branch stage-run3-ui at bb1457cc (#736, not on Stage
origin/main 6f275d9d), Source/Frontend/Runtime/src/humanize.ts:4-39
(word pattern `[A-Z]+(?![a-z])|[A-Z]?[a-z]+\d*|\d+`, acronym = length > 1
and all capitals), re-exported by stageFormSchema.ts:122; the examples were
run through that logic (Postal code, Register SKU, SKU list, Export to
PDF, Make a choice). Differing C# fallbacks on the same branch:
Source/Stage/Api/SynthesizedSceneContent.cs:122-143 and
Source/Contracts/Scene/CommandFormSchemas.cs:164-185 (split only on a
lower-to-upper change, no lower-casing). Status untouched; 0112 awaits
woksin under Q-33.
A marked capture fixture with no for now takes the key as its event source before projections and reactions see it, and a mismatched for is rejected when the world is established, with or without an action.
… S0)

Adds today/now offsets and 'date of' operands (decisions 0106/0107) to the
native and TypeScript parsers, printers and syntax JSON, with diagnostics
PLAY0812 InvalidTimeZoneDeclaration, PLAY0813 InvalidCommandCalendar and
PLAY0814 InvalidSpecificationTimeZone. Semantics refuse them until S1-S3.
…ay-train-next

# Conflicts:
#	Source/Screenplay/Monaco/screenplay-language/validation.ts
Construct 43 admission refusals now carry the Screenplay#824 issue link; regenerated with the contract tool, no manual edits.
… specification

PLAY0809 (#1042) was added to the editor's diagnostic codes without a document that raises it, so the
every-coded-kind specification failed.
@woksin woksin added the minor New features, non-breaking additions label Oct 24, 2026
@woksin woksin self-assigned this Oct 24, 2026
@woksin

woksin commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Notes for reviewers (not part of the release note).

Contents: #1042 event-source capture keys (ESM v33, decision 0114), #824 S0 clock/calendar syntax-only parsing (decisions 0106/0107), acceptance of decisions 0106-0113 and 0097 as amended by 0113, plus the #824 contract golden regeneration (99 issue leaves null -> #824 link) and the PLAY0809 case in the Monaco every-code spec.

Local gates (Release config, CI commands): Debug build; spec projects Screenplay (13,728), Matching.Specs, Contexts, ContractCatalog, Contracts, Tool, CanonicalVectors Debug + Release, MCP in three disjoint partitions (3,400 passed, 3 platform skips); Release build -p:Version=9999.0.0; pack; verify-package; yarn install/build/compile/lint:ci/test. All exit 0 on the final head or its parent (the last commit only adds a Monaco spec case, rerun with the JS gate).

Not run locally: docs trigger (secret), mcp-desktop publish/smoke, native-editor-repairs (VS Code host), render-blueprint-samples (published CLI), OS matrix.

Review: review workflow, deep round 1 and quick round 2 passed at 7e526e3; quick round 3 (delta to this head) passed.

AI corpus: tracked by Cratis/AI#891 (#1042) and Cratis/AI#903 (#824 S0).

Consumer note: the full-esm-v33 golden enters the CanonicalCorpus, so Stage must admit v33 when it next bumps Screenplay.

@woksin woksin added the ai-corpus: tracked Language change; the AI corpus update is tracked in a linked Cratis/AI issue or PR label Oct 24, 2026
@woksin
woksin merged commit 0f1f51f into main Oct 24, 2026
25 of 29 checks passed
@woksin
woksin deleted the screenplay-train-next branch October 24, 2026 12:26
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