Skip to content

feat(0.7.0): AI-ready risk gate — SARIF, MCP server, incremental cache - #22

Merged
alimaandev merged 5 commits into
mainfrom
release/0.7.0
Aug 18, 2026
Merged

feat(0.7.0): AI-ready risk gate — SARIF, MCP server, incremental cache#22
alimaandev merged 5 commits into
mainfrom
release/0.7.0

Conversation

@alimaandev

Copy link
Copy Markdown
Owner

Four commits building toward the 0.7.0 launch (AI-agent tooling + performance):

1. Incremental parse cache (5dee94d, refined in f14dea5)

  • .ripple/cache/ caches parsed surfaces; unchanged files are served without re-parsing, so repeated analyze/graph/diff/doctor runs are byte-identical to cold runs.
  • Schema 2 freshness: mtime+size fast path (no read, no hash), parallel file stats, cache only rewritten when something actually changed.
  • RIPPLE_NO_CACHE=1 to disable.

2. SARIF 2.1.0 output (b511c51)

  • ripple diff --format sarif and ripple analyze --sarif for GitHub Code Scanning, with stable primaryLocationLineHash fingerprints and allowlist entries emitted as note with in-source suppression.

3. ripple mcp (685e8bb)

  • Model Context Protocol server over stdio (protocol 2025-06-18) exposing impact, dependents, risk, gate_status — lets AI agents risk-check refactors before touching code.

4. Benchmarks (f14dea5)

  • scripts/bench.mjs: seeded synthetic layered projects (200–2000 files), cold-vs-warm, determinism check. Results in BENCHMARKS.md: ~1.2x–1.7x warm speedup, byte-identical output.
  • RIPPLE_TRACE=1 per-stage timing instrumentation.

Companion repo: alimaandev/ripple-action (GitHub Action wrapping these features, tag v1, smoke-tested on real PRs).

Repeated runs only re-parse files whose content changed; everything else is
served from a cached surface under .ripple/cache, keeping the stable JSON
contract byte-identical while large-codebase runs get faster.

- buildGraphFromParsed extracted so the pipeline can reuse parsed surfaces
- ts-morph project drops stale SourceFiles before re-parsing a changed file
- parseSourceFile now records parseError for extractor throws too, so broken
  files lower confidence instead of aborting the run
- discovery hard-excludes .ripple so the cache is never scanned
- RIPPLE_NO_CACHE=1 forces a cold run (for benchmarks); .ripple gitignored
- ripple diff --format sarif: one finding per changed file, error for
  CRITICAL/HIGH, warning for MEDIUM, note for LOW; allowlisted files are
  emitted as note with an in-source suppression
- ripple analyze --sarif: single-file finding
- stable primaryLocationLineHash fingerprints for GitHub Code Scanning
  deduplication; gate verdict still carried by the exit code
- docs: README diff/analyze flag tables + Code Scanning upload example,
  CHANGELOG [Unreleased]
- tests: unit (level mapping, fingerprints, suppressions, stability) and
  integration (analyze --sarif, diff --format sarif, updated format error)
ripple mcp serves Ripple's analysis over stdio as MCP tools:
- impact: blast radius of a file (affected files, routes, tests,
  components, risk level)
- dependents: who imports a file, up to a depth
- risk: score with factor breakdown
- gate_status: current change set vs the merge gate, pass/block verdict

Hand-rolled JSON-RPC 2.0 core (initialize, ping, tools/list,
tools/call) - no new dependencies. Tool failures return isError
results instead of killing the session; stdout stays strict
protocol-only. Project loads lazily on first tool call and is
cached for the session.

docs: README MCP section with client config example, CHANGELOG
[Unreleased]
tests: protocol unit tests (10), tool unit tests (10), and two
spawn-based integration tests exercising the real stdio server
…hmark harness

- cache entries carry size+mtimeMs; unchanged files hit on stat alone
  (no read, no hash), stats run in parallel, and the cache is only
  rewritten when something changed
- RIPPLE_TRACE=1 per-stage timings for pipeline/cache/graph profiling
- scripts/bench.mjs: seeded synthetic layered projects (200..2000 files),
  cold vs warm, determinism check; BENCHMARKS.md documents methodology
- eslint: node globals for scripts/*.mjs
@alimaandev
alimaandev merged commit 14c7e24 into main Aug 18, 2026
8 checks passed
@alimaandev
alimaandev deleted the release/0.7.0 branch August 18, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant