Beemer Claude Fable 5 commited on
Commit
9016f86
·
1 Parent(s): 4fef2ec

Case-law gap round: 71 governing authorities added (194 decisions); new-case-law watch; quarterly audit

Browse files

Six domain reviewers diffed the corpus against canonical authorities and
every gap was filled: the SCC scaffolding the border cases apply (Grant,
Jarvis, Golden, Chehil, Hunter, Collins, Suberu, Kang-Brown, Vu, Guindon,
Wigglesworth...), the s. 44/misrep/danger-opinion FCA line (Sharma, Sidhu,
Ragupathy, Obazughanmwen, Nagalingam, Revell, Bermudez, Coomaraswamy,
McAlpin, Pepa 2025 SCC 21), the IFA trilogy + refugee standards captured
from CanLII (Rasaratnam, Thirunavukkarasu, Ranganathan, Adjei, Maldonado,
Sahin), customs/trade (Mattel, C.B. Powell, Bri-Chem, Chen, Fritz,
Skechers), the labour backbone (Weber, Vaughan, Burchill, Wm Scott,
McKinley, Gagnon, Noel, Meiorin, Fraser-loyalty, Heyser, Frazee), the
admin-law foundation (Cardinal, CJL v NEB, Harrison, Maple Lodge, Mount
Sinai, Mobil Oil, Strickland, Blencoe, Abrametz, Auer, Prassad, CPR,
Patanguli carrying QuickLaw-only Tipple's rule), and the second tier at
the maintainer's direction (Nolet, Horrocks, Parry Sound, AJC, Hilewitz,
Tapambwa, Lidder). The weekly check now trips on the CIU Important-
Decisions page (the one automated new-case-law signal) and a quarterly
gap-audit scheduled task fires each Jan/Apr/Jul/Oct. 49,037 chunks /
54,766 vectors. Gate: ALL Hit@10 1.00 (first time); legacy
0.77/0.94/0.98/1.00 MRR 0.86; holdout 1.00 Hit@3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

canlex/caselaw.py CHANGED
@@ -213,6 +213,10 @@ CASES = [
213
  "topic": "Judicial review of 2017 PSLREB 55; compensation for a "
214
  "victim of workplace sexual assault in the federal public "
215
  "service; remedial authority of the Board"},
 
 
 
 
216
  {"court": "fc", "id": 525537, "short": "Marentette",
217
  "topic": "Workplace violence and harassment investigations under the "
218
  "Canada Labour Code; procedural fairness owed to the "
@@ -343,6 +347,206 @@ CASES = [
343
  "where only part is shown to be of legitimate origin"},
344
 
345
  # --- Federal Public Sector Labour Relations and Employment Board ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
  # The CIU's published "Important Decisions" list (ciu-sdi.ca), ingested
347
  # 2026-07-23; topics adapted from the union's own subject lines.
348
  {"court": "fpslreb", "id": 358837, "short": "Bartlett",
@@ -511,6 +715,86 @@ CANLII_CASES = [
511
  "precise wording and essential elements of the two provisions; "
512
  "(2) examine the evidence of what was actually done against the "
513
  "Canadian offence's elements; or (3) both combined"},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  {"file": "canlii-1996-li.txt",
515
  "canlii_path": "en/ca/fca/doc/1996/1996canlii4086/1996canlii4086.html",
516
  "short": "Li",
 
213
  "topic": "Judicial review of 2017 PSLREB 55; compensation for a "
214
  "victim of workplace sexual assault in the federal public "
215
  "service; remedial authority of the Board"},
216
+ {"court": "fca", "id": 127201, "short": "Patanguli",
217
+ "topic": "A de novo hearing before the Board cures procedural defects "
218
+ "in the employer's investigation (applying Tipple); dismissal "
219
+ "of a CIC employee for cheating in a staffing process"},
220
  {"court": "fc", "id": 525537, "short": "Marentette",
221
  "topic": "Workplace violence and harassment investigations under the "
222
  "Canada Labour Code; procedural fairness owed to the "
 
347
  "where only part is shown to be of legitimate origin"},
348
 
349
  # --- Federal Public Sector Labour Relations and Employment Board ---
350
+ # 2026-07 gap audit: the governing authorities the corpus's own
351
+ # decisions apply, identified per doctrinal domain and verified
352
+ # against the issuing courts' records before ingestion.
353
+ {"court": "scc", "id": 7799, "short": "Grant",
354
+ "topic": "The governing s. 24(2) exclusion framework and the "
355
+ "controlling definition of physical and psychological "
356
+ "detention"},
357
+ {"court": "scc", "id": 2015, "short": "Jarvis",
358
+ "topic": "The predominant-purpose test: when a regulatory audit "
359
+ "becomes a penal investigation engaging full Charter "
360
+ "protections"},
361
+ {"court": "scc", "id": 1924, "short": "Golden",
362
+ "topic": "Strip searches are never routine: independent reasonable "
363
+ "grounds and a reasonable manner required"},
364
+ {"court": "scc", "id": 13264, "short": "Chehil",
365
+ "topic": "The reasonable-suspicion standard: an objectively "
366
+ "discernible constellation of factors assessed in their "
367
+ "totality"},
368
+ {"court": "scc", "id": 5274, "short": "Hunter",
369
+ "topic": "The s. 8 foundation: reasonable expectation of privacy and "
370
+ "the presumptive warrant requirement"},
371
+ {"court": "scc", "id": 7800, "short": "Suberu",
372
+ "topic": "Section 10(b) attaches immediately on detention; when an "
373
+ "investigative encounter crystallizes into detention"},
374
+ {"court": "scc", "id": 4627, "short": "Kang-Brown",
375
+ "topic": "Sniffer-dog deployment is a s. 8 search, grounded on "
376
+ "reasonable suspicion"},
377
+ {"court": "scc", "id": 1492, "short": "Collins",
378
+ "topic": "The tripartite s. 8 reasonableness test: authorized by "
379
+ "law, a reasonable law, conducted reasonably"},
380
+ {"court": "scc", "id": 15478, "short": "Guindon",
381
+ "topic": "When an administrative monetary penalty engages Charter s. "
382
+ "11 protections (it ordinarily does not)"},
383
+ {"court": "scc", "id": 13327, "short": "Vu",
384
+ "topic": "Computers attract a distinct, heightened privacy interest "
385
+ "requiring specific search authorization"},
386
+ {"court": "scc", "id": 13265, "short": "MacKenzie",
387
+ "topic": "Reasonable suspicion applied to a vehicle sniffer-dog "
388
+ "search on traveller-profile indicators"},
389
+ {"court": "scc", "id": 21114, "short": "Pepa",
390
+ "topic": "IAD appeal rights under s. 63(2) for a foreign national "
391
+ "whose permanent resident visa expired after entry"},
392
+ {"court": "scc", "id": 1874, "short": "Mattel",
393
+ "topic": "Customs valuation under s. 48: royalties and licence fees "
394
+ "are dutiable only as a condition of the sale"},
395
+ {"court": "scc", "id": 266, "short": "Wigglesworth",
396
+ "topic": "The two-part test for Charter s. 11: proceedings criminal "
397
+ "by nature or carrying a true penal consequence"},
398
+ {"court": "scc", "id": 1276, "short": "Weber",
399
+ "topic": "Exclusive jurisdiction: disputes arising from the "
400
+ "collective agreement go to grievance arbitration, not the "
401
+ "courts"},
402
+ {"court": "scc", "id": 2211, "short": "Vaughan",
403
+ "topic": "Courts decline jurisdiction over federal public-service "
404
+ "workplace disputes covered by the statutory grievance "
405
+ "scheme"},
406
+ {"court": "scc", "id": 1876, "short": "McKinley",
407
+ "topic": "Dishonesty is not automatically just cause for dismissal: "
408
+ "the contextual, proportional approach"},
409
+ {"court": "scc", "id": 5271, "short": "Gagnon",
410
+ "topic": "The five governing principles of the union's duty of fair "
411
+ "representation"},
412
+ {"court": "scc", "id": 1877, "short": "Noel (DFR)",
413
+ "topic": "The duty of fair representation restated: arbitrary, "
414
+ "discriminatory, bad-faith or seriously negligent conduct"},
415
+ {"court": "scc", "id": 1724, "short": "Meiorin",
416
+ "topic": "The unified three-step bona fide occupational requirement "
417
+ "test for workplace standards and accommodation"},
418
+ {"court": "scc", "id": 96, "short": "Fraser (loyalty)",
419
+ "topic": "The federal public servant's duty of loyalty balanced "
420
+ "against freedom of expression"},
421
+ {"court": "scc", "id": 106, "short": "Cardinal",
422
+ "topic": "Procedural fairness binds every public authority; a breach "
423
+ "voids the decision regardless of the likely outcome"},
424
+ {"court": "scc", "id": 2574, "short": "CJL v NEB",
425
+ "topic": "The reasonable-apprehension-of-bias test: what an informed "
426
+ "person, viewing the matter realistically, would conclude"},
427
+ {"court": "scc", "id": 2660, "short": "Harrison",
428
+ "topic": "The Carltona doctrine: ministerial powers are "
429
+ "presumptively exercisable by responsible departmental "
430
+ "officials"},
431
+ {"court": "scc", "id": 2446, "short": "Maple Lodge",
432
+ "topic": "Fettering of discretion: policy guidelines cannot be "
433
+ "applied as binding rules excluding relevant considerations"},
434
+ {"court": "scc", "id": 1879, "short": "Mount Sinai",
435
+ "topic": "Legitimate expectations are procedural only; public-law "
436
+ "estoppel against a minister is narrow and yields to "
437
+ "statute"},
438
+ {"court": "scc", "id": 1107, "short": "Mobil Oil",
439
+ "topic": "The futility exception: relief for a fairness breach may "
440
+ "be withheld where the outcome was legally inevitable"},
441
+ {"court": "scc", "id": 15438, "short": "Strickland",
442
+ "topic": "Discretionary refusal of judicial review and the adequate- "
443
+ "alternative-remedy framework"},
444
+ {"court": "scc", "id": 1808, "short": "Blencoe",
445
+ "topic": "Administrative delay is an abuse of process only on "
446
+ "significant prejudice from unacceptable delay"},
447
+ {"court": "scc", "id": 19439, "short": "Abrametz",
448
+ "topic": "The modern three-part test for inordinate administrative "
449
+ "delay, with proportionate remedies"},
450
+ {"court": "scc", "id": 20730, "short": "Auer",
451
+ "topic": "Vavilov reasonableness, with a presumption of validity, "
452
+ "governs vires challenges to subordinate legislation"},
453
+ {"court": "scc", "id": 431, "short": "Prassad",
454
+ "topic": "Administrative tribunals are masters of their own "
455
+ "procedure, subject only to fairness"},
456
+ {"court": "fca", "id": 214260, "short": "Sharma",
457
+ "topic": "Section 44 reports and referrals for permanent residents: "
458
+ "very limited discretion, no duty to weigh H&C factors"},
459
+ {"court": "fca", "id": 407446, "short": "Sidhu",
460
+ "topic": "Misrepresentation under s. 40: the duty of candour and the "
461
+ "narrow innocent-misrepresentation exception"},
462
+ {"court": "fca", "id": 33323, "short": "Ragupathy",
463
+ "topic": "The s. 115(2)(a) danger-opinion framework: danger "
464
+ "assessment, then risk, then balancing"},
465
+ {"court": "fca", "id": 521220, "short": "Obazughanmwen",
466
+ "topic": "Section 44 officers and delegates have no mandate for "
467
+ "detailed H&C or abuse-of-process inquiries"},
468
+ {"court": "fca", "id": 35977, "short": "Nagalingam",
469
+ "topic": "The s. 115(2)(b) refoulement branch: assessing the nature "
470
+ "and severity of the acts committed"},
471
+ {"court": "fca", "id": 423316, "short": "Revell",
472
+ "topic": "An inadmissibility determination and s. 44 referral do not "
473
+ "engage Charter s. 7, even for long-term permanent "
474
+ "residents"},
475
+ {"court": "fca", "id": 143934, "short": "Bermudez",
476
+ "topic": "Cessation applications: the hearings officer has no "
477
+ "discretion to weigh H&C factors or a child's best "
478
+ "interests"},
479
+ {"court": "fca", "id": 31594, "short": "Coomaraswamy",
480
+ "topic": "Vacation of refugee protection under s. 109: establishing "
481
+ "misrepresentation; only untainted evidence on the second "
482
+ "branch"},
483
+ {"court": "fca", "id": 36788, "short": "Zeng",
484
+ "topic": "The three-question test for Article 1E exclusion: status "
485
+ "substantially similar to nationals of a third country"},
486
+ {"court": "fca", "id": 32011, "short": "Li (s. 97)",
487
+ "topic": "The s. 97 protected-person standard is balance of "
488
+ "probabilities, unlike the lower s. 96 threshold"},
489
+ {"court": "fca", "id": 36349, "short": "Li (detention)",
490
+ "topic": "Anticipated future length of detention is assessed on "
491
+ "proceedings conducted expeditiously"},
492
+ {"court": "fca", "id": 36729, "short": "C.B. Powell",
493
+ "topic": "Prematurity: the Customs Act re-determination and CITT "
494
+ "route must be exhausted before judicial review"},
495
+ {"court": "fca", "id": 181427, "short": "Bri-Chem",
496
+ "topic": "CBSA must follow CITT precedent when processing "
497
+ "corrections; relitigating settled rulings is an abuse of "
498
+ "process"},
499
+ {"court": "fca", "id": 407467, "short": "Chen",
500
+ "topic": "A s. 135 Customs Act action tests only whether the "
501
+ "contravention occurred; officer conduct belongs to other "
502
+ "recourse"},
503
+ {"court": "fca", "id": 36351, "short": "Fritz Marketing",
504
+ "topic": "Challenges to Detailed Adjustment Statements proceed "
505
+ "through the Customs Act appeal route, not judicial review"},
506
+ {"court": "fca", "id": 108541, "short": "Skechers",
507
+ "topic": "Transaction value: research cost-sharing payments to the "
508
+ "vendor form part of the price paid or payable"},
509
+ {"court": "fca", "id": 231365, "short": "Heyser",
510
+ "topic": "Termination on revocation of reliability status must rest "
511
+ "on legitimate grounds, reviewable by the Board"},
512
+ {"court": "fca", "id": 308603, "short": "CPR (fairness)",
513
+ "topic": "Procedural fairness on judicial review: whether the party "
514
+ "knew the case to meet and had a full chance to respond"},
515
+ {"court": "fc", "id": 308992, "short": "McAlpin",
516
+ "topic": "The s. 44 discretion synthesis: any H&C discretion in "
517
+ "criminality cases is very limited, if it exists at all"},
518
+ {"court": "fc", "id": 54573, "short": "Frazee",
519
+ "topic": "Whether an employer measure labelled administrative is in "
520
+ "substance discipline: corrective intent and impact"},
521
+ {"court": "onca", "id": 14196, "short": "Chaudhary",
522
+ "topic": "Habeas corpus is available for lengthy immigration "
523
+ "detention of uncertain duration"},
524
+ # Second tier from the 2026-07 gap audit, added at the maintainer's
525
+ # direction: the strongest of each reviewer's deliberate exclusions.
526
+ {"court": "scc", "id": 7865, "short": "Nolet",
527
+ "topic": "Dual-purpose vehicle searches: a valid regulatory search may "
528
+ "shift to criminal investigation; the Charter consequences of "
529
+ "each step assessed on its own footing"},
530
+ {"court": "scc", "id": 19043, "short": "Horrocks",
531
+ "topic": "Exclusive labour-arbitration jurisdiction over human-rights "
532
+ "disputes arising from the collective agreement; the Weber "
533
+ "framework applied to competing statutory tribunals"},
534
+ {"court": "scc", "id": 2075, "short": "Parry Sound",
535
+ "topic": "Statutory employment and human-rights protections are read "
536
+ "into every collective agreement and enforceable at "
537
+ "arbitration"},
538
+ {"court": "scc", "id": 16827, "short": "AJC v Canada",
539
+ "topic": "Management rights are exercised subject to reasonableness "
540
+ "and consistency with the collective agreement (standby "
541
+ "scheduling of counsel)"},
542
+ {"court": "scc", "id": 2291, "short": "Hilewitz",
543
+ "topic": "Medical inadmissibility for excessive demand requires "
544
+ "individualized assessment of the applicant's actual "
545
+ "circumstances, including family support"},
546
+ {"court": "fca", "id": 363658, "short": "Tapambwa",
547
+ "topic": "Restricted PRRA under s. 112(3): no revisiting of the "
548
+ "exclusion finding; the scope of protection for excluded "
549
+ "persons"},
550
  # The CIU's published "Important Decisions" list (ciu-sdi.ca), ingested
551
  # 2026-07-23; topics adapted from the union's own subject lines.
552
  {"court": "fpslreb", "id": 358837, "short": "Bartlett",
 
715
  "precise wording and essential elements of the two provisions; "
716
  "(2) examine the evidence of what was actually done against the "
717
  "Canadian offence's elements; or (3) both combined"},
718
+ # 2026-07 gap audit, pre-Decisia authorities: text arrives via the
719
+ # browser-capture workflow (or a direct PDF fetch for Wm. Scott);
720
+ # ingestion skips gracefully until each file exists.
721
+ {"file": "canlii-1991-rasaratnam.txt",
722
+ "canlii_path": "en/ca/fca/doc/1991/1991canlii13517/1991canlii13517.html",
723
+ "short": "Rasaratnam", "name": "Rasaratnam v Canada (MEI)",
724
+ "cite": "[1992] 1 FC 706 (CA)", "report": "1991 CanLII 13517",
725
+ "date": "1991-12-05", "court_name": "Federal Court of Appeal",
726
+ "topic": "The two-prong internal flight alternative test: no serious "
727
+ "possibility of persecution in the IFA, and reasonableness of "
728
+ "relocation"},
729
+ {"file": "canlii-1993-thirunavukkarasu.txt",
730
+ "canlii_path": "en/ca/fca/doc/1993/1993canlii3011/1993canlii3011.html",
731
+ "short": "Thirunavukkarasu", "name": "Thirunavukkarasu v Canada (MEI)",
732
+ "cite": "[1994] 1 FC 589 (CA)", "report": "1993 CanLII 3011",
733
+ "date": "1993-11-10", "court_name": "Federal Court of Appeal",
734
+ "topic": "The reasonableness prong of the IFA test: an objective "
735
+ "standard, with notice required before an IFA is raised"},
736
+ {"file": "canlii-2000-ranganathan.txt",
737
+ "canlii_path": "en/ca/fca/doc/2000/2000canlii16789/2000canlii16789.html",
738
+ "short": "Ranganathan", "name": "Ranganathan v Canada (MCI)",
739
+ "cite": "[2001] 2 FC 164 (CA)", "report": "2000 CanLII 16789",
740
+ "date": "2000-12-21", "court_name": "Federal Court of Appeal",
741
+ "topic": "The very high threshold for an unreasonable IFA: conditions "
742
+ "jeopardizing life and safety in travelling or relocating"},
743
+ {"file": "canlii-1994-sahin.txt",
744
+ "canlii_path": "en/ca/fct/doc/1994/1994canlii3521/1994canlii3521.html",
745
+ "short": "Sahin", "name": "Sahin v Canada (MCI)",
746
+ "cite": "[1995] 1 FC 214 (TD)", "report": "1994 CanLII 3521",
747
+ "date": "1994-10-14", "court_name": "Federal Court (Trial Division)",
748
+ "topic": "The s. 7 factors for continued immigration detention -- the "
749
+ "source of IRPR s. 248: reasons, length, future duration, "
750
+ "delay attribution, alternatives"},
751
+ {"file": "canlii-1979-maldonado.txt",
752
+ "canlii_path": "en/ca/fca/doc/1979/1979canlii4098/1979canlii4098.html",
753
+ "short": "Maldonado", "name": "Maldonado v Canada (MEI)",
754
+ "cite": "[1980] 2 FC 302 (CA)", "report": "1979 CanLII 4098",
755
+ "date": "1979-11-19", "court_name": "Federal Court of Appeal",
756
+ "topic": "The presumption that a claimant's sworn testimony is true "
757
+ "unless there is reason to doubt it"},
758
+ {"file": "canlii-1989-adjei.txt",
759
+ "canlii_path": "en/ca/fca/doc/1989/1989canlii5184/1989canlii5184.html",
760
+ "short": "Adjei", "name": "Adjei v Canada (MEI)",
761
+ "cite": "[1989] 2 FC 680 (CA)", "report": "1989 CanLII 9466",
762
+ "date": "1989-01-27", "court_name": "Federal Court of Appeal",
763
+ "topic": "The s. 96 standard of proof: a reasonable chance or serious "
764
+ "possibility of persecution, less than balance of probabilities"},
765
+ {"file": "canlii-1988-toth.txt",
766
+ "canlii_path": "en/ca/fca/doc/1988/1988canlii1420/1988canlii1420.html",
767
+ "short": "Toth", "name": "Toth v Canada (MEI)",
768
+ "cite": "(1988), 86 NR 302 (FCA)", "report": "1988 CanLII 1420",
769
+ "date": "1988-06-21", "court_name": "Federal Court of Appeal",
770
+ "topic": "The tripartite stay test on motions to stay removal: serious "
771
+ "issue, irreparable harm, balance of convenience"},
772
+ {"file": "canlii-1980-burchill.txt",
773
+ "canlii_path": "en/ca/fca/doc/1980/1980canlii4207/1980canlii4207.html",
774
+ "short": "Burchill", "name": "Burchill v Canada (Attorney General)",
775
+ "cite": "[1981] 1 FC 109 (CA)", "report": "1980 CanLII 4207",
776
+ "date": "1980-05-20", "court_name": "Federal Court of Appeal",
777
+ "topic": "A grievor cannot change the nature of a grievance when it "
778
+ "reaches adjudication"},
779
+ {"file": "canlii-1992-lidder.txt",
780
+ "canlii_path": "en/ca/fca/doc/1992/1992canlii14712/1992canlii14712.html",
781
+ "short": "Lidder", "name": "Canada (MEI) v Lidder",
782
+ "cite": "[1992] 2 FC 621 (CA)", "report": "1992 CanLII 14712",
783
+ "date": "1992-03-10", "court_name": "Federal Court of Appeal",
784
+ "topic": "Estoppel and legitimate expectations cannot defeat mandatory "
785
+ "statutory requirements: an officer's representation cannot "
786
+ "confer a status or bypass conditions the Act imposes"},
787
+ # Tipple ([1985] FCJ No 818) is QuickLaw-only -- no CanLII record
788
+ # exists. Its de-novo-cures-defects rule enters the corpus through
789
+ # Patanguli, 2015 FCA 291 (CASES entry), which quotes and applies it.
790
+ {"file": "canlii-1976-wmscott.txt",
791
+ "canlii_path": "en/bc/bclrb/doc/1976/1976canlii1017/1976canlii1017.html",
792
+ "short": "Wm. Scott", "name": "Wm. Scott & Company Ltd v CFAWU Local P-162",
793
+ "cite": "[1977] 1 Can LRBR 1 (BCLRB)", "report": "",
794
+ "date": "1976-10-26",
795
+ "court_name": "British Columbia Labour Relations Board",
796
+ "topic": "The three-question discipline framework: was there cause; was "
797
+ "the penalty excessive; what lesser penalty should substitute"},
798
  {"file": "canlii-1996-li.txt",
799
  "canlii_path": "en/ca/fca/doc/1996/1996canlii4086/1996canlii4086.html",
800
  "short": "Li",
canlex/refresh.py CHANGED
@@ -82,6 +82,39 @@ _NON_XML = [
82
  ]
83
 
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  def check_union():
86
  """Upstream drift for the CIU/PSAC documents (incl. every site VSSA).
87
 
@@ -541,6 +574,7 @@ def run(as_json=False):
541
  dmemo_idx = check_dmemo_index()
542
  tariff = check_tariff_edition(today)
543
  union = check_union()
 
544
  pending = pending_in_force(today)
545
  stale = [r for r in leg if r["status"] in ("stale", "missing-local")]
546
  errors = [r for r in leg if r["status"] == "error"]
@@ -550,13 +584,14 @@ def run(as_json=False):
550
  dmemo_stale = dmemo_idx["status"] == "stale"
551
  tariff_stale = tariff["status"] == "stale"
552
  union_stale = [r for r in union if r["status"] == "stale"]
 
553
 
554
  if as_json:
555
  print(json.dumps({"checked": today, "legislation": leg,
556
  "delegation": deleg, "directives": dirs,
557
  "non_xml": nonxml, "curated": curated,
558
  "dmemo_index": dmemo_idx, "tariff": tariff,
559
- "union": union,
560
  "pending_in_force": pending,
561
  "stale_count": (len(stale) + len(deleg_stale)
562
  + len(dirs_stale)
@@ -681,6 +716,19 @@ def run(as_json=False):
681
  if not union_stale and not any(r["status"] == "error" for r in union):
682
  print(f" all {n_union_ok} current (upstream unchanged since fetch)")
683
 
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  if pending:
685
  print("\nPending bills now in force (re-ingest the affected Acts):")
686
  for b in pending:
@@ -691,7 +739,7 @@ def run(as_json=False):
691
 
692
  return 1 if (stale or errors or deleg_stale or dirs_stale
693
  or curated_flag or dmemo_stale or tariff_stale
694
- or union_stale) else 0
695
 
696
 
697
  def main():
 
82
  ]
83
 
84
 
85
+ _CIU_DECISIONS = "https://ciu-sdi.ca/en/important-decisions/"
86
+ _CIU_DEC_MARKER = PROCESSED_DIR.parent / "raw" / "ciu" / "decisions-page-date.txt"
87
+
88
+
89
+ def check_ciu_decisions():
90
+ """New-case-law tripwire: the CIU curates its Important Decisions page,
91
+ so its dateModified moving is a cheap signal that a new decision worth
92
+ ingesting has issued. This is the only automated freshness signal the
93
+ case-law corpus has -- courts publish no 'new leading case' feed -- and
94
+ it complements the quarterly gap-audit ritual rather than replacing it."""
95
+ try:
96
+ req = urllib.request.Request(
97
+ _CIU_DECISIONS, headers={"User-Agent": BROWSER_UA})
98
+ with urllib.request.urlopen(req, timeout=60) as resp:
99
+ html = resp.read().decode("utf-8", "replace")
100
+ m = re.search(r'"dateModified":"(\d{4}-\d{2}-\d{2})', html)
101
+ remote = m.group(1) if m else ""
102
+ except Exception as exc:
103
+ return {"stored": "", "remote": "", "status": "error",
104
+ "error": f"{type(exc).__name__}: {exc}"}
105
+ if not remote:
106
+ return {"stored": "", "remote": "", "status": "no-date", "error": ""}
107
+ stored = (_CIU_DEC_MARKER.read_text(encoding="utf-8").strip()
108
+ if _CIU_DEC_MARKER.exists() else "")
109
+ if not stored:
110
+ # First run: record the baseline rather than alarming.
111
+ _CIU_DEC_MARKER.parent.mkdir(parents=True, exist_ok=True)
112
+ _CIU_DEC_MARKER.write_text(remote, encoding="utf-8")
113
+ stored = remote
114
+ status = "stale" if remote > stored else "ok"
115
+ return {"stored": stored, "remote": remote, "status": status, "error": ""}
116
+
117
+
118
  def check_union():
119
  """Upstream drift for the CIU/PSAC documents (incl. every site VSSA).
120
 
 
574
  dmemo_idx = check_dmemo_index()
575
  tariff = check_tariff_edition(today)
576
  union = check_union()
577
+ ciu_dec = check_ciu_decisions()
578
  pending = pending_in_force(today)
579
  stale = [r for r in leg if r["status"] in ("stale", "missing-local")]
580
  errors = [r for r in leg if r["status"] == "error"]
 
584
  dmemo_stale = dmemo_idx["status"] == "stale"
585
  tariff_stale = tariff["status"] == "stale"
586
  union_stale = [r for r in union if r["status"] == "stale"]
587
+ ciu_dec_stale = ciu_dec["status"] == "stale"
588
 
589
  if as_json:
590
  print(json.dumps({"checked": today, "legislation": leg,
591
  "delegation": deleg, "directives": dirs,
592
  "non_xml": nonxml, "curated": curated,
593
  "dmemo_index": dmemo_idx, "tariff": tariff,
594
+ "union": union, "ciu_decisions": ciu_dec,
595
  "pending_in_force": pending,
596
  "stale_count": (len(stale) + len(deleg_stale)
597
  + len(dirs_stale)
 
716
  if not union_stale and not any(r["status"] == "error" for r in union):
717
  print(f" all {n_union_ok} current (upstream unchanged since fetch)")
718
 
719
+ if ciu_dec["status"] == "stale":
720
+ print(f"\nCIU Important-Decisions page: UPDATED "
721
+ f"({ciu_dec['remote']} > {ciu_dec['stored']}) — the union "
722
+ f"may have flagged a new decision; review "
723
+ f"{_CIU_DECISIONS} and, after ingesting anything new, "
724
+ f"update {_CIU_DEC_MARKER.name} to {ciu_dec['remote']}")
725
+ elif ciu_dec["status"] == "error":
726
+ print(f"\nCIU Important-Decisions page: ERROR "
727
+ f"{ciu_dec['error'][:55]}")
728
+ else:
729
+ print(f"\nCIU Important-Decisions page: ok (last modified "
730
+ f"{ciu_dec['remote'] or '?'})")
731
+
732
  if pending:
733
  print("\nPending bills now in force (re-ingest the affected Acts):")
734
  for b in pending:
 
739
 
740
  return 1 if (stale or errors or deleg_stale or dirs_stale
741
  or curated_flag or dmemo_stale or tariff_stale
742
+ or union_stale or ciu_dec_stale) else 0
743
 
744
 
745
  def main():
data/processed/caselaw.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:94e937a9a6a36a17662c7fb63bc1cec7397a28ff910e0c6d5889c2b2ac8deed8
3
- size 13150503
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5ad0fe24cd8589c6600f179ff6ad171ca8a2b58702fb79bd8090abadc8ee33c
3
+ size 19418891
data/processed/embeddings.npz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2fa0640d280572773d6e35b23454c4de8e589a5d658a11a79e76175cce4faab3
3
- size 91712138
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31e4eaf89312bea25679f115567343228b1976deab44f1e36ba690f60effb9e0
3
+ size 97045858