Skip to main content

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//! * [`payload`] — the `file:` / `text:` value schemes every payload-typed
22//!   option resolves through.
23//! * [`block`] — line-anchored literal block matching (and the nearest-miss
24//!   diagnostic) behind multi-line patterns in `ct-search`/`ct-view`/`ct-edit`.
25//! * [`blockdoc`] — the `.ctb` block-document parser behind `ct-edit --script`.
26//! * [`editscript`] — the `--script` batch engine: compiled edits simulated
27//!   in memory under the prepare/confirm/write standard.
28//! * [`allowlist`] — the fixed command allow-gates behind `ct-test` and
29//!   `ct-each`.
30//! * [`explain`] — the `--explain` agent-documentation format selector.
31//! * [`pulse`] — the `--timeout` watchdog and `--heartbeat` liveness pulse
32//!   every tool carries.
33//! * [`rules`] — the `.ct/rules.jsonc` invariant surface shared by
34//!   `ct-rules` and `ct-check`: store model, defs, probe gate, the external
35//!   bridge, and outcome adapters.
36//! * [`supervise`] — bounded, captured child execution for the dispatching
37//!   tools (`ct-test`, `ct-each`), including suite sibling resolution.
38//!
39//! Per-command surfaces (the pure logic each `ct-*` tool is built on):
40//!
41//! * [`deps`] — `ct-deps`'s crate-graph queries over `cargo metadata`.
42//! * [`outline`] — `ct-outline`'s heuristic per-language declaration
43//!   detection.
44//! * [`view`] — `ct-view`'s range parsing and context-window merging.
45//! * [`tree`] — `ct-tree`'s line/word/character counts and grouping.
46//! * [`edit`] — `ct-edit`'s line-scoped, byte-preserving replacement engine.
47//! * [`patch`] — `ct-patch`'s node-path / predicate / value parsing.
48//! * [`testrun`] — `ct-test`'s `--focus` output distiller.
49
50pub mod allowlist;
51pub mod block;
52pub mod blockdoc;
53pub mod deps;
54pub mod edit;
55pub mod editscript;
56pub mod explain;
57pub mod outline;
58pub mod patch;
59pub mod pattern;
60pub mod payload;
61pub mod pulse;
62pub mod rules;
63pub mod supervise;
64pub mod template;
65pub mod testrun;
66pub mod tree;
67pub mod verdict;
68pub mod view;
69pub mod walk;