tools tier

tools-doc-ask

doc-ask: one command that detects a document's shape, runs the matching sharder (table/transcript/prose), and asks a local Ollama model a question about the resulting opaque shard -- never the raw document. Composes doc-shape + the *-shard family + local-ask's own server-startup/request logic rather than reimplementing any of it (Rule 14).

doc-ask: one command that detects a document's shape, runs the matching sharder (table/transcript/prose), and asks a local Ollama model a question about the resulting opaque shard -- never the raw document. Composes doc-shape + the *-shard family + local-ask's own server-startup/request logic rather than reimplementing any of it (Rule 14).

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/doc-ask
Edition2021
Targetstools-doc-ask, tools_doc_ask
Public items6 across 0 modules
Tests14

What it is for

Pure logic for tools-doc-ask: shard dispatch and default-question construction. I/O (reading the file, starting/calling the model) lives at the edge in main.rs.

Capabilities

crate root

Pure logic for tools-doc-ask: shard dispatch and default-question

Item
fn build_shard_json(text : & str, shape : DocShape, task : & str, allowed_outputs : Vec <String>,) -> String
fn default_question(shape : DocShape) -> String
fn build_report(shape : DocShape, shard_json : & str) -> String
fn example_questions(shape : DocShape) -> Vec <& 'static str>

ContentInspection

Pure logic for tools-doc-ask: shard dispatch and default-question

Item
pub struct ContentInspection
fn inspect_bytes(bytes : & u8) -> ContentInspection

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 ContentInspectionContent-only anomaly signals -- computed over raw bytes, never reported alongside the actual bytes/content, so this is safe to print even for a file that turns out not to be valid UTF-8 prose at all (the metadata route's whole point: cheap, no-LLM triage before deciding whether a document is even the kind of thing this toolchain can shard).
fn inspect_bytes(bytes : & u8) -> ContentInspectionInspect raw bytes for anomalies without assuming they're valid UTF-8 or even text at all -- callers decide what to do with an is_valid_utf8: false result rather than this function guessing.
fn build_shard_json(text : & str, shape : DocShape, task : & str, allowed_outputs : Vec <String>,) -> StringBuild the opaque structural shard for text given its already-detected shape, and return it as pretty JSON
fn default_question(shape : DocShape) -> StringA shape-tailored default question, used when the operator doesn't supply one: always asks the model to explain the JSON fields first (a cheap, checkable grounding test -- a model that gets the field meanings wrong shouldn't be trusted on the substantive questions either), then a handful of real, shape-specific questions worth asking of that shard.
fn build_report(shape : DocShape, shard_json : & str) -> StringBuild a human-readable, no-LLM summary from an already-built shard's JSON (as produced by build_shard_json)
fn example_questions(shape : DocShape) -> Vec <& 'static str>A broader, curated list of example questions per shape, for discovery (tools-doc-ask questions <path>) -- richer than default_question's tight 4-question default, covering every signal each shard family actually emits (including the ones added after the first pass: sentiment, POS proportions, embedding clusters).

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

Boundary

Reaches into domain, infrastructure.

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

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

flowchart LR
  n_tools["tools"] --> n_domain["domain"]
  n_tools["tools"] --> n_infrastructure["infrastructure"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`domain-prose-shard`domainnoalways
`domain-table-shard`domainnoalways
`domain-transcript-shard`domainnoalways
`infrastructure-ai`infrastructurenoalways
`tools-doc-shape`toolsnoalways
`tools-local-ask`toolsnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
clap^4derivenoalways
serde^1derive, derivenoalways
serde_json^1noalways
tokio^1full, macros, rt-multi-threadnoalways

Development, in this workspace.

CrateTierOptionalOnly on
`tools-cli-conformance`toolsnoalways

Build. None.

Depended on by. Nothing in this workspace.

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

flowchart LR
  SELF["tools-doc-ask"]
  SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"]
  SELF -->|runtime| n_domain_prose_shard["domain-prose-shard"]
  SELF -->|runtime| n_domain_table_shard["domain-table-shard"]
  SELF -->|runtime| n_domain_transcript_shard["domain-transcript-shard"]
  SELF -->|runtime| n_infrastructure_ai["infrastructure-ai"]
  SELF -->|runtime| n_tools_doc_shape["tools-doc-shape"]
  SELF -->|runtime| n_tools_local_ask["tools-local-ask"]
  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-doc-ask`src/main.rs`
libtools_doc_ask`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 runtimeyes
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.

No workspace crate depends on this one.

Verification

KindCount
Unit tests14
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root600

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc66
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 6
    "No rustdoc detected" : 0

Metrics

MetricValue
Rust source files2
Source lines704
Code lines570
Public API items6
Public modules0
Tests14
Examples0
Cargo features0
Direct runtime dependencies10
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "function" : 5
    "struct" : 1
pie showData
    title Rust source composition
    "Code" : 570
    "Blank or comment" : 134

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