Skip to main content

Module partition

Module partition 

Source
Expand description

JIT, format-owned partition identities for N↔M correspondence (CFM-72).

Some changes turn one artifact into several of the same shape (a table split by year) or several into one (merged). Representing that needs a way to ask whether one artifact’s atomic sub-units are exactly the disjoint union of several others’. This module supplies the seam:

  • IdentityToken — an opaque, globally-comparable identity for one atomic sub-unit (e.g. a table row).
  • IdentityExtractor — a format-keyed capability that yields an artifact’s ordered token sequence. The engine dispatches it like writers/compaction; the format owns what a sub-unit is and how its identity is derived.
  • disjoint_cover — the generic, opaque-token coverage query that answers “is whole the clean disjoint union of a subset of pool?”.

The query is deliberately conservative (see the partition-identities ADR): it reports Coverage::Clean only when the relationship is complete (residual 0), disjoint, unambiguous, and not a whole-artifact 1:1; any messiness is a Coverage::NearMiss that a consumer declines on, leaving honest add/remove.

Structs§

Candidate
One participant in a coverage query: an opaque node handle plus its ordered identity tokens.
IdentityExtractorDescriptor
Metadata for a registered IdentityExtractor.
IdentityToken
An opaque, globally-comparable identity for one atomic sub-unit of an artifact (e.g. a table row).
PartitionMatch
A clean, complete, disjoint, unambiguous partition: whole’s token multiset is exactly the disjoint union of parts, each a strict subset.
TabularIdentityExtractor
The SDK’s tabular_v1 identity extractor: one token per row, derived from the row’s cell values (order-stable canonical JSON of the Vec<Value>). All six tabular_v1 producers (CSV, SQLite, Excel, Parquet, Avro, DBF) gain partition capability through this single extractor.

Enums§

Coverage
Outcome of disjoint_cover.

Traits§

IdentityExtractor
Derives an ordered sequence of opaque IdentityTokens for an artifact — the atomic sub-units (e.g. table rows) used by partition (split/merge) detection.

Functions§

disjoint_cover
Is whole’s token multiset the clean disjoint union of a subset of pool? Generic over opaque tokens and location-agnostic — pool may live anywhere in either tree, because the tokens carry the correspondence, not the structure. Call it with whole = an input and pool = the output residue to detect a split; swap the sides to detect a merge.