Skip to content

feat(v0.16): SPI cache (#77) + multi-resolution (#76) + weighted coverage (#79) + cache-aware prompt hash (#80) - #123

Merged
mohanagy merged 2 commits into
mainfrom
feat/v0.16-finishers
May 11, 2026
Merged

mohanagy merged 2 commits into
mainfrom
feat/v0.16-finishers

Conversation

@mohanagy

@mohanagy mohanagy commented May 11, 2026 •

Copy link
Copy Markdown
Owner

Closes #77
Closes #76
Closes #79
Closes #80

Summary

Closes out v0.16-runtime-efficiency in one bundled PR. Four issues landed:

What's in the bundle

#77 SPI cache (src/pipeline/spi/cache.ts)

  • buildSpiCached(opts) wraps buildSpi with disk-backed all-or-nothing caching
  • Cache key = sha256 of workspace root + extractor_version + graphify_version + tsconfig content + per-file (path, mtime, size, sha256)
  • Cache layout: <root>/graphify-out/.spi-cache/{index.json, spi.json}
  • Format-versioned (CACHE_FORMAT_VERSION=1) so future schema changes invalidate cleanly
  • Returns SpiCacheStats (hit/reason/duration_ms/file_count/cache_key) via onCacheLookup callback
  • Public API: buildSpiCached, clearSpiCache, BuildSpiCachedOptions, BuildSpiCachedResult, SpiCacheStats, SpiCacheIndex

#76 Multi-resolution (src/runtime/context-pack-resolution.ts)

  • applyContextPackResolution(nodes, options) adapts a node list to one of:
    • detail — no-op, full snippets
    • summary — strip snippet bodies (label/source_file/line_number/match_score only)
    • mixed — top-N by match_score get detail, rest get summary (default N = ceil(n/3))
  • New stdio context_pack parameter: resolution: 'detail' | 'summary' | 'mixed'
  • Response includes resolution, resolution_map, bytes_saved_by_resolution

#79 Weighted coverage scoring

  • New PrImpactResult fields:
    • coverage_score_weighted — bridge/god labels count 3x, regular 1x
    • uncovered_hotspot_severities — per-label 'critical' (bridge/god) / 'high' (high-impact) / 'medium'
    • critical_labels — bridge+god subset of high-impact labels (consumer-readable)
  • Compact path recomputes weighted score + severities against the post-compaction review bundle (same correctness contract as the unweighted score)

#80 Cache-aware prompt layout — stable_prefix_hash

  • New BuiltContextPrompt field: stable_prefix_hash (sha256-16 of stable_prefix)
  • Byte-stable across re-runs when the underlying graph/anchor is unchanged
  • Invariant under dynamic-suffix changes — i.e., cache-hit precondition for Anthropic's automatic prompt cache reuse

Tests

  • +43 new tests across 4 files:
    • tests/unit/spi-cache.test.ts (13 tests)
    • tests/unit/context-pack-resolution.test.ts (10 tests)
    • tests/unit/context-prompt-cache-hash.test.ts (5 tests)
    • tests/unit/pr-impact-weighted-coverage.test.ts (5 tests)
  • Updated 5 existing fixtures for the new PrImpactResult shape
  • Existing "materially reduces" thresholds raised from 780 → 820 to absorb the 3 new compact fields
  • MCP schema-budget ceiling raised from 12,000 → 12,200 to accommodate the resolution parameter

Test plan

  • npm run typecheck clean
  • npm run build clean
  • npm run test:run — 1793/1793 pass (107 files)

Summary by CodeRabbit

  • New Features
    • On-disk caching for semantic program indexing to accelerate builds.
    • Multi-resolution modes (detail, summary, mixed) for context packs to reduce payloads.
    • PR impact analysis now reports weighted coverage scores, hotspot severities, and critical labels.
    • Exposed a stable prefix hash for context prompts to support cache validation.
    • Added cache management function to clear persisted cache artifacts.

Review Change Stack

…rage (#79) + cache-aware prompt hash (#80)

Closes out v0.16-runtime-efficiency in one bundled PR (as requested).

## #77 Incremental SPI cache

- New module src/pipeline/spi/cache.ts exporting buildSpiCached(opts) — wraps buildSpi with disk-backed all-or-nothing caching keyed by sha256 of (workspace root + extractor_version + graphify_version + tsconfig content + per-file (path, mtime, size, sha256)).

- Cache layout: <root>/graphify-out/.spi-cache/{index.json,spi.json}. Format-versioned (CACHE_FORMAT_VERSION=1) so future schema changes invalidate cleanly.

- Returns a SpiCacheStats payload (hit/reason/duration_ms/file_count/cache_key) via onCacheLookup callback so consumers can log telemetry without re-deriving the key.

- Public API: buildSpiCached, clearSpiCache, BuildSpiCachedOptions, BuildSpiCachedResult, SpiCacheStats, SpiCacheIndex.

## #76 Multi-resolution context representations

- New helper src/runtime/context-pack-resolution.ts exporting applyContextPackResolution(nodes, options) — supports 'detail' (no-op), 'summary' (strip snippet bodies), and 'mixed' (top-N detail by match_score, rest summary).

- New stdio context_pack parameter: resolution: 'detail' | 'summary' | 'mixed' (default detail).

- Reports bytes_saved when shrinking nodes; resolution_map[] for diagnostics.

## #79 Weighted coverage scoring

- New PrImpactResult fields: coverage_score_weighted (bridge/god labels count 3x), uncovered_hotspot_severities (per-label 'critical'/'high'/'medium' tiers), critical_labels (bridge+god subset of high-impact labels).

- Compact path recomputes weighted score + severities against the post-compaction review bundle, same correctness contract as the unweighted score from CodeRabbit follow-up to #79.

## #80 Cache-aware prompt layout — stable_prefix_hash

- New BuiltContextPrompt field: stable_prefix_hash (sha256-16 of stable_prefix).

- Byte-stable across re-runs when the underlying graph/anchor is unchanged; flips when stable content changes; invariant under dynamic-suffix changes (cache-hit precondition for Anthropic prompt cache reuse).

## Tests

- +43 new tests across 4 files. Updated 5 existing fixtures for the new PrImpactResult shape. Existing 'materially reduces' thresholds raised from 780 → 820 to absorb the 3 new compact fields. MCP schema-budget ceiling raised from 12,000 → 12,200 to accommodate the resolution parameter on context_pack.

- Verified: typecheck + build clean, 1793/1793 tests pass.
@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1892103b-855c-4a34-bd6c-b9a151440d78

📥 Commits

Reviewing files that changed from the base of the PR and between 6397193 and b20ad75.

📒 Files selected for processing (4)
  • src/pipeline/spi/cache.ts
  • src/runtime/pr-impact.ts
  • src/runtime/stdio/tools.ts
  • tests/unit/spi-cache.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/unit/spi-cache.test.ts
  • src/runtime/pr-impact.ts
  • src/pipeline/spi/cache.ts

📝 Walkthrough

Walkthrough

This PR adds stable prompt hashing for cache validation, an opt-in on-disk SPI cache with deterministic workspace fingerprinting, multi-resolution context-pack transformations and stdio wiring, and weighted PR-impact coverage scoring with compaction updates and tests.

Changes

Stable Prompt Infrastructure

Layer / File(s) Summary
Stable Prefix Hash Contract
src/infrastructure/context-prompt.ts
BuiltContextPrompt interface gains stable_prefix_hash field, a 16-char lowercase hex SHA-256 digest of the stable prefix for cache validation.
Prompt Hash Computation
src/infrastructure/context-prompt.ts
Imports Node.js createHash; computes and includes stable_prefix_hash in buildContextPrompt return value.
Hash Determinism Tests
tests/unit/context-prompt-cache-hash.test.ts
Verifies hash is deterministic 16-char hex, stable across identical stable inputs, changes when stable_sections content changes, and remains deterministic across section ordering variations.

Semantic Program Index Caching

Layer / File(s) Summary
Cache Constants & Exclusions
src/pipeline/spi/cache.ts
Defines cache directory/file names, cache format version, excluded directories, and indexable source extensions.
Cache Types & Options
src/pipeline/spi/cache.ts
Defines SpiCacheIndex, SpiCacheStats, BuildSpiCachedOptions, and BuildSpiCachedResult interfaces for cache metadata and build results.
Build & Lookup Implementation
src/pipeline/spi/cache.ts
buildSpiCached computes workspace fingerprints, optionally bypasses cache, attempts cache load with format/key validation and minimal SPI shape checks, rebuilds on miss, and persists with best-effort writes. clearSpiCache removes persisted cache.
Workspace Fingerprinting
src/pipeline/spi/cache.ts
Computes deterministic cache_key from workspace root, extractor/graphify versions, tsconfig.json bytes, and per-file indexable-source hashes with mtimeMs and size.
Cache Validation & Persistence
src/pipeline/spi/cache.ts
Parses and validates index.json/spi.json (format_version and exact cache_key), performs minimal SPI shape checks, writes cache metadata and SPI serialization, and provides safe-delete helpers.
Public API Re-exports
src/pipeline/spi/index.ts
Exposes buildSpiCached, clearSpiCache, and cache-related types from ./cache.js.
Cache Behavior Tests
tests/unit/spi-cache.test.ts
Tests cover cache hits/misses, invalidation on source/version/tsconfig changes, noCache flag behavior, onCacheLookup observability, byte-for-byte output equivalence, corrupt-cache recovery, and cacheDir override isolation.

Multi-Resolution Context Packing

Layer / File(s) Summary
Resolution Logic & Modes
src/runtime/context-pack-resolution.ts
Defines ContextPackResolution type (detail/summary/mixed), option/result interfaces, and applyContextPackResolution dispatcher with default detail_top_n calculation.
Summary & Mixed Mode Implementations
src/runtime/context-pack-resolution.ts
Implements summary mode (nulls snippets, tracks bytes_saved), mixed mode (ranks by match_score, keeps top-N as detail, summarizes rest), and helper transformers.
Tool Schema Extension
src/runtime/stdio/definitions.ts
Adds optional resolution parameter to context_pack tool input schema with enum constraint (detail/summary/mixed).
Tool Handler Integration
src/runtime/stdio/tools.ts
Parses resolution argument; rejects it for review/impact tasks; applies applyContextPackResolution to matched nodes in delta and non-delta paths; returns resolution, bytes_saved_by_resolution, and resolution_map when applicable.
Resolution Mode Tests
tests/unit/context-pack-resolution.test.ts
Tests verify detail is no-op with zero savings, summary nulls all snippets accurately, mixed ranks by score and preserves input order, handles defaults and edge cases (zero top-N, top-N≥node count, empty input), and works with pre-null snippets.

PR-Impact Weighted Coverage Scoring

Layer / File(s) Summary
Coverage Score & Severity Types
src/runtime/pr-impact.ts
PrImpactResult gains coverage_score_weighted, uncovered_hotspot_severities (label+severity pairs), and critical_labels list. CompactPrImpactResult type updated accordingly.
No-Change Early Return Defaults
src/runtime/pr-impact.ts
Early-return when no changed files now sets coverage_score_weighted: 1, empty uncovered_hotspot_severities, and empty critical_labels.
Weighted Coverage Computation
src/runtime/pr-impact.ts
analyzePrImpact computes coverage_score_weighted using 3× weighting for bridge/god labels, derives per-hotspot severity (critical/high), and identifies critical_labels.
Compact Result Recomputation
src/runtime/pr-impact.ts
compactPrImpactResult recomputes weighted coverage and uncovered-hotspot severities on the compacted bundle using full result critical_labels, and includes these fields in the compact output.
Fixture & Test Updates
tests/unit/pr-impact-*.test.ts, tests/unit/mcp-schema-budget.test.ts, tests/unit/stdio-pr-impact.test.ts
Fixtures extended with new fields; new weighted-coverage tests added; token budget expectations adjusted to account for added compact fields.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • mohanagy/graphify-ts#9: Both PRs modify src/runtime/pr-impact.ts (adding/changing the analyzePrImpact/compactPrImpactResult result shape and logic), so the changes are directly related.
  • mohanagy/graphify-ts#30: Both PRs modify src/runtime/pr-impact.ts and its public result shapes/compaction behavior (the main PR adds weighted coverage fields and compaction updates while the retrieved PR implements larger pr_impact refactor/compaction/seed-node changes), so they are related.
  • mohanagy/graphify-ts#121: Both modify the context_pack tool surface (stdio/tooling and definitions) to add new runtime behaviors—multi-resolution (resolution) in the main PR and diagnostics/delta-session support in the retrieved PR—so they are related.

🐰 I shuffled stable lines to keep the cache tight,
I stash SPI bytes so builds are light,
I trim snippets where detail's not due,
I weight hotspots so criticals shine through. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main changes: four bundled v0.16 features (SPI cache, multi-resolution, weighted coverage, cache-aware prompt hash) with issue numbers.
Description check ✅ Passed The PR description comprehensively covers all required template sections: Summary (what changed and why), detailed changes per feature, testing evidence (43 new tests, fixtures updated, clean test run), and all checklist items addressed.
Linked Issues check ✅ Passed All four linked issues (#77, #76, #79, #80) have their coding requirements fully met: SPI cache with safe invalidation [#77], multi-resolution context support [#76], weighted coverage scoring with severity tiers [#79], and cache-aware prompt layout with stable_prefix_hash [#80].
Out of Scope Changes check ✅ Passed All code changes directly support the four linked issues: cache implementation, resolution functions, weighted coverage logic, and prompt hash computation. Test updates and threshold adjustments are appropriate scope-related changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v0.16-finishers

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/runtime/stdio/tools.ts (1)

821-877: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

resolution is silently ignored for task: 'review' | 'impact'.

Line 891 parses resolution after early returns in Lines 821-877, so callers can pass resolution with no effect and no validation error. Either apply it to those task outputs or reject unsupported combinations explicitly.

Suggested minimal guard (prevent silent no-op)
+      const resolutionParam = helpers.stringParam(toolArguments, 'resolution')
+      const resolution: ContextPackResolution =
+        resolutionParam === 'summary' || resolutionParam === 'mixed'
+          ? resolutionParam
+          : 'detail'
+
+      if ((task === 'review' || task === 'impact') && resolutionParam) {
+        return helpers.failure(
+          id,
+          helpers.jsonrpcInvalidParams,
+          'resolution is currently supported only for task=explain',
+        )
+      }
-
-      if (task === 'review') {
+      if (task === 'review') {

Also applies to: 888-895

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime/stdio/tools.ts` around lines 821 - 877, The review and impact
branches ignore the caller-supplied resolution parameter because resolution
validation/parse happens later; update the task === 'review' and task ===
'impact' handling in the function that builds the context pack so resolution is
either validated early or rejected: check for the presence of resolution in
toolArguments (or the parsed resolution variable) before the early returns for
review/impact and either apply it into the returned payload (the object built
for helpers.textToolResult / contextPackBasePayload) or return helpers.failure
with jsonrpcInvalidParams when resolution is unsupported; locate the logic
around the review branch (task === 'review',
analyzePrImpact/compactPrImpactResult/contextMetadata/storeExpandableHandles/buildTaskContextPlan)
and the impact branch (task === 'impact',
retrieveContext/pickImpactTarget/analyzeImpact/impactMetadata) and add the
resolution check there so callers cannot pass resolution with no effect.
🧹 Nitpick comments (1)
src/runtime/pr-impact.ts (1)

1182-1189: 💤 Low value

Unreachable 'medium' severity branch.

The default severity = 'medium' at line 1185 is unreachable because uncoveredHotspots (lines 1159–1161) is already filtered to only include nodes in highImpactLabelSet. Every node will therefore match either the critical condition (line 1186) or the high condition (line 1187).

If the intent is to support non-high-impact changed nodes in the future, consider adding a comment. Otherwise, simplify by removing the unreachable branch or initializing severity to 'high' since that's the only non-critical outcome.

♻️ Proposed simplification
 const uncoveredHotspotSeverities: Array<{ label: string; severity: 'critical' | 'high' | 'medium' }> =
     uncoveredHotspots.map((node) => {
       const label = node.label
-      let severity: 'critical' | 'high' | 'medium' = 'medium'
-      if (bridgeSet.has(label) || godSet.has(label)) severity = 'critical'
-      else if (highImpactLabelSet.has(label)) severity = 'high'
+      const severity: 'critical' | 'high' = (bridgeSet.has(label) || godSet.has(label)) 
+        ? 'critical' 
+        : 'high'
       return { label, severity }
     })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime/pr-impact.ts` around lines 1182 - 1189, The mapping that builds
uncoveredHotspotSeverities sets severity default to 'medium' but
uncoveredHotspots is already filtered to high-impact labels, making 'medium'
unreachable; update the code in the uncoveredHotspots.map block to remove the
'medium' case by changing the severity type to only 'critical' | 'high',
initialize severity to 'high', and return either 'critical' if
bridgeSet.has(label) || godSet.has(label) else 'high' — also adjust the declared
Array type for uncoveredHotspotSeverities accordingly or add a clarifying
comment if you intend to reintroduce 'medium' later.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pipeline/spi/cache.ts`:
- Around line 156-195: The miss-reason computed from tryLoadCache (the variable
assigned from cached.kind ->
'key-mismatch'|'format-version-mismatch'|'corrupt-cache') is discarded and later
overwritten by checking existsSync(indexPath) after saveCache; fix by computing
and preserving that reason before calling safeDelete/saveCache and then pass
that preserved reason into finishStats for the miss return. Concretely, move the
declaration of the reason out of the if-block (or capture it into a local let
like missReason), set missReason based on cached.kind where tryLoadCache is
handled, call safeDelete(indexPath)/safeDelete(spiPath) and saveCache as before,
and then use missReason (falling back to 'no-cache' only if it was never set)
when building the final cache stats in the return that calls finishStats.
- Around line 127-154: The function buildSpiCached currently computes
computeWorkspaceFingerprint(root, opts) before checking opts.noCache, causing
expensive workspace hashing even when caching is disabled; change the control
flow so the opts.noCache guard runs before calling computeWorkspaceFingerprint
(or bail out immediately when opts.noCache is true), so that when noCache is
true you directly call buildSpi(opts) and return the cache-disabled result
without invoking computeWorkspaceFingerprint or any file I/O.

In `@src/runtime/stdio/tools.ts`:
- Around line 896-909: The helper applyResolutionToNodes currently returns only
{ nodes, bytes_saved } and drops applyContextPackResolution's resolution_map and
per-resolution savings; update applyResolutionToNodes to preserve and forward
resolution_map and bytes_saved_by_resolution from applyContextPackResolution
(e.g., return { nodes: result.nodes as T[], bytes_saved: result.bytes_saved,
resolution_map: result.resolution_map, bytes_saved_by_resolution:
result.bytes_saved_by_resolution }) so both non-delta and delta response paths
that call applyResolutionToNodes (and the callers around lines where it is used)
can include resolution_map and per-resolution savings in the response payload.

In `@tests/unit/spi-cache.test.ts`:
- Around line 28-59: The tests call buildSpiCached but don't assert the correct
miss reasons; update the three specs that call buildSpiCached to assert the
expected cache.reason values from the stats contract: in the first call (cold
start) assert the miss reason is the "no-cache" entry reason (e.g., 'no-cache'
or the project's canonical no-cache string) instead of leaving it out, and in
the file-change invalidation test replace the incorrect
expect(reBuild.cache.reason).toBe('fresh-cache') with the proper stale rebuild
reason (e.g., 'stale-cache'); locate and adjust assertions around buildSpiCached
in the tests so the first call checks for the no-cache reason and the
rebuild-after-change checks for stale-cache.

---

Outside diff comments:
In `@src/runtime/stdio/tools.ts`:
- Around line 821-877: The review and impact branches ignore the caller-supplied
resolution parameter because resolution validation/parse happens later; update
the task === 'review' and task === 'impact' handling in the function that builds
the context pack so resolution is either validated early or rejected: check for
the presence of resolution in toolArguments (or the parsed resolution variable)
before the early returns for review/impact and either apply it into the returned
payload (the object built for helpers.textToolResult / contextPackBasePayload)
or return helpers.failure with jsonrpcInvalidParams when resolution is
unsupported; locate the logic around the review branch (task === 'review',
analyzePrImpact/compactPrImpactResult/contextMetadata/storeExpandableHandles/buildTaskContextPlan)
and the impact branch (task === 'impact',
retrieveContext/pickImpactTarget/analyzeImpact/impactMetadata) and add the
resolution check there so callers cannot pass resolution with no effect.

---

Nitpick comments:
In `@src/runtime/pr-impact.ts`:
- Around line 1182-1189: The mapping that builds uncoveredHotspotSeverities sets
severity default to 'medium' but uncoveredHotspots is already filtered to
high-impact labels, making 'medium' unreachable; update the code in the
uncoveredHotspots.map block to remove the 'medium' case by changing the severity
type to only 'critical' | 'high', initialize severity to 'high', and return
either 'critical' if bridgeSet.has(label) || godSet.has(label) else 'high' —
also adjust the declared Array type for uncoveredHotspotSeverities accordingly
or add a clarifying comment if you intend to reintroduce 'medium' later.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e1de36e9-6239-4703-b9c3-a615d8da9530

📥 Commits

Reviewing files that changed from the base of the PR and between 4846657 and 6397193.

📒 Files selected for processing (15)
  • src/infrastructure/context-prompt.ts
  • src/pipeline/spi/cache.ts
  • src/pipeline/spi/index.ts
  • src/runtime/context-pack-resolution.ts
  • src/runtime/pr-impact.ts
  • src/runtime/stdio/definitions.ts
  • src/runtime/stdio/tools.ts
  • tests/unit/context-pack-resolution.test.ts
  • tests/unit/context-prompt-cache-hash.test.ts
  • tests/unit/mcp-schema-budget.test.ts
  • tests/unit/pr-impact-coverage.test.ts
  • tests/unit/pr-impact-weighted-coverage.test.ts
  • tests/unit/pr-impact.test.ts
  • tests/unit/spi-cache.test.ts
  • tests/unit/stdio-pr-impact.test.ts

Comment thread src/pipeline/spi/cache.ts Resolved
Comment thread src/pipeline/spi/cache.ts Resolved
Comment thread src/runtime/stdio/tools.ts Resolved
Comment thread tests/unit/spi-cache.test.ts Resolved
…easons, resolution_map forwarding

5 valid findings from CodeRabbit on PR #123:

1) MAJOR — context_pack 'resolution' parameter was silently ignored for task=review|impact. Now rejects unsupported (resolution, task) combinations with a clear jsonrpcInvalidParams error before the early returns.

2) cache.ts buildSpiCached: computeWorkspaceFingerprint ran BEFORE the noCache check, doing per-file hashing even when caching was disabled. Reordered so noCache short-circuits to buildSpi() with zero filesystem walks.

3) cache.ts buildSpiCached: the actual miss reason (key-mismatch / format-version-mismatch / corrupt-cache) was computed and discarded; the reported reason was always inferred from existsSync after the save. Now captured into a missReason variable and propagated into the SpiCacheStats payload.

4) stdio/tools.ts applyResolutionToNodes: dropped applyContextPackResolution's resolution_map. Now forwarded so callers can see which nodes were summarized vs kept in detail.

5) NITPICK — pr-impact.ts uncoveredHotspotSeverities mapping had an unreachable 'medium' branch (input is pre-filtered to high-impact labels). Simplified the construction to 'critical' | 'high' only; retained the wider 'medium' type on the result for future expansion.

Tests: updated spi-cache.test.ts to assert the proper miss reasons (no-cache on cold start, key-mismatch on file change). 1793/1793 still pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant