@windyroad/risk-scorer 0.13.4 → 0.13.5-preview.755
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
|
@@ -214,7 +214,7 @@ TODAY=$(date -u '+%Y-%m-%d')
|
|
|
214
214
|
# slate. Filesystem-only is correct for the bootstrap case; ADR-019 still applies to
|
|
215
215
|
# /wr-risk-scorer:create-risk for incremental adds post-bootstrap.
|
|
216
216
|
LOCAL_MAX=$(ls "$TARGET_DIR/"R*.active.md "$TARGET_DIR/"R*.retired.md 2>/dev/null | sed 's|.*/R||' | grep -oE '^[0-9]+' | sort -n | tail -1 || true)
|
|
217
|
-
NEXT_ID=$((
|
|
217
|
+
NEXT_ID=$(( 10#${LOCAL_MAX:-0} + 1 ))
|
|
218
218
|
|
|
219
219
|
CREATED=0
|
|
220
220
|
APPENDED=0
|
|
@@ -347,7 +347,7 @@ cat > "$TARGET_DIR/README.md" <<README_HEADER
|
|
|
347
347
|
|
|
348
348
|
## Purpose
|
|
349
349
|
|
|
350
|
-
This directory is the **persistent risk register** for
|
|
350
|
+
This directory is the **persistent risk register** for this project. It is distinct from:
|
|
351
351
|
|
|
352
352
|
- \`RISK-POLICY.md\` — defines the *criteria* (impact/likelihood scales, appetite, treatment principles).
|
|
353
353
|
- \`.risk-reports/\` — ephemeral **per-change** pipeline risk reports produced by the risk-scorer on each commit/push/release. Auto-deleted after 7 days.
|
|
@@ -259,6 +259,23 @@ EOF
|
|
|
259
259
|
grep -q "ADR-059" docs/risks/README.md
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
@test "emitted README does NOT leak the publishing-suite brand name (P374 published-artefacts)" {
|
|
263
|
+
# The README heredoc must use project-neutral phrasing so an adopter's
|
|
264
|
+
# generated docs/risks/README.md never carries the source monorepo's
|
|
265
|
+
# brand into adopter-controlled prose. Witness substring from #273.
|
|
266
|
+
mkdir -p .risk-reports
|
|
267
|
+
cat > .risk-reports/r.md <<'EOF'
|
|
268
|
+
RISK_REGISTER_HINT:
|
|
269
|
+
- above-appetite-residual | brand-leak-test | Brand-leak absence check
|
|
270
|
+
EOF
|
|
271
|
+
run "$SCRIPT"
|
|
272
|
+
[ "$status" -eq 0 ]
|
|
273
|
+
[ -f docs/risks/README.md ]
|
|
274
|
+
! grep -q "Windy Road Agent Plugins suite" docs/risks/README.md
|
|
275
|
+
# Positive assertion: the neutral phrasing is present
|
|
276
|
+
grep -q "persistent risk register\*\* for this project" docs/risks/README.md
|
|
277
|
+
}
|
|
278
|
+
|
|
262
279
|
@test "README does NOT cite TEMPLATE.md (per user direction 2026-05-04)" {
|
|
263
280
|
mkdir -p .risk-reports
|
|
264
281
|
cat > .risk-reports/r.md <<'EOF'
|
|
@@ -314,3 +331,36 @@ EOF
|
|
|
314
331
|
ls docs/risks/R*-derived-slug.active.md >/dev/null 2>&1
|
|
315
332
|
rm -f /tmp/derived.tsv
|
|
316
333
|
}
|
|
334
|
+
|
|
335
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
336
|
+
# Octal-eval regression (P164 Phase 2 — #273 witness)
|
|
337
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
338
|
+
# Bash arithmetic $(( ... )) parses a leading-zero operand as octal; 008/009 are
|
|
339
|
+
# invalid octal literals → `bash: 008: value too great for base`. The next-ID
|
|
340
|
+
# compute (LOCAL_MAX from zero-padded R<NNN> filenames) must force base-10 with
|
|
341
|
+
# 10#. Pre-seed an R008 entry so LOCAL_MAX="008" and assert the script allocates
|
|
342
|
+
# R009 cleanly without the octal error.
|
|
343
|
+
|
|
344
|
+
@test "allocates R009 cleanly when an R008 entry already exists (octal-eval regression, P164 Phase 2)" {
|
|
345
|
+
mkdir -p docs/risks
|
|
346
|
+
# Pre-existing zero-padded entry that drives LOCAL_MAX="008". Carries the
|
|
347
|
+
# full field shape the README generator reads (Category/Status/Curation) so
|
|
348
|
+
# the regression isolates the octal-eval boundary, not fixture malformation.
|
|
349
|
+
cat > docs/risks/R008-pre-existing.active.md <<'EOF'
|
|
350
|
+
# Risk R008: Pre Existing
|
|
351
|
+
**Status**: Active
|
|
352
|
+
**Category**: operational
|
|
353
|
+
**Curation**: (human-curated)
|
|
354
|
+
EOF
|
|
355
|
+
mkdir -p .risk-reports
|
|
356
|
+
cat > .risk-reports/octal.md <<'EOF'
|
|
357
|
+
RISK_REGISTER_HINT:
|
|
358
|
+
- above-appetite-residual | octal-boundary-slug | New risk past the 008 boundary
|
|
359
|
+
EOF
|
|
360
|
+
run "$SCRIPT"
|
|
361
|
+
[ "$status" -eq 0 ]
|
|
362
|
+
# No octal-base error in output
|
|
363
|
+
[[ "$output" != *"value too great for base"* ]]
|
|
364
|
+
# New entry allocated as R009, not a corrupted/duplicate ID
|
|
365
|
+
[ -f docs/risks/R009-octal-boundary-slug.active.md ]
|
|
366
|
+
}
|