Expand description
Command orchestration: walk -> parse -> classify -> validate -> render. Output is order-deterministic.
Structs§
- Coverage
Args - Decisions
ForArgs - Diff
Args - Directory
Validation - Doctor
Args - Eval
Args - Export
Args - File
Validation - Find
Args - Gate
Args - Herald
Args - Hook
Args - Improve
Args - Index
Args - Init
Args - Inspect
Args - McpStats
Args - Migrate
Args - NewArgs
- Portfolio
Args - Quickstart
Args - Relationships
Args - Rename
Args - Resolve
Args - Retrieve
Args - Review
Args - Schema
Args - Sentry
Args - Skill
Args - Stats
Args - Stdin
Corpus Validation - Telemetry
Args - Templates
Args - Usage
Args - Validate
Args - Watchkeeper
Args
Constants§
Functions§
- annotate_
search_ recency annotate_search_recency(matches, directory)— the read-surface join (ADR-045): git-derived staleness per match, computed AFTER ranking so the matched set and order are unchanged. All-null outside a git repository. Shared bycmd_findand the MCPsearch_artifactstool (both surfaces are byte-identical on this join).- cmd_
coverage - Advisory, never a build failure: exit 0 on every valid run (REQ-005).
- cmd_
decisions_ for - A query always succeeds: governed, ungoverned, and outside-repository paths all exit 0 (REQ-004); only a bad corpus directory is a usage error.
- cmd_
diff - cmd_
doctor - Corpus health in one pass. Exits non-zero only on a validation or relationship-integrity ERROR; orphan/hub/injection/unlinked/suspect warnings exit 0 (REQ-007).
- cmd_
eval decided eval [--check | --update-baseline] [--json] ...— score retrieval against the fixture benchmark, or gate against the baseline (ADR-066). Modes win over--json(eval brief, landmine 7); everyEvalUsageErrorexits 2 with adecided eval:stderr prefix — including a missing baseline under--check, discovered only AFTER the benchmark has run (statement order mirrors the oracle’s single try block).- cmd_
export - cmd_
find - cmd_
gate - One enforcement entry point: validation + relationships + review under
the corpus policy. Blocking findings fail (exit 1); a malformed
.decided/config.yamlis an operational error —decided: <message>, exit 1 (NOT the exit-2 usage class). The not-a-directory check runs BEFORE the config load, so a bad path wins exit 2 even beside a malformed config. - cmd_
herald - cmd_
hook decided hook <action> [--style STYLE] [--dir DIR] [--json]— list or install the bundled git hooks.listignores--style/--dir; an invalid style never reaches here (argparse choices fire first).- cmd_
improve - cmd_
index decided index— the plain-walk inventory; never touches the cache.- cmd_
init decided init [directory] [--key KEY] [--ticketing PROVIDER] [--profile NAME]— establish (or confirm) the repository identity namespace. Invalid key exits 2; conflict/malformed config exit 1. A successful non-JSON init may ask the one-time sharing question (TTY-gated).- cmd_
inspect - cmd_
mcp_ stats decided mcp-stats— Guide-only read-back. An empty or missing log is a valid answer (telemetry is off by default), likefindwith no matches: exit 0 for every log state.- cmd_
migrate decided migrate metadata <directory> [--dry-run]— canonical frontmatter identity for every recognized legacy artifact. A completed migration (or dry run) always exits 0 — nothing to migrate is a valid outcome.- cmd_new
decided new <type> <output_path>— create one artifact from its canonical template. Usage errors (bad type, exists, missing parent, no repo config) exit 2; operational errors (malformed config, id exhaustion) exit 1 — all stderrdecided: <msg>.- cmd_
portfolio - cmd_
quickstart decided quickstart [directory] [--key KEY] [--type TYPE]— identity plus one starter artifact in one step (ADR-044). Exit routing mirrors the oracle’s except ladder: bad type / bad key / missing parent are usage (2); a non-empty corpus, key conflict, or occupied starter path are refusals (1); operational errors are 1.- cmd_
relationships - cmd_
rename decided rename <old> <new> <directory> [--apply] [--top-level]— compute (and optionally apply) the corpus-wide rename edit set. Refusals exit 1 with the human rendering on STDERR but the JSON plan on STDOUT; a valid dry run and a successful apply exit 0.- cmd_
resolve - cmd_
retrieve cmd_retrieve— one-call compound grounding retrieval (ADR-113). The--jsonface emits the budget-capped serialization; the human face renders the same truncated payload. An emptyitemslist is a valid answer.- cmd_
review - cmd_
schema - cmd_
sentry - cmd_
skill decided skill <action> [name] [--dir DIR] [--json]— list or install the bundled Claude Code agent skills. The--dirnot-a-directory check runs BEFORE the unknown-name check (skill brief, landmine 5).- cmd_
stats - cmd_
telemetry decided telemetry [on|off|status] [--enterprise] [--unlock]— show or change sharing consent (ADR-041) and the enterprise hard-lock (ADR-086). Flag validation order is pinned: enterprise/unlock with a non-offaction first, then unlock-without-enterprise, then the opt-in-while-locked refusal — three distinct exit-2 usage errors.- cmd_
templates - cmd_
usage decided usage— unified read-back over the CLI-usage log and the Guide log (ADR-046). No consent gate on reads; exit 0 for every log state. The CLI log is read FIRST (a bad usage log crashes before the Guide log is touched, like the oracle’s statement order).- cmd_
validate - cmd_
watchkeeper - Review product knowledge changes between two repository states. Base and
head each name an existing directory (used as-is) or a git revision
materialized via
git archive. Failure policy (v0.12.2):errorfails on a review recommendation,warningalso on any warning-severity finding,nonenever fails. Revision/repository errors are the exit-2 usage class (decided: <msg>). - validate_
directory validate_directory(directory, recursive)— the uncached walk (the cache path is contractually byte-identical, PORT-CONTRACT.d/01 §6).- validate_
directory_ incremental validate_directory_incremental(directory, recursive, verify)— the ADR-106 changeset-bound path, byte-identical tovalidate_directoryfor the same corpus and config. Unchanged files reuse their cached path-free result verbatim; changed files re-parse and re-validate; assembly runs in walk order; OKF conformance recomputes over(artifact_type, path)shims.- validate_
directory_ incremental_ in - The cache-dir-injectable body (
cache_dir=Noneresolves the ladder) — the seam the S5 pinning test drives without touching process env. - validate_
stdin_ against_ corpus validate_stdin_against_corpus(product, corpus_dir, source_path).