recon_gen.common.spine.supersession

Supersession family — spine generator only (no Invariant).

AY.2.b promotion of the OLD SupersessionPlant / _emit_supersession_rows. The plant emits TWO transactions sharing one logical id — the original posting + a TechnicalCorrection rewrite. The dialect’s auto-increment entry column gives the correction a higher entry; the M.2b.12 Supersession Audit dataset’s COUNT(*) OVER (PARTITION BY id) > 1 + supersedes IS NOT NULL filter catches the pair.

Not a matview violation — the audit PDF reads the <prefix>_transactions table directly for the supersession trail; no L1 invariant matview surfaces them. The generator’s intended returns an AuditFixture (AY.2.a evidence-currency subtype for audit-PDF input markers).

Registers in INVARIANT_GENERATOR_EDGES with an empty invariant tuple — the AY.2.b widening permits coverage / audit-fixture generators to land on the spine without inventing a no-op detector.

Single-edge property: no balance row → no drift trip. The identical id field on the two rows is the supersession semantic; the dialect’s BIGSERIAL / IDENTITY / AUTOINCREMENT column handles the entry discriminator.

Classes

SupersessionGenerator(account_id, ...[, prefix])

Plant TWO transactions sharing one logical id — the original posting + a TechnicalCorrection rewrite.

class recon_gen.common.spine.supersession.SupersessionGenerator(account_id, account_role, account_scope, account_parent_role, rail_name, original_amount, corrected_amount, anchor_day, prefix='spec_example')[source]

Bases: object

Plant TWO transactions sharing one logical id — the original posting + a TechnicalCorrection rewrite.

Both rows land on the same account / rail / transfer_id; only the amount_money differs (the correction “fixes” the original amount). The dialect auto-increments entry so the correction sorts after the original; the audit PDF’s CASE on entry = MAX(entry) PARTITION BY id picks the correction as the “current” row + the original as the “superseded” trail.

Account context (role / scope / parent_role) arrives as construction args; the AY.4 adapter resolves them from the OLD plant’s referenced template instance.

Parameters:
  • account_id (str)

  • account_role (str)

  • account_scope (str)

  • account_parent_role (str | None)

  • rail_name (str)

  • original_amount (float)

  • corrected_amount (float)

  • anchor_day (date)

  • prefix (str)

account_id: str
account_parent_role: str | None
account_role: str
account_scope: str
anchor_day: date
property claimed_accounts: frozenset[str]
corrected_amount: float
emit(conn, *, scenario_id=None)[source]
Return type:

None

Parameters:
  • conn (SyncConnection)

  • scenario_id (str | None)

property intended: AuditFixture

The audit-PDF supersession entry’s identity — keyed on the logical transaction id + the corrected amount (what the audit shows as the “current” value).

original_amount: float
prefix: str = 'spec_example'
rail_name: str
property transaction_id: str

The shared logical id for both rows — the supersession anchor. Deterministic on account_id.

property transfer_id: str