bigpowers 2.86.6 → 2.86.7
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.
- package/.agents/skills/guard-git/SKILL.md +8 -8
- package/.agents/skills/kickoff-branch/SKILL.md +1 -1
- package/.agents/skills/migrate-spec/SKILL.md +52 -6
- package/.agents/skills/plan-work/SKILL.md +17 -5
- package/.agents/skills/publish-package/SKILL.md +15 -5
- package/.agents/skills/release-branch/SKILL.md +12 -8
- package/.agents/skills/seed-conventions/SKILL.md +20 -10
- package/.agents/skills/smoke-test/SKILL.md +9 -5
- package/.agents/skills/validate-contracts/SKILL.md +15 -6
- package/.agents/skills/wire-ci/SKILL.md +12 -5
- package/.agents/skills/write-document/SKILL.md +30 -4
- package/.cline/skills/guard-git/SKILL.md +8 -8
- package/.cline/skills/kickoff-branch/SKILL.md +1 -1
- package/.cline/skills/migrate-spec/SKILL.md +52 -6
- package/.cline/skills/plan-work/SKILL.md +17 -5
- package/.cline/skills/publish-package/SKILL.md +15 -5
- package/.cline/skills/release-branch/SKILL.md +12 -8
- package/.cline/skills/seed-conventions/SKILL.md +20 -10
- package/.cline/skills/smoke-test/SKILL.md +9 -5
- package/.cline/skills/validate-contracts/SKILL.md +15 -6
- package/.cline/skills/wire-ci/SKILL.md +12 -5
- package/.cline/skills/write-document/SKILL.md +30 -4
- package/.codebuddy/skills/guard-git/SKILL.md +8 -8
- package/.codebuddy/skills/kickoff-branch/SKILL.md +1 -1
- package/.codebuddy/skills/migrate-spec/SKILL.md +52 -6
- package/.codebuddy/skills/plan-work/SKILL.md +17 -5
- package/.codebuddy/skills/publish-package/SKILL.md +15 -5
- package/.codebuddy/skills/release-branch/SKILL.md +12 -8
- package/.codebuddy/skills/seed-conventions/SKILL.md +20 -10
- package/.codebuddy/skills/smoke-test/SKILL.md +9 -5
- package/.codebuddy/skills/validate-contracts/SKILL.md +15 -6
- package/.codebuddy/skills/wire-ci/SKILL.md +12 -5
- package/.codebuddy/skills/write-document/SKILL.md +30 -4
- package/.codex/skills/guard-git/SKILL.md +8 -8
- package/.codex/skills/kickoff-branch/SKILL.md +1 -1
- package/.codex/skills/migrate-spec/SKILL.md +52 -6
- package/.codex/skills/plan-work/SKILL.md +17 -5
- package/.codex/skills/publish-package/SKILL.md +15 -5
- package/.codex/skills/release-branch/SKILL.md +12 -8
- package/.codex/skills/seed-conventions/SKILL.md +20 -10
- package/.codex/skills/smoke-test/SKILL.md +9 -5
- package/.codex/skills/validate-contracts/SKILL.md +15 -6
- package/.codex/skills/wire-ci/SKILL.md +12 -5
- package/.codex/skills/write-document/SKILL.md +30 -4
- package/.copilot/skills/guard-git/SKILL.md +8 -8
- package/.copilot/skills/kickoff-branch/SKILL.md +1 -1
- package/.copilot/skills/migrate-spec/SKILL.md +52 -6
- package/.copilot/skills/plan-work/SKILL.md +17 -5
- package/.copilot/skills/publish-package/SKILL.md +15 -5
- package/.copilot/skills/release-branch/SKILL.md +12 -8
- package/.copilot/skills/seed-conventions/SKILL.md +20 -10
- package/.copilot/skills/smoke-test/SKILL.md +9 -5
- package/.copilot/skills/validate-contracts/SKILL.md +15 -6
- package/.copilot/skills/wire-ci/SKILL.md +12 -5
- package/.copilot/skills/write-document/SKILL.md +30 -4
- package/.hermes/skills/guard-git/SKILL.md +8 -8
- package/.hermes/skills/kickoff-branch/SKILL.md +1 -1
- package/.hermes/skills/migrate-spec/SKILL.md +52 -6
- package/.hermes/skills/plan-work/SKILL.md +17 -5
- package/.hermes/skills/publish-package/SKILL.md +15 -5
- package/.hermes/skills/release-branch/SKILL.md +12 -8
- package/.hermes/skills/seed-conventions/SKILL.md +20 -10
- package/.hermes/skills/smoke-test/SKILL.md +9 -5
- package/.hermes/skills/validate-contracts/SKILL.md +15 -6
- package/.hermes/skills/wire-ci/SKILL.md +12 -5
- package/.hermes/skills/write-document/SKILL.md +30 -4
- package/.kilocode/rules/guard-git.md +8 -8
- package/.kilocode/rules/kickoff-branch.md +1 -1
- package/.kilocode/rules/migrate-spec.md +52 -6
- package/.kilocode/rules/plan-work.md +17 -5
- package/.kilocode/rules/publish-package.md +15 -5
- package/.kilocode/rules/release-branch.md +12 -8
- package/.kilocode/rules/seed-conventions.md +20 -10
- package/.kilocode/rules/smoke-test.md +9 -5
- package/.kilocode/rules/validate-contracts.md +15 -6
- package/.kilocode/rules/wire-ci.md +12 -5
- package/.kilocode/rules/write-document.md +30 -4
- package/.mimocode/skills/guard-git/SKILL.md +8 -8
- package/.mimocode/skills/kickoff-branch/SKILL.md +1 -1
- package/.mimocode/skills/migrate-spec/SKILL.md +52 -6
- package/.mimocode/skills/plan-work/SKILL.md +17 -5
- package/.mimocode/skills/publish-package/SKILL.md +15 -5
- package/.mimocode/skills/release-branch/SKILL.md +12 -8
- package/.mimocode/skills/seed-conventions/SKILL.md +20 -10
- package/.mimocode/skills/smoke-test/SKILL.md +9 -5
- package/.mimocode/skills/validate-contracts/SKILL.md +15 -6
- package/.mimocode/skills/wire-ci/SKILL.md +12 -5
- package/.mimocode/skills/write-document/SKILL.md +30 -4
- package/.opencode/skills/guard-git/SKILL.md +8 -8
- package/.opencode/skills/kickoff-branch/SKILL.md +1 -1
- package/.opencode/skills/migrate-spec/SKILL.md +52 -6
- package/.opencode/skills/plan-work/SKILL.md +17 -5
- package/.opencode/skills/publish-package/SKILL.md +15 -5
- package/.opencode/skills/release-branch/SKILL.md +12 -8
- package/.opencode/skills/seed-conventions/SKILL.md +20 -10
- package/.opencode/skills/smoke-test/SKILL.md +9 -5
- package/.opencode/skills/validate-contracts/SKILL.md +15 -6
- package/.opencode/skills/wire-ci/SKILL.md +12 -5
- package/.opencode/skills/write-document/SKILL.md +30 -4
- package/.pi/package.json +1 -1
- package/.pi/prompts/guard-git.md +8 -8
- package/.pi/prompts/kickoff-branch.md +1 -1
- package/.pi/prompts/migrate-spec.md +52 -6
- package/.pi/prompts/plan-work.md +17 -5
- package/.pi/prompts/publish-package.md +15 -5
- package/.pi/prompts/release-branch.md +12 -8
- package/.pi/prompts/seed-conventions.md +20 -10
- package/.pi/prompts/smoke-test.md +9 -5
- package/.pi/prompts/validate-contracts.md +15 -6
- package/.pi/prompts/wire-ci.md +12 -5
- package/.pi/prompts/write-document.md +30 -4
- package/.pi/skills/guard-git/SKILL.md +8 -8
- package/.pi/skills/kickoff-branch/SKILL.md +1 -1
- package/.pi/skills/migrate-spec/SKILL.md +52 -6
- package/.pi/skills/plan-work/SKILL.md +17 -5
- package/.pi/skills/publish-package/SKILL.md +15 -5
- package/.pi/skills/release-branch/SKILL.md +12 -8
- package/.pi/skills/seed-conventions/SKILL.md +20 -10
- package/.pi/skills/smoke-test/SKILL.md +9 -5
- package/.pi/skills/validate-contracts/SKILL.md +15 -6
- package/.pi/skills/wire-ci/SKILL.md +12 -5
- package/.pi/skills/write-document/SKILL.md +30 -4
- package/.qwen/skills/guard-git/SKILL.md +8 -8
- package/.qwen/skills/kickoff-branch/SKILL.md +1 -1
- package/.qwen/skills/migrate-spec/SKILL.md +52 -6
- package/.qwen/skills/plan-work/SKILL.md +17 -5
- package/.qwen/skills/publish-package/SKILL.md +15 -5
- package/.qwen/skills/release-branch/SKILL.md +12 -8
- package/.qwen/skills/seed-conventions/SKILL.md +20 -10
- package/.qwen/skills/smoke-test/SKILL.md +9 -5
- package/.qwen/skills/validate-contracts/SKILL.md +15 -6
- package/.qwen/skills/wire-ci/SKILL.md +12 -5
- package/.qwen/skills/write-document/SKILL.md +30 -4
- package/.trae/skills/guard-git/SKILL.md +8 -8
- package/.trae/skills/kickoff-branch/SKILL.md +1 -1
- package/.trae/skills/migrate-spec/SKILL.md +52 -6
- package/.trae/skills/plan-work/SKILL.md +17 -5
- package/.trae/skills/publish-package/SKILL.md +15 -5
- package/.trae/skills/release-branch/SKILL.md +12 -8
- package/.trae/skills/seed-conventions/SKILL.md +20 -10
- package/.trae/skills/smoke-test/SKILL.md +9 -5
- package/.trae/skills/validate-contracts/SKILL.md +15 -6
- package/.trae/skills/wire-ci/SKILL.md +12 -5
- package/.trae/skills/write-document/SKILL.md +30 -4
- package/.windsurf/rules/guard-git.md +8 -8
- package/.windsurf/rules/kickoff-branch.md +1 -1
- package/.windsurf/rules/migrate-spec.md +52 -6
- package/.windsurf/rules/plan-work.md +17 -5
- package/.windsurf/rules/publish-package.md +15 -5
- package/.windsurf/rules/release-branch.md +12 -8
- package/.windsurf/rules/seed-conventions.md +20 -10
- package/.windsurf/rules/smoke-test.md +9 -5
- package/.windsurf/rules/validate-contracts.md +15 -6
- package/.windsurf/rules/wire-ci.md +12 -5
- package/.windsurf/rules/write-document.md +30 -4
- package/.zcode/skills/guard-git/SKILL.md +8 -8
- package/.zcode/skills/kickoff-branch/SKILL.md +1 -1
- package/.zcode/skills/migrate-spec/SKILL.md +52 -6
- package/.zcode/skills/plan-work/SKILL.md +17 -5
- package/.zcode/skills/publish-package/SKILL.md +15 -5
- package/.zcode/skills/release-branch/SKILL.md +12 -8
- package/.zcode/skills/seed-conventions/SKILL.md +20 -10
- package/.zcode/skills/smoke-test/SKILL.md +9 -5
- package/.zcode/skills/validate-contracts/SKILL.md +15 -6
- package/.zcode/skills/wire-ci/SKILL.md +12 -5
- package/.zcode/skills/write-document/SKILL.md +30 -4
- package/CHANGELOG.md +7 -0
- package/CONVENTIONS.md +2 -0
- package/package.json +1 -1
- package/scripts/generate-context-bundle.sh +6 -0
- package/scripts/generate-reference-nav.sh +89 -0
- package/scripts/generate-viz-graph.sh +4 -0
- package/scripts/golden-g13-script-orphans.sh +167 -0
- package/scripts/golden-g15-compliance-runner-selftest.sh +126 -0
- package/scripts/golden-g16-spec-version-gap.sh +72 -0
- package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
- package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
- package/scripts/lib/audit-compliance-report.sh +32 -7
- package/scripts/lib/audit-compliance-runner.sh +14 -1
- package/scripts/lib/golden-suite-gates.sh +23 -7
- package/scripts/lib/test-assertions.sh +4 -0
- package/scripts/snapshot-catalog-baseline.sh +4 -0
- package/scripts/test-adapter-render.sh +19 -21
- package/scripts/test-completeness-critic-scope.sh +18 -19
- package/scripts/test-generate-epics-wiki-zero-stories.sh +12 -13
- package/scripts/test-golden-g11-worktree-venv.sh +16 -18
- package/scripts/test-install-distribute-only.sh +27 -26
- package/scripts/test-install-hub.sh +25 -23
- package/scripts/test-setup-no-pyyaml.sh +16 -17
- package/scripts/test-target-contracts.sh +15 -13
- package/scripts/test-tombstone-mechanism.sh +31 -33
- package/skills/guard-git/REFERENCE.md +8 -8
- package/skills/kickoff-branch/SKILL.md +1 -1
- package/skills/migrate-spec/REFERENCE.md +52 -6
- package/skills/plan-work/REFERENCE.md +17 -5
- package/skills/publish-package/REFERENCE.md +15 -5
- package/skills/release-branch/REFERENCE.md +12 -8
- package/skills/seed-conventions/REFERENCE.md +20 -10
- package/skills/smoke-test/REFERENCE.md +9 -5
- package/skills/validate-contracts/REFERENCE.md +15 -6
- package/skills/wire-ci/REFERENCE.md +12 -5
- package/skills/write-document/REFERENCE.md +30 -4
- package/skills-lock.json +1 -1
- package/scripts/add-model-frontmatter.sh +0 -32
- package/scripts/golden-g13-test-orphans.sh +0 -70
- package/scripts/install-cursor-skills-local.sh +0 -15
- package/scripts/install-cursor-skills.sh +0 -24
- package/scripts/project-survey.sh +0 -63
|
@@ -87,12 +87,21 @@ Part of **★ VERIFY ★**: `verify-work` → `validate-contracts` → `smoke-te
|
|
|
87
87
|
| Lines | Section |
|
|
88
88
|
|-------|---------|
|
|
89
89
|
| 1 | Title |
|
|
90
|
-
| 3–
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
90
|
+
| 3–23 | Navigation |
|
|
91
|
+
| 24–32 | Integration |
|
|
92
|
+
| 33–44 | Configuration |
|
|
93
|
+
| 45–54 | Verification |
|
|
94
|
+
| 55–71 | Reference block 1 |
|
|
95
|
+
| 72–92 | Reference block 2 |
|
|
96
|
+
| 93–104 | Example 1 |
|
|
97
|
+
| 105–121 | Example 2 |
|
|
98
|
+
| 122–133 | Example 3 |
|
|
99
|
+
| 134–144 | Example 4 |
|
|
100
|
+
| 145–165 | Example 5 |
|
|
101
|
+
| 166–176 | Example 6 |
|
|
102
|
+
| 177–185 | Integration |
|
|
103
|
+
| 186–197 | Configuration |
|
|
104
|
+
| 198–204 | Verification |
|
|
96
105
|
|
|
97
106
|
## Integration
|
|
98
107
|
|
|
@@ -118,11 +118,18 @@ See [REFERENCE.md](REFERENCE.md).
|
|
|
118
118
|
| Lines | Section |
|
|
119
119
|
|-------|---------|
|
|
120
120
|
| 1 | Title |
|
|
121
|
-
| 3–
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
121
|
+
| 3–20 | Navigation |
|
|
122
|
+
| 21–22 | Examples |
|
|
123
|
+
| 23–39 | Create CI for a Go project (TBR + optional deploy) |
|
|
124
|
+
| 40–49 | Create CI for a CLI tool (TBR only, no deploy) |
|
|
125
|
+
| 50–57 | Validate existing workflows (no generation) |
|
|
126
|
+
| 58–70 | Options |
|
|
127
|
+
| 71–79 | Integration with build-epic |
|
|
128
|
+
| 80–154 | Reference block 1 — test-build-release.yml (Go, excerpt) |
|
|
129
|
+
| 155–204 | Reference block 2 — deploy.yml (generic web app, excerpt) |
|
|
130
|
+
| 205–232 | Reference block 3 — CLI dogfood (big-release pattern) |
|
|
131
|
+
| 233–257 | Reference block 4 — validate script |
|
|
132
|
+
| 258–268 | Reference block 5 — dry-run |
|
|
126
133
|
|
|
127
134
|
## Examples
|
|
128
135
|
|
|
@@ -86,10 +86,36 @@ Combined from dbader/readme-template and jehna/readme-best-practices. No TOC.
|
|
|
86
86
|
| Lines | Section |
|
|
87
87
|
|-------|---------|
|
|
88
88
|
| 1 | Title |
|
|
89
|
-
| 5–
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
89
|
+
| 5–40 | Navigation |
|
|
90
|
+
| 41–42 | Sections |
|
|
91
|
+
| 43–54 | 1. Title + Badges |
|
|
92
|
+
| 55–60 | 2. Tagline |
|
|
93
|
+
| 61–64 | 3. Description |
|
|
94
|
+
| 65–67 | 4. Prerequisites |
|
|
95
|
+
| 68–75 | Prerequisites |
|
|
96
|
+
| 76–78 | 5. Installation |
|
|
97
|
+
| 79–89 | Installation |
|
|
98
|
+
| 90–92 | 6. Usage |
|
|
99
|
+
| 93–102 | Usage |
|
|
100
|
+
| 103–105 | 7. Features |
|
|
101
|
+
| 106–113 | Features |
|
|
102
|
+
| 114–116 | 8. Configuration |
|
|
103
|
+
| 117–125 | Configuration |
|
|
104
|
+
| 126–128 | 9. Development Setup |
|
|
105
|
+
| 129–139 | Development |
|
|
106
|
+
| 140–142 | 10. Running Tests |
|
|
107
|
+
| 143–152 | Tests |
|
|
108
|
+
| 153–155 | 11. Contributing |
|
|
109
|
+
| 156–164 | Contributing |
|
|
110
|
+
| 165–167 | 12. Changelog |
|
|
111
|
+
| 168–172 | Changelog |
|
|
112
|
+
| 173–175 | 13. Links |
|
|
113
|
+
| 176–181 | Links |
|
|
114
|
+
| 182–184 | 14. License |
|
|
115
|
+
| 185–191 | License |
|
|
116
|
+
| 192–194 | 15. Credits (optional) |
|
|
117
|
+
| 195–199 | Credits |
|
|
118
|
+
| 200–202 | Verify |
|
|
93
119
|
|
|
94
120
|
## Sections
|
|
95
121
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.86.7](https://github.com/danielvm-git/bigpowers/compare/v2.86.6...v2.86.7) (2026-07-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **verify:** close the compliance margin and orphan-script risk ([e95c86a](https://github.com/danielvm-git/bigpowers/commit/e95c86aeb5808642c4fb94d280b4fd4777c0d6db))
|
|
7
|
+
|
|
1
8
|
## [2.86.6](https://github.com/danielvm-git/bigpowers/compare/v2.86.5...v2.86.6) (2026-07-26)
|
|
2
9
|
|
|
3
10
|
|
package/CONVENTIONS.md
CHANGED
|
@@ -380,6 +380,8 @@ name must return < 5 results across the repo.
|
|
|
380
380
|
| `visual-dashboard` | adjective-noun | `view-dashboard` implies read-only; `show-dashboard` collides with `show` verbs |
|
|
381
381
|
| `deploy` | single verb | Well-known DevOps single-word concept; renames like `deploy-app` or `deploy-service` are redundant since deploy always targets an application |
|
|
382
382
|
| `grill-with-docs` | three-word verb-prep-noun | Variant of `grill-me`; the `-with-docs` suffix is the distinguishing feature — collapsing it would hide the doc-grounded contract |
|
|
383
|
+
| `context7-mcp` | noun-noun (product + protocol) | Names the external service and protocol it fronts; a verb-noun rename (`fetch-docs`) would collide with generic doc-fetch skills and hide which provider is used |
|
|
384
|
+
| `generate-allure-report` | three-word verb-noun-noun | `generate-report` is ambiguous across report types; `allure` names the specific output format consumers integrate with |
|
|
383
385
|
|
|
384
386
|
Any new exception requires an entry in this table before the skill is published.
|
|
385
387
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# story: e37s06
|
|
3
3
|
# scenario: SC-e37s06-P1-01
|
|
4
|
+
# bp-manual-utility: ADR-0007/tech-stack.md document this as the post-seed
|
|
5
|
+
# context-wiring step, but seed-conventions never invokes it — a real
|
|
6
|
+
# "documented, never executed" gap. Not fixed here: wiring it into
|
|
7
|
+
# seed-conventions changes that skill's actual output, which needs its own
|
|
8
|
+
# investigate-bug pass and verification, not a silent bundle into a
|
|
9
|
+
# compliance-margin PR. Run manually: bash scripts/generate-context-bundle.sh
|
|
4
10
|
set -euo pipefail
|
|
5
11
|
|
|
6
12
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: e45s02
|
|
3
|
+
# generate-reference-nav.sh — rebuild the "| Lines | Section |" nav table at the
|
|
4
|
+
# top of each skills/*/REFERENCE.md from the file's actual headings.
|
|
5
|
+
#
|
|
6
|
+
# These tables are a token-economy aid: they let an agent jump to a line range
|
|
7
|
+
# instead of reading the whole file. Hand-maintained, they drift the moment any
|
|
8
|
+
# section grows — at the time this was written, 4 of 10 cited a line number past
|
|
9
|
+
# end-of-file, so the index pointed past the document it indexed.
|
|
10
|
+
#
|
|
11
|
+
# Usage: bash scripts/generate-reference-nav.sh [--check]
|
|
12
|
+
# --check fail if any committed nav table is stale (for CI)
|
|
13
|
+
|
|
14
|
+
set -euo pipefail
|
|
15
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/python-env.sh"
|
|
16
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/skill-common.sh"
|
|
17
|
+
resolve_repo_root
|
|
18
|
+
cd "$REPO_ROOT"
|
|
19
|
+
|
|
20
|
+
MODE="${1:-write}"
|
|
21
|
+
|
|
22
|
+
$PYTHON - "$MODE" <<'PY'
|
|
23
|
+
import sys, glob, re
|
|
24
|
+
|
|
25
|
+
mode = sys.argv[1]
|
|
26
|
+
stale, rewritten = [], []
|
|
27
|
+
|
|
28
|
+
def rebuild(lines):
|
|
29
|
+
"""One pass: replace the nav table with ranges derived from the headings."""
|
|
30
|
+
hdr = next((i for i, l in enumerate(lines) if l.strip() == "| Lines | Section |"), None)
|
|
31
|
+
if hdr is None:
|
|
32
|
+
return None
|
|
33
|
+
end = hdr + 2
|
|
34
|
+
while end < len(lines) and lines[end].startswith("|"):
|
|
35
|
+
end += 1
|
|
36
|
+
|
|
37
|
+
# Section boundaries come from ## / ### headings; the title is line 1.
|
|
38
|
+
heads = [(i + 1, l) for i, l in enumerate(lines) if re.match(r"^#{2,3} ", l)]
|
|
39
|
+
# "## Navigation" is itself a heading — do not synthesize a second row for it.
|
|
40
|
+
rows = ["| Lines | Section |", "|-------|---------|", "| 1 | Title |"]
|
|
41
|
+
# split("\n") on a trailing newline yields one extra empty element; the real
|
|
42
|
+
# last line is the last non-empty index.
|
|
43
|
+
last = len(lines)
|
|
44
|
+
while last > 0 and lines[last - 1] == "":
|
|
45
|
+
last -= 1
|
|
46
|
+
for idx, (ln, text) in enumerate(heads):
|
|
47
|
+
nxt = heads[idx + 1][0] - 1 if idx + 1 < len(heads) else last
|
|
48
|
+
name = re.sub(r"^#{2,3} ", "", text).strip()
|
|
49
|
+
rows.append("| %d–%d | %s |" % (ln, nxt, name))
|
|
50
|
+
return lines[:hdr] + rows + lines[end:]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
for path in sorted(glob.glob("skills/*/REFERENCE.md")):
|
|
54
|
+
original = open(path, encoding="utf-8").read().split("\n")
|
|
55
|
+
|
|
56
|
+
# Rewriting the table changes the line numbers the table reports, so iterate
|
|
57
|
+
# to a fixed point rather than assuming one pass converges.
|
|
58
|
+
lines = original
|
|
59
|
+
for _ in range(10):
|
|
60
|
+
nxt = rebuild(lines)
|
|
61
|
+
if nxt is None or nxt == lines:
|
|
62
|
+
break
|
|
63
|
+
lines = nxt
|
|
64
|
+
if lines is None:
|
|
65
|
+
continue
|
|
66
|
+
|
|
67
|
+
new = lines
|
|
68
|
+
if new == original:
|
|
69
|
+
continue
|
|
70
|
+
lines = original # keep the staleness comparison against what is committed
|
|
71
|
+
if mode == "--check":
|
|
72
|
+
stale.append(path)
|
|
73
|
+
else:
|
|
74
|
+
open(path, "w", encoding="utf-8").write("\n".join(new))
|
|
75
|
+
rewritten.append(path)
|
|
76
|
+
|
|
77
|
+
if mode == "--check":
|
|
78
|
+
if stale:
|
|
79
|
+
print("generate-reference-nav: stale nav table(s):", file=sys.stderr)
|
|
80
|
+
for s in stale:
|
|
81
|
+
print(" %s" % s, file=sys.stderr)
|
|
82
|
+
print("run: bash scripts/generate-reference-nav.sh", file=sys.stderr)
|
|
83
|
+
sys.exit(1)
|
|
84
|
+
print("generate-reference-nav: all nav tables current")
|
|
85
|
+
else:
|
|
86
|
+
for r in rewritten:
|
|
87
|
+
print(" rebuilt %s" % r)
|
|
88
|
+
print("generate-reference-nav: %d table(s) rebuilt" % len(rewritten))
|
|
89
|
+
PY
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# story: e45s04
|
|
3
3
|
# generate-viz-graph.sh — build specs/viz.html from bigpowers-mcp/graph.jsonl
|
|
4
|
+
# bp-manual-utility: on-demand report generator; nothing else depends on
|
|
5
|
+
# viz.html's freshness the way generate-workflow-diagrams.sh/
|
|
6
|
+
# generate-reference-nav.sh are --check-gated. Run manually after graph.jsonl
|
|
7
|
+
# changes: bash scripts/generate-viz-graph.sh
|
|
4
8
|
set -euo pipefail
|
|
5
9
|
source "$(dirname "${BASH_SOURCE[0]}")/lib/python-env.sh"
|
|
6
10
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: e37s05
|
|
3
|
+
# golden-g13-script-orphans.sh — every scripts/*.sh must be wired into a gate,
|
|
4
|
+
# invoked by another script/skill/doc/workflow, or explicitly tagged as a
|
|
5
|
+
# manual utility.
|
|
6
|
+
#
|
|
7
|
+
# Originally scoped to scripts/test-*.sh only (33 of 35 test scripts were
|
|
8
|
+
# reachable from nothing). Broadened after a catalog-wide review found 9 more
|
|
9
|
+
# orphans among non-test scripts, one of which (sync-version-mirrors.sh) was a
|
|
10
|
+
# false positive of the SCANNER, not the script: it is called from
|
|
11
|
+
# .releaserc.json's semantic-release prepareCmd, a reference location the
|
|
12
|
+
# original scan never searched. The file is also renamed from
|
|
13
|
+
# golden-g13-test-orphans.sh to match what it now checks — a check whose name
|
|
14
|
+
# doesn't match its mechanism is the exact defect class G25 fixes elsewhere in
|
|
15
|
+
# this series.
|
|
16
|
+
#
|
|
17
|
+
# Usage: bash scripts/golden-g13-script-orphans.sh [--self-test]
|
|
18
|
+
# Exit 0: every script is referenced, or explicitly tagged bp-manual-utility
|
|
19
|
+
# Exit 1: at least one orphan (or, under --self-test, the gate failed to
|
|
20
|
+
# notice a deliberately unlisted, untagged script)
|
|
21
|
+
|
|
22
|
+
set -euo pipefail
|
|
23
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/skill-common.sh"
|
|
24
|
+
resolve_repo_root
|
|
25
|
+
cd "$REPO_ROOT"
|
|
26
|
+
|
|
27
|
+
RED='\033[0;31m'
|
|
28
|
+
GREEN='\033[0;32m'
|
|
29
|
+
NC='\033[0m'
|
|
30
|
+
|
|
31
|
+
GATES_FILE="scripts/lib/golden-suite-gates.sh"
|
|
32
|
+
|
|
33
|
+
# Reference locations a script can legitimately be called from. Archived
|
|
34
|
+
# epics are frozen history (per BUG-2026-07-26: an archived reference is not a
|
|
35
|
+
# live caller), so they're excluded even though they match the glob.
|
|
36
|
+
REF_GLOBS=(
|
|
37
|
+
"scripts/**/*.sh"
|
|
38
|
+
"skills/**/SKILL.md"
|
|
39
|
+
"skills/**/REFERENCE.md"
|
|
40
|
+
"CLAUDE.md"
|
|
41
|
+
"CONVENTIONS.md"
|
|
42
|
+
"docs/**/*.md"
|
|
43
|
+
"bin/**/*.js"
|
|
44
|
+
"package.json"
|
|
45
|
+
".releaserc.json"
|
|
46
|
+
".github/workflows/*.yml"
|
|
47
|
+
"specs/epics/**/*.yaml"
|
|
48
|
+
"specs/epics/**/*.md"
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
is_manual_utility() { # $1 = script path
|
|
52
|
+
head -10 "$1" 2>/dev/null | grep -q '^# bp-manual-utility:'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
is_referenced() { # $1 = script basename, $2... = candidate file globs already expanded
|
|
56
|
+
local name="$1"; shift
|
|
57
|
+
local f
|
|
58
|
+
for f in "$@"; do
|
|
59
|
+
[[ "$f" == *"/$name" || "$(basename "$f")" == "$name" ]] && continue # self
|
|
60
|
+
grep -q "$name" "$f" 2>/dev/null && return 0
|
|
61
|
+
done
|
|
62
|
+
return 1
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
collect_ref_files() {
|
|
66
|
+
shopt -s globstar nullglob
|
|
67
|
+
local pattern expanded=()
|
|
68
|
+
for pattern in "${REF_GLOBS[@]}"; do
|
|
69
|
+
for f in $pattern; do
|
|
70
|
+
[[ "$f" == specs/epics/archive/* ]] && continue
|
|
71
|
+
expanded+=("$f")
|
|
72
|
+
done
|
|
73
|
+
done
|
|
74
|
+
shopt -u globstar nullglob
|
|
75
|
+
printf '%s\n' "${expanded[@]}"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
find_orphans() { # $1 = scripts root dir, $2 = extra untagged basename to inject (self-test only)
|
|
79
|
+
local root="$1" extra="${2:-}"
|
|
80
|
+
local orphans="" f b
|
|
81
|
+
mapfile -t ref_files < <(collect_ref_files)
|
|
82
|
+
for f in "$root"/*.sh; do
|
|
83
|
+
[[ -e "$f" ]] || continue
|
|
84
|
+
b="$(basename "$f")"
|
|
85
|
+
is_manual_utility "$f" && continue
|
|
86
|
+
is_referenced "$b" "${ref_files[@]}" || orphans+=" $b"$'\n'
|
|
87
|
+
done
|
|
88
|
+
if [[ -n "$extra" ]]; then
|
|
89
|
+
is_referenced "$extra" "${ref_files[@]}" || orphans+=" $extra"$'\n'
|
|
90
|
+
fi
|
|
91
|
+
printf '%s' "$orphans"
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if [[ "${1:-}" == "--self-test" ]]; then
|
|
95
|
+
echo "=== G-13 self-test: prove the gate can fail, and that its exemptions work ==="
|
|
96
|
+
TMP=$(mktemp -d)
|
|
97
|
+
trap 'rm -rf "$TMP"' EXIT
|
|
98
|
+
|
|
99
|
+
# (a) An unlisted, untagged script must still be reported. Built by
|
|
100
|
+
# concatenation, not a literal string: this script's own source lives under
|
|
101
|
+
# scripts/, which REF_GLOBS also scans, so a literal fixture name written
|
|
102
|
+
# here would make the checker match its own self-test line.
|
|
103
|
+
fake_name="fixture-not-wired-$$.sh"
|
|
104
|
+
ok=1
|
|
105
|
+
if [[ -z "$(find_orphans "scripts" "$fake_name")" ]]; then
|
|
106
|
+
echo -e "${RED}FAIL${NC} (a) unlisted script was not reported — vacuous gate"
|
|
107
|
+
ok=0
|
|
108
|
+
else
|
|
109
|
+
echo -e "${GREEN}PASS${NC} (a) unlisted, untagged script is reported"
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
# (b) A bp-manual-utility-tagged, unwired script must be excluded.
|
|
113
|
+
cat > "$TMP/tagged-orphan.sh" <<'EOF'
|
|
114
|
+
#!/usr/bin/env bash
|
|
115
|
+
# bp-manual-utility: fixture for G-13 self-test — deliberately unreferenced
|
|
116
|
+
echo "never called by anything"
|
|
117
|
+
EOF
|
|
118
|
+
if [[ -n "$(find_orphans "$TMP")" ]]; then
|
|
119
|
+
echo -e "${RED}FAIL${NC} (b) bp-manual-utility-tagged script was still flagged"
|
|
120
|
+
ok=0
|
|
121
|
+
else
|
|
122
|
+
echo -e "${GREEN}PASS${NC} (b) bp-manual-utility-tagged script is excluded"
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
# (c) A script referenced only from .releaserc.json-shaped content must be
|
|
126
|
+
# excluded — regression guard for the exact scope gap fixed here
|
|
127
|
+
# (sync-version-mirrors.sh, called only from .releaserc.json's prepareCmd).
|
|
128
|
+
mkdir -p "$TMP/scope-fixture"
|
|
129
|
+
cat > "$TMP/scope-fixture/releaserc-lookalike.json" <<'EOF'
|
|
130
|
+
{"prepareCmd": "bash scripts/only-in-releaserc.sh 1.0.0"}
|
|
131
|
+
EOF
|
|
132
|
+
cat > "$TMP/scope-fixture/only-in-releaserc.sh" <<'EOF'
|
|
133
|
+
#!/usr/bin/env bash
|
|
134
|
+
echo "referenced only from a releaserc-shaped file"
|
|
135
|
+
EOF
|
|
136
|
+
refs=("$TMP/scope-fixture/releaserc-lookalike.json")
|
|
137
|
+
if is_referenced "only-in-releaserc.sh" "${refs[@]}"; then
|
|
138
|
+
echo -e "${GREEN}PASS${NC} (c) a releaserc-shaped reference is detected by is_referenced"
|
|
139
|
+
else
|
|
140
|
+
echo -e "${RED}FAIL${NC} (c) is_referenced did not find the releaserc-shaped reference"
|
|
141
|
+
ok=0
|
|
142
|
+
fi
|
|
143
|
+
|
|
144
|
+
if [[ "$ok" -eq 1 ]]; then
|
|
145
|
+
echo "G-13 self-test: PASS"
|
|
146
|
+
exit 0
|
|
147
|
+
fi
|
|
148
|
+
echo "G-13 self-test: FAIL"
|
|
149
|
+
exit 1
|
|
150
|
+
fi
|
|
151
|
+
|
|
152
|
+
echo "=== G-13: script orphan check ==="
|
|
153
|
+
ORPHANS="$(find_orphans "scripts")"
|
|
154
|
+
TOTAL=$(ls scripts/*.sh 2>/dev/null | wc -l | tr -d ' ')
|
|
155
|
+
|
|
156
|
+
if [[ -z "$ORPHANS" ]]; then
|
|
157
|
+
echo " ok : all $TOTAL script(s) in scripts/ are referenced or tagged bp-manual-utility"
|
|
158
|
+
echo -e "${GREEN}PASS${NC}"
|
|
159
|
+
echo "G-13: PASS"
|
|
160
|
+
exit 0
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
echo " orphaned scripts (present but reachable from no gate, doc, or workflow):"
|
|
164
|
+
printf '%s' "$ORPHANS"
|
|
165
|
+
echo -e "${RED}FAIL${NC} wire them into a gate, reference them from a skill/doc, tag them '# bp-manual-utility: <reason>', or delete them"
|
|
166
|
+
echo "G-13: FAIL"
|
|
167
|
+
exit 1
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: e45s02
|
|
3
|
+
# golden-g15-compliance-runner-selftest.sh — audit-compliance-runner.sh must
|
|
4
|
+
# correctly execute a Background step, a step on a file's last line with no
|
|
5
|
+
# trailing newline, and must still report a genuinely failing step as FAIL
|
|
6
|
+
# rather than silently dropping it.
|
|
7
|
+
#
|
|
8
|
+
# audit-compliance-runner.sh had two bugs that dropped steps entirely rather
|
|
9
|
+
# than failing them: no Background: handling at all (akita.feature's
|
|
10
|
+
# Background Given was silently skipped), and `done < "$FEATURE_FILE"` losing
|
|
11
|
+
# a final line with no trailing newline (karpathy.feature's last step never
|
|
12
|
+
# appeared in [STEP] output). Both are fixed; this gate is the regression
|
|
13
|
+
# guard so a future change to the runner can't reintroduce either silently —
|
|
14
|
+
# and, just as important, can't "fix" step-dropping by making every line
|
|
15
|
+
# execute unconditionally, which would hide a genuinely failing step as a
|
|
16
|
+
# false PASS.
|
|
17
|
+
#
|
|
18
|
+
# Usage: bash scripts/golden-g15-compliance-runner-selftest.sh [--self-test]
|
|
19
|
+
# Exit 0: Background executes, the no-newline last step executes, and a
|
|
20
|
+
# failing step is reported FAIL (or, under --self-test, a loose
|
|
21
|
+
# Given line outside any Background/Scenario is correctly NOT
|
|
22
|
+
# executed)
|
|
23
|
+
# Exit 1: any of the above does not hold
|
|
24
|
+
|
|
25
|
+
set -euo pipefail
|
|
26
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/skill-common.sh"
|
|
27
|
+
resolve_repo_root
|
|
28
|
+
cd "$REPO_ROOT"
|
|
29
|
+
|
|
30
|
+
RED='\033[0;31m'
|
|
31
|
+
GREEN='\033[0;32m'
|
|
32
|
+
NC='\033[0m'
|
|
33
|
+
|
|
34
|
+
# Builds a fixture project at $1 with the step scripts a fixture .feature
|
|
35
|
+
# needs, then runs audit_run_file against $2 (a path relative to $1) and
|
|
36
|
+
# echoes the captured [STEP]/Result output.
|
|
37
|
+
run_fixture() { # $1 = fixture root, $2 = feature file path relative to root
|
|
38
|
+
local root="$1" feature="$2"
|
|
39
|
+
(
|
|
40
|
+
cd "$root"
|
|
41
|
+
# shellcheck source=lib/audit-compliance-runner.sh
|
|
42
|
+
source "$REPO_ROOT/scripts/lib/audit-compliance-runner.sh"
|
|
43
|
+
DRY_RUN=false SCENARIO_FILTER="" JUDGE="binary"
|
|
44
|
+
TOTAL_GLOBAL_PASS=0 TOTAL_GLOBAL_FAIL=0 TOTAL_GLOBAL_WAIVED=0 TOTAL_GLOBAL_EXPIRED=0
|
|
45
|
+
audit_run_file "$feature" 2>&1
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
build_step() { # $1 = fixture root, $2 = sanitized step filename (no .sh), $3 = exit code
|
|
50
|
+
cat > "$1/specs/verifications/steps/$2.sh" <<EOF
|
|
51
|
+
#!/usr/bin/env bash
|
|
52
|
+
exit $3
|
|
53
|
+
EOF
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if [[ "${1:-}" == "--self-test" ]]; then
|
|
57
|
+
echo "=== G-15 self-test: a loose Given outside Background/Scenario must not execute ==="
|
|
58
|
+
TMP=$(mktemp -d)
|
|
59
|
+
trap 'rm -rf "$TMP"' EXIT
|
|
60
|
+
mkdir -p "$TMP/specs/verifications/steps" "$TMP/specs/verifications/reports"
|
|
61
|
+
|
|
62
|
+
build_step "$TMP" "given-a-loose-step-outside-any-block" 0
|
|
63
|
+
# No "Background:" keyword and no "Scenario:" before this line — structurally
|
|
64
|
+
# mimics what the pre-fix runner treated every top-level Given/Then/And as
|
|
65
|
+
# (no scenario context tracked at all), which is the over-broad failure mode
|
|
66
|
+
# a bad fix could reintroduce: executing steps regardless of context.
|
|
67
|
+
printf 'Feature: G-15 self-test fixture\nGiven a loose step outside any block\n' \
|
|
68
|
+
> "$TMP/specs/features_fixture.feature"
|
|
69
|
+
|
|
70
|
+
OUTPUT=$(run_fixture "$TMP" "specs/features_fixture.feature")
|
|
71
|
+
if grep -q '\[STEP\] Given a loose step outside any block' <<<"$OUTPUT"; then
|
|
72
|
+
echo -e "${RED}FAIL${NC} a loose Given outside any Background/Scenario executed — the runner no longer tracks scenario context"
|
|
73
|
+
echo "G-15 self-test: FAIL"
|
|
74
|
+
exit 1
|
|
75
|
+
fi
|
|
76
|
+
echo -e "${GREEN}PASS${NC} the loose Given correctly did not execute"
|
|
77
|
+
echo "G-15 self-test: PASS"
|
|
78
|
+
exit 0
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
echo "=== G-15: compliance runner Background/EOF/failure handling ==="
|
|
82
|
+
TMP=$(mktemp -d)
|
|
83
|
+
trap 'rm -rf "$TMP"' EXIT
|
|
84
|
+
mkdir -p "$TMP/specs/verifications/steps" "$TMP/specs/verifications/reports"
|
|
85
|
+
|
|
86
|
+
build_step "$TMP" "given-a-background-step" 0
|
|
87
|
+
build_step "$TMP" "then-a-normal-step" 0
|
|
88
|
+
build_step "$TMP" "and-a-step-that-should-fail" 1
|
|
89
|
+
build_step "$TMP" "and-a-step-with-no-trailing-newline" 0
|
|
90
|
+
|
|
91
|
+
# Written without a trailing newline after the last line — printf, not a
|
|
92
|
+
# heredoc, so the file ends exactly where karpathy.feature's bug lived.
|
|
93
|
+
printf 'Feature: G-15 fixture\n Background:\n Given a background step\n\n Scenario: Fixture\n Then a normal step\n And a step that should fail\n And a step with no trailing newline' \
|
|
94
|
+
> "$TMP/specs/features_fixture.feature"
|
|
95
|
+
|
|
96
|
+
OUTPUT=$(run_fixture "$TMP" "specs/features_fixture.feature")
|
|
97
|
+
|
|
98
|
+
FAILS=0
|
|
99
|
+
|
|
100
|
+
if grep -q '\[STEP\] Given a background step' <<<"$OUTPUT"; then
|
|
101
|
+
echo -e "${GREEN}PASS${NC} Background step executed"
|
|
102
|
+
else
|
|
103
|
+
echo -e "${RED}FAIL${NC} Background step did not execute"
|
|
104
|
+
FAILS=$((FAILS + 1))
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
if grep -q '\[STEP\] And a step with no trailing newline' <<<"$OUTPUT"; then
|
|
108
|
+
echo -e "${GREEN}PASS${NC} the no-trailing-newline last step executed"
|
|
109
|
+
else
|
|
110
|
+
echo -e "${RED}FAIL${NC} the no-trailing-newline last step did not execute"
|
|
111
|
+
FAILS=$((FAILS + 1))
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
if grep -A2 '\[STEP\] And a step that should fail' <<<"$OUTPUT" | grep -q 'Result: FAIL'; then
|
|
115
|
+
echo -e "${GREEN}PASS${NC} the genuinely failing step is reported FAIL, not silently dropped"
|
|
116
|
+
else
|
|
117
|
+
echo -e "${RED}FAIL${NC} the genuinely failing step was not reported FAIL"
|
|
118
|
+
FAILS=$((FAILS + 1))
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
if [[ "$FAILS" -eq 0 ]]; then
|
|
122
|
+
echo "G-15: PASS"
|
|
123
|
+
exit 0
|
|
124
|
+
fi
|
|
125
|
+
echo "G-15: FAIL ($FAILS assertion(s) failed)"
|
|
126
|
+
exit 1
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# story: e44s02
|
|
3
|
+
# golden-g16-spec-version-gap.sh — bigpowers' own repo must never show a spec
|
|
4
|
+
# version gap against itself.
|
|
5
|
+
#
|
|
6
|
+
# check-spec-version-gap.sh is a fully-formed SoT-drift detector for consuming
|
|
7
|
+
# projects (installed package.json version vs the spec-format version stamped
|
|
8
|
+
# or fingerprinted in their specs/), the same class of check as G-12, but it
|
|
9
|
+
# had no gate of its own and was reachable from nothing (G-13). Running it
|
|
10
|
+
# against this repo's own specs/ is the natural self-test the tool already
|
|
11
|
+
# supports via --project: bigpowers' own package.json version and its own
|
|
12
|
+
# specs/state.yaml bigpowers_version stamp must always agree.
|
|
13
|
+
#
|
|
14
|
+
# Usage: bash scripts/golden-g16-spec-version-gap.sh [--self-test]
|
|
15
|
+
# Exit 0: no gap (or, under --self-test, a deliberately injected gap was
|
|
16
|
+
# correctly detected)
|
|
17
|
+
# Exit 1: a real gap exists, or --self-test failed to detect an injected one
|
|
18
|
+
|
|
19
|
+
set -euo pipefail
|
|
20
|
+
source "$(dirname "${BASH_SOURCE[0]}")/lib/skill-common.sh"
|
|
21
|
+
resolve_repo_root
|
|
22
|
+
cd "$REPO_ROOT"
|
|
23
|
+
|
|
24
|
+
RED='\033[0;31m'
|
|
25
|
+
GREEN='\033[0;32m'
|
|
26
|
+
NC='\033[0m'
|
|
27
|
+
|
|
28
|
+
if [[ "${1:-}" == "--self-test" ]]; then
|
|
29
|
+
echo "=== G-16 self-test: prove the gap detector can fail ==="
|
|
30
|
+
TMP=$(mktemp -d)
|
|
31
|
+
trap 'rm -rf "$TMP"' EXIT
|
|
32
|
+
mkdir -p "$TMP/specs"
|
|
33
|
+
cp package.json "$TMP/package.json"
|
|
34
|
+
# A stamped version far behind package.json's must be reported as a gap.
|
|
35
|
+
# set +e around the call: under set -e, `out=$(cmd)` itself aborts the
|
|
36
|
+
# script when cmd exits non-zero — exactly the outcome under test here — so
|
|
37
|
+
# rc=$? would never be reached.
|
|
38
|
+
printf 'bigpowers_version: 0.0.1\nactive_flow: null\n' > "$TMP/specs/state.yaml"
|
|
39
|
+
set +e
|
|
40
|
+
out=$(bash scripts/check-spec-version-gap.sh --project "$TMP" --skip-block --json 2>&1)
|
|
41
|
+
rc=$?
|
|
42
|
+
set -e
|
|
43
|
+
# check-spec-version-gap.sh's stamp path emits json.dumps-formatted JSON
|
|
44
|
+
# ("gap": true, with a space); its fingerprint path emits hand-concatenated
|
|
45
|
+
# JSON ("gap":true, no space) — tolerate both rather than assuming one.
|
|
46
|
+
if [[ $rc -eq 1 ]] && grep -qE '"gap":[[:space:]]*true' <<<"$out"; then
|
|
47
|
+
echo -e "${GREEN}PASS${NC} injected version gap detected (exit $rc): $out"
|
|
48
|
+
echo "G-16 self-test: PASS"
|
|
49
|
+
exit 0
|
|
50
|
+
fi
|
|
51
|
+
echo -e "${RED}FAIL${NC} injected gap was not detected (exit $rc): $out"
|
|
52
|
+
echo "G-16 self-test: FAIL"
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
echo "=== G-16: spec version gap (self-check) ==="
|
|
57
|
+
# Same set -e hazard as the self-test above: a real gap exits non-zero, and
|
|
58
|
+
# without set +e this assignment would abort before the FAIL branch prints.
|
|
59
|
+
set +e
|
|
60
|
+
OUT=$(bash scripts/check-spec-version-gap.sh --project . --skip-block --json 2>&1)
|
|
61
|
+
RC=$?
|
|
62
|
+
set -e
|
|
63
|
+
echo " $OUT"
|
|
64
|
+
|
|
65
|
+
if [[ $RC -eq 0 ]]; then
|
|
66
|
+
echo -e "${GREEN}PASS${NC} no spec version gap"
|
|
67
|
+
echo "G-16: PASS"
|
|
68
|
+
exit 0
|
|
69
|
+
fi
|
|
70
|
+
echo -e "${RED}FAIL${NC} bigpowers' own specs/ disagree with its own package.json version (exit $RC)"
|
|
71
|
+
echo "G-16: FAIL"
|
|
72
|
+
exit 1
|
|
Binary file
|
|
Binary file
|
|
@@ -5,6 +5,23 @@
|
|
|
5
5
|
if [ -n "${AUDIT_COMPLIANCE_REPORT_LOADED:-}" ]; then return 0; fi
|
|
6
6
|
AUDIT_COMPLIANCE_REPORT_LOADED=1
|
|
7
7
|
|
|
8
|
+
# A score sitting exactly on the 94% threshold has zero margin: one more
|
|
9
|
+
# failing scenario (the suite grows over time) blocks all forward work under
|
|
10
|
+
# this repo's own Always-Green doctrine — it already happened once mid-session.
|
|
11
|
+
# pass-warn surfaces a thinning margin before it goes red; it still exits 0,
|
|
12
|
+
# it does not block, it only makes the OKF report and terminal output loud
|
|
13
|
+
# about a score close enough to the threshold to be worth attention.
|
|
14
|
+
audit_gate_status() {
|
|
15
|
+
local score="$1"
|
|
16
|
+
if [[ "$score" -lt 94 ]]; then
|
|
17
|
+
echo "fail"
|
|
18
|
+
elif [[ "$score" -lt 97 ]]; then
|
|
19
|
+
echo "pass-warn"
|
|
20
|
+
else
|
|
21
|
+
echo "pass"
|
|
22
|
+
fi
|
|
23
|
+
}
|
|
24
|
+
|
|
8
25
|
audit_write_okf_report() {
|
|
9
26
|
local OKF_DIR OKF_FILE TIMESTAMP GIT_COMMIT GATE TOTAL_GLOBAL_ALL
|
|
10
27
|
|
|
@@ -20,7 +37,7 @@ audit_write_okf_report() {
|
|
|
20
37
|
OKF_FILE="$OKF_DIR/audit-$(date +%Y-%m-%d).okf.md"
|
|
21
38
|
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
22
39
|
GIT_COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
|
|
23
|
-
GATE=$(
|
|
40
|
+
GATE=$(audit_gate_status "$SCORE")
|
|
24
41
|
|
|
25
42
|
cat > "$OKF_FILE" << OKF_EOF
|
|
26
43
|
---
|
|
@@ -67,10 +84,18 @@ audit_print_summary_and_exit() {
|
|
|
67
84
|
echo " SCORE: ${SCORE}% (threshold 94%)"
|
|
68
85
|
fi
|
|
69
86
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
case "$(audit_gate_status "$SCORE")" in
|
|
88
|
+
pass)
|
|
89
|
+
echo " GATE: PASS"
|
|
90
|
+
exit 0
|
|
91
|
+
;;
|
|
92
|
+
pass-warn)
|
|
93
|
+
echo " GATE: PASS (WARNING: ${SCORE}% is within 3 points of the 94% threshold — margin is thin)"
|
|
94
|
+
exit 0
|
|
95
|
+
;;
|
|
96
|
+
*)
|
|
97
|
+
echo " GATE: FAIL (below 94%)"
|
|
98
|
+
exit 1
|
|
99
|
+
;;
|
|
100
|
+
esac
|
|
76
101
|
}
|