nx_efile_gate.nx source
↩ module page · 57 lines · 4349 B
1// nx_efile_gate.nx -- INDEPENDENT GATE: e-filing submission vs acceptance vs rejection.
2// ZERO storage. The teeth: a document SUBMITTED before the deadline but REJECTED was never filed and the
3// clock never stopped; relation back is an EXPLICIT jurisdictional permission, never a default; and a
4// correction that relates back to an ALREADY-LATE original is still late.
5// license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
6
7import "nx_efile_lib.nx"
8import "nx_gate_verdict.nx"
9
10func main(argc: i64, argv: *i64) -> i64 {
11 let ctr: *i64 = gv_ctr()
12 let lbl: *u8 = sys_mmap(32)
13
14 let dl: i64 = 20000
15 let U: i64 = EFL_UNSET
16
17 gv_head("NISHI-EFILE-GATE (submission is not filing; acceptance governs; relation back is explicit)" as *u8)
18
19 // ---- S: the ordinary path ----
20 gv_check("S1 submitted and accepted before the deadline -> TIMELY" as *u8, efl_status_pure(19998, 19999, 0, dl, 0, U) == EFL_FILED_TIMELY, ctr)
21 gv_check("S2 accepted ON the deadline -> TIMELY" as *u8, efl_status_pure(19998, 20000, 0, dl, 0, U) == EFL_FILED_TIMELY, ctr)
22 gv_check("S3 accepted one day after -> FILED LATE" as *u8, efl_status_pure(19998, 20001, 0, dl, 0, U) == EFL_FILED_LATE, ctr)
23 gv_check("S4 nothing submitted at all -> NOT FILED" as *u8, efl_status_pure(U, U, 0, dl, 0, U) == EFL_NOT_FILED, ctr)
24
25 // ---- u2605R: THE REJECTION TRAP ----
26 gv_check("R1 submitted BEFORE the deadline but REJECTED -> NOT filed" as *u8, efl_status_pure(19999, U, 1, dl, 0, U) == EFL_REJECTED, ctr)
27 gv_check("R1a a rejected submission is NOT on the docket" as *u8, efl_on_docket_pure(efl_status_pure(19999, U, 1, dl, 0, U)) == 0, ctr)
28 gv_check("R1b and it is NOT timely, however early it was sent" as *u8, efl_timely_pure(efl_status_pure(19000, U, 1, dl, 0, U)) == 0, ctr)
29 gv_check("R2 submitted but not yet ruled on -> PENDING, still not filed" as *u8, efl_status_pure(19999, U, 0, dl, 0, U) == EFL_PENDING, ctr)
30 gv_check("R2a pending is NOT on the docket" as *u8, efl_on_docket_pure(EFL_PENDING) == 0, ctr)
31 efl_status_label(efl_status_pure(19999, U, 1, dl, 0, U), lbl)
32 gv_check("R3 the rejected label says NOT-FILED out loud" as *u8, mt_streq(lbl, "REJECTED-NOT-FILED" as *u8) == 1, ctr)
33 efl_status_label(EFL_PENDING, lbl)
34 gv_check("R3a the pending label does too" as *u8, mt_streq(lbl, "PENDING-NOT-FILED" as *u8) == 1, ctr)
35
36 // ---- u2605B: RELATION BACK is explicit, never a default ----
37 gv_check("B1 WITHOUT relation back, the filing date is the ACCEPTANCE date" as *u8, efl_filing_date_pure(19999, 20005, 0, 10) == 20005, ctr)
38 gv_check("B1a so a late acceptance makes it LATE" as *u8, efl_status_pure(19999, 20005, 0, dl, 0, 10) == EFL_FILED_LATE, ctr)
39 gv_check("B2 WITH relation back and a correction inside the cure window -> submission date governs" as *u8, efl_filing_date_pure(19999, 20005, 1, 10) == 19999, ctr)
40 gv_check("B2a so the same facts become TIMELY" as *u8, efl_status_pure(19999, 20005, 0, dl, 1, 10) == EFL_FILED_TIMELY, ctr)
41 gv_check("B3 correction OUTSIDE the cure window -> acceptance date governs again" as *u8, efl_filing_date_pure(19999, 20015, 1, 10) == 20015, ctr)
42 gv_check("B3a and it is late" as *u8, efl_status_pure(19999, 20015, 0, dl, 1, 10) == EFL_FILED_LATE, ctr)
43 gv_check("B4 u2605relation back to an ALREADY-LATE original is STILL LATE" as *u8, efl_status_pure(20003, 20005, 0, dl, 1, 10) == EFL_FILED_LATE, ctr)
44 gv_check("B5 relation back with no cure term -> acceptance governs (fail-closed)" as *u8, efl_filing_date_pure(19999, 20005, 1, U) == 20005, ctr)
45
46 // ---- D: lateness measurement ----
47 gv_check("D1 timely filing is 0 days late" as *u8, efl_days_late_pure(19999, dl) == 0, ctr)
48 gv_check("D2 five days late" as *u8, efl_days_late_pure(20005, dl) == 5, ctr)
49 gv_check("D3 unknown filing date -> UNSET, never 0" as *u8, efl_days_late_pure(U, dl) == EFL_UNSET, ctr)
50
51 // ---- E: exposure ----
52 gv_check("E1 exposure counts rejected, pending and late alike" as *u8, efl_exposure_pure(1, 2, 3) == 6, ctr)
53 efl_status_label(EFL_FILED_TIMELY, lbl)
54 gv_check("E2 timely label" as *u8, mt_streq(lbl, "FILED-TIMELY" as *u8) == 1, ctr)
55
56 return gv_verdict("EFILE-ACCEPTANCE" as *u8, ctr, "a rejected submission was never filed; acceptance governs; relation back never assumed" as *u8)
57}