Version routing
Serve versions 1.0.0 and 2.0.0 of fares with separate workers, then compare default and pinned routing. Prices are fixtures; no supplier or provider key is needed.
Capabilities
| Capability | Kind | Signature | Module | Summary |
|---|---|---|---|---|
quote | traversal | (route: str, adults: int = 1) -> dict | examples/python/features/version_routing/agent.py | 1.0.0: one price per passenger, bags included. |
quote | traversal | (route: str, adults: int = 1, bags: int = 0) -> dict | examples/python/features/version_routing/agent.py | 2.0.0: same name, new input field and a new ``baggage`` line. |
seat_map | skill | (route: str) -> dict | examples/python/features/version_routing/agent.py | 2.0.0 only: a capability that does not exist on 1.0.0. |
Commands
python -m atfgraph.worker --module examples.python.features.version_routing.agent:v1
python -m atfgraph.worker --module examples.python.features.version_routing.agent:v2
python -m examples.python.features.version_routing.call
python -m examples.python.features.version_routing.call --route BNE-SYD --bags 1
python -m examples.python.features.version_routing.call --route MEL-OOL --bags 2
Files
examples/python/features/version_routing/README.mdexamples/python/features/version_routing/__init__.pyexamples/python/features/version_routing/agent.pyexamples/python/features/version_routing/agentnode.yamlexamples/python/features/version_routing/call.py
README
Serve versions 1.0.0 and 2.0.0 of fares with separate workers, then compare default and pinned routing. Prices are fixtures; no supplier or provider key is needed.
| Version | Capabilities | Difference |
|---|---|---|
1.0.0 (agent:v1) | quote(route, adults) | bags are bundled into the fare |
2.0.0 (agent:v2) | quote(route, adults, bags), seat_map(route) | baggage is a separate line; new capability |
target/debug/atfgraphd
python -m atfgraph.worker --module examples.python.features.version_routing.agent:v1
python -m atfgraph.worker --module examples.python.features.version_routing.agent:v2
python -m examples.python.features.version_routing.call --route BNE-SYD --bags 1
Run both workers. Each enrolls for one exact label/version pair, so work pinned to 1.0.0 waits until its worker is available even if the 2.0.0 worker is healthy.
The rule
| Call | Resolves to |
|---|---|
submit("fares.quote", ...) | the highest registered version — 2.0.0 once it exists |
submit("fares.quote", ..., version="1.0.0") | exactly 1.0.0, its schemas and its workers |
submit("fares.seat_map", ..., version="1.0.0") | 404 capability_not_found |
submit("fares.quote", ..., version="9.9.9") | 404 agent_not_found |
Read the default definition with client.capabilities("fares"), or request a specific version. Each traverser records its resolved version, allowing path inspection to show which definition executed each step.
Version pinning selects the corresponding schema and handler as well as the worker. The driver intentionally passes the newer bags parameter to 1.0.0 and receives invalid_input. To change a registered definition, register another version; existing versions are immutable.
The install manifest selects agent:v2, version 2.0.0. Run agent:v1 separately from the same source when testing the older version.
The extended-feature suite serves both versions against a real local daemon and checks the routing outcomes in the table.