Repository navigation
Business Rules
Rules the business has set for the Digital File Library (DFL) and the AI Classifier Tool (AICT). This page is a requirements catalogue, not a description of DEMI as it runs. Do not cite a rule here as evidence of how the code behaves.
Only BR-04 has a counterpart in src/. It ships as the read[] ACL: a record is public only
when its read[] contains public, and chunk visibility is derived from the parent document at
query time. Architecture describes the mechanism and
ADR-004-Read-ACL-Authorization-Model the decision behind it.
Everything else on this page is unimplemented. Two fields exist but do not do what the rules
describe: orcsClassification (src/seed/transform.js:146) and legislation
(src/seed/transform.js:148) are copied verbatim from Eagle, not derived. DEMI has three access
tiers — privileged, scoped, public — not the five levels of BR-03.
-
Rule: All newly uploaded or migrated documents, from
EPIC.submitor an automated EDRMS pipeline, must immediately enter a metadata verification hold state. - Constraint: During the hold the file is staged in object storage but is not admitted as an official DFL file-of-record. It stays invisible and unsearchable except to the uploader or a SuperUser.
- Admission trigger: A document is admitted, becoming a file-of-record, only when an authorized operator or SuperUser reviews, corrects and confirms its metadata.
-
Rule: On upload, every file must receive a coarse, reversible two-letter "vein" classification
handle appended as a filename suffix, for example
<original name> -[VV] -P.json, where-Pmeans pending verification. -
Vein spectrum:
-
PT— project technical detail (bulk studies, baseline reports, plans) -
CP— certificate proper (the legally issued certificate itself) -
PE— public engagement (public comments, PCP advertisements) -
AT— Act transition (requests, cross-Act notifications) -
OA— official EA artifacts (orders, amendments, evaluations) -
CM— communication (general correspondence, letters)
-
Document security and authorization levels must align with a 0–4 sensitivity scale:
| Level | Classification | Audience |
|---|---|---|
0 |
Uploader only | The uploading account or service alone |
1 |
Project team | The designated EAO project team list |
2 |
EAO-wide | All internal EAO staff (IDIR holders) |
3 |
TAC / working group | Technical Advisory Committee and working groups |
4 |
Government-wide | All BC government staff with a valid IDIR |
- Rule: For a DFL document to be searchable or viewable by the public it must pass two checks: the document itself is published, and its parent project is published.
-
Enforcement: The document's
read[]must containpublic, and a project visibility change cascades into its documents'read[]by intersection, so a document cannot out-rank its parent. Publishing a document under an unpublished project is refused with 409. Every search a caller makes carries that caller'sread[]predicate, evaluated by Azure AI Search alongside the match. Chunks are gated by their parent document, resolved at query time.
- Rule: High-volume technical project documentation — baseline studies, raw appendices, environmental chapters, about 76% of files — must be identified and set aside in a preliminary "grazing" pre-pass.
-
Action: These documents are flagged
Project Content = YESand skip deep taxonomy and keyword-frequency analysis. - Objective: Preserve throughput and prevent resource exhaustion during bulk ingestion.
-
Rule: Records-management fields must use a deterministic mapping so the result is auditable
and explainable:
- AICT uses keyword score thresholds to suggest a document type — "environmental assessment
certificate" suggests
EAC. - The confirmed document type maps one-to-one to an official ORCS classification code, defined by GIMO.
- The ORCS code dictates the retention class and disposal schedule.
- AICT uses keyword score thresholds to suggest a document type — "environmental assessment
certificate" suggests
-
Mapping:
-
EAC(certificate) → ORCS15400-30→ permanent archiving -
AR(assessment report) → ORCS15400-20→ 7 years semi-active retention, then archive -
Process Order→ ORCS15400-40→ active life of project
-
- Rule: The AICT interface must present the rule, score weights or keyword hits — for example "matched term 'environmental assessment certificate' 4 times" — alongside any suggestion.
- Consent rule: Autonomous final assignment of ORCS codes is forbidden. A human supervisor must confirm before records-management tags are committed.
- Rule: The system must evaluate a document's creation or publication date against regulatory transition milestones to assign the correct operative Act — the 1996, 2002 or 2018 EAA.
-
Transition threshold: Documents on or after the Process Order milestone —
2021-04-16for Cariboo Gold — default to the 2018 Act; earlier documents operate under the 2002 Act.
- Rule: An individual document stays tagged under a single operative Act.
- Action: Where a project spans multiple Acts, detected through transition documents such as a "Section 10 Order" paired with a "Section 19 Order", AICT compiles a project-level transition timeline block rather than duplicating Act fields on every document.
EPIC-Search-Business-Rules lists where DEMI's rules differ from EAO's other search product, EPIC.search.
- 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