Reference material for looking up aramid concepts, configuration, consumers, CLI commands, exit codes, and troubleshooting steps. Grounded strictly in the aramid source tree ( src/aramid/ ) as of this document's writing — nothing here is invented.
Configuration Reference
CLI Command Reference
FAQ / Troubleshooting
The rule-based (non-LLM) check pipeline invoked by aramid check , and by the installed pre-commit / pre-push git hooks. Runner set per gate ( pipeline.py GATE_RUNNER_KEYS ):
Each runner is additionally filtered by _is_applicable() : ruff only if the repo has a Python stack, eslint only if a JS stack, typecheck only if a tsconfig /mypy config is present ( run_mypy then filters the in-range Python files by typecheck.mypy_scope(root) -- [tool.mypy] files / exclude -- and toolset.examines_path("mypy", path, root=) consults the same helper), deps only if a package manager or requirements*.txt exists, tests only if detectors.detect_tests() finds a suite. gitleaks and semgrep are always applicable. A non-applicable runner is never selected and never counts as "degraded." aramid.pipeline.run_gate recomputes detect_stacks() / detect_tests() fresh on every gate run (not just at init time) via a pruned walk ( node_modules/ , venv/ , build/ , and dot-directories excluded) — so a JS/TS repo whose only .py files are vendored under one of those no longer spuriously enables ruff ( ctx.stacks ) or the tests gate.
Runners execute concurrently under a ThreadPoolExecutor , budgeted by [timeouts] ( pre_commit=5s , pre_push=300s ); a runner still running past budget is abandoned and recorded TIMEOUT (not joined). Two ignore-path filter passes are always on and unremovable by repo config ( _BUILTIN_IGNORE_PATHS ): before file discovery, and again on parsed findings (needed because gitleaks scans by git log range, not ctx.files ).
Re-scan before closing (OPERATOR 2026-10-25). gitleaks is the only runner whose input is a patch ( git --staged , git --log-opts ); every other runner is handed whole files ( ctx.files ) or checks the project. Ledger.record_run resolves an open row whose file is in scope and that the run did not report, so a secret on a line the change did not add was written fixed . pipeline._rescan_before_closing runs between normalize and record_run for modes staged and range only: the open gitleaks / gitleaks-inline rows not re-reported whose file is in scope_files are candidates; gitleaks.rescan(root, files, rev, gate_deadline) copies their blobs at each rev ( : at pre-commit, _certified_revs at pre-push) beside the repo's .gitleaks.toml and runs run() in full_tree mode on the copy, with line_content taken from the scanned blob, so ids match. Each own-label hit is also returned under the inline label ( dir cannot apply .gitleaksignore ). It returns the hits and the labels whose pass was OK; a candidate stays open if its id was found at any rev or its label was not vouched at every rev, and any exception keeps every candidate open with a stderr line. The ids go to record_run(still_found=) , which skips them in the resolution loop: no FINDING_DETECTED , no verdict, no blocking , not in flat_results (so no scope, examined, degraded or log entry). Pinned by tests/integration/test_gitleaks_rescan_live.py (the real binary) and, in the unit suite the latent-mutant ratchet measures, test_gitleaks_rescan.py , test_pipeline_rescan_before_closing.py and test_ledger_still_found.py .
Severity tiering ("security blocks, quality warns") is not uniform — policy.classify() is the single source of truth; see WARN vs BLOCK tiers below.
Where a program comes from ( toolpath )
One module finds every program aramid starts, and it never finds one in the repository being judged. Two ways lead to a program, and the current directory was in both (FN-46, FN-47; measured 2026-10-11 on Windows 11 with Python 3.14):
The current directory is looked in only where PATH names it, as . or in full; an empty entry names no directory, and no PATH at all is Python's default one less its . . The variable is no fix to lean on: an agent harness may set it for everything it starts (the one this was measured under does, which is why the first probe read "safe"), and a hook that git starts from an editor does not have it. Tests show the hazard live in their own process before they show the fix ( shutil.which answers the planted file; a bare git --version starts the planted copy of the interpreter), and three walks of src/ keep it closed: no shutil.which outside toolpath.py , no subprocess call whose program is a bare word ( test_no_launch_in_aramid_names_its_program_by_a_bare_word , with a short reviewed list of calls whose program was resolved before the call), no shell=True and no os.system . One thing a config can no longer do: name a file of the repo's root by a bare word ( command = ["runtests"] ). aramid doctor reports it and says to write ./runtests . Not covered, and not aramid's to cover: what a child does when it starts programs of its own (git and its hooks, npm, the test suite), in the directory aramid gave it.
A relative PATH entry (FN-48) names a directory of the current directory, so of the repo too. toolpath.which keeps shutil.which 's answer for it, except for aramid's own tools ( _aramids_own : a copy in tools_dir() , or a DEPENDENCY_TOOLS name a scripts_dirs() entry holds): a hit for one of those through a relative entry, or through . , is asked again of _on_path(name, absolute_only=True) , which passes over every entry that is not absolute and so never reaches the current directory; None there sends resolve on to scripts_dirs() and tools_dir() . _copy_in is the one test of "this directory of aramid's holds it", for the guard and for resolve 's fallback. Measured on 0.20.9 before the change: a relative bin LAST on PATH still answered gitleaks , which only tools_dir() holds. toolpath.relative_path_entries() (in order, once each, empty entries left out) feeds doctor.relative_path_lines() , one WARN PATH row each, printed after the DRIFT rows; advisory, the exit code is unchanged. Control characters (interop round 347 item 1, operator 2026-11-24). relative_path_lines walks toolpath._path_dirs() in order, once per entry: an entry with any character for which str.isprintable() is false (LF, CR, TAB, ESC, U+2028, ...) gets WARN PATH entry holds a control character ( at character ): a terminal started before PATH was changed keeps its old PATH -- open a new terminal, or remove the entry , absolute or not, and never the relative row; the others get the relative row when relative_path_entries() lists them. Entries print through handover.printable_line ( printable_body plus LF and TAB escaped, backslashes kept). bytesTTS's C: + LF + \Users\...\bin was called relative ("make it absolute") and its raw LF split the row in two. Lookups are unchanged: relative_path_entries() still lists such an entry.
The sweep ( aramid drain ) — scheduled (via aramid schedule install ) or manual — that catches up triage on registered repos, pops the highest-scored queued item(s) from the review queue , and runs every registered consumer against each item. Consumers run in this fixed registration order: regression_pack , llm_review , mutation , fuzz , js_mutation , dast .
Singleton lock: ~/.aramid/drain.lock (JSON {pid, started_at, deadline_s} ); considered stale/breakable if the recorded PID is dead or the lock is older than its own deadline_s (the holder's hard deadline, updated once its candidates' configs are read) plus 5 minutes. A lock with no deadline_s (written by aramid 0.19.1 or older) reads as the default 90 minutes. A drain removes the lock only if it names the drain's own PID. Taking, releasing and re-dating the lock are each one critical section under an OS lock on ~/.aramid/drain.lock.mutex ( msvcrt.locking on Windows, flock elsewhere; never deleted), so two drains that start together get one lock between them, and a release cannot delete a lock a newer drain took (FN-19). A mutex not had within 30 s starts no drain and removes no lock.
Hard deadline (0.19.1): [drain].hard_deadline_s (default 5400 s) after the lock is taken, the drain stops itself from inside. It writes a degraded consumer_run_finished row for the running consumer (note names the deadline), kills the children run_subprocess and the LLM provider launcher have alive and closes that registry (neither launcher starts a child afterwards, and a child the close killed returns TIMEOUT , never an exit code), releases the lock and exits 2; the item stays queued. On Windows that kill is taskkill /T , which lists the tree and then kills it, so a process started in between survived it (16 of 20 measured trials, taskkill exiting 0); every non-dry-run drain therefore first joins a JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE Job object ( aramid.drain_job.join , right after the cpu cap), whose handle is never closed, so every descendant ends when the drain process does, however it ends (0 of 48 trials, nested in another job included). A refused CreateJobObjectW , SetInformationJobObject or AssignProcessToJobObject is named on stderr and the drain runs unheld. POSIX needs no job: the consumer's child leads its own process group and killpg reaches all of it. Every candidate the drain had not opened gets a queue_item_deferred row, reason drain deadline (the drain tells the watchdog before each item). The row's note starts deadline_note_prefix(deadline, head) -- stopped at the drain's hard deadline ([drain].hard_deadline_s = N) (last seen @ ) -- and a consumer with three such rows on one item at that prefix is not run again: _consume_item records ok , note giving up: ... (so status shows it stood down), and the item drains (FN-16). Capped at interval_hours × 3600 − 900 of the shortest interval among the candidates, and on Windows at the installed task's ExecutionTimeLimit − 300 s (read with schtasks /Query /XML at each drain; PT0S or no task clamps nothing). The Windows task's ExecutionTimeLimit is interval_hours × 60 − 5 minutes, so the order is always deadline ConsumerResult , and self-registers into base.CONSUMERS[NAME] on import (mirrors the providers/ self-registration pattern).
DrainContext : root , cfg , ledger , clock .
ConsumerResult : consumer , state (one of OK , DEGRADED , ERROR ), findings (default [] ), duration_s (default 0.0 ), cost (default 0.0 ), note (default "" ), extra (default {} , merged into the CONSUMER_RUN_FINISHED event payload via setdefault — core keys always win).
Six consumers exist: regression_pack , llm-review , mutation , js_mutation , fuzz , dast . See Section 3 for per-consumer detail.
Every registered consumer runs unconditionally per queue item (no cross-consumer skip logic); any raised exception is caught into ConsumerResult(state="error", note=str(exc)) .
A CONSUMER_RUN_FINISHED ledger event is appended per consumer per item: {consumer, item_id, state, duration_s, cost, finding_count, note, **result.extra} .
A pure, git-plumbing-only, self-budgeted score (default budget_s=2.0 , checked between signal computations and measured from the first signal, after the diff fetch -- a slow git no longer zeroes the score; a partial score is kept past budget with a "triage-budget-exceeded" reason) computed by triage.py score() , capped at 100 total, from six weighted signals:
run_triage() always records a TRIAGE_RECORDED event (so the drain sweep can resume from its last-seen head), and enqueues ( QUEUE_ITEM_ADDED ) only at/above [triage].min_score (default 40).
The ledger-backed queue of triaged commits/ranges awaiting drain consumption ( queue.py ). Invariant: at most one "queued" item exists per repo ledger at a time — a second commit while one is queued coalesces into it (base kept, head advances, score = max of the two, reasons unioned) rather than creating a second item. Queue item states: queued → drained (every consumer finished cleanly) or expired ( [drain].item_expiry_days , default 30, unattended).
Enqueue path: aramid init installs a post-commit hook shim that runs aramid triage HEAD --budget 15 and swallows every outcome — a commit is never blocked/noisy-failed by triage.
Verdict is computed by policy.classify(tool, rule, severity_raw, gate, cfg) — the single source of truth, dispatching on the finding's tool string:
gitleaks → always BLOCK .
ruff → BLOCK only if rule is in the curated list ["S102","S105","S106","S107","S608","S301","S302"] ; everything else WARN .
semgrep → pack-block rules ( aramid-regression.block.* ) → BLOCK / WARN per [pack].pack_block_armed (default true ); OWASP block-list matches ( owasp-top-ten.* , *sqli* , *deserialization* , *command-injection* ) → BLOCK / WARN per semgrep_block_armed (default false ); anything else → WARN .
tests-failed rule → always BLOCK .
Dependency tools ( pip-audit , npm , pnpm , yarn ) → BLOCK iff severity ≥ [deps].block_severity (default "critical" ); else WARN .
llm-review tool → classify() always returns WARN structurally; the real BLOCK verdict is computed later, at pre-push, from ledger state + [llm].llm_block_armed (never inside classify ).
aramid's own producers → tdd , mutation , red-proof and shadow are BLOCK once their own flag is set ( tdd_block_armed , [mutation].mutation_block_armed , [red_proof].red_proof_block_armed , [shadow].shadow_block_armed ), else WARN ; mutation-score is BLOCK only for rule transition once [mutation].score_block_armed is set, else WARN .
The inline labels ( runners/inline.py , FN-38) → ruff-inline , gitleaks-inline and semgrep-inline are WARN , checked FIRST, ahead of every promotion path, so no block_rules addition can reach them. Each carries rule inline-suppressed-block and reports a hit the repo's own marker hid from its tool ( # noqa / ruff per-file-ignores , gitleaks:allow , # nosemgrep ). Only a hidden hit that classify would BLOCK at that gate is reported ( inline.block_tier_only , applied in run_gate before normalize), so a semgrep hit during the bake reports nothing.
Everything else → WARN .
Net effect: apart from aramid's own producers, only the semgrep rules (the pack's and the OWASP block-list's) and LLM findings are gated by an arming flag — gitleaks, the curated ruff rules, failing tests, and ≥critical CVEs BLOCK unconditionally regardless of bake state.
Pre-push no-new-warnings ratchet : at Gate.PRE_PUSH , any WARN finding whose id is "new" ( f.id in new_ids , never seen before in the ledger) is escalated to BLOCK — except five kinds, which are exempt ( pipeline.py , _escalates ): rule deps.DEPS_SHAPE_DRIFT_RULE ; tools cargo-audit-warnings , tdd and red-proof ; and the inline labels with rule inline-suppressed-block (label AND rule, never rule alone), which ship disarmed and which every repo meets all at once on its first run after upgrading. ruff and clippy are NOT exempt: a lint the push's author wrote and can fix. A ruff WARN recorded at pre-commit is already seen, so only one first seen at the push -- a commit that skipped the pre-commit hook -- escalates (FN-32). The LLM and mutation ledger gates' findings ( llm-review , mutation , mutation-score ) are added after the ratchet has run, so it never sees them.
Arming / bake-then-arm
Aramid ships with several checks in a WARN-only "bake" period so an operator can observe noise before committing to enforcement. There are exactly ten arming-style flags, independent of one another:
The verdict of every armable finding tool is computed from the arming flag at gate time, so arming applies to findings recorded before it. Drain-time mutation survivors are recorded WARN ; mutation_block_armed is what escalates them at the pre-push. [dast] , [fuzz] and [js_mutation] have no arming flag of any kind (until 0.19.0 defaults.toml carried a never-read [dast].block_armed ; setting it now warns).
Arming is always a manual, deliberate act ( aramid arm and its variants) — never a timer or auto-promotion. Every variant rewrites aramid.toml via targeted regex substitution (not a full TOML parse/re-dump) specifically to preserve hand-written byte-for-byte. aramid init writes a fresh repo's aramid.toml stub with semgrep_block_armed = false and bake_started = always, and never touches an existing aramid.toml . aramid status surfaces bake day-count and per-rule semgrep hit counts while unarmed, so an operator can spot/demote noisy rules before arming.
The stub's header ( # aramid repo config -- detected stack: ...; package manager: ... , and the matching "Detected stack:" line init writes into ARAMID.md ) is informational only — detect_stacks() / detect_package_manager() are re-detected fresh on every gate run, never persisted as config keys ( render_repo_stub 's own docstring is explicit this). Its only observable effect is that 's text: a JS/TS repo whose only .py files are vendored under node_modules/ , venv/ , or build/ (no top-level Python of its own) now gets an accurate detected stack: js there instead of a spurious detected stack: js, python — the same pruned walk described under the [tests] config section above, applied to detect_stacks() too.
Fingerprint / ratchet
Fingerprint ( fingerprint.py compute_fingerprint ):
normalize_path = backslash→forward-slash + casefold; normalize_line = collapse all whitespace runs to a single space + strip. occurrence_index disambiguates multiple identical (tool, rule, file, normalized-line) hits within one scan; see PIN_OCCURRENCE for the alternative mode. A finding ANOTHER tool's hit ( RawFinding.subject , set only by the FN-38 inline passes) passes rule + "\x1f" + hidden_tool + "\x1f" + hidden_rule as rule , so two rules hidden on one line get ids that do not depend on the tool's output order. With subject unset the input is unchanged, so no other id moved.
Ratchet : driven by "is this id new" ( new_ids from Ledger.record_run , i.e. never previously seen ), not by baseline membership directly — the baseline only matters for the fresh-clone downgrade path and Ledger.is_new() . See WARN vs BLOCK tiers for the escalation rule.
aramid rebaseline --yes re-snapshots current findings as the accepted ratchet baseline: runs a full Gate.ALL scan and calls ledger.write_baseline() with the resulting finding-id set, discarding prior grandfathering, and prints old -> new count. Without --yes , only reports the count that would be discarded and returns exit 3 (no interactive prompt — safe to invoke from hooks/CI).
Needed because an aramid upgrade that changes rule-id or path normalization changes the fingerprint hash, so previously-accepted findings re-fingerprint and the ratchet treats them as brand-new, escalating them to BLOCK. Side effect: because a full gate is run, normal RUN_STARTED / FINDING_DETECTED / FINDING_RESOLVED / RUN_FINISHED events are also appended — a re-fingerprinted-but-functionally-unchanged finding shows up as resolved in status / ledger list afterward -- superseded naming the new id when the new row is a same-tool/rule/file sibling within 40 lines, fixed otherwise (documented, expected, not a bug).
Provider ladder / risk tiers
Two different orderings — do not conflate them:
[llm].provider_order (default ["claude-cli", "codex-cli", "ollama-cloud"] ) feeds providers/base.py chain(cfg) , filtered to module.available(cfg) (fail-open on a raising probe). In practice this list is consumed only as a set or via an order-irrelevant any() check — its job is to declare which providers exist and gate availability, not to set review priority.
The risk-tiered ladder ( [[llm.ladder]] , review.py build_arms / target_arm / reviewer_order ) is what actually drives reviewer selection, cheap→frontier by ascending min_score :
These replaced deepseek-v4-flash and gpt-5.5 (and the opus alias) on 2026-10-30, after both retired under the shipped defaults: the ollama arm got HTTP 410, the codex arm exit 1, and review records each as a bare error , so every drain's review read "all providers unavailable" from 2026-10-26. A model that leaves its provider's catalog looks exactly like an outage; check codex debug models and Ollama's /api/tags first.
target_arm(score) picks the highest- min_score arm whose band contains the item's score (or the cheapest arm below the lowest band). reviewer_order() then attempts the target tier first, degrading to nearest-available (prefer at-or-below the target, then climb above), deduped by provider. OpenRouter is opt-in only — added to provider_order plus a [[llm.ladder]] arm manually — capped by [llm].openrouter_monthly_cap_usd (default $5.00/month), checked against a local spend log before every call.
Machine-global learned model-selection engine ( ~/.aramid/autolearn_state.json , STATE_VERSION=1 ; unreadable/malformed/foreign-version state degrades silently to an empty cold-start state), config under [llm.autolearn] . Three mechanisms:
Uplift : escalate-only Thompson-sampling walk up the ladder from the target tier; each cell samples a miss-probability q ~ Beta(1+misses, 9+clean) (no-data prior mean 1/(1+9)=0.10 ); serves the lowest arm whose q ≤ uplift_threshold (default 0.15). With armed=false (shipped default) the pick is computed and recorded ( uplift.mode="shadow" ) but never changes the effective score; only armed=true lets a picked higher tier raise it (never lowers below the deterministic floor).
Audit sampling : should_audit / audit_arm deterministically hash-sample 1-in- audit_every (default 8) below-frontier reviews for a frontier double-review, capped at max_audits_per_drain (default 1) per drain; active in shadow and armed modes; costs a flat-rate quota only (its own separate cap, never counted against the review budget). audit_diff compares fingerprints to find findings the served arm missed, feeding misses on that arm-cell's posterior.
Cascade : armed-only re-review by the -higher arm, triggered on any of: a verified CRITICAL in the served review, rejected ≥ cascade_hallucination_min (default 3), or a truncated packet. Never fires for a top-tier review; consumes a normal review-budget slot; skipped if the drain's LLM review budget is already exhausted.
Feature bucket is 2-valued only: "sec" if any triage reason names a security signal, else "plain" . Cost accrues on actual spend, not on parse success. aramid autolearn --rebuild replays every registered repo's ledger events from scratch into a fresh empty state (safe because the state file is fully derived).
Shared primitive prior_note_count(ledger, consumer, item_id, prefix) ( consumers/base.py ) that counts prior CONSUMER_RUN_FINISHED events for a (consumer, item_id) pair whose note starts with an exact prefix string. Once a per-consumer threshold is reached, the consumer OK-skips permanently (for that head) instead of retrying forever. Known thresholds: llm_review malformed-response ×3 ( _MALFORMED_GIVE_UP=3 ); mutation baseline-fail ×3 ( _BASELINE_GIVE_UP=3 , head-scoped); js_mutation baseline-fail ×3 and node_modules-link-fail ×3 ( _BASELINE_GIVE_UP=3 / _LINK_GIVE_UP=3 , head-scoped, independent valves); dast target-unreachable ×3 and probe-error ×3 ( _UNREACHABLE_GIVE_UP=3 , head-scoped, independent valves). regression_pack and fuzz have no give-up valve at all — the exact note-prefix strings are load-bearing (each consumer must emit the identical prefix every time for the counter to work).
Optional per-consumer-module attribute, read via getattr(module, "PIN_OCCURRENCE", False) in the drain; defaults to False . Set True by mutation , fuzz , js_mutation , and dast — all of which have budget-truncated or membership-variable batches across drains, so positional occurrence-index fingerprints would drift and create ghost never-resolving findings. When set, fingerprinting instead pins one finding per (tool, rule, file, line-content) and collapses/drops duplicates. regression_pack and llm_review do not set it (their finding-sets aren't drain-to-drain membership-variable the same way; llm_review additionally has its own separate internal fingerprint scheme).
The two files aramid keeps on disk carry the version of their layout (0.19.0, 1.0 blocker API-4). .aramid/ledger.db records it in SQLite's user_version header ( ledger.LEDGER_SCHEMA_VERSION , now 1 ); ~/.aramid/repos.toml carries a top-level schema_version ( registry.REGISTRY_SCHEMA_VERSION , now 1 ). A file written before 0.19.0 has neither and is read as it is -- the same layout; the first 0.19.0 open of a ledger stamps it. A ledger stamped higher than this aramid knows raises LedgerTooNew , so check exits 3 with ... was written by a newer aramid (ledger schema N; this one reads up to 1) -- upgrade aramid to use it (the pre-commit shim lets that through, the pre-push shim blocks). A registry from a newer aramid reads as empty with one stderr line, is never rewritten ( register refuses, deregister raises RegistryTooNew , uninstall exits 3 having done everything else), and makes drain exit 3 . An unreadable one is treated the same way ( RegistryUnusable ): until 0.19.0 register wrote over it, so one aramid init turned a corrupt fleet into a one-repo fleet. The stamp is the one write a ledger open makes, once per ledger, and a locked database at that moment does not fail the open. A new EVENT KIND is not a layout change: Ledger.events() keeps a kind it does not know as an UnknownEventType -- in place, since autolearn's rollup cursor counts positions in that list -- and nothing matches it. 0.18.0 was rehearsed reading both stamped files: it ignores the stamps.
2. Configuration Reference
Config file: aramid.toml at the repo root. Three-layer merge: package defaults ( src/aramid/data/defaults.toml ) ← ~/.aramid/config.toml ← /aramid.toml . CURRENT_SCHEMA_VERSION = 1 . block_rules is not sourced from defaults.toml at all — its base is the separate packaged, curated file src/aramid/data/block_rules.toml ( [ruff].block , [semgrep].block , [deps].block_severity ), and the two layers a person writes merge over it as [block_rules. ] . ~/.aramid/config.toml may demote an entry; a repo's own aramid.toml may only add to a list — an entry it drops is restored, with a stderr notice naming it — and may lower [deps].block_severity , never raise it above what the layers beneath set (compared as severities: an unrecognised word counts as medium ), nor drop it by putting a value where the deps table was (FN-20).
Validation (0.19.0). Each layer a person writes ( ~/.aramid/config.toml , /aramid.toml ) is checked against the keys aramid reads: every key in defaults.toml , with its type, plus config_keys.OPTIONAL ( test_command , bake_started , [tests].command , [tests].select_command , [mutation].test_command , the two baseline_timeout_s keys, [shadow] ); block_rules tool tables are left open. An unknown key or table, a key in the wrong table, a wrong type, and a retired key ( scope_subpath , [llm].model_openrouter , [dast].block_armed , [dast].start_command ) each print aramid: config: : on stderr, once per process, and a WARN row under doctor 's config: section. WARN only (DEC-4): what is loaded, and every exit code, are unchanged.
Code's own ultimate fallback if the section were entirely absent: 60.0 .
The BLOCK-tier tests gate ( --gate pre-push and --gate all ). Read by pipeline.run_gate , which resolves the section onto RunContext.test_command / .test_timeout_s / .tests_enabled — the Runner protocol is run(ctx) , so ctx is the only channel a runner has to config.
Why it exists: tests is in BLOCK_TIER_KEYS , so a suite that overruns the timeout degrades the block tier and policy.escalate_degraded returns 1 at pre-push. With no way to point the gate at a fast subset, every push blocks on any repo whose suite exceeds the budget — aramid's own (~900 s) included. A gate that must routinely be bypassed with --no-verify trains the bypass, which disables every other check too.
Two invariants worth keeping in mind when touching this:
BLOCK-tier escalation keys on the registry key ( results["tests"] ), not on RunnerResult.tool . A custom make test reports tool == "make" , which name-matches nothing in BLOCK_TIER_KEYS ; if that ever switched to name-matching, configuring a command would silently demote the test gate out of BLOCK tier.
A configured command that parses to empty argv degrades MISSING rather than returning zero findings — a gate cannot fall silent because its own config is malformed. Likewise pytest's rc 5 ("no tests collected") stays blocking: a selector matching nothing is a vacuous gate, not a pass.
Detection rules : detectors.detect_tests(root) returns "pytest" iff a real Python test file exists somewhere in the tree — test_*.py , *_test.py , or conftest.py . A bare tests/ directory is deliberately not a signal on its own: that was the false-positive bug (a TypeScript repo's tests/ directory of *.test.ts files used to read as a pytest suite, ran pytest -q , got exit 5 for "no tests collected", and blocked every push). It returns "npm" iff package.json declares a scripts.test entry. Both walks prune dot-directories, node_modules/ , venv/ , and build/ , so vendored/build-tree files never contribute either signal. This detection is bypassed entirely by an explicit [tests].command (or the legacy test_command ), which is checked first and always wins.
Dual-stack repos (both a Python test file AND an npm test script): runners/tests.py runs both suites and aggregates, rather than silently picking one — the exact bug class this module exists to close, a check that reports nothing for a reason indistinguishable from "clean." The shape mirrors runners/deps.py 's _run_mixed (two sub-results attached via .sub_results ), but the state rule is inverted: the combined result is OK iff both sub-suites are OK (deps' analogous aggregate uses OR — a degraded/missing suite there is still a useful partial result; here it must still block). A failing sub-suite still reports ToolState.OK with a non-zero returncode ; it blocks through the ordinary tests-failed finding, not through the aggregate's .state (which is meaningless to read directly on the combined result — consult .sub_results for the real per-suite outcomes). The two suites run sequentially, sharing one wall-clock deadline ( ctx.gate_deadline ) rather than each getting a full independent [tests].timeout_s .
The npm side is to a real second suite only when a JS package-manager lockfile is present ( package-lock.json , pnpm-lock.yaml , or yarn.lock , via detect_package_manager ). A package.json scripts.test entry with nothing installed behind it is common — e.g. npm init 's own default stub, "... && exit 1" — and promoting every such stub to a second concurrent BLOCK-tier suite would manufacture false blocks on repos that only ever meant that package.json for tooling like prettier/husky. Without a lockfile, only pytest runs and a stderr notice explains that npm was skipped rather than silently dropping it. This lockfile gate applies only to the promotion decision: a repo with npm detected but no pytest still runs npm test with no lockfile required at all, unchanged.
A detected suite whose own tool can't run. Inside a dual-stack run, if one sub-suite's binary can't be resolved at all (not installed, not on PATH), that sub-result comes back MISSING and now surfaces a tool="tests" , rule="tests-tool-missing" finding — unconditionally BLOCK per policy.classify , same tier as tests-failed , so the push fails with a stated reason instead of a bare degraded exit code. This is narrower than it may sound: it fires only for a sub-result of a dual-stack run. A single-suite repo (only pytest, or only npm, detected) whose one tool is missing still gets the pre-existing, unchanged behavior — zero findings from runners/tests.py , degrading the BLOCK tier via degraded_block_tier / --accept-degraded exactly as before this dual-suite path existed. Closing that single-suite gap (the more common case in practice — an unactivated venv or a slim CI image missing pytest entirely) is a separately tracked follow-up. aramid doctor does probe it ( probe_tests : pytest/npm, or the binary a configured [tests].command names, resolved the way the gate would) and exits 2 when a detected suite's tool cannot be resolved, so the single-suite case is visible before a push.
Notices. Six independent stderr notices exist around [tests] : the pre-existing [tests].enabled = false notice (fires only when a suite or command actually exists to be suppressed); two added by Task 4 for a false-negative/skipped suite, both pointing at [tests].command as the fix — detect_tests() finds nothing despite a plausible test setup existing anyway ( tests/ , test/ , pytest.ini , tox.ini , or [tool.pytest.ini_options] — e.g. a custom python_files pattern, unittest-style testfoo.py naming, or a doctest-only suite that the detector's literal filename match doesn't recognize), and both kinds detected but no lockfile backing the npm side (the case above); two independent budget-vs-timeout notices — one dual-suite-specific (fires only inside the lockfile-present dual-suite branch, comparing the effective per-suite timeout, defaulted via tests.TIMEOUT_S when unset, against the shared gate budget) and one general (fires whenever [tests].timeout_s is explicitly set above the gate budget, regardless of single- or dual-stack — the same check the timeout_s row above already documents); and a sixth, separate, differently-worded notice that runners/tests.py itself prints at actual dual-suite execution time for the same no-lockfile case. The last is a deliberate duplication across two independent code paths (pipeline's pre-flight check vs. the runner's own runtime check), not a bug — Task 4 kept both so neither's removal silently reopens the other's gap.
[[llm.ladder]] (array of tables):
Drain-time survivors are recorded WARN either way; the pre-push gate applies the flag, so arming covers survivors recorded before it.
No arming flag exists in [js_mutation] .
No arming flag exists in [fuzz] .
The dependency BLOCK threshold is not here: it is block_severity in block_rules.toml 's own [deps] table (see the section intro).
Both apply to semgrep's own run and to its inline pass ( semgrep-inline ).
Key naming collisions (same name, different meaning)
max_items_per_drain : [drain] = 10 (total items per drain run) vs. [llm] = 3 (LLM reviews per drain).
min_score : [triage] = 40 (queueing threshold) vs. each [[llm.ladder]] entry's own min_score (40/60/80, a reviewer-arm band floor).
Arming flags — full inventory
semgrep_block_armed (top level) — default false — armed via aramid arm .
[pack].pack_block_armed — default true — no arm subcommand; hand-edited.
[llm].llm_block_armed — default false — armed via aramid arm --llm .
[llm.autolearn].armed — default false — armed via aramid arm --autolearn .
tdd_block_armed (top level) — default false — armed via aramid arm --tdd .
[mutation].mutation_block_armed — default false — armed via aramid arm --mutation .
[mutation].score_block_armed — default false — armed via aramid arm --mutation-score .
[red_proof].red_proof_block_armed — default false — armed via aramid arm --red-proof .
[shadow].shadow_block_armed — default false — armed via aramid arm --shadow .
agent_block_armed (top level) — default false — armed via aramid arm --agent .
[dast] , [fuzz] and [js_mutation] have no arming flag of any kind. What each flag changes: see "Arming / bake-then-arm" in section 1.
3. Consumer Reference
NAME : regression_pack . Findings emit tool="semgrep" (not tool="regression_pack" ).
Purpose : drain-time replay of the compiled attack-pack ruleset ( /.aramid-rules/regression.yml , compiled by aramid pack from previously-resolved findings) against the queue item's changed files — catches commits/ranges that bypassed hooks.
Config keys : none read by the consumer itself (only whether the pack file exists on disk gates it); [pack].pack_block_armed (default true ) is consulted later, only inside policy.classify . Uses the global ignore_paths to prune changed files.
WARN/BLOCK + arming : findings are tool=semgrep , rule prefix aramid-regression.block.* → BLOCK/WARN per [pack].pack_block_armed — the only drain consumer that can BLOCK out of the box (default-armed).
OK-skip / give-up : OK-skip (not degraded) when no pack file exists ( "no pack file" ) or no changed files survive the diff+ignore-path filter+existence check ( "no files in range" ). DEGRADED when semgrep's subprocess isn't ToolState.OK ( f"semgrep {checked.state}" ). No give-up counter.
Stack requirement : needs a compiled pack file ( .aramid-rules/regression.yml ) to exist; otherwise a total no-op.
Token cost : always 0.0 .
NAME : llm-review (consumer module llm_review ). The only consumer that calls an LLM / spends tokens or dollars.
Purpose : assemble a redacted evidence packet (zero tokens) for the queue item, send it down the provider chain for one review call, mechanically verify each candidate's evidence is a verbatim quote anchored to a real line in HEAD, pre-refute-dedupe against the ledger, then spend one cross-provider refute call per fresh CRITICAL candidate before recording.
Config keys : [llm] ( enabled , max_items_per_drain=3 , call_timeout_s=240 , packet_max_bytes=120000 , llm_block_armed=false , provider_order , max_refutes_per_drain=6 ), [[llm.ladder]] (cheap/mid/frontier), [llm.autolearn] ( enabled , armed , uplift_threshold , audit_every , max_audits_per_drain , cascade_hallucination_min ).
WARN/BLOCK + arming : always recorded WARN at drain time ( policy.classify 's hard-coded tool=="llm-review" branch). Becomes BLOCK only later, at the PRE_PUSH gate, via review.llm_gate_findings : requires [llm].llm_block_armed=true AND the finding is confirmed (survived cross-provider refute) AND severity is critical. Computed fresh from ledger state every gate run — arming applies retroactively.
Auto-resolve ( review.auto_resolve_llm , at every pre-push gate, before the LLM block check): an open finding resolves evidence_gone when its whitespace-stripped evidence quote is in its file at none of the revisions the push certifies (the pushed refs' local shas and HEAD; HEAD alone without a certification) and the remote default branch, as the push leaves it, does not hold it either, and no branch carries it as its own: a tip under refs/heads or refs/remotes whose file holds the quote while its merge base with that default branch does not (FN-58, departure.Departure ; the branch refs/remotes/ /HEAD names for the remote the pre-push hook names, else origin's, else the only one, or the commit a pushed ref hands it; the tracking refs a fast-forward replaces are left out, a force-push's old commit is not; with no remote HEAD, a certified revision stands in for that branch). A copy inherited from shared history does not count, a branch the pushed one was cut from still does, a branch that drops what the default branch still ships clears nothing, and the disk is never read. Before such a finding resolves, a path tracked at no certified revision is searched for (FN-22): git grep -F on the quote's longest line across every tracked file at each certified revision, then the whole stripped quote on each hit. Found anywhere, the finding stays open (a git mv is not a fix); found nowhere, or the fails, it resolves as before (a deleted file still clears). A quote moved into another file while its own file stays is still resolved. A GitTimeout resolves nothing and fails the gate.
OK-skip / give-up : OK-skip when [llm].enabled=false ( "llm disabled" ); empty packet ( "empty packet" ); no provider CLIs installed at all ( "llm skipped: no providers installed" ); give-up valve — malformed responses ≥3 ( _MALFORMED_GIVE_UP=3 , note "llm giving up: repeated malformed output" ). DEGRADED when per-process review budget exhausted ( "llm budget exhausted" ); every configured provider installed but unavailable ( "all providers unavailable" ; when arms were tried and every one failed, followed by -- : ; ... , the head of each attempt's detail or else its error code); or a response parses to None ( f"malformed response from {provider}" ).
Failure detail (operator decision 2026-10-30): ProviderResponse.detail , built by providers.base.failure_detail(head, text) : the head ( HTTP , exit , an exception's class, tool used ), then text on one line, cut to DETAIL_MAX = 200 after masking OLLAMA_API_KEY / OPENROUTER_API_KEY values of 8+ characters ( redact.scrub ) and the packet's secret shapes ( review.redact_packet ). http_detail reads an HTTPError body's JSON error (a string or an object's message ), else the body, else the reason. codex: the last turn.failed or error event's message, else stderr's last line, else stdout's; claude: an is_error envelope's result , else stderr's last line, and stdout's only when it is not an envelope. Kept on every attempts entry and every refutes entry; the note carries only the head, because health matches "giving up" and the no-work marks in the note by substring.
Stack requirement : at least one of the configured provider CLIs (claude-cli / codex-cli / ollama-cloud, or opt-in openrouter) must be installed and reachable.
The claude-cli reviewer's command line ( providers/claude_cli.py , FN-41): claude -p --model --output-format json --tools "" --strict-mcp-config --safe-mode --restricted --no-session-persistence --permission-prompts none [--effort ] , started in an empty tempfile.TemporaryDirectory(prefix="aramid-review-") ( base.run_provider_subprocess(..., cwd=) ), which is removed after the call; one that will not go is left behind and does not fail the review. A non-zero exit whose stderr has a line starting error: unknown option or error: option means the CLI did not take the command line: one stderr line, ERR_UNAVAILABLE , and never a second launch without the options. Quota markers are checked first; any other non-zero exit is ERR_ERROR as before. codex-cli is restricted the same way since FN-49 ( entry).
The codex-cli reviewer's command line ( providers/codex_cli.py , FN-49): codex exec --json --sandbox read-only --skip-git-repo-check [-m ] [-c model_reasoning_effort= ] --ignore-user-config --ignore-rules --ephemeral --disable ... -c web_search=disabled - ( _RESTRICT ; _DISABLED_FEATURES names 15 features, each read back false from codex features list on 0.162.0; unified_exec is left out because codex accepts its --disable and keeps it on). The restriction comes after model and effort, so nothing later on the line can give a tool back. Started in an empty aramid-review- temporary directory, as for claude-cli. Refused: a non-zero exit whose stderr has a line starting error: unexpected argument , error: a value is required or Error: Unknown feature flag: gives one stderr line, ERR_UNAVAILABLE , and no second launch. Stream guard: any event whose item is a dict with a type outside _HARMLESS_ITEMS ( agent_message , reasoning , todo_list , error ), started, updated or completed, throws the away: spend logged, one stderr line, ERR_ERROR (the ladder moves on). An allowlist, so a tool a later codex adds is caught. -c web_search=disabled is unquoted: codex reads a value that is not TOML as a string, and codex is a .cmd on Windows.
Token cost : the only consumer with nonzero cost; accrues on spend, not on parse success (unparseable responses still burn tokens). Cascade re-review consumes a normal review slot; audit double-review has its own separate cap ( max_audits_per_drain ); refute calls have their own cap ( max_refutes_per_drain=6 ).
NAME : mutation , findings tool="mutation" .
Purpose : mutation-test the Python functions the queue item's commits touched, inside a throwaway git worktree --detach at item.head . Two-stage: targeted pytest run per mutant, then a capped full-suite confirmation run — a survivor is only reported once the full suite passes on it. Operators: cmp-flip , bool-swap , int-bound , not-drop .
Config keys : [mutation] ( enabled=true , max_mutants=20 , wall_budget_s=600 , mutant_timeout_s=120 , confirm_cap=3 ).
WARN/BLOCK + arming : no arming knob exists; findings are always medium severity → WARN under the catch-all.
OK-skip / give-up : OK-skip when enabled=false ( "disabled" ); no non-test Python files changed ( "no python files in range" ); no pytest stack detected — deliberately OK not DEGRADED ( "no python test stack (mutation skipped)" ); give-up valve — baseline failed 3 times at this exact head ( _BASELINE_GIVE_UP=3 , head-scoped note from mutation.failing_note_prefix(head) → f"baseline failing (last seen @ {head12})" ) → "mutation giving up: baseline persistently failing" . ERROR (not degraded) when git worktree add fails. DEGRADED when the full-suite baseline run on the pristine worktree doesn't pass.
Runs that certify nothing stay ok ( degraded would pin the queue item) and carry a note status lists under "consumers doing no work", which the fleet row grades as consumers_healthy: false : "no mutants tested: N generated, 0 certified -- ..." when the wall budget ran out before the first mutant, and "no mutant reached a verdict: N tested, T timed out, E errored -- the baseline took Bs; [mutation].mutant_timeout_s is Ms" when mutants ran and none reached a verdict (FN-23). The verdicts are a stage-1 kill, a full-suite kill and a confirmed survivor; a timeout or error at either stage, or a stage-1 survivor the confirm cap cut, is none of them.
A re-test the clock dropped is named (interop round 329) . When done (the wall clock ran out) and retested or was an equivalent mutant.
A re-test it can count on (FN-43) . Two keys on the consumer row carry a recorded survivor's re-test across drains. retest_partial (id → {head, suite, of, killed} ): the occurrences (indexes into the regeneration, of of them) whose kill a re-test confirmed before the wall clock or a cap cut it; the re-test under the same item.head and _suite_label of the configured suite runs only the rest and claims once every index has a kill. A kept set that names every occurrence counts for nothing ( _kept_kills ): the consumer never writes one, since such a re-test claims, and taken it would claim with no run in the claiming process (llm-review 961336fe ). The memory is the NEWEST row whose retested_ids holds the id, so a run that skipped the id does not wipe it, and a row that claimed or re-reported it, or a new head, suite or occurrence count, drops it. retest_owed (ids): written only by an item that re-tests ( _retest_statuses non-empty) -- the candidates it neither claimed nor re-reported; the debt is the newest row carrying the key, and pending_retests (the empty-queue item's population, for the drain and the consumer alike) adds its open or pending, unsuppressed ids to the pending_retest rows. Before: a three-occurrence survivor whose confirms outran wall_budget_s was cut after two kills every drain and never claimed (4307f4ee, ~47 min a drain at 2500 s), and an open survivor whose killing test landed in a push that filled the range was never re-tested again (59bcbe17).
The import check (interop round 327) . The baseline alone runs under baseline_env(wt, probe) : worktree_import_env(wt) with PYTHONDONTWRITEBYTECODE set empty and PYTHONPYCACHEPREFIX pointed at /pyc-probe , beside wt and removed with it. Every process inheriting that environment writes the bytecode of what it imports under the probe, mirroring each source's absolute path ( _mirror follows cache_from_source : an X: drive is stripped, a UNC is not). Measured 2026-11-23: a child started with a modified environment still writes, pytest's rewritten test and conftest bytecode lands there too, python -I / -E write nothing, and nothing lands in wt . import_check(probe, wt, rels) reads it for the range's files plus every claimed and hygiene re-test's file: observed (any .pyc at all), from_wt (any under the worktree's mirror, raw or realpath ), and per file WORKTREE , another path (the mirror's, its drive lost) or None . ungraded() withholds nothing when unobserved; every file when nothing came from wt ; otherwise each file imported from somewhere else. A withheld file is skipped in all three passes (range, claimed, hygiene), so it can be neither a survivor nor a kill claim, and no finding is written (operator 2026-11-23: a note and a stat, not a ledger row, so nothing needs a close). A file nothing imported, in a suite that ran from wt , is an untested module and is graded as before (operator 2026-11-23). Stats not_exercised (files withheld) and imports_unobserved (0/1); the note gains ; N file(s) not graded, their mutants were not the code under test: (imported from ) and/or ; the import check saw no Python process under aramid's environment ... , after every other suffix. Held re-tests (operator 2026-11-24) : every run that reaches the check writes not_graded = {head: item.head, suite: _suite_label(full_argv), files: [...]} on its row (an empty list too, so a graded run releases an older hold); withheld_pending(ledger, root, cfg) returns the pending_retests ids whose file the NEWEST such record lists, when its head is the current HEAD and its suite the current one (a malformed record holds nothing), and drain._pending_retest_item drops them beside the unfittable ones. Without it, a withheld file's pending_retest row stayed pending (a withheld re-test settles nothing, so it is also retest_owed ) and every idle drain cut the same item and paid a baseline to withhold it again (measured 2026-11-24 on 009118d: two items in a row, one baseline each). The note adds ; N re-test(s) held until a new commit or a change to the test command ; drain --dry-run adds held_not_graded=N . The prefix also redirects bytecode READS, so the baseline compiles stdlib and site-packages afresh: 9 s more on aramid's 5,600-test suite (fresh tree, collection 13.5 s -> 22.5 s).
Stack requirement : "pytest" in detectors.detect_tests(root) — true only if a real pytest-shaped file exists ( test_*.py , *_test.py , or conftest.py ); a bare tests/ directory alone is not a signal (see the [tests] config section's...
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
