bigpowers 2.66.0 → 2.67.1

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.
Files changed (48) hide show
  1. package/.fix_regex.sh +16 -0
  2. package/.hermes-verify-sed-fix.py +53 -0
  3. package/.pi/package.json +2 -2
  4. package/.pi/prompts/build-epic.md +8 -0
  5. package/.pi/prompts/gate-trace.md +2 -1
  6. package/.pi/prompts/kickoff-branch.md +19 -0
  7. package/.pi/prompts/maintain-wiki.md +63 -0
  8. package/.pi/prompts/plan-tests.md +1 -1
  9. package/.pi/prompts/release-branch.md +17 -13
  10. package/.pi/prompts/verify-work.md +9 -5
  11. package/.pi/skills/build-epic/SKILL.md +8 -0
  12. package/.pi/skills/gate-trace/SKILL.md +2 -1
  13. package/.pi/skills/kickoff-branch/SKILL.md +19 -0
  14. package/.pi/skills/maintain-wiki/SKILL.md +65 -0
  15. package/.pi/skills/plan-tests/SKILL.md +1 -1
  16. package/.pi/skills/release-branch/SKILL.md +17 -13
  17. package/.pi/skills/verify-work/SKILL.md +9 -5
  18. package/CHANGELOG.md +20 -0
  19. package/README.md +1 -1
  20. package/SKILL-INDEX.md +1 -1
  21. package/_test_e28s01.sh +2 -0
  22. package/hermes-verify-sed-fix.py +30 -0
  23. package/package.json +1 -1
  24. package/scripts/build-skill-graph.sh +151 -183
  25. package/scripts/check-spec-drift.sh +121 -0
  26. package/scripts/check-spec-version-gap.sh +143 -0
  27. package/scripts/decompose-conventions.sh +147 -0
  28. package/scripts/generate-agent-guide.sh +89 -0
  29. package/scripts/hermes-verify-e39s02.sh +28 -0
  30. package/scripts/lib/python-env.sh +44 -0
  31. package/scripts/migrate-version.sh +721 -0
  32. package/scripts/okf-post-sync.sh +163 -0
  33. package/scripts/validate-okf.sh +18 -0
  34. package/skills/build-epic/SKILL.md +8 -0
  35. package/skills/gate-trace/SKILL.md +2 -1
  36. package/skills/kickoff-branch/SKILL.md +19 -0
  37. package/skills/maintain-wiki/SKILL.md +66 -0
  38. package/skills/plan-tests/SKILL.md +1 -1
  39. package/skills/release-branch/SKILL.md +17 -13
  40. package/skills/verify-work/SKILL.md +9 -5
  41. package/skills-lock.json +11 -6
  42. package/tests/fixtures/v1.x-project/CLAUDE.md +4 -0
  43. package/tests/fixtures/v1.x-project/CONVENTIONS.md +4 -0
  44. package/tests/fixtures/v2.0.0-project/CLAUDE.md +4 -0
  45. package/tests/fixtures/v2.0.0-project/CONVENTIONS.md +3 -0
  46. package/tests/fixtures/v2.20-project/CLAUDE.md +4 -0
  47. package/tests/fixtures/v2.20-project/CONVENTIONS.md +4 -0
  48. package/tests/run-golden-migrate-version.sh +155 -0
@@ -0,0 +1,155 @@
1
+ #!/usr/bin/env bash
2
+ # story: e44s06
3
+ # G-06: migrate-version golden tests — detection + stamp + YAML validity
4
+ set -euo pipefail
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
8
+ FIXTURES="$SCRIPT_DIR/fixtures"
9
+ CHECK_GAP="$REPO_ROOT/scripts/check-spec-version-gap.sh"
10
+ VALIDATE_YAML="$REPO_ROOT/scripts/validate-specs-yaml.sh"
11
+
12
+ GREEN='\033[0;32m'; RED='\033[0;31m'; CYAN='\033[0;36m'; NC='\033[0m'
13
+ PASS=0; FAIL=0
14
+
15
+ pass() { echo -e " ${GREEN}PASS${NC} $1"; PASS=$((PASS+1)); }
16
+ fail() { echo -e " ${RED}FAIL${NC} $1"; FAIL=$((FAIL+1)); }
17
+
18
+ echo -e "${CYAN}═══ G-06: migrate-version Golden Tests ═══${NC}"
19
+
20
+ # ── Test 1: v1.x detection ──────────────────────────────────────────────
21
+ echo ""
22
+ echo -e "${CYAN}── G-06: v1.x detection ──${NC}"
23
+ tmp1="$(mktemp -d)"
24
+ cp -r "$FIXTURES/v1.x-project/"* "$tmp1/"
25
+ cd "$tmp1"
26
+ git init --quiet && git config user.email "test@b.dev" && git config user.name "T" && git add -A && git commit -m "i" --quiet
27
+
28
+ bash "$CHECK_GAP" --skip-block --json 2>&1 || true
29
+ echo ""
30
+
31
+ # Verify STATE.md exists, state.yaml does not
32
+ if [ -f "$tmp1/specs/STATE.md" ] && [ ! -f "$tmp1/specs/state.yaml" ]; then
33
+ pass "v1.x: Markdown-era detected (STATE.md present, state.yaml absent)"
34
+ else
35
+ fail "v1.x: expected Markdown-era signal"
36
+ fi
37
+ rm -rf "$tmp1"
38
+
39
+ # ── Test 2: v2.0.0 detection ────────────────────────────────────────────
40
+ echo ""
41
+ echo -e "${CYAN}── G-06: v2.0.0 detection ──${NC}"
42
+ tmp2="$(mktemp -d)"
43
+ cp -r "$FIXTURES/v2.0.0-project/"* "$tmp2/"
44
+ cd "$tmp2"
45
+ git init --quiet && git config user.email "test@b.dev" && git config user.name "T" && git add -A && git commit -m "i" --quiet
46
+
47
+ bash "$CHECK_GAP" --skip-block --json 2>&1 || true
48
+ echo ""
49
+
50
+ # Verify state.yaml exists but no bigpowers_version stamp
51
+ if [ -f "$tmp2/specs/state.yaml" ]; then
52
+ stamped="$(python3 -c "import yaml; d=yaml.safe_load(open('$tmp2/specs/state.yaml')); print(d.get('bigpowers_version','MISSING'))" 2>/dev/null)" || stamped="ERR"
53
+ if [ "$stamped" = "MISSING" ]; then
54
+ pass "v2.0.0: YAML cockpit without bigpowers_version stamp"
55
+ else
56
+ fail "v2.0.0: expected no stamp, got '$stamped'"
57
+ fi
58
+ else
59
+ fail "v2.0.0: state.yaml missing"
60
+ fi
61
+ rm -rf "$tmp2"
62
+
63
+ # ── Test 3: v2.20 detection ─────────────────────────────────────────────
64
+ echo ""
65
+ echo -e "${CYAN}── G-06: v2.20 detection ──${NC}"
66
+ tmp3="$(mktemp -d)"
67
+ cp -r "$FIXTURES/v2.20-project/"* "$tmp3/"
68
+ cd "$tmp3"
69
+ git init --quiet && git config user.email "test@b.dev" && git config user.name "T" && git add -A && git commit -m "i" --quiet
70
+
71
+ bash "$CHECK_GAP" --skip-block --json 2>&1 || true
72
+ echo ""
73
+
74
+ if [ -f "$tmp3/specs/state.yaml" ]; then
75
+ has_capsule="$(python3 -c "import yaml; d=yaml.safe_load(open('$tmp3/specs/state.yaml')); print('yes' if d.get('epic_cycle') else 'no')" 2>/dev/null)" || has_capsule="ERR"
76
+ stamped="$(python3 -c "import yaml; d=yaml.safe_load(open('$tmp3/specs/state.yaml')); print(d.get('bigpowers_version','MISSING'))" 2>/dev/null)" || stamped="ERR"
77
+ if [ "$has_capsule" = "yes" ] && [ "$stamped" = "MISSING" ]; then
78
+ pass "v2.20: capsule era with epic_cycle, no stamp"
79
+ elif [ "$has_capsule" != "yes" ]; then
80
+ fail "v2.20: expected epic_cycle, got '$has_capsule'"
81
+ else
82
+ fail "v2.20: expected no stamp, got '$stamped'"
83
+ fi
84
+ else
85
+ fail "v2.20: state.yaml missing"
86
+ fi
87
+ rm -rf "$tmp3"
88
+
89
+ # ── Test 4: stamp-only migration (v2.20, no migrations needed) ──────────
90
+ echo ""
91
+ echo -e "${CYAN}── G-06: stamp-only migration ──${NC}"
92
+ tmp4="$(mktemp -d)"
93
+ cp -r "$FIXTURES/v2.20-project/"* "$tmp4/"
94
+ cd "$tmp4"
95
+ git init --quiet && git config user.email "test@b.dev" && git config user.name "T" && git add -A && git commit -m "i" --quiet
96
+
97
+ bash "$REPO_ROOT/scripts/migrate-version.sh" --project "$tmp4" --force --no-commit 2>&1 | tail -3 || true
98
+
99
+ if [ -f "$tmp4/specs/state.yaml" ]; then
100
+ stamped="$(python3 -c "import yaml; d=yaml.safe_load(open('$tmp4/specs/state.yaml')); print(d.get('bigpowers_version','MISSING'))" 2>/dev/null)" || stamped="ERR"
101
+ installed="$(node -e "console.log(require('$REPO_ROOT/package.json').version)" 2>/dev/null)"
102
+ if [ "$stamped" = "$installed" ]; then
103
+ pass "v2.20: stamp-only migration produced bigpowers_version=$stamped"
104
+ else
105
+ fail "v2.20: stamp check — expected $installed, got $stamped"
106
+ fi
107
+ else
108
+ fail "v2.20: state.yaml missing after migration"
109
+ fi
110
+
111
+ # Validate YAML
112
+ if bash "$VALIDATE_YAML" "$tmp4/specs" 2>&1 | grep -qv 'PARSE ERROR'; then
113
+ pass "v2.20: validate-specs-yaml"
114
+ else
115
+ fail "v2.20: validate-specs-yaml had parse errors"
116
+ fi
117
+ rm -rf "$tmp4"
118
+
119
+ # ── Test 5: v2.0.0 migration roundtrip ──────────────────────────────────
120
+ echo ""
121
+ echo -e "${CYAN}── G-06: v2.0.0 migration roundtrip ──${NC}"
122
+ tmp5="$(mktemp -d)"
123
+ cp -r "$FIXTURES/v2.0.0-project/"* "$tmp5/"
124
+ cd "$tmp5"
125
+ git init --quiet && git config user.email "test@b.dev" && git config user.name "T" && git add -A && git commit -m "i" --quiet
126
+
127
+ bash "$REPO_ROOT/scripts/migrate-version.sh" --project "$tmp5" --force --no-commit 2>&1 | tail -5 || true
128
+
129
+ if [ -f "$tmp5/specs/state.yaml" ]; then
130
+ installed="$(node -e "console.log(require('$REPO_ROOT/package.json').version)" 2>/dev/null)"
131
+ stamped="$(python3 -c "import yaml; d=yaml.safe_load(open('$tmp5/specs/state.yaml')); print(d.get('bigpowers_version','MISSING'))" 2>/dev/null)" || stamped="ERR"
132
+ if [ "$stamped" = "$installed" ]; then
133
+ pass "v2.0.0: stamp = $stamped after migration"
134
+ else
135
+ fail "v2.0.0: stamp check — expected $installed, got $stamped"
136
+ fi
137
+ else
138
+ fail "v2.0.0: state.yaml missing after migration"
139
+ fi
140
+
141
+ if python3 -c "import yaml; yaml.safe_load(open('$tmp5/specs/state.yaml')); print('OK')" 2>/dev/null | grep -q OK; then
142
+ pass "v2.0.0: state.yaml is valid YAML after migration"
143
+ else
144
+ fail "v2.0.0: state.yaml parse error after migration"
145
+ fi
146
+ rm -rf "$tmp5"
147
+
148
+ echo ""
149
+ echo -e "${CYAN}────────────────────────────────────${NC}"
150
+ echo -e "G-06 Results: ${GREEN}${PASS} passed${NC}, ${RED}${FAIL} failed${NC}"
151
+ if [ $FAIL -gt 0 ]; then
152
+ exit 1
153
+ fi
154
+ echo -e "${GREEN}G-06: OK${NC}"
155
+ exit 0