codex-genesis-harness 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/.codebase/COMPRESSED_CONTEXT.md +80 -0
  2. package/.codebase/CURRENT_STATE.md +10 -10
  3. package/.codebase/DEPENDENCY_GRAPH.md +14 -1
  4. package/.codebase/IMPLEMENTATION_HANDOFF.md +34 -336
  5. package/.codebase/KNOWN_PROBLEMS.md +73 -3
  6. package/.codebase/MODULE_INDEX.md +23 -2
  7. package/.codebase/PIPELINE_FLOW.md +16 -6
  8. package/.codebase/RECOVERY_POINTS.md +80 -78
  9. package/.codebase/TECH_DEBT.md +6 -0
  10. package/.codebase/TEST_MATRIX.md +8 -3
  11. package/.codebase/VISUAL_GRAPH.md +127 -0
  12. package/.codebase/context-policy.json +68 -0
  13. package/.codebase/memories/lessons_learned.md +63 -0
  14. package/.codebase/memories/preferences.md +17 -0
  15. package/.codebase/state.json +156 -17
  16. package/.codex/skills/genesis-architecture/SKILL.md +5 -0
  17. package/.codex/skills/genesis-debug-guide/SKILL.md +10 -4
  18. package/.codex/skills/genesis-docs-automation/SKILL.md +52 -973
  19. package/.codex/skills/genesis-executing-plans/SKILL.md +54 -0
  20. package/.codex/skills/genesis-executing-plans/agents/openai.yaml +6 -0
  21. package/.codex/skills/genesis-executing-plans/checklists/.gitkeep +0 -0
  22. package/.codex/skills/genesis-executing-plans/examples/.gitkeep +0 -0
  23. package/.codex/skills/genesis-executing-plans/templates/.gitkeep +0 -0
  24. package/.codex/skills/genesis-harness/SKILL.md +73 -1385
  25. package/.codex/skills/genesis-harness/agents/openai.yaml +1 -2
  26. package/.codex/skills/genesis-harness/references/state-machine.md +4 -1
  27. package/.codex/skills/genesis-harness/references/workflows.md +7 -1
  28. package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +3 -3
  29. package/.codex/skills/genesis-harness/scripts/init-planning.sh +246 -14
  30. package/.codex/skills/genesis-new-design/SKILL.md +4 -1
  31. package/.codex/skills/genesis-new-design/agents/openai.yaml +2 -0
  32. package/.codex/skills/genesis-observability-automation/SKILL.md +69 -303
  33. package/.codex/skills/genesis-observability-automation/references/common-mistakes-and-recovery.md +84 -0
  34. package/.codex/skills/genesis-observability-automation/references/workflow-phases.md +78 -0
  35. package/.codex/skills/genesis-performance-profiling/SKILL.md +1 -22
  36. package/.codex/skills/genesis-performance-profiling/agents/openai.yaml +1 -1
  37. package/.codex/skills/genesis-pipeline-orchestration/SKILL.md +15 -3
  38. package/.codex/skills/genesis-planning/SKILL.md +6 -1
  39. package/.codex/skills/genesis-release/SKILL.md +5 -0
  40. package/.codex/skills/genesis-research-first/SKILL.md +6 -0
  41. package/.codex/skills/genesis-spec-propagation/SKILL.md +52 -504
  42. package/.codex/skills/genesis-test-driven-development/SKILL.md +55 -0
  43. package/.codex/skills/genesis-test-driven-development/agents/openai.yaml +6 -0
  44. package/.codex/skills/genesis-test-driven-development/checklists/.gitkeep +0 -0
  45. package/.codex/skills/genesis-test-driven-development/examples/.gitkeep +0 -0
  46. package/.codex/skills/genesis-test-driven-development/templates/.gitkeep +0 -0
  47. package/.codex/skills/genesis-upgrade-design/SKILL.md +4 -2
  48. package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +2 -0
  49. package/.codex/skills/genesis-using-git-worktrees/SKILL.md +54 -0
  50. package/.codex/skills/genesis-using-git-worktrees/agents/openai.yaml +6 -0
  51. package/.codex/skills/genesis-using-git-worktrees/checklists/.gitkeep +0 -0
  52. package/.codex/skills/genesis-using-git-worktrees/examples/.gitkeep +0 -0
  53. package/.codex/skills/genesis-using-git-worktrees/templates/.gitkeep +0 -0
  54. package/.codex/skills/genesis-verification-before-completion/SKILL.md +53 -0
  55. package/.codex/skills/genesis-verification-before-completion/agents/openai.yaml +6 -0
  56. package/.codex/skills/genesis-verification-before-completion/checklists/.gitkeep +0 -0
  57. package/.codex/skills/genesis-verification-before-completion/examples/.gitkeep +0 -0
  58. package/.codex/skills/genesis-verification-before-completion/templates/.gitkeep +0 -0
  59. package/.codex/skills/spec-impact-engine/SKILL.md +77 -500
  60. package/.codex/skills/spec-impact-engine/checklists/checklist.md +10 -0
  61. package/.codex-plugin/plugin.json +6 -5
  62. package/CHANGELOG.md +25 -1
  63. package/README.EN.md +74 -17
  64. package/README.VI.md +77 -19
  65. package/README.md +126 -10
  66. package/VERSION +1 -2
  67. package/bin/genesis-harness.js +2979 -149
  68. package/contracts/features/project-registry-schema.json +37 -0
  69. package/contracts/features/registry-schema.json +15 -0
  70. package/contracts/observability/agent-run-schema.json +39 -0
  71. package/contracts/observability/failure-schema.json +35 -0
  72. package/contracts/ui/auth/login-screen-contract.json +43 -0
  73. package/features/REGISTRY.md +65 -0
  74. package/features/SCOPE-template.md +65 -0
  75. package/fixtures/pipeline/end-to-end-project-lifecycle-fixture.md +39 -0
  76. package/fixtures/pipeline/feature-completion-fixture.md +26 -0
  77. package/fixtures/pipeline/run-to-feature-execution-fixture.md +20 -0
  78. package/fixtures/planning/MOCKUP_PROMPT_TEMPLATE.md +16 -0
  79. package/observability/agent-runs/sample-run.json +13 -0
  80. package/observability/decision-logs/sample-decision.md +43 -0
  81. package/observability/failures/sample-failure.json +12 -0
  82. package/package.json +15 -4
  83. package/playwright/e2e/app-template.spec.js +37 -0
  84. package/playwright/e2e/auth/login-screen.spec.js +65 -0
  85. package/playwright/e2e/web-template.spec.js +28 -0
  86. package/scripts/check-repository-hygiene.js +48 -0
  87. package/scripts/check-scope.sh +100 -0
  88. package/scripts/cold-start-check.js +133 -0
  89. package/scripts/install.sh +4 -0
  90. package/scripts/prompt_sentinel.js +35 -4
  91. package/scripts/run-evals.sh +152 -3
  92. package/scripts/schema/001-init.sql +129 -0
  93. package/scripts/schema/002-story-verify.sql +9 -0
  94. package/scripts/schema/003-tool-registry.sql +15 -0
  95. package/scripts/schema/004-intervention.sql +15 -0
  96. package/scripts/scratch_parser.js +49 -0
  97. package/scripts/spec_visual_sync.js +1 -1
  98. package/scripts/test_generator.js +2 -2
  99. package/scripts/transition_state.sh +32 -8
  100. package/scripts/uninstall.sh +4 -0
  101. package/scripts/validation_gates.sh +2 -80
  102. package/scripts/verify.sh +19 -2
  103. package/tests/fixtures/fixture-index.md +5 -0
  104. package/tests/integration/cli-smoke.test.js +506 -0
  105. package/tests/unit/feature_registry.test.js +152 -0
  106. package/tests/unit/prompt_sentinel.test.js +1 -1
  107. package/tests/unit/repository_hygiene.test.js +17 -0
  108. package/tests/unit/spec_visual_sync.test.js +1 -1
  109. package/tests/unit/state_metadata.test.js +76 -0
  110. package/tests/unit/test_generator.test.js +1 -1
  111. package/tests/unit/verify_gate.test.js +25 -0
  112. package/tests/unit/workflow_contracts.test.js +90 -0
  113. package/fixtures/tts/tts-fixture-template.md +0 -14
  114. package/fixtures/videos/video-fixture-template.md +0 -14
  115. package/playwright/e2e/e2e-template.md +0 -4
@@ -0,0 +1,129 @@
1
+ -- Harness v0 schema — migration 001
2
+ -- Durable layer for operational harness data.
3
+ -- Policy docs (HARNESS.md, FEATURE_INTAKE.md, ARCHITECTURE.md) stay as
4
+ -- human-readable references. This database stores the operational records
5
+ -- that agents produce and query during work.
6
+
7
+ PRAGMA journal_mode = WAL;
8
+ PRAGMA foreign_keys = ON;
9
+
10
+ ----------------------------------------------------------------------
11
+ -- Schema version
12
+ ----------------------------------------------------------------------
13
+ CREATE TABLE IF NOT EXISTS schema_version (
14
+ version INTEGER PRIMARY KEY,
15
+ applied_at TEXT NOT NULL DEFAULT (datetime('now'))
16
+ );
17
+
18
+ INSERT INTO schema_version (version) VALUES (1);
19
+
20
+ ----------------------------------------------------------------------
21
+ -- Intake: classifying incoming work
22
+ ----------------------------------------------------------------------
23
+ CREATE TABLE intake (
24
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
25
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
26
+ input_type TEXT NOT NULL
27
+ CHECK(input_type IN (
28
+ 'new_spec','spec_slice','change_request',
29
+ 'new_initiative','maintenance','harness_improvement'
30
+ )),
31
+ summary TEXT NOT NULL,
32
+ risk_lane TEXT NOT NULL
33
+ CHECK(risk_lane IN ('tiny','normal','high_risk')),
34
+ risk_flags TEXT, -- JSON array, e.g. ["auth","data_model"]
35
+ affected_docs TEXT, -- JSON array of doc paths
36
+ story_id TEXT, -- links to story.id when one is created
37
+ notes TEXT
38
+ );
39
+
40
+ ----------------------------------------------------------------------
41
+ -- Story: work packets and their validation status
42
+ -- Replaces hand-edited TEST_MATRIX.md rows.
43
+ ----------------------------------------------------------------------
44
+ CREATE TABLE story (
45
+ id TEXT PRIMARY KEY, -- e.g. US-001
46
+ title TEXT NOT NULL,
47
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
48
+ risk_lane TEXT NOT NULL
49
+ CHECK(risk_lane IN ('tiny','normal','high_risk')),
50
+ contract_doc TEXT, -- path to product doc
51
+ status TEXT NOT NULL DEFAULT 'planned'
52
+ CHECK(status IN (
53
+ 'planned','in_progress','implemented','changed','retired'
54
+ )),
55
+ unit_proof INTEGER NOT NULL DEFAULT 0,
56
+ integration_proof INTEGER NOT NULL DEFAULT 0,
57
+ e2e_proof INTEGER NOT NULL DEFAULT 0,
58
+ platform_proof INTEGER NOT NULL DEFAULT 0,
59
+ evidence TEXT,
60
+ notes TEXT
61
+ );
62
+
63
+ ----------------------------------------------------------------------
64
+ -- Decision: durable records with optional verification
65
+ ----------------------------------------------------------------------
66
+ CREATE TABLE decision (
67
+ id TEXT PRIMARY KEY, -- e.g. 0001
68
+ title TEXT NOT NULL,
69
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
70
+ status TEXT NOT NULL DEFAULT 'proposed'
71
+ CHECK(status IN (
72
+ 'proposed','accepted','superseded','rejected'
73
+ )),
74
+ doc_path TEXT, -- path to the markdown ADR
75
+ verify_command TEXT, -- optional check command
76
+ last_verified_at TEXT,
77
+ last_verified_result TEXT
78
+ CHECK(last_verified_result IN ('pass','fail') OR
79
+ last_verified_result IS NULL),
80
+ predicted_impact TEXT,
81
+ actual_outcome TEXT,
82
+ notes TEXT
83
+ );
84
+
85
+ ----------------------------------------------------------------------
86
+ -- Backlog: harness improvement proposals with evidence loop
87
+ ----------------------------------------------------------------------
88
+ CREATE TABLE backlog (
89
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
90
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
91
+ title TEXT NOT NULL,
92
+ discovered_while TEXT,
93
+ current_pain TEXT,
94
+ suggested_improvement TEXT,
95
+ risk TEXT CHECK(risk IN ('tiny','normal','high_risk')),
96
+ status TEXT NOT NULL DEFAULT 'proposed'
97
+ CHECK(status IN (
98
+ 'proposed','accepted','implemented','rejected'
99
+ )),
100
+ predicted_impact TEXT,
101
+ actual_outcome TEXT,
102
+ implemented_at TEXT,
103
+ notes TEXT
104
+ );
105
+
106
+ ----------------------------------------------------------------------
107
+ -- Trace: agent task execution records (observability foundation)
108
+ ----------------------------------------------------------------------
109
+ CREATE TABLE trace (
110
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
111
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
112
+ task_summary TEXT NOT NULL,
113
+ intake_id INTEGER REFERENCES intake(id),
114
+ story_id TEXT REFERENCES story(id),
115
+ agent TEXT,
116
+ actions_taken TEXT, -- JSON array
117
+ files_read TEXT, -- JSON array
118
+ files_changed TEXT, -- JSON array
119
+ decisions_made TEXT, -- JSON array
120
+ errors TEXT, -- JSON array
121
+ outcome TEXT
122
+ CHECK(outcome IN (
123
+ 'completed','blocked','partial','failed'
124
+ )),
125
+ duration_seconds INTEGER,
126
+ token_estimate INTEGER,
127
+ harness_friction TEXT,
128
+ notes TEXT
129
+ );
@@ -0,0 +1,9 @@
1
+ -- Harness v0 schema - migration 002
2
+ -- Story-level mechanical verification.
3
+
4
+ ALTER TABLE story ADD COLUMN verify_command TEXT;
5
+ ALTER TABLE story ADD COLUMN last_verified_at TEXT;
6
+ ALTER TABLE story ADD COLUMN last_verified_result TEXT
7
+ CHECK(last_verified_result IN ('pass','fail') OR last_verified_result IS NULL);
8
+
9
+ INSERT INTO schema_version (version) VALUES (2);
@@ -0,0 +1,15 @@
1
+ -- Harness v0 schema - migration 003
2
+ -- Machine-readable registry for user-provided project tools.
3
+
4
+ CREATE TABLE tool (
5
+ name TEXT PRIMARY KEY,
6
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
7
+ provider TEXT NOT NULL DEFAULT 'custom',
8
+ command TEXT NOT NULL,
9
+ description TEXT NOT NULL,
10
+ args TEXT,
11
+ responsibility TEXT NOT NULL,
12
+ since TEXT NOT NULL DEFAULT 'registered'
13
+ );
14
+
15
+ INSERT INTO schema_version (version) VALUES (3);
@@ -0,0 +1,15 @@
1
+ -- Harness v0 schema - migration 004
2
+ -- Review, human, CI, or agent interventions separated from normal traces.
3
+
4
+ CREATE TABLE intervention (
5
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
6
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
7
+ trace_id INTEGER REFERENCES trace(id),
8
+ story_id TEXT,
9
+ type TEXT NOT NULL CHECK(type IN ('correction','override','escalation','approval')),
10
+ description TEXT NOT NULL,
11
+ source TEXT NOT NULL CHECK(source IN ('human','reviewer','ci','agent')),
12
+ impact TEXT
13
+ );
14
+
15
+ INSERT INTO schema_version (version) VALUES (4);
@@ -0,0 +1,49 @@
1
+ const fs = require('fs');
2
+ const parser = require('@babel/parser');
3
+ const traverse = require('@babel/traverse').default;
4
+
5
+ const code = `
6
+ import { something } from './my-module';
7
+ const x = require('another-module');
8
+ export class MyClass {}
9
+ export function myFunc() {}
10
+ export const myArrow = async () => {};
11
+ `;
12
+
13
+ const ast = parser.parse(code, {
14
+ sourceType: 'module',
15
+ plugins: ['typescript']
16
+ });
17
+
18
+ const exportsList = [];
19
+ const importsList = [];
20
+
21
+ traverse(ast, {
22
+ ExportNamedDeclaration(path) {
23
+ const decl = path.node.declaration;
24
+ if (decl) {
25
+ if (decl.type === 'ClassDeclaration' && decl.id) {
26
+ exportsList.push('class ' + decl.id.name);
27
+ } else if (decl.type === 'FunctionDeclaration' && decl.id) {
28
+ exportsList.push('function ' + decl.id.name);
29
+ } else if (decl.type === 'VariableDeclaration') {
30
+ decl.declarations.forEach(d => {
31
+ if (d.id) exportsList.push('const ' + d.id.name);
32
+ });
33
+ }
34
+ }
35
+ },
36
+ ImportDeclaration(path) {
37
+ importsList.push(path.node.source.value);
38
+ },
39
+ CallExpression(path) {
40
+ if (path.node.callee.name === 'require' && path.node.arguments.length > 0) {
41
+ if (path.node.arguments[0].type === 'StringLiteral') {
42
+ importsList.push(path.node.arguments[0].value);
43
+ }
44
+ }
45
+ }
46
+ });
47
+
48
+ console.log('Exports:', exportsList);
49
+ console.log('Imports:', importsList);
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * Spec Visual Sync - Bi-directional AST Sync between Mermaid ERD and JSON Contracts
5
- * Part of Genesis Codex Harness v0.1.7
5
+ * Part of Genesis Codex Harness v0.1.8
6
6
  */
7
7
 
8
8
  const fs = require('fs');
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * Contract-Driven Test Auto-Generator
5
- * Part of Genesis Codex Harness v0.1.7
5
+ * Part of Genesis Codex Harness v0.1.8
6
6
  */
7
7
 
8
8
  const fs = require('fs');
@@ -62,7 +62,7 @@ const requiredFields = schema.required || Object.keys(properties);
62
62
  // Construct test cases content
63
63
  let testSuiteCode = `/**
64
64
  * Integration Test for Endpoint: /api/${endpoint}
65
- * Automatically generated by Genesis Contract-Driven Test Generator (v0.1.7)
65
+ * Automatically generated by Genesis Contract-Driven Test Generator (v0.1.8)
66
66
  * Strictly Enforces TDD Contract Compliance.
67
67
  */
68
68
 
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ set -euo pipefail
4
+
3
5
  if [ -z "$1" ]; then
4
6
  echo "Usage: bash scripts/transition_state.sh <NEW_STATE> [Reason]"
5
7
  exit 1
@@ -30,14 +32,16 @@ const fs = require('fs');
30
32
  const file = '$STATE_FILE';
31
33
  const newState = '$NEW_STATE';
32
34
  const reason = '$REASON';
35
+ const now = new Date().toISOString();
33
36
 
34
37
  const allowed = {
35
38
  'INIT': ['REQUIREMENTS_GATHERING', 'PLANNING'],
36
39
  'REQUIREMENTS_GATHERING': ['PLANNING'],
37
40
  'PLANNING': ['IMPLEMENTATION'],
38
41
  'IMPLEMENTATION': ['VERIFICATION', 'PLANNING'],
39
- 'VERIFICATION': ['COMPLETED', 'IMPLEMENTATION'],
40
- 'COMPLETED': ['INIT', 'REQUIREMENTS_GATHERING']
42
+ 'VERIFICATION': ['RELEASE_READY', 'IMPLEMENTATION'],
43
+ 'RELEASE_READY': ['COMPLETED', 'IMPLEMENTATION'],
44
+ 'COMPLETED': ['INIT', 'REQUIREMENTS_GATHERING', 'IMPLEMENTATION']
41
45
  };
42
46
 
43
47
  let data = JSON.parse(fs.readFileSync(file, 'utf8'));
@@ -45,8 +49,18 @@ const current = data.current_state || 'INIT';
45
49
 
46
50
  if (allowed[current] && allowed[current].includes(newState)) {
47
51
  data.history = data.history || [];
48
- data.history.push({ from: current, to: newState, reason: reason, timestamp: new Date().toISOString() });
52
+ data.history.push({ from: current, to: newState, reason: reason, timestamp: now, session_id: data.session_id || 'manual-transition' });
49
53
  data.current_state = newState;
54
+ data.session_started_at = data.session_started_at || now;
55
+ data.last_updated_at = now;
56
+ if (newState === 'COMPLETED') {
57
+ data.completed_at = now;
58
+ data.active_work = '';
59
+ data.pending_tasks = [];
60
+ data.latest_recovery_point = reason;
61
+ } else {
62
+ delete data.completed_at;
63
+ }
50
64
  fs.writeFileSync(file, JSON.stringify(data, null, 2));
51
65
  console.log('Transition successful: ' + current + ' -> ' + newState);
52
66
  } else {
@@ -56,11 +70,21 @@ if (allowed[current] && allowed[current].includes(newState)) {
56
70
  "
57
71
 
58
72
  if [ $? -eq 0 ]; then
59
- echo "# Current State: $NEW_STATE" > "$CURRENT_STATE_MD"
60
- echo "Last updated: $(date)" >> "$CURRENT_STATE_MD"
61
- echo "" >> "$CURRENT_STATE_MD"
62
- echo "## Reason" >> "$CURRENT_STATE_MD"
63
- echo "$REASON" >> "$CURRENT_STATE_MD"
73
+ SESSION_ID=$(node -p "JSON.parse(require('fs').readFileSync('$STATE_FILE', 'utf8')).session_id || 'manual-transition'")
74
+ TTFV_SECONDS=$(node -p "JSON.parse(require('fs').readFileSync('$STATE_FILE', 'utf8')).ttfv_seconds || 0")
75
+ cat > "$CURRENT_STATE_MD" <<EOF
76
+ # Current System State
77
+
78
+ **Time**: $(date +%F)
79
+ **Status**: \`$NEW_STATE\`
80
+ **Latest Session**: \`$SESSION_ID\`
81
+ **Time to First Verification (TTFV)**: ${TTFV_SECONDS}s
82
+
83
+ ## Latest Transition
84
+
85
+ - State changed to \`$NEW_STATE\`
86
+ - Reason: $REASON
87
+ EOF
64
88
  exit 0
65
89
  else
66
90
  exit 1
@@ -23,6 +23,10 @@ skill_names=(
23
23
  genesis-research-first
24
24
  genesis-release
25
25
  spec-impact-engine
26
+ genesis-executing-plans
27
+ genesis-test-driven-development
28
+ genesis-verification-before-completion
29
+ genesis-using-git-worktrees
26
30
  project-genesis-harness
27
31
  )
28
32
  codex_home="${CODEX_HOME:-$HOME/.codex}"
@@ -1,85 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
- echo "====================================="
5
- echo " RUNNING VALIDATION GATES "
6
- echo "====================================="
7
-
8
4
  repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
9
- FAILURES=0
10
-
11
- fail() {
12
- echo "❌ VALIDATION FAILED: $*" >&2
13
- FAILURES=$((FAILURES + 1))
14
- }
15
-
16
- echo "1. Checking for leftover debug logs and TODOs..."
17
- # Exclude node_modules, .git, .codex, scripts, .codebase, bin, and md files
18
- EXCLUDES="--exclude-dir=node_modules --exclude-dir=.git --exclude-dir=.codex --exclude-dir=scripts --exclude-dir=.codebase --exclude-dir=bin --exclude=*.md"
19
-
20
- # We check for TODO, FIXME, console.log, print( (python)
21
- # Using grep recursively
22
- if grep -rn $EXCLUDES -E 'TODO|FIXME|console\.log|print\(' "$repo_root" | grep -v 'validation_gates.sh'; then
23
- fail "Found unresolved TODOs or leftover debug logs in codebase!"
24
- else
25
- echo "✅ Codebase cleanliness gate passed."
26
- fi
27
-
28
- echo "2. Verifying Harness Integrity..."
29
- if [ -f "$repo_root/scripts/verify.sh" ]; then
30
- if bash "$repo_root/scripts/verify.sh" > /dev/null 2>&1; then
31
- echo "✅ Harness Integrity gate passed."
32
- else
33
- fail "verify.sh failed. Core files or templates are missing."
34
- fi
35
- fi
36
-
37
- echo "3. Checking for Documentation Drift (Alignment with Code changes)..."
38
- if [ -d "$repo_root/.git" ]; then
39
- # Get list of modified files in git
40
- CHANGED_FILES=$(git diff --name-only HEAD 2>/dev/null || true)
41
-
42
- if [ -n "$CHANGED_FILES" ]; then
43
- # API Drift: code under src/ modified, but API contracts not updated
44
- if echo "$CHANGED_FILES" | grep -qE "src/.*api|src/.*endpoint|src/.*route" && ! echo "$CHANGED_FILES" | grep -qE "contracts/api/|.codebase/API_CONTRACTS.md|.planning/API_DOCS.md"; then
45
- echo "⚠️ WARNING: You changed API code under src/ but did not update API_CONTRACTS.md, API_DOCS.md or contracts/api/!"
46
- fi
47
-
48
- # Database Drift: models or schemas modified, but DOMAIN_MODELS.md not updated
49
- if echo "$CHANGED_FILES" | grep -qE "model|schema|db" && ! echo "$CHANGED_FILES" | grep -qE ".codebase/DOMAIN_MODELS.md"; then
50
- echo "⚠️ WARNING: You changed database/model files but did not update DOMAIN_MODELS.md!"
51
- fi
52
-
53
- # Test Drift: test files modified, but TEST_MATRIX.md not updated
54
- if echo "$CHANGED_FILES" | grep -qE "tests/|playwright/" && ! echo "$CHANGED_FILES" | grep -qE ".codebase/TEST_MATRIX.md"; then
55
- echo "⚠️ WARNING: You changed test files but did not update TEST_MATRIX.md!"
56
- fi
57
-
58
- # Dependency Drift: package.json dependencies modified, but DEPENDENCY_GRAPH.md not updated
59
- if echo "$CHANGED_FILES" | grep -q "package.json" && ! echo "$CHANGED_FILES" | grep -q ".codebase/DEPENDENCY_GRAPH.md"; then
60
- if git diff package.json 2>/dev/null | grep -qE '^\+.*"(dependencies|devDependencies)"'; then
61
- echo "⚠️ WARNING: You updated package.json dependencies but did not update DEPENDENCY_GRAPH.md!"
62
- fi
63
- fi
64
- echo "✅ Documentation alignment check complete."
65
- fi
66
- else
67
- echo "⚠️ Git repository not found. Skipping drift check."
68
- fi
69
-
70
- echo "4. Running Pre-emptive Prompt Sentinel check..."
71
- if [ -f "$repo_root/scripts/prompt_sentinel.js" ] && [ -f "$repo_root/.codebase/CURRENT_STATE.md" ]; then
72
- # Run prompt sentinel check on the state file as a pre-flight test
73
- node "$repo_root/scripts/prompt_sentinel.js" --check "$repo_root/.codebase/CURRENT_STATE.md" --threshold 1500
74
- fi
75
-
76
-
77
5
 
78
- echo "====================================="
79
- if [ $FAILURES -gt 0 ]; then
80
- echo "❌ $FAILURES Validation Gate(s) failed."
81
- exit 1
82
- else
83
- echo "✅ All Validation Gates passed! Output is ready for production."
84
- exit 0
85
- fi
6
+ echo "Running canonical Genesis verification gate..."
7
+ exec node "$repo_root/bin/genesis-harness.js" verify-gate
package/scripts/verify.sh CHANGED
@@ -25,6 +25,10 @@ skill_names=(
25
25
  genesis-research-first
26
26
  genesis-release
27
27
  spec-impact-engine
28
+ genesis-executing-plans
29
+ genesis-test-driven-development
30
+ genesis-verification-before-completion
31
+ genesis-using-git-worktrees
28
32
  )
29
33
 
30
34
  required_memory_files=(
@@ -51,7 +55,7 @@ required_context_files=(
51
55
  )
52
56
 
53
57
  required_contract_roots=(api agents events ui)
54
- required_fixture_roots=(api agents pipeline render tts images videos)
58
+ required_fixture_roots=(api agents pipeline render images)
55
59
  required_test_roots=(contracts integration unit fixtures)
56
60
  required_playwright_roots=(e2e smoke visual fixtures)
57
61
  required_observability_roots=(agent-runs failures decision-logs)
@@ -117,7 +121,14 @@ required_scripts=(
117
121
  run-verify-loop.sh
118
122
  )
119
123
 
124
+ max_skill_lines=500
125
+
120
126
  fail() {
127
+ if [ "${VIBE_MODE:-0}" = "1" ]; then
128
+ echo "verify WARN (VIBE_MODE): $*" >&2
129
+ echo "- [$(date -u +"%Y-%m-%dT%H:%M:%SZ")] VIBE_MODE Bypass: Verify check failed - $*" >> "$repo_root/.codebase/TECH_DEBT.md"
130
+ return 0
131
+ fi
121
132
  echo "verify failed: $*" >&2
122
133
  exit 1
123
134
  }
@@ -169,12 +180,17 @@ verify_repository_harness() {
169
180
 
170
181
  verify_repository_harness
171
182
 
183
+ node "$repo_root/scripts/check-repository-hygiene.js"
184
+
172
185
  verify_skill_metadata() {
173
186
  local skill_dir="$1"
174
187
  local expected_name="$2"
188
+ local skill_lines
175
189
 
176
190
  [ -f "$skill_dir/SKILL.md" ] || fail "missing SKILL.md: $skill_dir"
177
191
  [ -f "$skill_dir/agents/openai.yaml" ] || fail "missing agents/openai.yaml: $skill_dir"
192
+ skill_lines="$(wc -l < "$skill_dir/SKILL.md" | tr -d ' ')"
193
+ [ "$skill_lines" -le "$max_skill_lines" ] || fail "SKILL.md exceeds ${max_skill_lines} lines ($skill_lines): $skill_dir"
178
194
  grep -q "^name: $expected_name[[:space:]]*$" "$skill_dir/SKILL.md" || fail "invalid skill name frontmatter (expected 'name: $expected_name'): $skill_dir"
179
195
  grep -q '^description:' "$skill_dir/SKILL.md" || fail "missing description frontmatter: $skill_dir"
180
196
  grep -q 'default_prompt:' "$skill_dir/agents/openai.yaml" || fail "missing default_prompt: $skill_dir"
@@ -246,6 +262,7 @@ verify_minimal_skill() {
246
262
  local skill_dir="$1"
247
263
 
248
264
  [ -d "$skill_dir/templates" ] || fail "missing templates/: $skill_dir"
265
+ [ -d "$skill_dir/checklists" ] || fail "missing checklists/: $skill_dir"
249
266
  [ -d "$skill_dir/examples" ] || fail "missing examples/: $skill_dir"
250
267
  }
251
268
 
@@ -264,7 +281,7 @@ verify_one() {
264
281
  genesis-new-design|genesis-upgrade-design)
265
282
  verify_design_skill "$skill_dir" "$dir_name"
266
283
  ;;
267
- genesis-architecture|genesis-planning|genesis-codebase-map|genesis-design-spec|genesis-api-contract|genesis-ui-ux-test|genesis-harness-engineering|genesis-ai-provider|genesis-pipeline-orchestration|genesis-api-sync)
284
+ genesis-architecture|genesis-planning|genesis-codebase-map|genesis-design-spec|genesis-api-contract|genesis-ui-ux-test|genesis-harness-engineering|genesis-ai-provider|genesis-pipeline-orchestration|genesis-api-sync|genesis-executing-plans|genesis-test-driven-development|genesis-verification-before-completion|genesis-using-git-worktrees)
268
285
  verify_skill_metadata "$skill_dir" "$dir_name"
269
286
  verify_skill_protocol "$skill_dir"
270
287
  ;;
@@ -2,3 +2,8 @@
2
2
 
3
3
  Map every fixture to the contract, test, and module it validates.
4
4
 
5
+ | Fixture | Validates | Test / Module |
6
+ |---|---|---|
7
+ | `fixtures/pipeline/run-to-feature-execution-fixture.md` | `run --idea` advances from discovery into active feature execution with resumable artifacts plus typed API/UI contract scaffolding | `tests/integration/cli-smoke.test.js`, `bin/genesis-harness.js` |
8
+ | `fixtures/pipeline/feature-completion-fixture.md` | `next` and `complete-feature` close an active feature only after executable verification and explicit evidence | `tests/integration/cli-smoke.test.js`, `bin/genesis-harness.js` |
9
+ | `fixtures/pipeline/end-to-end-project-lifecycle-fixture.md` | Multi-feature promotion, project-wide verification, release-ready handoff, idempotent completion, event history, and pipeline audit | `tests/integration/cli-smoke.test.js`, `bin/genesis-harness.js` |