|
2 | 2 |
|
3 | 3 | This file is the canonical carry-over plan for implementation sequencing, test gates, and next-session priority. Keep this file updated as work progresses. |
4 | 4 |
|
| 5 | +Canonical document contract: |
| 6 | +1. Product vision and non-negotiables: `README.md` |
| 7 | +2. Architecture contracts and backlog: `CORTEX-DESIGN-PLAN-TODO.md` |
| 8 | +3. Execution sequencing, command contract, and test gates: `PROJECT-EXECUTION-PLAN.md` |
| 9 | + |
5 | 10 | ## Pass Status (2026-03-11) |
6 | 11 |
|
7 | 12 | Completed in this pass: |
@@ -41,12 +46,48 @@ Completed in this pass: |
41 | 46 | - `npm run build` |
42 | 47 | - `npm run benchmark:dummy` |
43 | 48 | - ad hoc `Vectors.wat` compile + instantiate + export smoke (`dot_many`, `project`, `hash_binary`, `hamming_scores`, `topk_i32`, `topk_f32`) via transient `wabt` |
| 49 | +13. Synchronized canonical docs with anti-drift protocol and shared P0 priorities: |
| 50 | + - `README.md` |
| 51 | + - `CORTEX-DESIGN-PLAN-TODO.md` |
| 52 | + - `PROJECT-EXECUTION-PLAN.md` |
| 53 | +14. Implemented browser-first runtime harness and local server: |
| 54 | + - `runtime/harness/index.html` |
| 55 | + - `scripts/runtime-harness-server.mjs` |
| 56 | +15. Implemented thin Electron wrapper and runtime lane tests: |
| 57 | + - `scripts/electron-harness-main.mjs` |
| 58 | + - `tests/runtime/browser-harness.spec.mjs` |
| 59 | + - `tests/runtime/electron-harness.spec.mjs` |
| 60 | +16. Added Playwright runtime lane configuration and scripts: |
| 61 | + - `playwright.config.mjs` |
| 62 | + - `package.json` scripts (`dev:harness`, `test:browser`, `test:electron`, `test:runtime`, `test:all`) |
| 63 | +17. Added explicit Electron lane runner with actionable setup messaging and optional local soft-skip: |
| 64 | + - `scripts/run-electron-runtime-tests.mjs` |
| 65 | + - `CORTEX_ALLOW_ELECTRON_SKIP=1` local skip flag |
| 66 | +18. Validation gates executed in this pass: |
| 67 | + - `npm run build` |
| 68 | + - `npm run lint` |
| 69 | + - `npm run guard:model-derived` |
| 70 | + - `npm run test:unit` |
| 71 | + - `npm run test:browser` |
| 72 | + - `CORTEX_ALLOW_ELECTRON_SKIP=1 npm run test:electron` |
44 | 73 |
|
45 | 74 | Open items carried to next pass: |
46 | 75 | 1. Wire resolved `ModelProfile` into first concrete ingest/query orchestrator path. |
47 | 76 | 2. Add real embedding providers (ONNX/Transformers/WebNN/WebGPU/WebGL/WASM) as candidates for the resolver. |
48 | | -3. Add browser/electron runtime scripts and CI lanes for non-Node merge gating. |
49 | | -4. Build the browser-first runtime harness described below and use it as the substrate for runtime-browser/runtime-electron lanes. |
| 77 | +3. Provision Electron binary availability in CI image and enforce `runtime-electron` as hard gate. |
| 78 | +4. Implement first Hippocampus/Cortex vertical slice on top of runtime harness lanes. |
| 79 | + |
| 80 | +### Documentation Synchronization Protocol (Required) |
| 81 | + |
| 82 | +At the end of every implementation pass, update docs in this order: |
| 83 | +1. `PROJECT-EXECUTION-PLAN.md`: pass status delta and exact commands executed. |
| 84 | +2. `CORTEX-DESIGN-PLAN-TODO.md`: design-to-code status matrix. |
| 85 | +3. `README.md`: top blocker and current P0 priorities. |
| 86 | + |
| 87 | +Blocker logging format: |
| 88 | +1. File path |
| 89 | +2. Failure symptom |
| 90 | +3. Next actionable step |
50 | 91 |
|
51 | 92 | ### Runtime Verification Snapshot (2026-03-11) |
52 | 93 |
|
@@ -106,31 +147,23 @@ Decision from this pass: |
106 | 147 | 4. Keep Chromium as the web-parity lane; use Electron as the primary GPU/runtime realism lane. |
107 | 148 | 5. Serve the harness over `http://127.0.0.1` / `http://localhost` during development and testing; do not rely on `file://` for WebGPU-sensitive execution. |
108 | 149 |
|
109 | | -## Next Session Highest Priority (P0) |
| 150 | +## Current Pass Highest Priority (P0) |
110 | 151 |
|
111 | | -Stand up the browser-first runtime harness and thin Electron wrapper so real GPU/browser validation can begin, then connect adaptive embedding selection into that runtime path. |
| 152 | +Move from harness scaffolding to production validation by enabling Electron gate provisioning, wiring real providers, and implementing first ingest/query orchestration slices. |
112 | 153 |
|
113 | 154 | Instruction: |
114 | | -1. Create a minimal harness renderer that reports: |
115 | | - - `navigator.gpu` availability |
116 | | - - adapter/device acquisition outcome |
117 | | - - IndexedDB + OPFS availability |
118 | | - - selected embedding backend/provider kind |
119 | | -2. Add a thin Electron main-process wrapper that: |
120 | | - - loads the same harness via localhost |
121 | | - - appends required Chromium switches before `ready` |
122 | | - - logs GPU feature status and GPU info after `gpu-info-update` |
123 | | -3. Add Playwright coverage for two lanes: |
124 | | - - Chromium web harness |
125 | | - - Electron harness |
126 | | -4. After the harness exists, register the first real embedding providers in `ProviderResolver` and test selection inside the real runtime lane. |
127 | | -5. Keep strict TDD (Red -> Green -> Refactor). |
128 | | -6. If a blocker appears, record it in this document under an error log entry and continue with the next actionable slice. |
| 155 | +1. Keep canonical docs synchronized (`README.md`, `CORTEX-DESIGN-PLAN-TODO.md`, `PROJECT-EXECUTION-PLAN.md`) before and after implementation slices. |
| 156 | +2. Provision Electron in CI/runtime images and remove local soft-skip in gated contexts. |
| 157 | +3. Register the first real embedding providers in `ProviderResolver` and test selection inside runtime lanes. |
| 158 | +4. Implement first `Hippocampus` ingest orchestration entry point with profile-resolved settings. |
| 159 | +5. Implement first `Cortex` retrieval orchestration entry point with deterministic coherence ordering baseline. |
| 160 | +6. Keep strict TDD (Red -> Green -> Refactor). |
| 161 | +7. If a blocker appears, record it in this document under an error log entry and continue with the next actionable slice. |
129 | 162 |
|
130 | 163 | Definition of done for this pass: |
131 | | -1. A single renderer harness runs under both Chromium and Electron. |
132 | | -2. Electron lane emits GPU capability diagnostics on Linux. |
133 | | -3. At least one real provider candidate is wired into resolver selection from the runtime harness. |
| 164 | +1. Canonical docs expose the same P0 priorities and maintenance protocol. |
| 165 | +2. Runtime browser lane passes from Playwright against shared harness. |
| 166 | +3. Electron lane has explicit provisioning contract and blocker handling. |
134 | 167 | 4. Any unresolved blocker is documented with file/symptom/next action. |
135 | 168 |
|
136 | 169 | ## Non-Negotiable Rules |
@@ -190,13 +223,22 @@ Available now: |
190 | 223 | 8. `npm run benchmark:dummy` |
191 | 224 | 9. `npm run benchmark` |
192 | 225 | 10. `npm run build && npm run lint` |
| 226 | +11. `npm run dev:harness` |
| 227 | +12. `npm run test:browser` |
| 228 | +13. `npm run test:electron` |
| 229 | +14. `npm run test:runtime` |
| 230 | +15. `npm run test:all` |
193 | 231 |
|
194 | 232 | Planned commands to add in later passes: |
195 | 233 | 1. `npm run test:unit -- tests/embeddings/OnnxEmbeddingRunner.test.ts` |
196 | | -2. `npm run dev:harness` |
197 | | -3. `npm run test:browser` |
198 | | -4. `npm run test:electron` |
199 | | -5. `npm run test:all` |
| 234 | +2. `npm run test:integration` |
| 235 | +3. `npm run test:runtime:strict` (no local soft-skip) |
| 236 | + |
| 237 | +## Error Log |
| 238 | + |
| 239 | +1. File path: `scripts/run-electron-runtime-tests.mjs` / `package.json` |
| 240 | +2. Failure symptom: Electron executable is unavailable in this environment after `npm install`; direct `npm run test:electron` cannot launch Electron. |
| 241 | +3. Next action: provision Electron binary in CI image (or ensure `npm install -D electron` succeeds in runtime lane environment), then run `npm run test:electron` without `CORTEX_ALLOW_ELECTRON_SKIP=1`. |
200 | 242 |
|
201 | 243 | ## Known Hardcoded Hotspots To Clean First |
202 | 244 |
|
|
0 commit comments