# decisions.json — what `render-security-updates.mjs` takes

One file per project per run, written by you after Phase 3 and updated after verification.
Keep it outside the repo (e.g. `/tmp/avo-security/<project>/decisions.json`); the rendered
entry is what gets committed, into `docs/SecurityUpdates.md`.

```json
{
  "project": "immerse-player-hub",
  "projectDir": "/Users/me/dce/apps/immersive-player",
  "version": "1.12.2",
  "date": "2026-11-10",
  "scope": ["root", "client", "server"],
  "wizReportDate": "2026-11-03",
  "before": { "root": { "total": 25 }, "client": { "total": 28 }, "server": { "total": 33 } },
  "after":  { "root": { "total": 25 }, "client": { "total": 6 },  "server": { "total": 9 } },
  "preparedBy": "AvoSecurity (Claude) with Gabe",
  "summary": "Optional one-paragraph overview that renders under the header lines.",

  "resolved": [
    { "package": "qs", "location": "server", "severity": "moderate",
      "advisories": ["GHSA-x5fp-wj9c-mxmx", "GHSA-4mjr-xmp4-gh2g"],
      "from": "6.11.0", "to": "6.16.1", "notes": "npm update qs (lockfile only); Wiz w2" }
  ],
  "removed": [
    { "package": "@monaco-editor/react", "location": "client",
      "advisories": ["GHSA-cmwh-pvxp-8882"],
      "reason": "no import anywhere in client/src; pulled in the critical DOMPurify finding",
      "confirmedBy": "Gabe, 2026-11-10" }
  ],
  "blocked": [
    { "finding": "uuid < 11.1.1 (GHSA-w5hq-g745-h8pq)", "library": "dce-mango",
      "neededChange": "bump uuid to ^11.1.1 and publish 2.x", "status": "lib PR prepared" }
  ],
  "accepted": [
    { "package": "aws-cdk-lib", "advisory": ["GHSA-rx28-r23p-2qc3"],
      "exposure": "deploy-tool (root devDependency, not in image)",
      "why": "runs only on a developer's machine during deploys; fix needs a caccl-deploy update",
      "revisitBy": "2026-12" }
  ],
  "infrastructure": [
    "Rebuild on refreshed node:24-alpine clears Wiz w3 (openssl) and w4 (node runtime).",
    "Recommendation raised: prune devDependencies from the image (multi-stage build)."
  ],
  "verification": {
    "local": ["root: npm ci ok", "client: npm ci, build, vitest, lint, typecheck ok", "server: npm ci, build, jest ok"],
    "instance": { "name": "Test (immersive-test)", "deployedOn": "2026-11-11", "deployedBy": "Gabe" },
    "ky": { "profile": "Test", "folder": "all", "passed": 42, "failed": 0,
            "report": "immersive-classroom-tests/results/2026-11-11" }
  },
  "wizIdsExpectedToClear": ["w1", "w2", "w3", "w4"]
}
```

Field notes:

- `version` is the version the PR *creates* (current patch + 1); `date` is the date of the
  entry. Both are required; everything else may be empty, and empty sections render as
  "None." so the entry's shape stays constant from month to month.
- `before`/`after` take `npm audit --json`'s `metadata.vulnerabilities` objects (or just
  `{ "total": n }`) keyed by location label. The renderer prints `root 25→25, client 28→6`.
- `resolved` rows are one per package per location. Put the Wiz id in `notes` when there is one.
- `removed` requires `confirmedBy`: a removal without a developer's yes does not happen.
- `blocked` rows are the lib-fix queue for this app; `status` is free text
  (`requested`, `lib PR prepared`, `published, bump pending`).
- `accepted` rows must say *why* in terms a security reviewer accepts (exposure class,
  preconditions not met, dev-only, dead code) and carry a `revisitBy`. Mirror each one into
  `.reviewed-cves` (see `wiz-csv.md`).
- `verification.ky` is filled in after the deployed-instance run; until then leave it out and
  the entry prints `_pending_`. Re-run the renderer after updating; it replaces the entry for
  the same version in place.

Rendered shape (the renderer owns this; do not hand-edit the entry):

```markdown
## v1.12.2 — 2026-11-10

**Scope:** root, client, server; Wiz report dated 2026-11-03
**Before → after (`npm audit`):** root 25→25, client 28→6, server 33→9
**Prepared by:** AvoSecurity (Claude) with Gabe

### Resolved
| Package | Location | Severity | Advisory | From → To | Notes |
### Removed unused dependencies
| Package | Location | Advisories it carried | Why it was unused | Confirmed by |
### Blocked on in-house libraries
| Finding | Library | Needed change | Status |
### No fix available / accepted risk
| Package | Advisory | Exposure | Why acceptable | Revisit by |
### Base image / infrastructure
### Verification
- Local / Instance / Ky / Wiz ids expected to clear
```
