Local, deterministic structural decomposition of GFM markdown tables: parses header/separator/data rows, infers a per-column type, and emits an opaque shard of structural facts (row count, column count, per-column type, null/distinct counts, numeric summary stats) -- the real cell values never appear in the emitted shard, only their shape. Column headers are treated as schema, not content, and pass through as-is. Same document-structural-decomposition gap as domain-transcript-shard (ADR 0035), applied to tabular data instead of speaker-turn dialogue. Pure logic, zero I/O beyond reading the input file, zero AI calls.
| Tier | domain |
| Role | unclassified (baselined) |
| Path | crates/domain/table-shard |
| Edition | 2021 |
| Targets | table-shard, domain_table_shard |
| Public items | 9 across 0 modules |
| Tests | 12 |
What it is for
Local, deterministic structural decomposition of GFM markdown tables: find table blocks, parse header/separator/data rows, and reduce each column to structural facts -- type, null/distinct counts, numeric summary stats -- without ever retaining a real cell value past build_shard. Column headers are schema, not content, and pass through as-is; cell values never appear in the emitted DocumentShard.
Same "document structural decomposition" gap as domain-transcript-shard (ADR 0035), applied to tabular data instead of speaker-turn dialogue. Nothing here calls an AI or makes a network request.
Table detection is delegated to pulldown-cmark's GFM-tables extension rather than hand-rolled line parsing -- a real, widely-used markdown parser handles escaped pipes, inline formatting inside cells, and malformed/short rows correctly; a hand-rolled split('|') scanner does not, and silently mis-parsing a legal fact-pattern table is a worse failure than a build dependency.
Capabilities
crate root
Local, deterministic structural decomposition of GFM markdown tables:
| Item |
|---|
fn build_shard(tables : & Table, task : & str, allowed_outputs : Vec <String>) -> DocumentShard |
ColumnShard
Local, deterministic structural decomposition of GFM markdown tables:
| Item |
|---|
pub struct ColumnShard |
fn classify_column(name : & str, values : & & str) -> ColumnShard |
ColumnType
Local, deterministic structural decomposition of GFM markdown tables:
| Item |
|---|
pub enum ColumnType |
DocumentShard
Local, deterministic structural decomposition of GFM markdown tables:
| Item |
|---|
pub struct DocumentShard |
NumericSummary
Local, deterministic structural decomposition of GFM markdown tables:
| Item |
|---|
pub struct NumericSummary |
Table
Local, deterministic structural decomposition of GFM markdown tables:
| Item |
|---|
pub struct Table |
fn parse_tables(text : & str) -> Vec <Table> |
TableShard
Local, deterministic structural decomposition of GFM markdown tables:
| Item |
|---|
pub struct TableShard |
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 struct Table | One parsed table block: the header cells and every data row's cells, in document order |
fn parse_tables(text : & str) -> Vec <Table> | Scan text for GFM table blocks via pulldown-cmark's table events |
pub enum ColumnType | A column's inferred structural type |
pub struct NumericSummary | Summary statistics for a numeric column |
pub struct ColumnShard | One column's structural facts |
fn classify_column(name : & str, values : & & str) -> ColumnShard | Classify one column from its non-header cell values |
pub struct TableShard | One table's structural facts: shape plus every column's shard. |
pub struct DocumentShard | The minimal-disclosure document shard: every table's structure, and the fixed question being asked |
fn build_shard(tables : & Table, task : & str, allowed_outputs : Vec <String>) -> DocumentShard | Build a document shard from parsed tables: for each table, classify every column from its own cells and record row/column shape |
No pub use re-exports: every item above is declared in this crate.
Boundary
Depends on no other workspace tier.
Shares tier domain with 41 other crates: domain-agreements, domain-ai-report, domain-billing, domain-catalog, domain-classify, domain-comments, domain-competitive-intel, domain-contact, … (41 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) | domain |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/domain/table-shard |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
clap | ^4 | derive | no | always |
pulldown-cmark | ^0.10 | — | 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. 3 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_doc_shape["tools-doc-shape"] -->|uses| SELF n_tools_knowitall["tools-knowitall"] -->|uses| SELF SELF["domain-table-shard"] SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"] 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 | table-shard | `src/main.rs` |
| lib | domain_table_shard | `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
3 workspace crates depend on this one: tools-doc-ask, tools-doc-shape, tools-knowitall.
Verification
| Kind | Count |
|---|---|
| Unit tests | 12 |
| 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 | 9 | 0 | 6 |
What the tests establish, by name:
build_shard_never_leaks_a_real_text_cell_value—src/lib.rsbuild_shard_reports_correct_shape_for_both_tables—src/lib.rsclassify_column_detects_numeric_with_correct_summary—src/lib.rsclassify_column_detects_text_and_counts_nulls_and_distinct—src/lib.rsclassify_column_does_not_panic_on_the_literal_string_nan—src/lib.rsclassify_column_even_count_median_averages_the_two_middle_values—src/lib.rsclassify_column_treats_a_mixed_column_as_text_not_numeric—src/lib.rsparse_tables_finds_both_blocks_and_ignores_surrounding_prose—src/lib.rsparse_tables_handles_aligned_separator_rows—src/lib.rsparse_tables_handles_an_escaped_pipe_inside_a_cell—src/lib.rsparse_tables_pads_a_short_row_with_empty_cells_per_gfm_spec—src/lib.rscli_definition_conforms—src/main.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 9 | 9 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 9
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 2 |
| Source lines | 468 |
| Code lines | 336 |
| Public API items | 9 |
| Public modules | 0 |
| Tests | 12 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 4 |
| Workspace reverse dependencies | 3 |
pie showData
title Public API by kind
"enum" : 1
"function" : 3
"struct" : 5
pie showData
title Rust source composition
"Code" : 336
"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.