Skip to content

Scope generated facts by Marten EventModelName and Wolverine ancillary stores #79

Closed

Description

@woksin

Marten 9.35 added StoreOptions.EventModelName (https://github.com/JasperFx/marten/releases/tag/V9.35.0), and Wolverine 6.39/6.40 added assembly- and namespace-based ancillary-store routing (https://github.com/JasperFx/wolverine/releases/tag/V6.39.0, https://github.com/JasperFx/wolverine/releases/tag/V6.40.0). Together they determine which store or event model owns a CLR type, and identically named documents can come from different stores.

The adapter collapses everything into one model. Mapping EventModelName straight to a Screenplay module would override host-owned placement. A correct design needs explicit store-context discovery, relationship scoping, and diagnostics where ownership is ambiguous. Found while updating to Marten 9.45 / Wolverine 6.45 (#76).

Activity

  1. self-assigned this
    on Oct 2, 2026
  2. woksin commented on Oct 29, 2026

    @woksin
    CollaboratorAuthor

    Analysis and proposed solution

    Current behaviour

    Source/DotNET/CritterStack/Marten/MartenFacts.cs:29 is the Marten discovery entry point. Source/DotNET/CritterStack/CritterStackScreenplayGenerator.cs:111 creates a shared analysis context for the selected projects. No production-source recognition of EventModelName was found. Current discovery therefore does not establish the requested explicit store/event-model ownership boundary.

    Root cause / gap

    CLR type identity and source placement do not identify which configured store owns a document or relationship. Reusing a module as store identity would override an independent host-owned concern and could merge unrelated stores.

    Proposed change

    Add store-context discovery for exact Marten configuration and Wolverine ancillary-store routing APIs. Carry stable context identity through relevant facts and relationship resolution without changing folder/module placement. Diagnose unknown, conflicting and multiply matched ownership instead of selecting the first store. Add solution-scope Roslyn fixtures covering two stores, shared CLR types, identical short names, assembly routing, namespace routing and unresolved configuration. Follow existing given fixtures and focused when_*/should_* specifications; include reversed project-order output parity and unchanged single-store output.

    Size, risk and release intent

    L; high risk because identity and relationship scoping affect many recovered artifacts; minor if existing single-store contracts remain compatible.

    Dependencies and blockers

    Coordinate identity and composition boundaries with #44. Shared generation contracts may need an explicit store-context representation before this adapter can preserve ownership faithfully.

  3. removed their assignment
    on Nov 4, 2026
  4. self-assigned this
    on Nov 21, 2026
  5. woksin commented on Nov 21, 2026

    @woksin
    CollaboratorAuthor

    Partial progress in #119: Marten EventModelName, ancillary stores (AddMartenStore<T>) and [MartenStore] are now detected and reported with a located MARTEN0020 diagnostic, so lost store scope is visible instead of silently merged into one model. No scoping is emitted yet: the shared generation contracts have no store or event-model scope on artifacts and relationships. That is requested in Cratis/Screenplay.Generation#104; this issue stays open until it lands and the adapter can emit the scope.

  6. woksin commented on Nov 21, 2026

    @woksin
    CollaboratorAuthor

    Scope decision for the generation side (Cratis/Screenplay.Generation#104): Marten event-model and ancillary-store scope will be carried as generator-side provenance, keeping same-named artifacts in different stores distinct and reporting unclear ownership. Generated .play will not express storage ownership; the scope is reported as unsupported in .play, because the Screenplay language has no construct for it yet. Language support is proposed in Cratis/Screenplay#1352.

  7. github-actions commented on Nov 22, 2026

    @github-actions
    Contributor

    Closed by release v0.29.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions