Skip to content

feat: add controlled SafeCall incident seeding - #143

Closed
AB-rmit wants to merge 3 commits into
RMIT-Garage:mainfrom
AB-rmit-projects:feature/safecall-phase3-incident-seeding
Closed

AB-rmit wants to merge 3 commits into
RMIT-Garage:mainfrom
AB-rmit-projects:feature/safecall-phase3-incident-seeding

Conversation

@AB-rmit

@AB-rmit AB-rmit commented Oct 21, 2026

Copy link
Copy Markdown

Summary

Implements Phase 3 of the SafeCall Incident Evidence & Action Log feature: controlled, administrator-only seeding of 50 fictional incidents.

Implementation

  • Adds 50 deterministic incidents (INC-001–INC-050) with 50 unique device IDs.
  • Implements five simulated cause categories with the agreed 15/12/10/8/5 distribution.
  • Provides an emulator-only CLI with dry-run mode by default.
  • Uses Firestore create-only writes to prevent overwriting existing incidents.
  • Adds idempotency, conflict detection, strict argument validation and emulator safety checks.
  • Adds unit tests, emulator integration tests and seeding documentation.

Verification

  • TypeScript typecheck: passed
  • ESLint: passed
  • Frontend tests: 241 passed
  • Firestore emulator tests: 86 passed, including 15 seed integration tests
  • Backend tests: 5 passed
  • Validation and production build: passed

Emulator smoke test

  • Dry run: 50 would be created; no writes.
  • First write: 50 incidents created.
  • Repeated write: 0 created, 50 skipped.
  • Existing incident data and update timestamps remained unchanged.

Safety and scope

  • Production Firebase access is disabled.
  • No real Firebase database has been populated.
  • No application-facing incident-creation functionality is introduced.
  • Firestore security rules and indexes are unchanged.
  • Phase 4 dashboard implementation is not included.

Next phase

Phase 4 will implement the incident dashboard using the existing Incident schema and seeded dataset.

AB-rmit and others added 3 commits October 20, 2026 18:16
* chore: remediate dependency advisories and set Firebase project

- next / eslint-config-next 16.2.12 -> 16.3.8 (3 critical + 1 high advisory)
- vitest / @vitest/coverage-v8 ^3.1.1 -> ^4.1.12 (drops vulnerable tinypool 1.x;
  no patched 1.x exists); migrate removed poolOptions.forks.singleFork in
  backend/vitest.config.ts to maxWorkers: 1, isolate: false
- lockfile-only, in-range fixes: sharp, nanoid, source-map-js, js-yaml,
  brace-expansion, proxy-addr, @fastify/busboy, @grpc/grpc-js
- scoped override @firebase/firestore>@grpc/grpc-js ^1.14.5 (Firebase pins
  ~1.9.0, which has no patched release)
- ignore only GHSA-vfj7-8cjw-p6xm (braces: no patched version exists;
  lint-time path only), documented in README with a removal condition
- commit the real Firebase project ID in .firebaserc
- frontend/AGENTS.md: block regenerated by next 16.3 `next dev`

* chore: make postcss override comment version-independent
Establishes the Firestore foundation for the SafeCall Incident Evidence & Action Log feature.

- Add Incident and ActionLog models, owner-scoped queries and Zod validation.
- Enforce verified-owner access and append-only action history through Firestore security rules.
- Add composite index definitions and 71 Firestore emulator tests.
- Harden authentication, session synchronisation and sign-out handling.
- Add authentication and component regression tests.
- Update documentation, patch Vite and correct pre-commit whitespace validation.

Verification: 81 frontend, 5 backend and 71 Firestore security tests passed. GitHub CI passed.

The incident seed script, dashboard, detail screen and deployment remain for subsequent phases.
@AB-rmit AB-rmit closed this Oct 21, 2026
@AB-rmit AB-rmit reopened this Oct 21, 2026
@AB-rmit

AB-rmit commented Oct 21, 2026

Copy link
Copy Markdown
Author

Opened against the upstream boilerplate repository by mistake. Closing and recreating against the correct project repository.

@AB-rmit AB-rmit closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant