diff --git a/docs/handoffs/2026-07-24-a1-regex-guard.md b/docs/handoffs/2026-07-24-a1-regex-guard.md new file mode 100644 index 0000000..f21ff5c --- /dev/null +++ b/docs/handoffs/2026-07-24-a1-regex-guard.md @@ -0,0 +1,37 @@ +# HANDOFF — A1 regex validation / ReDoS guard (#80) + +**Status:** Planned +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #80 +**Last updated:** 2026-07-24 + +## Bottom line +Before storing or serving LLM-generated A1 regex rules, run pass/fail (or equivalent) probes and reject catastrophic/invalid patterns so the CLI cannot hang. + +## Current state +- A1 rules produced in categorizer / rule publish path without a dedicated ReDoS gate (see audit §6). +- Still open from stabilize handoff follow-ups. + +## What shipped +| PR / commit | Delivers | +|-------------|---------| +| (pending) | | + +## Hook points (files to touch) +- `backend/app/services/categorizer.py` +- Rule publish / persist path before CLI consume +- `docs/audit/README.md` §6 for prior findings + +## Open follow-ups +- [ ] test_pass / test_fail (or timeout harness) for candidate regex +- [ ] Reject path does not persist/serve bad patterns +- [ ] Tests for reject path + +## How to verify +```bash +cd backend && uv run pytest tests/ -k regex -v +``` + +## Done means +- [ ] Unsafe/invalid regex not served to CLI +- [ ] Tests for reject path diff --git a/docs/handoffs/2026-07-24-deferred-load-test.md b/docs/handoffs/2026-07-24-deferred-load-test.md new file mode 100644 index 0000000..bf3344b --- /dev/null +++ b/docs/handoffs/2026-07-24-deferred-load-test.md @@ -0,0 +1,15 @@ +# HANDOFF — Load test / 5s rule (#22) [post-MVP] + +**Status:** Planned (deferred) +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #22 +**Last updated:** 2026-07-24 + +## Bottom line +Verify normal scan latency <5s and document bottlenecks. **Out of MVP.** + +## Current state +Not started; do not pull into MVP PRs. + +## Done means (later phase) +- [ ] Load harness + bottleneck notes diff --git a/docs/handoffs/2026-07-24-deferred-rag-finetune.md b/docs/handoffs/2026-07-24-deferred-rag-finetune.md new file mode 100644 index 0000000..1ef2f4f --- /dev/null +++ b/docs/handoffs/2026-07-24-deferred-rag-finetune.md @@ -0,0 +1,15 @@ +# HANDOFF — RAG fine-tune & performance test (#14) [post-MVP] + +**Status:** Planned (deferred) +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #14 +**Last updated:** 2026-07-24 + +## Bottom line +Measure extraction latency across chunk sizes and document optimal settings. **Out of MVP.** + +## Current state +Not started; do not pull into MVP PRs. + +## Done means (later phase) +- [ ] Benchmark harness + documented recommendations diff --git a/docs/handoffs/2026-07-24-deferred-regulatory-simulator.md b/docs/handoffs/2026-07-24-deferred-regulatory-simulator.md new file mode 100644 index 0000000..7634869 --- /dev/null +++ b/docs/handoffs/2026-07-24-deferred-regulatory-simulator.md @@ -0,0 +1,16 @@ +# HANDOFF — Regulatory change simulator (#13) [post-MVP] + +**Status:** Planned (deferred) +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #13 +**Last updated:** 2026-07-24 + +## Bottom line +Watch a local folder and log drift alerts (e.g. to Loki) on new file detection. **Out of MVP** per epic #74 / `docs/ROADMAP.md` Phase 1 non-goals. + +## Current state +Not started; do not pull into MVP PRs. + +## Done means (later phase) +- [ ] Scope re-confirmed in Phase 2+ +- [ ] Implementation + verify path documented then diff --git a/docs/handoffs/2026-07-24-e2e-live-hitl.md b/docs/handoffs/2026-07-24-e2e-live-hitl.md new file mode 100644 index 0000000..129c520 --- /dev/null +++ b/docs/handoffs/2026-07-24-e2e-live-hitl.md @@ -0,0 +1,40 @@ +# HANDOFF — E2E happy path + live HITL (#78) + +**Status:** Planned +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #78 +**Last updated:** 2026-07-24 + +## Bottom line +Documented cold-start path: compose/uv up → ingest sample policy → push/scan → pending HITL → approve/reject against the **live** API (mocks only as fallback). + +## Current state +- Sample fixtures: `docs/mvp/fixtures/` (#81, PR #86). +- HITL endpoints exist on backend (`PATCH /validate/{id}`); frontend may still be mock-leaning — confirm `frontend/services/api.ts`. +- No committed smoke checklist/runbook for the full path yet. + +## What shipped +| PR / commit | Delivers | +|-------------|---------| +| (pending) | | + +## Hook points (files to touch) +- `docker-compose.yml` +- `frontend/services/api.ts` + HITL UI components +- `docs/ONBOARDING.md`, `docs/mvp/` runbook +- Wire fixtures from #81 into the runbook + +## Open follow-ups +- [ ] Runbook (cold start → HITL) +- [ ] Live HITL card against backend +- [ ] Smoke script or checklist in-repo + +## How to verify +```bash +# follow runbook once written; smoke script when present +``` + +## Done means +- [ ] Runbook in docs +- [ ] HITL card works with backend up +- [ ] Smoke script or checklist committed diff --git a/docs/handoffs/2026-07-24-legacy-loki-20.md b/docs/handoffs/2026-07-24-legacy-loki-20.md new file mode 100644 index 0000000..859c6e9 --- /dev/null +++ b/docs/handoffs/2026-07-24-legacy-loki-20.md @@ -0,0 +1,12 @@ +# HANDOFF — Log every verdict to Loki (#20) [legacy] + +**Status:** Planned (superseded by #77) +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #20 → implement via #77 +**Last updated:** 2026-07-24 + +## Bottom line +Legacy Loki push tracker. **Do not implement here** — execute [#77](2026-07-24-verdict-loki-push.md) (schema from #76) and close #20 when that DoD is met. + +## Done means +- [ ] Closed as duplicate/completed by #77 diff --git a/docs/handoffs/2026-07-24-legacy-presidio-17.md b/docs/handoffs/2026-07-24-legacy-presidio-17.md new file mode 100644 index 0000000..923eef2 --- /dev/null +++ b/docs/handoffs/2026-07-24-legacy-presidio-17.md @@ -0,0 +1,12 @@ +# HANDOFF — Presidio PII integration (#17) [legacy] + +**Status:** Planned (superseded by #79) +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #17 → implement via #79 +**Last updated:** 2026-07-24 + +## Bottom line +Legacy tracker for Presidio on diffs/snippets. **Do not implement here** — execute [#79](2026-07-24-presidio-pii.md) and close #17 when that DoD is met. + +## Done means +- [ ] Closed as duplicate/completed by #79 diff --git a/docs/handoffs/2026-07-24-presidio-pii.md b/docs/handoffs/2026-07-24-presidio-pii.md new file mode 100644 index 0000000..aa9eaf4 --- /dev/null +++ b/docs/handoffs/2026-07-24-presidio-pii.md @@ -0,0 +1,40 @@ +# HANDOFF — Presidio PII gate on /validate (#79) + +**Status:** Planned +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #79 (legacy #17) +**Last updated:** 2026-07-24 + +## Bottom line +Block high-risk PII in `code_snippet` on `/validate` (email / card / phone at minimum) via a `PIIScannerService`; force HIGH/block when detected. + +## Current state +- No `backend/app/services/pii.py` yet. +- Validate path runs LLM risk check only. +- Legacy #17 is the same capability; close when #79 ships. + +## What shipped +| PR / commit | Delivers | +|-------------|---------| +| (pending) | | + +## Hook points (files to touch) +- `backend/app/services/pii.py` (new) +- `backend/app/api/validate.py` — gate before/alongside validator +- `backend/pyproject.toml` — Presidio (or agreed detector) deps +- Tests: unit detector + integration PII → HIGH/block + +## Open follow-ups +- [ ] Detector service + config +- [ ] Integrate into `/validate` +- [ ] Unit + integration tests +- [ ] Close #17 when done + +## How to verify +```bash +cd backend && uv run pytest tests/ -k pii -v +``` + +## Done means +- [ ] Unit tests for detector +- [ ] Integration: PII snippet → block/HIGH diff --git a/docs/handoffs/2026-07-24-verdict-loki-push.md b/docs/handoffs/2026-07-24-verdict-loki-push.md new file mode 100644 index 0000000..d9e1e15 --- /dev/null +++ b/docs/handoffs/2026-07-24-verdict-loki-push.md @@ -0,0 +1,42 @@ +# HANDOFF — Push verdicts to Loki (#77) + +**Status:** Planned +**Branch:** `docs/open-issue-handoffs` +**Issue(s):** #77 (legacy #20) +**Last updated:** 2026-07-24 + +## Bottom line +Ship every `verdict_event` to Grafana Loki when configured; otherwise keep a durable local/structured fallback so dev stays green without Loki. + +## Current state +- Schema lives in `backend/app/services/verdict_log.py` (#76 on `mvp/75-76-81-foundation` / PR #86 — do not re-invent keys). +- Validate emits `verdict_event` to app logger; **no** Loki HTTP push yet. +- Legacy #20 is the same intent; close it when #77 ships. + +## What shipped +| PR / commit | Delivers | +|-------------|---------| +| (pending) | | + +## Hook points (files to touch) +- `backend/app/services/verdict_log.py` / logger — push after `emit_verdict_log` +- `backend/app/core/config.py` — `LOKI_URL` (or equiv) + enable flag +- `backend/app/api/validate.py` — HITL resolve path should also emit +- CLI / `pg` completion path if it logs verdicts independently + +## Open follow-ups +- [ ] Config + no-op when unset +- [ ] Emit on validate completion + HITL approve/reject +- [ ] Tests with mocked Loki (or file sink) +- [ ] Close #20 when done + +## How to verify +```bash +cd backend && uv run pytest tests/ -k loki -v +# with LOKI_URL set: trigger /validate and confirm push (or mock) +``` + +## Done means +- [ ] Config flag/URL +- [ ] Emit on CLI-driven validate completion + HITL resolve +- [ ] No-op / file fallback when Loki unset diff --git a/docs/handoffs/README.md b/docs/handoffs/README.md index 7798269..745895a 100644 --- a/docs/handoffs/README.md +++ b/docs/handoffs/README.md @@ -38,3 +38,12 @@ Agents: use project skill **`feature-plan`** (`.agents/skills/feature-plan/` and |------|---------|----------------|--------| | 2026-07-24 | [stabilize-contracts-and-ci](2026-07-24-stabilize-contracts-and-ci.md) | `dev` / #61–#64, #73, #84 | Done | | 2026-07-24 | [mvp-continuous-compliance-gate](2026-07-24-mvp-continuous-compliance-gate.md) | `docs/mvp-handoffs` / #74 | In progress | +| 2026-07-24 | [verdict-loki-push](2026-07-24-verdict-loki-push.md) | `docs/open-issue-handoffs` / #77 (#20) | Planned | +| 2026-07-24 | [e2e-live-hitl](2026-07-24-e2e-live-hitl.md) | `docs/open-issue-handoffs` / #78 | Planned | +| 2026-07-24 | [presidio-pii](2026-07-24-presidio-pii.md) | `docs/open-issue-handoffs` / #79 (#17) | Planned | +| 2026-07-24 | [a1-regex-guard](2026-07-24-a1-regex-guard.md) | `docs/open-issue-handoffs` / #80 | Planned | +| 2026-07-24 | [legacy-presidio-17](2026-07-24-legacy-presidio-17.md) | `docs/open-issue-handoffs` / #17 → #79 | Planned | +| 2026-07-24 | [legacy-loki-20](2026-07-24-legacy-loki-20.md) | `docs/open-issue-handoffs` / #20 → #77 | Planned | +| 2026-07-24 | [deferred-regulatory-simulator](2026-07-24-deferred-regulatory-simulator.md) | `docs/open-issue-handoffs` / #13 | Deferred | +| 2026-07-24 | [deferred-rag-finetune](2026-07-24-deferred-rag-finetune.md) | `docs/open-issue-handoffs` / #14 | Deferred | +| 2026-07-24 | [deferred-load-test](2026-07-24-deferred-load-test.md) | `docs/open-issue-handoffs` / #22 | Deferred |