Skip to content

Delegation

Use localgauge delegate when an orchestrator needs a worker result it can parse without trusting the worker's final message.

./localgauge delegate \
  --repo /path/to/committed/repository \
  --ref HEAD \
  --task 'Fix the parser so malformed records are rejected.' \
  --allowed-path src/parser.py \
  --test-command 'python3 -m unittest' \
  --timeout-seconds 900

A local path uses committed HEAD unless --ref selects another commit. Caller working-tree edits are not copied. A Git URL must use public HTTPS and include --ref. --profile defaults to pi-local, and the model defaults to the standard Caveling server profile. Pass --module-cache /path/to/cache when an offline test command needs a caller-owned Go module cache.

The command prints one JSON object:

Field Meaning
status passed, failed, or error when the command could not run the task
files_changed Paths changed by the worker
diff Patch, binary-safe
diff_encoding utf-8, or base64 for a localgauge-diff-base64-v1: payload that keeps non-text bytes
worker_test_runs Test commands run by the worker and their results
independent_tests.passed Result of a fresh read-only sandbox rerun after files outside allowed paths are restored to the pre-worker baseline
scope.within_allowed_paths Whether every change stayed inside --allowed-path; scope.out_of_scope_paths lists exceptions
tool_errors, tokens Worker tool errors and token counts
wall_time_seconds Total wall time; worker_wall_time_seconds covers the worker alone

Apply a diff only when independent_tests.passed and scope.within_allowed_paths are both true. Real-task manifests still own hidden patches, mutant checks, structured reviews and recovery-event checks. A generic test command does not replace that stronger acceptance.

What an orchestrator can do with the result

An orchestrator can:

  1. select a committed repository ref;
  2. pass a task, optional plan, allowed paths, test command and timeout;
  3. consume status, files_changed, diff, worker_test_runs, tool_errors and tokens;
  4. trust independent_tests.passed only as the result of a fresh read-only rerun over trusted pre-worker inputs;
  5. require scope.within_allowed_paths before applying the diff;
  6. keep status: error distinct from a completed worker failure.

The command never publishes, merges, deploys or accepts an unbounded path scope.