#!/bin/bash # dacli/scripts/validate-baseline.sh — CI gate for JNPF7 antipattern baseline # # Runs all 5 validation layers + vitest regression suite. # Exit 0 = all pass; Exit 1 = one or more failures # # Usage: # bash scripts/validate-baseline.sh # bash scripts/validate-baseline.sh --skip-llm # skip tests that need base_ai set -e cd "$(dirname "$0")/.." SKIP_LLM=false [ "$1" = "--skip-llm" ] && SKIP_LLM=true echo "==========================================" echo " dacli 5-Layer Validation Baseline" echo "==========================================" echo "" # Layer 1.1 — VisualAiModel schema echo "── L1.1: VisualAiModel JSON Schema ──" if [ -f "/tmp/dacli-baseline-form.json" ]; then npx tsx tools/validate-form-schema.ts /tmp/dacli-baseline-form.json || echo " ⚠ skipped (no baseline file)" else echo " ⚠ skipped (no /tmp/dacli-baseline-form.json)" fi echo "" # Layer 1.2 — BPMN XSD echo "── L1.2: BPMN XSD ──" if [ -f "/tmp/dacli-baseline-bpmn.xml" ]; then npx tsx tools/validate-bpmn-xsd.ts /tmp/dacli-baseline-bpmn.xml || echo " ⚠ skipped (no baseline file)" else echo " ⚠ skipped (no /tmp/dacli-baseline-bpmn.xml)" fi echo "" # Layer 1.3 — JNPF antipattern scanner echo "── L1.3: JNPF Antipattern Static Scanner ──" npx tsx tools/scan-antipatterns.ts echo "" # Layer 2.1 — Prompt rules coverage echo "── L2.1: Prompt Rules Coverage ──" npx tsx tools/check-prompt-rules.ts echo "" # Layer 2.2 — Parser coverage echo "── L2.2: Parser Coverage ──" # check-parsers.ts (P0-9): reads config/components-whitelist.yaml. # Exits 0 when 6 documented pass-through components lack refs; exits 1 only on a # real regression (a 'handled' component losing coverage). Let set -e propagate. npx tsx tools/check-parsers.ts echo "" # Layer 3 — Vitest regression tests echo "── L3: Vitest Regression Tests ──" npx vitest run tests/unit/bs117-regression.test.ts tests/unit/bpmn-bs-regression.test.ts tests/unit/antipattern-output.test.ts echo "" # Layer 4 — Historical BS replay echo "── L4: Historical BS Case Replay ──" npx tsx tools/replay-history.ts echo "" # Layer 5 — Static A/B echo "── L5: Static Prompt A/B Comparison ──" npx tsx tools/prompt-ab-static.ts echo "" echo "==========================================" echo " ✓ All baseline validations completed" echo "==========================================" echo "" echo "See: docs/dacli-validation-baseline-2026-07-27.md"