tools capa

tools-path-dep-repair

Repairs stale `path = "..."` dependency values in Cargo manifests after crates move (the tier refactor renamed crates/forge-<x> to crates/<tier>/<x>). Reads the package-name -> directory index from the manifests that exist now, rewrites only path values that no longer resolve on disk, and reports any dep it cannot resolve instead of guessing. Standalone example workspaces (examples/*) are the class of victim: they carry their own lockfile and are not built by `cargo build --workspace`, so a moved crate breaks them silently.

Repairs stale `path = "..."` dependency values in Cargo manifests after crates move (the tier refactor renamed crates/forge-<x> to crates/<tier>/<x>). Reads the package-name -> directory index from the manifests that exist now, rewrites only path values that no longer resolve on disk, and reports any dep it cannot resolve instead of guessing. Standalone example workspaces (examples/*) are the class of victim: they carry their own lockfile and are not built by `cargo build --workspace`, so a moved crate breaks them silently.

Tiertools
Roletooling
Pathcrates/tools/path-dep-repair
Edition2021
Targetstools-path-dep-repair, tools_path_dep_repair
Public items14 across 0 modules
Tests11

What it is for

Pure repair logic: given a manifest's text, its directory, a package-name -> directory index, and a path-existence oracle, produce the repaired text plus the list of changes and unresolved deps.

Everything decidable is a pure function (Gate 2.1); the only fs work lives in main.rs (walking the tree, reading/writing files).

Capabilities

crate root

Pure repair logic: given a manifest's text, its directory, a package-name ->

Item
fn package_name(manifest : & str) -> Option <String>
fn dep_table_header(line : & str) -> Option <String>
fn relative_path(from_dir : & Path, to : & Path) -> String

Change

Pure repair logic: given a manifest's text, its directory, a package-name ->

Item
pub struct Change

PackageIndex

Pure repair logic: given a manifest's text, its directory, a package-name ->

Item
pub struct PackageIndex
PackageIndex :: fn insert(& mut self, name : impl Into <String>, dir : impl Into <PathBuf>)
PackageIndex :: fn get(& self, name : & str) -> Option <& Path>
PackageIndex :: fn len(& self) -> usize
PackageIndex :: fn is_empty(& self) -> bool

PathDep

Pure repair logic: given a manifest's text, its directory, a package-name ->

Item
pub struct PathDep
fn parse_path_dep(line : & str, section_dep : Option <& str>) -> Option <PathDep>

Repair

Pure repair logic: given a manifest's text, its directory, a package-name ->

Item
pub struct Repair
fn repair(manifest : & str, manifest_dir : & Path, index : & PackageIndex, exists : & dyn Fn(& Path) -> bool,) -> Repair

Unresolved

Pure repair logic: given a manifest's text, its directory, a package-name ->

Item
pub struct Unresolved

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`

ItemWhat it is
pub struct PackageIndexpackage name -> absolute directory holding its Cargo.toml.
PackageIndex :: fn insert(& mut self, name : impl Into <String>, dir : impl Into <PathBuf>)
PackageIndex :: fn get(& self, name : & str) -> Option <& Path>
PackageIndex :: fn len(& self) -> usize
PackageIndex :: fn is_empty(& self) -> bool
fn package_name(manifest : & str) -> Option <String>name = "..." from the package section
pub struct Change
pub struct Unresolved
pub struct Repair
fn repair(manifest : & str, manifest_dir : & Path, index : & PackageIndex, exists : & dyn Fn(& Path) -> bool,) -> RepairRewrite every path = "..." whose target does not exist, when the dependency name is in index
pub struct PathDepOne path = "..." dependency as written in a manifest
fn parse_path_dep(line : & str, section_dep : Option <& str>) -> Option <PathDep>The dep a path = "..." line declares, or None for any other line
fn dep_table_header(line : & str) -> Option <String>dependencies.foo, dev-dependencies.foo, target.'cfg(x)'.dependencies.foo.
fn relative_path(from_dir : & Path, to : & Path) -> StringA ..-relative path from from_dir to to, in forward-slash form for TOML.

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier tools with 84 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, … (84 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)tooling
Locationcrates/tools/path-dep-repair
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways

Development. None.

Build. None.

Depended on by. 1 workspace crate.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_tools_crate_retarget["tools-crate-retarget"] -->|uses| SELF
  SELF["tools-path-dep-repair"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
bintools-path-dep-repair`src/main.rs`
libtools_path_dep_repair`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

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

1 workspace crate depends on this one: tools-crate-retarget.

Verification

KindCount
Unit tests11
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root1004

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc714
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 7
    "No rustdoc detected" : 7

Metrics

MetricValue
Rust source files2
Source lines584
Code lines495
Public API items14
Public modules0
Tests11
Examples0
Cargo features0
Direct runtime dependencies1
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "function" : 5
    "method" : 4
    "struct" : 5
pie showData
    title Rust source composition
    "Code" : 495
    "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.

Todas las tools · Manual