Skip to content

Commit 57f59c6

Browse files
fahchenclaude
andcommitted
docs: update AGENTS.md for new ColouredFlow.DSL surface
- Add `dsl/` row to module map; clarify `notation/` as low-level building blocks. - Bump migration range to V0..V3. - List current `locals_without_parens` macros and document `cpnet/0` + `__cpn__/1` reflection. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent bec62e6 commit 57f59c6

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

AGENTS.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ The code splits into **static CPN structure**, **CPN semantics**, and the
4141
| `definition/` | Pure data model. `ColouredPetriNet` holds `colour_sets`, `places`, `transitions`, `arcs`, `variables`, `constants`, `functions`, optional `termination_criteria`. |
4242
| `enactment/` | Runtime values: `Marking` (tokens on a place), `BindingElement` (transition bound to input tokens), `Occurrence` (fired binding — the event-source event). |
4343
| `multi_set.ex` | Multiset token bag. Sigil: `~MS[{1, "a"}, {2, "b"}]`. |
44-
| `notation/` | Elixir DSL: `colset/1`, `val/1`, `var/1`, `arc` macro. |
44+
| `notation/` | Low-level building blocks reused by `dsl/`: `colset/1`, `val/1`, `var/1`, plus `arc`/expression helpers. |
45+
| `dsl/` | High-level declarative workflow DSL (`use ColouredFlow.DSL`). Composes `notation/` into a validated `ColouredPetriNet` at compile time. See `dsl/spec.md`. |
4546
| `builder/` | Converts DSL input into a validated `ColouredPetriNet`. |
4647
| `validators/` | Static definition checks (colour sets, arc typechecks) + enactment-time invariants. |
4748
| `expression/` | CPN ML compiler/evaluator; builds guards and bindings for arc inscriptions. |
@@ -82,10 +83,10 @@ tree.
8283
picked via
8384
`Application.get_env(:coloured_flow, ColouredFlow.Runner.Storage)[:storage]`.
8485

85-
| Implementation | Use | Location |
86-
| ------------------ | -------------------------- | ----------------------------------------------------------- |
87-
| `Storage.Default` | production — Ecto/Postgres | `storage/schemas/`; migrations `storage/migrations/{V0,V1}` |
88-
| `Storage.InMemory` | tests | `storage/in_memory.ex` |
86+
| Implementation | Use | Location |
87+
| ------------------ | -------------------------- | ------------------------------------------------------------ |
88+
| `Storage.Default` | production — Ecto/Postgres | `storage/schemas/`; migrations `storage/migrations/{V0..V3}` |
89+
| `Storage.InMemory` | tests | `storage/in_memory.ex` |
8990

9091
- **Worklist** (`runner/worklist/`). `WorkitemStream.live_query` + `list_live`
9192
stream live workitems via cursor (see `TrafficLight` example's
@@ -97,5 +98,12 @@ tree.
9798

9899
- Prefer `typed_structor` over plain `defstruct` + `@type t` for new data types
99100
— used pervasively.
100-
- DSL macros `colset`, `val`, `var`, `return` are registered as
101-
`locals_without_parens` — don't add parens when the formatter complains.
101+
- DSL macros are registered in `.formatter.exs` `locals_without_parens` — don't
102+
add parens when the formatter complains. Current set: `colset/1`, `var/1`,
103+
`val/1`, `return/1` (notation); `name/1`, `version/1`, `place/2`,
104+
`initial_marking/2`, `function/{1,2}`, `transition/2`, `guard/1`, `action/1`,
105+
`input/{2,3}`, `output/{2,3}`, `termination/1`, `on_markings/1` (high-level
106+
DSL).
107+
- Modules using `ColouredFlow.DSL` expose `cpnet/0` (the materialised
108+
`%ColouredPetriNet{}`) and `__cpn__/1` reflection (`:name`, `:version`,
109+
`:initial_markings`), modeled after `Ecto.Schema.__schema__/1`.

0 commit comments

Comments
 (0)