deterministic declarations onlyDeclarative authoring restrictions
Keep Python files as a deterministic, reviewable description of the graph rather than a general application program.
When to use
Apply these rules to every project edited locally, by Codex, or inside the Designer browser workspace.
Behavior
- Use assignments, imports, typed factory calls, object references, and
>>or<<graph expressions. - Split declarations into modules for readability, but make every import contribute directly to construction of the same Project.
- The same source files must construct the same topology and canonical YAML on every execution.
- Business logic belongs in generated runtime implementation files, not in the architecture authoring project.
Use in authoring files properties
Small deterministic building blocks that round-trip cleanly.
Typed objectsrecommendedProject, services, pipelines, streams, connectors, endpoints, types, modules, packages, pools, and config objects.
Static importsrecommendedExplicit imports between files in the same modular project.
Object referencesrecommendedPass declared objects instead of string keys or numeric IDs.
Graph operatorsrecommendedUse >>, <<, from_sources, on_error, and typed call-semantic methods.
Keep out of the topology project properties
Code that makes the graph opaque, non-deterministic, unsafe, or impossible to reconstruct from YAML.
Loops and dynamic generationnot supportedEven repetitive declarations should remain explicit or be generated once and reviewed as explicit Python modules.
I/O and external statenot supportedFiles, environment, network, databases, subprocesses, clocks, and randomness must not influence the graph.
Business implementationwrong layerImplement generated Function contracts in the target runtime project.
Preferred explicit authoring
orders = service.pipeline("orders")
consume = orders.input("Consume Orders", endpoint=created, value_type=order)
validate = orders.map("Validate Order", function=validate_order, value_type=order)
publish = orders.sink("Publish Orders", endpoint=processed, value_type=order)
consume >> validate >> publish