tools tier

tools-stub-scan

Stub/debt-marker scanner. Finds hard stubs (todo!/unimplemented!) and structured debt markers (TODO/FIXME/HACK/STUB comments) across the tree, maintains a machine-generated section in docs/TECH-DEBT.md, and queues one GitHub issue per crate (deduplicated by title) so stubs become tracked work instead of silent rot.

Stub/debt-marker scanner. Finds hard stubs (todo!/unimplemented!) and structured debt markers (TODO/FIXME/HACK/STUB comments) across the tree, maintains a machine-generated section in docs/TECH-DEBT.md, and queues one GitHub issue per crate (deduplicated by title) so stubs become tracked work instead of silent rot.

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/stub-scan
Edition2021
Targetstools-stub-scan, tools_stub_scan
Public items20 across 1 module
Tests9

What it is for

Stub / debt-marker scanner.

Two classes, both high-precision by construction:

function exists, callers link against it, and it panics at runtime. String literals and comments never match (the source is lexed first).

STUB as a whole word inside a // or /* */ comment. Only comments match — prose words like "placeholder" in doc text are deliberately NOT flagged (too noisy to act on).

The scanner's job is to turn these into tracked work: a machine-managed section in docs/TECH-DEBT.md (sentinel block, same convention as tools-update-process) and one GitHub issue per crate, deduplicated by title so re-runs never spam the tracker.

Sprint 4.21 adds the other half. Walking the tree is the SENSOR; store is the RECORD, so what the walk found becomes queryable alongside the crate rows the corpus already holds. Documents and issues are for people; neither can answer "which application-tier crates are still stubs?" without someone re-walking the tree by hand.

Capabilities

crate root

Stub / debt-marker scanner.

Item
fn one_segment_crate_dirs(rel_files : & String) -> BTreeSet <String>
fn issue_title(crate_key : & str) -> String
pub const DEBT_BEGIN: & str
pub const DEBT_END: & str
fn splice_debt(existing : & str, section : & str) -> String

Finding

Stub / debt-marker scanner.

Item
pub struct Finding
fn scan_source(rel : & str, src : & str, out : & mut Vec <Finding>, one_segment_dirs : & BTreeSet <String>,)
fn scan(repo_root : & Path) -> Result <Vec <Finding>>
fn group_by_crate(findings : & Finding) -> BTreeMap <String, Vec <& Finding>>
fn issue_body(crate_key : & str, findings : & & Finding) -> String
fn render_debt_section(findings : & Finding) -> String

Kind

Stub / debt-marker scanner.

Item
pub enum Kind
Kind :: fn label(& self) -> & 'static str

store (other)

The scanner's second capability: findings as data.

Item
pub const STUB_SCAN_MIGRATIONS: & (& str, & str)
pub const MIGRATION_MODULE: & str
async fn migrate(pool : & PgPool) -> Result <u32>
async fn record(pool : & PgPool, findings : & Finding) -> Result <usize>
async fn count(pool : & PgPool) -> Result <usize>
async fn load(pool : & PgPool) -> Result <Vec <Finding>>
async fn hard_stubs_by_crate(pool : & PgPool) -> Result <Vec <(String, i64)>>

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_stub_scan

Public surface

`crate root`

ItemWhat it is
pub enum KindWhich class of stub a finding belongs to.
Kind :: fn label(& self) -> & 'static str
pub struct FindingOne stub site.
fn one_segment_crate_dirs(rel_files : & String) -> BTreeSet <String>The one-segment crate-root set for crate_key: every dir directly under crates/ that holds its own Cargo.toml (measured from the same file walk the scan reads — no registry to drift from the disk).
fn scan_source(rel : & str, src : & str, out : & mut Vec <Finding>, one_segment_dirs : & BTreeSet <String>,)Scan one source file.
fn scan(repo_root : & Path) -> Result <Vec <Finding>>Scan the tree rooted at repo_root.
fn group_by_crate(findings : & Finding) -> BTreeMap <String, Vec <& Finding>>Group findings per crate for the issue queue and the debt section.
fn issue_title(crate_key : & str) -> StringThe stable, deduplicatable issue title for a crate's stub queue.
fn issue_body(crate_key : & str, findings : & & Finding) -> StringThe issue body for one crate group.
pub const DEBT_BEGIN: & str
pub const DEBT_END: & str
fn render_debt_section(findings : & Finding) -> StringRender the managed TECH-DEBT.md section.
fn splice_debt(existing : & str, section : & str) -> StringSplice the managed section into the TECH-DEBT.md content (replace the existing sentinel block, or append one).

`store`

ItemWhat it is
pub const STUB_SCAN_MIGRATIONS: & (& str, & str)The schema this crate owns inside corpus_sourcecode, applied through the same module-migration ledger every other module uses.
pub const MIGRATION_MODULE: & strThe module name this crate's migrations are recorded under.
async fn migrate(pool : & PgPool) -> Result <u32>Apply this crate's migrations
async fn record(pool : & PgPool, findings : & Finding) -> Result <usize>Replace the recorded findings with this scan's, in one transaction
async fn count(pool : & PgPool) -> Result <usize>How many findings the recorded snapshot holds
async fn load(pool : & PgPool) -> Result <Vec <Finding>>Read the recorded snapshot back, without walking the tree
async fn hard_stubs_by_crate(pool : & PgPool) -> Result <Vec <(String, i64)>>Findings per crate, straight from the database

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

Boundary

Reaches into application.

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/stub-scan
Vocabulary in force (lexicon)current

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

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

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-core`applicationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, json, runtime-tokio, … (9 total)noalways
tokio^1full, macros, rt-multi-threadnoalways

Development. None.

Build. None.

Depended on by. 1 workspace crate.

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

flowchart LR
  n_tools_corpus["tools-corpus"] -->|uses| SELF
  SELF["tools-stub-scan"]
  SELF -->|runtime| n_application_core["application-core"]
  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-stub-scan`src/main.rs`
libtools_stub_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

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
CARGO_MANIFEST_DIRsrc/main.rs
CORPUS_SOURCECODE_APP_DBsrc/main.rs

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

Verification

KindCount
Unit tests9
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root1204
store704

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1720
Public modules with a //! block11
pie showData
    title Public items with rustdoc
    "Documented" : 17
    "No rustdoc detected" : 3

Metrics

MetricValue
Rust source files3
Source lines1011
Code lines816
Public API items20
Public modules1
Tests9
Examples0
Cargo features0
Direct runtime dependencies6
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "constant" : 4
    "enum" : 1
    "function" : 13
    "method" : 1
    "struct" : 1
pie showData
    title Rust source composition
    "Code" : 816
    "Blank or comment" : 195

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.

All tools · Manual