You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework/ecosystem.md
+33-19Lines changed: 33 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,39 +4,53 @@ The GDS ecosystem is a family of composable packages for specifying, visualizing
4
4
5
5
## Packages
6
6
7
-
| Package | Description | Docs | PyPI |
8
-
|---|---|---|---|
9
-
|**gds-framework**| Foundation — typed compositional specifications |[Docs](https://blockscience.github.io/gds-framework)|[PyPI](https://pypi.org/project/gds-framework/)|
10
-
|**gds-viz**| Mermaid diagram renderers for GDS specifications |[Docs](https://blockscience.github.io/gds-viz)|[PyPI](https://pypi.org/project/gds-viz/)|
11
-
|**gds-games**| Typed DSL for compositional game theory |[Docs](https://blockscience.github.io/gds-games)|[PyPI](https://pypi.org/project/gds-games/)|
12
-
|**gds-examples**| Six tutorial models demonstrating every framework feature |[Docs](https://blockscience.github.io/gds-examples)|[PyPI](https://pypi.org/project/gds-examples/)|
Copy file name to clipboardExpand all lines: docs/framework/guide/architecture.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,14 @@ Blocks with bidirectional typed interfaces, composed via four operators (`>>`, `
10
10
11
11
TypeDef with runtime constraints, typed Spaces, Entities with StateVariables, Block roles (BoundaryAction/Policy/Mechanism/ControlAction), GDSSpec registry, ParameterSchema (Θ), canonical projection (CanonicalGDS), Tagged mixin, semantic verification (SC-001..SC-007), SpecQuery for dependency analysis, and JSON serialization.
12
12
13
+
### Why Two Layers?
14
+
15
+
Layer 0 is domain-neutral by design. It knows about blocks with typed ports, four composition operators, and structural topology — nothing about games, stocks, or controllers. This neutrality is what allows five different DSLs to compile to the same IR.
16
+
17
+
Domain judgment enters at Layer 1: when a modeler decides "this is a Mechanism, not a Policy" or "this variable is part of the system state." Layer 0 cannot make these decisions because they require knowledge of the problem being modeled. The three-stage compiler (flatten, wire, extract hierarchy) is pure algebra. The role annotations (BoundaryAction, Policy, Mechanism) are domain commitments.
18
+
19
+
This separation means Layer 0 specifications stay verifiable without knowing anything about the domain — they can be composed and checked formally. Layer 1 adds the meaning that makes a specification useful for a particular problem.
Copy file name to clipboardExpand all lines: docs/guides/best-practices.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,20 @@ Policy(name="Process", ...)
49
49
50
50
---
51
51
52
+
## Modeling Decisions
53
+
54
+
Before writing any composition, three choices shape the entire specification:
55
+
56
+
**Role assignment.** Which processes become BoundaryActions (exogenous inputs), Policies (decision/observation logic), or Mechanisms (state updates)? This determines the canonical decomposition `h = f . g`. A temperature sensor could be a BoundaryAction (external data arrives) or a Policy (compute reading from state) — the right answer depends on what you want to verify, not on the physics alone.
57
+
58
+
**State identification.** Which quantities are state variables and which are derived? An SIR model with three state variables (S, I, R) produces a different canonical form than one that derives R = N - S - I and tracks only two. Finer state identification lets SC-001 catch orphan variables; coarser identification creates fewer obligations.
59
+
60
+
**Block granularity.** One large block or several small ones? The algebra composes anything with compatible ports, but finer granularity makes the [hierarchy tree](../framework/guide/composition.md) more informative and gives verification more to check. A single-block model passes all structural checks trivially.
61
+
62
+
These are design choices, not discoveries. Different choices lead to different verifiable specifications — neither is "wrong." Start from the question you want to answer ("Does this system avoid write conflicts on state?") and design roles backward from there.
Copy file name to clipboardExpand all lines: docs/guides/choosing-a-dsl.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,16 @@ Five domain-specific languages compile to the same GDS core. This guide helps yo
4
4
5
5
---
6
6
7
+
## Starting from the Problem
8
+
9
+
The Decision Matrix below is a technical reference — it assumes you already know your primitives. In practice, most modelers start earlier: with a domain question.
10
+
11
+
The same system can often be modeled with more than one DSL. An epidemic could be stockflow (if you care about accumulation rates) or raw framework (if you just need a state transition). A supply chain could be stockflow (stocks and flows), CLD (causal influences), or SCN (inventory and topology). The DSL choice depends on **what you want to verify**, not just what domain you are in.
12
+
13
+
The natural workflow is: **Problem → What do I want to check? → DSL**. Once you pick a DSL, roles and block structure follow more naturally because the DSL embeds domain conventions about what matters.
uv run marimo run packages/gds-examples/guides/getting_started/notebook.py
436
+
uv run marimo run packages/gds-examples/notebooks/getting_started.py
437
437
```
438
438
439
439
Run the test suite:
440
440
441
441
```bash
442
-
uv run --package gds-examples pytest packages/gds-examples/guides/getting_started/ -v
442
+
uv run --package gds-examples pytest packages/gds-examples/tests/test_getting_started.py -v
443
443
```
444
444
445
445
## Source Files
446
446
447
447
| File | Purpose |
448
448
|------|---------|
449
-
|[`stage1_minimal.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/guides/getting_started/stage1_minimal.py)| Minimal heater model |
450
-
|[`stage2_feedback.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/guides/getting_started/stage2_feedback.py)| Feedback loop with policies |
451
-
|[`stage3_dsl.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/guides/getting_started/stage3_dsl.py)| gds-control DSL version |
452
-
|[`stage4_verify_viz.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/guides/getting_started/stage4_verify_viz.py)| Verification and visualization |
453
-
|[`stage5_query.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/guides/getting_started/stage5_query.py)| SpecQuery API |
|[`stage1_minimal.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/gds_examples/getting_started/stage1_minimal.py)| Minimal heater model |
450
+
|[`stage2_feedback.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/gds_examples/getting_started/stage2_feedback.py)| Feedback loop with policies |
451
+
|[`stage3_dsl.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/gds_examples/getting_started/stage3_dsl.py)| gds-control DSL version |
452
+
|[`stage4_verify_viz.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/gds_examples/getting_started/stage4_verify_viz.py)| Verification and visualization |
453
+
|[`stage5_query.py`](https://github.com/BlockScience/gds-core/blob/main/packages/gds-examples/gds_examples/getting_started/stage5_query.py)| SpecQuery API |
0 commit comments