archal autoloop connects a harness repo to trace evidence. Hosted database
sources are registered with Archal and processed by hosted workers. Local
trace directories run a local loop and write artifacts under .archal/autoloop/.
Usage
trace-dir is required for local file-backed autoloops. Omit it when using
--source postgres or --source supabase.
Required options
For hosted database sources, also set:
Use exactly one of
--database-url-env or --database-url-secret-ref.
Source configuration (.archal.json)
Per-source facts live in the autoloop block of .archal.json in the harness
repo, not in flags. Every field is optional; unset fields fall back to the
defaults shown.
source.nameis the stable display name;source.idis the hosted source UUID (set both to re-register an existing source under its display name).cursor.modeisupdated_at_idorcreated_at_id; usecreated_at_idfor append-only tables, and mapmapping.traces.updatedAtColumnandmapping.spans.updatedAtColumnto the creation timestamp column too (the updated columns are always required).cursor.watermarksis a repair escape hatch: set it only to rewind or skip the import cursor. Streams you leave unset keep their server-stored position across re-registrations. Setting a stream’satoridto a timestamp or id moves its cursor; settingatoridtonullresets that stream and re-imports from the beginning. Do not leavenullplaceholders in the config:{ "at": null }is a deliberate reset on every registration, not an unset default.filtersrestrict which rows import (workspaceIds,statuses,traceGroups,agentIds, and a per-polllimit).metadatastores non-secret labels with the source.
--repo, so the source
configuration always tracks the repo being fixed. Passing one of the retired
source flags exits 2 with a message naming the config field to set instead.
Execution policy
fix
Validation
Use--check to validate prerequisites without registering a hosted source or
starting a local loop:
Examples
Register a hosted Supabase source (name it in.archal.json):
archal autoloop detach applies to local file-backed autoloops. Hosted database
sources are managed by hosted Autoloop workers; local detach does not disable
them.
Output
Hosted database source registration prints:Local artifacts
Local file-backed autoloops write:archal autoloop status <run-id>, which prints a hosted run’s
status, grade evidence, and artifacts. Without a run id, archal autoloop status reads the repo-local ledger for file-backed autoloops only.
For terminal-first handoffs, pair local artifacts with:
autoloop status to summarize terminal trace jobs. Use autoloop reprocess
after fixing the missing evidence, credential, mapping, harness, or GitHub
blocker that caused a trace job to stop.
With --json, the local view emits { "ok": true, "jobs": [...] } where each
job row carries the trace id, status, phase, next action, and artifact summary.
The shape is identical with or without --wait; a failed wait (timeout or a
terminal-failed job) emits "ok": false with error and "kind": "wait_failed" and exits 1.
Exit behavior
archal autoloop exits non-zero when prerequisites fail, source options are
invalid, database credentials are missing or malformed, the repo cannot be
resolved to GitHub where required, or hosted registration fails.
