Skip to content

fix(cache): add analysis_profile to cache payload for min-loc/min-stm…#10

Merged
orenlab merged 1 commit intomainfrom
fix/fix-min-loc-min-stmt-cache-compat
Mar 3, 2026
Merged

fix(cache): add analysis_profile to cache payload for min-loc/min-stm…#10
orenlab merged 1 commit intomainfrom
fix/fix-min-loc-min-stmt-cache-compat

Conversation

@orenlab
Copy link
Owner

@orenlab orenlab commented Mar 3, 2026

Fixes #9

  • Cache schema bumped from v1.2 to v1.3 (fail-open behavior preserved).
  • Added signed analysis_profile (ap: {min_loc, min_stmt}) to cache payload.
  • Cache compatibility now requires analysis_profile to match active CLI thresholds.
  • On profile mismatch: warning + cache ignored; new CacheStatus=analysis_profile_mismatch.
  • CLI now passes effective thresholds into Cache(...).
  • Added contract and CLI in-process regression coverage for:
    • ap roundtrip in cache payload,
    • profile mismatch bypassing cache,
    • profile match preserving cache-hit behavior.
  • Baseline contract unchanged (schema v1.0, fingerprint v1).

Sanity checks:

  • Legacy cache v1.2 now yields version_mismatch warning, rc=0, analysis continues (cache_hits=0).
  • Mismatch warning includes found vs expected profile values.
  • ap remains deterministic (canonical JSON with sorted keys) and strictly validated ({min_loc,min_stmt} with int values).

@orenlab orenlab self-assigned this Mar 3, 2026
@orenlab orenlab merged commit a328bd1 into main Mar 3, 2026
12 checks passed
@orenlab orenlab deleted the fix/fix-min-loc-min-stmt-cache-compat branch March 3, 2026 17:08
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.

[Bug]: --min-loc/--min-stmt are not reapplied on cache hits

1 participant