/\ 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.

Harness as a traversal

Directory examples/harness

This example delegates harness-example.answer to a local atfHar process through app.harness(provider="atf-harness"). It returns the text, usage, price and session ID the CLI supplies, while the graph server stores the traversal and progress. A provider error fails the traverser with the harness message; no fixture answer is substituted.

Agent node label remote-coder, version 0.1.0.

Capabilities

CapabilityKindSignatureModuleSummary
answertraversal(prompt: str, model: Optional[str] = None, cwd: Optional[str] = None, variant: Optional[str] = None, provider: Optional[str] = None, timeout: float = DEFAULT_TIMEOUT_SECONDS) -> dictexamples/harness/python/agent.pyRun one prompt through the harness with no tools and return what it reported.
doctorskill() -> dictexamples/harness/python/agent.pyWhich harness CLIs are available on this worker (nothing is executed).
continuetraversal(task: str, timeout: Optional[float] = None) -> dictexamples/harness/remote/agent.pyA follow-up in the same harness session (same ATFGraph session id required).
doctorskill() -> dictexamples/harness/remote/agent.pyReachability, readiness and profile availability of the configured harness. No turn is started.
implementtraversal(task: str, timeout: Optional[float] = None) -> dictexamples/harness/remote/agent.pyRun ``task`` in the operator's workspace. One attempt: coding work has side effects.

Non-default capability options: answer: max_attempts=1, timeout_seconds=180; continue: max_attempts=1, timeout_seconds=1800; implement: max_attempts=1, timeout_seconds=1800

Commands

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

atfg traverse remote-coder.continue  --in '{"task": "Now add a test"}' --session <id>
atfg traverse remote-coder.doctor --in '{}'
atfg traverse remote-coder.implement --in '{"task": "Fix the failing parser tests"}' --new-session
python -m atfgraph.worker --module examples.harness.python.agent:app
python -m atfgraph.worker --module examples.harness.remote.agent:app
python -m examples.harness.python.call "Reply with the word ready."
python -m examples.harness.python.call --doctor
python -m examples.harness.remote.call "Fix the failing parser tests and explain the change"
python -m examples.harness.remote.call "Fix the failing parser tests"       # new ATFGraph session → new harness session
python -m examples.harness.remote.call --doctor
python -m examples.harness.remote.call --session <id> "Now add a test"      # follow-up in the same harness session

Files

  • examples/harness/README.md
  • examples/harness/__init__.py
  • examples/harness/python/__init__.py
  • examples/harness/python/agent.py
  • examples/harness/python/agentnode.yaml
  • examples/harness/python/call.py
  • examples/harness/python/requirements.txt
  • examples/harness/remote/__init__.py
  • examples/harness/remote/agent.py
  • examples/harness/remote/agentnode.yaml
  • examples/harness/remote/call.py
  • examples/harness/remote/requirements.txt

README

Rendered from examples/harness/README.md; the source file is not modified.

This example delegates harness-example.answer to a local atfHar process through app.harness(provider="atf-harness"). It returns the text, usage, price and session ID the CLI supplies, while the graph server stores the traversal and progress. A provider error fails the traverser with the harness message; no fixture answer is substituted.

CapabilityKindWhat it does
answertraversalone prompt, no tools, one attempt, 120 s harness timeout
doctorskillwhich harness CLIs are installed on the worker host (none is executed)

Prerequisites

Use Python 3.10+, the installed SDK, a running graph server, and atfHar on the worker's PATH. Configure its model and credentials in ~/.atf-harness/agent/config.yml and models.yml. The example does not edit those files or log into providers.

Run

atfHar --version
export ATFGRAPH_HARNESS_MODEL='your-provider/your-model'
export ATFGRAPH_HARNESS_WORKDIR="$PWD"
# Export the provider credentials your harness model needs into this shell:
# the worker process is what runs atfHar.
target/debug/atfgraphd
python -m atfgraph.worker --module examples.harness.python.agent:app
# Another terminal:
python -m examples.harness.python.call --doctor
python -m examples.harness.python.call "Reply with the word ready."

The server defaults to http://127.0.0.1:18880. Input options can override model, cwd, variant, provider and timeout; environment values supply defaults. cwd selects a working directory, not a sandbox. Set ATFGRAPH_HARNESS_THINKING only to override a configured variant. Other supported providers can be selected through ATFGRAPH_HARNESS_PROVIDER or --provider; their tool controls differ.

Missing or expired credentials appear as a failed traverser, including the provider's reported authentication error. doctor checks executable availability only; it does not verify model access.

Package or install

target/debug/atfg install examples/harness/python --python python3 --sdk python
target/debug/atfg run harness-example

The package manifest asks for ATFGRAPH_HARNESS_MODEL and ATFGRAPH_HARNESS_WORKDIR. Provider credentials remain in the operator's harness configuration rather than being packaged with the node.

Differences from the original

  • The node is an outbound worker with no inbound agent port.
  • max_attempts=1 places retry control on the registered capability.
  • atfHar print mode runs one turn; Claude Code supports an explicit max_turns option if selected instead.
  • Invocation errors raise HarnessFailure, reported in the traverser error.
  • Streamed harness JSON events become progress events within the traversal, not independent graph steps. Local harness usage needs explicit recording when it should appear in shared usage totals.

The migrated-operations tests use a fixture atfHar executable with a real local daemon. They verify adapter behavior without contacting a model provider.

Remote harness (remote/)

The remote-coder node uses the same harness call with RemoteHarness transport and an existing workspace on another host. The remote service executes the task while ATFGraph records orchestration, approval pauses and reported usage. The worker needs no local coding CLI.

CapabilityKindWhat it does
implementtraversalone task in the operator's workspace, one attempt
continuetraversala follow-up in the same harness session (same ATFGraph session id)
doctorskillreachability, readiness and profile availability of the harness; no turn

Set ATFGRAPH_HARNESS_URL, ATFGRAPH_HARNESS_PROFILE and ATFGRAPH_HARNESS_WORKSPACE, plus edge authentication/token settings when required. Start examples.harness.remote.agent:app with the worker, then call examples.harness.remote.call. The workspace must already exist on the remote host; this example does not clone repositories or return patches. See the remote harness guide.

ATFGraph documentationHosted workflow · Framework reference