bigpowers 2.75.1 → 2.76.0

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 (37) hide show
  1. package/.pi/package.json +1 -1
  2. package/CHANGELOG.md +20 -0
  3. package/bin/bigspec +35 -1
  4. package/kernel/src/publish-to-wiki.sh +131 -6
  5. package/package.json +1 -1
  6. package/scripts/audit-compliance.sh +2 -3
  7. package/scripts/build-receipts.sh +2 -2
  8. package/scripts/build-skill-graph.sh +1 -1
  9. package/scripts/check-spec-drift.sh +2 -2
  10. package/scripts/check-spec-version-gap.sh +13 -13
  11. package/scripts/compile-rule-matrix.sh +2 -2
  12. package/scripts/decompose-conventions.sh +2 -2
  13. package/scripts/generate-adr-wiki.sh +3 -2
  14. package/scripts/generate-agent-guide.sh +2 -2
  15. package/scripts/generate-epics-wiki.sh +3 -2
  16. package/scripts/hooks/token-mgmt-pre-tool-use.sh +5 -5
  17. package/scripts/land-branch.sh +11 -11
  18. package/scripts/lib/audit-compliance-report.sh +1 -0
  19. package/scripts/lib/emit-okf-metrics.sh +1 -0
  20. package/scripts/lib/golden-suite-report.sh +1 -0
  21. package/scripts/lib/golden-suite-run.sh +5 -1
  22. package/scripts/lib/migrate-version-transforms.sh +3 -4
  23. package/scripts/lib/record-cycle-time-lib.sh +31 -0
  24. package/scripts/lib/sync-post.sh +6 -1
  25. package/scripts/lib/test-assertions.sh +11 -0
  26. package/scripts/lib/validate-okf-kinds.sh +7 -4
  27. package/scripts/record-cycle-time.sh +4 -28
  28. package/scripts/sync-bugs-registry.sh +1 -0
  29. package/scripts/sync-skills.sh +3 -3
  30. package/scripts/test-adapters.sh +13 -13
  31. package/scripts/test-trace-matrix-size.sh +4 -4
  32. package/scripts/test-trace-strict.sh +8 -8
  33. package/scripts/validate-doctrine.sh +18 -18
  34. package/scripts/validate-skill-catalog.sh +10 -10
  35. package/scripts/verify-install.sh +39 -37
  36. package/tests/test-epic-status-drift.sh +53 -0
  37. package/tests/test-okf-generators.sh +57 -0
@@ -52,83 +52,85 @@ fi
52
52
  PASS=0
53
53
  FAIL=0
54
54
  TMPDIR=""
55
+ TA_PASS=0
56
+ TA_FAIL=0
57
+ TA_TMPDIR=""
55
58
 
56
- cleanup() { [[ -n "$TMPDIR" && -d "$TMPDIR" ]] && rm -rf "$TMPDIR"; }
57
- trap cleanup EXIT
59
+ source "$(dirname "${BASH_SOURCE[0]}")/lib/test-assertions.sh"
60
+ trap ta_cleanup EXIT
58
61
 
59
- pass() { echo " PASS $1"; PASS=$((PASS + 1)); }
60
- fail() { echo " FAIL $1"; FAIL=$((FAIL + 1)); }
61
62
 
62
63
  echo "=== install.sh --dry-run ==="
63
64
  DRY_OUT="$("$REPO_ROOT/scripts/install.sh" --dry-run 2>&1)"
64
65
 
65
- echo "$DRY_OUT" | grep -q 'pi →' && pass "install --dry-run includes pi" || fail "install --dry-run missing pi"
66
+ echo "$DRY_OUT" | grep -q 'pi →' && ta_pass "install --dry-run includes pi" || ta_fail "install --dry-run missing pi"
66
67
  DRY_UNINSTALL="$("$REPO_ROOT/scripts/install.sh" --dry-run --uninstall 2>&1)"
67
- echo "$DRY_UNINSTALL" | grep -q 'pi →' && pass "uninstall --dry-run includes pi" || fail "uninstall --dry-run missing pi"
68
- echo "$DRY_OUT" | grep -qi 'opencode' && fail "install references opencode" || pass "install has no opencode reference"
69
- echo "$DRY_OUT" | grep -q 'Claude Code →' && pass "install includes Claude Code" || fail "install missing Claude Code"
70
- echo "$DRY_OUT" | grep -q 'Gemini CLI →' && pass "install includes Gemini CLI" || fail "install missing Gemini CLI"
71
- echo "$DRY_OUT" | grep -q 'Cursor →' && pass "install includes Cursor" || fail "install missing Cursor"
68
+ echo "$DRY_UNINSTALL" | grep -q 'pi →' && ta_pass "uninstall --dry-run includes pi" || ta_fail "uninstall --dry-run missing pi"
69
+ echo "$DRY_OUT" | grep -qi 'opencode' && ta_fail "install references opencode" || ta_pass "install has no opencode reference"
70
+ echo "$DRY_OUT" | grep -q 'Claude Code →' && ta_pass "install includes Claude Code" || ta_fail "install missing Claude Code"
71
+ echo "$DRY_OUT" | grep -q 'Gemini CLI →' && ta_pass "install includes Gemini CLI" || ta_fail "install missing Gemini CLI"
72
+ echo "$DRY_OUT" | grep -q 'Cursor →' && ta_pass "install includes Cursor" || ta_fail "install missing Cursor"
72
73
 
73
74
  for tool in "Claude Code" "pi"; do
74
75
  section=$(echo "$DRY_OUT" | sed -n "/${tool} →/,/^$/p")
75
76
  count=$(echo "$section" | grep -o '[0-9]\+ skills installed' | grep -o '[0-9]\+' || echo "0")
76
- [[ "$count" -gt 0 ]] && pass "${tool}: $count skills" || fail "${tool}: 0 skills"
77
+ [[ "$count" -gt 0 ]] && ta_pass "${tool}: $count skills" || ta_fail "${tool}: 0 skills"
77
78
  done
78
79
 
79
80
  echo ""
80
81
  echo "=== AGENTS.md spine (e37s04) ==="
81
- [[ -f "$REPO_ROOT/docs/templates/AGENTS.md" ]] && pass "Reach template exists" || fail "Reach template missing"
82
- grep -q 'Preflight' "$REPO_ROOT/docs/templates/AGENTS.md" && pass "template: Preflight" || fail "template: missing Preflight"
83
- grep -qi 'cline\|aider\|opencode' "$REPO_ROOT/docs/templates/AGENTS.md" && pass "template: multi-agent preamble" || fail "template: missing OSS targets"
84
- grep -q '## Test' "$REPO_ROOT/docs/templates/AGENTS.md" && pass "template: Test section" || fail "template: missing Test"
85
- grep -q '## Lint' "$REPO_ROOT/docs/templates/AGENTS.md" && pass "template: Lint section" || fail "template: missing Lint"
86
- grep -q '## Build' "$REPO_ROOT/docs/templates/AGENTS.md" && pass "template: Build section" || fail "template: missing Build"
82
+ [[ -f "$REPO_ROOT/docs/templates/AGENTS.md" ]] && ta_pass "Reach template exists" || ta_fail "Reach template missing"
83
+ grep -q 'Preflight' "$REPO_ROOT/docs/templates/AGENTS.md" && ta_pass "template: Preflight" || ta_fail "template: missing Preflight"
84
+ grep -qi 'cline\|aider\|opencode' "$REPO_ROOT/docs/templates/AGENTS.md" && ta_pass "template: multi-agent preamble" || ta_fail "template: missing OSS targets"
85
+ grep -q '## Test' "$REPO_ROOT/docs/templates/AGENTS.md" && ta_pass "template: Test section" || ta_fail "template: missing Test"
86
+ grep -q '## Lint' "$REPO_ROOT/docs/templates/AGENTS.md" && ta_pass "template: Lint section" || ta_fail "template: missing Lint"
87
+ grep -q '## Build' "$REPO_ROOT/docs/templates/AGENTS.md" && ta_pass "template: Build section" || ta_fail "template: missing Build"
87
88
 
88
89
  echo ""
89
90
  echo "=== Cline native AGENTS.md (e37s02) ==="
90
- [[ -f "$REPO_ROOT/AGENTS.md" || -f "$REPO_ROOT/docs/templates/AGENTS.md" ]] && pass "Cline: AGENTS.md present (native reader)" || fail "Cline: AGENTS.md missing"
91
- grep -qi 'cline' "$REPO_ROOT/skills/using-bigpowers/SKILL.md" && pass "using-bigpowers: Cline section" || fail "using-bigpowers: missing Cline"
91
+ [[ -f "$REPO_ROOT/AGENTS.md" || -f "$REPO_ROOT/docs/templates/AGENTS.md" ]] && ta_pass "Cline: AGENTS.md present (native reader)" || ta_fail "Cline: AGENTS.md missing"
92
+ grep -qi 'cline' "$REPO_ROOT/skills/using-bigpowers/SKILL.md" && ta_pass "using-bigpowers: Cline section" || ta_fail "using-bigpowers: missing Cline"
92
93
 
93
94
  echo ""
94
95
  echo "=== Aider bridge (e37s03) ==="
95
- grep -qi 'aider' "$REPO_ROOT/skills/seed-conventions/SKILL.md" && pass "seed-conventions: Aider wiring" || fail "seed-conventions: missing Aider"
96
- grep -qi 'Aider-AI' "$REPO_ROOT/skills/using-bigpowers/SKILL.md" && pass "using-bigpowers: Aider-AI upstream" || fail "using-bigpowers: missing Aider-AI"
96
+ grep -qi 'aider' "$REPO_ROOT/skills/seed-conventions/SKILL.md" && ta_pass "seed-conventions: Aider wiring" || ta_fail "seed-conventions: missing Aider"
97
+ grep -qi 'Aider-AI' "$REPO_ROOT/skills/using-bigpowers/SKILL.md" && ta_pass "using-bigpowers: Aider-AI upstream" || ta_fail "using-bigpowers: missing Aider-AI"
97
98
 
98
99
  echo ""
99
100
  echo "=== Optional Codex wave (e37s04) ==="
100
101
  if grep -qi 'codex' "$REPO_ROOT/skills/seed-conventions/SKILL.md" 2>/dev/null; then
101
- grep -qi 'config.toml' "$REPO_ROOT/skills/seed-conventions/REFERENCE.md" && pass "Codex: REFERENCE config.toml" || fail "Codex: missing config.toml"
102
- echo "$DRY_OUT" | grep -qi 'codex' && pass "Codex: install --dry-run mentions codex" || fail "Codex: install missing codex"
102
+ grep -qi 'config.toml' "$REPO_ROOT/skills/seed-conventions/REFERENCE.md" && ta_pass "Codex: REFERENCE config.toml" || ta_fail "Codex: missing config.toml"
103
+ echo "$DRY_OUT" | grep -qi 'codex' && ta_pass "Codex: install --dry-run mentions codex" || ta_fail "Codex: install missing codex"
103
104
  else
104
- pass "Codex: wave absent — assertions skipped"
105
+ ta_pass "Codex: wave absent — assertions skipped"
105
106
  fi
106
107
 
107
108
  echo ""
108
109
  echo "=== seed-conventions local wiring ==="
109
- grep -qi 'local tool wiring' "$REPO_ROOT/skills/seed-conventions/SKILL.md" && pass "SKILL.md: local tool wiring" || fail "SKILL.md: missing local tool wiring"
110
- grep -qi 'opencode.json' "$REPO_ROOT/skills/seed-conventions/REFERENCE.md" && pass "REFERENCE.md: opencode.json" || fail "REFERENCE.md: missing opencode.json"
111
- grep -qi 'AGENTS.md' "$REPO_ROOT/skills/seed-conventions/SKILL.md" && pass "SKILL.md: AGENTS.md spine" || fail "SKILL.md: missing AGENTS.md"
112
- grep -qi 'symlink' "$REPO_ROOT/skills/seed-conventions/SKILL.md" && pass "SKILL.md: CLAUDE.md symlink" || fail "SKILL.md: missing symlink"
113
- grep -qi 'cursor/rules' "$REPO_ROOT/skills/seed-conventions/REFERENCE.md" && pass "REFERENCE.md: Cursor symlink" || fail "REFERENCE.md: missing Cursor symlink"
110
+ grep -qi 'local tool wiring' "$REPO_ROOT/skills/seed-conventions/SKILL.md" && ta_pass "SKILL.md: local tool wiring" || ta_fail "SKILL.md: missing local tool wiring"
111
+ grep -qi 'opencode.json' "$REPO_ROOT/skills/seed-conventions/REFERENCE.md" && ta_pass "REFERENCE.md: opencode.json" || ta_fail "REFERENCE.md: missing opencode.json"
112
+ grep -qi 'AGENTS.md' "$REPO_ROOT/skills/seed-conventions/SKILL.md" && ta_pass "SKILL.md: AGENTS.md spine" || ta_fail "SKILL.md: missing AGENTS.md"
113
+ grep -qi 'symlink' "$REPO_ROOT/skills/seed-conventions/SKILL.md" && ta_pass "SKILL.md: CLAUDE.md symlink" || ta_fail "SKILL.md: missing symlink"
114
+ grep -qi 'cursor/rules' "$REPO_ROOT/skills/seed-conventions/REFERENCE.md" && ta_pass "REFERENCE.md: Cursor symlink" || ta_fail "REFERENCE.md: missing Cursor symlink"
114
115
 
115
116
  OPENCODE_JSON=$(sed -n '/```json/,/```/p' "$REPO_ROOT/skills/seed-conventions/REFERENCE.md" | grep -v '```' || true)
116
117
  if [[ -n "$OPENCODE_JSON" ]]; then
117
118
  TMPDIR=$(mktemp -d)
119
+ TA_TMPDIR="$TMPDIR"
118
120
  echo "$OPENCODE_JSON" > "$TMPDIR/test-opencode.json"
119
- jq empty "$TMPDIR/test-opencode.json" 2>/dev/null && pass "opencode.json valid JSON" || fail "opencode.json NOT valid JSON"
121
+ jq empty "$TMPDIR/test-opencode.json" 2>/dev/null && ta_pass "opencode.json valid JSON" || ta_fail "opencode.json NOT valid JSON"
120
122
  else
121
- fail "opencode.json template not found"
123
+ ta_fail "opencode.json template not found"
122
124
  fi
123
125
 
124
126
  echo ""
125
127
  echo "=== install.sh source ==="
126
- grep -q 'install_pi()' "$REPO_ROOT/scripts/install.sh" && pass "source: install_pi()" || fail "source: missing install_pi()"
127
- grep -q 'uninstall_pi()' "$REPO_ROOT/scripts/install.sh" && pass "source: uninstall_pi()" || fail "source: missing uninstall_pi()"
128
- grep -q 'PI_SKILLS_DIR="$PI_CONFIG_DIR/agent/skills"' "$REPO_ROOT/scripts/install.sh" && pass "source: targets ~/.pi/agent/skills/" || fail "source: wrong pi target"
129
- ! grep -q 'install_opencode\|print_opencode_instructions' "$REPO_ROOT/scripts/install.sh" && pass "source: no opencode functions" || fail "source: opencode functions remain"
128
+ grep -q 'install_pi()' "$REPO_ROOT/scripts/install.sh" && ta_pass "source: install_pi()" || ta_fail "source: missing install_pi()"
129
+ grep -q 'uninstall_pi()' "$REPO_ROOT/scripts/install.sh" && ta_pass "source: uninstall_pi()" || ta_fail "source: missing uninstall_pi()"
130
+ grep -q 'PI_SKILLS_DIR="$PI_CONFIG_DIR/agent/skills"' "$REPO_ROOT/scripts/install.sh" && ta_pass "source: targets ~/.pi/agent/skills/" || ta_fail "source: wrong pi target"
131
+ ! grep -q 'install_opencode\|print_opencode_instructions' "$REPO_ROOT/scripts/install.sh" && ta_pass "source: no opencode functions" || ta_fail "source: opencode functions remain"
130
132
 
131
133
  echo ""
132
134
  echo "──────────────────────────────────────────"
133
- echo "verify-install: $PASS passed, $FAIL failed"
134
- [[ "$FAIL" -gt 0 ]] && { echo "Overall: fail"; exit 1; } || echo "Overall: pass"
135
+ echo "verify-install: $TA_PASS passed, $TA_FAIL failed"
136
+ [[ "$TA_FAIL" -gt 0 ]] && { echo "Overall: fail"; exit 1; } || echo "Overall: pass"
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env bash
2
+ # story: BUG-001
3
+ # Regression test: epic.yaml status matches execution-status.yaml for completed epics
4
+ set -euo pipefail
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
8
+ EXEC_STATUS="$REPO_ROOT/specs/execution-status.yaml"
9
+ EPICS_ROOT="$REPO_ROOT/specs/epics"
10
+
11
+ if [[ ! -f "$EXEC_STATUS" ]]; then
12
+ echo "FAIL: missing $EXEC_STATUS"
13
+ exit 1
14
+ fi
15
+
16
+ FAILURES=0
17
+
18
+ while IFS= read -r line; do
19
+ [[ "$line" =~ ^[[:space:]]*(e[0-9]+):[[:space:]]*done[[:space:]]*$ ]] || continue
20
+ epic_id="${BASH_REMATCH[1]}"
21
+
22
+ # e37 is redesigned as Reach — execution-status may say done while capsule stays planned
23
+ [[ "$epic_id" == "e37" ]] && continue
24
+
25
+ epic_yaml=""
26
+ for candidate in \
27
+ "$EPICS_ROOT/$epic_id"*/epic.yaml \
28
+ "$EPICS_ROOT/archive/$epic_id"*/epic.yaml; do
29
+ if [[ -f "$candidate" ]]; then
30
+ epic_yaml="$candidate"
31
+ break
32
+ fi
33
+ done
34
+
35
+ if [[ -z "$epic_yaml" ]]; then
36
+ echo "WARN: no epic.yaml found for $epic_id (execution-status: done)"
37
+ continue
38
+ fi
39
+
40
+ yaml_status="$(grep -m1 '^status:' "$epic_yaml" | sed 's/^status:[[:space:]]*//' | tr -d '"')"
41
+ if [[ "$yaml_status" != "done" ]]; then
42
+ echo "FAIL: $epic_id epic.yaml status='$yaml_status' but execution-status.yaml says done ($epic_yaml)"
43
+ FAILURES=$((FAILURES + 1))
44
+ fi
45
+ done < "$EXEC_STATUS"
46
+
47
+ if [[ "$FAILURES" -gt 0 ]]; then
48
+ echo "FAIL: $FAILURES epic status drift(s)"
49
+ exit 1
50
+ fi
51
+
52
+ echo "PASS: epic.yaml status aligned with execution-status for completed epics"
53
+ exit 0
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env bash
2
+ # story: e48s01
3
+ # story: e48s03
4
+ # Regression tests for OKF bundle generators (e48 audit gap closure)
5
+ set -euo pipefail
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
9
+
10
+ echo "=== OKF generator regression tests ==="
11
+
12
+ require_min_count() {
13
+ local dir="$1" min="$2" label="$3"
14
+ local count
15
+ count="$(find "$dir" -maxdepth 1 -name '*.okf.md' -type f 2>/dev/null | wc -l | tr -d ' ')"
16
+ if [[ "$count" -lt "$min" ]]; then
17
+ echo "FAIL: expected at least $min $label bundles in $dir, got $count"
18
+ exit 1
19
+ fi
20
+ echo " $label: $count bundles"
21
+ }
22
+
23
+ echo "→ generate-epics-wiki.sh"
24
+ bash "$REPO_ROOT/scripts/generate-epics-wiki.sh" >/dev/null
25
+ require_min_count "$REPO_ROOT/specs/epics-wiki" 1 "epic"
26
+ bash "$REPO_ROOT/scripts/validate-okf.sh" --dir "$REPO_ROOT/specs/epics-wiki"
27
+
28
+ if ! grep -q '^tier:' "$REPO_ROOT/specs/epics-wiki/e48.okf.md"; then
29
+ echo "FAIL: e48.okf.md missing tier: field (e48s06)"
30
+ exit 1
31
+ fi
32
+
33
+ echo "→ generate-adr-wiki.sh"
34
+ bash "$REPO_ROOT/scripts/generate-adr-wiki.sh" >/dev/null
35
+ require_min_count "$REPO_ROOT/specs/adr-wiki" 1 "adr"
36
+ bash "$REPO_ROOT/scripts/validate-okf.sh" --dir "$REPO_ROOT/specs/adr-wiki"
37
+
38
+ echo "→ sync-bugs-registry.sh"
39
+ bash "$REPO_ROOT/scripts/sync-bugs-registry.sh" >/dev/null
40
+ require_min_count "$REPO_ROOT/specs/bugs" 1 "bug"
41
+ bash "$REPO_ROOT/scripts/validate-okf.sh" --dir "$REPO_ROOT/specs/bugs"
42
+
43
+ echo "→ validate all CI OKF directories"
44
+ for dir in specs/metrics specs/migrations specs/verifications/reports; do
45
+ bash "$REPO_ROOT/scripts/validate-okf.sh" --dir "$REPO_ROOT/$dir"
46
+ done
47
+
48
+ echo "→ publish-to-wiki.sh --dry-run"
49
+ OUTPUT="$(bash "$REPO_ROOT/kernel/src/publish-to-wiki.sh" --dry-run)"
50
+ if [[ "$OUTPUT" != *"pages:"* ]]; then
51
+ echo "FAIL: publish-to-wiki dry-run missing page manifest"
52
+ echo "$OUTPUT"
53
+ exit 1
54
+ fi
55
+
56
+ echo "PASS: OKF generators and publish-to-wiki dry-run"
57
+ exit 0