Expand description
Central concentration abstraction (#143, Phase 1).
Post-generation passes that reshape the JE batch’s distributional structure toward a corpus-derived target. Single integration point in the orchestrator sidesteps the multi-generator coverage problem that blocked SOTA-8 (#141) and SOTA-11 (#142) during the SOTA-N round.
Design reference: docs/superpowers/specs/2026-05-23-concentration-pass-INDEX.md
Invariants every implementor MUST preserve:
- Per-JE balance:
sum(debits) == sum(credits) - Subledger-bridge accounts unchanged (see
STRUCTURAL_BRIDGE_ACCOUNTS) - Document-chain refs (
DocumentReferenceis keyed bydocument_id, not bygl_account— substituting non-bridge accounts is safe) - Determinism: same RNG seed + same input batch ⇒ same output
§Phase 1 (this commit)
ConcentrationPasstrait +ConcentrationStatsaggregateConcentrationPipelineruns passes in order with per-pass RNG isolationSourceConditionalRarityPass— wraps shipped SOTA-12 taggerTradingPartnerPoolPass— closes SOTA-11.1 / #142 coverage gap
§Phase 2 (next commit)
AccountPairSubstitutionPass— corpus-PMF-driven account rewriting respecting the bridge allowlist + AccountType invariant
Re-exports§
pub use account_pair_substitution::AccountPairSubstitutionError;pub use account_pair_substitution::AccountPairSubstitutionPass;pub use consolidation_outlier::ConsolidationOutlierPass;pub use source_blanking::SourceBlankingPass;pub use source_conditional_rarity_pass::SourceConditionalRarityPass;pub use trading_partner_pool::TradingPartnerPoolPass;
Modules§
- account_
pair_ substitution AccountPairSubstitutionPass— Phase 2 of the central concentration abstraction (#143). Reshapes the per-JE(debit_account, credit_account)edge distribution toward a corpus-empirical PMF.- consolidation_
outlier ConsolidationOutlierPass— v5.30 B2 (#154) heavy-tail outlier emission.- source_
blanking SourceBlankingPass— Phase 1.5 of the central concentration abstraction (#143). Closes SOTA-7 (#132) by nullingsap_source_codeon a configurable fraction of JEs to match the corpus’s ~21% blank-source rate.- source_
conditional_ rarity_ pass SourceConditionalRarityPass— Phase 1 trait wrapper around the already- shipped SOTA-12 tagger (crate::anomaly::source_conditional_rarity).- trading_
partner_ pool TradingPartnerPoolPass— closes the SOTA-11.1 / #142 coverage gap by rewriting JE-linetrading_partnerstrings to a target pool size.
Structs§
- Concentration
Pipeline - Ordered, deterministic execution of zero or more
ConcentrationPassinstances. Each pass receives a dedicated ChaCha8 substream so adding or removing a pass does not perturb the RNG state of any other pass. - Concentration
Stats - Per-pass aggregate counters. Serialised into the orchestrator’s run report.
Enums§
- Concentration
Pipeline Error - Errors from constructing a
ConcentrationPipeline. Currently only one fallible source (Phase-2 AccountPairSubstitutionPass loads its PMF file); the enum is open for future pass-construction errors.
Constants§
- STRUCTURAL_
BRIDGE_ ACCOUNTS - The 7 subledger-bridge accounts whose balances must be preserved across any post-process substitution. Aggregating to subledger totals (AR/AP aging) or netting across matching pairs (GR/IR, IC, wire, fixed-asset acquisition), substituting them silently breaks reconciliation reports.
Traits§
- Concentration
Pass - A post-generation transformation reshaping the JE batch’s concentration / distributional structure toward a target. See module-level docs for the invariants every implementor must preserve.
Functions§
- is_
structural_ bridge - True iff the account code is a subledger-bridge account that must be preserved across post-process substitution. Phase-1 passes don’t substitute accounts at all so this is currently informational; Phase-2’s account-pair substitution pass will gate substitution on this.