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