1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 Jonathan Shook
//! Shared library for the `coding_tools` command-line suite.
//!
//! The binaries (`ct` and the `ct-*` tools it dispatches to) are thin
//! front-ends over the reusable, doctested pieces collected here.
//!
//! Cross-cutting surfaces, used by several commands:
//!
//! * [`pattern`] — the shared substring → glob → regex promotion that every
//! pattern-accepting option uses.
//! * [`walk`] — the shared file-selection predicates (`--base`/`--name`/`--type`
//! /`--size`/`--hidden`/`--follow`) that `ct-search`/`ct-edit`/`ct-patch`/
//! `ct-tree` target with.
//! * [`verdict`] — the shared `SUCCESS`/`ERROR` outcome, its exit-status
//! mapping, and the count [`Expect`](verdict::Expect)ation that frames a
//! search/edit/patch as a pass/fail test.
//! * [`template`] — the `{TOKEN}` substitution engine behind every `--emit`
//! verdict template.
//! * [`allowlist`] — the fixed command allow-gates behind `ct-test` and
//! `ct-each`.
//! * [`explain`] — the `--explain` agent-documentation format selector.
//! * [`pulse`] — the `--timeout` watchdog and `--heartbeat` liveness pulse
//! every tool carries.
//! * [`rules`] — the `.ct/rules.jsonc` invariant surface shared by
//! `ct-rules` and `ct-check`: store model, defs, probe gate, the external
//! bridge, and outcome adapters.
//! * [`supervise`] — bounded, captured child execution for the dispatching
//! tools (`ct-test`, `ct-each`), including suite sibling resolution.
//!
//! Per-command surfaces (the pure logic each `ct-*` tool is built on):
//!
//! * [`deps`] — `ct-deps`'s crate-graph queries over `cargo metadata`.
//! * [`outline`] — `ct-outline`'s heuristic per-language declaration
//! detection.
//! * [`view`] — `ct-view`'s range parsing and context-window merging.
//! * [`tree`] — `ct-tree`'s line/word/character counts and grouping.
//! * [`edit`] — `ct-edit`'s line-scoped, byte-preserving replacement engine.
//! * [`patch`] — `ct-patch`'s node-path / predicate / value parsing.
//! * [`testrun`] — `ct-test`'s `--focus` output distiller.