# AWP I0 / I1 Preflight Harness

These scripts turn environment-dependent readiness rows into repeatable evidence collection on authorized Linux/buildbox/K3s infrastructure.

They intentionally do **not** mark a gate green merely because discovery succeeds.

## Scripts

- `check-environment.sh` — read-only discovery of Git, Node/pnpm, Kubernetes context, RuntimeClasses, ARC resources and required CLIs.
- `overdeck-harvest-inventory.sh <repo-path>` — read-only exact source revision + candidate capability inventory for the binding Overdeck harvest.
- `workspace-wip-smoke.sh --run [--yes]` — creates a bounded temporary namespace/PVC, writes WIP from one pod, deletes it, replaces it, and proves the checkpoint survives. Uses the RuntimeClass named by `AWP_RUNTIME_CLASS`; an empty value explicitly tests native fallback.
- `gvisor-toolchain-smoke.sh --run [--yes]` — runs representative Node/TypeScript/React-base and PHP/WordPress toolchains in temporary non-root pods with `runtimeClassName: gvisor`. It fails rather than weakening to native execution if gVisor is unavailable.
- `arc-ephemeral-proof.sh --run --repo OWNER/REPO --workflow FILE_OR_NAME [...]` — dispatches an AWP-compatible real GitHub Actions workflow, observes its ARC runner pod, checks the expected runner isolation/credential markers, waits for the GitHub result and proves the ephemeral pod is removed.
- `dbos-live-proof.sh --run [--yes]` — on an authorized build/test host, creates a temporary user-local PostgreSQL cluster and proves real DBOS crash/restart/resume, retry, cancellation, duplicate-start idempotency, side-effect checkpointing and terminal-result persistence. Temporary PostgreSQL/state is removed on exit.

## Rules

1. Run only against the intended AWP build/test cluster or explicitly authorized buildboxes, never unrelated production infrastructure.
2. Mutating proof scripts require explicit `--run`; without it they print their bounded operations and exit.
3. `--yes` only suppresses the interactive confirmation after `--run`; it does not bypass preconditions or broaden scope.
4. Save stdout/stderr plus host/cluster/context identity with readiness evidence.
5. Discovery or manifest rendering does not replace the required crash/restart/retry/provider E2E proofs in `docs/plans/STEP-0-PREPARATION-DEPENDENCIES.md`.
6. Never paste credentials into evidence files.
7. A missing gVisor runtime or missing live provider substrate remains an explicit blocker; do not turn it green through native fallback or static tests.

## Examples

```bash
./tools/preflight/check-environment.sh
./tools/preflight/overdeck-harvest-inventory.sh /path/to/overdeck
AWP_RUNTIME_CLASS=gvisor ./tools/preflight/workspace-wip-smoke.sh --run
./tools/preflight/gvisor-toolchain-smoke.sh --run
./tools/preflight/dbos-live-proof.sh --run
./tools/preflight/arc-ephemeral-proof.sh --run --repo OWNER/REPO --workflow ci.yml
```

Provider-specific live proof belongs with the I0 implementation because it depends on the actual adapter, provider/runtime version and intended execution substrate. Keep unavailable rows red rather than substituting workstation-local or simulated evidence.
