Skip to content

Feed the Choreography availability engine from GuestList - #131

Merged
einari merged 3 commits into
mainfrom
feature/availability-audience-source
Nov 12, 2026
Merged

einari merged 3 commits into
mainfrom
feature/availability-audience-source

Conversation

@einari

@einari einari commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

GuestList can now feed the Cratis Choreography availability engine from the audiences a product recorded locally. It is a separate package, so hosts without Choreography are unaffected.

Added

  • Cratis.Showrunner.GuestList.Availability: AddGuestListAvailability registers a Choreography IAudienceSource over GuestList's local read models. The effective audiences are the union of the system's, the tenant's and the user's grants, each tagged with its level. Nothing is asked of the operator, so the last known state stays in force while the link is down. Grants for audiences the application does not declare are carried, never match a gate and are reported (a warning once per grant; the UndeclaredGrant query lists them). Audience resolution from local state, reactive to change Choreography#221
  • Open sessions update: IAudienceSource.OnChanged is raised when a grant or withdrawal changes the product's read models, including for tenants added later.
  • The cratis.showrunner.guestlist.audience_lag metric reports the seconds since the product last received a change to its audiences.
  • Documentation: Feed the availability engine.

@einari einari added the minor New functionality - bumps the minor version label Nov 12, 2026
@einari einari self-assigned this Nov 12, 2026
@einari

einari commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Reviewer notes for Cratis/Choreography#221 (epic Cratis/Screenplay#1296).

  • Packaging: a new GuestList.Availability project/package references Cratis.Choreography 2.7.0; GuestList itself is unchanged, so hosts without Choreography are unaffected. Microsoft.CodeAnalysis.Workspaces.Common is pinned to 5.9.0 centrally because Choreography's Orleans codegen asks for 5.0.0 and the integration project references CodeAnalysis.CSharp 5.9.0 (NU1608 otherwise).
  • Reading of the brief: the issue names read models ProductGuestList and UndeclaredAudienceGrant; in the repository they are AudienceHoldings (self-reducing, watched) and UndeclaredGrant, which is what is wired.
  • Assumption: a system grant is part of every answer (GuestList documents that system grants apply to every tenant), so AudienceSubject.IsSystem does not gate it.
  • The user level is read only when the subject has a tenant, because user grants live in the tenant's namespace.
  • Lag is measured from the last change the watched read models published, not from every inbox event, so an operator decision that changes nothing (a duplicate, a stale one) does not reset it.
  • Locally verified: Release and Debug solution builds with 0 warnings; 40 new specs in GuestList.Availability; the 67 GuestList specs; the GuestList integration specs against a real Chronicle kernel in Docker, including a new one with an operator store and a product store (union, undeclared carried, open session told of a change, last known state after the operator is gone).

@einari
einari merged commit cfd6758 into main Nov 12, 2026
8 checks passed
@cratis-direct
cratis-direct Bot deleted the feature/availability-audience-source branch November 12, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New functionality - bumps the minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant