ADLC
Toolkit

build-gate

Denies starting a high-risk ticket's build in a degraded (context-rot) session unless an audited override is durably recorded.

build-gate

ADLC phase: P4 Build · Gate: a high-risk ticket must not begin its build in a context-degraded session.

The ADLC lifecycle, with P4 highlighted. Read the theory for P4

What it defends against

Nothing else in ADLC deterministically prevents starting a high-blast-radius build while the executing session is context-rotted: deep, drifted, and past the point where it reliably holds the plot. build-gate sits at the P3→P4 entry: it derives the ticket's risk tier from its own fields (risk, external, mutatesIdentity, trust-root scope, contract/architecture category), checks a machine-checkable context-fitness signal (tool-call depth and transcript bytes), and denies the build unless an audited override is recorded. A declared "risk": "normal" can never downgrade a derived-high signal.

Usage

adlc build-gate <ticket-id> [--depth <n>] [--session-bytes <n>] [--transcript <path>]
                [--depth-threshold <n>] [--bytes-threshold <n>] [--tickets <path>]
                [--reason <text>] [--json]
FlagDefaultDescription
<ticket-id>Ticket to gate (required positional).
--depth <n>Precomputed tool-call-count depth signal.
--session-bytes <n>Precomputed transcript byte-size signal.
--transcript <path>Derive depth / session-bytes from this transcript file.
--depth-threshold <n>40Tool-call count past which a session is degraded.
--bytes-threshold <n>262144Transcript bytes (256 KiB) past which a session is degraded.
--tickets <path>.adlc/tickets.jsonPath to the tickets file.
--reason <text>Free-text reason recorded with an override.
--jsonoffMachine-readable JSON result.

Supplying no signal defaults to "not degraded", since a gate given no signal cannot deny. Set ADLC_BUILD_GATE_BYPASS=1 to override a deny; the override is honored only if it can be durably recorded to .adlc/manifest.jsonl.

Exit codes

0: allow. Gate passes (low risk, not degraded, or an audited override recorded).1: operational error (bad ticket id, missing tickets file, bad thresholds).2: deny. A high-risk ticket in a degraded session with no recorded override.

Example

$ adlc build-gate AUTH-9 --depth 61
build-gate: DENY (AUTH-9, risk=high) — high-risk build in a degraded session; no audited override
exit 2

Go deeper

packages/build-gate

On this page