tools tier

tools-doc-read

Browse the workspace's crate READMEs from the terminal: index them with a one-line summary each, open one by crate name (no path, no .md), or search across all of them -- paged through $PAGER. The estate has one README per crate across seven tiers, which is more than anyone greps by hand and more than fits on a screen; `gen-ai-context` regenerates the crate index for AI_CONTEXT.md but nothing reads them back.

Browse the workspace's crate READMEs from the terminal: index them with a one-line summary each, open one by crate name (no path, no .md), or search across all of them -- paged through $PAGER. The estate has one README per crate across seven tiers, which is more than anyone greps by hand and more than fits on a screen; `gen-ai-context` regenerates the crate index for AI_CONTEXT.md but nothing reads them back.

Tiertools
Roletooling
Pathcrates/tools/doc-read
Edition2021
Targetsdoc-read, tools_doc_read
Public items32 across 1 module
Tests29

What it is for

Index and address the workspace's crate READMEs.

Two sources, one question set: this module answers from the README files a person reads, and rows answers the same standing questions from corpus_sourcecode. A caller picks a source; it does not restate a question, because a restated question answers differently within a week.

Pure logic only — resolving a crate reference, summarising a README, ranking search hits — so it is testable without a filesystem. The walking, reading and paging live in main.rs.

The addressing rule is the point: a crate is named identity-auth in its manifest and lives at crates/identity/auth, so an operator reasonably types any of identity-auth, identity/auth or just auth. All three resolve, and a bare name that matches several crates reports the candidates instead of picking one.

Capabilities

crate root

Index and address the workspace's crate READMEs.

Item
fn resolve <'a>(docs : & 'a CrateDoc, query : & str) -> Resolution <'a>
fn summarize(readme : & str, width : usize) -> String
fn first_sentence(text : & str, width : usize) -> String
fn bug_digest(markdown : & str) ->(String, String)
fn crate_of_path(path : & str) -> Option <(String, String)>
fn pending_migrations(files : & u64, applied : & u64) -> Vec <u64>
fn applied_beyond_files(files : & u64, applied : & u64) -> Vec <u64>
pub const TIER_ORDER: & & str
fn tier_rank(tier : & str) -> usize
fn tier_glosses(manifest : & str) -> std::collections::BTreeMap <String, String>

CrateDoc

Index and address the workspace's crate READMEs.

Item
pub struct CrateDoc
CrateDoc :: fn slug(& self) -> String

Hit

Index and address the workspace's crate READMEs.

Item
pub struct Hit
fn search_readme(crate_name : & str, body : & str, term : & str) -> Vec <Hit>

LexiconRow

Index and address the workspace's crate READMEs.

Item
pub struct LexiconRow
fn parse_lexicon(tsv : & str) -> Vec <LexiconRow>

Resolution

Index and address the workspace's crate READMEs.

Item
pub enum Resolution<'a>

rows (other)

The same standing questions, answered from rows rather than from files.

Item
pub const MAX_ROWS: i64
pub const STATEMENT_TIMEOUT_MS: i32
pub const MAX_SUBJECT_BYTES: usize
fn ask(question : & str, subject : & str) -> Result <(Question, String), AskRefusal>

AskRefusal

The same standing questions, answered from rows rather than from files.

Item
pub enum AskRefusal
AskRefusal :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

Question

The same standing questions, answered from rows rather than from files.

Item
pub enum Question
Question :: fn as_str(self) -> & 'static str
Question :: fn source(self) -> Source
Question :: fn all() -> Question; 7
Question :: fn description(self) -> & 'static str
Question :: fn sql(self) -> & 'static str
Question :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

Source

The same standing questions, answered from rows rather than from files.

Item
pub enum Source
Source :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

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_doc_read

Public surface

`crate root`

ItemWhat it is
pub struct CrateDocOne crate's README, as the index sees it.
CrateDoc :: fn slug(& self) -> Stringidentity/auth — how the index prints a crate's location.
pub enum Resolution<'a>What a crate reference resolved to.
fn resolve <'a>(docs : & 'a CrateDoc, query : & str) -> Resolution <'a>Resolve identity-auth, identity/auth, auth, or a unique prefix
fn summarize(readme : & str, width : usize) -> StringThe first line of real prose in a README, for the one-line index
fn first_sentence(text : & str, width : usize) -> StringThe first sentence of a description, for a one-line index entry
pub struct LexiconRowOne enforced vocabulary rule, as the lexicon records it.
fn parse_lexicon(tsv : & str) -> Vec <LexiconRow>Parse docs/reference/lexicon-policy.tsv
fn bug_digest(markdown : & str) ->(String, String)Title and severity/status of a bug file, for a one-line listing
fn crate_of_path(path : & str) -> Option <(String, String)>crates/identity/auth/src/api_key.rs -> ("identity", "auth")
fn pending_migrations(files : & u64, applied : & u64) -> Vec <u64>Migration versions present as files but not recorded as applied
fn applied_beyond_files(files : & u64, applied : & u64) -> Vec <u64>Versions recorded as applied with no matching file — a database ahead of the code, which is how a checkout ends up unable to build against its own DB.
pub struct HitOne matching line from a search.
fn search_readme(crate_name : & str, body : & str, term : & str) -> Vec <Hit>Case-insensitive line matches in one README.
pub const TIER_ORDER: & & strTier order for listings: the dependency direction of the estate, so a reader goes bottom-up rather than alphabetically through unrelated layers.
fn tier_rank(tier : & str) -> usizeSort key for a tier: its position in TIER_ORDER, unknown tiers last.
fn tier_glosses(manifest : & str) -> std::collections::BTreeMap <String, String>What each tier MEANS, read from the section comments in the workspace manifest

`rows`

ItemWhat it is
pub const MAX_ROWS: i64How many rows any question may return, whatever it was asked.
pub const STATEMENT_TIMEOUT_MS: i32How long a single read may run before the database is told to stop.
pub const MAX_SUBJECT_BYTES: usizeThe longest subject a question accepts, so a pasted file cannot become a query parameter.
pub enum SourceWhich database answers a question
Source :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub enum QuestionOne of the workspace's standing questions.
Question :: fn as_str(self) -> & 'static strThe name a caller uses.
Question :: fn source(self) -> SourceWhich record answers it.
Question :: fn all() -> Question; 7Every question, in the order they are advertised.
Question :: fn description(self) -> & 'static strOne line saying what the question answers, for a caller that has to describe the catalog to someone else.
Question :: fn sql(self) -> & 'static strThe parameterised read
Question :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub enum AskRefusalWhy a question could not be asked.
AskRefusal :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
fn ask(question : & str, subject : & str) -> Result <(Question, String), AskRefusal>Resolve a caller's arguments into a question and its subject

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/doc-read
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_imp["tools-imp"] -->|uses| SELF
  SELF["tools-doc-read"]
  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
bindoc-read`src/main.rs`
libtools_doc_read`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 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
PAGERsrc/main.rs

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

Verification

KindCount
Unit tests29
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root1602
rows705

What the tests establish, by name:

Documentation coverage

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

Metrics

MetricValue
Rust source files3
Source lines2412
Code lines2013
Public API items32
Public modules1
Tests29
Examples0
Cargo features0
Direct runtime dependencies1
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "constant" : 4
    "enum" : 4
    "function" : 12
    "method" : 9
    "struct" : 3
pie showData
    title Rust source composition
    "Code" : 2013
    "Blank or comment" : 399

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