Skip to main content

Module commands

Module commands 

Source
Expand description

Command orchestration: walk -> parse -> classify -> validate -> render. Output is order-deterministic.

Structs§

CoverageArgs
DecisionsForArgs
DiffArgs
DirectoryValidation
DoctorArgs
EvalArgs
ExportArgs
FileValidation
FindArgs
GateArgs
HeraldArgs
HookArgs
ImproveArgs
IndexArgs
InitArgs
InspectArgs
McpStatsArgs
MigrateArgs
NewArgs
PortfolioArgs
QuickstartArgs
RelationshipsArgs
RenameArgs
ResolveArgs
RetrieveArgs
ReviewArgs
SchemaArgs
SentryArgs
SkillArgs
StatsArgs
StdinCorpusValidation
TelemetryArgs
TemplatesArgs
UsageArgs
ValidateArgs
WatchkeeperArgs

Constants§

EXIT_OK
EXIT_USAGE
EXIT_VALIDATION_FAILED
STATUS_INVALID
STATUS_SKIPPED
STATUS_VALID

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 by cmd_find and the MCP search_artifacts tool (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); every EvalUsageError exits 2 with a decided 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.yaml is 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. list ignores --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), like find with 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 stderr decided: <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 --json face emits the budget-capped serialization; the human face renders the same truncated payload. An empty items list 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 --dir not-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-off action 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): error fails on a review recommendation, warning also on any warning-severity finding, none never 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 to validate_directory for 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=None resolves 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).