archal preprod is the CLI surface for pre-production autonomous checks. It
can inspect a repo, author starter scenario files, run scenarios, classify
failures, optionally execute a coding-agent fix command, rerun, validate, and
publish a draft PR after validation passes.
Commands
plan for setup and authoring. Use run for the bounded loop.
archal preprod plan
| Option | Description |
|---|---|
--repo <path> | Repo path to inspect. Defaults to the current directory |
--out <path> | Write the JSON plan to a file |
--write-scenarios [dir] | Write parser-validated authored scenario markdown files. Defaults to archal |
--write-config | Write a minimal .archal.json from the generated config spec when no config exists |
--json | Print machine-readable JSON |
archal/ by default. The command refuses
to overwrite existing scenario files or .archal.json.
archal preprod run
.archal.json.
| Option | Default | Description |
|---|---|---|
--plan | Resolve scenarios and print the loop plan without running them | |
--dry-run | Run and classify scenarios, then stop before fix or PR commands | |
--artifacts <dir> | Write redacted result and failure-classification artifacts | |
--max-fix-attempts <count> | 2 | Maximum coding-agent fix attempts, between 0 and 10 |
--allow-external-execution | Allow --fix-command and --pr-command to execute local processes | |
--fix-command <command> | Coding-agent fix command. Receives ARCHAL_PREPROD_FAILURES_JSON and ARCHAL_PREPROD_ATTEMPT | |
--validation-command <command> | Additional local validation command required before PR creation | |
--open-pr | Open a PR after scenario reruns and validation pass | |
--pr-command <command> | PR publishing command. Receives ARCHAL_PREPROD_VALIDATION_JSON | |
--json | Emit machine-readable output |
archal run:
| Option | Description |
|---|---|
-c, --config <path> | Path to .archal.json |
--workspace-scenario <id-or-slug> | Run a scenario saved on the active workspace |
--task <description> | Run an inline task without a scenario file |
--clone <name> | Clone or clones for --task |
-n, --runs <count> | Number of runs for each scenario |
-t, --timeout <seconds> | Timeout per run in seconds |
--pass-threshold <score> | Required satisfaction score before validation. Default: 80 |
--model <model> | Evaluator model |
--agent-model <model> | Agent model, or none for deterministic harnesses |
--harness <path> | Path to a runnable harness |
--workspace <name-or-id> | Use an Archal workspace by name or id |
--sandbox | Run the harness in the sandbox engine |
--docker | Run the harness in Docker interception mode |
--no-docker | Disable Docker interception mode |
--allow-low-fidelity-networking | Allow explicit low-fidelity local debug networking |
--seed <name-or-path> | Seed name or local seed file |
--reuse-session [session-id] | Reuse an existing clone session |
--keep-state | Preserve state in a reused session |
--fresh-seed | Force re-apply of the scenario seed |
Examples
Resolve the loop without running anything:.archal.json and stop after classification:
Output statuses
| Status | Meaning |
|---|---|
passed | scenarios passed, validation passed, and PR publishing was either not requested or completed |
planned | --plan resolved scenarios and stopped |
dry_run | --dry-run classified failures and stopped before fix commands |
blocked | the loop stopped before a safe next phase |
budget_exhausted | fix attempts reached --max-fix-attempts |
validation_failed | scenario reruns passed, but --validation-command failed |
pr_failed | validation passed, but the PR command or PR verification failed |
no_scenarios, external_execution_disabled,
blocking_failure_classification, fix_budget_exhausted,
validation_command_failed, and pr_command_failed.
Artifacts
Set--artifacts <dir> to write:
| File | Contents |
|---|---|
preprod-result.json | Redacted loop result with status, stop reason, attempts, scenario run ids, validation, PR summary, and artifact metadata |
preprod-failures.json | Schema-limited failure classifications for a coding agent or handoff |
Coding-agent hooks
Fix and PR commands execute through/bin/sh -lc with a restricted environment.
The fix command receives:
| Variable | Contents |
|---|---|
ARCHAL_PREPROD_FAILURES_JSON | Schema-limited failure payload with scenario paths, classifications, and digests |
ARCHAL_PREPROD_ATTEMPT | One-based fix attempt number |
ARCHAL_PREPROD_USAGE_PATH | Optional path where the command can write token/cost usage JSON |
ARCHAL_PREPROD_VALIDATION_JSON after scenario reruns
and the validation command pass. It should print the GitHub PR URL. By default
Archal expects a draft PR; set ARCHAL_PREPROD_ALLOW_READY_PR=true only when a
ready-for-review PR is intentional.
Safety
--plannever runs scenarios.--dry-runruns and classifies scenarios, but does not invoke fix or PR commands.- Fix and PR commands do not run unless
--allow-external-executionis set. - PR publishing only runs when
--open-prand--pr-commandare provided. - PR verification checks the head commit, changed file count, draft status, and GitHub checks before reporting success.
