← Back to project

Scrapbook: Implementation Plan & Backlog



Date: 2026-02-16T18:00:00Z

Goal: Break MVP architecture into 25–40 engineering tasks, each with clear goal, acceptance criteria, and difficulty estimate (S=1-2d, M=3-5d, L=1+wk). Group by milestone and produce a 60‑day schedule.

We’ll aim for ~30 tasks.

Milestone 1: CDC Ingestion (Days 1–10)



1. Task: Set up test MySQL 8 instance with binlog enabled, sample pharmacy schema.


2. Task: Install and configure Debezium Server (HTTP sink).

3. Task: Implement `/ingest` HTTP endpoint in Go service.

4. Task: End‑to‑end verification: Debezium → overlay → storage? Not yet storage; just log receipt.

Milestone 2: Normalization & Persistent Storage (Days 5–12)



5. Task: Define Go structs for CanonicalChangeEvent; implement conversion from Debezium raw.


6. Task: Design and implement SQLite storage schema (table `events` + indexes).

7. Task: Implement idempotent ingestion: store canonical event with `INSERT OR IGNORE` by `event_id`.

8. Task: Add transaction grouping: store `transaction_id` and ensure atomic batch ingest.

Milestone 3: Inference Engine (Days 10–20)



9. Task: Implement rule engine that consumes canonical events grouped by transaction.


10. Task: Implement inventory adjustment inference (single row update).

11. Task: Implement user role change detection.

12. Task: Write unit tests for inference rules (sample transactions).

Milestone 4: AI Layer (Days 15–30)



13. Task: Integrate Ollama client (HTTP to localhost:11434).


14. Task: Implement daily summary batch job (runs at 23:30).

15. Task: Design and implement heuristic anomaly detection (inventory, user, branch).

16. Task: AI‑enhanced explanations: for each anomaly, call Ollama to produce natural language reason.

17. Task: Caching layer for summaries and anomaly explanations to avoid repeated LLM calls.

Milestone 5: Interfaces (Days 25–35)



18. Task: Build CLI `auditctl` (subcommands: summary, anomalies, trace, export).


19. Task: Implement MCP server (stdio) with all five tools.

20. Task: (Stretch) Build minimal web UI: dashboard showing recent events, summary, anomalies.

Milestone 6: Security & Polish (Days 30–40)



21. Task: Add configurable data masking (column blacklist).


22. Task: Harden secrets handling: support Docker secrets or `.env` with strict file perms.

23. Task: Implement overlay‑self audit logging (rotate files, capture errors).

24. Task: Create Docker Compose file bundling Debezium, overlay, and optional MySQL.

25. Task: Write installation guide (markdown) for on‑prem deploy.

Milestone 7: Synthetic Data & Demo (Days 35–50)



26. Task: Build synthetic pharmacy data generator (Go or Python).


27. Task: Integrate generator into Docker Compose (init container or script).

28. Task: Create demo script: show key features (summary, anomaly, trace).

Milestone 8: Pilot Prep & Documentation (Days 45–60)



29. Task: End‑to‑end testing with synthetic data; tune heuristics.


30. Task: Write operator’s manual (config reference, troubleshooting).

31. Task: Prepare pilot proposal template (based on Report 5).

32. Task: Final code cleanup: remove debug, add metrics, ensure graceful shutdown.

That’s 32 tasks. Good.


Schedule (High‑Level)



Dependencies: Ingestion must precede normalization; normalization before inference; storage before AI; AI before summary/CLI. MCP depends on all read paths.


---

Will be refined into Report 6.