Skip to content

library: build a machine from a native mapping#57

Merged
fruwe merged 2 commits into
mainfrom
ws/programmatic-construction
Jul 7, 2026
Merged

library: build a machine from a native mapping#57
fruwe merged 2 commits into
mainfrom
ws/programmatic-construction

Conversation

@fruwe

@fruwe fruwe commented Jul 6, 2026

Copy link
Copy Markdown
Member

load_definitions / load_definition now accept a native mapping (dict) or a sequence of mappings, in addition to YAML text. Each document runs through the same validate() path, so a machine built in code is held to the same contract as one loaded from a YAML file — hosts no longer need to serialize to YAML to construct a machine programmatically.

Workstream 3. Adds unit tests (test_library_api.py: build from dict, singular, multi-doc list, validation rejection) and a 'build a machine in code' README snippet. Pairs with spec #47 (the §2 SHOULD note).

Gate: ruff + mypy + 154 unit tests + 67 conformance cases all green.

fruwe added 2 commits July 7, 2026 02:26
load_definitions / load_definition now accept a native mapping (dict) or a
sequence of mappings, in addition to YAML text. Each document runs through the
same validate() path, so a machine built in code is held to the same contract
as one loaded from a YAML file — hosts no longer need to serialize to YAML to
construct a machine programmatically.

Adds unit tests (test_library_api.py) and a 'build a machine in code' snippet
to the README.
@fruwe
fruwe merged commit 2dfa48e into main Jul 7, 2026
2 checks passed
@fruwe
fruwe deleted the ws/programmatic-construction branch July 7, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant