@metasession.co/devaudit-cli 0.1.45 → 0.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metasession.co/devaudit-cli",
3
- "version": "0.1.45",
3
+ "version": "0.1.47",
4
4
  "description": "DevAudit CLI — installs, syncs, and operates the Metasession SDLC across consumer projects.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@clack/prompts": "^0.8.2",
36
- "@metasession.co/devaudit-plugin-sdk": "^0.1.45",
36
+ "@metasession.co/devaudit-plugin-sdk": "^0.1.47",
37
37
  "commander": "^12.1.0",
38
38
  "consola": "^3.2.3",
39
39
  "env-paths": "^3.0.0",
@@ -184,13 +184,33 @@ fi
184
184
  # Issue: devaudit#263.
185
185
  SUCCEEDED=0
186
186
  FAILED=0
187
+ # devaudit#133 — central stub guard. Any file still carrying the
188
+ # DevAudit starter banner ("STARTER TEMPLATE — REPLACE BEFORE
189
+ # COMMITTING" / "...BEFORE GOING TO PRODUCTION" — both phrasings)
190
+ # is skipped before the upload attempt so unedited placeholders
191
+ # can't flip a clause to COVERED off a stub. The check is binary-
192
+ # safe (-a) so it doesn't choke on PNGs or other non-text files.
193
+ SKIPPED=0
187
194
  TOTAL_SIZE=0
188
195
  UPLOAD_URL="${DEVAUDIT_BASE_URL}/api/evidence/upload"
189
196
  MAX_ATTEMPTS=${UPLOAD_MAX_ATTEMPTS:-5}
190
197
  INITIAL_BACKOFF_SECONDS=${UPLOAD_INITIAL_BACKOFF_SECONDS:-1}
191
198
 
199
+ is_unedited_starter_stub() {
200
+ # Match BOTH banner phrasings the SDLC has shipped (v0.1.36 changed
201
+ # the wording from "...GOING TO PRODUCTION" to "...COMMITTING").
202
+ # -a forces binary→text so we don't error on PNGs/PDFs; the regex
203
+ # won't match either of those formats by accident.
204
+ grep -aqE 'STARTER TEMPLATE.+REPLACE BEFORE' "$1"
205
+ }
206
+
192
207
  for FILE in "${FILES[@]}"; do
193
208
  FILENAME=$(basename "$FILE")
209
+ if is_unedited_starter_stub "$FILE"; then
210
+ echo "SKIPPED ${FILENAME} — unedited starter stub (replace the STARTER TEMPLATE banner to upload)"
211
+ SKIPPED=$((SKIPPED + 1))
212
+ continue
213
+ fi
194
214
  FILE_SIZE=$(stat -c%s "$FILE" 2>/dev/null || stat -f%z "$FILE")
195
215
  echo -n "Uploading ${FILENAME}... "
196
216
  CURL_ARGS=(
@@ -267,8 +287,10 @@ done
267
287
  # --- Summary ---
268
288
  echo ""
269
289
  echo "=== Upload Summary ==="
270
- echo "Files: ${SUCCEEDED} succeeded, ${FAILED} failed (${#FILES[@]} total)"
290
+ echo "Files: ${SUCCEEDED} succeeded, ${FAILED} failed, ${SKIPPED} skipped (${#FILES[@]} total)"
271
291
  echo "Total size: $((TOTAL_SIZE / 1024)) KB"
292
+ # Skipped stubs are intentional (devaudit#133) — they don't fail the
293
+ # run. Only true upload failures bump the exit code.
272
294
  if [ "$FAILED" -gt 0 ]; then
273
295
  exit 1
274
296
  fi
@@ -29,9 +29,9 @@ last_reviewed_at: "REPLACE — YYYY-MM-DD"
29
29
 
30
30
  ## Uploading this artefact
31
31
 
32
- - **File path:** `compliance/governance/incident-report.md` (the template) or `compliance/governance/incident-report-<id>.md` (per-incident — recommended; the `incident-export.yml` workflow auto-produces these from closed GitHub issues labelled `incident`)
33
- - **Upload trigger:** automatic — on every push to `develop` that touches `compliance/**`, `compliance-evidence.yml` uploads this file as `incident_report` evidence via the `upload_governance` helper.
34
- - **Verify after merge:** open `/projects/<slug>/compliance`. `ISO29119.3.5.4` always flips to COVERED (baseline). `SOC2.CC7.2`, `GDPR.Art-33`, `GDPR.Art-34` flip only when the relevant attribution sections below are non-stub.
32
+ - **File path:** `compliance/governance/incident-report-<id>.md` (per-incident — recommended; the `incident-export.yml` workflow auto-produces these from closed GitHub issues labelled `incident`). The bare `incident-report.md` is the unedited starter — kept on disk as a reference but **skipped by the uploader** until you replace the STARTER TEMPLATE banner.
33
+ - **Upload trigger:** automatic — on every push to `develop` that touches `compliance/**`, `compliance-evidence.yml` globs `incident-report*.md` under both layouts and uploads each non-stub file as `incident_report` evidence via the `upload_governance` helper. The starter stub is filtered out centrally by `upload-evidence.sh` (devaudit#133).
34
+ - **Verify after merge:** open `/projects/<slug>/compliance`. `ISO29119.3.5.4` flips to COVERED only when a non-stub `incident-report*.md` lands. `SOC2.CC7.2`, `GDPR.Art-33`, `GDPR.Art-34` flip only when the relevant attribution sections below are non-stub.
35
35
  - **Refresh cadence:** none — incidents are point-in-time. Authoring is event-driven.
36
36
 
37
37
  ## Framework attribution — which clauses THIS incident closes
@@ -290,8 +290,19 @@ jobs:
290
290
  # (operator's choice — both layouts are common).
291
291
  upload_governance compliance/periodic-review.md periodic_review
292
292
  upload_governance compliance/governance/periodic-review.md periodic_review
293
- upload_governance compliance/incident-report.md incident_report
294
- upload_governance compliance/governance/incident-report.md incident_report
293
+ # Incident reports: glob `incident-report*.md` so per-incident
294
+ # files (e.g. `incident-report-2026-001.md`, written by
295
+ # incident-export.yml from labelled GitHub issues) all
296
+ # upload as real evidence. The unedited starter
297
+ # `incident-report.md` matches the glob too but is skipped
298
+ # by upload-evidence.sh's central stub guard — so the stub
299
+ # can never flip ISO29119.3.5.4 to COVERED on its own
300
+ # (devaudit#133). `*.md` does not match `*.md.template`.
301
+ shopt -s nullglob
302
+ for f in compliance/incident-report*.md compliance/governance/incident-report*.md; do
303
+ upload_governance "$f" incident_report
304
+ done
305
+ shopt -u nullglob
295
306
 
296
307
  # ── Audit-log export (DevAudit-Installer#98 WS2) ──────────────
297
308
  # Snapshot the portal's audit log for the rolling 90-day window