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,17 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const assert = require("assert");
5
+ const path = require("path");
6
+ const { execFileSync } = require("child_process");
7
+
8
+ const repoRoot = path.resolve(__dirname, "..", "..");
9
+ const hygieneScript = path.join(repoRoot, "scripts", "check-repository-hygiene.js");
10
+
11
+ const output = execFileSync(process.execPath, [hygieneScript], {
12
+ cwd: repoRoot,
13
+ encoding: "utf8"
14
+ });
15
+
16
+ assert(output.includes("repository hygiene passed"), "hygiene gate should report success");
17
+ console.log("repository_hygiene tests passed");
@@ -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');
@@ -0,0 +1,76 @@
1
+ const assert = require("assert");
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+
5
+ const repoRoot = path.resolve(__dirname, "..", "..");
6
+ const currentStatePath = path.join(repoRoot, ".codebase", "CURRENT_STATE.md");
7
+ const repoStatePath = path.join(repoRoot, ".codebase", "state.json");
8
+
9
+ console.log("Running state metadata contract unit tests...");
10
+
11
+ const currentState = fs.readFileSync(currentStatePath, "utf8");
12
+ const repoState = JSON.parse(fs.readFileSync(repoStatePath, "utf8"));
13
+ const allowedStates = new Set([
14
+ "INIT",
15
+ "REQUIREMENTS_GATHERING",
16
+ "PLANNING",
17
+ "IMPLEMENTATION",
18
+ "VERIFICATION",
19
+ "RELEASE_READY",
20
+ "COMPLETED"
21
+ ]);
22
+
23
+ const latestSessionMatch = currentState.match(/\*\*Latest Session\*\*: `([^`]+)`/);
24
+ assert(latestSessionMatch, "CURRENT_STATE.md should declare the latest session");
25
+ assert.strictEqual(
26
+ repoState.session_id,
27
+ latestSessionMatch[1],
28
+ "state.json session_id should match CURRENT_STATE.md"
29
+ );
30
+
31
+ const ttfvMatch = currentState.match(/\*\*Time to First Verification \(TTFV\)\*\*: (\d+)s/);
32
+ assert(ttfvMatch, "CURRENT_STATE.md should declare TTFV in seconds");
33
+ assert.strictEqual(
34
+ repoState.ttfv_seconds,
35
+ Number(ttfvMatch[1]),
36
+ "state.json ttfv_seconds should match CURRENT_STATE.md"
37
+ );
38
+ assert(
39
+ repoState._comment_ttfv.includes(`${repoState.ttfv_seconds}s`),
40
+ "state.json TTFV comment should describe the same number of seconds"
41
+ );
42
+
43
+ assert(
44
+ allowedStates.has(repoState.current_state),
45
+ `state.json current_state must be one of: ${Array.from(allowedStates).join(", ")}`
46
+ );
47
+
48
+ const sessionStartedAt = Date.parse(repoState.session_started_at);
49
+ assert(!Number.isNaN(sessionStartedAt), "state.json should include a valid session_started_at timestamp");
50
+
51
+ if (repoState.current_state === "COMPLETED") {
52
+ const completedAt = Date.parse(repoState.completed_at);
53
+ assert(!Number.isNaN(completedAt), "completed state should include a valid completed_at timestamp");
54
+ assert(
55
+ completedAt >= sessionStartedAt,
56
+ "state.json completed_at must not be older than session_started_at"
57
+ );
58
+ } else {
59
+ assert(
60
+ !Object.prototype.hasOwnProperty.call(repoState, "completed_at"),
61
+ "active states should not retain a stale completed_at timestamp"
62
+ );
63
+ }
64
+
65
+ for (const transition of repoState.history || []) {
66
+ assert(
67
+ allowedStates.has(transition.from),
68
+ `history transition.from must be a legal state: ${transition.from}`
69
+ );
70
+ assert(
71
+ allowedStates.has(transition.to),
72
+ `history transition.to must be a legal state: ${transition.to}`
73
+ );
74
+ }
75
+
76
+ console.log("state metadata contract tests passed! ✓\n");
@@ -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');
@@ -0,0 +1,25 @@
1
+ const assert = require("assert");
2
+ const path = require("path");
3
+ const { execFileSync } = require("child_process");
4
+
5
+ const repoRoot = path.resolve(__dirname, "..", "..");
6
+ const cli = path.join(repoRoot, "bin", "genesis-harness.js");
7
+
8
+ console.log("Running verify-gate contract unit tests...");
9
+
10
+ const output = execFileSync(process.execPath, [cli, "verify-gate"], {
11
+ cwd: repoRoot,
12
+ env: {
13
+ ...process.env,
14
+ GENESIS_VERIFY_GATE_SELF_TEST: "1"
15
+ },
16
+ encoding: "utf8"
17
+ });
18
+
19
+ assert(output.includes("run-evals.sh"), "verify-gate should include eval regression checks");
20
+ assert(output.includes("docs-gate"), "verify-gate should include docs drift checks");
21
+ assert(output.includes("cold-start"), "verify-gate should include cold-start readiness checks");
22
+ assert(output.includes("pack:check"), "verify-gate should include package dry-run checks");
23
+ assert(output.includes("leanctx"), "verify-gate should include lean context reporting");
24
+
25
+ console.log("verify-gate contract tests passed! ✓\n");
@@ -0,0 +1,90 @@
1
+ const assert = require("assert");
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+
5
+ const repoRoot = path.resolve(__dirname, "..", "..");
6
+ const reusableVerifyPath = path.join(repoRoot, ".github", "workflows", "reusable-verify.yml");
7
+ const docsSyncPath = path.join(repoRoot, ".github", "workflows", "docs-sync.yml");
8
+ const publishPath = path.join(repoRoot, ".github", "workflows", "publish-npm.yml");
9
+ const registryPath = path.join(repoRoot, "features", "REGISTRY.md");
10
+
11
+ console.log("Running workflow contract unit tests...");
12
+
13
+ const reusableVerify = fs.readFileSync(reusableVerifyPath, "utf8");
14
+ const docsSync = fs.readFileSync(docsSyncPath, "utf8");
15
+ const publishWorkflow = fs.readFileSync(publishPath, "utf8");
16
+ const registry = fs.readFileSync(registryPath, "utf8");
17
+
18
+ assert(
19
+ reusableVerify.includes("workflow_call:"),
20
+ "reusable verify workflow should expose workflow_call"
21
+ );
22
+ assert(
23
+ reusableVerify.includes("genesis-harness.js verify-gate"),
24
+ "reusable verify workflow should execute the single verify-gate path"
25
+ );
26
+ assert(
27
+ /actions\/checkout@[0-9a-f]{40}/.test(reusableVerify),
28
+ "reusable verify workflow should pin actions/checkout to a full commit SHA"
29
+ );
30
+ assert(
31
+ /actions\/setup-node@[0-9a-f]{40}/.test(reusableVerify),
32
+ "reusable verify workflow should pin actions/setup-node to a full commit SHA"
33
+ );
34
+
35
+ assert(
36
+ docsSync.includes("uses: ./.github/workflows/reusable-verify.yml"),
37
+ "docs-sync workflow should delegate verification to the reusable workflow"
38
+ );
39
+ assert(
40
+ !docsSync.includes("npm test"),
41
+ "docs-sync workflow should not call a non-existent npm test script"
42
+ );
43
+ assert(
44
+ !docsSync.includes("git push origin"),
45
+ "docs-sync workflow should not auto-push documentation changes from CI"
46
+ );
47
+
48
+ assert(
49
+ publishWorkflow.includes("release:"),
50
+ "publish workflow should publish from a release event"
51
+ );
52
+ assert(
53
+ publishWorkflow.includes("workflow_dispatch:"),
54
+ "publish workflow should allow manual release runs"
55
+ );
56
+ assert(
57
+ publishWorkflow.includes("id-token: write"),
58
+ "publish workflow should use OIDC trusted publishing"
59
+ );
60
+ assert(
61
+ publishWorkflow.includes("npm publish --provenance --access public"),
62
+ "publish workflow should publish with provenance enabled"
63
+ );
64
+ assert(
65
+ !publishWorkflow.includes("NPM_TOKEN"),
66
+ "publish workflow should not require a long-lived NPM_TOKEN secret"
67
+ );
68
+ assert(
69
+ !publishWorkflow.includes("npm pkg set"),
70
+ "publish workflow should publish the checked-in release version without rewriting it in CI"
71
+ );
72
+ assert(
73
+ !publishWorkflow.includes("--tag latest"),
74
+ "publish workflow should avoid forcing prerelease-style CI publishes onto the latest dist-tag"
75
+ );
76
+
77
+ assert(
78
+ registry.includes("| F016 | verified |"),
79
+ "feature registry should mark cold-start automation as verified"
80
+ );
81
+ assert(
82
+ registry.includes("| F018 | verified |"),
83
+ "feature registry should mark scope ledger verification as verified"
84
+ );
85
+ assert(
86
+ !registry.includes("| F019 | verified | Demo Feature") || !registry.includes("`npm test`"),
87
+ "feature registry should not claim a verified demo feature with a non-existent npm test command"
88
+ );
89
+
90
+ console.log("workflow contract tests passed! ✓\n");
@@ -1,14 +0,0 @@
1
- # TTS Fixture Template
2
-
3
- ## Input
4
-
5
- Text, voice, language, timing, and provider options.
6
-
7
- ## Expected Output
8
-
9
- Audio metadata, transcript alignment, and provider response shape.
10
-
11
- ## Validation Notes
12
-
13
- Check retries, provider errors, empty text, and persistence.
14
-
@@ -1,14 +0,0 @@
1
- # Video Fixture Template
2
-
3
- ## Input
4
-
5
- Scene plan, audio, subtitles, images, transitions, and render options.
6
-
7
- ## Expected Output
8
-
9
- Video artifact metadata, duration, and validation checks.
10
-
11
- ## Validation Notes
12
-
13
- Check missing clips, bad timing, retry behavior, and resumability.
14
-
@@ -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
-