mission-agent (Unattended Agent Runs Scored Against Data the Agent Cannot See)
Role: Solo, end-to-end: spec, service, scorer, worker image, mission pack, and the person who labels the truth.
Tech Stack: Python 3.12, MCP (mcp 2.3.0), Claude Code in headless mode, Docker, NumPy, SciPy, pandas, laspy, PyYAML, pytest, CloudCompare for watching.
Repository: Private. Demo available on request
Overview
If an agent is going to work unattended and tell me a number went up, the number has to come from something the agent could not have touched. mission-agent is my attempt to build that as a service. A mission is a goal, some data and a contract. The agent proposes methods and runs them; the service scores them, decides what counts as an improvement, and stops the run when the budget is spent. The scorer, the held-out blocks and the gold labels live where the agent has no path to them.
The first mission comes from TALON: find individual tree trunks in leaf-off airborne lidar over Buncombe County, starting from TALONâs two existing stem detectors as baselines. The core knows nothing about lidar. Its domain/ and application/ layers are barred from importing GIS libraries by a test that walks the syntax tree of every source file, and everything about trunks sits in a mission pack.
Where it stands, from docs/resume.md at commit 468b4c1 (2026-10-19): the trunk mission is built end to end, the full suite passed with 2,032 tests that day, and there has been one agent run, a 17-minute smoke test on a single labelled block. The project is paused until I hand-label enough blocks for a real run. The repo is 76 commits on three active days between 2026-10-14 and 2026-10-19 (2, 37 and 37 by Eastern date), about 6,200 lines of Python and about 14,600 lines of tests (raw line counts, 2026-11-22). Its README still describes the plan from before anything was built, so the resume note and the code are what this page follows. One thing has moved since that note: it lists the TALON side (the two detectors packaged as a wheel, plus a blind block export) as an unmerged draft, and that pull request was merged into TALONâs develop branch on 2026-10-20. It had not reached TALONâs main when I checked on 2026-11-22.
How It Is Put Together
graph TD
R[Runner: one headless agent session at a time] --> A[Agent: mission tools only]
A --> M[Mission MCP server, stateless]
M --> S[Mission service: contract, ledger, budget, lock]
S --> W[Worker container: no network, read-only mounts]
S --> C[Scorer: separate process]
C --> S
W --> S
S --> L[Run folder: methods, dev layers, ledger, handoff]
C -.reads.-> X[Sealed root: held-out points and truth]
- Two roots per mission. The run folder is what the agentâs work can reach: the contract, the ledger, the methods (a Git repo), development blocks and their labels. The sealed root holds held-out points, held-out truth and held-out predictions, and it is deliberately not under the run folder. The mount builder refuses any job whose paths overlap the sealed root, checking both the raw and the resolved spelling so a junction or symlink does not get around it.
- The agent has no shell. Sessions run Claude Code headless with every built-in tool disabled and only the mission server allowed. The core prompt says it plainly: âYou have no shell, no file access and no web access; everything you can do is a mission tool call.â There are 19 tools: read, write and test a method, run it on development blocks, score, compare, promote, request a held-out score, write notes and a handoff.
- Methods run in a locked container. Each job is one
docker runwith--network none, a read-only root filesystem, all capabilities dropped, a process limit and a timeout that lives on a container label, so a restarted service still enforces it. The image holds a small harness and TALONâs detectors as a wheel. It does not contain the service or the scorer. - The scorer is another process. The service launches it as a subprocess and never imports it. Development scoring returns per-block counts. Held-out scoring returns only aggregates rounded to two decimals, an interval and a verdict.
- The service writes the record. Every tool call lands in an append-only ledger written by the service. The agent can add notes but has no tool that writes a structural entry.
Engineering Details
1. The First Review Found the Central Claim Was False
I had the spec reviewed on 2026-10-14, before any service code existed. The review came back with 5 blockers, 24 major and 19 minor findings, and the first blocker was the whole point of the project: as written, the scorer and the held-out labels were not hidden from the agent. Labels sat next to the methods folder, and the scorer was a module inside the same worker that ran the agentâs code, so any method could simply open the answers. The second blocker was that a headless coding agent keeps its own shell and edit tools unless you take them away, which made âthe mission server is the agentâs only doorâ untrue.
The decisions I adopted on 2026-10-18 are the architecture above: two roots, the scorer as its own process, a network-less container, and an agent backend with an empty tool list. It was cheaper to be told this by a review than by a leaderboard that looked too good.
2. What Counts as Better
One labelled block is noisy, and a method can look better by luck. So promotion is a paired block bootstrap: resample the development blocks with replacement 2,000 times, pool true positives, false positives and misses across each resample, and compute the F1 difference between challenger and champion. The challenger is promoted only when the 20th percentile of that difference is above zero and the point gain is at least 0.01 F1. Pooling the counts before computing F1 means a block where a method finds nothing still counts against it.
The held-out gate is stricter: 5,000 resamples and a two-sided 95% interval whose lower bound must be above zero. Held-out can be scored at most five times per contract version, and only through one gated call, so it cannot become a tuning target by repeated peeking. The service also refuses to freeze a contract with fewer than 5 labelled development blocks, or to score held-out with fewer than 6.
If I correct a label, that starts a new truth version. Runs scored on the old truth stop being compared, and the old champion is retired. Corrections are refused outright once a held-out score exists.
3. Zero Tools, Still âSucceededâ
The first agent run was on 2026-10-19, a scratch mission on the one labelled block, capped at two sessions. A scratch mission has no sealed root and refuses to promote anything, so it can only test the loop. It found three bugs, each fixed with a regression test:
- Sessions with nothing to do passed. The mission server failed to import from the agentâs working directory, so the first two sessions started with zero tools and still exited as successes. The runner now puts the server on the path explicitly and stops with
runner_failedwhen the server does not connect. - The wrong account paid. An API key set in the environment outranked the subscription login, so those sessions were billed to the API. Sessions now start with credentials and auth overrides stripped from their environment, and with my global instruction files and auto memory switched off, so my own habits do not leak into a mission either. A canary test checks all of it and is meant to be rerun after an agent upgrade.
- A scratch mission was refused because its sealed folder did not exist, which is the definition of a scratch mission.
With those fixed, the run took 17 minutes: 91 tool calls, 31 worker jobs and 5 scored runs. The agent wrote its own detector, a line-fit method with a test, and pooled F1 on the block went from 0.346 (the better baseline) to 0.634. My own notes call that what it is: with one block it is overfitting to that block, not a result. What the run showed is that the loop works. The ledger validated, and the sealed folder was never created.
Current State and Limits
- No real mission has run. One block is labelled (37 stems). The real mission needs 5 labelled development blocks and 6 labelled blind blocks, and the blind ones have to be labelled without looking at any detectorâs output.
- The baselines are a smoke test too. On that one block, with no agent, the occupancy detector scored F1 0.260 (16 true positives, 87 false positives, 4 misses) and the slab-linking detector 0.346 (9, 23, 11) on 2026-10-19. A block bootstrap needs more than one block, so there is no interval and no ranking.
- Budgets are placeholders. 2 hours of wall time, 20 iterations and a plateau stop after 8 are first-run guesses, as are the containerâs 4 CPUs and 8 GB. The 2 m match radius is TALONâs scorer default and is marked for revisiting.
- Parts of the spec are not built. The agent works from numbers only. Rendering its errors as images for a vision model to review, the second mission (unmapped roads) and a third in a different domain are in the spec and not in the code.
- Known loose ends. The exported blocks compute height above ground from a different terrain model than the earlier TALON run (10.2% of points differ by more than 1 cm, at most 0.56 m), and the worker base image is pinned by version but not by digest.
Code Snippet: The Promotion Rule
The whole decision is a few lines over the bootstrap differences, and it returns its reason so the ledger can say why a run was or was not promoted.
def promotion_decision(
cand: Mapping[str, Counts],
champ: Mapping[str, Counts],
*,
n_boot: int = 2000,
quantile: float = 0.20,
min_gain: float = 0.01,
seed: int = 0,
) -> Decision:
"""Accept when the `quantile` percentile of paired diffs is > 0 and the
point gain (pooled F1 on the full unit set) is >= min_gain."""
if not 0.0 < quantile < 0.5:
raise ValueError(f"quantile must be in (0, 0.5), got {quantile}")
diffs = paired_diffs(cand, champ, n_boot, seed)
lo, hi = np.percentile(diffs, [quantile * 100.0, (1.0 - quantile) * 100.0])
point = pooled_f1(cand.values()) - pooled_f1(champ.values())
lo, hi = float(lo), float(hi)
if not lo > 0:
accept, reason = False, f"lower {quantile:.2f} quantile {lo:.4f} is not > 0"
elif point < min_gain:
accept, reason = False, f"point gain {point:.4f} is below min_gain {min_gain}"
else:
accept, reason = True, f"lower quantile {lo:.4f} > 0 and gain {point:.4f} >= min_gain {min_gain}"
return Decision(accept, point, lo, hi, len(cand), reason)
The bootstrap seed is fixed, so a score or a decision can be reproduced exactly from the ledger.
CLI Interface
The mission command is for me, not the agent. Subcommands, from the argparse definitions:
initcreates a run folder from a pack and freezes the contractbaselinescores the seed methods on the development blocks with no agentrunruns agent sessions until the mission stops (--model,--max-sessions)statusandvalidateprint the mission state and check the ledgerviewopens one unit of a scored run in CloudComparecorrectionslists pending label corrections and accepts one as a new truth versionheldoutcollects a pending held-out result after a stopabortasks a mission to stop before its next session
Features
- Scorer, held-out data and promotion decisions outside the agentâs reach, enforced by process, container and mount boundaries, not by instructions
- Paired block-bootstrap promotion and a capped, gated held-out score
- One agent session per context: after 10 development scores the service makes the session write a handoff and the runner starts a fresh one
- Append-only ledger with a validator, a mission lock with heartbeat and stale takeover, and seed retries capped at three attempts
- Truth versions, so corrected labels never mix with scores made on the old ones
- A generic core with one mission pack; the pack supplies the data layout, the seed methods and the agent brief
Testing
The resume note records 2,032 tests passing on 2026-10-19 and puts a full run at about 17 minutes. A grep on 2026-11-22 at 468b4c1 counts 1,103 def test_ functions in 46 files, with 163 parametrize uses accounting for at least part of the gap; I did not rerun the suite for this page. Tests that need Docker, a logged-in agent CLI or the CloudCompare GUI are marked and deselected by default. The Docker isolation tests, run on 2026-10-18 per the runbook, confirmed that an unmounted file is not visible, an outbound request is blocked, a write to a read-only mount is refused, and neither the scorer nor the service can be imported inside the image. An end-to-end test drives a whole mission with a scripted stand-in for the agent.
Tech Stack
- Service: Python 3.12, hexagonal layout (domain, application, ports, adapters), all state in files in the run folder
- Agent interface: MCP server (
mcp2.3.0), Claude Code headless as the first backend - Worker: Docker,
python:3.12.14-slim-bookworm, CPU only, TALON detectors installed as a wheel - Statistics: NumPy block bootstrap; SciPy and pandas in the trunk scorer
- Point clouds: laspy with LAZ support; CloudCompare for viewing and for label corrections
- Testing: pytest with markers for Docker, agent and GUI tests