1242 Commits

Author SHA1 Message Date
Dragan Spiridonov 4b0ef79830 Merge pull request #390 from proffesor-for-testing/march-fixes-and-improvements
chore(release): v3.8.12
v3.8.12
2026-03-29 20:30:34 +02:00
Dragan Spiridonov eeddf4edf6 chore(release): bump version to v3.8.12
- Version bump: 3.8.11 → 3.8.12 (package.json, skills-manifest)
- Fix HDC pre-filter regression: reorder-only instead of eliminating candidates
- CHANGELOG, release notes, and docs/releases index updated

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:00:24 +00:00
Dragan Spiridonov eebb76731e feat: implement RuVector Phase 5 Milestones 3-4 — Scale, Optimization & Advanced Learning (ADR-087)
Milestone 3 — Scale & Optimization (R7-R10):
- R7: Meta-learning enhancements (DecayingBeta, PlateauDetector with CUSUM,
  ParetoFront, CuriosityBonus) wired into DomainTransferEngine
- R8: PageRank pattern importance solver with citation graph pipeline
  (PatternCitationGraph bootstraps from 129 existing patterns, blended
  scoring in pattern-promotion.ts)
- R9: Spectral graph sparsifier (degree-based leverage heuristic) wired
  into mincut-wrapper.ts as optional preprocessing
- R10: Reservoir replay buffer with coherence-gated admission and CUSUM
  drift detection, wired into ExperienceReplay (write + read paths)

Milestone 4 — Advanced Learning (R11-R12):
- R11: E-prop online learning (12 bytes/synapse, eligibility traces,
  feedback alignment) — RL algorithm #10, extends BaseRLAlgorithm
- R12: Granger causality for test failure prediction (VAR + F-test with
  full statistical math) wired into defect-intelligence coordinator with
  persistent history accumulation

Infrastructure:
- 8 feature flags (all default true per opt-out policy), convenience
  functions, env var support, CLI descriptions
- RLAlgorithmType union: 9 → 10 members (added 'eprop')
- ADR-087 status: Proposed → Active (M1-4 complete)
- 234 new tests across 8 test files, all passing
- Performance benchmarks for PageRank, sparsification, reservoir admission
- 0 regressions in existing test suite

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:41:06 +00:00
Dragan Spiridonov 19ba1a8fb7 feat: implement RuVector Phase 5 Milestone 2 — Graph Learning (ADR-087)
Implements R4 (GraphMAE), R5 (Modern Hopfield), R6 (Cold-Tier GNN) with
full integration wiring into pattern-store and code-intelligence domains.

R4 GraphMAE Self-Supervised Learning:
- SPSA optimizer for gradient-free training of masked graph autoencoders
- Decoder head reconstructs features from embeddings (SCE loss, γ=2)
- Per-epoch lossHistory for convergence analysis
- Wired into coordinator-gnn.ts:generateGraphMAEEmbeddings()
- 21 tests including 1K-node scale test

R5 Modern Hopfield Networks:
- Exponential-capacity exact pattern recall (Ramsauer 2020)
- L2-normalized patterns for consistent softmax attention
- Dimension-aware singleton, zero-vector rejection
- Wired into pattern-store.ts store()/search() as exact-recall tier
- 28 tests including 10K capacity and <2ms benchmark

R6 Cold-Tier GNN Training:
- LRU-cached mini-batch trainer with memory cap enforcement
- FileBackedGraph for real disk-backed larger-than-RAM graphs
- Unbiased Fisher-Yates shuffle (rejection sampling)
- Wired into coordinator-gnn.ts:trainWithColdTier()
- 25 tests including FileBackedGraph round-trip and mode equivalence

Shared:
- Extracted Xorshift128 PRNG to src/shared/utils/xorshift128.ts
- 3 feature flags (default false) with documented activation criteria
- Barrel exports for all types, classes, and factories

74 new tests, 0 type errors, 0 regressions across 1030 existing tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:02:34 +00:00
Dragan Spiridonov fa28ce6bfa feat: implement RuVector Phase 5 Milestone 1 — Pattern Intelligence (ADR-087)
Adds 4 new capabilities with production wiring, 148 tests, and performance baselines:

- R1: HDC Pattern Fingerprinting — 10K-bit binary hypervectors with O(1) XOR binding,
  wired into PatternStore search as Hamming-distance pre-filter
- R2: CUSUM Drift Detection — two-sided statistical change-point detection across all
  4 coherence gate types (retrieve/write/learn/act), auto-enabled via feature flag
- R3: Delta Event Sourcing — pattern version history with rollback via SQLite
  pattern_deltas table, wired into PatternStore store/recordUsage paths
- EWC++ Activation — three-loop protocol (instantAdapt→recordOutcome→backgroundConsolidate)
  wired in quality-assessment, test-generation, and contract-testing coordinators
  with double-flag guard (useSONAThreeLoop && useEwcPlusPlusRegularization)

Extracts coherence-gate.ts (930 lines) into 4 modules under 500-line limit.
All feature flags default true (opt-out) per amended ADR-087 policy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 11:43:11 +00:00
Dragan Spiridonov d291b26f7c Merge pull request #389 from proffesor-for-testing/dependabot/npm_and_yarn/npm_and_yarn-5c00e80ab5
chore(deps-dev): bump path-to-regexp from 0.1.12 to 0.1.13 in the npm_and_yarn group across 1 directory
2026-03-29 09:28:14 +02:00
dependabot[bot] 2b8d4392ac chore(deps-dev): bump path-to-regexp
Bumps the npm_and_yarn group with 1 update in the / directory: [path-to-regexp](https://github.com/pillarjs/path-to-regexp).


Updates `path-to-regexp` from 0.1.12 to 0.1.13
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/v.0.1.13/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.12...v.0.1.13)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-version: 0.1.13
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-28 18:50:23 +00:00
Dragan Spiridonov 5f017e6b2f Merge pull request #388 from proffesor-for-testing/march-fixes-and-improvements
chore(release): v3.8.11
v3.8.11
2026-03-27 15:10:44 +01:00
Dragan Spiridonov bc557c63c7 chore(release): bump version to v3.8.11
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:49:31 +00:00
Dragan Spiridonov a2f9365ddc feat: implement session reuse with O(1) fingerprint cache for 40-60% token savings (#334)
Imp-15: Session Reuse for Repeated Operations

Adds a SHA-256 fingerprint-based operation cache as layer 0 before HNSW
early exit. Exact-match lookups run in O(1) before O(log n) similarity
search, catching repeated operations instantly.

- SessionOperationCache with TTL, capacity eviction, and kv_store persistence
- Wired into TokenOptimizerService.checkEarlyExit() as first check
- cacheOperationResult() stores results after successful LLM execution
- session_cache_stats MCP tool for monitoring hit rates
- CLI: aqe token-usage --cache-stats for cache performance
- Cross-session persistence via existing kv_store table
- 26 new tests covering fingerprinting, TTL, eviction, stats, degradation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:36:35 +00:00
Dragan Spiridonov 73eab06585 feat: implement Six Hats Tier 3 Phase 1 — YAML pipelines, heartbeat CLI, economic routing (#334)
Three strategic features from Issue #334 with full CLI-MCP parity:

Imp-9: YAML Deterministic QE Pipelines
- Approval gate step type with auto-approve timeout and cancel cleanup
- 4 deterministic actions (quality-gate, coverage, pattern-health, routing)
  with real SQL queries and graceful DB degradation
- 7 CLI commands (aqe pipeline load/validate/run/list/status/approve/reject)
- YAML loader validation for approval fields

Imp-10: Token-Free Heartbeat CLI & MCP
- 6 CLI commands (aqe heartbeat status/run-now/history/log/pause/resume)
- 3 MCP tools (heartbeat_status/trigger/log)
- History persistence, date validation, timeout support

Imp-18: Economic Routing Model
- EconomicRoutingModel with quality-per-dollar scoring and EMA estimates
- Budget-aware tier selection with fallback strategies
- Cost-adjusted rewards for neural router (opt-in)
- CLI commands (aqe routing economics/accuracy/metrics)
- routing_economics MCP tool with kv_store persistence

Security: path traversal fix on CLI log reader, config weight validation

71 new tests across 6 test files, all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:09:55 +00:00
Dragan Spiridonov c4b625aa6c Merge pull request #386 from proffesor-for-testing/march-fixes-and-improvements
chore(release): v3.8.10
v3.8.10
2026-03-26 15:19:01 +01:00
Dragan Spiridonov ba1f017afb chore(release): bump version to v3.8.10
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:27:30 +00:00
Dragan Spiridonov 4bd61c27b8 fix(coverage): unify coverage data flow from test execution to quality score (#385)
Coverage data never reached quality assessment because of fragmented key
conventions, fabricated fallback values, and missing --coverage flags in
test commands. This commit fixes the entire coverage data pipeline:

- Remove fabricated coverage (up to 95%) when no real data exists
- Unify 5 orphaned key conventions into consistent coverage:latest,
  coverage:previous, and coverage:file:{path} keys
- Add --coverage flags to vitest/jest test commands
- Read coverage from disk (coverage-summary.json) when not in stdout
- Store per-file coverage via memory.set() (not storeVector) so
  quality-analyzer can read it
- Rotate coverage:previous only in coverage-analyzer (canonical writer)
  to prevent double-rotation race conditions
- Fix defect-predictor and defect-investigation orphaned key reads
- Replace hardcoded fake data in coverage-tracker worker with real reads
- Use safeJsonParse and path sanitization in disk coverage reader
- Report coverage: -1 (not 0) when no data available to avoid
  false 25-point quality score penalty

Closes #385

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:28:46 +00:00
Dragan Spiridonov 815a32c8b5 Merge pull request #384 from proffesor-for-testing/march-fixes-and-improvements
chore(release): v3.8.9
v3.8.9
2026-03-25 15:36:42 +01:00
Dragan Spiridonov d32176874c chore(release): bump version to v3.8.9
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:57:06 +00:00
Dragan Spiridonov d43bdfd915 fix(security): persist coherence gate witnesses, remove hardcoded signing key (#383)
W-2: Replace hardcoded 'agentic-qe-default-key' in proof-envelope
with crypto.randomBytes(32) when no explicit key is provided.
The previous default provided no meaningful signing security.

W-3: Add governance chain bridge to CoherenceGate. The coherence
gate now accepts an optional GovernanceWitnessChain (or
PersistentWitnessChain) via setGovernanceChain(). When attached,
every validation decision is persisted to the existing
witness_chain_receipts SQLite table in addition to the in-memory
witness array.

No new tables needed — uses existing witness_chain_receipts from
governance/witness-chain.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:12:25 +00:00
Dragan Spiridonov c725043631 fix(security): replace djb2 hash with SHA-256 in witness adapter, fix Blake3 docs (#383)
Security audit findings:

F-1 (CRITICAL): witness-adapter.ts used a 32-bit djb2 non-cryptographic
hash for witness records. Replaced with SHA-256 via Node.js crypto.
The previous implementation provided no tamper-evidence.

W-1 (WARN): Blake3 was referenced in 15+ code comments but never
implemented — SHA-256 is the actual algorithm used everywhere.
Updated all misleading references to accurately state SHA-256:
- coherence-gate.ts module JSDoc and method comments
- witness-adapter.ts module JSDoc
- ruvector-commands.ts flag description

Audit verdict: SHA-256 is sufficient for current use. Ed25519 is
already fully implemented in witness-key-manager.ts. Blake3 would
be a performance optimization, not a security requirement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 12:19:33 +00:00
Dragan Spiridonov 12216ec1a6 fix: address devil's advocate findings — wire language param, fix benchmark output, extend KG (#383)
Fixes from devil's advocate review:
- Wire `language` param through MCP coverage tools to parseCoverage()
  and include detected language/format in CoverageAnalyzeResult
- Add language-to-format inference map (LANGUAGE_FORMAT_HINTS) for
  format detection when only language is specified
- Use language hint to distinguish JaCoCo vs Kover XML
- Replace void template literals with console.log in benchmarks
  so data is actually recorded for cross-release comparison
- Add Swift and C# to KG matchesLanguage(), Swift to getFileType()
- Create #383 tracking remaining dropped items transparently

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:20:09 +00:00
Dragan Spiridonov 126667257a feat: multi-language Phase 5 — coverage parsers, language routing, MCP schemas (#324)
Add 6 multi-language coverage format parsers:
- JaCoCo XML (Java/Kotlin) with line/branch/method/instruction counters
- dotcover XML (C#/.NET) with statement-level coverage
- Tarpaulin JSON (Rust) with trace-based line coverage
- Go cover text format with block-level statement tracking
- Kover XML (Kotlin/JVM) via JaCoCo-compatible parsing
- xcresult JSON (Swift/iOS) with function-level detail

Add language-aware agent routing:
- New `languages` field on AgentCapabilityProfile
- 0.15 score boost for agents matching request language
- Configurable language weight in RoutingWeights
- Case-insensitive, backward-compatible

Update MCP tool schemas:
- Add `language` and `coverageFormat` params to coverage analyze/gaps tools
- Auto-detect format from filename and content signatures
- Extended findAndParseCoverage with multi-language file paths

24 new tests, all passing. 30 existing routing tests unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:02:41 +00:00
Dragan Spiridonov 233eba3aa0 feat(ruvector): add P1 scale benchmarks, concurrency tests, CLI memory display (#355)
Phase A of RuVector P1 items:
- Tiered HNSW benchmarks (1K→10K, 100K→500K with RUN_SCALE_BENCH=1)
- Migration performance benchmark with compression and rollback
- 8-agent coherence gate concurrency test (8 tests, 50-agent stress)
- HNSW memory usage display in `aqe ruvector status`
- v3.8.8 benchmark baseline for cross-release comparison

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 10:48:56 +00:00
Dragan Spiridonov 70adc500a8 Merge pull request #381 from proffesor-for-testing/march-fixes-and-improvements
chore(release): v3.8.8
v3.8.8
2026-03-25 08:04:47 +01:00
Dragan Spiridonov b4eebad70f fix: regenerate package-lock.json for npm ci compatibility
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:56:53 +00:00
Dragan Spiridonov 12f169af4f fix: sync package-lock.json with package.json for CI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:03:42 +00:00
Dragan Spiridonov bf0ff4126f chore(release): bump version to v3.8.8
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:53:19 +00:00
Dragan Spiridonov 0f44d7231a feat: migrate agents/skills from MCP to CLI, improve skill descriptions, make MCP opt-in
- Standardize 15 QE skill names to kebab-case (matching directory names)
- Enrich 18 skill descriptions with third-person voice and trigger terms
- Add `aqe memory` CLI command (store/get/search/list/delete/share/usage)
  with full MCP parity, reusing existing MCP handlers
- Migrate all 431 mcp__agentic-qe__* references across 230 agent/skill
  files (.claude/, assets/, .kiro/) to CLI equivalents (aqe task, aqe agent,
  aqe fleet, aqe memory, aqe coverage, aqe quality, aqe security, etc.)
- Make MCP server opt-in during `aqe init` (--with-mcp flag); CLI commands
  work without MCP server running
- Zero mcp__agentic-qe__* references remain in agent/skill definitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:45:15 +00:00
Dragan Spiridonov 2086bafa6b feat(parsers): add web-tree-sitter WASM for Python, Java, C#, Rust, Swift (#323)
Integrate tree-sitter WASM as the default parser for 5 languages, replacing
regex-only parsing (~97-98%) with AST-based parsing (~100% accuracy).

- Add TreeSitterWASMParser implementing ILanguageParser for 5 languages
- Bundle only needed WASM grammars in assets/grammars/ (8.5MB vs 50MB)
- Add FallbackParser with 3-retry logic before permanent regex degradation
- Add per-call parser instances to prevent concurrency races across await
- Add cyclomatic complexity computation from AST branching nodes
- Add property extraction from class/struct AST nodes
- Add AQE_PARSER_REGEX_ONLY=1 env var for opt-out to regex
- Replace require() with ESM-compatible dynamic import() in registry
- Mark web-tree-sitter as external in CLI/MCP esbuild configs
- Amend ADR-076 with decision rationale and alternatives evaluated

Alternatives evaluated and rejected:
- @ast-grep/napi: npm package only ships JS/TS/CSS/HTML, others need native .so
- node-tree-sitter: requires native C compilation via node-gyp

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 12:43:14 +00:00
Dragan Spiridonov ca788f6881 Merge pull request #379 from proffesor-for-testing/march-fixes-and-improvements
chore(release): v3.8.7
v3.8.7
2026-03-23 15:35:01 +01:00
Dragan Spiridonov e0eb5bfa29 chore(release): bump version to v3.8.7
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 14:17:36 +00:00
Dragan Spiridonov 0cc11ea05b fix: unify hypergraph persistence to memory.db, add CLI/MCP query tools
Eliminates the separate hypergraph.db file — all hypergraph data now lives
in the unified .agentic-qe/memory.db alongside other QE tables. Fixes stale
v3/ path references in governance shards. Adds user-facing hypergraph query
surface via CLI (`aqe hypergraph stats/untested/impacted/gaps`) and MCP
(`hypergraph_query` tool).

Key changes:
- coordinator + coordinator-hypergraph default path: hypergraph.db → memory.db
- governance shards: v3/src/domains/ → src/domains/ (12 files + constitution)
- init phase 06: now builds hypergraph tables during `aqe init --auto`
- coordinator.index(): rebuilds hypergraph on every code_index MCP call
- protocol: removed redundant buildHypergraphFromIndex (coordinator handles it)
- shared code-index-extractor: async batched I/O, arrow/method/interface patterns
- CLI handler: ensureInitialized guard, connection leak fix, path resolution
- MCP handler: hypergraph_query tool with stats/untested/impacted/gaps queries
- tool-scoping: hypergraph_query added to 5 agent roles
- completions: bash/zsh/fish/powershell support for hypergraph subcommands
- coordinator: publishes HypergraphDegraded event on init failure
- 12 new tests for code-index-extractor

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:48:09 +00:00
Dragan Spiridonov f0ad3cd65d v3.8.6: Security ReDoS fixes, flaky timer elimination, module decomposition (#378)
v3.8.6: Security ReDoS fixes, flaky timer elimination, module decomposition
v3.8.6
2026-03-23 09:01:44 +01:00
Dragan Spiridonov 606a024321 fix(test): update backtick regex assertion to match new pattern
The cve-prevention test asserted on the old `.*` regex source string.
Updated to match the new `[^`]*` negated character class.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 07:26:59 +00:00
Dragan Spiridonov 004141cc8e fix(security): eliminate remaining CodeQL ReDoS vectors
- command-validator: backtick regex `.*` → `[^`]*` (negated class
  eliminates backtracking between delimiters)
- input-sanitizer: UPDATE regex `\S+(?:\.\S+)*` → `[^\s.!]+(?:\.[^\s.!]+)*`
  (narrowed character class removes ambiguous overlap that caused
  exponential backtracking on repeated `!.` sequences)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 07:19:32 +00:00
Dragan Spiridonov f52f35271b fix(ci): restore package-lock.json from main with version bump
The lockfile was regenerated locally with missing private registry
packages, causing npm ci to fail in all CI jobs. Restored the
complete lockfile from main and only bumped the version to 3.8.6.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:42:17 +00:00
Dragan Spiridonov 939488ce3c chore: bump version to 3.8.6
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:17:20 +00:00
Dragan Spiridonov 3d7a2f91dd fix(security): resolve 4 CodeQL ReDoS alerts + decompose oversized modules
Security (CodeQL #193-196):
- command-validator: replace greedy .* with [^)]* in $() pattern
- input-sanitizer: replace .* with \S+(?:\.\S+)* in UPDATE SET pattern
- path-traversal-validator: split alternation into two .replace() calls
- regex-safety-validator: use [^\]]* and non-greedy variants in detection patterns

Flaky test indicators (5 files, 58 real setTimeout calls eliminated):
- file-watcher.test.ts: vi.useFakeTimers + advanceTimersByTimeAsync
- qcsd-refinement.test.ts: vi.useFakeTimers + advanceTimersByTimeAsync
- qcsd-ideation-url.test.ts: vi.useFakeTimers + advanceTimersByTimeAsync
- server-client.test.ts: process.nextTick for data callbacks
- stream-controller.test.ts: vi.useFakeTimers + advanceTimersByTimeAsync

File size discipline (issue #374 P2):
- time-crystal.ts (1,714 → 6 files, max 447 lines):
  time-crystal-types, phase-executor, time-crystal-persistence,
  time-crystal-analysis, time-crystal-scheduling, time-crystal (controller)
- qe-reasoning-bank.ts (1,941 → 7 files, max 738 lines):
  qe-reasoning-bank-types, pretrained-patterns, agent-routing,
  embedding-utils, pattern-promotion, qe-reasoning-bank (class)

All re-exports preserved for backward compatibility.
536 directly affected tests pass. Build clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 19:58:01 +00:00
Dragan Spiridonov 37de92af2e Merge pull request #376 from proffesor-for-testing/march-fixes-and-improvements
chore(release): v3.8.5
v3.8.5
2026-03-22 10:29:31 +01:00
Dragan Spiridonov 0b9e4ca65f Merge branch 'main' into march-fixes-and-improvements 2026-03-22 10:09:48 +01:00
Dragan Spiridonov 7c58397035 Merge pull request #377 from proffesor-for-testing/dependabot/npm_and_yarn/npm_and_yarn-e5a595f223
chore(deps-dev): bump flatted from 3.4.1 to 3.4.2 in the npm_and_yarn group across 1 directory
2026-03-22 10:08:59 +01:00
Dragan Spiridonov 21eae2456f fix(ci): check vitest stdout instead of junit.xml for test results
Root cause found: junit.xml is 0 bytes because vitest writes it only
on clean process exit. When timeout sends SIGTERM, vitest is killed
before flushing the junit report.

New approach: pipe vitest output through tee to capture stdout. After
timeout kills vitest, grep the captured output for vitest's "Test
Files  X passed" summary line (printed after all tests complete but
before the process hang). If found with no failures, exit 0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 09:03:39 +00:00
Dragan Spiridonov 2a8e21eff9 fix(ci): simplify junit check and add debug output
Previous check failed because TESTS_RUN grep returned empty.
Simplify to just check for absence of <failure tags and presence
of <testsuites tag. Add diagnostic notices to debug junit.xml state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:43:40 +00:00
Dragan Spiridonov 20cb8f329e fix(ci): revert passing jobs back to timeout 480
Only apply the ci-vitest-run.sh wrapper to the 5 jobs that actually
hang (MCP Handlers, MCP Root, Journey RuVector, Journey Root, Journey
Remaining). Revert Governance, Security, and Tools+Transport back to
plain `timeout 480` since they were already passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:45:16 +00:00
Dragan Spiridonov 76427caab2 fix(ci): use timeout --foreground to prevent killing wrapper script
The `timeout` command was killing the entire process group (including
the wrapper script) before the junit.xml recovery check could run.
Using `--foreground` sends the signal only to the vitest child process,
allowing the wrapper to check junit.xml and exit 0 when tests passed.

Also added diagnostic messages for when junit.xml is missing or shows
failures, and uses && || pattern for bash -e compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:36:41 +00:00
dependabot[bot] e5d9b6e62d chore(deps-dev): bump flatted
Bumps the npm_and_yarn group with 1 update in the / directory: [flatted](https://github.com/WebReflection/flatted).


Updates `flatted` from 3.4.1 to 3.4.2
- [Commits](https://github.com/WebReflection/flatted/compare/v3.4.1...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-21 20:28:20 +00:00
Dragan Spiridonov 505e2944ff fix(ci): ensure junit reporter runs for timeout recovery (#376)
Two fixes:
1. ci-vitest-run.sh now injects --reporter=junit before user args so
   junit.xml is always written even when --reporter=verbose overrides
   vitest.config.ts reporters. Also use portable grep -o instead of
   grep -oP.
2. MCP Integration Tests: add continue-on-error to dorny/test-reporter
   step which was failing the job independently of test results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:04:29 +00:00
Dragan Spiridonov 3f479e4a6f fix(ci): handle vitest process hang after test completion (#376)
Vitest completes all tests but hangs due to open handles (SQLite
connections, HNSW models, timers). The `timeout 480` command kills
it with exit code 124, which CI treats as failure even though all
tests passed.

Add scripts/ci-vitest-run.sh wrapper that checks junit.xml for
actual test results when timeout kills the process. If all tests
passed, exit 0 instead of 124.

Fixes 6 CI jobs: Journey (Remaining Subdirs, Root-level, RuVector),
MCP (Integration, Handlers, Root Files).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 19:31:51 +00:00
Dragan Spiridonov ee1416e4d4 chore(release): bump version to v3.8.5
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:48:57 +00:00
Dragan Spiridonov fdd32a42ce fix(tests): add vi.useFakeTimers() to 11 files using real setTimeout (#374 P2)
11 test files used real setTimeout without vi.useFakeTimers(), adding
wall-clock time to sequential CI execution. Converted to fake timers
with vi.advanceTimersByTime() for deterministic, instant execution.

Files fixed:
- error-paths/ (5 files): circuit breaker, workflow timeout, consensus
  timeout, task timeout, concurrent init — ~33 setTimeout patterns
- kernel/ (3 files): TTL expiration tests that waited 1100ms real time
- mcp/metrics (1 file): 7 timing-measurement tests
- cli/progress (1 file): 3 ETA estimator tests
- memory/crdt (1 file): convergence time tracking

Estimated CI time savings: ~10s per sequential run.

11 files intentionally skipped (real I/O, production timer logic):
websocket-transport, mcp-server, adr-040, swarm-skill-validator,
plan-executor, parallel-eval-runner, failover, behavior-tree, etc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:52:46 +00:00
Dragan Spiridonov 00e4d2cfa6 fix(tests): add afterEach cleanup to 104 test files missing it (#374 P2)
125 test files had beforeEach/beforeAll but no afterEach/afterAll,
leaking state between tests and causing order-dependent failures.

Added cleanup to 104 files (skipped 4 archived, 16 import-only):
- 2 critical DB handle leaks (witness-chain): added db.close()
- 7 high-risk service files: added vi.restoreAllMocks()
- 7 beforeAll files: added matching afterAll
- 88 medium/low risk: added afterEach with appropriate cleanup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:51:47 +00:00
Dragan Spiridonov 076d55e704 fix(ci): add timeout 480 to remaining 5 unguarded npm run commands
Missed in prior commit: infrastructure tests, regression tests,
performance gate, mcp:validate, and mcp:report all lacked OS-level
timeout guards. Now every npm-run and vitest command in both CI
workflows has timeout 480.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:21:43 +00:00