domain tier

domain-table-shard

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.

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.

Tierdomain
Roleunclassified (baselined)
Pathcrates/domain/table-shard
Edition2021
Targetstable-shard, domain_table_shard
Public items9 across 0 modules
Tests12

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`

ItemWhat it is
pub struct TableOne 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 ColumnTypeA column's inferred structural type
pub struct NumericSummarySummary statistics for a numeric column
pub struct ColumnShardOne column's structural facts
fn classify_column(name : & str, values : & & str) -> ColumnShardClassify one column from its non-header cell values
pub struct TableShardOne table's structural facts: shape plus every column's shard.
pub struct DocumentShardThe 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>) -> DocumentShardBuild 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)
Locationcrates/domain/table-shard
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
clap^4derivenoalways
pulldown-cmark^0.10noalways
serde^1derive, derivenoalways
serde_json^1noalways

Development, in this workspace.

CrateTierOptionalOnly on
`tools-cli-conformance`toolsnoalways

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

KindNameSource
bintable-shard`src/main.rs`
libdomain_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

PropertyEvidence
async public surfacenone detected
async runtimenone detected
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.

3 workspace crates depend on this one: tools-doc-ask, tools-doc-shape, tools-knowitall.

Verification

KindCount
Unit tests12
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root906

What the tests establish, by name:

Documentation coverage

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

Metrics

MetricValue
Rust source files2
Source lines468
Code lines336
Public API items9
Public modules0
Tests12
Examples0
Cargo features0
Direct runtime dependencies4
Workspace reverse dependencies3
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.

All domain · Manual