Output Envelopes
Luotsi uses two output contracts on purpose.
For a faster first-pass mental model, start with First Five Minutes. This page is the reference for the underlying output contracts.
One-shot command mode
Section titled “One-shot command mode”Most commands return a single final JSON envelope with:
schemaokcommandstarted_atended_atdataartifactsprovenanceerror
This is the default contract for CLI commands, including scenario execution unless you explicitly request raw replay output modes.
For local terminal readability, one-shot commands also accept --human or --console-output human. That mode leads with the artifact path, a guide: reminder that the artifact root is durable evidence, and a next: command when Luotsi can name the follow-up before the rest of the concise text summary. The default and --json keep the full machine-readable envelope. Use --quiet or --console-output quiet to suppress successful command output while still printing failure envelopes. Luotsi does not use a global --output switch for this because some commands already use --output for file paths.
When an agent or CI job needs the next action, read command hints in this order:
data.recommended_next_action_commandwhen a check result exposes the direct continuation command; command-envelopedatafields use snake_case.data.recommended_next_action.commandwhen the command can name one best action.data.primary_failure.source_commandordata.primaryFailure.sourceCommandwhen a packet/check result has focused failure evidence but no recommended action.data.triage_checklist[].commandordata.triageChecklist[].commandwhen a packet/check result exposes a structured first-minute checklist.data.recommended_next_steps[],data.next_actions[], ordata.suggested_commands[]when the workflow returns an ordered handoff.artifacts.artifact_rootas the fallback evidence pointer; runreplay packetfirst so the loop hasrun-summary.jsonandrun-summary.md.data.commands[],data.artifact_commands[], ordata.recommended_commands[]only when there is no artifact root to packetize; useartifacts openonly when you specifically need the generic artifact browser.
The source tree includes executable examples of this priority order at examples/agents/extract-next-command.py and examples/agents/extract-next-command.mjs. The same parsers accept persisted run-summary.json packets with schema luotsi-run-summary.v1; the source contract is documented at docs/schemas/luotsi-run-summary-v1.md, and replay packet --check is the pass/fail gate for an existing packet. After choosing the command, use packet evidenceFiles[] or check-envelope data.evidence_files[] as proof-file context for the focused failure rather than scraping Markdown.
When an artifact root has a persisted package intake audit, human output for artifacts info and replay capsule includes a compact intake: line with status, share-safety, SHA verification, and package path. Received-package handoffs from artifacts info, artifacts verify, artifacts unpack, and artifacts intake include a replay packet --check command so humans and agents validate run-summary.json before opening broader replay surfaces.
Long-lived session mode
Section titled “Long-lived session mode”inspect is a JSONL session instead of one final object. view prints human startup/runtime progress by default, can stream raw JSONL events with view -o jsonl, view --output jsonl, or view --json, and always writes its JSONL timeline artifact for replay.
Typical inspect events:
session_startedscreen_snapshotscreen_deltacommand_resultsession_endedprotocol_errorsession_error
Typical view events:
view_startedview_startup_phaseview_diagnosticview_statsview_reconnect_requestedview_reconnectedview_recording_startedview_recording_stoppedview_screenshot_capturedview_share_startedview_share_client_connectedview_artifacts_openedview_file_pushedview_file_pulledview_package_installedview_errorview_ended
Not every session emits every event family. Startup diagnostics appear during bring-up, share events only appear for shared sessions, and recording or file-transfer events only appear when the operator actually uses those controls.
Replay export exception
Section titled “Replay export exception”replay summarize --format json|jsonl and replay timeline --format json|jsonl are intentional exceptions. They can emit raw replay output for CI-oriented consumers instead of the normal envelope.
Raw replay --format modes cannot be combined with --human, --quiet, --json, or --console-output because those flags control envelope presentation, while --format replaces the envelope entirely.
Artifact and replay commands that keep the normal envelope put their command-specific contract under data:
artifacts inforeturns root/package metadata. For artifact roots, persisted intake audits appear ashas_artifact_intake_summaryplus optionalartifact_intake_summaryfields for restored package status, share safety, SHA-256, verification, and persisted audit paths.replay capsulereturns a failure-capsule summary withprimary_failure,failure_timeline,artifact_manifest, optionalartifact_intake_artifacts/artifact_intake_summaryfields for restored package audit status, optional scenario draft summary fields including boundednext_actionsandrun_handoff, draft-ledrecommended_next_stepsthat promote ready dry-run/preflight/claimed-run/direct-run commands first, andsuggested_commands.replay summarizereturns session summaries pluscommandsthat route into capsule, open, scrub, graph, and clustering when failures are present.replay timelinereturns ordered events pluscommandsthat route into capsule, open, scrub, and graph when selected events include failures.replay searchreturns text matches pluscommandsback into capsule, open, scrub, and graph when matches are replay-relevant.replay scenario-draftreturns draft metadata, warnings, suggestions, review items, orderednext_actions, optionalpackage_provenance, optionaldevice_provenance, optional staticvalidation, optional gatedrun_handoffwithclaimed_run_commandonly when package and device serial are concrete, source summaries, step origins, normalizations such as inserted pre-tap waits or dropped duplicate waits, and the generated output paths. When persisted, the main review artifacts arescenario-draft-summary.jsonandscenario-draft.md.replay graphreturns a stable graph payload withquery,agent_summary, counts, taxonomy, insights, actions, evidence, facts, causal chains, hypotheses, optional output paths, plus returnednodesandedges; scenario-draft step and normalization nodes preserve source audit fields when available.replay clustergroups failed replay sessions by normalized failure shape and returns cluster summaries plus suggested next triage commands.
Error categories
Section titled “Error categories”The current public error categories include:
usage_errorlog_wait_timeoutoracle_timeoutconfiguration_errorselector_or_screen_statescenario_error
Treat these as current API-visible values derived from the active failure paths rather than as a permanently closed enum.
Why this split matters
Section titled “Why this split matters”- One-shot commands are easy to consume from scripts and CI
- JSONL sessions are better for agents and long-lived operator loops
- Keeping the split explicit prevents ambiguous mixed-output contracts