Pre-Flight

preflight · v1 · @aarmos/cli (current stable)

Cleared for takeoff — with a signed receipt.

aarmos preflight is the offline, deterministic gate that runs before any agent — the flight recorder analogy's missing pre-step. It reuses aarmos lint for matrix checks (M1) and capability attenuation (D1), then adds Environmental Context Attestation: workspace sanity, static connector shape, and secret prefix scanning on non-gitignored files. Every run emits a signed AVAR entry — preflight.pass or preflight.fail — chained into your session so incident bundles carry cryptographic proof takeoff was cleared, or knowingly bypassed.

Zero network. Everything runs on-device from files already on disk. Median run: ~13ms in a small workspace; budget cap p99 ≤ 500ms.

What it checks

  • Matrix Lint (M1) — 8×8 action/resource coverage via aarmos lint.
  • Capability Attenuation (D1) — no delegation broadens its parent.
  • Workspace sanityaarmos.json shape, policy path clamp.
  • Static connector shape — offline manifest validation.
  • Secret prefix scan — credential-shaped strings in tracked files (respects .gitignore).

Usage

# local — warn and continue on failures
$ aarmos preflight

# CI — non-zero exit on any hard finding
$ aarmos preflight --strict

# machine-readable
$ aarmos preflight --json

Signed receipt

Each run appends one AVAR entry with an x-preflight extension that pins a SHA-256 of the structured findings sidecar (.aarmos/preflight/<stamp>.json). The extension is hashed with the entry — tamper-evidence covers it. Downstream aarmos run links to the receipt via a preflight_ref meta field.

Failure semantics

  • Default (local) — warn, exit 0, receipt still emitted. The bypass is auditable.
  • --strict (CI) — exit 2 on any hard finding.

Git hook — print by default, never clobbers

The installer detects Husky and Lefthook and prints the correct snippet for their config. Bare .git/hooks/pre-commit is only written under --force, and any existing hook is backed up to .bak first.

# prints snippet — safe to run in any repo
$ aarmos preflight install-hook

# only writes .git/hooks/pre-commit; backs up existing to .bak
$ aarmos preflight install-hook --force

Non-goals

  • No network reachability probes — that's aarmos doctor.
  • No CVE scanning.
  • No runtime policy evaluation — that happens at the gate, per call.

← Back to docs · ASP spec · AVAR spec