Architecture Architecture Review Checklist.md
View source on GitHub ↗
Architecture Review Checklist
Use this checklist for PRs that change streaming parsers, DuckDB schema/repositories, pass orchestration (ACI@2.0/ACI@3.0, Scoring@3.0, Triage@2.0, Remediation@1.0, TopN@2.0, Summary@2.0), DiffEngine, enrichment caches, offline ML (src/vulnparse_pin/ml/), MCP server (src/vulnparse_pin/mcp/), local browser GUI (src/vulnparse_pin/ui/gui_server.py), inventory compilation (src/vulnparse_pin/core/inventory_compiler.py), reporting templates, runtime security defaults, or dependencies.
Trigger Criteria
Run this checklist when any of the following is true:
- Parser detection, streaming readers, or XML/SARIF/CSV security guards change
- DuckDB
.vpp.dbschema (schema.sql),ensure_v21_schema(), or repository queries (repositories.py) change - Pass order, dependency declarations,
Scoring@3.0/Triage@2.0/Remediation@1.0/DiffEnginesemantics change - Enrichment cache signing, HTTPS streaming, or CVSS provenance precedence changes
- Offline ML registry/models (
src/vulnparse_pin/ml/), MCP tools/HTTP server (src/vulnparse_pin/mcp/), GUI server (src/vulnparse_pin/ui/gui_server.py), or inventory compiler (src/vulnparse_pin/core/inventory_compiler.py) change - Security-sensitive defaults (PFH,
_UMASK_LOCK, read-onlyvpp verify/vpp intel status/vpp mcp/vpp gui, CSV sanitization, Jinja2/HTML escaping) change - Runtime or optional dependencies are added or upgraded in
pyproject.toml
Checklist
1. Clean-Room Licensing & Dependency Gate (Apache-2.0)
- Zero
AGPL,GPL, orLGPLruntime dependencies introduced (e.g., no LGPLcvsslibrary; keep stdlib clean-roomcvss_utils.py). - New files include
# SPDX-License-Identifier: Apache-2.0(or-- SPDX-License-Identifier: Apache-2.0for SQL). - Hardened
lxml(_xml_security.py) is used for XML;defusedxmlis never reintroduced.
2. Streaming, DuckDB & Contract Integrity
- Parsers stream in bounded memory (
iter_batches) without whole-filejson.load()or unpruned DOM trees. - All DuckDB SQL queries use
?parameters and deterministicORDER BYtie-breakers. -
.vpp.db,.wal, and.tmppaths are validated via_validate_duckdb_paths()and created0o600under_UMASK_LOCK. -
Triage@2.0,DiffEngine, andRunManifest/ledger_eventscontracts remain deterministic and schema-valid.
3. Security & Fail-Closed Defaults
-
VP_FEED_CACHE_HMAC_KEYandVP_SQLITE_HMAC_KEYreject SHA-256 downgrades and never auto-resign unsigned/tampered caches. -
VP_MODEL_HMAC_KEY(src/vulnparse_pin/ml/registry.py) enforceshmac-sha256without downgrade, rejects symlinks /S_IWOTHfiles viaO_NOFOLLOW, and enforces artifact byte caps (< 2 MiBdistilled JSON,< 64 KiB.sig.json,< 64 MiBONNX). -
VP_WEBHOOK_HMAC_KEY(WebhookRuntimeConfig) signs HTTPS-only webhook payloads and blocks private/loopback/metadata targets by default. -
vpp mcp(streamable-http) andvpp guienforce loopback default, reject non-loopback binds without--auth-token-env(>= 16chars), validate singleHost+Originheaders, block write mutations unless--allow-writeis set, and (forvpp gui) requireX-VPP-CSRFonPOST /api/rpcalongside zero-CDNContent-Security-Policyheaders. - Remote HTTPS downloads use
allow_redirects=Falsewith per-hop HTTPS validation and byte caps. -
vpp verify(_build_verify_pfh) andvpp intel statusremain strictly read-only by default (zero$HOME/XDG_*writes). - HTML/Markdown templates enforce
autoescape/md_escape, and CSV exports sanitize formulas by default unless--no-csv-sanitize --confirm-unsafe-csvare both given.
4. Test Coverage & Verification
- Streaming parser, XXE/zip-traversal, DuckDB repository, pass contract, and cross-component CLI tests are added/updated.
-
RunManifestdigest andvpp verifytests pass when pass outputs or reporting bundles change. - Documentation (
Usage.md,Configs.md,Architecture.md, ADRs,CHANGELOG.md) reflects user-visible or architectural changes.
Completion Record (copy into PR)
Architecture Review Checklist
- Trigger: <why checklist applies>
- ADR: <link or N/A>
- Apache-2.0 / Clean-Room Deps Verified: <yes/no>
- Compatibility Impact: <none|additive|breaking>
- Tests Updated: <list>
- Docs Updated: <list>
- Rollback Plan: <summary>