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.
- package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -216
- package/.codebase/CURRENT_STATE.md +9 -7
- package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -161
- package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -613
- package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -429
- package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -351
- package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -419
- package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -292
- package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -486
- package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -456
- package/.codebase/README.md +139 -139
- package/.codebase/RECOVERY_POINTS.md +438 -438
- package/.codebase/state.json +37 -0
- package/.codex/skills/genesis-api-sync/SKILL.md +354 -354
- package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -101
- package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -257
- package/.codex/skills/genesis-debug-guide/SKILL.md +479 -479
- package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -339
- package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -210
- package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -158
- package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -365
- package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -289
- package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -288
- package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -1003
- package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -359
- package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -312
- package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -382
- package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -851
- package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -491
- package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -187
- package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -297
- package/.codex/skills/genesis-harness/SKILL.md +1427 -1418
- package/.codex/skills/genesis-harness/agents/openai.yaml +7 -7
- package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -169
- package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -157
- package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -216
- package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -211
- package/.codex/skills/genesis-harness/references/planning-schema.md +35 -35
- package/.codex/skills/genesis-harness/references/quality-rubric.md +21 -21
- package/.codex/skills/genesis-harness/references/research-rubric.md +41 -41
- package/.codex/skills/genesis-harness/references/workflows.md +33 -33
- package/.codex/skills/genesis-harness/resources/agents-template.md +27 -27
- package/.codex/skills/genesis-harness/resources/api-docs-template.md +32 -32
- package/.codex/skills/genesis-harness/resources/architecture-template.md +30 -30
- package/.codex/skills/genesis-harness/resources/audit-template.md +26 -26
- package/.codex/skills/genesis-harness/resources/bug-template.md +34 -34
- package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -204
- package/.codex/skills/genesis-harness/resources/check-template.md +21 -21
- package/.codex/skills/genesis-harness/resources/conventions-template.md +42 -42
- package/.codex/skills/genesis-harness/resources/decision-template.md +33 -33
- package/.codex/skills/genesis-harness/resources/design-template.md +26 -26
- package/.codex/skills/genesis-harness/resources/escalation-template.md +21 -21
- package/.codex/skills/genesis-harness/resources/feature-template.md +49 -49
- package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -131
- package/.codex/skills/genesis-harness/resources/integrations-template.md +32 -32
- package/.codex/skills/genesis-harness/resources/journeys-template.md +13 -13
- package/.codex/skills/genesis-harness/resources/lessons-learned-template.md +12 -12
- package/.codex/skills/genesis-harness/resources/observability-template.md +34 -34
- package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -76
- package/.codex/skills/genesis-harness/resources/phase-template.md +34 -34
- package/.codex/skills/genesis-harness/resources/pitfalls-template.md +22 -22
- package/.codex/skills/genesis-harness/resources/planning-tree-template.md +39 -39
- package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -347
- package/.codex/skills/genesis-harness/resources/project-template.md +38 -38
- package/.codex/skills/genesis-harness/resources/quality-score-template.md +11 -11
- package/.codex/skills/genesis-harness/resources/requirements-template.md +26 -26
- package/.codex/skills/genesis-harness/resources/research-template.md +26 -26
- package/.codex/skills/genesis-harness/resources/review-template.md +22 -22
- package/.codex/skills/genesis-harness/resources/spec-changelog-template.md +6 -6
- package/.codex/skills/genesis-harness/resources/stack-template.md +33 -33
- package/.codex/skills/genesis-harness/resources/verification-template.md +26 -26
- package/.codex/skills/genesis-harness/scripts/check-architecture-boundaries.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/check-no-debug-logs.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/check-required-planning-files.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/check-spec-changelog.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/check-task-tracking.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/compact-context.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/create-adr.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/create-bug.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/create-feature.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/detect-stack.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/init-planning.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/list-changed-files.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/offload-log.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/run-verification.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +0 -0
- package/.codex/skills/genesis-harness/scripts/update-state.sh +0 -0
- package/.codex/skills/genesis-mvp-planning/SKILL.md +114 -0
- package/.codex/skills/genesis-mvp-planning/agents/openai.yaml +6 -0
- package/.codex/skills/genesis-mvp-planning/checklists/mvp-readiness.md +18 -0
- package/.codex/skills/genesis-mvp-planning/examples/5-phase-roadmap-example.md +43 -0
- package/.codex/skills/genesis-mvp-planning/templates/phase-1-core.md +17 -0
- package/.codex/skills/genesis-mvp-planning/templates/phase-2-auth.md +17 -0
- package/.codex/skills/genesis-mvp-planning/templates/phase-3-features.md +17 -0
- package/.codex/skills/genesis-mvp-planning/templates/phase-4-integrations.md +17 -0
- package/.codex/skills/genesis-mvp-planning/templates/phase-5-readiness.md +17 -0
- package/.codex/skills/genesis-new-design/agents/openai.yaml +3 -3
- package/.codex/skills/genesis-observability-automation/checklists/.gitkeep +0 -0
- package/.codex/skills/genesis-observability-automation/observability/.gitkeep +0 -0
- package/.codex/skills/genesis-observability-automation/playbooks/.gitkeep +0 -0
- package/.codex/skills/genesis-observability-automation/templates/.gitkeep +0 -0
- package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -653
- package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -274
- package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -220
- package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -253
- package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -472
- package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -494
- package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -303
- package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -420
- package/.codex/skills/genesis-research-first/SKILL.md +237 -237
- package/.codex/skills/genesis-research-first/templates/.gitkeep +0 -0
- package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -534
- package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -384
- package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -257
- package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -373
- package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -692
- package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -434
- package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -407
- package/.codex/skills/genesis-state-machine/SKILL.md +34 -0
- package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +3 -3
- package/.codex/skills/spec-impact-engine/SKILL.md +504 -504
- package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +0 -0
- package/.codex-plugin/plugin.json +24 -24
- package/CHANGELOG.md +42 -0
- package/LICENSE +22 -22
- package/README.EN.md +784 -719
- package/README.VI.md +776 -712
- package/README.md +113 -253
- package/VERSION +2 -2
- package/bin/genesis-harness.js +90 -87
- package/package.json +68 -43
- package/scripts/README.md +342 -342
- package/scripts/compact-context.sh +0 -0
- package/scripts/contract_integrity_gate.js +83 -0
- package/scripts/detect-changes.sh +0 -0
- package/scripts/healing_telemetry.js +118 -0
- package/scripts/install.sh +4 -1
- package/scripts/offload-log.sh +0 -0
- package/scripts/prompt_sentinel.js +84 -0
- package/scripts/run-evals.sh +1 -0
- package/scripts/run-verify-loop.sh +11 -0
- package/scripts/spec_visual_sync.js +157 -0
- package/scripts/test_generator.js +142 -0
- package/scripts/transition_state.sh +67 -0
- package/scripts/uninstall.sh +1 -0
- package/scripts/validation_gates.sh +85 -0
- package/scripts/verify.sh +5 -0
- package/tests/unit/contract_integrity_gate.test.js +74 -0
- package/tests/unit/healing_telemetry.test.js +58 -0
- package/tests/unit/prompt_sentinel.test.js +50 -0
- package/tests/unit/spec_visual_sync.test.js +77 -0
- package/tests/unit/test_generator.test.js +62 -0
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
# Test Failure Debug Checklist
|
|
2
|
-
|
|
3
|
-
**Purpose**: Systematic verification before debugging test failures. Ensures test environment is clean and failure is reproducible.
|
|
4
|
-
|
|
5
|
-
**Status**: MANDATORY - Complete before starting test failure investigation.
|
|
6
|
-
|
|
7
|
-
## Environment Verification
|
|
8
|
-
|
|
9
|
-
- [ ] **Test runs in isolation**:
|
|
10
|
-
- Run only the failing test: `npm test -- test-name.test.js`
|
|
11
|
-
- Not running entire suite (could be interference)
|
|
12
|
-
- Confirm single test failure is reproducible
|
|
13
|
-
|
|
14
|
-
- [ ] **No environment contamination**:
|
|
15
|
-
- Git status clean (`git status` shows no uncommitted changes)
|
|
16
|
-
- No stale debug code or console.log statements
|
|
17
|
-
- Dependencies up to date (`npm install` recent)
|
|
18
|
-
- Node version correct (check `.nvmrc` or `package.json`)
|
|
19
|
-
|
|
20
|
-
- [ ] **Test environment isolated**:
|
|
21
|
-
- No other tests running in parallel
|
|
22
|
-
- No file system state from previous tests
|
|
23
|
-
- Database fixtures clean
|
|
24
|
-
- Cache cleared if applicable
|
|
25
|
-
|
|
26
|
-
## Test Fundamentals
|
|
27
|
-
|
|
28
|
-
- [ ] **Test is deterministic** (not flaky):
|
|
29
|
-
- Run test 5 times consecutively
|
|
30
|
-
- Fails same way every time
|
|
31
|
-
- If fails inconsistently → switch to flaky-test-investigation.md
|
|
32
|
-
|
|
33
|
-
- [ ] **Error message is clear**:
|
|
34
|
-
- Full error read (including stack trace)
|
|
35
|
-
- Assertion message understood
|
|
36
|
-
- Expected vs actual values noted
|
|
37
|
-
|
|
38
|
-
- [ ] **Reproduction steps documented**:
|
|
39
|
-
- Steps to run failing test written down
|
|
40
|
-
- Any preconditions noted
|
|
41
|
-
- Environment variables documented
|
|
42
|
-
|
|
43
|
-
## Test Code Analysis
|
|
44
|
-
|
|
45
|
-
- [ ] **Test structure is correct**:
|
|
46
|
-
- Setup (arrange): Test data initialized
|
|
47
|
-
- Execution (act): Function called with test data
|
|
48
|
-
- Assertion (assert): Result verified
|
|
49
|
-
- Teardown: Resources cleaned up
|
|
50
|
-
|
|
51
|
-
- [ ] **Mocks are properly configured**:
|
|
52
|
-
- All external dependencies mocked
|
|
53
|
-
- Mock return values match expectations
|
|
54
|
-
- Mock call counts/arguments verified
|
|
55
|
-
- Mocks reset between tests
|
|
56
|
-
|
|
57
|
-
- [ ] **Test data is valid**:
|
|
58
|
-
- Test fixtures exist
|
|
59
|
-
- Data types correct (number, string, array, object)
|
|
60
|
-
- Null/undefined not unexpected
|
|
61
|
-
- Edge cases considered
|
|
62
|
-
|
|
63
|
-
## Implementation Analysis
|
|
64
|
-
|
|
65
|
-
- [ ] **Code under test identified**:
|
|
66
|
-
- Exact function/method being tested known
|
|
67
|
-
- File location noted
|
|
68
|
-
- Recent changes reviewed (git blame)
|
|
69
|
-
|
|
70
|
-
- [ ] **Code logic reviewed**:
|
|
71
|
-
- Function parameters match test call
|
|
72
|
-
- Return type matches assertion
|
|
73
|
-
- No type mismatches
|
|
74
|
-
- Null checks in place
|
|
75
|
-
|
|
76
|
-
- [ ] **Dependency chain checked**:
|
|
77
|
-
- All imported modules exist
|
|
78
|
-
- No circular dependencies
|
|
79
|
-
- Versions compatible
|
|
80
|
-
- Initialization order correct
|
|
81
|
-
|
|
82
|
-
## Debug Information Gathering
|
|
83
|
-
|
|
84
|
-
- [ ] **Error output analyzed**:
|
|
85
|
-
- Stack trace followed to root
|
|
86
|
-
- Line number in error matches code
|
|
87
|
-
- Message matches code (not outdated?)
|
|
88
|
-
- All context (variables, state) logged
|
|
89
|
-
|
|
90
|
-
- [ ] **Variable values inspected**:
|
|
91
|
-
- Expected value printed
|
|
92
|
-
- Actual value printed
|
|
93
|
-
- Types match
|
|
94
|
-
- Data structure as expected
|
|
95
|
-
|
|
96
|
-
- [ ] **Scope issues checked**:
|
|
97
|
-
- Variable in correct scope
|
|
98
|
-
- Not undefined when used
|
|
99
|
-
- Reference vs value semantics correct
|
|
100
|
-
- Closure capturing right variables
|
|
101
|
-
|
|
102
|
-
## Common Issues Ruled Out
|
|
103
|
-
|
|
104
|
-
- [ ] **Not a typo**:
|
|
105
|
-
- Function name spelled correctly
|
|
106
|
-
- Variable name matches
|
|
107
|
-
- No case sensitivity issues
|
|
108
|
-
- Import path correct
|
|
109
|
-
|
|
110
|
-
- [ ] **Not an import issue**:
|
|
111
|
-
- Module imported correctly
|
|
112
|
-
- Correct export used (default vs named)
|
|
113
|
-
- Path relative or absolute correct
|
|
114
|
-
- No circular imports
|
|
115
|
-
|
|
116
|
-
- [ ] **Not a timing issue** (for async):
|
|
117
|
-
- Promises/callbacks not mixed
|
|
118
|
-
- Async/await used correctly
|
|
119
|
-
- Test waits for async operations
|
|
120
|
-
- No race conditions
|
|
121
|
-
|
|
122
|
-
## Ready to Debug
|
|
123
|
-
|
|
124
|
-
- [ ] All checks above passed
|
|
125
|
-
- [ ] Investigation log created (templates/debug-investigation-log.md)
|
|
126
|
-
- [ ] Ready to proceed with playbook:
|
|
127
|
-
- Unit tests → playbooks/unit-test-failures.md
|
|
128
|
-
- Integration tests → playbooks/integration-test-failures.md
|
|
129
|
-
- E2E tests → playbooks/e2e-test-failures.md
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Usage
|
|
134
|
-
|
|
135
|
-
Before investigating test failure:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# 1. Run test in isolation
|
|
139
|
-
npm test -- NameOfTest.test.js
|
|
140
|
-
|
|
141
|
-
# 2. Complete this checklist
|
|
142
|
-
cat .codex/skills/genesis-debug-guide/checklists/test-failure-debug.md
|
|
143
|
-
|
|
144
|
-
# 3. Select appropriate playbook
|
|
145
|
-
# - Unit: playbooks/unit-test-failures.md
|
|
146
|
-
# - Integration: playbooks/integration-test-failures.md
|
|
147
|
-
# - E2E: playbooks/e2e-test-failures.md
|
|
148
|
-
|
|
149
|
-
# 4. Create investigation log
|
|
150
|
-
# cp templates/debug-investigation-log.md observability/failures/investigation-$(date +%s).md
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## Notes
|
|
154
|
-
|
|
155
|
-
- Don't skip environment verification - most failures are environmental
|
|
156
|
-
- If test fails intermittently → See flaky-test-investigation.md
|
|
157
|
-
- If multiple tests fail → Check test isolation first
|
|
158
|
-
- If all tests fail → Check environment/dependencies
|
|
1
|
+
# Test Failure Debug Checklist
|
|
2
|
+
|
|
3
|
+
**Purpose**: Systematic verification before debugging test failures. Ensures test environment is clean and failure is reproducible.
|
|
4
|
+
|
|
5
|
+
**Status**: MANDATORY - Complete before starting test failure investigation.
|
|
6
|
+
|
|
7
|
+
## Environment Verification
|
|
8
|
+
|
|
9
|
+
- [ ] **Test runs in isolation**:
|
|
10
|
+
- Run only the failing test: `npm test -- test-name.test.js`
|
|
11
|
+
- Not running entire suite (could be interference)
|
|
12
|
+
- Confirm single test failure is reproducible
|
|
13
|
+
|
|
14
|
+
- [ ] **No environment contamination**:
|
|
15
|
+
- Git status clean (`git status` shows no uncommitted changes)
|
|
16
|
+
- No stale debug code or console.log statements
|
|
17
|
+
- Dependencies up to date (`npm install` recent)
|
|
18
|
+
- Node version correct (check `.nvmrc` or `package.json`)
|
|
19
|
+
|
|
20
|
+
- [ ] **Test environment isolated**:
|
|
21
|
+
- No other tests running in parallel
|
|
22
|
+
- No file system state from previous tests
|
|
23
|
+
- Database fixtures clean
|
|
24
|
+
- Cache cleared if applicable
|
|
25
|
+
|
|
26
|
+
## Test Fundamentals
|
|
27
|
+
|
|
28
|
+
- [ ] **Test is deterministic** (not flaky):
|
|
29
|
+
- Run test 5 times consecutively
|
|
30
|
+
- Fails same way every time
|
|
31
|
+
- If fails inconsistently → switch to flaky-test-investigation.md
|
|
32
|
+
|
|
33
|
+
- [ ] **Error message is clear**:
|
|
34
|
+
- Full error read (including stack trace)
|
|
35
|
+
- Assertion message understood
|
|
36
|
+
- Expected vs actual values noted
|
|
37
|
+
|
|
38
|
+
- [ ] **Reproduction steps documented**:
|
|
39
|
+
- Steps to run failing test written down
|
|
40
|
+
- Any preconditions noted
|
|
41
|
+
- Environment variables documented
|
|
42
|
+
|
|
43
|
+
## Test Code Analysis
|
|
44
|
+
|
|
45
|
+
- [ ] **Test structure is correct**:
|
|
46
|
+
- Setup (arrange): Test data initialized
|
|
47
|
+
- Execution (act): Function called with test data
|
|
48
|
+
- Assertion (assert): Result verified
|
|
49
|
+
- Teardown: Resources cleaned up
|
|
50
|
+
|
|
51
|
+
- [ ] **Mocks are properly configured**:
|
|
52
|
+
- All external dependencies mocked
|
|
53
|
+
- Mock return values match expectations
|
|
54
|
+
- Mock call counts/arguments verified
|
|
55
|
+
- Mocks reset between tests
|
|
56
|
+
|
|
57
|
+
- [ ] **Test data is valid**:
|
|
58
|
+
- Test fixtures exist
|
|
59
|
+
- Data types correct (number, string, array, object)
|
|
60
|
+
- Null/undefined not unexpected
|
|
61
|
+
- Edge cases considered
|
|
62
|
+
|
|
63
|
+
## Implementation Analysis
|
|
64
|
+
|
|
65
|
+
- [ ] **Code under test identified**:
|
|
66
|
+
- Exact function/method being tested known
|
|
67
|
+
- File location noted
|
|
68
|
+
- Recent changes reviewed (git blame)
|
|
69
|
+
|
|
70
|
+
- [ ] **Code logic reviewed**:
|
|
71
|
+
- Function parameters match test call
|
|
72
|
+
- Return type matches assertion
|
|
73
|
+
- No type mismatches
|
|
74
|
+
- Null checks in place
|
|
75
|
+
|
|
76
|
+
- [ ] **Dependency chain checked**:
|
|
77
|
+
- All imported modules exist
|
|
78
|
+
- No circular dependencies
|
|
79
|
+
- Versions compatible
|
|
80
|
+
- Initialization order correct
|
|
81
|
+
|
|
82
|
+
## Debug Information Gathering
|
|
83
|
+
|
|
84
|
+
- [ ] **Error output analyzed**:
|
|
85
|
+
- Stack trace followed to root
|
|
86
|
+
- Line number in error matches code
|
|
87
|
+
- Message matches code (not outdated?)
|
|
88
|
+
- All context (variables, state) logged
|
|
89
|
+
|
|
90
|
+
- [ ] **Variable values inspected**:
|
|
91
|
+
- Expected value printed
|
|
92
|
+
- Actual value printed
|
|
93
|
+
- Types match
|
|
94
|
+
- Data structure as expected
|
|
95
|
+
|
|
96
|
+
- [ ] **Scope issues checked**:
|
|
97
|
+
- Variable in correct scope
|
|
98
|
+
- Not undefined when used
|
|
99
|
+
- Reference vs value semantics correct
|
|
100
|
+
- Closure capturing right variables
|
|
101
|
+
|
|
102
|
+
## Common Issues Ruled Out
|
|
103
|
+
|
|
104
|
+
- [ ] **Not a typo**:
|
|
105
|
+
- Function name spelled correctly
|
|
106
|
+
- Variable name matches
|
|
107
|
+
- No case sensitivity issues
|
|
108
|
+
- Import path correct
|
|
109
|
+
|
|
110
|
+
- [ ] **Not an import issue**:
|
|
111
|
+
- Module imported correctly
|
|
112
|
+
- Correct export used (default vs named)
|
|
113
|
+
- Path relative or absolute correct
|
|
114
|
+
- No circular imports
|
|
115
|
+
|
|
116
|
+
- [ ] **Not a timing issue** (for async):
|
|
117
|
+
- Promises/callbacks not mixed
|
|
118
|
+
- Async/await used correctly
|
|
119
|
+
- Test waits for async operations
|
|
120
|
+
- No race conditions
|
|
121
|
+
|
|
122
|
+
## Ready to Debug
|
|
123
|
+
|
|
124
|
+
- [ ] All checks above passed
|
|
125
|
+
- [ ] Investigation log created (templates/debug-investigation-log.md)
|
|
126
|
+
- [ ] Ready to proceed with playbook:
|
|
127
|
+
- Unit tests → playbooks/unit-test-failures.md
|
|
128
|
+
- Integration tests → playbooks/integration-test-failures.md
|
|
129
|
+
- E2E tests → playbooks/e2e-test-failures.md
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Usage
|
|
134
|
+
|
|
135
|
+
Before investigating test failure:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# 1. Run test in isolation
|
|
139
|
+
npm test -- NameOfTest.test.js
|
|
140
|
+
|
|
141
|
+
# 2. Complete this checklist
|
|
142
|
+
cat .codex/skills/genesis-debug-guide/checklists/test-failure-debug.md
|
|
143
|
+
|
|
144
|
+
# 3. Select appropriate playbook
|
|
145
|
+
# - Unit: playbooks/unit-test-failures.md
|
|
146
|
+
# - Integration: playbooks/integration-test-failures.md
|
|
147
|
+
# - E2E: playbooks/e2e-test-failures.md
|
|
148
|
+
|
|
149
|
+
# 4. Create investigation log
|
|
150
|
+
# cp templates/debug-investigation-log.md observability/failures/investigation-$(date +%s).md
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Notes
|
|
154
|
+
|
|
155
|
+
- Don't skip environment verification - most failures are environmental
|
|
156
|
+
- If test fails intermittently → See flaky-test-investigation.md
|
|
157
|
+
- If multiple tests fail → Check test isolation first
|
|
158
|
+
- If all tests fail → Check environment/dependencies
|