Repository navigation
Per Document Generator
Daniel Truong edited this page Jul 21, 2026
·
1 revision
This document describes the design, execution pipeline, and algorithmic heuristics used by the AI Classifier Tool (AICT) Generator defined in Per-Document-Generator.py.
The generator operates as a multi-stage deterministic sorting and metadata extraction pipeline:
flowchart TD
START[Raw PDF Document & Metadata] --> GRAZE{1. Grazing Pre-pass}
GRAZE -->|Yes: Study, Plan, Appendix| PT[Vein: PT - Project Technical Detail]
GRAZE -->|No: Administrative File| COARSE{2. Family / Vein Sort}
COARSE --> CP[Vein: CP - Certificate Proper]
COARSE --> PE[Vein: PE - Public Engagement]
COARSE --> AT[Vein: AT - Act Transition]
COARSE --> CM[Vein: CM - Communication]
COARSE --> OA[Vein: OA - Official EA Artifact]
PT & CP & PE & AT & CM & OA --> ACT_REC{3. Operative Act Recovery}
ACT_REC --> OUTPUT[Generate Verified JSON Metadata Output]
- Objective: Exclude high-volume technical and public submission attachments (~76% of all files) from deep classification.
-
Rule: If a document type or name contains standard bulk keywords (e.g., appendix, chapter, technical memo, baseline report, study, management plan), set
Project Content = YESand tag it as PT (Project Technical Detail). - Performance Impact: Reduces fine classification evaluation scope by 74%, dramatically preserving processing resources.
For non-bulk administrative records, the generator categorizes files into functional tracks ("Veins"):
| Vein Code | Vein Name | Precedence | Triggers & Identifiers |
|---|---|---|---|
CP |
Certificate Proper | 1 | Contains certificate in title and does not contain amend, transfer, application. |
AT |
Act Transition | 2 | Contains request to start new, section 10 order, issued process order with transition indicators. |
PE |
Public Engagement | 3 | Title contains comment, open house, notice of intent, PCP, or advertisement. |
OA |
Official EA Artifacts | 4 | Title/Type contains order, amendment, exemption, extension, assessment report. |
CM |
Communication | 5 | Contains letter or meeting notes (lowest-precedence). |
- Rule: Resolves whether a document operates under the 2002 Act or the 2018 Act.
-
Threshold Date: Uses the formal enactment and implementation of the 2018 EAA (e.g.,
2021-04-16Process Order date). - Result: Publication dates before the threshold are assigned to the 2002 Act, while newer dates default to the 2018 Act.
The generator modifies the physical filename suffix to represent the coarse classification state without destructive renaming:
- Pattern:
<original_name> -[VV] -P.json(whereVVis the two-letter Vein code, andPis Pending Verification status). - Schema structure matches
Per-Document-Data-Format.md.
- Environment Reality & Gotchas
- Architecture
- Seeding — filling Cosmos from Track and Eagle
- Sources and Status — every source, one state
- Search & Retrieval — overview
- Search Index Reference
- Search Query Construction
- Search Measurements
- Extraction Pipeline
- Extraction Quality — coverage, word-joining, tiling
- Identity Model — which id means what
- Attribute-Level Access — field-visibility levels, catalog
- Sync Architecture — how records get in
- Eagle Mirror Reference — mirrored kinds, refusals, drift classes
- ENGAGE Rows Reference — ENGAGE-owned comment periods, reconcile
- Public-Read Backfill — filling and repairing the mirror containers
-
Short Links —
/s/{code}redirect and/api/links -
Recent Uploads —
/api/documents/recent-uploads, eagle-public homepage panel - Reports — comment export and BCGW CSV reads
-
User Data — saved map areas, preferences,
/meroutes -
Bulk Download —
/api/bulk-downloads, zip jobs - Bulk Download: Operations — enable, poison-queue runbook
- Document Intake — upload link, malware scan, release
- Connecting an Application to DEMI
- Azure Environments
- Document Backup — archive copy of originals, run and check
- Document Backup: Revert and Drill — put documents back from the archive
- PDF Titles — public name written into stored PDFs, run, restore
- Secret Sync — Key Vault, secret-sync Function app, required names
-
Operating DEMI in Azure — deploy, verify
- Operating the DEMI Data Plane — devbox access, probes, audit and cost reads
- Edge ban detector — hourly timer, modes, kill switch, soak and promote
-
CI Workflows — every GitHub Actions workflow, trigger, identity, roles
- CI Deploy Workflows — eagle-demi staging and production deploys
- CI Admin Frontend Workflows — eagle-demi-admin checks and deploys
- Release Process — cutting, tagging, shipping and rolling back a version
- Runbook: Search Outage — index/app schema drift, diagnose, fix, roll back
- BC Gov Landing Zone
- Business Rules
- EPIC.search Business Rules — where DEMI differs from EPIC.search
- 001: Typesense for DFL Search — superseded
- 002: Async Processing (MongoDB Queue) — superseded
- 003: Rule-Based Classification
- 004: Read ACL Authorization Model
- 005: Cosmos Full-Text Search Ruled Out
- 006: AI Summarization over BM25
- 007: Service-to-Service Credentials
- 008: Audit and Usage Analytics Store
- 009: Track Feed — proposed
- 010: Attribute-Level Access Control
- 011: Public Read Surface
- 012: Public Config Surface
- 013: Stored Project Summaries — proposed
- 014: Sync-out to Eagle
- 015: Malware scanning on intake