CLI and JSON Contract
Documentation source v0.5.0-rc.1. Published releases
Generated from the Cobra command tree. Do not edit manually.
Source version: 0.5.0-rc.1.
loopexec
loopexec - deterministic runtime for loop engineering
Usage: loopexec [flags]
--help, -h(bool, defaultfalse): help for loopexec--json(bool, defaultfalse): Emit machine-readable JSON output--version, -v(bool, defaultfalse): version for loopexec
loopexec ack
Clear comprehension debt and any paged escalation (records the reviewer)
Usage: loopexec ack [flags]
--help, -h(bool, defaultfalse): help for ack--json(bool, defaultfalse): Emit machine-readable JSON output--reviewer(string, default “): Reviewer identity recorded in the ack (required)--workdir(string, default “): Directory containing .loopexec/state.json (default: current directory)
loopexec attest
Sign the receipt (HMAC) so provenance is verifiable; —verify to check a signature
Usage: loopexec attest [flags]
--help, -h(bool, defaultfalse): help for attest--json(bool, defaultfalse): Emit machine-readable JSON output--key(string, default “): Attestation key (else $LOOPEXEC_ATTEST_KEY, else a dev default)--run-id(string, default “): Attest a specific recorded run by id (default: the latest run)--verify(bool, defaultfalse): Verify the stored signature instead of creating one--workdir(string, default “): Directory containing .loopexec (default: current directory)
loopexec budget
Shared call budgets across independent run IDs
Usage: loopexec budget [flags]
--help, -h(bool, defaultfalse): help for budget--json(bool, defaultfalse): Emit machine-readable JSON output--policy(string, default “): Pinned scoped budget policy JSON--store-dir(string, default “): Existing absolute directory shared by all runs in this budget scope
loopexec budget reserve
Consume one model-call slot before launching a child
Usage: loopexec budget reserve [flags]
--call-id(string, default “): Unique identity for this logical call; duplicates fail closed--help, -h(bool, defaultfalse): help for reserve--json(bool, defaultfalse): Emit machine-readable JSON output--phase(string, default “): Budget phase, such as builder or critic--policy(string, default “): Pinned scoped budget policy JSON--store-dir(string, default “): Existing absolute directory shared by all runs in this budget scope
loopexec budget status
Read remaining scoped model-call allowance
Usage: loopexec budget status [flags]
--help, -h(bool, defaultfalse): help for status--json(bool, defaultfalse): Emit machine-readable JSON output--policy(string, default “): Pinned scoped budget policy JSON--store-dir(string, default “): Existing absolute directory shared by all runs in this budget scope
loopexec build-context
Assemble a narrow, budgeted context slice (state + failure + relevant files)
Usage: loopexec build-context [flags]
--budget-tokens(int, default8000): Context token ceiling (code-calibrated ~3.3 chars/token)--diff-base(string, defaultHEAD): Git ref for the last-diff relevance signal--failure(string, default “): Failure / stack-trace source: a file path, ’-’ for stdin, or inline text--help, -h(bool, defaultfalse): help for build-context--json(bool, defaultfalse): Emit machine-readable JSON output--out(string, default “): Output path within —workdir (default:/.loopexec/context.md) --strategy(string, defaultstacktrace_last_diff): Relevance strategy (import_closure / dep_graph are Planned)--workdir(string, default “): Directory to resolve files against (default: current directory)
loopexec check
Validate loop invariants (state hygiene, not the application oracle)
Usage: loopexec check [flags]
--fail-invariant(bool, defaultfalse): Force invariant failure--help, -h(bool, defaultfalse): help for check--json(bool, defaultfalse): Emit machine-readable JSON output
loopexec demo
Prove execute -> external check -> receipt -> replay without credentials
Usage: loopexec demo [flags]
--help, -h(bool, defaultfalse): help for demo--json(bool, defaultfalse): Emit machine-readable JSON output--workdir(string, default “): Fresh directory for durable demo artifacts (default: create and retain a temporary directory)
loopexec doctor
Gate loop preconditions: determinism + isolation preflight + adequacy canary (—mutate-cmd)
Usage: loopexec doctor [flags]
--bind-model-home(bool, defaultfalse): Declare a $HOME/.model-home credential bind-mount (fails the isolation preflight)--check(string, default “): External check command to validate--exec-network(string, default “): Declared exec-zone network policy; must be ‘none’ (SPEC section 7)--help, -h(bool, defaultfalse): help for doctor--json(bool, defaultfalse): Emit machine-readable JSON output--max-flake-rate(float64, default0): Target max flake rate to certify--mutate-cmd(string, default “): Operator command that plants a mutation in the changed code; the —check MUST then turn red, else check_inadequate (SPEC O4)--runs(int, default0): Determinism probe runs (default: derived, else 10)--workdir(string, default “): Directory to run the check in (default: current directory)
loopexec escalate
Emit a structured escalation packet and mark the run paged (cleared by ack)
Usage: loopexec escalate [flags]
--channel(string, defaultfile): Escalation channel: file | stdout (github/slack are Planned)--help, -h(bool, defaultfalse): help for escalate--json(bool, defaultfalse): Emit machine-readable JSON output--workdir(string, default “): Directory containing .loopexec/state.json (default: current directory)
loopexec explain-halt
Explain why the recorded run halted (raise-the-limit vs do-not-retry)
Usage: loopexec explain-halt [flags]
--help, -h(bool, defaultfalse): help for explain-halt--json(bool, defaultfalse): Emit machine-readable JSON output--run-id(string, default “): Explain a specific recorded run by id (default: the latest run)--workdir(string, default “): Directory containing .loopexec (default: current directory)
loopexec init
Initialize loopexec workspace metadata
Usage: loopexec init [flags]
--help, -h(bool, defaultfalse): help for init--json(bool, defaultfalse): Emit machine-readable JSON output
loopexec inspect-cost
Analyze a per-iteration cost ledger against a budget cap and a sigma anomaly bound
Usage: loopexec inspect-cost [flags]
--budget-usd(float64, default0): Run-total hard cap in USD (0 = no cap); over it halts budget_exceeded (18)--cost(stringArray, default[]): Per-iteration USD cost (repeatable); an alternative to —ledger--help, -h(bool, defaultfalse): help for inspect-cost--json(bool, defaultfalse): Emit machine-readable JSON output--ledger(string, default “): File of per-iteration USD costs, one per line (the cost ledger)--sigma(float64, default3): Anomaly threshold in standard deviations above the rolling mean (cost_anomaly, 18)
loopexec isolate
Two-zone isolation: detached clone + per-run minted key + exec/agent zone launch plan
Usage: loopexec isolate [flags]
--agent-image(string, defaultloopexec/agent): Agent-zone container image--agent-network(string, defaultloopexec-agent-net): Agent-zone network (operator-provisioned internal net; egress via the proxy)--branch(string, default “): Branch to check out (default: the repo default)--check(string, default “): Check command to run in the exec zone--confirm(bool, defaultfalse): Confirm launching containers (required with —execute)--egress-allow(stringArray, default[]): Allowed egress host:port (default api.model.example:443); RECORDED in the receipt, enforced by the operator’s allowlist proxy--egress-proxy(string, defaulthttp://egress-proxy:8080): Auditing forward proxy the agent zone routes through--exec(string, default “): Agent/work command to run in the agent zone--exec-image(string, defaultloopexec/exec): Exec-zone container image--execute(bool, defaultfalse): Launch the zones (default: render the plan only)--help, -h(bool, defaultfalse): help for isolate--json(bool, defaultfalse): Emit machine-readable JSON output--key-env(string, defaultMODEL_API_KEY): Env var the minted credential is injected as--mint-cmd(string, default “): Operator hook that prints a per-run scoped, spend-capped key to stdout (requires —revoke-cmd)--repo(string, default “): Repository to clone into the sandbox (default: —workdir)--revoke-cmd(string, default “): Operator hook that revokes the key (receives it via the key-env env var)--run-id(string, default “): Run identifier (slug)--runtime(string, defaultdocker): Container runtime used to launch the zones--workdir(string, default “): Directory holding .loopexec (default: current directory)
loopexec models
Inspect configured task-to-model assignments without invoking models
Usage: loopexec models [flags]
--help, -h(bool, defaultfalse): help for models--json(bool, defaultfalse): Emit machine-readable JSON output
loopexec models plan
Explain the selected workflow task, role profiles and dispatch assurance; spends nothing
Usage: loopexec models plan [flags]
--help, -h(bool, defaultfalse): help for plan--json(bool, defaultfalse): Emit machine-readable JSON output--workdir(string, default.): Directory used to resolve the workflow path--workflow(string, default “): Workflow JSON containing model_policy (required)
loopexec probe-check
Measure check determinism as a confidence bound (no check, no loop)
Usage: loopexec probe-check [flags]
--check(string, default “): External check command to probe (required)--help, -h(bool, defaultfalse): help for probe-check--json(bool, defaultfalse): Emit machine-readable JSON output--max-flake-rate(float64, default0): Target max flake rate to certify (derives runs via rule of three)--runs(int, default0): Number of probe runs (default: derived from —max-flake-rate, else 10)--workdir(string, default “): Directory to run the check in (default: current directory)
loopexec reexecute
Live re-run of the recorded loop config N times; reports a statistical match (—confirm)
Usage: loopexec reexecute [flags]
--confirm(bool, defaultfalse): Confirm the budget-burning live re-run--help, -h(bool, defaultfalse): help for reexecute--json(bool, defaultfalse): Emit machine-readable JSON output--samples(int, default3): Number of live re-run samples--workdir(string, default “): Directory containing .loopexec/state.json (default: current directory)
loopexec replay
VERIFY a recorded receipt: re-run the check and confirm the fingerprint (agent-free)
Usage: loopexec replay [flags]
--help, -h(bool, defaultfalse): help for replay--json(bool, defaultfalse): Emit machine-readable JSON output--run-id(string, default “): Verify a specific recorded run by id (default: the latest run)--workdir(string, default “): Directory containing .loopexec (default: current directory)
loopexec report
Render a recorded receipt (state + JSONL event log); re-runs nothing
Usage: loopexec report [flags]
--help, -h(bool, defaultfalse): help for report--json(bool, defaultfalse): Emit machine-readable JSON output--run-id(string, default “): Report a specific recorded run by id (default: the latest run)--workdir(string, default “): Directory containing .loopexec (default: current directory)
loopexec run
Run a bounded check_fixpoint loop until the check passes or a bound trips
Usage: loopexec run [flags]
--budget-usd(float64, default0): Run-total USD allowance; requires workflow strict or observed metering--check(string, default “): External check command; exit 0 means converged (required)--command-timeout(duration, default0s): Deadline for every command and collector (0 = disabled)--comprehension-every(int, default0): Halt comprehension_debt_exceeded after N iterations without aloopexec ack(0 = off)--context-file(stringArray, default[]): File to include in the receipt context manifest (path + sha256); repeatable--cost-usd(float64, default0): Legacy recorded cost metadata; workflow actuals are metered separately--exec(string, default “): Work command run each iteration before the check (e.g. an agent invocation)--failures-cmd(string, default “): Command printing current open failures (one identity per line); enables set-based progress and the no-regression ratchet--help, -h(bool, defaultfalse): help for run--integrity-cmd(string, default “): Command printing the test-determining surface (one identity per line); its t0 set MUST NOT lose a member (metric-integrity gate)--json(bool, defaultfalse): Emit machine-readable JSON output--max-iterations(int, default10): Maximum iterations (fuse)--max-tokens(int, default0): Recorded sampling max_tokens--model-id(string, default “): Record the model id in the receipt (records only; the call lives in —exec); enables the model/sampling pin--model-provider(string, default “): Record the model provider in the receipt (records only; does NOT select the model - —exec does)--model-version(string, default “): Record the model version/build in the receipt--no-progress-k(int, default3): Halt no_progress_detected after K iterations with no new best failing-set size--once(bool, defaultfalse): Run exactly one iteration (debug single-step); overrides —max-iterations--resume(bool, defaultfalse): Resume a workflow run with identical policy and cumulative bounds--run-id(string, default “): Run identifier--seed(int, default0): Recorded sampling seed--temperature(float64, default0): Recorded sampling temperature--terminate-grace(duration, default250ms): Grace between process-group TERM and KILL--timeout(duration, default0s): Total run deadline (0 = disabled)--workdir(string, default “): Directory to run commands in (default: current directory)--workflow(string, default “): Pinned workflow JSON (argv hooks, metering, candidates, numeric policy, optional model assignments)
loopexec status
Show loop status
Usage: loopexec status [flags]
--halt-reason(string, default “): Current halt reason--help, -h(bool, defaultfalse): help for status--iteration(int, default0): Current iteration--json(bool, defaultfalse): Emit machine-readable JSON output--run-id(string, default “): Run identifier
loopexec step
Execute a single loop step
Usage: loopexec step [flags]
--help, -h(bool, defaultfalse): help for step--json(bool, defaultfalse): Emit machine-readable JSON output
loopexec version
Print the CLI identity
Usage: loopexec version [flags]
--help, -h(bool, defaultfalse): help for version--json(bool, defaultfalse): Emit machine-readable JSON output
loopexec watch
Read the heartbeat and report alive vs heartbeat_stale
Usage: loopexec watch [flags]
--help, -h(bool, defaultfalse): help for watch--json(bool, defaultfalse): Emit machine-readable JSON output--stall-timeout(int, default600): Seconds before the heartbeat is considered stale--workdir(string, default “): Directory containing .loopexec/heartbeat (default: current directory)
JSON field contract
Types and JSON tags are generated from the runtime structs. Value semantics and exit behavior are described in cli.md and SPEC.md.
response
model_selection,omitempty:*modelpolicy.Selectionfailure_cause,omitempty:stringbest_candidate,omitempty:stringtool:stringversion:stringstatus:stringrun_id,omitempty:stringiteration,omitempty:inthalt_reason,omitempty:stringcheck_exit,omitempty:*intreceipt,omitempty:stringprobe,omitempty:*main.probeReportdoctor,omitempty:*main.doctorReportverdict,omitempty:stringwhy,omitempty:stringverified,omitempty:*boolsignature,omitempty:stringops,omitempty:*main.opsReportcontext,omitempty:*main.contextReportisolation,omitempty:*main.isolationReportreport,omitempty:*main.reportSummarycost,omitempty:*main.costReportbudget_scope,omitempty:*main.scopedBudgetReporterrors:[]string
receiptEvent
model_selection,omitempty:*modelpolicy.Selectionoutput_truncated,omitempty:boolphase,omitempty:stringduration_ms:int64cause,omitempty:stringts:int64run_id:stringiteration:intevent:stringdetail,omitempty:stringexit_code,omitempty:*int
Selection
mode:stringtask:stringassurance:stringroles:[]modelpolicy.Role
probeReport
runs:intpasses:intfails:intflake_count:intstable:boolflake_upper_bound:float64confidence_pct:intdistinct_exit_codes:[]intmax_flake_rate,omitempty:float64certified:bool
doctorReport
checks:[]main.doctorCheckprobe,omitempty:*main.probeReport
opsReport
samples,omitempty:intconverged,omitempty:intconvergence_rate,omitempty:float64distribution,omitempty:map[string]intpacket,omitempty:stringheartbeat_age_s,omitempty:*intstale,omitempty:*bool
contextReport
path:stringtokens_estimated:intbudget_tokens:intfiles_included:[]stringfiles_dropped:[]string
isolationReport
sandbox:stringclone:stringagent_image:stringexec_image:stringexec_zone_cmd:stringagent_zone_cmd:stringegress_allow:[]stringkey_env,omitempty:stringhardened:boolminted:boolrevoked:boolexecuted:boolexec_zone_exit,omitempty:*intagent_zone_exit,omitempty:*int
reportSummary
model_selection,omitempty:*modelpolicy.Selectionbudget,omitempty:*main.budgetBooknumeric,omitempty:*main.numericStatecandidate,omitempty:*main.candidateStatebest_candidate,omitempty:stringphase:stringexit_code:intiterations:intcheck,omitempty:stringworkdir,omitempty:stringcost_usd,omitempty:float64model,omitempty:*main.modelPinsampling,omitempty:*main.samplingPincontext_files,omitempty:intfingerprint,omitempty:*main.checkFingerprintevents:intreceipt,omitempty:stringreceipt_status:stringwarnings:[]stringtimeline:[]main.receiptEventscore_target,omitempty:*float64attestation_status:stringattested:bool
costReport
iterations:inttotal_usd:float64mean_usd:float64stddev_usd:float64max_usd:float64budget_usd,omitempty:float64sigma:float64over_budget:boolanomaly_at,omitempty:[]int
scopedBudgetReport
scope:stringmax_calls:intused:intremaining:intphase_remaining:map[string]intreservation,omitempty:string
Role
provider:stringmodel_id:stringversion,omitempty:stringreasoning_effort,omitempty:stringrole:stringprofile:stringreason:stringcapabilities,omitempty:[]stringrequires,omitempty:[]string
doctorCheck
name:stringstatus:stringdetail,omitempty:string
budgetBook
mode:stringmicrousd:int64monetary_known:boolcalls:int64tokens:int64entries:map[string]workflow.Callpending,omitempty:*workflow.Preflightphase_costs_usd,omitempty:[]float64
numericState
best_accepted,omitempty:*float64patience_anchor,omitempty:*float64reviewed:intreviews_since_improvement:int
candidateState
best_iteration,omitempty:intnumeric,omitempty:*main.numericStateattempted_id,omitempty:stringaccepted_id,omitempty:stringrestored_id,omitempty:stringbest_id,omitempty:stringinitial_id,omitempty:stringstatus:stringbest_exposed:boolprotected:[]main.manifestEntrybest_fingerprint,omitempty:*main.checkFingerprint
modelPin
provider,omitempty:stringid:stringversion,omitempty:string
samplingPin
temperature:float64seed:intmax_tokens,omitempty:int
checkFingerprint
exit_code:intoutput_sha256:string
Call
model,omitempty:*modelpolicy.Identityid:stringphase:stringstatus:stringmicrousd,omitempty:*int64tokens,omitempty:*int64
Preflight
schema_version:intrun_id:stringiteration:intphase:stringenforced:boolcalls:[]workflow.Reservation
manifestEntry
path:stringsha256:string
Identity
provider:stringmodel_id:stringversion,omitempty:stringreasoning_effort,omitempty:string
Reservation
model,omitempty:*modelpolicy.Identityid:stringphase:stringmax_microusd:int64max_tokens:int64