tools capa

tools-target-sweep

Finds and clears cargo build artifacts across a set of project directories, reports space reclaimed, optionally persists the report to corpus_sourcecode (sprint 3.104).

Finds and clears cargo build artifacts across a set of project directories, reports space reclaimed, optionally persists the report to corpus_sourcecode (sprint 3.104).

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/target-sweep
Edition2021
Targetstools-target-sweep, tools_target_sweep
Public items8 across 1 module
Tests7

What it is for

Pure discovery/sizing logic for sprint 3.104's disk-cleanup tool.

Kept free of subprocess/DB calls so it's testable against real tempdir fixtures, no mocks (Gate 2 convention this repo already follows).

Capabilities

crate root

Pure discovery/sizing logic for sprint 3.104's disk-cleanup tool.

Item
fn discover_repos(parent : & Path) -> io::Result <Vec <PathBuf>>
fn target_dir_size(repo : & Path) -> io::Result <u64>

SweepReport

Pure discovery/sizing logic for sprint 3.104's disk-cleanup tool.

Item
pub struct SweepReport
SweepReport :: fn reclaimed(& self) -> u64

SweepStatus

Pure discovery/sizing logic for sprint 3.104's disk-cleanup tool.

Item
pub enum SweepStatus

persist (other)

Optional write side: persists each repo's crate::SweepReport into

Item
pub const MODULE_NAME: & str
async fn apply_migrations(pool : & PgPool) -> Result <u32, application_core::MigrationError>
async fn insert_report(pool : & PgPool, report : & SweepReport) -> Result <(), sqlx::Error>

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

tools_target_sweep

Public surface

`crate root`

ItemWhat it is
fn discover_repos(parent : & Path) -> io::Result <Vec <PathBuf>>Immediate children of parent that are directories containing a Cargo.toml -- one level deep only (Gate 1.5.6 §1: bounded discovery, never a recursive repo scan)
fn target_dir_size(repo : & Path) -> io::Result <u64>Recursive byte sum of repo/target, never following symlinks (Gate 1.5.6 §1: no symlink-loop risk)
pub enum SweepStatusWhat happened when sweeping one repo.
pub struct SweepReportOne repo's sweep result.
SweepReport :: fn reclaimed(& self) -> u64

`persist`

ItemWhat it is
pub const MODULE_NAME: & strThis tool's own module name in forge_module_migrations (application_core::apply_module_migrations's per-module namespace) -- distinct from "tools-session-error-audit"/"org-knowledge-corpus" in the SAME shared corpus_sourcecode database.
async fn apply_migrations(pool : & PgPool) -> Result <u32, application_core::MigrationError>Apply this tool's own migration into pool (already the corpus_sourcecode connection)
async fn insert_report(pool : & PgPool, report : & SweepReport) -> Result <(), sqlx::Error>Insert one repo's sweep report as one row

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

Boundary

Reaches into application, foundation.

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)unclassified (baselined)
Locationcrates/tools/target-sweep
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_tools["tools"] --> n_application["application"]
  n_tools["tools"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-core`applicationnoalways
`foundation-bounded-io`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
clap^4derivenoalways
serde^1derive, derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2noalways
tokio^1full, macros, rt-multi-threadnoalways

Development, in this workspace.

CrateTierOptionalOnly on
`tools-cli-conformance`toolsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tempfile^3noalways
url^2noalways

Build. None.

Depended on by. Nothing in this workspace.

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

flowchart LR
  SELF["tools-target-sweep"]
  SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"]
  SELF -->|runtime| n_application_core["application-core"]
  SELF -->|runtime| n_foundation_bounded_io["foundation-bounded-io"]
  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-target-sweep`src/main.rs`
libtools_target_sweep`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 surfaceyes
async runtimeyes
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesyes

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

Configuration

VariableRead in
CORPUS_SOURCECODE_APP_DBsrc/main.rs
DATABASE_URLsrc/persist.rs
TEST_DATABASE_URLsrc/persist.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests7
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root400
persist300

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc78
Public modules with a //! block11
pie showData
    title Public items with rustdoc
    "Documented" : 7
    "No rustdoc detected" : 1

Metrics

MetricValue
Rust source files3
Source lines557
Code lines425
Public API items8
Public modules1
Tests7
Examples0
Cargo features0
Direct runtime dependencies9
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 1
    "enum" : 1
    "function" : 4
    "method" : 1
    "struct" : 1
pie showData
    title Rust source composition
    "Code" : 425
    "Blank or comment" : 132

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