
## Build & Distribution

### Standalone Scripts

`scripts = { bin/deploy: @release }` generates self-contained POSIX sh scripts. Assembly order:

1. Shebang (`#!/bin/sh`) + generated banner
2. Runtime shim (`@out`, `@export`, `@defer`, `@throw`, logging functions, `__ops_check_skip`, parallel helpers, `__json_get`/`__json_set` via inlined awk)
3. Inlined op source (stripped shebangs and `@operation` blocks)
4. Inlined group .op.sh files
5. Root function with flag parser (declaration env only)
6. `__context__do "$@"`

Single portable POSIX script, `chmod +x`. Standalone scripts inline the `__json.awk` program so they remain single-file artifacts with no `.opcache` dependency.

Standalone assembly reads the same resolved `.op.sh` files from `.opcache` that `./ops` uses for drilling. No separate emission pass — if the pipeline has been drilled locally, the standalone script is built from the same artifacts.

### Environment Freshness

`ops init` generates a `.envrc` with a lightweight freshness check. On `cd`, compares installed tool versions against a manifest emitted by the resolver to opcache. Stale/missing → suggests `ops development`. Must be fast (<200ms, version lookups only, no network). `ops init` bootstraps direnv if missing.

### Compilation & Discovery

**Transitive**: `use ./other/pipeline` triggers recursive compilation. Conflict detection for env defaults, group names, exports. Cycle detection with full import path. Each file compiled at most once per invocation.

**Discovery**: `ops-engine build` uses `**/*.ops` glob. `manifest.json` can specify `ignore` globs. Explicit `ops-engine compile <file>` ignores ignore patterns.

### Registry Bootstrap

New registry fields for typed `@in` / `@out` entries need bash-side `@operation` changes that land at Tier 22 (cutover). Tiers 5–21 use hand-crafted registry JSON fixtures, validated against real output at Tier 22.

### Pre-built Binaries

Pre-built `ops-engine` binaries per platform via Forgejo CI, attached to git tags. The `ops` script downloads the matching binary on first invocation if missing. Fallback: `ops-engine` on `$PATH`. Development: `cargo build` in `engine/`, preferred over downloaded binary when present.
