tools-doc-shape: detect a document's structural shape (tabular, speaker-turn transcript, or prose) and report which sharder applies, without ever printing real content -- structural counts only. Routes to domain-table-shard or domain-transcript-shard; reports prose honestly as unsupported rather than guessing.
| Tier | tools |
| Role | unclassified (baselined) |
| Path | crates/tools/doc-shape |
| Edition | 2021 |
| Targets | tools-doc-shape, tools_doc_shape |
| Public items | 3 across 0 modules |
| Tests | 7 |
What it is for
Detect a document's structural shape so the right sharder gets picked automatically instead of the operator guessing: tabular (GFM tables) -> domain-table-shard, speaker-turn dialogue -> primitives- transcript-shard, otherwise prose, which neither existing sharder covers -- reported honestly as unsupported rather than forced into the wrong shape.
Reuses both sharders' own real parsers to detect shape (never a separate heuristic reimplementation of table/turn detection) and never prints or returns a real cell value, cell, or line of prose -- only structural counts, the same disclosure boundary as both sharders themselves.
Capabilities
DocShape
Detect a document's structural shape so the right sharder gets picked
| Item |
|---|
pub enum DocShape |
ShapeReport
Detect a document's structural shape so the right sharder gets picked
| Item |
|---|
pub struct ShapeReport |
fn detect_shape(text : & str) -> ShapeReport |
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`
| Item | What it is |
|---|---|
pub enum DocShape | The detected shape, and which sharder (if any) applies. |
pub struct ShapeReport | Structural counts only -- no table headers, no turn text, no real content of any kind |
fn detect_shape(text : & str) -> ShapeReport | Detect text's shape |
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into domain.
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) |
| Location | crates/tools/doc-shape |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_tools["tools"] --> n_domain["domain"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `domain-table-shard` | domain | no | always |
| `domain-transcript-shard` | domain | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
clap | ^4 | derive | no | always |
serde | ^1 | derive, derive | no | always |
serde_json | ^1 | — | no | always |
Development, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `tools-cli-conformance` | tools | no | always |
Build. None.
Depended on by. 2 workspace crates.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_tools_doc_ask["tools-doc-ask"] -->|uses| SELF n_tools_knowitall["tools-knowitall"] -->|uses| SELF SELF["tools-doc-shape"] SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"] SELF -->|runtime| n_domain_table_shard["domain-table-shard"] SELF -->|runtime| n_domain_transcript_shard["domain-transcript-shard"] 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
| Kind | Name | Source |
|---|---|---|
| bin | tools-doc-shape | `src/main.rs` |
| lib | tools_doc_shape | `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
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none 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.
Related capabilities
2 workspace crates depend on this one: tools-doc-ask, tools-knowitall.
Verification
| Kind | Count |
|---|---|
| Unit tests | 7 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 3 | 0 | 4 |
What the tests establish, by name:
a_document_with_no_table_and_only_incidental_capitalized_headers_is_prose_not_transcript—src/lib.rsa_handful_of_isolated_all_caps_labels_does_not_misroute_to_transcript—src/lib.rsdetects_prose_shape_from_a_document_with_neither_signal—src/lib.rsdetects_tabular_shape_from_the_real_table_shard_fixture—src/lib.rsdetects_transcript_shape_from_the_real_transcript_shard_fixture—src/lib.rsempty_input_is_prose_not_a_divide_by_zero_panic—src/lib.rscli_definition_conforms—src/main.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 3 | 3 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 3
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 2 |
| Source lines | 216 |
| Code lines | 148 |
| Public API items | 3 |
| Public modules | 0 |
| Tests | 7 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 5 |
| Workspace reverse dependencies | 2 |
pie showData
title Public API by kind
"enum" : 1
"function" : 1
"struct" : 1
pie showData
title Rust source composition
"Code" : 148
"Blank or comment" : 68
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.