Skip to main content

Module tranche

Module tranche 

Source
Expand description

Conservative-filing DeclareTranche record path + the tranche⇄allocation mutual-exclusion guard (D-8 UX layer). A tranche is undocumented BTC declared at $0 basis (the IRS fallback), folded to an EstimatedConservative lot homed at window_end. See design/conservative-filing/SPEC.md D-8.

The engine backstop (Task 5 — SafeHarborUnconservable denies a SafeHarborAllocation effectiveness over a live tranche residue) is the GUARANTEE; these record-time guards are the early, friendly error. They are the single source of the mutual-exclusion predicate for ALL FOUR allocation append sites (CLI safe_harbor_allocate + safe_harbor_attest; TUI persist_safe_harbor_allocate + persist_safe_harbor_attest) and the tranche record path here.

Functions§

declare_tranche
Append a DeclareTranche decision (a $0-basis EstimatedConservative lot) and persist.
guard_allocation_vs_tranche
ALLOCATION-side guard (the chokepoint for all four allocation append sites): refuse recording a SafeHarborAllocation while a pre-2025 tranche is on file. v1 makes them mutually exclusive (D-8).
in_force_allocation_exists
True iff an IN-FORCE (non-voided) SafeHarborAllocation exists — effective OR inert (arch r2 New-3: an inert allocation can be flipped effective, so it too collides with a new pre-2025 tranche). Deliberately NOT scoped to effective allocations (that would let a pre-2025 tranche slip in beside an inert one and silently discard it once the allocation later goes effective).
pre2025_tranche_exists
True iff a non-voided PRE-2025 (window_end < TRANSITION_DATE) DeclareTranche exists — the only tranche that collides with the pre-2025 Universal residue a SafeHarborAllocation reconstructs (tax r1 I-2). A window_end ≥ 2025 tranche folds into a post-transition per-wallet pool and never touches Rev-Proc-2024-28, so it does NOT block an allocation.
wallet_is_known
P8 Nit: is wallet referenced by any prior event — an import’s wallet, or a prior tranche declaration’s target wallet? A false result means --wallet likely has a TYPO. This drives a WARN only, NEVER a refusal: a $0 tranche lot in any wallet still files at $0 (tax-neutral), so a typo merely strands the lot in a phantom wallet rather than mis-stating tax. Pure over the event log.