codex-genesis-harness 0.1.4 → 0.1.6

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 (153) hide show
  1. package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -216
  2. package/.codebase/CURRENT_STATE.md +9 -7
  3. package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -161
  4. package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -613
  5. package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -429
  6. package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -351
  7. package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -419
  8. package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -292
  9. package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -486
  10. package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -456
  11. package/.codebase/README.md +139 -139
  12. package/.codebase/RECOVERY_POINTS.md +438 -438
  13. package/.codebase/state.json +37 -0
  14. package/.codex/skills/genesis-api-sync/SKILL.md +354 -354
  15. package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -101
  16. package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -257
  17. package/.codex/skills/genesis-debug-guide/SKILL.md +479 -479
  18. package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -339
  19. package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -210
  20. package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -158
  21. package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -365
  22. package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -289
  23. package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -288
  24. package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -1003
  25. package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -359
  26. package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -312
  27. package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -382
  28. package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -851
  29. package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -491
  30. package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -187
  31. package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -297
  32. package/.codex/skills/genesis-harness/SKILL.md +1427 -1418
  33. package/.codex/skills/genesis-harness/agents/openai.yaml +7 -7
  34. package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -169
  35. package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -157
  36. package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -216
  37. package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -211
  38. package/.codex/skills/genesis-harness/references/planning-schema.md +35 -35
  39. package/.codex/skills/genesis-harness/references/quality-rubric.md +21 -21
  40. package/.codex/skills/genesis-harness/references/research-rubric.md +41 -41
  41. package/.codex/skills/genesis-harness/references/workflows.md +33 -33
  42. package/.codex/skills/genesis-harness/resources/agents-template.md +27 -27
  43. package/.codex/skills/genesis-harness/resources/api-docs-template.md +32 -32
  44. package/.codex/skills/genesis-harness/resources/architecture-template.md +30 -30
  45. package/.codex/skills/genesis-harness/resources/audit-template.md +26 -26
  46. package/.codex/skills/genesis-harness/resources/bug-template.md +34 -34
  47. package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -204
  48. package/.codex/skills/genesis-harness/resources/check-template.md +21 -21
  49. package/.codex/skills/genesis-harness/resources/conventions-template.md +42 -42
  50. package/.codex/skills/genesis-harness/resources/decision-template.md +33 -33
  51. package/.codex/skills/genesis-harness/resources/design-template.md +26 -26
  52. package/.codex/skills/genesis-harness/resources/escalation-template.md +21 -21
  53. package/.codex/skills/genesis-harness/resources/feature-template.md +49 -49
  54. package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -131
  55. package/.codex/skills/genesis-harness/resources/integrations-template.md +32 -32
  56. package/.codex/skills/genesis-harness/resources/journeys-template.md +13 -13
  57. package/.codex/skills/genesis-harness/resources/lessons-learned-template.md +12 -12
  58. package/.codex/skills/genesis-harness/resources/observability-template.md +34 -34
  59. package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -76
  60. package/.codex/skills/genesis-harness/resources/phase-template.md +34 -34
  61. package/.codex/skills/genesis-harness/resources/pitfalls-template.md +22 -22
  62. package/.codex/skills/genesis-harness/resources/planning-tree-template.md +39 -39
  63. package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -347
  64. package/.codex/skills/genesis-harness/resources/project-template.md +38 -38
  65. package/.codex/skills/genesis-harness/resources/quality-score-template.md +11 -11
  66. package/.codex/skills/genesis-harness/resources/requirements-template.md +26 -26
  67. package/.codex/skills/genesis-harness/resources/research-template.md +26 -26
  68. package/.codex/skills/genesis-harness/resources/review-template.md +22 -22
  69. package/.codex/skills/genesis-harness/resources/spec-changelog-template.md +6 -6
  70. package/.codex/skills/genesis-harness/resources/stack-template.md +33 -33
  71. package/.codex/skills/genesis-harness/resources/verification-template.md +26 -26
  72. package/.codex/skills/genesis-harness/scripts/check-architecture-boundaries.sh +0 -0
  73. package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +0 -0
  74. package/.codex/skills/genesis-harness/scripts/check-no-debug-logs.sh +0 -0
  75. package/.codex/skills/genesis-harness/scripts/check-required-planning-files.sh +0 -0
  76. package/.codex/skills/genesis-harness/scripts/check-spec-changelog.sh +0 -0
  77. package/.codex/skills/genesis-harness/scripts/check-task-tracking.sh +0 -0
  78. package/.codex/skills/genesis-harness/scripts/compact-context.sh +0 -0
  79. package/.codex/skills/genesis-harness/scripts/create-adr.sh +0 -0
  80. package/.codex/skills/genesis-harness/scripts/create-bug.sh +0 -0
  81. package/.codex/skills/genesis-harness/scripts/create-feature.sh +0 -0
  82. package/.codex/skills/genesis-harness/scripts/detect-stack.sh +0 -0
  83. package/.codex/skills/genesis-harness/scripts/init-planning.sh +0 -0
  84. package/.codex/skills/genesis-harness/scripts/list-changed-files.sh +0 -0
  85. package/.codex/skills/genesis-harness/scripts/offload-log.sh +0 -0
  86. package/.codex/skills/genesis-harness/scripts/run-verification.sh +0 -0
  87. package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +0 -0
  88. package/.codex/skills/genesis-harness/scripts/update-state.sh +0 -0
  89. package/.codex/skills/genesis-mvp-planning/SKILL.md +114 -0
  90. package/.codex/skills/genesis-mvp-planning/agents/openai.yaml +6 -0
  91. package/.codex/skills/genesis-mvp-planning/checklists/mvp-readiness.md +18 -0
  92. package/.codex/skills/genesis-mvp-planning/examples/5-phase-roadmap-example.md +43 -0
  93. package/.codex/skills/genesis-mvp-planning/templates/phase-1-core.md +17 -0
  94. package/.codex/skills/genesis-mvp-planning/templates/phase-2-auth.md +17 -0
  95. package/.codex/skills/genesis-mvp-planning/templates/phase-3-features.md +17 -0
  96. package/.codex/skills/genesis-mvp-planning/templates/phase-4-integrations.md +17 -0
  97. package/.codex/skills/genesis-mvp-planning/templates/phase-5-readiness.md +17 -0
  98. package/.codex/skills/genesis-new-design/agents/openai.yaml +3 -3
  99. package/.codex/skills/genesis-observability-automation/checklists/.gitkeep +0 -0
  100. package/.codex/skills/genesis-observability-automation/observability/.gitkeep +0 -0
  101. package/.codex/skills/genesis-observability-automation/playbooks/.gitkeep +0 -0
  102. package/.codex/skills/genesis-observability-automation/templates/.gitkeep +0 -0
  103. package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -653
  104. package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -274
  105. package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -220
  106. package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -253
  107. package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -472
  108. package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -494
  109. package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -303
  110. package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -420
  111. package/.codex/skills/genesis-research-first/SKILL.md +237 -237
  112. package/.codex/skills/genesis-research-first/templates/.gitkeep +0 -0
  113. package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -534
  114. package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -384
  115. package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -257
  116. package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -373
  117. package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -692
  118. package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -434
  119. package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -407
  120. package/.codex/skills/genesis-state-machine/SKILL.md +34 -0
  121. package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +3 -3
  122. package/.codex/skills/spec-impact-engine/SKILL.md +504 -504
  123. package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +0 -0
  124. package/.codex-plugin/plugin.json +24 -24
  125. package/CHANGELOG.md +42 -0
  126. package/LICENSE +22 -22
  127. package/README.EN.md +784 -719
  128. package/README.VI.md +776 -712
  129. package/README.md +113 -253
  130. package/VERSION +2 -2
  131. package/bin/genesis-harness.js +90 -87
  132. package/package.json +68 -43
  133. package/scripts/README.md +342 -342
  134. package/scripts/compact-context.sh +0 -0
  135. package/scripts/contract_integrity_gate.js +83 -0
  136. package/scripts/detect-changes.sh +0 -0
  137. package/scripts/healing_telemetry.js +118 -0
  138. package/scripts/install.sh +4 -1
  139. package/scripts/offload-log.sh +0 -0
  140. package/scripts/prompt_sentinel.js +84 -0
  141. package/scripts/run-evals.sh +1 -0
  142. package/scripts/run-verify-loop.sh +11 -0
  143. package/scripts/spec_visual_sync.js +157 -0
  144. package/scripts/test_generator.js +142 -0
  145. package/scripts/transition_state.sh +67 -0
  146. package/scripts/uninstall.sh +1 -0
  147. package/scripts/validation_gates.sh +85 -0
  148. package/scripts/verify.sh +5 -0
  149. package/tests/unit/contract_integrity_gate.test.js +74 -0
  150. package/tests/unit/healing_telemetry.test.js +58 -0
  151. package/tests/unit/prompt_sentinel.test.js +50 -0
  152. package/tests/unit/spec_visual_sync.test.js +77 -0
  153. package/tests/unit/test_generator.test.js +62 -0
package/scripts/README.md CHANGED
@@ -1,342 +1,342 @@
1
- # Scripts Reference
2
-
3
- Utility scripts for verifying, testing, and managing the Genesis Harness project.
4
-
5
- ## Quick Start
6
-
7
- ```bash
8
- # First time setup
9
- ./scripts/install.sh
10
-
11
- # Verify everything works
12
- ./scripts/verify.sh
13
-
14
- # Before PR submission
15
- npm run verify && npm run eval && npm run pack:check
16
- ```
17
-
18
- ## Scripts
19
-
20
- ### install.sh
21
-
22
- **Purpose**: Install Genesis Harness skills and dependencies
23
-
24
- **When to run**:
25
- - First time setting up the project
26
- - After cloning the repository
27
- - When adding new skills
28
-
29
- **What it does**:
30
- - Copies skills to `~/.codex/skills/`
31
- - Installs npm dependencies
32
- - Sets up environment paths
33
- - Validates installation
34
-
35
- **Usage**:
36
- ```bash
37
- # Default installation
38
- ./scripts/install.sh
39
-
40
- # Custom homes
41
- CODEX_HOME=/path/to/.codex ./scripts/install.sh
42
- GENESIS_HARNESS_HOME=/path/to/.agents ./scripts/install.sh
43
-
44
- # Skip postinstall
45
- GENESIS_HARNESS_SKIP_POSTINSTALL=1 npm install -g codex-genesis-harness@latest
46
- ```
47
-
48
- **Success indicator**: "Installation complete" message, no errors
49
-
50
- ---
51
-
52
- ### verify.sh
53
-
54
- **Purpose**: Run all verification checks
55
-
56
- **When to run**:
57
- - After making code changes
58
- - Before submitting a PR (REQUIRED)
59
- - When debugging test failures
60
- - During development cycles
61
-
62
- **What it does**:
63
- - Runs all unit tests
64
- - Runs all integration tests
65
- - Checks TypeScript compilation
66
- - Validates contract schemas
67
- - Checks for linting errors
68
- - Verifies package integrity
69
-
70
- **Usage**:
71
- ```bash
72
- # Verify project root
73
- ./scripts/verify.sh
74
-
75
- # Verify installed copy
76
- ./scripts/verify.sh ~/.codex/skills
77
-
78
- # Run specific test type
79
- npm run verify:unit
80
- npm run verify:integration
81
- npm run verify:e2e
82
- ```
83
-
84
- **Success indicator**: "✓ All checks passed", exit code 0
85
-
86
- **Common issues**:
87
- - Test failures → Fix code, re-run
88
- - Schema validation errors → Update contracts
89
- - TypeScript errors → Fix type issues
90
-
91
- ---
92
-
93
- ### run-evals.sh
94
-
95
- **Purpose**: Run evaluation suite for coverage and quality metrics
96
-
97
- **When to run**:
98
- - Before final PR submission
99
- - During sprint reviews
100
- - When verifying coverage meets 80%
101
- - Performance benchmarking
102
-
103
- **What it does**:
104
- - Measures test coverage (target: 80%+)
105
- - Runs performance benchmarks
106
- - Checks code complexity
107
- - Validates fixture integrity
108
- - Generates coverage reports
109
-
110
- **Usage**:
111
- ```bash
112
- # Run full evaluation
113
- ./scripts/run-evals.sh
114
-
115
- # Run specific evaluation
116
- npm run eval:coverage
117
- npm run eval:performance
118
- npm run eval:complexity
119
- ```
120
-
121
- **Output**: Coverage report, performance metrics, complexity analysis
122
-
123
- **Success indicator**: Coverage 80%+, no performance regressions
124
-
125
- ---
126
-
127
- ### npm Commands
128
-
129
- These are defined in `package.json` and run via npm.
130
-
131
- #### npm run verify
132
-
133
- **Alias**: `./scripts/verify.sh`
134
-
135
- Runs all verification checks. **Use this before every PR.**
136
-
137
- ```bash
138
- npm run verify
139
- ```
140
-
141
- ---
142
-
143
- #### npm run eval
144
-
145
- **Alias**: `./scripts/run-evals.sh`
146
-
147
- Runs evaluation suite. Check coverage and quality metrics.
148
-
149
- ```bash
150
- npm run eval
151
- ```
152
-
153
- ---
154
-
155
- #### npm run pack:check
156
-
157
- **Purpose**: Verify package will publish correctly
158
-
159
- **When to run**:
160
- - Before publishing to npm
161
- - Before PR submission
162
- - When package.json changes
163
-
164
- **What it does**:
165
- - Simulates npm publish
166
- - Validates all files in package
167
- - Checks naming and metadata
168
- - Verifies no secrets exposed
169
-
170
- **Usage**:
171
- ```bash
172
- npm run pack:check
173
- ```
174
-
175
- **Success indicator**: "✓ Package ready for publish", exit code 0
176
-
177
- ---
178
-
179
- ## Typical Development Workflow
180
-
181
- ### 1. Start a Feature
182
-
183
- ```bash
184
- ./scripts/install.sh # If first time
185
- ./scripts/verify.sh # Baseline check
186
- ```
187
-
188
- ### 2. Make Changes
189
-
190
- Write code, tests, update contracts.
191
-
192
- ### 3. Verify Locally
193
-
194
- ```bash
195
- ./scripts/verify.sh # All tests pass
196
- npm run eval # Coverage 80%+
197
- ```
198
-
199
- ### 4. Before PR
200
-
201
- ```bash
202
- ./scripts/verify.sh # Final verification
203
- npm run eval # Final coverage check
204
- npm run pack:check # Package integrity
205
- ```
206
-
207
- ### 5. After Merge
208
-
209
- ```bash
210
- ./scripts/install.sh # Re-install with new code
211
- ./scripts/verify.sh # Validate in production paths
212
- ```
213
-
214
- ---
215
-
216
- ## Debugging Failed Scripts
217
-
218
- ### Verify Script Fails
219
-
220
- **Check test output**:
221
- ```bash
222
- npm test 2>&1 | tail -50 # Last 50 lines of output
223
- ```
224
-
225
- **Run single test**:
226
- ```bash
227
- npm run test -- --testNamePattern="specific test"
228
- ```
229
-
230
- **Run test file**:
231
- ```bash
232
- npm run test tests/unit/my-feature.test.md
233
- ```
234
-
235
- ### Eval Script Fails
236
-
237
- **Check coverage only**:
238
- ```bash
239
- npm run eval:coverage
240
- ```
241
-
242
- **Check specific metric**:
243
- ```bash
244
- npm run eval:performance
245
- ```
246
-
247
- ### Pack Check Fails
248
-
249
- **Check what's included**:
250
- ```bash
251
- npm pack --dry-run | head -100
252
- ```
253
-
254
- **Check for secrets**:
255
- ```bash
256
- grep -r "API_KEY\|SECRET\|password" . --exclude-dir=node_modules
257
- ```
258
-
259
- ---
260
-
261
- ## Environment Variables
262
-
263
- Control script behavior:
264
-
265
- ```bash
266
- # Skip postinstall during npm install
267
- GENESIS_HARNESS_SKIP_POSTINSTALL=1
268
-
269
- # Custom skill installation paths
270
- CODEX_HOME=/path/to/.codex
271
- GENESIS_HARNESS_HOME=/path/to/.agents
272
-
273
- # Enable verbose output
274
- DEBUG=*
275
-
276
- # Set Node version
277
- NODE_VERSION=18.0.0
278
- ```
279
-
280
- ---
281
-
282
- ## Manual Verification
283
-
284
- If scripts fail, verify manually:
285
-
286
- ```bash
287
- # Check Node version
288
- node --version # Should be 18+
289
-
290
- # Check npm modules installed
291
- npm ls # Should have no errors
292
-
293
- # List test files
294
- find tests -name "*.test.md" -type f
295
-
296
- # Count coverage
297
- find . -name "coverage" -type d
298
- ```
299
-
300
- ---
301
-
302
- ## Performance Tips
303
-
304
- **Faster local development**:
305
- ```bash
306
- # Skip e2e tests during development
307
- npm run verify:unit
308
- npm run verify:integration
309
-
310
- # Then run full verify before PR:
311
- npm run verify
312
- ```
313
-
314
- **Cache improvements**:
315
- ```bash
316
- # Clear npm cache
317
- npm cache clean --force
318
-
319
- # Reinstall
320
- ./scripts/install.sh
321
- ```
322
-
323
- ---
324
-
325
- ## Continuous Integration
326
-
327
- These scripts run in CI/CD:
328
-
329
- 1. `npm install` - Install dependencies
330
- 2. `npm run verify` - All checks must pass
331
- 3. `npm run eval` - Coverage and quality metrics
332
- 4. `npm run pack:check` - Package integrity
333
-
334
- **Failed CI blocks PR merge.** Fix locally before pushing.
335
-
336
- ---
337
-
338
- ## Support
339
-
340
- - Script errors? → Check exit code with `echo $?`
341
- - Still failing? → Read full output, not just errors
342
- - Clear cache and try again: `npm cache clean --force && ./scripts/install.sh`
1
+ # Scripts Reference
2
+
3
+ Utility scripts for verifying, testing, and managing the Genesis Harness project.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # First time setup
9
+ ./scripts/install.sh
10
+
11
+ # Verify everything works
12
+ ./scripts/verify.sh
13
+
14
+ # Before PR submission
15
+ npm run verify && npm run eval && npm run pack:check
16
+ ```
17
+
18
+ ## Scripts
19
+
20
+ ### install.sh
21
+
22
+ **Purpose**: Install Genesis Harness skills and dependencies
23
+
24
+ **When to run**:
25
+ - First time setting up the project
26
+ - After cloning the repository
27
+ - When adding new skills
28
+
29
+ **What it does**:
30
+ - Copies skills to `~/.codex/skills/`
31
+ - Installs npm dependencies
32
+ - Sets up environment paths
33
+ - Validates installation
34
+
35
+ **Usage**:
36
+ ```bash
37
+ # Default installation
38
+ ./scripts/install.sh
39
+
40
+ # Custom homes
41
+ CODEX_HOME=/path/to/.codex ./scripts/install.sh
42
+ GENESIS_HARNESS_HOME=/path/to/.agents ./scripts/install.sh
43
+
44
+ # Skip postinstall
45
+ GENESIS_HARNESS_SKIP_POSTINSTALL=1 npm install -g codex-genesis-harness@latest
46
+ ```
47
+
48
+ **Success indicator**: "Installation complete" message, no errors
49
+
50
+ ---
51
+
52
+ ### verify.sh
53
+
54
+ **Purpose**: Run all verification checks
55
+
56
+ **When to run**:
57
+ - After making code changes
58
+ - Before submitting a PR (REQUIRED)
59
+ - When debugging test failures
60
+ - During development cycles
61
+
62
+ **What it does**:
63
+ - Runs all unit tests
64
+ - Runs all integration tests
65
+ - Checks TypeScript compilation
66
+ - Validates contract schemas
67
+ - Checks for linting errors
68
+ - Verifies package integrity
69
+
70
+ **Usage**:
71
+ ```bash
72
+ # Verify project root
73
+ ./scripts/verify.sh
74
+
75
+ # Verify installed copy
76
+ ./scripts/verify.sh ~/.codex/skills
77
+
78
+ # Run specific test type
79
+ npm run verify:unit
80
+ npm run verify:integration
81
+ npm run verify:e2e
82
+ ```
83
+
84
+ **Success indicator**: "✓ All checks passed", exit code 0
85
+
86
+ **Common issues**:
87
+ - Test failures → Fix code, re-run
88
+ - Schema validation errors → Update contracts
89
+ - TypeScript errors → Fix type issues
90
+
91
+ ---
92
+
93
+ ### run-evals.sh
94
+
95
+ **Purpose**: Run evaluation suite for coverage and quality metrics
96
+
97
+ **When to run**:
98
+ - Before final PR submission
99
+ - During sprint reviews
100
+ - When verifying coverage meets 80%
101
+ - Performance benchmarking
102
+
103
+ **What it does**:
104
+ - Measures test coverage (target: 80%+)
105
+ - Runs performance benchmarks
106
+ - Checks code complexity
107
+ - Validates fixture integrity
108
+ - Generates coverage reports
109
+
110
+ **Usage**:
111
+ ```bash
112
+ # Run full evaluation
113
+ ./scripts/run-evals.sh
114
+
115
+ # Run specific evaluation
116
+ npm run eval:coverage
117
+ npm run eval:performance
118
+ npm run eval:complexity
119
+ ```
120
+
121
+ **Output**: Coverage report, performance metrics, complexity analysis
122
+
123
+ **Success indicator**: Coverage 80%+, no performance regressions
124
+
125
+ ---
126
+
127
+ ### npm Commands
128
+
129
+ These are defined in `package.json` and run via npm.
130
+
131
+ #### npm run verify
132
+
133
+ **Alias**: `./scripts/verify.sh`
134
+
135
+ Runs all verification checks. **Use this before every PR.**
136
+
137
+ ```bash
138
+ npm run verify
139
+ ```
140
+
141
+ ---
142
+
143
+ #### npm run eval
144
+
145
+ **Alias**: `./scripts/run-evals.sh`
146
+
147
+ Runs evaluation suite. Check coverage and quality metrics.
148
+
149
+ ```bash
150
+ npm run eval
151
+ ```
152
+
153
+ ---
154
+
155
+ #### npm run pack:check
156
+
157
+ **Purpose**: Verify package will publish correctly
158
+
159
+ **When to run**:
160
+ - Before publishing to npm
161
+ - Before PR submission
162
+ - When package.json changes
163
+
164
+ **What it does**:
165
+ - Simulates npm publish
166
+ - Validates all files in package
167
+ - Checks naming and metadata
168
+ - Verifies no secrets exposed
169
+
170
+ **Usage**:
171
+ ```bash
172
+ npm run pack:check
173
+ ```
174
+
175
+ **Success indicator**: "✓ Package ready for publish", exit code 0
176
+
177
+ ---
178
+
179
+ ## Typical Development Workflow
180
+
181
+ ### 1. Start a Feature
182
+
183
+ ```bash
184
+ ./scripts/install.sh # If first time
185
+ ./scripts/verify.sh # Baseline check
186
+ ```
187
+
188
+ ### 2. Make Changes
189
+
190
+ Write code, tests, update contracts.
191
+
192
+ ### 3. Verify Locally
193
+
194
+ ```bash
195
+ ./scripts/verify.sh # All tests pass
196
+ npm run eval # Coverage 80%+
197
+ ```
198
+
199
+ ### 4. Before PR
200
+
201
+ ```bash
202
+ ./scripts/verify.sh # Final verification
203
+ npm run eval # Final coverage check
204
+ npm run pack:check # Package integrity
205
+ ```
206
+
207
+ ### 5. After Merge
208
+
209
+ ```bash
210
+ ./scripts/install.sh # Re-install with new code
211
+ ./scripts/verify.sh # Validate in production paths
212
+ ```
213
+
214
+ ---
215
+
216
+ ## Debugging Failed Scripts
217
+
218
+ ### Verify Script Fails
219
+
220
+ **Check test output**:
221
+ ```bash
222
+ npm test 2>&1 | tail -50 # Last 50 lines of output
223
+ ```
224
+
225
+ **Run single test**:
226
+ ```bash
227
+ npm run test -- --testNamePattern="specific test"
228
+ ```
229
+
230
+ **Run test file**:
231
+ ```bash
232
+ npm run test tests/unit/my-feature.test.md
233
+ ```
234
+
235
+ ### Eval Script Fails
236
+
237
+ **Check coverage only**:
238
+ ```bash
239
+ npm run eval:coverage
240
+ ```
241
+
242
+ **Check specific metric**:
243
+ ```bash
244
+ npm run eval:performance
245
+ ```
246
+
247
+ ### Pack Check Fails
248
+
249
+ **Check what's included**:
250
+ ```bash
251
+ npm pack --dry-run | head -100
252
+ ```
253
+
254
+ **Check for secrets**:
255
+ ```bash
256
+ grep -r "API_KEY\|SECRET\|password" . --exclude-dir=node_modules
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Environment Variables
262
+
263
+ Control script behavior:
264
+
265
+ ```bash
266
+ # Skip postinstall during npm install
267
+ GENESIS_HARNESS_SKIP_POSTINSTALL=1
268
+
269
+ # Custom skill installation paths
270
+ CODEX_HOME=/path/to/.codex
271
+ GENESIS_HARNESS_HOME=/path/to/.agents
272
+
273
+ # Enable verbose output
274
+ DEBUG=*
275
+
276
+ # Set Node version
277
+ NODE_VERSION=18.0.0
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Manual Verification
283
+
284
+ If scripts fail, verify manually:
285
+
286
+ ```bash
287
+ # Check Node version
288
+ node --version # Should be 18+
289
+
290
+ # Check npm modules installed
291
+ npm ls # Should have no errors
292
+
293
+ # List test files
294
+ find tests -name "*.test.md" -type f
295
+
296
+ # Count coverage
297
+ find . -name "coverage" -type d
298
+ ```
299
+
300
+ ---
301
+
302
+ ## Performance Tips
303
+
304
+ **Faster local development**:
305
+ ```bash
306
+ # Skip e2e tests during development
307
+ npm run verify:unit
308
+ npm run verify:integration
309
+
310
+ # Then run full verify before PR:
311
+ npm run verify
312
+ ```
313
+
314
+ **Cache improvements**:
315
+ ```bash
316
+ # Clear npm cache
317
+ npm cache clean --force
318
+
319
+ # Reinstall
320
+ ./scripts/install.sh
321
+ ```
322
+
323
+ ---
324
+
325
+ ## Continuous Integration
326
+
327
+ These scripts run in CI/CD:
328
+
329
+ 1. `npm install` - Install dependencies
330
+ 2. `npm run verify` - All checks must pass
331
+ 3. `npm run eval` - Coverage and quality metrics
332
+ 4. `npm run pack:check` - Package integrity
333
+
334
+ **Failed CI blocks PR merge.** Fix locally before pushing.
335
+
336
+ ---
337
+
338
+ ## Support
339
+
340
+ - Script errors? → Check exit code with `echo $?`
341
+ - Still failing? → Read full output, not just errors
342
+ - Clear cache and try again: `npm cache clean --force && ./scripts/install.sh`
File without changes