docs

Reference

Config fields, CLI commands, the manifest contract, and the metrics the platform recognises — for looking up, not reading through.

Look things up here. For the exhaustive, every-field-annotated configs, read the two files in the CLI repo: trap.yaml and traptask.yaml.

CLI commands

CommandDoes
tp auth loginone-time browser OAuth → stores your CLI token (tp auth status / logout to inspect / clear)
tp runrun every case locally, judge, write .trap/<task>/<ts>/report.json
tp run --no-costsame, with cost tracking off
tp reportre-render a stored run without re-executing it
tp submitupload the latest report (provenance locates the task)
tp submit --run <ts>upload a specific stored run (-w picks the workspace)
--allow-unanchoredon run/submit: skip the confirmation for a checkout with no git provenance (dirty / no remote — lands as a local try-out, never ranks). Env: TRAP_ALLOW_UNANCHORED=1

Point the CLI at another server with TRAPSTREET_URL=https://…; in CI, skip the browser with TRAPSTREET_API_KEY (or tp auth login --with-token).

trap.yaml — solution config

FieldReqMeaning
cmdshell command that runs your solution
profile.model / .frameworkself-reported engine identity (scalar or list) → run page
stdininput filename piped to your solution's stdin
setup_cmdrun once after clone (e.g. uv sync)
nameleaderboard identity (else the server auto-assigns one)
timeoutper-case ceiling, seconds (default 600)
tasks.<alias>.sourcethe task: a local path or git+https://…@rev

<alias> should equal the task's id on trapstreet so tp submit resolves with no flag. Cost tracking is a CLI flag, not a yaml field.

traptask.yaml — task config

FieldReqMeaning
namehuman-readable task title
dirs.inputs / .expectedfixture dirs (default inputs/ / expected/)
cases[].idone per inputs/<id>/ directory
cases[].tags / .skip / .descriptionfilter / skip / annotate a case
judge.cmdscores one case; omit to leave cases unscored
grader.cmdaggregates to a run summary; omit → server averages at ≥ 0.8
declared_outputsadvisory list of output filenames / stdout

The manifest your code reads

ConsumerEnv varJSON
solutionTRAP_MANIFEST{inputs_dir, outputs_dir}
judgeTRAPTASK_MANIFEST{inputs_dir, expected_dir, outputs_dir, run:{stdout,stderr,meta}}
graderTRAPTASK_MANIFESTlist of per-case results

All values are absolute paths — directories, or files for run.*. Join a directory with the filename you authored.

Metrics dictionary

Whatever judge.py / grader.py print becomes cases.metrics and the run's grader output. The platform interprets exactly one key:

KeyFromEffect
scorejudge + grader0–1. The grader's is the run score (fallback: mean of case scores); a case counts as passed at 1.0
agent_answer / expected / reasonjudgerendered in the per-case view

Everything else is stored and shown verbatim on the run page — there is no run-level passed and correct is not interpreted. Cost and latency are not grader keys: the CLI records per-case spend (cost.by_model) and run timestamps in the report, and the server derives the leaderboard columns from those.

Repos

  • trap-cli on PyPI — the tp command
  • trapstreet — the single repo: this website + the CLI (cli/, with the annotated examples above)