nx_ipdock_gate.nx source
↩ module page · 74 lines · 5810 B
1// nx_ipdock_gate.nx -- INDEPENDENT GATE: IP docketing, and which deadlines survive being missed.
2// ZERO storage. The teeth: a missed Paris Convention priority is IRRECOVERABLE (no grace, ever), while a
3// missed maintenance fee inside its six-month grace is still PAYABLE with a surcharge -- calling that one
4// "lost" abandons a live patent, the mirror-image error; a trademark filing BEFORE its window opens is
5// refused rather than accepted early; and an unknown anchor date yields UNKNOWN, never a fabricated
6// deadline, because a fabricated IP date will be trusted.
7// license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
8
9import "nx_ipdock_lib.nx"
10import "nx_gate_verdict.nx"
11
12func main(argc: i64, argv: *i64) -> i64 {
13 let ctr: *i64 = gv_ctr()
14 let lbl: *u8 = sys_mmap(32)
15
16 let prio: i64 = 20000
17 let grant: i64 = 21000
18 let reg: i64 = 21000
19 let U: i64 = IPD_UNSET
20
21 gv_head("NISHI-IPDOCK-GATE (patent + trademark deadlines: irrecoverable vs grace-bearing)" as *u8)
22
23 // ---- D: deadline computation, fail-closed on unknown anchors ----
24 gv_check("D1 Paris priority year = 365 days from priority" as *u8, ipd_paris_pure(prio) == 20365, ctr)
25 gv_check("D2 PCT national phase = 30 months from priority" as *u8, ipd_pct_pure(prio) == 20913, ctr)
26 gv_check("D3 unknown priority -> UNKNOWN deadline, never day zero" as *u8, ipd_paris_pure(U) == IPD_UNKNOWN, ctr)
27 gv_check("D4 unknown priority -> unknown PCT deadline too" as *u8, ipd_pct_pure(U) == IPD_UNKNOWN, ctr)
28
29 // ---- H: IRRECOVERABLE deadlines have NO grace ----
30 gv_check("H1 day before the Paris deadline -> OPEN" as *u8, ipd_status_hard_pure(20365, 20364) == IPD_OPEN, ctr)
31 gv_check("H2 ON the Paris deadline -> still OPEN (may file that day)" as *u8, ipd_status_hard_pure(20365, 20365) == IPD_OPEN, ctr)
32 gv_check("H3 one day late -> LOST, permanently" as *u8, ipd_status_hard_pure(20365, 20366) == IPD_LOST, ctr)
33 gv_check("H4 a lost priority is NOT recoverable" as *u8, ipd_recoverable_pure(ipd_status_hard_pure(20365, 20366)) == 0, ctr)
34 gv_check("H5 no grace is ever granted on a hard deadline" as *u8, ipd_surcharge_due_pure(ipd_status_hard_pure(20365, 20366)) == 0, ctr)
35 gv_check("H6 unknown as-of -> UNKNOWN, never LOST by assumption" as *u8, ipd_status_hard_pure(20365, U) == IPD_UNKNOWN, ctr)
36
37 // ---- M: maintenance fees -- grace-bearing, so late is NOT lost ----
38 let m1: i64 = ipd_deadline_pure(grant, IPD_MAINT1_DAYS)
39 gv_check("M1 first maintenance fee at 3.5 years from grant" as *u8, m1 == 22278, ctr)
40 gv_check("M2 before it -> OPEN" as *u8, ipd_status_grace_pure(m1, 22277, IPD_GRACE_DAYS) == IPD_OPEN, ctr)
41 gv_check("M3 one day late -> GRACE, NOT lost" as *u8, ipd_status_grace_pure(m1, 22279, IPD_GRACE_DAYS) == IPD_GRACE, ctr)
42 gv_check("M3a a patent in grace is still RECOVERABLE" as *u8, ipd_recoverable_pure(ipd_status_grace_pure(m1, 22279, IPD_GRACE_DAYS)) == 1, ctr)
43 gv_check("M3b and a surcharge is owed" as *u8, ipd_surcharge_due_pure(ipd_status_grace_pure(m1, 22279, IPD_GRACE_DAYS)) == 1, ctr)
44 gv_check("M4 last day of grace -> still GRACE" as *u8, ipd_status_grace_pure(m1, 22460, IPD_GRACE_DAYS) == IPD_GRACE, ctr)
45 gv_check("M5 one day past grace -> LOST" as *u8, ipd_status_grace_pure(m1, 22461, IPD_GRACE_DAYS) == IPD_LOST, ctr)
46 gv_check("M6 no surcharge once truly lost" as *u8, ipd_surcharge_due_pure(ipd_status_grace_pure(m1, 22461, IPD_GRACE_DAYS)) == 0, ctr)
47 gv_check("M7 second maintenance fee at 7.5 years" as *u8, ipd_deadline_pure(grant, IPD_MAINT2_DAYS) == 23739, ctr)
48 gv_check("M8 third maintenance fee at 11.5 years" as *u8, ipd_deadline_pure(grant, IPD_MAINT3_DAYS) == 25200, ctr)
49 gv_check("M9 days remaining includes the grace window" as *u8, ipd_days_remaining_pure(m1, 22278, IPD_GRACE_DAYS) == 182, ctr)
50
51 // ---- T: trademark windows OPEN before they are DUE ----
52 let s8o: i64 = ipd_deadline_pure(reg, IPD_TM_S8_OPEN_DAYS)
53 let s8d: i64 = ipd_deadline_pure(reg, IPD_TM_S8_DUE_DAYS)
54 gv_check("T1 s8 window opens at year 5" as *u8, s8o == 22826, ctr)
55 gv_check("T2 s8 window closes at year 6" as *u8, s8d == 23191, ctr)
56 gv_check("T3 BEFORE the window opens -> not filable (premature)" as *u8, ipd_tm_filable_pure(s8o, s8d, 22000, IPD_GRACE_DAYS) == 0, ctr)
57 gv_check("T3a and its status is UNKNOWN, not OPEN" as *u8, ipd_window_status_pure(s8o, s8d, 22000, IPD_GRACE_DAYS) == IPD_UNKNOWN, ctr)
58 gv_check("T4 inside the window -> filable" as *u8, ipd_tm_filable_pure(s8o, s8d, 23000, IPD_GRACE_DAYS) == 1, ctr)
59 gv_check("T5 in grace after the window -> still filable with surcharge" as *u8, ipd_tm_filable_pure(s8o, s8d, 23300, IPD_GRACE_DAYS) == 1, ctr)
60 gv_check("T6 past grace -> not filable, registration lapses" as *u8, ipd_tm_filable_pure(s8o, s8d, 23400, IPD_GRACE_DAYS) == 0, ctr)
61 gv_check("T7 s9 renewal window opens at year 9" as *u8, ipd_deadline_pure(reg, IPD_TM_S9_OPEN_DAYS) == 24287, ctr)
62 gv_check("T8 s9 renewal due at year 10" as *u8, ipd_deadline_pure(reg, IPD_TM_S9_DUE_DAYS) == 24652, ctr)
63
64 // ---- L: labels and portfolio ----
65 ipd_status_label(ipd_status_grace_pure(m1, 22279, IPD_GRACE_DAYS), lbl)
66 gv_check("L1 grace label names the surcharge" as *u8, mt_streq(lbl, "GRACE-SURCHARGE" as *u8) == 1, ctr)
67 ipd_status_label(IPD_LOST, lbl)
68 gv_check("L2 lost label" as *u8, mt_streq(lbl, "LOST" as *u8) == 1, ctr)
69 ipd_status_label(IPD_UNKNOWN, lbl)
70 gv_check("L3 unknown label" as *u8, mt_streq(lbl, "UNKNOWN" as *u8) == 1, ctr)
71 gv_check("L4 exposure counts LOST and UNKNOWN alike" as *u8, ipd_exposure_pure(2, 3) == 5, ctr)
72
73 return gv_verdict("IP-DOCKET" as *u8, ctr, "Paris priority irrecoverable; maintenance fees survive in grace; premature TM filings refused" as *u8)
74}