dizzy.generators.wiring¶
dizzy.generators.wiring
¶
Wiring generator — lib/
This is the last artifact that used to be copied out of the feature-file by hand.
The feat already declares, per element, exactly the argument list of its generated
context: a procedure's command: gives what it registers under, emits: the
emitter bindings, queries: the query bindings, environment:/telemetry:
the rest; a projection's event: gives the event->projection routing; a policy's
event:/emits: give its registration and its dispatch targets. Every line of
a hand-written wiring is that one template repeated, which makes it a pure function
of the feat — so it is generated, and cannot drift.
What is emitted is engine-mediated: emitters go to engine.emit_event and a
policy's dispatch to engine.dispatch_command, never to another element. The
engine then owns the ordering rule (projections fold and the read model commits
before policies dispatch) rather than each handler restating it.
WIRING_PACKAGE = 'wiring'
module-attribute
¶
Workspace member name, and the importable module (from wiring import ...).
feat_name(feat_file_name)
¶
recipes.feat.yaml -> recipes. The feature's name is its file's.
Source code in dizzy/src/dizzy/generators/wiring.py
528 529 530 | |
render_wiring(feat, feat_file='feature.feat.yaml')
¶
Render lib/
Source code in dizzy/src/dizzy/generators/wiring.py
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | |
render_wiring_pyproject_toml(feat)
¶
The wiring package manifest.
This is the one generated package that depends on DIZZY itself: the elements
import only their contracts, but the wiring imports dizzy.engine — it is
what binds them to a runtime.
The dizzy requirement is deliberately left un-sourced here. DIZZY is not
published to a package index, so it needs a source — but that belongs at the
workspace ROOT (see render_workspace_pyproject_toml), where it applies to
every member and can be pointed at a checkout or a git URL without rewriting
this file. Keeping it out means this manifest is the same wherever the lib is
shipped.
Source code in dizzy/src/dizzy/generators/wiring.py
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 | |
write_wiring_python_uv(feat, feat_file, output_dir)
¶
Write lib/python-uv/wiring/ — always overwritten, like every generated interface.
Source code in dizzy/src/dizzy/generators/wiring.py
606 607 608 609 610 611 612 613 614 615 | |