pub struct TransactionConfig {Show 17 fields
pub line_item_distribution: LineItemDistributionConfig,
pub debit_credit_distribution: DebitCreditDistributionConfig,
pub even_odd_distribution: EvenOddDistributionConfig,
pub source_distribution: SourceDistribution,
pub synthetic_source_codes: Option<bool>,
pub recurring_templates: Option<bool>,
pub reversal_rate: Option<f64>,
pub account_concentration: Option<bool>,
pub allocation_batch_rate: Option<f64>,
pub business_unit_dimension: Option<bool>,
pub foreign_currency_rate: Option<f64>,
pub seasonality: SeasonalityConfig,
pub amounts: AmountDistributionConfig,
pub benford: BenfordConfig,
pub lines_per_je_cap: Option<usize>,
pub archetype_reuse_probability: Option<f64>,
pub source_conditional_account_pair: SourceConditionalAccountPairConfig,
}Expand description
Transaction generation configuration.
Fields§
§line_item_distribution: LineItemDistributionConfigLine item distribution
debit_credit_distribution: DebitCreditDistributionConfigDebit/credit balance distribution
even_odd_distribution: EvenOddDistributionConfigEven/odd line count distribution
source_distribution: SourceDistributionTransaction source distribution
synthetic_source_codes: Option<bool>T2-D Source-mix breadth. When unset or true (the default), the
emitted source column is drawn from a generic SAP document-type mix
(~25 codes, entropy ~2.7) instead of the coarse TransactionSource
enum (~4 values, entropy ~0.75), closing the source-mix gap measured
in experiments/ml/FINDINGS.md §6. Industry priors, when loaded, take
precedence. Set false to restore the legacy enum labels. Option
(not bare bool) so the default is genuinely on under both serde and
Default::default().
recurring_templates: Option<bool>SOTA-1 Recurring / standard-journal templating. When unset or true
(the default), the no-priors generation path reuses a small per-(company,
process) library of standard JE account-archetypes with high probability,
so standard postings recur (and a hot subset of accounts dominates)
instead of every JE drawing fresh uniform accounts. Matches the corpus’s
heavy templating (FINDINGS.md sec.8: 97% recurring, top-50 cover 65%; vs
the engine’s 758/1k unique). Reuse overrides only account choice (the
main RNG + amounts/dates/counts are unchanged). Set false for the
legacy uniform-per-line account selection.
reversal_rate: Option<f64>SOTA-5 Fraction of journal entries that are reversals/corrections of
a recent JE (swap dr/cr, reference the original) — a process auditors
specifically look for, and largely absent from the engine (FINDINGS.md
sec.8: corpus reversal-proxy ~10% vs synthetic ~0.2%). Unset → a default
of ~0.10 (matching the corpus proxy); 0.0 disables it. Reversals are
interspersed without perturbing the normal JEs (separate RNG + derived id).
account_concentration: Option<bool>SOTA-2 Concentrate posting activity onto a hot subset of accounts via
a Zipf (power-law) override of the per-line account pick, so a few
accounts carry most lines like a real GL (FINDINGS.md sec.8: corpus
top-10% of accounts ≈ 95% of lines vs the engine’s near-uniform ~0.21).
The uniform draw is still consumed (amounts/dates/counts unchanged) — only
the chosen account moves toward the hot set. Set false for the legacy
uniform-over-pool selection. Default-on when unset.
allocation_batch_rate: Option<f64>SOTA-6 Fraction of journal entries that are allocation/assessment
batches — large 1-to-many postings (one cost pool spread across many
cost centers) that drive the corpus lines-per-JE tail (FINDINGS.md
sec.8: AB docs ~52 lines vs the engine’s ~4.6 mean with no large-batch
process). Each batch carries ~30-80 cost-center-spread sub-lines and
stays balanced. Unset → a small default (~0.008, ≈8% of lines); 0.0
disables. Interspersed without perturbing the normal JEs (separate RNG +
derived id, reusing a recent JE’s header).
business_unit_dimension: Option<bool>SOTA-3 Populate a line-level business_unit dimension — an
organisational segment that rolls up the cost center, or the profit
center as fallback (the same dimension value always maps to the same BU).
The corpus carries a BU dimension (~11 codes) the engine lacked entirely;
this fills it wherever a cost or profit center is present (~corpus fill),
so BU-level analytics are coherent. Default-on when unset; false
leaves business_unit empty (legacy).
foreign_currency_rate: Option<f64>SOTA-4 Fraction of journal entries that post in a foreign
(document) currency — SAP-style: debit_amount/credit_amount/
local_amount stay the company-ledger amount (DMBTR; the trial balance
is unaffected), and the line’s transaction_amount (WRBTR) plus
header.currency (WAERS) / header.exchange_rate carry the foreign
value. The corpus shows ~3.5% functional≠reporting (FINDINGS §8).
Unset/0.0 → all company-currency (default). Additive — ledger
coherence is preserved; enable for corpus-matching / FX realism.
seasonality: SeasonalityConfigSeasonality configuration
amounts: AmountDistributionConfigAmount distribution
benford: BenfordConfigBenford’s Law compliance configuration
lines_per_je_cap: Option<usize>SOTA-10 (FINDINGS §14): optional hard cap on total lines per JE. Corpus has
p99.9 ~99 lines / max ~924; the synthetic engine occasionally produces
2000+-line monster JEs that degrade the audit packet’s signal-to-noise.
None = no cap (legacy); ~100 is a realism-matching default. Applies after
copula adjustment; preserves balance by scaling debit/credit proportionally.
archetype_reuse_probability: Option<f64>SOTA-9 (FINDINGS §14): archetype reuse probability for the recurring-templates
process (overrides the historical 0.90 default). Corpus recurring share ~0.97;
raising this concentrates edges/je toward the corpus value (currently 8.75×
too diffuse). Range [0.0, 1.0]. None = use legacy 0.90.
source_conditional_account_pair: SourceConditionalAccountPairConfigSOTA-8 (FINDINGS §14): source-conditional Dirichlet account-pair sampler. Models the corpus finding that per-source account usage is concentrated (entropy ~0.68 vs synth 0.97) over a larger pool (~23 vs 5 accts/source). Default off — opt-in so existing synthetic streams stay byte-identical; enable for audit-realism + tighter inverse-audit normal manifold.
Trait Implementations§
Source§impl Clone for TransactionConfig
impl Clone for TransactionConfig
Source§fn clone(&self) -> TransactionConfig
fn clone(&self) -> TransactionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransactionConfig
impl Debug for TransactionConfig
Source§impl Default for TransactionConfig
impl Default for TransactionConfig
Source§fn default() -> TransactionConfig
fn default() -> TransactionConfig
Source§impl<'de> Deserialize<'de> for TransactionConfig
impl<'de> Deserialize<'de> for TransactionConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TransactionConfig
impl RefUnwindSafe for TransactionConfig
impl Send for TransactionConfig
impl Sync for TransactionConfig
impl Unpin for TransactionConfig
impl UnsafeUnpin for TransactionConfig
impl UnwindSafe for TransactionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.