Skip to content

A C#-first sample against the shipped overlay API — and does the overlay stance hold for spec-first work? #16

Description

@jeremydmiller

Part of JasperFx/bobcat#257, and of the Spec Driven Development effort (master: JasperFx/stoat#9).

Rescoped 2026-09-08, after reading stoat#9 and JasperFx/jasperfx#687 properly. The fluent authoring API already shipped, and it shipped reshaped: it is an overlay, not a role-declaring surface.

The builder may name slices, group them, annotate and link (spec identities). It must not declare command / handler / aggregates / emitted events / read models / trigger kind / slice pattern — those are derived. Command<T>() / HandledBy<T>() / Emits<T>() / Projects<T>() / Reads<T>() either go, or survive only as an explicitly documented escape hatch for flows you don't own.

So this issue is no longer "write the model in C#" in the abstract. It is: build the sample against the overlay as designed, and find out whether it reads.

Starting material, and the tension it exposes

The first wave produced a working C# model of all eleven CritterCrush slices — CritterCrushModel.cs, an IEventModelDefinitionSource that compiles and merges. It is also a direct violation of the stance above: it declares every role, because it was transcribed from a curated .emodel.yaml that declares every role.

That is not a mistake to quietly correct. It is the open question this sample should answer:

Does the overlay stance hold when the code does not exist yet? The stance reads naturally for an application that already runs — roles are derived because there is something to derive them from. The curated model's whole purpose is the opposite: it is the input to scaffolding, so its roles are what becomes the code. There is nothing to derive from at that moment.

Three candidate answers, and picking one is the point of this issue:

  1. The stance holds and spec-first is out of scope for the overlay — the curated file stays a Bobcat scaffolding input that never reaches the descriptor as declared roles, and the C# sample only names, groups and links.
  2. Spec-first is the documented escape hatch that jasperfx#687 already leaves room for, and this is a fourth provenance rung below Declared.
  3. The stance needs amending now that a real spec-first pipeline exists that did not when it was written on 2026-08-20.

What good looks like

Someone reading the file should see the board: a stream-starting automation triggered from another boundary; a collapsed HTTP command slice with a refusal; a single-stream View slice; and a fan-out View slice that is deliberately unprovable. If those four shapes are obvious, the overlay reads. If they are buried in constructor arguments, this sample is the evidence for what to change.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions