Files
ssw-mvp/dacli/scripts/validate-baseline.sh
T
admin 4d096dd97e chore(dacli): 提交 dacli CLI 工具源码并过滤敏感/噪声文件
- dacli/ 整目录被 .gitignore 忽略,本次 force-add 其业务源码(766 文件)
- 排除 node_modules/.env(含 PGPASSWORD 等敏感信息)/.DS_Store/__pycache__/*.pyc
- 新增 dacli/.gitignore 长期管理内部噪声,新增文件仍需 git add -f
- 根 .gitignore 补充 .cache/ 与诊断脚本忽略,并加 dacli 段说明
2026-08-06 19:02:39 +08:00

76 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# dacli/scripts/validate-baseline.sh — CI gate for JNPF antipattern baseline
#
# Runs all 4 validation layers + vitest regression suite.
# Exit 0 = all pass; Exit 1 = one or more failures
#
# 注: 原 L5 (Static Prompt A/B Comparison) 已移除 (2026-07-29).
# jnpf7 是临时对照目录, 该层不再需要. tools/prompt-ab-static.ts 已删除.
#
# 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 4-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 ""
echo "=========================================="
echo " ✓ All baseline validations completed"
echo "=========================================="
echo ""
echo "See: docs/dacli-validation-baseline-2026-07-27.md"