dream(performance): #3183 wire real cold-start measurement, remove fabricated V2-vs-V3 benchmark (evaluated, ACCEPT-scoped) - #3184
Conversation
|
CI red — not this PR's failure, confirmed via base-branch reproduction. All 8 failing checks ( Confirmed pre-existing and unrelated to this diff:
Not re-running: this is a deterministic This PR's own diff ( Generated by Claude Code |
530334e to
af6ad1c
Compare
…s dropped by the July helper sync tests/hook-handler-runwithtimeout.test.cjs failed with "runWithTimeout is not a function" on the first Test Suite runs after #3203 (#3177, #3184). cb1e93e (2026-06-15) had guarded the hook dispatch behind `require.main === module` and exported { runWithTimeout, INTELLIGENCE_TIMEOUT_MS } for that test; the 2026-07-04 helper sync (a5f86ad) replaced both copies of hook-handler.cjs with the packaged build and dropped the guard and the exports, so require()-ing the helper ran main() (stdin read + process.exit) and exposed nothing. Both copies (repo dogfood + v3/@claude-flow/cli) restored identically; direct invocation still prints usage and exits 0. The helpers manifest is re-signed at publish (prepublishOnly), as the guard workflow expects. node --test tests/hook-handler-runwithtimeout.test.cjs tests/context-persistence-hook.test.mjs: all pass, 0 fail. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_019xHM4rAH4aaShb4DTr1n6s
(embedding width; hook-handler exports) (#3204) * test(context-hook): assert the hash embedding width is EMBEDDING_DIM (384), not the legacy 768 tests/context-persistence-hook.test.mjs still expected createHashEmbedding to return 768 values; the hook has defaulted to 384 (the ONNX all-MiniLM-L6-v2 width, EMBEDDING_DIM) since February so hash-fallback blobs stay comparable with ONNX vectors. The mismatch was hidden while the Test Suite job died at ETARGET (fixed in #3203) and surfaced on the first PR runs after it (#3177, #3184). Assert EMBEDDING_DIM and pin it to 384; fix the stale "768-dim" docstring on the blob store. node --test tests/context-persistence-hook.test.mjs: 66 pass, 0 fail. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_019xHM4rAH4aaShb4DTr1n6s * fix(hooks): restore hook-handler's require.main guard and test exports dropped by the July helper sync tests/hook-handler-runwithtimeout.test.cjs failed with "runWithTimeout is not a function" on the first Test Suite runs after #3203 (#3177, #3184). cb1e93e (2026-06-15) had guarded the hook dispatch behind `require.main === module` and exported { runWithTimeout, INTELLIGENCE_TIMEOUT_MS } for that test; the 2026-07-04 helper sync (a5f86ad) replaced both copies of hook-handler.cjs with the packaged build and dropped the guard and the exports, so require()-ing the helper ran main() (stdin read + process.exit) and exposed nothing. Both copies (repo dogfood + v3/@claude-flow/cli) restored identically; direct invocation still prints usage and exits 0. The helpers manifest is re-signed at publish (prepublishOnly), as the guard workflow expects. node --test tests/hook-handler-runwithtimeout.test.cjs tests/context-persistence-hook.test.mjs: all pass, 0 fail. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_019xHM4rAH4aaShb4DTr1n6s * chore(helpers): re-sign helpers manifest after hook-handler.cjs test-surface restore The packaged hook-handler.cjs changed in this branch (require.main guard + runWithTimeout exports), so helpers.manifest.json still carried main's hash and helper-signing.test.ts ("hashes match the actual shipped helper files") failed in Test Suite (ubuntu-latest), run 33972961703. Re-signed with the ruflo helpers key via RUFLO_HELPERS_SIGNING_SECRET; no other file changed. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_019xHM4rAH4aaShb4DTr1n6s
Ledger-append step silently failed again for 10 consecutive nights (3rd occurrence of this failure class, first flagged 2026-08-19). Verified via git ls-remote + GitHub MCP issue/PR search before concluding this (all 10 nights ran to completion: real branch, issue, and draft PR each) rather than inferring failure from a sparse table. 2026-08-20..08-23 is a separate, confirmed-genuine 4-night gap where the pipeline did not run at all. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01YQUz3bkMpqgtLXgkYa1LFF
…ed V2-vs-V3 benchmark (evaluated, ACCEPT-scoped) cli-cold-start.bench.ts's own measureColdStart() (a real, spawn-based process timer) was never called anywhere in the file. Every reported number instead came from setTimeout() delays, including a "V2 vs V3 Speedup: 5.00x" that was guaranteed by construction (setTimeout(100) vs setTimeout(20), no code between them) regardless of any real behavior. - Export measureColdStart(), add runRealColdStartMeasurement() and CLI_BIN_PATH; wire the real spawn-based measurement into the suite. - Remove the fabricated V2-vs-V3 comparison outright (no V2 binary remains to honestly compare against). - Add a deterministic Vitest regression test (4 assertions); fails against baseline (functions not exported, fabricated pattern still present), passes against candidate — confirmed via git-stash isolation. Full @claude-flow/performance suite: 99/99 passing. tsc --noEmit: clean. - Real measured number: node bin/cli.js --version, 5 runs, mean 54.65ms (min 51.94 / max 57.92) — well under the 500ms target. Caveat disclosed in-code: --version is the one subcommand that succeeds without a built dist/ in this worktree; this is not a full-CLI cold-start measurement. - Correct the two stale "Achieved" claims this fed in ADR-STATUS-SUMMARY.md's Performance Targets table (CLI Startup, and the already-known-false HNSW 150x-12,500x figure one row up). Darwin: skipped, scope mismatch (dead-code-wiring fix, not a tunable parameter). Flywheel: no signed bundle, deterministic Vitest evidence retained instead. Follow-ups documented in tonight's gist: same anti-pattern in agent-spawn/mcp-server-init/cli-warm-start bench files (not touched, kept to one conceptual change); a Raft election safety gap and a plugin supply-chain enforcement gap found by tonight's scan roles (hive-mind, security) but out of scope for the performance DEEP surface. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01YQUz3bkMpqgtLXgkYa1LFF
Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01YQUz3bkMpqgtLXgkYa1LFF
af6ad1c to
8b3927d
Compare
Patch release covering the six commits landed since 3.38.21: - #3221 gate EnhancedModelRouter's forwarded modelId on tier match - #3169 wire embedding-cosine into SmartRetrieval's MMR step - #3184 wire real cold-start measurement, drop the fabricated V2-vs-V3 benchmark - #3177 bound two ReDoS patterns, stateless PII regexes, O(P) confidence pass - #3204 fix two stale main-tree Test Suite failures - #3203 add v3/@claude-flow/mcp to the root npm workspaces 3.38.22 is intentionally skipped: @claude-flow/cli's publish for that version stuck in npm's "staged" state (published umbrellas, cli 404) and the registry refused to republish over it even after unpublish, so all three packages moved to .23 together to restore version lockstep. Co-Authored-By: RuFlo <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01Ff2xRKvYrqXJhefvcapfE1
1. Hypothesis
2. Candidate
cli-cold-start.bench.ts: exportedmeasureColdStart()(was private and dead — zero call sites before this diff); addedrunRealColdStartMeasurement()+CLI_BIN_PATH; wired the real measurement intorunColdStartBenchmarks(); removed the "V2 vs V3 Comparison Simulation" block (setTimeout(100)vssetTimeout(20), no code between them — a "5.00x speedup" guaranteed by construction on every run).__tests__/cli-cold-start.test.ts(new): 4 deterministic Vitest assertions.ADR-STATUS-SUMMARY.md: corrected 2 rows in the Performance Targets table (CLI Startup — was "✅ Achieved" fed by the fabricated benchmark; HNSW — an already-known-false 150x-12,500x figure one row up, same table, same defect class).3. Evaluation Receipt
Real evaluator: Vitest 4.1.8, deterministic, zero LLM calls, $0 cost.
Baseline vs. candidate isolated via
git stashof just the.bench.tsfile (test file kept): all 4 new tests fail against baseline (measureColdStart/runRealColdStartMeasurement/CLI_BIN_PATHnot exported pre-fix; fabricated-pattern guard also fails) and pass against candidate.Full
@claude-flow/performancesuite: 99/99 passing (95 pre-existing + 4 new; pre-existing 95 identical both ways).tsc --noEmit: zero errors.Real measured number:
node bin/cli.js --version, 5 runs — mean 54.65ms, min 51.94ms, max 57.92ms. Well under the 500ms target.4. Baseline Comparison
measureColdStartexported/callabletsc --noEmit5. Darwin Lineage
Skipped — scope mismatch (dead-code-wiring fix with a binary "called or not" evaluation, not a tunable parameter with a search space). Confirmed real Darwin interface via
npx ruvector harness darwin --helptonight (JSON genome config +--execute).6. Flywheel Evidence
No signed
@metaharness/flywheelbundle (deterministic Vitest evidence targets a different evaluation shape than the LLM-task corpus that tooling replays/verifies) — consistent with every accepted night since 2026-08-18. Evidence retained as: 4 new tests + linked issue + gist + stash-isolated baseline/candidate result.7. Reward Hack Check
Manual checklist (no standalone reward-hack CLI reachable this session): no test weakened (purely additive), no gold-label leakage (none exists in this code), no cherry-picking (full 99-test suite both ways), no seed manipulation (real subprocess timing, variance disclosed via min/max), zero cost, no undocumented caching. The one real limitation (
--versiononly, not full CLI init) is disclosed in-code and in the linked issue/gist, not hidden.8. Security Review
runRealColdStartMeasurement()spawns a fixed, hardcoded command withshell: false(unchanged from the pre-existing helper) — no user-controlled input reaches the spawned args. Dev/benchmark tooling only, no new production-facing surface.9. Regression Analysis
No production CLI code touched.
ADR-STATUS-SUMMARY.mdchanges are documentation-only. Full package test suite green (99/99),tsc --noEmitclean, pre-existing 95 tests identical pass/fail both sides of the stash isolation.10. ADR
None — scoped wiring/correctness fix + one doc-table correction, consistent with repo convention for this class of finding (no ADR for 08-24/08-25/08-30's similar fixes).
11. Research Gist
docs/dream-cycle/dream-gist-2026-09-05.md(this branch) — full competitor analysis, external sources (arXiv:2606.20695, Pebblous 2026 benchmark-trust-crisis report, Qdrant/Milvus/LangGraph/CrewAI/OpenAI comparisons), and this cycle's security (plugin supply-chain enforcement gap) and hive-mind (Raft election safety gap) scan findings, neither implemented tonight (out of scope for the performance DEEP surface, documented as follow-ups).12. Issue
#3183
13. Witness
db4991967c45c6f72133dff0bb80b0a492960fc10aae2712a54567521f308721205cbcbded0dadada2ab052810476b8e94d60fce04f903bab9006e79cf201c498058d028d66a0de7d6ef17e97325638336d1e98c14. Merge Policy
Human review required. Do not self-merge. Do not autonomously promote Flywheel state.
🤖 Generated with RuFlo
https://claude.ai/code/session_01YQUz3bkMpqgtLXgkYa1LFF
Generated by Claude Code