bigpowers 2.85.1 → 2.86.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 (99) hide show
  1. package/.agents/skills/assess-impact/SKILL.md +1 -1
  2. package/.agents/skills/develop-tdd/SKILL.md +11 -1
  3. package/.agents/skills/enforce-first/SKILL.md +13 -0
  4. package/.agents/skills/gate-trace/SKILL.md +4 -0
  5. package/.agents/skills/smoke-test/SKILL.md +39 -24
  6. package/.agents/skills/validate-contracts/SKILL.md +26 -58
  7. package/.agents/skills/validate-fix/SKILL.md +46 -5
  8. package/.codebuddy/skills/assess-impact/SKILL.md +1 -1
  9. package/.codebuddy/skills/develop-tdd/SKILL.md +11 -1
  10. package/.codebuddy/skills/enforce-first/SKILL.md +13 -0
  11. package/.codebuddy/skills/gate-trace/SKILL.md +4 -0
  12. package/.codebuddy/skills/smoke-test/SKILL.md +39 -24
  13. package/.codebuddy/skills/validate-contracts/SKILL.md +26 -58
  14. package/.codebuddy/skills/validate-fix/SKILL.md +46 -5
  15. package/.codex/skills/assess-impact/SKILL.md +1 -1
  16. package/.codex/skills/develop-tdd/SKILL.md +11 -1
  17. package/.codex/skills/enforce-first/SKILL.md +13 -0
  18. package/.codex/skills/gate-trace/SKILL.md +4 -0
  19. package/.codex/skills/smoke-test/SKILL.md +39 -24
  20. package/.codex/skills/validate-contracts/SKILL.md +26 -58
  21. package/.codex/skills/validate-fix/SKILL.md +46 -5
  22. package/.hermes/skills/assess-impact/SKILL.md +1 -1
  23. package/.hermes/skills/develop-tdd/SKILL.md +11 -1
  24. package/.hermes/skills/enforce-first/SKILL.md +13 -0
  25. package/.hermes/skills/gate-trace/SKILL.md +4 -0
  26. package/.hermes/skills/smoke-test/SKILL.md +39 -24
  27. package/.hermes/skills/validate-contracts/SKILL.md +26 -58
  28. package/.hermes/skills/validate-fix/SKILL.md +46 -5
  29. package/.kilocode/rules/assess-impact.md +1 -1
  30. package/.kilocode/rules/develop-tdd.md +11 -1
  31. package/.kilocode/rules/enforce-first.md +13 -0
  32. package/.kilocode/rules/gate-trace.md +4 -0
  33. package/.kilocode/rules/smoke-test.md +39 -24
  34. package/.kilocode/rules/validate-contracts.md +26 -58
  35. package/.kilocode/rules/validate-fix.md +46 -5
  36. package/.mimocode/skills/assess-impact/SKILL.md +1 -1
  37. package/.mimocode/skills/develop-tdd/SKILL.md +11 -1
  38. package/.mimocode/skills/enforce-first/SKILL.md +13 -0
  39. package/.mimocode/skills/gate-trace/SKILL.md +4 -0
  40. package/.mimocode/skills/smoke-test/SKILL.md +39 -24
  41. package/.mimocode/skills/validate-contracts/SKILL.md +26 -58
  42. package/.mimocode/skills/validate-fix/SKILL.md +46 -5
  43. package/.pi/package.json +1 -1
  44. package/.pi/prompts/assess-impact.md +1 -1
  45. package/.pi/prompts/develop-tdd.md +11 -1
  46. package/.pi/prompts/enforce-first.md +13 -0
  47. package/.pi/prompts/gate-trace.md +4 -0
  48. package/.pi/prompts/smoke-test.md +39 -24
  49. package/.pi/prompts/validate-contracts.md +26 -58
  50. package/.pi/prompts/validate-fix.md +46 -5
  51. package/.pi/skills/assess-impact/SKILL.md +1 -1
  52. package/.pi/skills/develop-tdd/SKILL.md +11 -1
  53. package/.pi/skills/enforce-first/SKILL.md +13 -0
  54. package/.pi/skills/gate-trace/SKILL.md +4 -0
  55. package/.pi/skills/smoke-test/SKILL.md +39 -24
  56. package/.pi/skills/validate-contracts/SKILL.md +26 -58
  57. package/.pi/skills/validate-fix/SKILL.md +46 -5
  58. package/.trae/skills/assess-impact/SKILL.md +1 -1
  59. package/.trae/skills/develop-tdd/SKILL.md +11 -1
  60. package/.trae/skills/enforce-first/SKILL.md +13 -0
  61. package/.trae/skills/gate-trace/SKILL.md +4 -0
  62. package/.trae/skills/smoke-test/SKILL.md +39 -24
  63. package/.trae/skills/validate-contracts/SKILL.md +26 -58
  64. package/.trae/skills/validate-fix/SKILL.md +46 -5
  65. package/.windsurf/rules/assess-impact.md +1 -1
  66. package/.windsurf/rules/develop-tdd.md +11 -1
  67. package/.windsurf/rules/enforce-first.md +13 -0
  68. package/.windsurf/rules/gate-trace.md +4 -0
  69. package/.windsurf/rules/smoke-test.md +39 -24
  70. package/.windsurf/rules/validate-contracts.md +26 -58
  71. package/.windsurf/rules/validate-fix.md +46 -5
  72. package/.zcode/skills/assess-impact/SKILL.md +1 -1
  73. package/.zcode/skills/develop-tdd/SKILL.md +11 -1
  74. package/.zcode/skills/enforce-first/SKILL.md +13 -0
  75. package/.zcode/skills/gate-trace/SKILL.md +4 -0
  76. package/.zcode/skills/smoke-test/SKILL.md +39 -24
  77. package/.zcode/skills/validate-contracts/SKILL.md +26 -58
  78. package/.zcode/skills/validate-fix/SKILL.md +46 -5
  79. package/CHANGELOG.md +20 -0
  80. package/SKILL-INDEX.md +24 -24
  81. package/package.json +1 -1
  82. package/scripts/generate-skill-index.sh +1 -1
  83. package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
  84. package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
  85. package/scripts/run-gate-trace-verify.sh +35 -0
  86. package/scripts/validate-contracts.sh +58 -0
  87. package/scripts/verify-generalize-sweep.sh +55 -0
  88. package/scripts/verify-tdd-red-commit.sh +91 -0
  89. package/skills/assess-impact/SKILL.md +1 -1
  90. package/skills/develop-tdd/SKILL.md +13 -1
  91. package/skills/enforce-first/SKILL.md +14 -0
  92. package/skills/gate-trace/SKILL.md +5 -0
  93. package/skills/security-review/fixtures/CWE-fail-open-verify-negative.sh +5 -0
  94. package/skills/security-review/fixtures/CWE-fail-open-verify-positive.sh +5 -0
  95. package/skills/smoke-test/SKILL.md +40 -24
  96. package/skills/validate-contracts/SKILL.md +27 -58
  97. package/skills/validate-fix/REFERENCE-generalize-fix.md +31 -0
  98. package/skills/validate-fix/SKILL.md +14 -5
  99. package/skills-lock.json +7 -7
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env bash
2
+ # story: e80s04
3
+ # Validates generalize-fix sweep artifact exists and has required fields.
4
+ # Usage:
5
+ # bash scripts/verify-generalize-sweep.sh [--self-test]
6
+ # bash scripts/verify-generalize-sweep.sh specs/verifications/generalize-sweep-BUG-*.json
7
+ set -euo pipefail
8
+
9
+ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
+ cd "$REPO_ROOT"
11
+
12
+ validate_artifact() {
13
+ local file="$1"
14
+ [[ -f "$file" ]] || { echo "FAIL: missing $file"; return 1; }
15
+ grep -q '"defect_class"' "$file" || { echo "FAIL: $file missing defect_class"; return 1; }
16
+ grep -q '"grep_pattern"' "$file" || { echo "FAIL: $file missing grep_pattern"; return 1; }
17
+ grep -q '"match_count"' "$file" || { echo "FAIL: $file missing match_count"; return 1; }
18
+ echo "PASS: $file"
19
+ }
20
+
21
+ self_test() {
22
+ local dir="$REPO_ROOT/specs/verifications/fixtures"
23
+ mkdir -p "$dir"
24
+ local sample="$dir/generalize-sweep-selftest.json"
25
+ cat > "$sample" <<'JSON'
26
+ {
27
+ "defect_class": "fail-open-verify",
28
+ "grep_pattern": "|| echo",
29
+ "match_count": 0,
30
+ "sweep_scope": "skills/*/SKILL.md",
31
+ "notes": "self-test fixture for verify-generalize-sweep.sh"
32
+ }
33
+ JSON
34
+ validate_artifact "$sample"
35
+ grep -q 'generalize-fix' skills/validate-fix/SKILL.md
36
+ echo "verify-generalize-sweep: self-test OK"
37
+ }
38
+
39
+ if [[ "${1:-}" == "--self-test" ]]; then
40
+ self_test
41
+ exit 0
42
+ fi
43
+
44
+ if [[ $# -gt 0 ]]; then
45
+ for f in "$@"; do validate_artifact "$f"; done
46
+ exit 0
47
+ fi
48
+
49
+ shopt -s nullglob
50
+ artifacts=(specs/verifications/generalize-sweep-*.json)
51
+ if [[ ${#artifacts[@]} -eq 0 ]]; then
52
+ echo "FAIL: no specs/verifications/generalize-sweep-*.json artifact (generalize-fix not evidenced)"
53
+ exit 1
54
+ fi
55
+ for f in "${artifacts[@]}"; do validate_artifact "$f"; done
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env bash
2
+ # story: e80s01 e80s03
3
+ # Mechanical gate: test-only (RED) commit must fail when checked out in isolation.
4
+ # Usage:
5
+ # bash scripts/verify-tdd-red-commit.sh [--self-test]
6
+ # TDD_VERIFY_CMD='npm test' bash scripts/verify-tdd-red-commit.sh
7
+ set -euo pipefail
8
+
9
+ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
+ cd "$REPO_ROOT"
11
+
12
+ self_test() {
13
+ local tmp
14
+ tmp=$(mktemp -d)
15
+ trap 'rm -rf "$tmp"' RETURN
16
+ cd "$tmp"
17
+ git init -q
18
+ git config user.email "tdd-verify@bigpowers.local"
19
+ git config user.name "tdd-verify"
20
+
21
+ mkdir -p test
22
+ cat > package.json <<'JSON'
23
+ {"name":"tdd-fixture","scripts":{"test":"node test/run.js"}}
24
+ JSON
25
+ cat > test/run.js <<'JS'
26
+ const fs = require('fs');
27
+ const impl = fs.existsSync('src/impl.js');
28
+ process.exit(impl ? 0 : 1);
29
+ JS
30
+ git add .
31
+ git commit -q -m "test(scope): red — expect failure without impl"
32
+
33
+ git checkout -q HEAD
34
+ if node test/run.js; then
35
+ echo "FAIL: RED commit passed in isolation (expected failure)"
36
+ return 1
37
+ fi
38
+ echo "PASS: RED commit fails in isolation"
39
+
40
+ mkdir -p src
41
+ echo 'module.exports = {};' > src/impl.js
42
+ git add src/impl.js
43
+ git commit -q -m "fix(scope): green — implementation"
44
+ if ! node test/run.js; then
45
+ echo "FAIL: GREEN commit should pass"
46
+ return 1
47
+ fi
48
+ echo "PASS: GREEN commit passes"
49
+ echo "verify-tdd-red-commit: self-test OK"
50
+ }
51
+
52
+ if [[ "${1:-}" == "--self-test" ]]; then
53
+ self_test
54
+ exit $?
55
+ fi
56
+
57
+ if ! git rev-parse --git-dir >/dev/null 2>&1; then
58
+ echo "ERROR: not a git repository"
59
+ exit 1
60
+ fi
61
+
62
+ if [[ "$(git rev-list --count HEAD 2>/dev/null || echo 0)" -lt 2 ]]; then
63
+ echo "SKIP: need at least 2 commits (test-only RED then fix GREEN)"
64
+ exit 0
65
+ fi
66
+
67
+ VERIFY_CMD="${TDD_VERIFY_CMD:-}"
68
+ if [[ -z "$VERIFY_CMD" ]]; then
69
+ if [[ -f package.json ]] && grep -q '"test"' package.json 2>/dev/null; then
70
+ VERIFY_CMD="npm test --if-present"
71
+ elif [[ -f Cargo.toml ]]; then
72
+ VERIFY_CMD="cargo test"
73
+ else
74
+ echo "SKIP: set TDD_VERIFY_CMD for this repo"
75
+ exit 0
76
+ fi
77
+ fi
78
+
79
+ RED_SHA=$(git rev-parse HEAD~1)
80
+ WORKTREE=$(mktemp -d)
81
+ trap 'git worktree remove -f "$WORKTREE" 2>/dev/null || rm -rf "$WORKTREE"' EXIT
82
+
83
+ git worktree add -q --detach "$WORKTREE" "$RED_SHA"
84
+ (
85
+ cd "$WORKTREE"
86
+ if bash -c "$VERIFY_CMD"; then
87
+ echo "FAIL: test-only commit $RED_SHA passed in isolation — RED gate violated"
88
+ exit 1
89
+ fi
90
+ echo "PASS: test-only commit $RED_SHA fails in isolation"
91
+ )
@@ -35,7 +35,7 @@ git log --oneline -10 -- [file-path]
35
35
 
36
36
  Read `specs/release-plan.yaml + epic capsule directories` (if it exists). For each dependent found in Step 2, identify which story owns that module. List stories that will be affected by the change.
37
37
 
38
- → verify: `grep -c "Story" specs/release-plan.yaml 2>/dev/null || echo "no release plan"`
38
+ → verify: `test -f specs/release-plan.yaml && grep -ci "stor" specs/release-plan.yaml`
39
39
 
40
40
  ### 4. List test coverage
41
41
 
@@ -1,3 +1,5 @@
1
+ # story: e80s01
2
+ # story: e80s03
1
3
  # story: e51s04
2
4
  # story: e45s06
3
5
  # story: e45s08
@@ -60,7 +62,13 @@ GREEN: Write minimal code to pass → test passes → commit: feat(<scope>): ..
60
62
  REFACTOR (optional): clean up → commit: refactor(<scope>): ...
61
63
  ```
62
64
 
63
- > **Two-commit red/green policy (HARD GATE — e45s08)** — Each behavior cycle requires **two separate commits**: (1) test-only commit that fails in CI (RED), then (2) implementation commit that makes it pass (GREEN). Never combine test + fix in one commit. Show `git log -2 --oneline` as evidence before proceeding to the next behavior.
65
+ > **Two-commit red/green policy (HARD GATE — e45s08)** — Each behavior cycle requires **two separate commits**: (1) test-only commit that fails in CI (RED), then (2) implementation commit that makes it pass (GREEN). Never combine test + fix in one commit. Before proceeding, run the mechanical RED isolation check:
66
+
67
+ ```bash
68
+ bash scripts/verify-tdd-red-commit.sh
69
+ ```
70
+
71
+ Show `git log -2 --oneline` **and** the script output as evidence. If the test-only commit passes in isolation, the RED gate is violated — stop and fix before GREEN.
64
72
 
65
73
  > **tasks.yaml ledger (e45s06)** — After each task's `verify:` exits 0, update `eNNsYY-tasks.yaml`: set that task's `status: passing`. Story-level `status: passing` only when all tasks pass.
66
74
 
@@ -124,5 +132,9 @@ Writes: state.yaml handoff.next_skill = verify-work
124
132
 
125
133
  At story completion, if the story was sized with BCP Plus (13-dimension breakdown), log the `bcp_plus.total` alongside the standard `bcps:` count in the story's tasks.yaml. The breakdown is available from the epic capsule's `bcp_plus_breakdown` field. See `docs/references/bcp-plus.md` for the full methodology and NFR Gate pattern.
126
134
 
135
+ ## Verify
136
+
137
+ → verify: `test -x scripts/verify-tdd-red-commit.sh && bash scripts/verify-tdd-red-commit.sh --self-test && grep -q 'verify-tdd-red-commit' skills/develop-tdd/SKILL.md && echo OK`
138
+
127
139
 
128
140
  <!-- story: e02s04 -->
@@ -1,3 +1,4 @@
1
+ # story: e80s01
1
2
  ---
2
3
  name: enforce-first
3
4
  model: haiku
@@ -22,6 +23,15 @@ This skill is typically invoked internally by `develop-tdd` during the test-writ
22
23
 
23
24
  See CONVENTIONS.md §Tests for the canonical F.I.R.S.T rubric definition, checklists, and fix patterns.
24
25
 
26
+ Mechanical self-check (runs before reporting audit complete):
27
+
28
+ ```bash
29
+ grep -q '## Tests (F.I.R.S.T' CONVENTIONS.md
30
+ grep -qE 'Fast|Independent|Repeatable|Self-Validating|Timely' CONVENTIONS.md
31
+ ```
32
+
33
+ Each criterion must be explicitly addressed in the audit report with pass/fail per test file reviewed.
34
+
25
35
  ## Applying the rubric
26
36
 
27
37
  For each failing criterion:
@@ -32,3 +42,7 @@ For each failing criterion:
32
42
 
33
43
  Report: "F.I.R.S.T audit complete. X criteria passed, Y fixed."
34
44
 
45
+ ## Verify
46
+
47
+ → verify: `grep -q '## Tests (F.I.R.S.T' CONVENTIONS.md && grep -qE 'Self-Validating|Repeatable' skills/enforce-first/SKILL.md && echo OK`
48
+
@@ -1,3 +1,4 @@
1
+ # story: e80s01
1
2
  # story: e45s05
2
3
  ---
3
4
  name: gate-trace
@@ -90,3 +91,7 @@ gate_trace:
90
91
 
91
92
  Gate: READY → next: release-branch (final step before merge)
92
93
  Writes: state.yaml handoff.next_skill = release-branch
94
+
95
+ ## Verify
96
+
97
+ → verify: `test -x scripts/run-gate-trace-verify.sh && bash scripts/run-gate-trace-verify.sh --self-test && echo OK`
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ # story: e80s05
3
+ # Negative fixture: proper exit-code propagation (must NOT be flagged as fail-open)
4
+ set -euo pipefail
5
+ test -f scripts/run-skill-verify.sh
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ # story: e80s05
3
+ # Positive fixture: fail-open verify directive (must be flagged)
4
+ # Vulnerable: exit 0 even when check fails via || echo
5
+ grep -q 'bigpowers' /nonexistent/path 2>/dev/null || echo "FAIL: missing artifact"
@@ -1,5 +1,7 @@
1
+ # story: e80s02
1
2
  ---
2
3
  name: smoke-test
4
+ phase: verify
3
5
  description: "Post-deploy health-check against a live URL. Validates HTTP status, response content, and critical endpoints. Runnable standalone OR as the final step of the deploy skill."
4
6
  model: sonnet
5
7
  effort: standard
@@ -11,58 +13,72 @@ effort: standard
11
13
  >
12
14
  > **HARD GATE** — A failed smoke test means the deployment is broken. Do NOT mark a deploy as successful until all smoke checks pass.
13
15
 
14
- Validate a deployed application is healthy by running a configurable set of HTTP checks against live URLs. Each check asserts:
15
- - HTTP status code (e.g., 200 for success, 404 for expected-not-found)
16
- - Response body content signal (regex or jq expression)
17
- - Response time threshold (optional)
18
-
19
- Can be run standalone for quick health checks or chained as the final step of the `deploy` skill.
16
+ Validate a deployed application is healthy by running HTTP checks against live URLs. Each check asserts HTTP status, optional body signal (regex), and optional response-time threshold.
20
17
 
21
18
  ## Configuration
22
19
 
23
- Smoke checks are defined in `smoke-checks.yaml` at the project root:
24
-
25
- See [REFERENCE.md](REFERENCE.md)
20
+ Smoke checks live in `smoke-checks.yaml` at the project root:
26
21
 
27
- Checks can also be specified inline via environment variables or CLI arguments for ad-hoc use.
28
-
29
- ### Check Schema
22
+ ```yaml
23
+ base_url: "https://example.com"
24
+ checks:
25
+ - name: "Homepage"
26
+ path: "/"
27
+ expected_status: 200
28
+ content_signal: "welcome|ok"
29
+ max_response_time_ms: 3000
30
+ ```
30
31
 
31
32
  | Field | Required | Default | Description |
32
33
  |-------|----------|---------|-------------|
33
- | `name` | Yes | — | Human-readable check name (used in report) |
34
+ | `name` | Yes | — | Human-readable check name |
34
35
  | `path` | Yes | `/` | URL path relative to base_url |
35
36
  | `method` | No | `GET` | HTTP method |
36
37
  | `expected_status` | No | `200` | Expected HTTP status code |
37
- | `content_signal` | No | — | Regex or string to find in response body |
38
- | `max_response_time_ms` | No | — | Fail if response slower than this threshold (ms) |
38
+ | `content_signal` | No | — | Regex or string in response body |
39
+ | `max_response_time_ms` | No | — | Fail if slower than threshold (ms) |
40
+
41
+ Ad-hoc single-URL mode: `DEPLOY_URL=https://host bash scripts/run-smoke.sh`
39
42
 
40
43
  ## Process
41
44
 
42
- ### 1. Load smoke checks
45
+ ### 1. Load checks
43
46
 
44
- See [REFERENCE.md](REFERENCE.md)
47
+ ```bash
48
+ SMOKE_CHECKS_FILE="${SMOKE_CHECKS_FILE:-smoke-checks.yaml}"
49
+ BASE_URL="${DEPLOY_URL:-$BASE_URL}"
50
+ test -f "$SMOKE_CHECKS_FILE" || test -n "$BASE_URL" || { echo "ERROR: no checks file or URL"; exit 1; }
51
+ ```
45
52
 
46
53
  ### 2. Run each check
47
54
 
48
- For each check in the configuration, perform an HTTP request:
55
+ ```bash
56
+ bash scripts/run-smoke.sh "${DEPLOY_URL:-}" "${SMOKE_CHECKS_FILE:-smoke-checks.yaml}"
57
+ ```
49
58
 
50
- See [REFERENCE.md](REFERENCE.md)
59
+ The runner performs curl requests per check, records pass/fail per assertion, and prints a summary.
51
60
 
52
61
  ### 3. Assert results
53
62
 
54
- See [REFERENCE.md](REFERENCE.md)
63
+ - Any HTTP status mismatch → FAIL
64
+ - Missing `content_signal` when configured → FAIL
65
+ - Response time over `max_response_time_ms` → FAIL
66
+ - Exit code non-zero → deployment not healthy
55
67
 
56
68
  ### 4. Generate report
57
69
 
58
- See [REFERENCE.md](REFERENCE.md)
70
+ Capture stdout from `run-smoke.sh` as evidence. Persist to `specs/verifications/smoke-<date>.log` for release-branch.
59
71
 
60
72
  ## Integration with deploy skill
61
73
 
62
- The `deploy` skill references `smoke-test` as its final verification step:
63
-
64
74
  ```bash
65
- # In deploy workflow — after successful deploy
66
75
  DEPLOY_URL="$DEPLOY_URL" bash scripts/run-smoke.sh
67
76
  ```
68
77
 
78
+ ## Verify arc
79
+
80
+ Part of **★ VERIFY ★**: `verify-work` → `validate-contracts` → `smoke-test` → `run-evals` → `audit-code`
81
+
82
+ ## Verify
83
+
84
+ → verify: `test -x scripts/run-smoke.sh && grep -q 'run-smoke.sh' skills/smoke-test/SKILL.md && grep -qv 'See \[REFERENCE.md\]' skills/smoke-test/SKILL.md && echo OK`
@@ -1,5 +1,7 @@
1
+ # story: e80s02
1
2
  ---
2
3
  name: validate-contracts
4
+ phase: verify
3
5
  description: "Assert data shape consistency across system boundaries — live API responses against JSON Schema, key-set comparison across layers, data shape validation for migrations and exports. Catches silent data corruption before deploy."
4
6
  model: sonnet
5
7
  effort: standard
@@ -11,60 +13,30 @@ effort: standard
11
13
  >
12
14
  > **HARD GATE** — Contract files MUST be version-controlled alongside code. Outdated contracts are worse than no contracts. If a contract hasn't been reviewed in 30 days, flag it as stale.
13
15
 
14
- Validate that data structures stay in sync across system boundaries — front-end vs
15
- back-end, API responses vs expected schemas, config files vs code assumptions,
16
- migration output vs target shape.
16
+ Validate that data structures stay in sync across system boundaries — front-end vs back-end, API responses vs expected schemas, config files vs code assumptions, migration output vs target shape.
17
17
 
18
18
  ## Contract types
19
19
 
20
- Three modes of validation:
21
-
22
20
  | Mode | What it catches | When to use |
23
21
  |------|----------------|-------------|
24
- | **Schema** | API response shape mismatches (missing field, wrong type) | Before every deploy, after API changes |
22
+ | **Schema** | API response shape mismatches | Before every deploy, after API changes |
25
23
  | **Key-set** | Missing/unexpected keys across two data sources | Translation files, configs, enum definitions |
26
- | **Shape** | Column type or format violations in data files | After migrations, before consuming exports |
24
+ | **Shape** | Column type or format violations | After migrations, before consuming exports |
27
25
 
28
26
  ## Contract file convention
29
27
 
30
- All contract files live in `specs/contracts/` and use YAML:
31
-
32
- See [REFERENCE.md](REFERENCE.md) for examples.
33
-
34
- ### 1. API Response Contracts (`--schema`)
28
+ All contract files live in `specs/contracts/` as YAML. See [REFERENCE.md](REFERENCE.md) for extended examples.
35
29
 
36
- Define expected API response shapes and validate live endpoints against them:
30
+ ### Key-set example
37
31
 
38
- See [REFERENCE.md](REFERENCE.md) for examples.
39
-
40
- Usage:
41
-
42
- ```bash
43
- validate-contracts --schema specs/contracts/users.schema.yaml --url https://api.example.com/users
44
- # → PASS: /api/users matches expected schema (3/3 fields, types ok)
45
- # → FAIL: /api/users — field 'email' has type null (expected string)
32
+ ```yaml
33
+ # specs/contracts/i18n-keys.yaml
34
+ sources:
35
+ reference: src/locales/en.json
36
+ target: src/messages/en.json
37
+ mode: subset
46
38
  ```
47
39
 
48
- ### 2. Key-Set Contracts (`--key-set`)
49
-
50
- Assert that two data sources share a consistent set of keys:
51
-
52
- See [REFERENCE.md](REFERENCE.md) for examples.
53
-
54
- Usage:
55
-
56
- See [REFERENCE.md](REFERENCE.md) for examples.
57
-
58
- ### 3. Data Shape Contracts (`--shape`)
59
-
60
- Validate that a data file matches expected column types and constraints:
61
-
62
- See [REFERENCE.md](REFERENCE.md) for examples.
63
-
64
- Usage:
65
-
66
- See [REFERENCE.md](REFERENCE.md) for examples.
67
-
68
40
  ## Process
69
41
 
70
42
  ### 1. Define contract
@@ -74,29 +46,20 @@ Create a YAML file in `specs/contracts/` following the schema for the mode.
74
46
  ### 2. Run validation
75
47
 
76
48
  ```bash
77
- bash scripts/validate-contracts.sh <contract-file>
49
+ bash scripts/validate-contracts.sh specs/contracts/<contract>.yaml
78
50
  ```
79
51
 
80
- The runner auto-detects the contract type from the file content (presence of `schema:`,
81
- `sources:`, or `file:` + `fields:` keys).
52
+ The runner auto-detects key-set contracts (`sources:` block). Schema and shape modes are documented in REFERENCE.md for consumer projects.
82
53
 
83
54
  ### 3. Read the report
84
55
 
85
- Output is JSON Lines (one event per line) plus a human-readable summary:
86
-
87
56
  ```
88
- {"event":"pass","check":"users.schema","detail":"3/3 fields match types"}
89
- {"event":"warn","check":"users.schema","detail":"field 'avatar' has format: uri (unexpected)"}
90
- {"event":"fail","check":"i18n-keys","detail":"missing: 2 keys in target"}
57
+ PASS: key-set contract
58
+ # or
59
+ FAIL: key-set — N keys in reference missing from target
91
60
  ```
92
61
 
93
- Final summary:
94
-
95
- ```
96
- === Validate Contracts Summary ===
97
- Schema: 3/3 pass | Key-set: 1/1 fail | Shape: 2/2 pass
98
- FAILED: 1 contract has divergence
99
- ```
62
+ JSON Lines output for CI is planned for schema/shape modes; key-set failures exit non-zero.
100
63
 
101
64
  ### 4. Fix divergence
102
65
 
@@ -107,7 +70,13 @@ FAILED: 1 contract has divergence
107
70
  ### 5. Re-validate
108
71
 
109
72
  ```bash
110
- bash scripts/validate-contracts.sh <contract-file>
111
- # → All pass → ready to deploy
73
+ bash scripts/validate-contracts.sh specs/contracts/<contract>.yaml
112
74
  ```
113
75
 
76
+ ## Verify arc
77
+
78
+ Part of **★ VERIFY ★**: `verify-work` → `validate-contracts` → `smoke-test` → `run-evals` → `audit-code`
79
+
80
+ ## Verify
81
+
82
+ → verify: `test -x scripts/validate-contracts.sh && bash scripts/validate-contracts.sh --self-test && grep -q 'validate-contracts.sh' skills/validate-contracts/SKILL.md && echo OK`
@@ -0,0 +1,31 @@
1
+ # Generalize-fix (e80s04 / GH #98)
2
+
3
+ After local hardening in `validate-fix`, sweep the **defect class** across the codebase.
4
+
5
+ ## Steps
6
+
7
+ 1. **Classify** — name the pattern (e.g. `unscoped org query`, `fail-open verify`, `hardcoded package manager`).
8
+ 2. **Sweep** — grep for sibling instances; record `match_count` and `grep_pattern`.
9
+ 3. **Resolve** — patch all matches in this PR **or** file one tracking issue listing every remaining instance.
10
+ 4. **Artifact** — write sweep evidence before declaring done:
11
+
12
+ ```bash
13
+ cat > specs/verifications/generalize-sweep-BUG-YYYY-MM-DD-slug.json <<EOF
14
+ {
15
+ "defect_class": "fail-open-verify",
16
+ "grep_pattern": "\\\\|\\\\| echo",
17
+ "match_count": 0,
18
+ "sweep_scope": "skills/*/SKILL.md",
19
+ "patched_in_pr": [],
20
+ "tracked_issues": []
21
+ }
22
+ EOF
23
+ bash scripts/verify-generalize-sweep.sh specs/verifications/generalize-sweep-*.json
24
+ ```
25
+
26
+ ## Security classes
27
+
28
+ When the defect class is security- or gate-relevant:
29
+
30
+ - Add a row to `security-review` CWE fixture table (see `skills/security-review/SKILL.md` § CWE mapping mandate).
31
+ - If security-impact was MEDIUM+: add regression test, false-positive exclusion rule, and threat-model update (HIGH+).
@@ -1,3 +1,5 @@
1
+ # story: e80s01
2
+ # story: e80s04
1
3
  # story: e45s08
2
4
  ---
3
5
  name: validate-fix
@@ -7,7 +9,7 @@ description: Prove a fix works before declaring done — re-run the failing test
7
9
  ---
8
10
 
9
11
  # Validate Fix
10
- > **HARD GATE** — **HARD GATE** — Fix must not regress. Run full test suite and manual UAT before declaring success. A fix that passes tests but breaks something else is a failure.
12
+ > **HARD GATE** — Fix must not regress. Run full test suite and manual UAT before declaring success.
11
13
 
12
14
 
13
15
  Prove the fix works. "I think it works" is not evidence. Run the suite, show the output, then harden against recurrence.
@@ -65,10 +67,13 @@ For every bug fixed, add at least one prevention layer:
65
67
  - [ ] At least one hardening mechanism added
66
68
  - [ ] Hardening mechanism is tested
67
69
 
68
- > **Security recurrence hardening** — If the bug's security-impact assessment (from investigate-bug) was MEDIUM or higher, additionally check:
69
- > - [ ] Security regression test added (covers the exploit path)
70
- > - [ ] False-positive exclusion rule added (if applicable)
71
- > - [ ] Threat model updated (if impact was HIGH+)
70
+ ### 5b. Generalize-fix (HARD GATE — e80s04 / GH #98)
71
+
72
+ Sweep the **defect class** across the codebase after local hardening — see [REFERENCE-generalize-fix.md](REFERENCE-generalize-fix.md).
73
+
74
+ - [ ] Defect class documented (not just the one-line root cause)
75
+ - [ ] Grep sweep run and `match_count` recorded
76
+ - [ ] `verify-generalize-sweep.sh` passes on the artifact
72
77
 
73
78
  ### 6. Update the bug file and registry.yaml
74
79
 
@@ -107,3 +112,7 @@ Mechanical verification (tests passing) is only half the fix. You must prove **b
107
112
 
108
113
  Suggest next skill: `audit-code` → `commit-message`.
109
114
 
115
+ ## Verify
116
+
117
+ → verify: `grep -q 'generalize-fix' skills/validate-fix/SKILL.md && test -x scripts/verify-generalize-sweep.sh && bash scripts/verify-generalize-sweep.sh --self-test && echo OK`
118
+
package/skills-lock.json CHANGED
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "assess-impact": {
10
10
  "description": "Analyze the blast radius of a proposed change before any code is written. Maps dependents, affected stories, and test coverage. Produces specs/IMPACT_LATEST.md. Use before plan-work on any non-trivial change, when touching a shared module, or when the user asks \"what does this break?\".",
11
- "sha256": "5a443f358b8a2369",
11
+ "sha256": "4168a9484c4e7d30",
12
12
  "path": "skills/assess-impactSKILL.md"
13
13
  },
14
14
  "audit-code": {
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "develop-tdd": {
85
85
  "description": "Test-driven development with red-green-refactor loop using vertical slices. Use for features (epic tasks) or bugs (specs/bugs/BUG-*.md).",
86
- "sha256": "91928da1d9757094",
86
+ "sha256": "8b3934e2291b863d",
87
87
  "path": "skills/develop-tddSKILL.md"
88
88
  },
89
89
  "diagnose-root": {
@@ -113,7 +113,7 @@
113
113
  },
114
114
  "enforce-first": {
115
115
  "description": "Apply the F.I.R.S.T test quality rubric (per CONVENTIONS.md §Tests) to a test suite or individual tests. Use when develop-tdd is writing tests, when test quality needs to be checked, or when user mentions F.I.R.S.T or \"test quality\".",
116
- "sha256": "64cde2c5f741c77f",
116
+ "sha256": "1ec1183ee6377917",
117
117
  "path": "skills/enforce-firstSKILL.md"
118
118
  },
119
119
  "evolve-skill": {
@@ -143,7 +143,7 @@
143
143
  },
144
144
  "gate-trace": {
145
145
  "description": "\"Deterministic traceability quality gate — reads coverage matrix + blind-spot data, applies decision rules with oracle confidence downgrade, emits PASS/CONCERNS/FAIL/WAIVED verdict. Use before release-branch to gate merges on traceability.\"",
146
- "sha256": "dd52baa85ff939e8",
146
+ "sha256": "87e0c49ff90ec34c",
147
147
  "path": "skills/gate-traceSKILL.md"
148
148
  },
149
149
  "generate-allure-report": {
@@ -333,7 +333,7 @@
333
333
  },
334
334
  "smoke-test": {
335
335
  "description": "\"Post-deploy health-check against a live URL. Validates HTTP status, response content, and critical endpoints. Runnable standalone OR as the final step of the deploy skill.\"",
336
- "sha256": "664c11f36df51da8",
336
+ "sha256": "f75e9e57d4003209",
337
337
  "path": "skills/smoke-testSKILL.md"
338
338
  },
339
339
  "spike-prototype": {
@@ -368,12 +368,12 @@
368
368
  },
369
369
  "validate-contracts": {
370
370
  "description": "\"Assert data shape consistency across system boundaries — live API responses against JSON Schema, key-set comparison across layers, data shape validation for migrations and exports. Catches silent data corruption before deploy.\"",
371
- "sha256": "7d944527859c3c14",
371
+ "sha256": "d93c9ae2953ac457",
372
372
  "path": "skills/validate-contractsSKILL.md"
373
373
  },
374
374
  "validate-fix": {
375
375
  "description": "Prove a fix works before declaring done — re-run the failing test, run the full suite, typecheck, lint, and harden against recurrence. Use after implementing a bug fix, when user says \"is this fixed?\", or before closing an investigation.",
376
- "sha256": "e3a38b117a7f3b2d",
376
+ "sha256": "f94972af3fd48e3e",
377
377
  "path": "skills/validate-fixSKILL.md"
378
378
  },
379
379
  "verify-work": {