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,80 @@
1
+ # Compressed Context & Dependency Graph
2
+
3
+ ## src/auth.js
4
+ ### Implements Features
5
+ - `Đăng nhập`
6
+ - `Cập nhật Profile`
7
+
8
+ ## tests/integration/cli-smoke.test.js
9
+ ### Dependencies
10
+ - `assert`
11
+ - `fs`
12
+ - `os`
13
+ - `path`
14
+ - `child_process`
15
+
16
+ ## tests/unit/contract_integrity_gate.test.js
17
+ ### Dependencies
18
+ - `assert`
19
+ - `fs`
20
+ - `path`
21
+ - `child_process`
22
+
23
+ ## tests/unit/healing_telemetry.test.js
24
+ ### Dependencies
25
+ - `assert`
26
+ - `fs`
27
+ - `path`
28
+ - `child_process`
29
+
30
+ ## tests/unit/prompt_sentinel.test.js
31
+ ### Dependencies
32
+ - `assert`
33
+ - `fs`
34
+ - `path`
35
+ - `child_process`
36
+
37
+ ## tests/unit/spec_visual_sync.test.js
38
+ ### Dependencies
39
+ - `assert`
40
+ - `fs`
41
+ - `path`
42
+ - `child_process`
43
+
44
+ ## tests/unit/test_generator.test.js
45
+ ### Dependencies
46
+ - `assert`
47
+ - `fs`
48
+ - `path`
49
+ - `child_process`
50
+
51
+ ## bin/genesis-harness.js
52
+ ### Dependencies
53
+ - `fs`
54
+ - `path`
55
+ - `child_process`
56
+ - `@babel/parser`
57
+ - `@babel/traverse`
58
+ - `child_process`
59
+
60
+
61
+ ## Project Planning & Roadmap
62
+ # Phase 1: Core Features
63
+
64
+ ## Role: User
65
+ - [x] Đăng nhập (files: src/auth.js)
66
+ - [/] Cập nhật Profile (depends_on: Đăng nhập) (files: src/auth.js, src/db.js)
67
+ - [ ] Mua hàng (depends_on: Đăng nhập)
68
+
69
+ ## Role: Admin
70
+ - [x] Quản lý User
71
+ - [ ] Xem thống kê doanh thu (depends_on: Mua hàng)
72
+ - [~] Xử lý đơn hàng (depends_on: Mua hàng)
73
+
74
+ # Phase 2: Nâng Cao
75
+
76
+ ## Role: Analytics
77
+ - [ ] Xuất báo cáo Excel (depends_on: Xem thống kê doanh thu)
78
+ - [ ] Tích hợp Google Analytics
79
+ - [/] Dashboard Real-time (depends_on: Google Analytics)
80
+
@@ -1,11 +1,11 @@
1
- # Current State: COMPLETED
2
- Last updated: Mon Jun 01 17:15:00 +07 2026
1
+ # Current System State
3
2
 
4
- ## Reason
5
- Successfully completed the Visual Mockup Generation & Interactive TUI Mockup Viewer integration (v0.3.0), followed by Harness Engineering standardizations and preparation for release `0.1.7`:
6
- - **Interactive Keyboard-Navigated CLI TUI**: Developed an elegant console interface for `genesis-harness view-mockup` capturing stdin keypresses.
7
- - **Harness Verification Streamlining**: Refactored `scripts/verify.sh` and `scripts/run-evals.sh` to dynamically evaluate skill names, removing legacy hard-coded mapping logic. Cleaned up deprecated skills (e.g., `genesis-mvp-planning`, `genesis-release-orchestration`, `genesis-state-machine`, `genesis-research`, `genesis-docs`).
8
- - **Skill Consolidation**: Merged overlapping skills to resolve duplicated slash commands and clean up the architecture.
9
- - **Bead Memory Test Coverage**: Added rigorous CLI command validations in `scripts/run-evals.sh` to guarantee that `remember`, `recall`, `prime`, and `forget` function reliably.
10
- - **Skill Enrichment Directives**: Packaged new visual contract requirements inside `genesis-design-spec` (utilizing `generate_image`) and visual alignment checks inside `genesis-new-design` (utilizing `view_file`).
11
- - **Verification Evidence**: Structural checks and regression evaluations pass 100% cleanly, confirming absolute stability in the current codebase state. Ready for 0.1.7 release.
3
+ **Time**: 2026-06-12
4
+ **Status**: `COMPLETED`
5
+ **Latest Session**: `2026-06-12-lifecycle-pipeline-hardening`
6
+ **Time to First Verification (TTFV)**: 180s
7
+
8
+ ## Latest Transition
9
+
10
+ - State changed to `COMPLETED`
11
+ - Reason: End-to-end lifecycle pipeline verified with project closure and audit
@@ -5,10 +5,23 @@ flowchart TD
5
5
  npm["npm package"] --> cli["bin/genesis-harness.js"]
6
6
  npm --> skills[".codex/skills"]
7
7
  cli --> verify["scripts/verify.sh"]
8
+ cli --> evals["scripts/run-evals.sh"]
8
9
  cli --> install["scripts/install.sh"]
10
+ cli --> docsgate["genesis-harness docs-gate"]
11
+ cli --> leanctx["genesis-harness leanctx"]
12
+ cli --> prime["genesis-harness prime"]
13
+ leanctx --> policy[".codebase/context-policy.json"]
14
+ prime --> policy
15
+ sentinel["scripts/prompt_sentinel.js"] --> policy
16
+ docsgate --> docsync["check-docs-sync.sh"]
17
+ docsgate --> specsync["check-spec-changelog.sh"]
9
18
  verify --> memory[".codebase"]
10
19
  verify --> contracts["contracts"]
11
20
  verify --> fixtures["fixtures"]
12
21
  verify --> tests["tests and playwright"]
22
+ evals --> unit["tests/unit/*.test.js"]
23
+ evals --> integration["tests/integration/*.test.js"]
24
+ evals --> visual[".codebase/VISUAL_GRAPH.md"]
25
+ evals --> handoff[".codebase/IMPLEMENTATION_HANDOFF.md"]
26
+ evals --> policy
13
27
  ```
14
-
@@ -1,351 +1,49 @@
1
- # Implementation Handoff Template
1
+ # Implementation Handoff: Harness Drift Gate Hardening + LeanCTX
2
2
 
3
- **Purpose**: Document what was implemented, current state, and how to continue if work is paused or passed to another team member.
3
+ **Completed date**: 2026-06-03
4
+ **Status**: Completed, pending user-requested commit only
5
+ **Owner**: Codex harness engineering
4
6
 
5
- **Use After**: Successful implementation completion, before moving to next phase.
7
+ ## Summary
6
8
 
7
- ---
9
+ The harness has been hardened against source-of-truth drift, stale Mermaid graphs, placeholder handoffs, long skill entrypoints, and missing executable CLI smoke coverage. It now also ships portable LeanCTX defaults and auto-seeds them during install/postinstall when a project root is detected, so npm users get token-budget guidance without requiring a machine-specific command wrapper or a manual inspection command.
8
10
 
9
- ## Header
11
+ ## Changed Subsystems
10
12
 
11
- **Feature/Bug**: _[Name and reference]_
12
- **Implemented By**: _Name_
13
- **Completed Date**: _YYYY-MM-DD_
14
- **Estimated Handoff Date**: _YYYY-MM-DD_
15
- **Next Owner**: _Name (if known)_
13
+ - **CLI**: `genesis-harness sync` now generates harness relationship Mermaid graphs and keeps roadmap-derived output generic so sample app task names do not leak into `.codebase/VISUAL_GRAPH.md`.
14
+ - **Verification**: `scripts/verify.sh` enforces a 500-line maximum for skill entrypoints. `scripts/run-evals.sh` now validates handoff freshness, state freshness, sync-generated Mermaid, and integration smoke coverage.
15
+ - **LeanCTX**: `.codebase/context-policy.json` defines token budget layers, `genesis-harness install` and npm `postinstall` seed it into detected projects without overwriting custom policies, `genesis-harness leanctx` reports the policy, `genesis-harness prime` includes the same policy, and `scripts/prompt_sentinel.js` reads the policy for compaction thresholds.
16
+ - **Skills**: Oversized `SKILL.md` entrypoints were converted into short routing files that point to existing references, playbooks, templates, and checklists.
17
+ - **State and memory**: `.codebase/CURRENT_STATE.md`, `.codebase/state.json`, `.codebase/TEST_MATRIX.md`, `.codebase/RECOVERY_POINTS.md`, `.codebase/DEPENDENCY_GRAPH.md`, `.codebase/PIPELINE_FLOW.md`, and `.codebase/VISUAL_GRAPH.md` now describe the current harness gates.
16
18
 
17
- ---
19
+ ## Verification Evidence
18
20
 
19
- ## Executive Summary
20
-
21
- _Brief (2-3 sentences) overview of what was implemented._
22
-
23
- Example:
24
- ```
25
- Implemented OAuth 2.0 authentication with Google and GitHub providers.
26
- Added user registration flow, login page, and session management.
27
- Integrated with existing user database and role system.
28
- ```
29
-
30
- ---
31
-
32
- ## What Was Built
33
-
34
- ### Modules Created
35
-
36
- List all new files/modules:
37
-
38
- ```
39
- ├── src/auth/
40
- │ ├── oauth-provider.ts (new)
41
- │ ├── session-manager.ts (new)
42
- │ └── token-handler.ts (new)
43
- ├── src/ui/pages/
44
- │ ├── login.tsx (new)
45
- │ └── register.tsx (new)
46
- ├── tests/
47
- │ ├── auth.test.ts (new)
48
- │ └── oauth.integration.test.ts (new)
49
- └── docs/
50
- └── AUTH_SETUP.md (new)
51
- ```
52
-
53
- ### Modules Modified
54
-
55
- List all files changed:
56
-
57
- ```
58
- ├── src/app.ts (modified)
59
- │ └── Added auth middleware
60
- ├── src/db/user-model.ts (modified)
61
- │ └── Added oauth provider fields
62
- ├── .codebase/API_CONTRACTS.md (updated)
63
- │ └── Added /auth/* endpoints
64
- └── package.json (updated)
65
- └── Added oauth2 dependencies
66
- ```
67
-
68
- ### Key Features Implemented
69
-
70
- - [ ] Feature A: Description
71
- - [ ] Feature B: Description
72
- - [ ] Feature C: Description
73
-
74
- ---
75
-
76
- ## Current State
77
-
78
- ### ✅ What's Complete
79
-
80
- ```
81
- Implementation:
82
- ✓ OAuth flow implemented
83
- ✓ Database migrations applied
84
- ✓ API endpoints created
85
- ✓ UI components built
86
- ✓ Error handling added
87
-
88
- Testing:
89
- ✓ Unit tests passing (15/15)
90
- ✓ Integration tests passing (8/8)
91
- ✓ E2E tests passing (5/5)
92
- ✓ Coverage: 85%
93
-
94
- Documentation:
95
- ✓ API_CONTRACTS.md updated
96
- ✓ README updated with setup instructions
97
- ✓ Database schema documented
98
- ✓ Error handling documented
99
-
100
- Deployment:
101
- ✓ Code review approved
102
- ✓ All linting passed
103
- ✓ Build successful
104
- ```
105
-
106
- ### ⚠️ Known Issues / Limitations
107
-
108
- ```
109
- Issue #1: Rate limiting not yet enforced
110
- - Status: Identified
111
- - Severity: Low
112
- - Next: Implement in next sprint
113
- - Workaround: None needed, non-blocking
114
-
115
- Issue #2: Session timeout not configurable
116
- - Status: Identified
117
- - Severity: Medium
118
- - Next: Add config options
119
- - Workaround: Contact admin to adjust
120
-
121
- Issue #3: OAuth token refresh edge case
122
- - Status: Identified, isolated to specific provider
123
- - Severity: Low
124
- - Next: Add retry logic
125
- - Workaround: User re-login
126
- ```
127
-
128
- ### 📊 Metrics & Status
129
-
130
- ```
131
- Code Quality:
132
- - Test coverage: 85% (target: 80%)
133
- - Cyclomatic complexity: Low
134
- - Code review: Approved
135
- - Linting: 0 errors
136
-
137
- Performance:
138
- - Auth flow latency: 250ms avg
139
- - Login page load: 1.2s
140
- - No performance regressions detected
141
-
142
- Deployment Readiness:
143
- - Staging: ✓ Deployed, tested
144
- - Production: Ready
145
- ```
146
-
147
- ---
148
-
149
- ## Files & Artifacts
150
-
151
- ### Documentation
152
-
153
- - **AUTH_SETUP.md**: Setup instructions for OAuth providers
154
- - **API_CONTRACTS.md**: Endpoint specifications
155
- - **.codebase/CURRENT_STATE.md**: Updated implementation status
156
- - **RECOVERY_POINTS.md**: Resumption points if work pauses
157
-
158
- ### Code Locations
159
-
160
- ```
161
- Authentication logic: src/auth/
162
- UI components: src/ui/pages/auth/
163
- Tests: tests/auth/, tests/integration/oauth/
164
- Database: src/db/migrations/auth-v1.sql
165
- Configuration: config/oauth-providers.json
166
- ```
167
-
168
- ### Contracts & Schemas
169
-
170
- ```
171
- API Contracts: .codebase/API_CONTRACTS.md
172
- - POST /auth/login
173
- - POST /auth/register
174
- - POST /auth/logout
175
- - GET /auth/callback
176
-
177
- Database: src/db/schema/users.sql
178
- - oauth_provider field
179
- - oauth_id field
180
- - oauth_email field
181
- - oauth_metadata field
182
- ```
183
-
184
- ---
185
-
186
- ## For Next Developer / Phase
187
-
188
- ### To Continue This Work
189
-
190
- 1. **Read These First**:
191
- ```bash
192
- cat .codebase/CURRENT_STATE.md
193
- cat AUTH_SETUP.md
194
- cat RECOVERY_POINTS.md
195
- ```
196
-
197
- 2. **Environment Setup**:
198
- ```bash
199
- npm install
200
- npm run db:migrate
201
- npm test # Should see 28 tests passing
202
- ```
203
-
204
- 3. **Known Issues to Address** (Priority Order):
205
- - [ ] Rate limiting (Low priority, next sprint)
206
- - [ ] Configurable timeout (Medium priority)
207
- - [ ] Token refresh edge case (Low priority)
208
-
209
- 4. **Next Steps**:
210
- - [ ] Deploy to production (when ready)
211
- - [ ] Monitor error rates for 24 hours
212
- - [ ] Gather user feedback
213
- - [ ] Plan Phase 2: Social login enhancements
214
-
215
- ### Recovery Points
216
-
217
- See **RECOVERY_POINTS.md** for:
218
- - Pause points if work interrupted
219
- - How to resume mid-implementation
220
- - Rollback procedures if needed
221
- - Dependencies and blockers
222
-
223
- ---
224
-
225
- ## Testing Status
226
-
227
- ### Test Coverage By Module
228
-
229
- ```
230
- Authentication (oauth-provider.ts): ✓ 90% (9/10 functions)
231
- Session management (session-manager.ts): ✓ 85% (6/7 functions)
232
- Token handling (token-handler.ts): ✓ 100% (5/5 functions)
233
- UI components (login.tsx, register.tsx): ✓ 75% (styling not tested)
234
- API endpoints: ✓ 95% (18/19 paths)
235
- ```
236
-
237
- ### Test Execution
21
+ Required commands for this handoff:
238
22
 
239
23
  ```bash
240
- # All tests
241
- npm test
242
-
243
- # Specific suite
244
- npm test -- auth.test.ts
245
-
246
- # With coverage
247
- npm test -- --coverage
248
- ```
249
-
250
- ### Critical Tests to Monitor
251
-
252
- ```
253
- 1. OAuth token refresh flow
254
- 2. Session expiry handling
255
- 3. Concurrent login attempts
256
- 4. Provider callback validation
24
+ node --check bin/genesis-harness.js
25
+ node --check scripts/prompt_sentinel.js
26
+ node tests/integration/cli-smoke.test.js
27
+ node tests/unit/prompt_sentinel.test.js
28
+ bash -n scripts/verify.sh
29
+ bash -n scripts/run-evals.sh
30
+ npm run verify
31
+ npm run eval
32
+ npm run pack:check
33
+ node bin/genesis-harness.js docs-gate
257
34
  ```
258
35
 
259
- ---
260
-
261
- ## Deployment Notes
262
-
263
- ### Prerequisites
264
-
265
- ```
266
- Required environment variables:
267
- - OAUTH_GOOGLE_CLIENT_ID
268
- - OAUTH_GOOGLE_CLIENT_SECRET
269
- - OAUTH_GITHUB_CLIENT_ID
270
- - OAUTH_GITHUB_CLIENT_SECRET
271
- - SESSION_SECRET
272
- - SESSION_TIMEOUT_MINUTES
273
-
274
- Database:
275
- - Run: npm run db:migrate
276
- - Check: SELECT * FROM migrations; (should see auth-v1)
277
-
278
- Dependencies:
279
- - All installed: npm install
280
- - Versions locked in package-lock.json
281
- ```
282
-
283
- ### Deployment Checklist
284
-
285
- - [ ] Environment variables configured
286
- - [ ] Database migrations applied
287
- - [ ] SSL certificates configured
288
- - [ ] Rate limiting enabled
289
- - [ ] Logging configured
290
- - [ ] Monitoring alerts set up
291
- - [ ] Rollback plan tested
292
-
293
- ### Rollback Procedure
294
-
295
- ```bash
296
- # If deployment fails:
297
- 1. Revert git commit: git revert [commit-hash]
298
- 2. Rollback database: npm run db:rollback -- auth-v1
299
- 3. Clear session cache: redis-cli FLUSHDB
300
- 4. Restart app: npm restart
301
- 5. Verify health check: curl https://api/health
302
- ```
303
-
304
- ---
305
-
306
- ## Architecture Decisions
307
-
308
- ### Why This Approach?
309
-
310
- **Decision 1: OAuth 2.0 via provider-specific libraries**
311
- - Alternative: Build custom OAuth implementation
312
- - Chose this because: Security, maintainability, reduces code
313
- - Tradeoff: Slight vendor lock-in, but worth it
314
-
315
- **Decision 2: Session-based auth**
316
- - Alternative: JWT tokens only
317
- - Chose this because: Server-side logout control, CSRF protection
318
- - Tradeoff: Slight more server memory, but better security
319
-
320
- **Decision 3: Async token refresh**
321
- - Alternative: Refresh on every request
322
- - Chose this because: Performance, reduces provider calls
323
- - Tradeoff: Slight risk of stale tokens, mitigated by retry logic
324
-
325
- See **ARCHITECTURE.md** for full design decisions.
326
-
327
- ---
328
-
329
- ## Contact & Questions
330
-
331
- **Original Developer**: _Name_ (_email_)
332
- **Current Owner**: _Name_ (_email_)
333
- **Questions**: See KNOWN_PROBLEMS.md or ask in #[Slack channel]
334
-
335
- ---
336
-
337
- ## Sign-Off
36
+ Last expected status: all commands pass.
338
37
 
339
- - [ ] **Implementation Complete**: ✓ Verified
340
- - [ ] **All Tests Passing**: ✓ Verified
341
- - [ ] **Documentation Complete**: ✓ Verified
342
- - [ ] **Ready for Handoff**: ✓ Verified
38
+ ## Remaining Risks
343
39
 
344
- **Handoff Date**: _YYYY-MM-DD_
345
- **Handed Off By**: _Name_
346
- **Received By**: _Name (if applicable)_
40
+ - Full 10/10 WalkingLabs parity still requires CI/CD enforcement and an application-backed browser E2E target. This repo is a package harness, so the current executable E2E layer is CLI-focused.
41
+ - Worktree is intentionally not staged or committed until the user requests it.
347
42
 
348
- ---
43
+ ## Resume Instructions
349
44
 
350
- **Last Updated**: _YYYY-MM-DD_
351
- **Next Review**: _YYYY-MM-DD_
45
+ 1. Start with `.codebase/CURRENT_STATE.md`, `.codebase/state.json`, and this handoff.
46
+ 2. Re-run `npm run verify`, `npm run eval`, and `npm run pack:check` before publishing or committing.
47
+ 3. If a future change reintroduces Mermaid or handoff drift, inspect `scripts/run-evals.sh` first; it owns the regression checks.
48
+ 4. If skill entrypoint size fails, move operational detail into the skill's references, playbooks, templates, or checklists instead of raising the limit.
49
+ 5. If token budget behavior changes, update `.codebase/context-policy.json`, install/postinstall seeding, `genesis-harness leanctx`, and `scripts/prompt_sentinel.js` together.
@@ -1,6 +1,76 @@
1
1
  # Known Problems
2
2
 
3
- - `.npm-cache/` was previously committed by mistake; it is now ignored but may still exist in history.
4
- - The current package provides templates and verification scaffolds, not application-specific generated tests.
5
- - Downstream projects must fill concrete endpoint, UI, provider, and persistence details.
3
+ Last updated: 2026-06-12
6
4
 
5
+ ## Active Technical Debt
6
+
7
+ ### TD-001: `SKILL.md` size boundary not auto-enforced during authoring
8
+ - **Symptom**: `genesis-observability-automation/SKILL.md` reached 383 lines before the `verify.sh` line-limit gate caught it. The gate catches after-the-fact but does not block during writing.
9
+ - **Impact**: L04 (Instruction Not Bloated) is only enforced at verification time, not at authoring time.
10
+ - **Mitigation**: Added `references/` split for the observability skill. Gate in `verify.sh` at 500-line hard cap.
11
+ - **Permanent Fix Needed**: Add a pre-commit git hook that warns when `SKILL.md` exceeds 200 lines.
12
+ - **Assigned to**: `genesis-harness-engineering`
13
+ - **Priority**: P2
14
+
15
+ ### TD-002: `KNOWN_PROBLEMS.md` was not populated with actual debt (was 323 bytes)
16
+ - **Symptom**: L12 (Clean State Each Session) downgraded — the clean state file was effectively a placeholder.
17
+ - **Impact**: Agents in new sessions couldn't assess actual risk before starting work.
18
+ - **Fix applied**: This file (2026-06-03).
19
+ - **Status**: RESOLVED
20
+
21
+ ### TD-003: Feature list existed only as prose (pre-2026-06-03)
22
+ - **Symptom**: Features were described in `ROADMAP.md` and `EVOLUTION_PLAN.md` as human narrative. No `verify_cmd` per feature. No machine-readable status.
23
+ - **Impact**: L08 (Feature List as Harness Primitive) gap — agent could not verify individual feature status programmatically.
24
+ - **Fix applied**: Created `features/REGISTRY.md` + `contracts/features/registry-schema.json` + test gate.
25
+ - **Status**: RESOLVED
26
+
27
+ ### TD-004: Observability directories were empty scaffolding (pre-2026-06-03)
28
+ - **Symptom**: `observability/agent-runs/`, `decision-logs/`, `failures/` had no actual data.
29
+ - **Impact**: L11 (Observability Inside Harness) gap — harness was designed to observe but collected no data.
30
+ - **Fix applied**: Created schemas, sample run, sample failure, and real decision log.
31
+ - **Status**: RESOLVED
32
+
33
+ ### TD-005: No per-session `session_id` in `state.json`
34
+ - **Symptom**: History entries have timestamps but no unique session identifier. Cannot cross-reference `state.json` with `observability/agent-runs/`.
35
+ - **Impact**: L05 (Session Continuity) — cannot trace which session produced which state transition.
36
+ - **Mitigation**: Added `session_id` field to state history entries (2026-06-03).
37
+ - **Permanent Fix Needed**: CLI `genesis-harness sync` should auto-write the session_id to state on each invocation.
38
+ - **Priority**: P2
39
+
40
+ ### TD-006: Playwright templates not populated with executable tests
41
+ - **Symptom**: `playwright/` directory contains templates and fixtures but no runnable `.spec.js` files.
42
+ - **Impact**: L10 (E2E Testing Changes Outcomes) — E2E layer exists in design but not in execution.
43
+ - **Mitigation**: Added `playwright/e2e/auth/login-screen.spec.js` with mocked HTML route (2026-06-03).
44
+ - **Status**: RESOLVED
45
+
46
+ ### TD-007: Cold-start test not automated
47
+ - **Symptom**: The 5-question cold-start test (L03) is documented conceptually but not executable as a CI gate.
48
+ - **Impact**: Drift between repo docs and actual cold-start readiness could go undetected.
49
+ - **Fix applied**: `scripts/cold-start-check.js` created (2026-06-03).
50
+ - **Priority**: P1 → RESOLVED
51
+
52
+ ### TD-008: No automatic "Context Anxiety" detection
53
+ - **Symptom**: No mechanism detects when an agent is converging prematurely due to context pressure.
54
+ - **Impact**: L05 — agents may hallucinate completion under context pressure with no harness intervention.
55
+ - **Mitigation**: `genesis-verification-before-completion` skill partially addresses this through mandatory evidence.
56
+ - **Permanent Fix Needed**: Integrate a token-budget warning callback in the `prompt_sentinel.js` that flags imminent convergence.
57
+ - **Priority**: P3
58
+
59
+ ### TD-009: Dependency directory was tracked in Git
60
+ - **Symptom**: `node_modules/` contributed hundreds of tracked files even though dependencies are reproducible from `package-lock.json`.
61
+ - **Impact**: Noisy diffs, larger clones, and a higher risk of stale or platform-specific dependency artifacts.
62
+ - **Fix applied**: Removed `node_modules/` from the Git index, added it to `.gitignore`, and added `scripts/check-repository-hygiene.js` to the structural verification path.
63
+ - **Status**: RESOLVED
64
+
65
+ ### TD-010: Historical unpacked package artifact remains tracked
66
+ - **Symptom**: `tmp_pack/` keeps a full historical package tree in Git.
67
+ - **Impact**: Repository duplication remains higher than necessary.
68
+ - **Mitigation**: Explicitly allowlisted for now because current repository state identifies it as historical evidence.
69
+ - **Permanent Fix Needed**: Replace it with a compact expected tarball manifest after confirming no release or regression workflow consumes the unpacked tree.
70
+ - **Priority**: P2
71
+
72
+ ### TD-011: Feature completion previously lacked project closure
73
+ - **Symptom**: A verified active feature could be presented as lifecycle completion without proving all queued work or producing a release-ready handoff.
74
+ - **Impact**: Projects could stop between feature execution and acceptance with no deterministic next action.
75
+ - **Fix applied**: Added queue promotion, `verify-project`, `RELEASE_READY`, `complete-project`, append-only event history, and `pipeline-audit`.
76
+ - **Status**: RESOLVED
@@ -1,13 +1,34 @@
1
1
  # Module Index
2
2
 
3
3
  - `.codex/skills/`: packaged Codex skills.
4
- - `bin/genesis-harness.js`: npm CLI for install, verify, uninstall, and path output.
4
+ - `bin/genesis-harness.js`: npm CLI for install, verify, uninstall, docs gates, idea bootstrap, resumable execution, multi-feature queue routing, feature/project verification, release-ready completion, and pipeline audit.
5
+ - `scripts/check-repository-hygiene.js`: blocks tracked dependency and generated artifacts such as `node_modules/`, `dist/`, and package tarballs.
6
+ - `contracts/features/project-registry-schema.json`: contract for generated `.planning/FEATURE_REGISTRY.json` lifecycle queues.
7
+ - `.github/workflows/reusable-verify.yml`: reusable GitHub Actions workflow that runs the canonical `genesis-harness verify-gate` path and uploads verification artifacts.
8
+ - `.github/workflows/docs-sync.yml`: CI entrypoint that delegates pull-request and protected-branch verification to the reusable verify workflow.
9
+ - `.github/workflows/publish-npm.yml`: release-oriented npm publishing workflow using GitHub OIDC trusted publishing and provenance.
5
10
  - `scripts/verify.sh`: structural and smoke verification.
6
11
  - `scripts/run-evals.sh`: package-level regression checks.
7
12
  - `.codebase/`: compressed repository memory.
8
13
  - `contracts/`: API, agent, event, and UI contract templates.
14
+ - `contracts/features/registry-schema.json`: JSON schema for the feature registry (L08).
15
+ - `contracts/observability/agent-run-schema.json`: JSON schema for agent-run observability logs (L11).
16
+ - `contracts/observability/failure-schema.json`: JSON schema for failure observability records (L11).
17
+ - `features/REGISTRY.md`: machine-readable feature list primitive — canonical status + verify_cmd per feature (L08).
9
18
  - `fixtures/`: reusable test and validation fixtures.
10
19
  - `tests/`: harness test architecture templates.
20
+ - `tests/unit/feature_registry.test.js`: validates feature registry schema and observability live data (L08 + L11).
21
+ - `tests/unit/workflow_contracts.test.js`: validates that GitHub workflows use the reusable verify path and trusted npm publishing defaults.
11
22
  - `playwright/`: UI smoke, e2e, and visual harness templates.
12
23
  - `observability/`: autonomous run and decision logging templates.
13
-
24
+ - `observability/agent-runs/`: per-session agent execution records (L11).
25
+ - `observability/decision-logs/`: rationale logs for significant decisions (L11).
26
+ - `observability/failures/`: failure records with root-cause and prevention notes (L11).
27
+ - `.codex/skills/genesis-harness/scripts/init-planning.sh`: planning bootstrap that now creates Foundation + Discovery/QA scaffolds.
28
+ - `.planning/INIT_QA.md`: initialization questionnaire for product approach, QA closure, and tech stack sign-off.
29
+ - `.codebase/PHASE_DEPENDENCY_MAP.md`: init-created dependency map used by spec-impact-engine and downstream planning.
30
+ - `.codebase/state.json`: canonical runtime state for the harness repo and generated projects; `run --idea` now advances project state into `IMPLEMENTATION` with `active_feature`, and `resume` restores the next actionable task from it.
31
+ - `.runs/`: per-session run artifacts (`INPUT.md`, `DISCOVERY.json`, `STATE.json`, `RESUME.md`, `EVENTS.jsonl`) used for resume and append-only lifecycle history.
32
+ - `.planning/FEATURE_REGISTRY.json`: generated project-level execution queue consumed by `add-feature`, `next`, `complete-feature`, `verify-project`, `complete-project`, and `pipeline-audit`.
33
+ - `.planning/PROJECT_VERIFICATION.json`: project-wide feature proof and acceptance proof record.
34
+ - `.planning/IMPLEMENTATION_HANDOFF.md`: release-ready handoff generated only after all proofs pass.
@@ -3,12 +3,22 @@
3
3
  ```mermaid
4
4
  flowchart LR
5
5
  state["Read .codebase state"] --> test["Create failing test"]
6
+ state --> leanctx["Load LeanCTX policy"]
7
+ leanctx --> test
6
8
  test --> fixture["Create fixture and expected output"]
7
- fixture --> impl["Implement minimum change"]
8
- impl --> verify["Run verification"]
9
- verify --> contracts["Update contracts"]
10
- contracts --> memory["Update .codebase memory"]
9
+ fixture --> contracts["Update contracts when behavior changes"]
10
+ contracts --> impl["Implement minimum change"]
11
+ impl --> featureVerify["Run feature proof"]
12
+ featureVerify --> featureComplete["complete-feature records evidence"]
13
+ featureComplete --> queued{"Queued feature remains?"}
14
+ queued -->|yes| impl
15
+ queued -->|no| projectVerify["verify-project reruns all feature proofs and project proof"]
16
+ projectVerify --> handoff["Write project verification and implementation handoff"]
17
+ handoff --> releaseReady["RELEASE_READY"]
18
+ releaseReady --> projectComplete["complete-project records release or acceptance evidence"]
19
+ projectComplete --> audit["pipeline-audit checks state, proofs, handoff, and event history"]
20
+ audit --> memory["Update .codebase memory and metrics"]
11
21
  memory --> docs["Update docs"]
12
- docs --> summary["Write change summary"]
22
+ docs --> sync["Run genesis-harness sync"]
23
+ sync --> summary["Write change summary"]
13
24
  ```
14
-