codex-genesis-harness 0.1.1 → 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/ARCHITECTURE_REVIEW_COMPLETE.md +216 -0
- package/.codebase/CURRENT_STATE.md +2 -0
- package/.codebase/DOMAIN_MODELS.md +5 -3
- 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/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -0
- package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -0
- package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -0
- package/.codebase/README.md +139 -0
- package/.codebase/RECOVERY_POINTS.md +438 -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-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-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 +734 -82
- package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -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/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/genesis-harness/scripts/check-architecture-boundaries.sh +23 -23
- package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +24 -24
- package/.codex/skills/genesis-harness/scripts/check-no-debug-logs.sh +21 -21
- package/.codex/skills/genesis-harness/scripts/check-required-planning-files.sh +46 -46
- package/.codex/skills/genesis-harness/scripts/check-spec-changelog.sh +24 -24
- package/.codex/skills/genesis-harness/scripts/check-task-tracking.sh +25 -25
- package/.codex/skills/genesis-harness/scripts/compact-context.sh +54 -0
- package/.codex/skills/genesis-harness/scripts/create-adr.sh +74 -74
- package/.codex/skills/genesis-harness/scripts/create-bug.sh +160 -160
- package/.codex/skills/genesis-harness/scripts/create-feature.sh +217 -217
- package/.codex/skills/genesis-harness/scripts/detect-stack.sh +26 -26
- package/.codex/skills/genesis-harness/scripts/init-planning.sh +750 -719
- package/.codex/skills/genesis-harness/scripts/list-changed-files.sh +12 -12
- package/.codex/skills/genesis-harness/scripts/offload-log.sh +72 -0
- package/.codex/skills/genesis-harness/scripts/run-verification.sh +47 -47
- package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +75 -0
- package/.codex/skills/genesis-harness/scripts/update-state.sh +33 -33
- package/.codex/skills/genesis-harness-engineering/SKILL.md +159 -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-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-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-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/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-plugin/plugin.json +1 -1
- package/README.EN.md +719 -0
- package/README.VI.md +712 -0
- package/README.md +261 -107
- package/VERSION +1 -1
- package/bin/genesis-harness.js +20 -11
- package/package.json +1 -1
- package/scripts/README.md +342 -0
- package/scripts/compact-context.sh +54 -0
- package/scripts/detect-changes.sh +152 -0
- package/scripts/install.sh +50 -41
- package/scripts/offload-log.sh +72 -0
- package/scripts/run-evals.sh +70 -43
- package/scripts/run-verify-loop.sh +75 -0
- package/scripts/uninstall.sh +52 -43
- package/scripts/verify.sh +165 -73
- package/.codex/skills/harness-engineering-skill/SKILL.md +0 -45
- package/.codex/skills/harness-engineering-skill/checklists/checklist.md +0 -8
- package/.codex/skills/harness-engineering-skill/examples/example.md +0 -4
- package/.codex/skills/harness-engineering-skill/templates/harness-change-template.md +0 -8
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/SKILL.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/agents/openai.yaml +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/checklists/checklist.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/examples/example.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/templates/provider-contract-template.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/SKILL.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/agents/openai.yaml +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/checklists/checklist.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/examples/example.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/templates/api-contract-template.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/SKILL.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/agents/openai.yaml +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/checklists/checklist.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/examples/example.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/templates/architecture-decision-template.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/SKILL.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/agents/openai.yaml +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/checklists/checklist.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/examples/example.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/templates/map-update-template.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/SKILL.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/agents/openai.yaml +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/checklists/checklist.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/examples/example.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/templates/design-spec-template.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/SKILL.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/agents/openai.yaml +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/checklists/checklist.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/examples/example.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/templates/docs-update-template.md +0 -0
- /package/.codex/skills/{harness-engineering-skill → genesis-harness-engineering}/agents/openai.yaml +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/SKILL.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/agents/openai.yaml +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/checklists/checklist.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/examples/example.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/templates/orchestration-template.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/SKILL.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/agents/openai.yaml +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/checklists/checklist.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/examples/example.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/templates/plan-template.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/SKILL.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/agents/openai.yaml +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/checklists/checklist.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/examples/example.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/templates/release-checklist-template.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/SKILL.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/agents/openai.yaml +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/checklists/checklist.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/examples/example.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/templates/research-note-template.md +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ==============================================================================
|
|
3
|
+
# Genesis Codex Harness — Context Compaction Engine
|
|
4
|
+
# ==============================================================================
|
|
5
|
+
# Summarizes active project planning files, active tasks, and logs into a single
|
|
6
|
+
# .planning/CONTEXT_SUMMARY.md file to safely offload context before compacting.
|
|
7
|
+
# Reduces context window usage and prevents Context Rot.
|
|
8
|
+
# ==============================================================================
|
|
9
|
+
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
PLANNING_DIR="${1:-.planning}"
|
|
13
|
+
SUMMARY_FILE="$PLANNING_DIR/CONTEXT_SUMMARY.md"
|
|
14
|
+
|
|
15
|
+
if [ ! -d "$PLANNING_DIR" ]; then
|
|
16
|
+
echo "Error: Planning directory '$PLANNING_DIR' does not exist." >&2
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
echo "==> Compacting active context..."
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
echo "# Context Compaction Summary"
|
|
24
|
+
echo "Generated: $(date +'%Y-%m-%d %H:%M:%S')"
|
|
25
|
+
echo ""
|
|
26
|
+
echo "## 📊 Active State Summary"
|
|
27
|
+
if [ -f "$PLANNING_DIR/STATE.md" ]; then
|
|
28
|
+
grep -E "^- (Current Phase|Active Feature|Last Completed Task|Next Task|Blockers):" "$PLANNING_DIR/STATE.md" || true
|
|
29
|
+
else
|
|
30
|
+
echo "State file not found. Project initialized but state unpopulated."
|
|
31
|
+
fi
|
|
32
|
+
echo ""
|
|
33
|
+
echo "## 🎯 Key Architectural Invariants"
|
|
34
|
+
if [ -f "$PLANNING_DIR/ARCHITECTURE.md" ]; then
|
|
35
|
+
head -n 25 "$PLANNING_DIR/ARCHITECTURE.md"
|
|
36
|
+
else
|
|
37
|
+
echo "Architecture file not found."
|
|
38
|
+
fi
|
|
39
|
+
echo ""
|
|
40
|
+
echo "## 📝 Active Task Progress"
|
|
41
|
+
# Find all task lists in active features or bugs
|
|
42
|
+
find "$PLANNING_DIR/features" "$PLANNING_DIR/bugs" -name "TASKS.md" 2>/dev/null | while read -r task_file; do
|
|
43
|
+
echo "### Tasks for: $(basename "$(dirname "$task_file")")"
|
|
44
|
+
grep -E "^- \[[x~ ]\]" "$task_file" | tail -n 15 || true
|
|
45
|
+
echo ""
|
|
46
|
+
done
|
|
47
|
+
echo ""
|
|
48
|
+
echo "## ⚠️ Fragile Areas & Lessons Learned"
|
|
49
|
+
if [ -f "$PLANNING_DIR/PITFALLS.md" ]; then
|
|
50
|
+
head -n 15 "$PLANNING_DIR/PITFALLS.md"
|
|
51
|
+
fi
|
|
52
|
+
} > "$SUMMARY_FILE"
|
|
53
|
+
|
|
54
|
+
echo "==> Context compaction complete! Summary saved to: file://$(pwd)/$SUMMARY_FILE"
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
usage() {
|
|
5
|
-
echo "Usage: $0 <slug> [title] [root]" >&2
|
|
6
|
-
exit 2
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
slug="${1:-}"
|
|
10
|
-
title="${2:-$slug}"
|
|
11
|
-
root="${3:-.}"
|
|
12
|
-
[ -n "$slug" ] || usage
|
|
13
|
-
|
|
14
|
-
case "$slug" in
|
|
15
|
-
*[!a-z0-9-]*|'') echo "Slug must use lowercase letters, numbers, and hyphens." >&2; exit 2 ;;
|
|
16
|
-
esac
|
|
17
|
-
|
|
18
|
-
cd "$root"
|
|
19
|
-
mkdir -p .planning/decisions
|
|
20
|
-
|
|
21
|
-
next="$(
|
|
22
|
-
find .planning/decisions -maxdepth 1 -type f -name 'ADR-[0-9][0-9][0-9]-*.md' 2>/dev/null \
|
|
23
|
-
| sed -E 's#.*/ADR-([0-9]{3})-.*#\1#' \
|
|
24
|
-
| sort -n \
|
|
25
|
-
| tail -1
|
|
26
|
-
)"
|
|
27
|
-
if [ -z "$next" ]; then
|
|
28
|
-
number="001"
|
|
29
|
-
else
|
|
30
|
-
number="$(printf '%03d' "$((10#$next + 1))")"
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
file=".planning/decisions/ADR-${number}-${slug}.md"
|
|
34
|
-
if [ -e "$file" ]; then
|
|
35
|
-
echo "ADR already exists: $file" >&2
|
|
36
|
-
exit 1
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
cat > "$file" <<EOF
|
|
40
|
-
# ADR-${number}: $title
|
|
41
|
-
|
|
42
|
-
Status: Proposed
|
|
43
|
-
Date: $(date +%Y-%m-%d)
|
|
44
|
-
|
|
45
|
-
## Context
|
|
46
|
-
|
|
47
|
-
TBD
|
|
48
|
-
|
|
49
|
-
## Decision
|
|
50
|
-
|
|
51
|
-
TBD
|
|
52
|
-
|
|
53
|
-
## Alternatives Considered
|
|
54
|
-
|
|
55
|
-
- [ ] TBD
|
|
56
|
-
|
|
57
|
-
## Consequences
|
|
58
|
-
|
|
59
|
-
- [ ] TBD
|
|
60
|
-
|
|
61
|
-
## Risks
|
|
62
|
-
|
|
63
|
-
- [ ] TBD
|
|
64
|
-
|
|
65
|
-
## Mitigation
|
|
66
|
-
|
|
67
|
-
- [ ] TBD
|
|
68
|
-
|
|
69
|
-
## Verification Evidence
|
|
70
|
-
|
|
71
|
-
TBD
|
|
72
|
-
EOF
|
|
73
|
-
|
|
74
|
-
echo "$file"
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
echo "Usage: $0 <slug> [title] [root]" >&2
|
|
6
|
+
exit 2
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
slug="${1:-}"
|
|
10
|
+
title="${2:-$slug}"
|
|
11
|
+
root="${3:-.}"
|
|
12
|
+
[ -n "$slug" ] || usage
|
|
13
|
+
|
|
14
|
+
case "$slug" in
|
|
15
|
+
*[!a-z0-9-]*|'') echo "Slug must use lowercase letters, numbers, and hyphens." >&2; exit 2 ;;
|
|
16
|
+
esac
|
|
17
|
+
|
|
18
|
+
cd "$root"
|
|
19
|
+
mkdir -p .planning/decisions
|
|
20
|
+
|
|
21
|
+
next="$(
|
|
22
|
+
find .planning/decisions -maxdepth 1 -type f -name 'ADR-[0-9][0-9][0-9]-*.md' 2>/dev/null \
|
|
23
|
+
| sed -E 's#.*/ADR-([0-9]{3})-.*#\1#' \
|
|
24
|
+
| sort -n \
|
|
25
|
+
| tail -1
|
|
26
|
+
)"
|
|
27
|
+
if [ -z "$next" ]; then
|
|
28
|
+
number="001"
|
|
29
|
+
else
|
|
30
|
+
number="$(printf '%03d' "$((10#$next + 1))")"
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
file=".planning/decisions/ADR-${number}-${slug}.md"
|
|
34
|
+
if [ -e "$file" ]; then
|
|
35
|
+
echo "ADR already exists: $file" >&2
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
cat > "$file" <<EOF
|
|
40
|
+
# ADR-${number}: $title
|
|
41
|
+
|
|
42
|
+
Status: Proposed
|
|
43
|
+
Date: $(date +%Y-%m-%d)
|
|
44
|
+
|
|
45
|
+
## Context
|
|
46
|
+
|
|
47
|
+
TBD
|
|
48
|
+
|
|
49
|
+
## Decision
|
|
50
|
+
|
|
51
|
+
TBD
|
|
52
|
+
|
|
53
|
+
## Alternatives Considered
|
|
54
|
+
|
|
55
|
+
- [ ] TBD
|
|
56
|
+
|
|
57
|
+
## Consequences
|
|
58
|
+
|
|
59
|
+
- [ ] TBD
|
|
60
|
+
|
|
61
|
+
## Risks
|
|
62
|
+
|
|
63
|
+
- [ ] TBD
|
|
64
|
+
|
|
65
|
+
## Mitigation
|
|
66
|
+
|
|
67
|
+
- [ ] TBD
|
|
68
|
+
|
|
69
|
+
## Verification Evidence
|
|
70
|
+
|
|
71
|
+
TBD
|
|
72
|
+
EOF
|
|
73
|
+
|
|
74
|
+
echo "$file"
|
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
usage() {
|
|
5
|
-
echo "Usage: $0 <slug> [summary] [root]" >&2
|
|
6
|
-
exit 2
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
slug="${1:-}"
|
|
10
|
-
summary="${2:-TBD}"
|
|
11
|
-
root="${3:-.}"
|
|
12
|
-
[ -n "$slug" ] || usage
|
|
13
|
-
|
|
14
|
-
case "$slug" in
|
|
15
|
-
*[!a-z0-9-]*|'') echo "Slug must use lowercase letters, numbers, and hyphens." >&2; exit 2 ;;
|
|
16
|
-
esac
|
|
17
|
-
|
|
18
|
-
cd "$root"
|
|
19
|
-
mkdir -p .planning/bugs
|
|
20
|
-
|
|
21
|
-
next="$(
|
|
22
|
-
find .planning/bugs -maxdepth 1 -type d -name '[0-9][0-9][0-9]-*' 2>/dev/null \
|
|
23
|
-
| sed -E 's#.*/([0-9]{3})-.*#\1#' \
|
|
24
|
-
| sort -n \
|
|
25
|
-
| tail -1
|
|
26
|
-
)"
|
|
27
|
-
if [ -z "$next" ]; then
|
|
28
|
-
number="001"
|
|
29
|
-
else
|
|
30
|
-
number="$(printf '%03d' "$((10#$next + 1))")"
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
dir=".planning/bugs/${number}-${slug}"
|
|
34
|
-
if [ -e "$dir" ]; then
|
|
35
|
-
echo "Bug directory already exists: $dir" >&2
|
|
36
|
-
exit 1
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
mkdir -p "$dir"
|
|
40
|
-
|
|
41
|
-
cat > "$dir/REPORT.md" <<EOF
|
|
42
|
-
# Bug Report: $summary
|
|
43
|
-
|
|
44
|
-
## Summary
|
|
45
|
-
|
|
46
|
-
$summary
|
|
47
|
-
|
|
48
|
-
## Expected Behavior
|
|
49
|
-
|
|
50
|
-
- [ ] TBD
|
|
51
|
-
|
|
52
|
-
## Actual Behavior
|
|
53
|
-
|
|
54
|
-
- [ ] TBD
|
|
55
|
-
|
|
56
|
-
## Reproduction Steps
|
|
57
|
-
|
|
58
|
-
- [ ] TBD
|
|
59
|
-
|
|
60
|
-
## Environment
|
|
61
|
-
|
|
62
|
-
TBD
|
|
63
|
-
EOF
|
|
64
|
-
|
|
65
|
-
cat > "$dir/ROOT_CAUSE.md" <<'EOF'
|
|
66
|
-
# Root Cause
|
|
67
|
-
|
|
68
|
-
## Evidence
|
|
69
|
-
|
|
70
|
-
- [ ] TBD
|
|
71
|
-
|
|
72
|
-
## Root Cause
|
|
73
|
-
|
|
74
|
-
TBD
|
|
75
|
-
|
|
76
|
-
## Failed Assumption
|
|
77
|
-
|
|
78
|
-
TBD
|
|
79
|
-
|
|
80
|
-
## Correct Pattern
|
|
81
|
-
|
|
82
|
-
TBD
|
|
83
|
-
EOF
|
|
84
|
-
|
|
85
|
-
cat > "$dir/PLAN.md" <<'EOF'
|
|
86
|
-
# Plan
|
|
87
|
-
|
|
88
|
-
## Files To Change
|
|
89
|
-
|
|
90
|
-
### File: `path/to/file`
|
|
91
|
-
|
|
92
|
-
Change:
|
|
93
|
-
Why:
|
|
94
|
-
Risk:
|
|
95
|
-
Test:
|
|
96
|
-
Docs impact:
|
|
97
|
-
|
|
98
|
-
## Fix Steps
|
|
99
|
-
|
|
100
|
-
- [ ] TBD
|
|
101
|
-
|
|
102
|
-
## Rollback Plan
|
|
103
|
-
|
|
104
|
-
- [ ] TBD
|
|
105
|
-
EOF
|
|
106
|
-
|
|
107
|
-
cat > "$dir/TEST_CONTRACT.md" <<'EOF'
|
|
108
|
-
# Test Contract
|
|
109
|
-
|
|
110
|
-
- [ ] Reproduction fails before fix
|
|
111
|
-
- [ ] Regression test or verification fails before fix
|
|
112
|
-
- [ ] Regression test or verification passes after fix
|
|
113
|
-
- [ ] Related edge case is covered
|
|
114
|
-
EOF
|
|
115
|
-
|
|
116
|
-
cat > "$dir/TASKS.md" <<'EOF'
|
|
117
|
-
# Tasks
|
|
118
|
-
|
|
119
|
-
- [ ] Read PITFALLS.md
|
|
120
|
-
- [ ] Read LESSONS_LEARNED.md
|
|
121
|
-
- [ ] Reproduce bug
|
|
122
|
-
- [ ] Identify root cause
|
|
123
|
-
- [ ] Write regression test or verification
|
|
124
|
-
- [ ] Fix bug
|
|
125
|
-
- [ ] Run verification
|
|
126
|
-
- [ ] Update LESSONS_LEARNED.md
|
|
127
|
-
- [ ] Update docs if behavior changed
|
|
128
|
-
- [ ] Review changed files
|
|
129
|
-
- [ ] Update STATE.md
|
|
130
|
-
- [ ] Update SPEC_CHANGELOG.md if needed
|
|
131
|
-
EOF
|
|
132
|
-
|
|
133
|
-
cat > "$dir/VERIFICATION.md" <<'EOF'
|
|
134
|
-
# Verification
|
|
135
|
-
|
|
136
|
-
- [ ] Define reproduction command
|
|
137
|
-
- [ ] Run failing verification before fix
|
|
138
|
-
- [ ] Run passing verification after fix
|
|
139
|
-
|
|
140
|
-
| Command | Result | Evidence |
|
|
141
|
-
|---|---|---|
|
|
142
|
-
| TBD | TBD | TBD |
|
|
143
|
-
EOF
|
|
144
|
-
|
|
145
|
-
cat > "$dir/REVIEW.md" <<'EOF'
|
|
146
|
-
# Review
|
|
147
|
-
|
|
148
|
-
- [ ] Changed files reviewed
|
|
149
|
-
- [ ] Regression coverage checked
|
|
150
|
-
- [ ] Docs impact checked
|
|
151
|
-
- [ ] Debug logs removed
|
|
152
|
-
|
|
153
|
-
## Findings
|
|
154
|
-
|
|
155
|
-
| Severity | File | Issue | Follow-Up |
|
|
156
|
-
|---|---|---|---|
|
|
157
|
-
| TBD | TBD | TBD | TBD |
|
|
158
|
-
EOF
|
|
159
|
-
|
|
160
|
-
echo "$dir"
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
echo "Usage: $0 <slug> [summary] [root]" >&2
|
|
6
|
+
exit 2
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
slug="${1:-}"
|
|
10
|
+
summary="${2:-TBD}"
|
|
11
|
+
root="${3:-.}"
|
|
12
|
+
[ -n "$slug" ] || usage
|
|
13
|
+
|
|
14
|
+
case "$slug" in
|
|
15
|
+
*[!a-z0-9-]*|'') echo "Slug must use lowercase letters, numbers, and hyphens." >&2; exit 2 ;;
|
|
16
|
+
esac
|
|
17
|
+
|
|
18
|
+
cd "$root"
|
|
19
|
+
mkdir -p .planning/bugs
|
|
20
|
+
|
|
21
|
+
next="$(
|
|
22
|
+
find .planning/bugs -maxdepth 1 -type d -name '[0-9][0-9][0-9]-*' 2>/dev/null \
|
|
23
|
+
| sed -E 's#.*/([0-9]{3})-.*#\1#' \
|
|
24
|
+
| sort -n \
|
|
25
|
+
| tail -1
|
|
26
|
+
)"
|
|
27
|
+
if [ -z "$next" ]; then
|
|
28
|
+
number="001"
|
|
29
|
+
else
|
|
30
|
+
number="$(printf '%03d' "$((10#$next + 1))")"
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
dir=".planning/bugs/${number}-${slug}"
|
|
34
|
+
if [ -e "$dir" ]; then
|
|
35
|
+
echo "Bug directory already exists: $dir" >&2
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
mkdir -p "$dir"
|
|
40
|
+
|
|
41
|
+
cat > "$dir/REPORT.md" <<EOF
|
|
42
|
+
# Bug Report: $summary
|
|
43
|
+
|
|
44
|
+
## Summary
|
|
45
|
+
|
|
46
|
+
$summary
|
|
47
|
+
|
|
48
|
+
## Expected Behavior
|
|
49
|
+
|
|
50
|
+
- [ ] TBD
|
|
51
|
+
|
|
52
|
+
## Actual Behavior
|
|
53
|
+
|
|
54
|
+
- [ ] TBD
|
|
55
|
+
|
|
56
|
+
## Reproduction Steps
|
|
57
|
+
|
|
58
|
+
- [ ] TBD
|
|
59
|
+
|
|
60
|
+
## Environment
|
|
61
|
+
|
|
62
|
+
TBD
|
|
63
|
+
EOF
|
|
64
|
+
|
|
65
|
+
cat > "$dir/ROOT_CAUSE.md" <<'EOF'
|
|
66
|
+
# Root Cause
|
|
67
|
+
|
|
68
|
+
## Evidence
|
|
69
|
+
|
|
70
|
+
- [ ] TBD
|
|
71
|
+
|
|
72
|
+
## Root Cause
|
|
73
|
+
|
|
74
|
+
TBD
|
|
75
|
+
|
|
76
|
+
## Failed Assumption
|
|
77
|
+
|
|
78
|
+
TBD
|
|
79
|
+
|
|
80
|
+
## Correct Pattern
|
|
81
|
+
|
|
82
|
+
TBD
|
|
83
|
+
EOF
|
|
84
|
+
|
|
85
|
+
cat > "$dir/PLAN.md" <<'EOF'
|
|
86
|
+
# Plan
|
|
87
|
+
|
|
88
|
+
## Files To Change
|
|
89
|
+
|
|
90
|
+
### File: `path/to/file`
|
|
91
|
+
|
|
92
|
+
Change:
|
|
93
|
+
Why:
|
|
94
|
+
Risk:
|
|
95
|
+
Test:
|
|
96
|
+
Docs impact:
|
|
97
|
+
|
|
98
|
+
## Fix Steps
|
|
99
|
+
|
|
100
|
+
- [ ] TBD
|
|
101
|
+
|
|
102
|
+
## Rollback Plan
|
|
103
|
+
|
|
104
|
+
- [ ] TBD
|
|
105
|
+
EOF
|
|
106
|
+
|
|
107
|
+
cat > "$dir/TEST_CONTRACT.md" <<'EOF'
|
|
108
|
+
# Test Contract
|
|
109
|
+
|
|
110
|
+
- [ ] Reproduction fails before fix
|
|
111
|
+
- [ ] Regression test or verification fails before fix
|
|
112
|
+
- [ ] Regression test or verification passes after fix
|
|
113
|
+
- [ ] Related edge case is covered
|
|
114
|
+
EOF
|
|
115
|
+
|
|
116
|
+
cat > "$dir/TASKS.md" <<'EOF'
|
|
117
|
+
# Tasks
|
|
118
|
+
|
|
119
|
+
- [ ] Read PITFALLS.md
|
|
120
|
+
- [ ] Read LESSONS_LEARNED.md
|
|
121
|
+
- [ ] Reproduce bug
|
|
122
|
+
- [ ] Identify root cause
|
|
123
|
+
- [ ] Write regression test or verification
|
|
124
|
+
- [ ] Fix bug
|
|
125
|
+
- [ ] Run verification
|
|
126
|
+
- [ ] Update LESSONS_LEARNED.md
|
|
127
|
+
- [ ] Update docs if behavior changed
|
|
128
|
+
- [ ] Review changed files
|
|
129
|
+
- [ ] Update STATE.md
|
|
130
|
+
- [ ] Update SPEC_CHANGELOG.md if needed
|
|
131
|
+
EOF
|
|
132
|
+
|
|
133
|
+
cat > "$dir/VERIFICATION.md" <<'EOF'
|
|
134
|
+
# Verification
|
|
135
|
+
|
|
136
|
+
- [ ] Define reproduction command
|
|
137
|
+
- [ ] Run failing verification before fix
|
|
138
|
+
- [ ] Run passing verification after fix
|
|
139
|
+
|
|
140
|
+
| Command | Result | Evidence |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| TBD | TBD | TBD |
|
|
143
|
+
EOF
|
|
144
|
+
|
|
145
|
+
cat > "$dir/REVIEW.md" <<'EOF'
|
|
146
|
+
# Review
|
|
147
|
+
|
|
148
|
+
- [ ] Changed files reviewed
|
|
149
|
+
- [ ] Regression coverage checked
|
|
150
|
+
- [ ] Docs impact checked
|
|
151
|
+
- [ ] Debug logs removed
|
|
152
|
+
|
|
153
|
+
## Findings
|
|
154
|
+
|
|
155
|
+
| Severity | File | Issue | Follow-Up |
|
|
156
|
+
|---|---|---|---|
|
|
157
|
+
| TBD | TBD | TBD | TBD |
|
|
158
|
+
EOF
|
|
159
|
+
|
|
160
|
+
echo "$dir"
|