tools-rename-drift-scan: find and fix literal occurrences of a retired path or crate name (e.g. a renamed sibling repo, a re-tiered crate) across everything tools-knowitall has cataloged. Built for the rp-master-wt/rust-primitives -> rust-framework-workspace rename and the primitives-* -> foundation-*/domain-*/infrastructure-*/tools-* crate re-tiering; the rule list is not hardcoded to those, so it covers the next rename too.
| Tier | tools |
| Role | unclassified (baselined) |
| Path | crates/tools/rename-drift-scan |
| Edition | 2021 |
| Targets | tools-rename-drift-scan, tools_rename_drift_scan |
| Public items | 6 across 0 modules |
| Tests | 11 |
What it is for
Pure logic for finding/fixing a retired name's literal occurrences. No I/O here (that's main.rs): a rename produces the same class of bug every time (a sibling repo directory renamed, a crate re-tiered) — this makes fixing an instance of it a reusable operation instead of a one-off grep-and-hand-edit, per the "write once" rule.
Capabilities
RenameRule
Pure logic for finding/fixing a retired name's literal occurrences.
| Item |
|---|
pub struct RenameRule |
RenameRule :: fn parse(spec : & str) -> Result <Self, String> |
RenameRule :: fn builtin() -> Vec <RenameRule> |
fn from_governed_term(term : & str, prefer : & str) -> Result <RenameRule, String> |
fn apply_rule(text : & str, rule : & RenameRule) ->(String, usize) |
fn apply_rules(text : & str, rules : & RenameRule) ->(String, usize) |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub struct RenameRule | One retired-name -> current-name mapping, e.g |
RenameRule :: fn parse(spec : & str) -> Result <Self, String> | Parse OLD=NEW |
RenameRule :: fn builtin() -> Vec <RenameRule> | The drift this tool shipped to fix first |
fn from_governed_term(term : & str, prefer : & str) -> Result <RenameRule, String> | Build a RenameRule from one governed_term row (term, prefer), e.g |
fn apply_rule(text : & str, rule : & RenameRule) ->(String, usize) | Replace every literal occurrence of rule.old with rule.new in text |
fn apply_rules(text : & str, rules : & RenameRule) ->(String, usize) | Apply every rule in sequence, summing replacement counts across all of them. |
No pub use re-exports: every item above is declared in this crate.
Boundary
Depends on no other workspace tier.
Shares tier tools with 86 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (86 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | tools |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/tools/rename-drift-scan |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
clap | ^4 | derive | no | always |
sqlx | ^0.8 | runtime-tokio, postgres | no | always |
thiserror | ^2 | — | no | always |
tokio | ^1 | rt-multi-thread, macros | no | always |
Development. None.
Build. None.
Depended on by. Nothing in this workspace.
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| bin | tools-rename-drift-scan | `src/main.rs` |
| lib | tools_rename_drift_scan | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | yes |
| database access | yes |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | yes |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
| Variable | Read in |
|---|---|
CORPUS_SOURCECODE_APP_DB | src/main.rs |
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 11 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 4 | 0 | 0 |
What the tests establish, by name:
apply_rule_on_absent_term_is_a_no_op—src/lib.rsapply_rule_replaces_every_occurrence_and_counts_them—src/lib.rsapply_rules_composes_multiple_rules_in_one_pass—src/lib.rsbuiltin_rules_are_internally_consistent—src/lib.rsfrom_governed_term_rejects_a_no_op—src/lib.rsfrom_governed_term_rejects_multiple_alternatives—src/lib.rsfrom_governed_term_strips_backticks—src/lib.rsparse_accepts_old_equals_new—src/lib.rsparse_rejects_a_no_op_rule—src/lib.rsparse_rejects_empty_side—src/lib.rsparse_rejects_missing_equals—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 6 | 6 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 6
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 2 |
| Source lines | 473 |
| Code lines | 384 |
| Public API items | 6 |
| Public modules | 0 |
| Tests | 11 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 4 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"function" : 3
"method" : 2
"struct" : 1
pie showData
title Rust source composition
"Code" : 384
"Blank or comment" : 89
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.