feat: cross-domain comparison — gds-control + canonical validation across 3 DSLs#8
Conversation
Add compile_pattern_to_spec() which maps OGS patterns to GDSSpec, enabling canonical projection (h = f ∘ g) for game-theoretic systems. All games map to Policy, PatternInputs to BoundaryAction, yielding the expected degenerate form: f=∅, X=∅, h=g (pure policy). 67 canonical tests validate five archetypes (sequential, parallel, feedback, inputs, mixed types) plus cross-built equivalence and parametric invariants across all patterns. Document view stratification architecture: domain IRs for domain vocabulary, GDSSpec/CanonicalGDS for semantic classification, SystemIR for structural topology. Add RQ4 (cross-lens analysis) to research boundaries.
0021957 to
3a8cc9a
Compare
There was a problem hiding this comment.
Pull request overview
Adds an OGS→GDS bridge so OGS patterns can be compiled into GDSSpec and then canonically projected, with accompanying canonical-equivalence tests and updated architecture documentation for the 3-DSL canonical pipeline.
Changes:
- Introduces
compile_pattern_to_spec()to compile OGSPatternintoGDSSpecforproject_canonical() - Adds a comprehensive OGS canonical test suite (archetypes + invariants + cross-built equivalence)
- Updates docs to reflect view stratification / research boundaries after 3-DSL canonical integration
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/gds-games/tests/test_canonical.py | New OGS→GDS canonical projection + equivalence tests |
| packages/gds-games/ogs/dsl/spec_bridge.py | New bridge compiler from OGS Pattern to GDSSpec |
| packages/gds-games/ogs/init.py | Re-exports compile_pattern_to_spec as part of the public API |
| docs/guides/view-stratification.md | New guidance on which representation is authoritative for different “views” |
| docs/guides/research-boundaries.md | Updates boundaries and adds RQ3/RQ4 content incorporating OGS canonical results |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Wire( | ||
| source=flow.source, | ||
| target=flow.target, | ||
| space=f"{flow.label} Flow", |
There was a problem hiding this comment.
Wire.space is being set to a derived string (e.g. "{flow.label} Flow") but no corresponding Space is registered on the GDSSpec. This makes spec.validate_spec() fail with “unregistered space …” errors (the validator treats any non-empty Wire.space as a reference). Either register actual Space objects for these names, or (likely for OGS) leave space empty and rely on the port names/labels for semantics instead.
| space=f"{flow.label} Flow", | |
| space="", |
| Wire( | ||
| source="Transform A", | ||
| target="Transform B", | ||
| space="Intermediate Flow", |
There was a problem hiding this comment.
This hand-built GDSSpec sets Wire.space="Intermediate Flow" but does not register a Space named "Intermediate Flow". As written, hand_spec.validate_spec() would fail due to an unregistered space reference. Either register a matching Space in the test, or set Wire.space to "" (and likewise ensure the DSL-compiled spec uses only registered space names).
| space="Intermediate Flow", | |
| space="", |
Summary
ControlModel→GDSSpec→SystemIR) with elements, model validation, compiler, verification checks, and 117 testscompile_pattern_to_spec()maps OGS patterns to GDSSpec, enablingh = f ∘ gcanonical projection for game-theoretic systems (67 tests)Canonical Spectrum Validated
Test plan
uv run --package gds-control pytest packages/gds-control/tests -v(117 tests)uv run --package gds-games pytest packages/gds-games/tests -v(229 tests, 67 canonical)uv run --package gds-stockflow pytest packages/gds-stockflow/tests -v(cross-domain + canonical stress)uv run --package gds-framework pytest packages/gds-framework/tests packages/gds-viz/tests packages/gds-games/tests packages/gds-stockflow/tests packages/gds-control/tests -v