Expand description
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) thatct-search/ct-edit/ct-patch/ct-treetarget with.verdict— the sharedSUCCESS/ERRORoutcome, its exit-status mapping, and the countExpectation that frames a search/edit/patch as a pass/fail test.template— the{TOKEN}substitution engine behind every--emitverdict template.allowlist—ct-test’s fixed, read-only command allow-gate.explain— the--explainagent-documentation format selector.
Per-command surfaces (the pure logic each ct-* tool is built on):
Modules§
- allowlist
ct-test’s command allow-gate.- edit
- The per-file replacement engine behind
ct-edit: a line-scoped find/replace that preserves every untouched byte (line terminators, indentation, and surrounding text) and records the changed lines. - explain
- The
--explainagent-documentation format selector. - patch
ct-patch’s structured-edit engine for JSON / JSONC / JSONL / YAML.- pattern
- Substring → glob → regex pattern promotion, shared by every tool option that accepts a pattern.
- template
- Token substitution for
--emitverdict templates, shared by every tool. - testrun
- Pure helpers behind
ct-test’s output handling — currently the--focusdistiller, which reduces a captured stream to the lines that matter. - tree
- Pure helpers behind
ct-tree’s reporting: per-file line/word/character counts, the metric-bound predicate, and the immediate-parent grouping used by the per-folder predicate and the directory summary. - verdict
- The shared framed-verdict spine: the
SUCCESS/ERRORoutcome every tool emits, its0/1exit-status mapping, and theExpectation that turns a search’s match count into aVerdict. - view
- Pure line-selection helpers behind
ct-view’s bounded, context-aware reads: parsing a--rangespec, expanding--matchhits into context windows, and grouping the kept line indices into contiguous runs for display. - walk
- Shared file-selection traversal.