Files
llm-intelligence/scripts/review/backlog_current_freshness_guard_test.sh
2026-05-29 18:48:48 +08:00

37 lines
1.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$ROOT_DIR"
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT
STALE_FILE="$TMP_DIR/stale-backlog.md"
cat > "$STALE_FILE" <<'EOF'
## 当前未修复问题速查表(截至 2026-05-01 09:30
| # | 问题 | 优先级 | 首次暴露 | 修复状态 | 影响次数 |
|---|------|--------|----------|----------|----------|
| 25 | stale current truth | P2 | 05-16 09:30 | ❌ 未修复 | 2 次 |
---
EOF
set +e
LLM_NOW='2026-05-29 12:00' bash scripts/review/backlog_current_freshness_guard.sh "$STALE_FILE" >/tmp/backlog_freshness_bad.out 2>&1
STALE_RC=$?
set -e
[[ "$STALE_RC" -ne 0 ]]
grep -q 'stale current truth snapshot' /tmp/backlog_freshness_bad.out
FRESH_FILE="$TMP_DIR/fresh-backlog.md"
cat > "$FRESH_FILE" <<'EOF'
## 当前未修复问题速查表(截至 2026-05-29 11:55
| # | 问题 | 优先级 | 首次暴露 | 修复状态 | 影响次数 |
|---|------|--------|----------|----------|----------|
| 25 | stale current truth | P2 | 05-16 09:30 | ❌ 未修复 | 2 次 |
---
EOF
LLM_NOW='2026-05-29 12:00' bash scripts/review/backlog_current_freshness_guard.sh "$FRESH_FILE" >/tmp/backlog_freshness_good.out 2>&1
grep -q 'BACKLOG_FRESHNESS age_minutes=5 status=fresh' /tmp/backlog_freshness_good.out