/\ ATFGraph /docs
README Downloads
Examples / ATFGraph
Framework reference

This article is retained from the existing framework docs. Self-hosting commands and server-admin access differ from the managed CLI workflow. Start with Get started for the installed product.

Version routing

Directory examples/python/features/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

CapabilityKindSignatureModuleSummary
quotetraversal(route: str, adults: int = 1) -> dictexamples/python/features/version_routing/agent.py1.0.0: one price per passenger, bags included.
quotetraversal(route: str, adults: int = 1, bags: int = 0) -> dictexamples/python/features/version_routing/agent.py2.0.0: same name, new input field and a new ``baggage`` line.
seat_mapskill(route: str) -> dictexamples/python/features/version_routing/agent.py2.0.0 only: a capability that does not exist on 1.0.0.

Commands

Taken from this example's own README and module docstrings.

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.md
  • examples/python/features/version_routing/__init__.py
  • examples/python/features/version_routing/agent.py
  • examples/python/features/version_routing/agentnode.yaml
  • examples/python/features/version_routing/call.py

Note: More than one agent node is declared in this directory; capabilities are listed without a single label.

README

Rendered from examples/python/features/version_routing/README.md; the source file is not modified.

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.

VersionCapabilitiesDifference
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

CallResolves 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.

ATFGraph documentationHosted workflow · Framework reference