Files
dacli/scripts/validate-baseline.sh
T
sushub f403a7e80e import: ssw/dacli@eea0ebc (2026-08-12) 起点版本
本仓 2026-08-12 从 ssw main (192.168.1.18:13300/ssw/ssw-mvp) 的
dacli/ subpath 抽取,作为独立仓托管到 gitea:3000/ssw/dacli.git。

- 工作树为 ssw main dacli subpath 最新版 (110 commit, 08-12)
- 历史未带 ssw main 整体历史(避免大仓污染)
- 此为新仓基线 commit,未来以本仓历史为主
2026-08-12 15:58:06 +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"