codex-genesis-harness 0.1.0 → 0.1.4
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/API_CONTRACTS.md +12 -0
- package/.codebase/ARCHITECTURE.md +6 -0
- package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -0
- package/.codebase/CURRENT_STATE.md +8 -0
- package/.codebase/DEPENDENCY_GRAPH.md +14 -0
- package/.codebase/DOMAIN_MODELS.md +10 -0
- package/.codebase/EVOLUTION_PLAN.md +35 -0
- package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -0
- package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -0
- package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -0
- package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -0
- package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -0
- package/.codebase/KNOWN_PROBLEMS.md +6 -0
- package/.codebase/MODULE_INDEX.md +13 -0
- package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -0
- package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -0
- package/.codebase/PIPELINE_FLOW.md +14 -0
- package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -0
- package/.codebase/README.md +139 -0
- package/.codebase/RECOVERY_POINTS.md +438 -0
- package/.codebase/TEST_MATRIX.md +11 -0
- package/.codebase/UI_ROUTES.md +4 -0
- package/.codebase/context/backend-summary.md +4 -0
- package/.codebase/context/frontend-summary.md +4 -0
- package/.codebase/context/pipeline-summary.md +4 -0
- package/.codebase/context/providers-summary.md +4 -0
- package/.codebase/context/render-summary.md +4 -0
- package/.codebase/context/tests-summary.md +4 -0
- package/.codex/skills/genesis-ai-provider/SKILL.md +46 -0
- package/.codex/skills/genesis-ai-provider/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-ai-provider/checklists/checklist.md +9 -0
- package/.codex/skills/genesis-ai-provider/examples/example.md +4 -0
- package/.codex/skills/genesis-ai-provider/templates/provider-contract-template.md +9 -0
- package/.codex/skills/genesis-api-contract/SKILL.md +46 -0
- package/.codex/skills/genesis-api-contract/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-api-contract/checklists/checklist.md +8 -0
- package/.codex/skills/genesis-api-contract/examples/example.md +4 -0
- package/.codex/skills/genesis-api-contract/templates/api-contract-template.md +4 -0
- package/.codex/skills/genesis-api-sync/SKILL.md +354 -0
- package/.codex/skills/genesis-api-sync/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -0
- package/.codex/skills/genesis-api-sync/examples/example.md +68 -0
- package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -0
- package/.codex/skills/genesis-architecture/SKILL.md +46 -0
- package/.codex/skills/genesis-architecture/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-architecture/checklists/checklist.md +8 -0
- package/.codex/skills/genesis-architecture/examples/example.md +4 -0
- package/.codex/skills/genesis-architecture/templates/architecture-decision-template.md +14 -0
- package/.codex/skills/genesis-codebase-map/SKILL.md +46 -0
- package/.codex/skills/genesis-codebase-map/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-codebase-map/checklists/checklist.md +7 -0
- package/.codex/skills/genesis-codebase-map/examples/example.md +4 -0
- package/.codex/skills/genesis-codebase-map/templates/map-update-template.md +8 -0
- package/.codex/skills/genesis-debug-guide/SKILL.md +479 -0
- package/.codex/skills/genesis-debug-guide/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -0
- package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -0
- package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -0
- package/.codex/skills/genesis-debug-guide/examples/example.md +48 -0
- package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -0
- package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -0
- package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -0
- package/.codex/skills/genesis-design-spec/SKILL.md +46 -0
- package/.codex/skills/genesis-design-spec/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-design-spec/checklists/checklist.md +7 -0
- package/.codex/skills/genesis-design-spec/examples/example.md +4 -0
- package/.codex/skills/genesis-design-spec/templates/design-spec-template.md +9 -0
- package/.codex/skills/genesis-docs/SKILL.md +46 -0
- package/.codex/skills/genesis-docs/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-docs/checklists/checklist.md +7 -0
- package/.codex/skills/genesis-docs/examples/example.md +4 -0
- package/.codex/skills/genesis-docs/templates/docs-update-template.md +8 -0
- package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -0
- package/.codex/skills/genesis-docs-automation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -0
- package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -0
- package/.codex/skills/genesis-docs-automation/examples/example.md +59 -0
- package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -0
- package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -0
- package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -0
- package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -0
- package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -0
- package/.codex/skills/genesis-harness/SKILL.md +1418 -0
- package/.codex/skills/genesis-harness/agents/openai.yaml +9 -0
- package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -0
- package/.codex/skills/genesis-harness/checklists/checklist.md +10 -0
- package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -0
- package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -0
- package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -0
- package/.codex/skills/genesis-harness/examples/example.md +4 -0
- package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -0
- package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -0
- package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -0
- package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -0
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-architecture-boundaries.sh +23 -23
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-docs-sync.sh +24 -24
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-no-debug-logs.sh +21 -21
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-required-planning-files.sh +46 -46
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-spec-changelog.sh +24 -24
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-task-tracking.sh +25 -25
- package/.codex/skills/genesis-harness/scripts/compact-context.sh +54 -0
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/create-adr.sh +74 -74
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/create-bug.sh +160 -160
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/create-feature.sh +217 -217
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/detect-stack.sh +26 -26
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/init-planning.sh +750 -719
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/list-changed-files.sh +12 -12
- package/.codex/skills/genesis-harness/scripts/offload-log.sh +72 -0
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/run-verification.sh +47 -47
- package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +75 -0
- package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/update-state.sh +33 -33
- package/.codex/skills/genesis-harness/templates/harness-workflow-template.md +10 -0
- package/.codex/skills/genesis-harness-engineering/SKILL.md +159 -0
- package/.codex/skills/genesis-harness-engineering/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-harness-engineering/checklists/checklist.md +48 -0
- package/.codex/skills/genesis-harness-engineering/examples/example.md +57 -0
- package/.codex/skills/genesis-harness-engineering/playbooks/harness-evolution.md +99 -0
- package/.codex/skills/genesis-harness-engineering/templates/harness-change-template.md +37 -0
- package/.codex/skills/genesis-new-design/SKILL.md +95 -0
- package/.codex/skills/genesis-new-design/agents/openai.yaml +4 -0
- package/.codex/skills/genesis-new-design/checklists/checklist.md +8 -0
- package/.codex/skills/genesis-new-design/examples/example.md +4 -0
- package/.codex/skills/genesis-new-design/templates/new-design-template.md +9 -0
- package/.codex/skills/genesis-observability-automation/SKILL.md +382 -0
- package/.codex/skills/genesis-observability-automation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-observability-automation/examples/example.md +86 -0
- package/.codex/skills/genesis-performance-profiling/SKILL.md +510 -0
- package/.codex/skills/genesis-performance-profiling/agents/openai.yaml +6 -0
- package/.codex/skills/genesis-performance-profiling/checklists/optimization-verification.md +199 -0
- package/.codex/skills/genesis-performance-profiling/checklists/performance-baseline.md +183 -0
- package/.codex/skills/genesis-performance-profiling/examples/example.md +234 -0
- package/.codex/skills/genesis-performance-profiling/observability/performance-tracking.md +202 -0
- package/.codex/skills/genesis-performance-profiling/playbooks/load-testing-orchestration.md +593 -0
- package/.codex/skills/genesis-performance-profiling/playbooks/profiling-playbook.md +601 -0
- package/.codex/skills/genesis-performance-profiling/templates/load-test-config-template.md +428 -0
- package/.codex/skills/genesis-performance-profiling/templates/performance-report-template.md +238 -0
- package/.codex/skills/genesis-pipeline-orchestration/SKILL.md +46 -0
- package/.codex/skills/genesis-pipeline-orchestration/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-pipeline-orchestration/checklists/checklist.md +12 -0
- package/.codex/skills/genesis-pipeline-orchestration/examples/example.md +4 -0
- package/.codex/skills/genesis-pipeline-orchestration/templates/orchestration-template.md +12 -0
- package/.codex/skills/genesis-planning/SKILL.md +46 -0
- package/.codex/skills/genesis-planning/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-planning/checklists/checklist.md +8 -0
- package/.codex/skills/genesis-planning/examples/example.md +4 -0
- package/.codex/skills/genesis-planning/templates/plan-template.md +11 -0
- package/.codex/skills/genesis-release/SKILL.md +46 -0
- package/.codex/skills/genesis-release/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-release/checklists/checklist.md +8 -0
- package/.codex/skills/genesis-release/examples/example.md +4 -0
- package/.codex/skills/genesis-release/templates/release-checklist-template.md +9 -0
- package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -0
- package/.codex/skills/genesis-release-orchestration/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -0
- package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -0
- package/.codex/skills/genesis-release-orchestration/examples/example.md +78 -0
- package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -0
- package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -0
- package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -0
- package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -0
- package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -0
- package/.codex/skills/genesis-research/SKILL.md +46 -0
- package/.codex/skills/genesis-research/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-research/checklists/checklist.md +7 -0
- package/.codex/skills/genesis-research/examples/example.md +4 -0
- package/.codex/skills/genesis-research/templates/research-note-template.md +9 -0
- package/.codex/skills/genesis-research-first/SKILL.md +237 -0
- package/.codex/skills/genesis-research-first/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-research-first/examples/example.md +85 -0
- package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -0
- package/.codex/skills/genesis-spec-propagation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -0
- package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -0
- package/.codex/skills/genesis-spec-propagation/examples/example.md +63 -0
- package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -0
- package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -0
- package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -0
- package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -0
- package/.codex/skills/genesis-upgrade-design/SKILL.md +97 -0
- package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +4 -0
- package/.codex/skills/genesis-upgrade-design/checklists/checklist.md +8 -0
- package/.codex/skills/genesis-upgrade-design/examples/example.md +4 -0
- package/.codex/skills/genesis-upgrade-design/templates/upgrade-design-template.md +9 -0
- package/.codex/skills/spec-impact-engine/SKILL.md +504 -0
- package/.codex/skills/spec-impact-engine/agents/openai.yaml +7 -0
- package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +262 -0
- package/.codex/skills/spec-impact-engine/examples/example.md +98 -0
- package/.codex/skills/spec-impact-engine/templates/impact-report.md +248 -0
- package/.codex/skills/spec-impact-engine/templates/migration-guide.md +223 -0
- package/.codex/skills/ui-ux-test-skill/SKILL.md +46 -0
- package/.codex/skills/ui-ux-test-skill/agents/openai.yaml +7 -0
- package/.codex/skills/ui-ux-test-skill/checklists/checklist.md +8 -0
- package/.codex/skills/ui-ux-test-skill/examples/example.md +4 -0
- package/.codex/skills/ui-ux-test-skill/templates/playwright-test-template.md +4 -0
- package/.codex-plugin/plugin.json +13 -11
- package/README.EN.md +719 -0
- package/README.VI.md +712 -0
- package/README.md +318 -181
- package/VERSION +1 -1
- package/bin/genesis-harness.js +133 -79
- package/contracts/agents/CharacterBibleAgent/error.json +1 -0
- package/contracts/agents/CharacterBibleAgent/example.json +1 -0
- package/contracts/agents/CharacterBibleAgent/request.json +1 -0
- package/contracts/agents/CharacterBibleAgent/response.json +1 -0
- package/contracts/agents/CharacterBibleAgent/schema.json +1 -0
- package/contracts/agents/ImageGenerationAgent/error.json +1 -0
- package/contracts/agents/ImageGenerationAgent/example.json +1 -0
- package/contracts/agents/ImageGenerationAgent/request.json +1 -0
- package/contracts/agents/ImageGenerationAgent/response.json +1 -0
- package/contracts/agents/ImageGenerationAgent/schema.json +1 -0
- package/contracts/agents/PipelineOrchestrator/error.json +1 -0
- package/contracts/agents/PipelineOrchestrator/example.json +1 -0
- package/contracts/agents/PipelineOrchestrator/request.json +1 -0
- package/contracts/agents/PipelineOrchestrator/response.json +1 -0
- package/contracts/agents/PipelineOrchestrator/schema.json +1 -0
- package/contracts/agents/PromptGenerationAgent/error.json +1 -0
- package/contracts/agents/PromptGenerationAgent/example.json +1 -0
- package/contracts/agents/PromptGenerationAgent/request.json +1 -0
- package/contracts/agents/PromptGenerationAgent/response.json +1 -0
- package/contracts/agents/PromptGenerationAgent/schema.json +1 -0
- package/contracts/agents/RenderAgent/error.json +1 -0
- package/contracts/agents/RenderAgent/example.json +1 -0
- package/contracts/agents/RenderAgent/request.json +1 -0
- package/contracts/agents/RenderAgent/response.json +1 -0
- package/contracts/agents/RenderAgent/schema.json +1 -0
- package/contracts/agents/ScenePlanningAgent/error.json +1 -0
- package/contracts/agents/ScenePlanningAgent/example.json +1 -0
- package/contracts/agents/ScenePlanningAgent/request.json +1 -0
- package/contracts/agents/ScenePlanningAgent/response.json +1 -0
- package/contracts/agents/ScenePlanningAgent/schema.json +1 -0
- package/contracts/agents/ScreenplayAgent/error.json +1 -0
- package/contracts/agents/ScreenplayAgent/example.json +1 -0
- package/contracts/agents/ScreenplayAgent/request.json +1 -0
- package/contracts/agents/ScreenplayAgent/response.json +1 -0
- package/contracts/agents/ScreenplayAgent/schema.json +1 -0
- package/contracts/agents/StoryAnalysisAgent/error.json +1 -0
- package/contracts/agents/StoryAnalysisAgent/example.json +1 -0
- package/contracts/agents/StoryAnalysisAgent/request.json +1 -0
- package/contracts/agents/StoryAnalysisAgent/response.json +1 -0
- package/contracts/agents/StoryAnalysisAgent/schema.json +1 -0
- package/contracts/agents/SubtitleGenerationAgent/error.json +1 -0
- package/contracts/agents/SubtitleGenerationAgent/example.json +1 -0
- package/contracts/agents/SubtitleGenerationAgent/request.json +1 -0
- package/contracts/agents/SubtitleGenerationAgent/response.json +1 -0
- package/contracts/agents/SubtitleGenerationAgent/schema.json +1 -0
- package/contracts/agents/VoiceGenerationAgent/error.json +1 -0
- package/contracts/agents/VoiceGenerationAgent/example.json +1 -0
- package/contracts/agents/VoiceGenerationAgent/request.json +1 -0
- package/contracts/agents/VoiceGenerationAgent/response.json +1 -0
- package/contracts/agents/VoiceGenerationAgent/schema.json +1 -0
- package/contracts/api/README.md +4 -0
- package/contracts/api/endpoint-template/error.json +7 -0
- package/contracts/api/endpoint-template/example.json +11 -0
- package/contracts/api/endpoint-template/request.json +7 -0
- package/contracts/api/endpoint-template/response.json +6 -0
- package/contracts/api/endpoint-template/schema.json +9 -0
- package/contracts/events/README.md +4 -0
- package/contracts/events/event-template/error.json +4 -0
- package/contracts/events/event-template/example.json +6 -0
- package/contracts/events/event-template/request.json +6 -0
- package/contracts/events/event-template/response.json +3 -0
- package/contracts/events/event-template/schema.json +8 -0
- package/contracts/ui/README.md +4 -0
- package/contracts/ui/screen-template/error.json +4 -0
- package/contracts/ui/screen-template/example.json +7 -0
- package/contracts/ui/screen-template/request.json +4 -0
- package/contracts/ui/screen-template/response.json +4 -0
- package/contracts/ui/screen-template/schema.json +8 -0
- package/fixtures/agents/agent-fixture-template.md +14 -0
- package/fixtures/api/api-fixture-template.md +14 -0
- package/fixtures/images/image-fixture-template.md +14 -0
- package/fixtures/pipeline/pipeline-fixture-template.md +14 -0
- package/fixtures/render/render-fixture-template.md +14 -0
- package/fixtures/tts/tts-fixture-template.md +14 -0
- package/fixtures/videos/video-fixture-template.md +14 -0
- package/observability/agent-runs/agent-run-template.md +22 -0
- package/observability/decision-logs/decision-log-template.md +18 -0
- package/observability/failures/failure-template.md +18 -0
- package/package.json +8 -2
- package/playwright/e2e/e2e-template.md +4 -0
- package/playwright/fixtures/ui-fixture-template.md +4 -0
- package/playwright/smoke/smoke-template.md +4 -0
- package/playwright/visual/visual-regression-template.md +4 -0
- package/scripts/README.md +342 -0
- package/scripts/compact-context.sh +54 -0
- package/scripts/detect-changes.sh +152 -0
- package/scripts/install.sh +103 -69
- package/scripts/offload-log.sh +72 -0
- package/scripts/run-evals.sh +118 -52
- package/scripts/run-verify-loop.sh +75 -0
- package/scripts/uninstall.sh +81 -52
- package/scripts/verify.sh +380 -109
- package/tests/contracts/contract-template.test.md +10 -0
- package/tests/fixtures/fixture-index.md +4 -0
- package/tests/integration/integration-template.test.md +4 -0
- package/tests/unit/unit-template.test.md +4 -0
- package/.codex/skills/project-genesis-harness/SKILL.md +0 -727
- package/.codex/skills/project-genesis-harness/agents/openai.yaml +0 -9
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/references/planning-schema.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/references/quality-rubric.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/references/research-rubric.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/references/workflows.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/agents-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/api-docs-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/architecture-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/audit-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/bug-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/check-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/conventions-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/decision-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/design-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/escalation-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/feature-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/integrations-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/journeys-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/lessons-learned-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/observability-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/phase-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/pitfalls-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/planning-tree-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/project-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/quality-score-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/requirements-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/research-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/review-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/spec-changelog-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/stack-template.md +0 -0
- /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/verification-template.md +0 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
# Flaky Test Investigation Checklist
|
|
2
|
+
|
|
3
|
+
**Purpose**: Systematic debugging for tests that fail intermittently. These are notoriously hard to fix but follow patterns.
|
|
4
|
+
|
|
5
|
+
**Status**: MANDATORY - Complete before attempting flaky test fix.
|
|
6
|
+
|
|
7
|
+
## Characteristics: Is It Actually Flaky?
|
|
8
|
+
|
|
9
|
+
- [ ] **Fails inconsistently**:
|
|
10
|
+
- Run test 10 times: `for i in {1..10}; do npm test -- test.js; done`
|
|
11
|
+
- Fails ~X times out of 10
|
|
12
|
+
- Not always the same assertion fails
|
|
13
|
+
- Not 0% or 100% (if always fails, see test-failure-debug.md)
|
|
14
|
+
|
|
15
|
+
- [ ] **Failure pattern exists**:
|
|
16
|
+
- Fails more often under load?
|
|
17
|
+
- Fails in CI but not locally?
|
|
18
|
+
- Fails after other tests?
|
|
19
|
+
- Fails at specific time of day?
|
|
20
|
+
|
|
21
|
+
- [ ] **Previous attempts failed**:
|
|
22
|
+
- Simple retry didn't fix it
|
|
23
|
+
- Disabling parallelization didn't fix it
|
|
24
|
+
- Increasing timeout didn't fix it
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Root Cause Pattern Analysis
|
|
29
|
+
|
|
30
|
+
### Pattern 1: Race Condition (Most Common)
|
|
31
|
+
```javascript
|
|
32
|
+
// ❌ WRONG: Race condition
|
|
33
|
+
test('user updates profile', async () => {
|
|
34
|
+
updateUser({ name: 'New Name' }); // Async, not awaited!
|
|
35
|
+
expect(userName).toBe('New Name'); // Might run before update completes
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// ✅ CORRECT: Wait for async operation
|
|
39
|
+
test('user updates profile', async () => {
|
|
40
|
+
await updateUser({ name: 'New Name' }); // Wait for it
|
|
41
|
+
expect(userName).toBe('New Name');
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Signs**:
|
|
46
|
+
- [ ] Test has async operations
|
|
47
|
+
- [ ] Not all async operations awaited
|
|
48
|
+
- [ ] Uses `setTimeout` or `setInterval`
|
|
49
|
+
- [ ] Fails under high CPU load
|
|
50
|
+
- [ ] Fails more in CI (slower machines)
|
|
51
|
+
|
|
52
|
+
**Fix**:
|
|
53
|
+
```javascript
|
|
54
|
+
// Add explicit waits
|
|
55
|
+
await waitFor(() => expect(element).toBeVisible());
|
|
56
|
+
|
|
57
|
+
// Use async/await properly
|
|
58
|
+
const result = await asyncFunction();
|
|
59
|
+
|
|
60
|
+
// Don't mix promises with callbacks
|
|
61
|
+
// Use either async/await OR .then(), not both
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Pattern 2: Test Order Dependency
|
|
65
|
+
```javascript
|
|
66
|
+
// ❌ WRONG: Tests affect each other
|
|
67
|
+
let globalState = 0;
|
|
68
|
+
test('first test', () => { globalState = 1; });
|
|
69
|
+
test('second test', () => { expect(globalState).toBe(0); }); // Fails if first runs first!
|
|
70
|
+
|
|
71
|
+
// ✅ CORRECT: Each test is isolated
|
|
72
|
+
beforeEach(() => { state = 0; }); // Reset before each test
|
|
73
|
+
test('first test', () => { state = 1; });
|
|
74
|
+
test('second test', () => { expect(state).toBe(0); });
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Signs**:
|
|
78
|
+
- [ ] Test passes when run alone
|
|
79
|
+
- [ ] Test fails when run with others
|
|
80
|
+
- [ ] Test fails when run in random order
|
|
81
|
+
- [ ] Global variables used
|
|
82
|
+
- [ ] Database not cleaned between tests
|
|
83
|
+
|
|
84
|
+
**Fix**:
|
|
85
|
+
```javascript
|
|
86
|
+
beforeEach(() => {
|
|
87
|
+
// Reset all state
|
|
88
|
+
jest.clearAllMocks();
|
|
89
|
+
db.clear();
|
|
90
|
+
localStorage.clear();
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Pattern 3: Timing Issues
|
|
95
|
+
```javascript
|
|
96
|
+
// ❌ WRONG: Fixed timeout too short
|
|
97
|
+
test('animation completes', async () => {
|
|
98
|
+
await new Promise(r => setTimeout(r, 50)); // Sometimes not enough time
|
|
99
|
+
expect(element.style.opacity).toBe(1);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// ✅ CORRECT: Wait for actual condition
|
|
103
|
+
test('animation completes', async () => {
|
|
104
|
+
await waitFor(() => expect(element).toHaveStyle('opacity: 1'), { timeout: 5000 });
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Signs**:
|
|
109
|
+
- [ ] Uses `setTimeout` with fixed delays
|
|
110
|
+
- [ ] Fails randomly
|
|
111
|
+
- [ ] Fails when machine is busy
|
|
112
|
+
- [ ] Fails in CI (which is slower)
|
|
113
|
+
- [ ] Increasing timeout "fixes" it temporarily
|
|
114
|
+
|
|
115
|
+
**Fix**:
|
|
116
|
+
```javascript
|
|
117
|
+
// Instead of sleep:
|
|
118
|
+
await new Promise(r => setTimeout(r, 100));
|
|
119
|
+
|
|
120
|
+
// Use condition-based waiting:
|
|
121
|
+
await waitFor(() => expect(element).toBeVisible());
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Pattern 4: External Service/Network
|
|
125
|
+
```javascript
|
|
126
|
+
// ❌ WRONG: Calls actual API
|
|
127
|
+
test('fetch user', async () => {
|
|
128
|
+
const user = await fetchRealAPI('/users/1'); // Network unreliable!
|
|
129
|
+
expect(user.name).toBe('John');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// ✅ CORRECT: Mock external service
|
|
133
|
+
test('fetch user', async () => {
|
|
134
|
+
jest.mock('api', () => ({
|
|
135
|
+
fetch: jest.fn().mockResolvedValue({ name: 'John' })
|
|
136
|
+
}));
|
|
137
|
+
const user = await fetchUser(1);
|
|
138
|
+
expect(user.name).toBe('John');
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Signs**:
|
|
143
|
+
- [ ] Test makes network requests
|
|
144
|
+
- [ ] Mock not configured properly
|
|
145
|
+
- [ ] Network-dependent test
|
|
146
|
+
- [ ] Fails in offline environment
|
|
147
|
+
- [ ] Fails randomly (network issues)
|
|
148
|
+
|
|
149
|
+
**Fix**:
|
|
150
|
+
```javascript
|
|
151
|
+
// Mock all external APIs
|
|
152
|
+
jest.mock('node-fetch');
|
|
153
|
+
nodeFetch.mockResolvedValue({ json: () => ({ ... }) });
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Pattern 5: Randomness/Seeding
|
|
157
|
+
```javascript
|
|
158
|
+
// ❌ WRONG: Random data without seed
|
|
159
|
+
test('shuffle array', () => {
|
|
160
|
+
const result = shuffle([1, 2, 3]);
|
|
161
|
+
expect(result).toEqual([2, 1, 3]); // Different order each time!
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// ✅ CORRECT: Seed random for reproducible tests
|
|
165
|
+
test('shuffle array', () => {
|
|
166
|
+
Math.seedrandom = () => 0.5; // Set seed
|
|
167
|
+
const result = shuffle([1, 2, 3]);
|
|
168
|
+
expect(result).toEqual([3, 1, 2]); // Same every time with same seed
|
|
169
|
+
});
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Signs**:
|
|
173
|
+
- [ ] Test uses `Math.random()`
|
|
174
|
+
- [ ] Test uses `Date.now()`
|
|
175
|
+
- [ ] Test uses `UUID.generate()`
|
|
176
|
+
- [ ] Different assertions fail each run
|
|
177
|
+
- [ ] Works locally but fails in CI
|
|
178
|
+
|
|
179
|
+
**Fix**:
|
|
180
|
+
```javascript
|
|
181
|
+
// Seed random number generator
|
|
182
|
+
beforeEach(() => {
|
|
183
|
+
jest.spyOn(Math, 'random').mockReturnValue(0.5);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// Mock Date.now()
|
|
187
|
+
jest.spyOn(Date, 'now').mockReturnValue(1234567890);
|
|
188
|
+
|
|
189
|
+
// Generate UUIDs deterministically
|
|
190
|
+
jest.mock('uuid', () => ({ v4: () => 'test-uuid-123' }));
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Investigation Checklist
|
|
196
|
+
|
|
197
|
+
### Documentation
|
|
198
|
+
- [ ] When test was added
|
|
199
|
+
- [ ] When it started failing
|
|
200
|
+
- [ ] Failure frequency recorded
|
|
201
|
+
- [ ] Specific assertion that fails (changes?)
|
|
202
|
+
|
|
203
|
+
### Reproduction
|
|
204
|
+
- [ ] Test fails when run 10 times in sequence
|
|
205
|
+
- [ ] Test fails when run in random order with others
|
|
206
|
+
- [ ] Test fails in CI but not locally (or vice versa)
|
|
207
|
+
- [ ] Test fails under high system load
|
|
208
|
+
|
|
209
|
+
### Code Analysis
|
|
210
|
+
- [ ] All async operations have `await`
|
|
211
|
+
- [ ] No global state modifications
|
|
212
|
+
- [ ] All mocks are configured
|
|
213
|
+
- [ ] No `setTimeout` with fixed delays
|
|
214
|
+
- [ ] No external service calls
|
|
215
|
+
- [ ] No random values without seeding
|
|
216
|
+
|
|
217
|
+
### Environment
|
|
218
|
+
- [ ] Node version documented (local vs CI)
|
|
219
|
+
- [ ] Operating system noted (different on CI?)
|
|
220
|
+
- [ ] CI environment variables checked
|
|
221
|
+
- [ ] Parallelization disabled for test
|
|
222
|
+
- [ ] Test isolation verified
|
|
223
|
+
|
|
224
|
+
### Fix Validation
|
|
225
|
+
- [ ] Test passes 20 times consecutively
|
|
226
|
+
- [ ] Test passes in random order with other tests
|
|
227
|
+
- [ ] Test passes in CI
|
|
228
|
+
- [ ] Test passes under load
|
|
229
|
+
- [ ] No other tests broken
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Debugging Strategy
|
|
234
|
+
|
|
235
|
+
### If Pattern 1: Race Condition
|
|
236
|
+
```bash
|
|
237
|
+
# Add debug logging to see timing
|
|
238
|
+
npm test -- --verbose path/to/test.js
|
|
239
|
+
|
|
240
|
+
# Add explicit waits
|
|
241
|
+
await new Promise(r => setTimeout(r, 100));
|
|
242
|
+
|
|
243
|
+
# Use waitFor with debug
|
|
244
|
+
await waitFor(() => {
|
|
245
|
+
console.log('Checking condition...');
|
|
246
|
+
expect(element).toBeVisible();
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### If Pattern 2: Test Order Dependency
|
|
251
|
+
```bash
|
|
252
|
+
# Run tests in random order
|
|
253
|
+
npm test -- --randomize path/to/test.js
|
|
254
|
+
|
|
255
|
+
# Run test alone vs with others
|
|
256
|
+
npm test -- test1.js test2.js test3.js # Together
|
|
257
|
+
npm test -- test2.js # Alone
|
|
258
|
+
|
|
259
|
+
# Check beforeEach/afterEach setup
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### If Pattern 3: Timing Issues
|
|
263
|
+
```bash
|
|
264
|
+
# Check system load
|
|
265
|
+
# Monitor: CPU, Memory, Disk I/O during test run
|
|
266
|
+
|
|
267
|
+
# Increase timeouts
|
|
268
|
+
await waitFor(() => expect(...), { timeout: 10000 });
|
|
269
|
+
|
|
270
|
+
# Replace sleep with condition
|
|
271
|
+
// Instead of: await sleep(1000);
|
|
272
|
+
await waitFor(() => expect(element).toBeVisible());
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### If Pattern 4: External Service
|
|
276
|
+
```bash
|
|
277
|
+
# Verify all external calls are mocked
|
|
278
|
+
grep -r "fetch\|axios\|http" src/__tests__/
|
|
279
|
+
|
|
280
|
+
# Check mock setup
|
|
281
|
+
console.log(jest.mock(...));
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### If Pattern 5: Randomness
|
|
285
|
+
```bash
|
|
286
|
+
# Set seed for randomness
|
|
287
|
+
jest.spyOn(Math, 'random').mockReturnValue(0.5);
|
|
288
|
+
|
|
289
|
+
# Mock Date.now()
|
|
290
|
+
jest.spyOn(Date, 'now').mockReturnValue(1234567890);
|
|
291
|
+
|
|
292
|
+
# Use deterministic test data
|
|
293
|
+
const testUser = { id: '123', name: 'Test' }; // Same each time
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Verification: Flaky Test Fixed
|
|
299
|
+
|
|
300
|
+
- [ ] Test passes 20 times consecutively
|
|
301
|
+
- [ ] Test passes 20 times in random order
|
|
302
|
+
- [ ] Test passes in CI environment
|
|
303
|
+
- [ ] Test passes under system load
|
|
304
|
+
- [ ] No debug code left
|
|
305
|
+
- [ ] Updated RECOVERY_POINTS.md with pattern
|
|
306
|
+
- [ ] Similar tests checked for same issue
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Recovery: Still Flaky?
|
|
311
|
+
|
|
312
|
+
If still failing after fixes:
|
|
313
|
+
|
|
314
|
+
1. **Add extensive logging**:
|
|
315
|
+
```javascript
|
|
316
|
+
test('flaky test', async () => {
|
|
317
|
+
console.log('Start:', Date.now());
|
|
318
|
+
const value = getSomeValue();
|
|
319
|
+
console.log('Value:', value);
|
|
320
|
+
await waitForCondition();
|
|
321
|
+
console.log('Condition met:', Date.now());
|
|
322
|
+
expect(...).toBe(...);
|
|
323
|
+
});
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
2. **Disable test temporarily**:
|
|
327
|
+
```javascript
|
|
328
|
+
test.skip('flaky test', async () => { // Temporarily skip
|
|
329
|
+
// ...
|
|
330
|
+
});
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
3. **Escalate**: Mark test with TODO comment for team
|
|
334
|
+
```javascript
|
|
335
|
+
// TODO: Fix flaky test - likely timing issue, investigate when time permits
|
|
336
|
+
test.skip('should handle concurrent updates', async () => {
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
4. **Create issue**: Document flaky test pattern for future fix
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Production Bug Debug Checklist
|
|
2
|
+
|
|
3
|
+
**Purpose**: Structured investigation for production bugs with data integrity and user impact focus.
|
|
4
|
+
|
|
5
|
+
**Status**: MANDATORY - Complete before `/fix-bug` for production issues.
|
|
6
|
+
|
|
7
|
+
## Incident Assessment
|
|
8
|
+
|
|
9
|
+
- [ ] **Bug severity determined**:
|
|
10
|
+
- Critical (service down, data loss): Requires hotfix
|
|
11
|
+
- High (significant user impact): Next release or hotfix
|
|
12
|
+
- Medium (inconvenience, workaround exists): Next release
|
|
13
|
+
- Low (cosmetic, edge case): Backlog
|
|
14
|
+
|
|
15
|
+
- [ ] **User impact quantified**:
|
|
16
|
+
- How many users affected?
|
|
17
|
+
- What functionality broken?
|
|
18
|
+
- Workaround available?
|
|
19
|
+
- Revenue impact (if applicable)?
|
|
20
|
+
|
|
21
|
+
- [ ] **Reproducibility confirmed**:
|
|
22
|
+
- Reproduced in staging environment first
|
|
23
|
+
- Not reproduced in production → investigation in staging
|
|
24
|
+
- Confirmed with actual user data (if possible)
|
|
25
|
+
- Environment-specific or universal?
|
|
26
|
+
|
|
27
|
+
## Data Integrity Assessment
|
|
28
|
+
|
|
29
|
+
- [ ] **Data corruption checked**:
|
|
30
|
+
- Database queried for anomalies
|
|
31
|
+
- No orphaned records found
|
|
32
|
+
- Foreign keys still valid
|
|
33
|
+
- Timestamps/sequences consistent
|
|
34
|
+
|
|
35
|
+
- [ ] **Rollback strategy documented**:
|
|
36
|
+
- Rollback steps written down
|
|
37
|
+
- Data recovery plan if needed
|
|
38
|
+
- Backup verified
|
|
39
|
+
- Estimated rollback time
|
|
40
|
+
|
|
41
|
+
- [ ] **Data migration planned** (if applicable):
|
|
42
|
+
- Affected data identified
|
|
43
|
+
- Migration strategy documented
|
|
44
|
+
- Backwards compatibility checked
|
|
45
|
+
- Dry run successful
|
|
46
|
+
|
|
47
|
+
## Root Cause Investigation
|
|
48
|
+
|
|
49
|
+
- [ ] **Logs collected and analyzed**:
|
|
50
|
+
- Error logs reviewed
|
|
51
|
+
- Application logs checked
|
|
52
|
+
- System logs examined
|
|
53
|
+
- Timeline of events mapped
|
|
54
|
+
|
|
55
|
+
- [ ] **Recent changes identified**:
|
|
56
|
+
- Last deployment time noted
|
|
57
|
+
- Code changes reviewed (git log)
|
|
58
|
+
- Configuration changes checked
|
|
59
|
+
- Infrastructure changes noted
|
|
60
|
+
|
|
61
|
+
- [ ] **Affected versions identified**:
|
|
62
|
+
- Bug introduced in version X
|
|
63
|
+
- Affects which current versions?
|
|
64
|
+
- Oldest affected version?
|
|
65
|
+
- Fixed in which version?
|
|
66
|
+
|
|
67
|
+
- [ ] **Root cause identified** (or hypothesis):
|
|
68
|
+
- Specific code/config location
|
|
69
|
+
- Why was it missed in testing?
|
|
70
|
+
- Dependency issue or implementation?
|
|
71
|
+
- Environment-specific factor?
|
|
72
|
+
|
|
73
|
+
## Fix Strategy
|
|
74
|
+
|
|
75
|
+
- [ ] **Fix approach decided**:
|
|
76
|
+
- Minimal fix vs architectural refactor?
|
|
77
|
+
- Hotfix vs next release?
|
|
78
|
+
- Backwards compatibility needed?
|
|
79
|
+
- Breaking change implications?
|
|
80
|
+
|
|
81
|
+
- [ ] **Risk assessment completed**:
|
|
82
|
+
- Could fix introduce new bugs?
|
|
83
|
+
- Dependencies to check?
|
|
84
|
+
- Side effects analyzed?
|
|
85
|
+
- Test coverage adequate?
|
|
86
|
+
|
|
87
|
+
- [ ] **Verification plan documented**:
|
|
88
|
+
- Metrics to monitor after fix
|
|
89
|
+
- Rollback criteria defined
|
|
90
|
+
- Health checks configured
|
|
91
|
+
- Alert thresholds set
|
|
92
|
+
|
|
93
|
+
## Testing & Validation
|
|
94
|
+
|
|
95
|
+
- [ ] **Test created** (reproduces bug):
|
|
96
|
+
- Failing test demonstrates bug
|
|
97
|
+
- Test passes without bug (would fail)
|
|
98
|
+
- Test with production-like data
|
|
99
|
+
- Edge cases included
|
|
100
|
+
|
|
101
|
+
- [ ] **Fix validated** (in staging):
|
|
102
|
+
- Test passes with fix
|
|
103
|
+
- All related tests pass
|
|
104
|
+
- No new test failures
|
|
105
|
+
- Performance not degraded
|
|
106
|
+
|
|
107
|
+
- [ ] **Regression testing completed**:
|
|
108
|
+
- Full test suite passes
|
|
109
|
+
- Related features tested
|
|
110
|
+
- Integration scenarios verified
|
|
111
|
+
- Similar bugs searched for
|
|
112
|
+
|
|
113
|
+
## Deployment Planning
|
|
114
|
+
|
|
115
|
+
- [ ] **Deployment strategy determined**:
|
|
116
|
+
- Staged rollout or immediate?
|
|
117
|
+
- Feature flags needed?
|
|
118
|
+
- Canary deployment approach?
|
|
119
|
+
- Rollback testing done?
|
|
120
|
+
|
|
121
|
+
- [ ] **Communication planned**:
|
|
122
|
+
- User notification (if applicable)
|
|
123
|
+
- Workaround documented
|
|
124
|
+
- ETA for fix communicated
|
|
125
|
+
- Post-fix status update planned
|
|
126
|
+
|
|
127
|
+
- [ ] **Monitoring configured**:
|
|
128
|
+
- Key metrics identified
|
|
129
|
+
- Alerts set for regression
|
|
130
|
+
- Dashboard created for tracking
|
|
131
|
+
- On-call rotation aware
|
|
132
|
+
|
|
133
|
+
## Release & Monitoring
|
|
134
|
+
|
|
135
|
+
- [ ] **Release documentation complete**:
|
|
136
|
+
- Fix summary written
|
|
137
|
+
- User-friendly description
|
|
138
|
+
- Migration steps (if needed)
|
|
139
|
+
- Known issues documented
|
|
140
|
+
|
|
141
|
+
- [ ] **Rollback plan tested**:
|
|
142
|
+
- Rollback procedure practiced
|
|
143
|
+
- Time to rollback estimated
|
|
144
|
+
- Backup verified
|
|
145
|
+
- Stakeholders notified
|
|
146
|
+
|
|
147
|
+
- [ ] **Post-deployment monitoring** (first 24h):
|
|
148
|
+
- Error rate watched
|
|
149
|
+
- Performance metrics checked
|
|
150
|
+
- User reports monitored
|
|
151
|
+
- Rollback executed if issues
|
|
152
|
+
|
|
153
|
+
## Prevention & Lessons
|
|
154
|
+
|
|
155
|
+
- [ ] **Prevention documented**:
|
|
156
|
+
- Better test coverage needed?
|
|
157
|
+
- Contract/spec gap?
|
|
158
|
+
- Monitoring enhancement?
|
|
159
|
+
- Process improvement?
|
|
160
|
+
|
|
161
|
+
- [ ] **Similar bugs searched**:
|
|
162
|
+
- Code pattern scanned
|
|
163
|
+
- Similar issues found and tracked
|
|
164
|
+
- Prevention applied broadly
|
|
165
|
+
- Team notified
|
|
166
|
+
|
|
167
|
+
- [ ] **Documentation updated**:
|
|
168
|
+
- Behavior change documented
|
|
169
|
+
- Workaround removed (if applicable)
|
|
170
|
+
- System documentation updated
|
|
171
|
+
- Known issues list maintained
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Usage
|
|
176
|
+
|
|
177
|
+
When debugging production bug:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# 1. Assess severity
|
|
181
|
+
# - Critical: Hotfix needed
|
|
182
|
+
# - High: Plan for next release + hotfix consideration
|
|
183
|
+
# - Medium/Low: Standard fix process
|
|
184
|
+
|
|
185
|
+
# 2. Complete this checklist
|
|
186
|
+
cat .codex/skills/genesis-debug-guide/checklists/production-bug-debug.md
|
|
187
|
+
|
|
188
|
+
# 3. Proceed with /fix-bug
|
|
189
|
+
/fix-bug "Production issue: [description]"
|
|
190
|
+
|
|
191
|
+
# 4. After fix: genesis-debug-guide auto-triggers verification
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Hotfix vs Regular Release Decision
|
|
195
|
+
|
|
196
|
+
**Hotfix** (immediate deployment):
|
|
197
|
+
- ✅ Service down or data loss risk
|
|
198
|
+
- ✅ Critical user impact
|
|
199
|
+
- ✅ Can be isolated fix
|
|
200
|
+
- ✅ Adequate testing done
|
|
201
|
+
- ✅ Rollback strategy documented
|
|
202
|
+
|
|
203
|
+
**Regular Release** (next scheduled):
|
|
204
|
+
- ✅ Medium/Low severity
|
|
205
|
+
- ✅ Workaround available
|
|
206
|
+
- ✅ Can wait for next release
|
|
207
|
+
- ✅ No data integrity risk
|
|
208
|
+
- ✅ More complex fix with side effects
|
|
209
|
+
|
|
210
|
+
**Default**: Regular release unless severity assessment says otherwise.
|
|
@@ -0,0 +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
|