codex-genesis-harness 0.1.7 → 0.1.8

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 (93) hide show
  1. package/.codebase/COMPRESSED_CONTEXT.md +80 -0
  2. package/.codebase/CURRENT_STATE.md +37 -11
  3. package/.codebase/DEPENDENCY_GRAPH.md +14 -1
  4. package/.codebase/IMPLEMENTATION_HANDOFF.md +34 -336
  5. package/.codebase/KNOWN_PROBLEMS.md +54 -3
  6. package/.codebase/MODULE_INDEX.md +8 -0
  7. package/.codebase/PIPELINE_FLOW.md +7 -5
  8. package/.codebase/RECOVERY_POINTS.md +17 -78
  9. package/.codebase/TECH_DEBT.md +6 -0
  10. package/.codebase/TEST_MATRIX.md +4 -3
  11. package/.codebase/VISUAL_GRAPH.md +127 -0
  12. package/.codebase/context-policy.json +68 -0
  13. package/.codebase/memories/lessons_learned.md +21 -0
  14. package/.codebase/memories/preferences.md +17 -0
  15. package/.codebase/state.json +45 -24
  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 +64 -1385
  25. package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +3 -3
  26. package/.codex/skills/genesis-harness/scripts/init-planning.sh +1 -1
  27. package/.codex/skills/genesis-new-design/SKILL.md +4 -1
  28. package/.codex/skills/genesis-new-design/agents/openai.yaml +2 -0
  29. package/.codex/skills/genesis-observability-automation/SKILL.md +69 -303
  30. package/.codex/skills/genesis-observability-automation/references/common-mistakes-and-recovery.md +84 -0
  31. package/.codex/skills/genesis-observability-automation/references/workflow-phases.md +78 -0
  32. package/.codex/skills/genesis-performance-profiling/SKILL.md +1 -22
  33. package/.codex/skills/genesis-performance-profiling/agents/openai.yaml +1 -1
  34. package/.codex/skills/genesis-planning/SKILL.md +6 -1
  35. package/.codex/skills/genesis-release/SKILL.md +5 -0
  36. package/.codex/skills/genesis-research-first/SKILL.md +6 -0
  37. package/.codex/skills/genesis-spec-propagation/SKILL.md +52 -504
  38. package/.codex/skills/genesis-test-driven-development/SKILL.md +55 -0
  39. package/.codex/skills/genesis-test-driven-development/agents/openai.yaml +6 -0
  40. package/.codex/skills/genesis-test-driven-development/checklists/.gitkeep +0 -0
  41. package/.codex/skills/genesis-test-driven-development/examples/.gitkeep +0 -0
  42. package/.codex/skills/genesis-test-driven-development/templates/.gitkeep +0 -0
  43. package/.codex/skills/genesis-upgrade-design/SKILL.md +4 -2
  44. package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +2 -0
  45. package/.codex/skills/genesis-using-git-worktrees/SKILL.md +54 -0
  46. package/.codex/skills/genesis-using-git-worktrees/agents/openai.yaml +6 -0
  47. package/.codex/skills/genesis-using-git-worktrees/checklists/.gitkeep +0 -0
  48. package/.codex/skills/genesis-using-git-worktrees/examples/.gitkeep +0 -0
  49. package/.codex/skills/genesis-using-git-worktrees/templates/.gitkeep +0 -0
  50. package/.codex/skills/genesis-verification-before-completion/SKILL.md +53 -0
  51. package/.codex/skills/genesis-verification-before-completion/agents/openai.yaml +6 -0
  52. package/.codex/skills/genesis-verification-before-completion/checklists/.gitkeep +0 -0
  53. package/.codex/skills/genesis-verification-before-completion/examples/.gitkeep +0 -0
  54. package/.codex/skills/genesis-verification-before-completion/templates/.gitkeep +0 -0
  55. package/.codex/skills/spec-impact-engine/SKILL.md +77 -500
  56. package/.codex/skills/spec-impact-engine/checklists/checklist.md +10 -0
  57. package/.codex-plugin/plugin.json +3 -4
  58. package/CHANGELOG.md +4 -1
  59. package/README.EN.md +32 -17
  60. package/README.VI.md +35 -19
  61. package/README.md +48 -10
  62. package/VERSION +1 -1
  63. package/bin/genesis-harness.js +735 -5
  64. package/contracts/features/registry-schema.json +15 -0
  65. package/contracts/observability/agent-run-schema.json +34 -0
  66. package/contracts/observability/failure-schema.json +35 -0
  67. package/contracts/ui/auth/login-screen-contract.json +43 -0
  68. package/features/REGISTRY.md +63 -0
  69. package/features/SCOPE-template.md +65 -0
  70. package/fixtures/planning/MOCKUP_PROMPT_TEMPLATE.md +16 -0
  71. package/observability/agent-runs/sample-run.json +13 -0
  72. package/observability/decision-logs/sample-decision.md +43 -0
  73. package/observability/failures/sample-failure.json +12 -0
  74. package/package.json +9 -3
  75. package/playwright/e2e/app-template.spec.js +37 -0
  76. package/playwright/e2e/auth/login-screen.spec.js +65 -0
  77. package/playwright/e2e/web-template.spec.js +28 -0
  78. package/scripts/check-scope.sh +100 -0
  79. package/scripts/cold-start-check.js +133 -0
  80. package/scripts/install.sh +4 -0
  81. package/scripts/prompt_sentinel.js +35 -4
  82. package/scripts/run-evals.sh +119 -3
  83. package/scripts/scratch_parser.js +49 -0
  84. package/scripts/spec_visual_sync.js +1 -1
  85. package/scripts/test_generator.js +2 -2
  86. package/scripts/uninstall.sh +4 -0
  87. package/scripts/verify.sh +16 -1
  88. package/tests/integration/cli-smoke.test.js +103 -0
  89. package/tests/unit/feature_registry.test.js +152 -0
  90. package/tests/unit/prompt_sentinel.test.js +1 -1
  91. package/tests/unit/spec_visual_sync.test.js +1 -1
  92. package/tests/unit/test_generator.test.js +1 -1
  93. package/playwright/e2e/e2e-template.md +0 -4
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ /**
5
+ * feature_registry.test.js
6
+ * L08 – Feature List as Harness Primitive
7
+ * L11 – Observability Bên Trong Harness
8
+ *
9
+ * Tests must FAIL before implementation (Red phase).
10
+ * Run: node tests/unit/feature_registry.test.js
11
+ */
12
+
13
+ const assert = require("assert");
14
+ const fs = require("fs");
15
+ const path = require("path");
16
+
17
+ const repoRoot = path.resolve(__dirname, "..", "..");
18
+
19
+ // ─────────────────────────────────────────────────────────────────────────────
20
+ // L08 — Feature Registry checks
21
+ // ─────────────────────────────────────────────────────────────────────────────
22
+
23
+ const REGISTRY_PATH = path.join(repoRoot, "features", "REGISTRY.md");
24
+ const REGISTRY_SCHEMA_PATH = path.join(repoRoot, "contracts", "features", "registry-schema.json");
25
+
26
+ // Test 1: features/REGISTRY.md phải tồn tại
27
+ assert(
28
+ fs.existsSync(REGISTRY_PATH),
29
+ "L08: features/REGISTRY.md must exist as machine-readable feature primitive"
30
+ );
31
+
32
+ // Test 2: REGISTRY.md phải chứa section machine-readable features table
33
+ const registryContent = fs.readFileSync(REGISTRY_PATH, "utf8");
34
+ assert(
35
+ registryContent.includes("| id |"),
36
+ "L08: REGISTRY.md must have a machine-readable table with 'id' column"
37
+ );
38
+ assert(
39
+ registryContent.includes("| status |"),
40
+ "L08: REGISTRY.md must have a 'status' column"
41
+ );
42
+ assert(
43
+ registryContent.includes("| verify_cmd |"),
44
+ "L08: REGISTRY.md must have a 'verify_cmd' column per feature"
45
+ );
46
+
47
+ // Test 3: Mỗi feature phải có trạng thái hợp lệ
48
+ const validStatuses = ["planned", "in-progress", "done", "verified", "deprecated"];
49
+ const tableRows = registryContent
50
+ .split("\n")
51
+ .filter(line => /^\|\s*F\d+\s*\|/.test(line)); // Only data rows from Feature Table (id starts with F)
52
+ assert(
53
+ tableRows.length > 0,
54
+ "L08: REGISTRY.md must have at least one feature entry (id must start with F, e.g. F001)"
55
+ );
56
+ for (const row of tableRows) {
57
+ const cols = row.split("|").map(c => c.trim()).filter(Boolean);
58
+ if (cols.length < 2) continue;
59
+ const status = cols[1];
60
+ assert(
61
+ validStatuses.includes(status),
62
+ `L08: Invalid status '${status}' in REGISTRY.md — must be one of: ${validStatuses.join(", ")}`
63
+ );
64
+ }
65
+
66
+ // Test 4: contracts/features/registry-schema.json phải tồn tại
67
+ assert(
68
+ fs.existsSync(REGISTRY_SCHEMA_PATH),
69
+ "L08: contracts/features/registry-schema.json must exist"
70
+ );
71
+ const schema = JSON.parse(fs.readFileSync(REGISTRY_SCHEMA_PATH, "utf8"));
72
+ assert(schema.version, "L08: registry-schema.json must have a version field");
73
+ assert(schema.required_columns, "L08: registry-schema.json must define required_columns");
74
+ assert(
75
+ Array.isArray(schema.required_columns) && schema.required_columns.includes("id"),
76
+ "L08: required_columns must include 'id'"
77
+ );
78
+
79
+ // Test 5: REGISTRY.md phải được đề cập trong MODULE_INDEX.md
80
+ const moduleIndex = fs.readFileSync(
81
+ path.join(repoRoot, ".codebase", "MODULE_INDEX.md"),
82
+ "utf8"
83
+ );
84
+ assert(
85
+ moduleIndex.includes("features/REGISTRY.md"),
86
+ "L08: features/REGISTRY.md must be listed in .codebase/MODULE_INDEX.md"
87
+ );
88
+
89
+ // ─────────────────────────────────────────────────────────────────────────────
90
+ // L11 — Observability Live Data checks
91
+ // ─────────────────────────────────────────────────────────────────────────────
92
+
93
+ const OBS_SCHEMA_PATH = path.join(repoRoot, "contracts", "observability", "agent-run-schema.json");
94
+ const OBS_SAMPLE_PATH = path.join(repoRoot, "observability", "agent-runs", "sample-run.json");
95
+ const OBS_FAILURE_SCHEMA_PATH = path.join(repoRoot, "contracts", "observability", "failure-schema.json");
96
+ const OBS_FAILURE_SAMPLE_PATH = path.join(repoRoot, "observability", "failures", "sample-failure.json");
97
+ const OBS_DECISION_SAMPLE_PATH = path.join(repoRoot, "observability", "decision-logs", "sample-decision.md");
98
+
99
+ // Test 6: contracts/observability/ phải có agent-run-schema.json
100
+ assert(
101
+ fs.existsSync(OBS_SCHEMA_PATH),
102
+ "L11: contracts/observability/agent-run-schema.json must exist"
103
+ );
104
+ const agentRunSchema = JSON.parse(fs.readFileSync(OBS_SCHEMA_PATH, "utf8"));
105
+ assert(agentRunSchema.required_fields, "L11: agent-run-schema.json must define required_fields");
106
+ const requiredRunFields = ["session_id", "timestamp", "skill", "phase", "outcome", "evidence"];
107
+ for (const field of requiredRunFields) {
108
+ assert(
109
+ agentRunSchema.required_fields.includes(field),
110
+ `L11: agent-run-schema.json must require field '${field}'`
111
+ );
112
+ }
113
+
114
+ // Test 7: observability/agent-runs/ phải có ít nhất 1 sample entry
115
+ assert(
116
+ fs.existsSync(OBS_SAMPLE_PATH),
117
+ "L11: observability/agent-runs/sample-run.json must exist as live sample"
118
+ );
119
+ const sampleRun = JSON.parse(fs.readFileSync(OBS_SAMPLE_PATH, "utf8"));
120
+ for (const field of requiredRunFields) {
121
+ assert(
122
+ sampleRun[field] !== undefined,
123
+ `L11: sample-run.json is missing required field '${field}'`
124
+ );
125
+ }
126
+
127
+ // Test 8: contracts/observability/failure-schema.json phải tồn tại
128
+ assert(
129
+ fs.existsSync(OBS_FAILURE_SCHEMA_PATH),
130
+ "L11: contracts/observability/failure-schema.json must exist"
131
+ );
132
+ const failureSchema = JSON.parse(fs.readFileSync(OBS_FAILURE_SCHEMA_PATH, "utf8"));
133
+ assert(failureSchema.required_fields, "L11: failure-schema.json must define required_fields");
134
+
135
+ // Test 9: observability/failures/ phải có sample failure entry
136
+ assert(
137
+ fs.existsSync(OBS_FAILURE_SAMPLE_PATH),
138
+ "L11: observability/failures/sample-failure.json must exist"
139
+ );
140
+
141
+ // Test 10: observability/decision-logs/ phải có sample thực tế (không chỉ template)
142
+ assert(
143
+ fs.existsSync(OBS_DECISION_SAMPLE_PATH),
144
+ "L11: observability/decision-logs/sample-decision.md must exist as actual decision record"
145
+ );
146
+ const decisionContent = fs.readFileSync(OBS_DECISION_SAMPLE_PATH, "utf8");
147
+ assert(
148
+ !decisionContent.includes("What changed."),
149
+ "L11: sample-decision.md must be a real decision record, not just the blank template"
150
+ );
151
+
152
+ console.log("feature_registry tests passed");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Unit Test for prompt_sentinel.js
3
- * Part of Genesis Codex Harness v0.1.7
3
+ * Part of Genesis Codex Harness v0.1.8
4
4
  */
5
5
 
6
6
  const assert = require('assert');
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Unit Test for spec_visual_sync.js
3
- * Part of Genesis Codex Harness v0.1.7
3
+ * Part of Genesis Codex Harness v0.1.8
4
4
  */
5
5
 
6
6
  const assert = require('assert');
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Unit Test for test_generator.js
3
- * Part of Genesis Codex Harness v0.1.7
3
+ * Part of Genesis Codex Harness v0.1.8
4
4
  */
5
5
 
6
6
  const assert = require('assert');
@@ -1,4 +0,0 @@
1
- # Playwright E2E Template
2
-
3
- For every critical screen: load route, perform primary workflow, assert final UI state, assert API synchronization, and capture trace on failure.
4
-