1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Pure event-scan predicates for the tranche⇄allocation mutual-exclusion guard (D-8).
//!
//! Defensive Filing Wizard Task 5 (C-2): MOVED here from `btctax-cli::cmd::tranche` so btctax-core
//! callers (Task 6's `journey_view` safe-harbor read, Task 8's declare flow) can consult them without a
//! cli→core dependency inversion. All three predicates are events-only scans (never touch persistence);
//! `TRANSITION_DATE` is the same conservative-filing/safe-harbor boundary used everywhere else in core.
//!
//! The GUARD functions themselves (`guard_allocation_vs_tranche` / `guard_tranche_vs_allocation`) STAY in
//! `btctax-cli::cmd::tranche` — they map a refusal to a `CliError`, a cli-only concern. Only these three
//! pure, `CliError`-free scans moved; this module is the single source for both crates.
use crateTRANSITION_DATE;
use crateEventPayload;
use crateEventId;
use crateLedgerEvent;
use BTreeSet;
/// The set of event ids targeted by any `VoidDecisionEvent` in the log — the record-time "voided" view.
///
/// Mirrors `resolve.rs` pass-1 step 1a and the attest site's own `voided` set: a decision is not-in-force
/// once a `VoidDecisionEvent` names it. (A void of a `SafeHarborAllocation` is resolver-deferred to Task 12
/// for its EFFECTIVE-vs-inert semantics, but for THIS friendly record-time layer the presence of the void
/// is enough — the engine backstop is the guarantee behind it.)
pub
/// 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).
/// 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.