Skip to main content

TransactionConfig

Struct TransactionConfig 

Source
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: LineItemDistributionConfig

Line item distribution

§debit_credit_distribution: DebitCreditDistributionConfig

Debit/credit balance distribution

§even_odd_distribution: EvenOddDistributionConfig

Even/odd line count distribution

§source_distribution: SourceDistribution

Transaction 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: SeasonalityConfig

Seasonality configuration

§amounts: AmountDistributionConfig

Amount distribution

§benford: BenfordConfig

Benford’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: SourceConditionalAccountPairConfig

SOTA-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

Source§

fn clone(&self) -> TransactionConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransactionConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransactionConfig

Source§

fn default() -> TransactionConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TransactionConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for TransactionConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more