bcgov / bcgov/entity

9.3 — Preserve AI output in audit logs (staff-only

Open
#30,626 0 comments 0 reactions 0 assignees View on GitHub
Assets
Dominant language
JavaScript
Stars
23
Forks
62
Avg merge
24m
Merged PRs (30d)
1

Description

# 9.3 — Record AI validation result in MHR audit log (MVP)

**Priority (MoSCoW):** Must
**Persona:** Registry Analyst
**Value:** Ensure AI validation results are recorded in the audit log for each uploaded MHR document, so analysts and operations have a defensible record of document authenticity checks.

---

## User Story
As a **registry analyst**,
I want **Document AI validation results to be stored in the MHR audit log**,
So that **there is an accountable, defensible history of when and how documents were validated**.

## Context
- **Where:** DRS audit trail linked to each MHR filing request.
- **Purpose:** Preserve AI validation outputs (status, timestamp, who uploaded) for compliance, audit, and dispute resolution.
- **Flow:** Document uploaded → Document AI runs (9.1) → Result displayed (9.2) → Result logged in audit trail (9.3).
- **Policy fit (BA to confirm):**
- FOIPPA — s.30.1: Requires secure storage and access of personal information.
**How this story meets it:** Ensures audit records of validation results are maintained securely in-province.

## UX/UI Link (Design-owned)
_TBD — Design to paste after BA review is complete._

## Sprints
| Role (icon + text) | Forecasted (PO-planned) | Actual (post-planning) |
|:-------------------|:-------------------------------|:-------------------------------|
| 🧭 PO | Sprint __ (________–________) | Sprint __ (________–________) |
| 📌 BA | Sprint __ (________–________) | Sprint __ (________–________) |
| 🎨 Design | Sprint __ (________–________) | Sprint __ (________–________) |
| 💻 Dev | Sprint __ (________–________) | Sprint __ (________–________) |

---

## MVP Boundary (story-level; PO-owned)
- **In:**
- Store Document AI validation result (flag/score, timestamp, uploader) in the filing’s audit log.
- Make log entries staff-only, not visible to filers.
- **Out:**
- Analyst override or comments on validation (future).
- Exposing AI scores to external parties.

---

## Acceptance Criteria (PO-owned; user-observable)
- [ ] Every AI validation result (Validated / Flagged / Unavailable) is stored in the audit log with timestamp and uploader ID.
- [ ] Audit log entries are staff-only (not shown to filer or public).
- [ ] Original documents remain preserved and unaltered.
- [ ] **Accessibility:** Audit log entry must be text-based, not reliant on colour or visual cues.
- [ ] **Unavailable:** If AI service is unavailable, log entry shows “Validation unavailable” with reason.

---

## BA Section (Required before Dev)
*(BA responsible, Design consulted — SM enforces DoR)*

### Definition of Ready — BA gate
- [ ] **BA — please cover completed** (rules, errors, edge cases, authoritative sources, policy refs)
- [ ] Edge cases table filled
- [ ] Draft Gherkin (happy path + key errors)
- [ ] Policy refs confirmed & linked in Context
- [ ] Ticket reviewed with Design (labels/states aligned; Design confirms readiness)
- [ ] UX/UI link pasted (Design)

---

**BA — please cover**
- [ ] Business & validation rules (plain language)
- [ ] Error wording users should see + edge cases (incl. **Unavailable**)
- [ ] **Unavailable wording:** plain-language, non-blocking message
- [ ] Data & authoritative sources (e.g., audit logs, FOIPPA constraints)
- [ ] Constraints/NFRs (performance, availability, retention period) if relevant
- [ ] Check with Design on accessibility basics (Design owns the HOW)
- [ ] Policy references (MHA/MHR Reg/FOIPPA) if applicable — see below

**Policy references (BA to confirm)**
- Manufactured Home Act — s.8: Registrar may require supporting documents. Link: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/03075_01
- Manufactured Home Regulation — s.3: Proof of information in a record may be required. Link: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96_2004
- FOIPPA — s.30.1: Personal information must be stored and accessed only in Canada unless permitted by regulation. Link: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96165_00

**BA Prompts (things to think about)**
- What exact details need to be logged (flag only, flag + score, full metadata)?
- Should audit log entries include **who ran the validation** (system vs. analyst)?
- How long must these validation results be retained (ARCS/ORCS)?
- What wording should appear for **Unavailable** status?
- Do flagged results require any **additional audit notation** (e.g., “Analyst review required”)?

---

### BA — Edge cases
| Edge case | What triggers it | What the user sees | Can they continue? |
|-----------|------------------|--------------------|--------------------|
| AI unavailable | Service down at upload | Audit log: “Validation unavailable — document stored” | Yes |
| False positive | AI flags document incorrectly | Audit log shows “Flagged” with timestamp | Yes |
| Manual correction | Analyst later rejects filing | Audit log still shows original AI result, plus analyst action (separate entry) | Yes |

---

### BA — Gherkin (to draft before Dev)
- [ ] **Happy path:** Document uploaded, AI result logged with timestamp and uploader.
- [ ] **AI unavailable:** Log entry shows “Validation unavailable — document stored.”
- [ ] **Flagged document:** Log entry shows “Flagged for Review.”
- [ ] **Audit visibility:** Log entry is visible to staff only.

---

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or implementation entry points are identified. Start by completing the BA and Design sections, then trace the Document AI flow from upload through the DRS audit trail; done means staff-only entries preserve each result, timestamp, uploader, unavailable reason, and the original document.

Written by the indexing model from the issue text.

Assessment

Domain
authorization, backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.