Commit Graph

6 Commits

Author SHA1 Message Date
Dragan Spiridonov 475bd61a75 fix(learning): purge 15K junk patterns, fix DB corruption, improve quality scoring
- Rebuild corrupted memory.db (82 corrupt pages causing 43% dream cycle failures)
- Purge 15,624 benchmark/test artifacts from qe_patterns (bench-*, Dream: novel_association, Test Pattern)
- Fix benchmark test isolation: add useUnified: false to prevent prod DB pollution
- Improve cli-hook quality scoring: context-aware (source/speed) instead of hardcoded 0.7/0.3
- Fix statusline to show only meaningful patterns (was inflating count with junk + cross-table sum)
- Update fallback statusline generator with same meaningful-only query

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 12:02:53 +00:00
Dragan Spiridonov f341beefdf fix(init): resolve issues #361-367 from Nate's testing feedback
- #361: opencode-installer uses package-relative path resolution with
  resolveViaPackageJson() fallback, never uses CWD as source
- #362: permissions union-merged via _aqePermissions to preserve user entries
- #363: brain-checkpoint/statusline hooks use hardcoded projectRoot fallback
  instead of `pwd` in $(git rev-parse ... || echo "<path>")
- #364: created .claude/helpers/validation-pipeline.cjs with 13-step
  requirements pipeline, updated SKILL.md references
- #365: agents-installer bumps `updated:` frontmatter date when overlays
  modify agent content
- #366: qe-security-scanner dependency on qe-dependency-mapper changed
  from hard to soft
- #367: --steps parameter documented as comma-separated string consistently

Closes #361, closes #362, closes #363, closes #364, closes #365, closes #366, closes #367

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 18:46:53 +00:00
Dragan Spiridonov 65f9999a77 fix(security): complete ruflo rebrand across skills, helpers, and bridge modules
Finish the claude-flow → ruflo rename in all remaining references:
skills (iterative-loop, QCSD swarms), git helpers, statusline, and
the TypeScript bridge modules (model-router, pretrain, trajectory).
Add resolveCliPackage() for consistent CLI resolution with fallback.
Also includes SONA graceful degradation and isSONAAvailable() API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:19:11 +00:00
Dragan Spiridonov 948d4e0f41 fix: use __dirname instead of process.cwd() in helpers for reliable path resolution (#352)
Helpers (brain-checkpoint.cjs, statusline-v3.cjs) used process.cwd()
to find the project root, which breaks when Claude Code runs hooks from
a different working directory. Fixed to use path.resolve(__dirname, '..', '..')
since these files always live at <project>/.claude/helpers/.

Also updated hook commands in 07-hooks.ts and settings-merge.ts to use
$(git rev-parse --show-toplevel) for absolute path resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 09:54:30 +00:00
Dragan Spiridonov 575633958a fix: eliminate shell injection vectors, upgrade error logging, and reduce DRY violations
P1 (Security): Convert all execSync template-literal calls to execFileSync
with argument arrays, eliminating shell metacharacter injection across:
- claude-flow-adapter.ts (8 calls)
- trajectory-bridge.ts, pretrain-bridge.ts, model-router-bridge.ts (8 calls)
- brain-checkpoint.cjs, statusline-v3.cjs helpers (3 calls)
- 07-hooks.ts generated scripts (2 calls)
Remove dead escapeArg() methods from bridge files.

P2 (Reliability): Replace swallowed .catch(() => {}) handlers with
structured logging via createLogger() from the project's LoggerFactory:
- task-executor.ts: 5 recordOutcome catches → logger.warn with taskId
- experience-capture-middleware.ts: embedding catch → ecLogger.warn
- token-tracker.ts: DB init + KV persist → ttLogger.warn
- qe-reasoning-bank.ts: 3 witness chain catches → logger.warn
- init-wizard.ts: V2 migration → console.warn (logger not yet initialized)

P2 (Correctness): Guard non-null assertion in mincut-test-optimizer.ts
with early continue. Wrap JSON.parse in brain-rvf-exporter.ts with
inner try-catch for clearer error messages on malformed kernel data.

P3 (DRY): Extract shared backoffDelay() to src/shared/llm/retry.ts,
replacing 12 duplicate Math.min(1000 * Math.pow(2, attempt), 30000)
across 6 LLM providers. Collapse 100-line capability boolean matrix
in agent-router-config.ts into 4 named presets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 16:15:37 +00:00
Dragan Spiridonov 6307ce1f9a statusline fixes 2026-03-11 11:43:34 +00:00