Skip to content

Fail loud on cache-query errors (no silent {hit:false} fallback) (0.10.0) #59

@himerus

Description

@himerus

Symptom

The cache-check logic in push-review-core.sh catches any error from the CLI invocation — SyntaxError, missing file, jq parse failure, permission denial — and returns {"hit":false}. The gate interprets this as "legitimate cache miss" and proceeds to require a fresh review. No warning is emitted.

Why this matters — from the field

Issue #53 (the node <shim> invocation bug, fixed in 0.9.2) hid for weeks because of this behavior. Every push produced a SyntaxError from node "${REA_ROOT}/node_modules/.bin/rea", the stderr was swallowed, and the gate returned {"hit":false}. Agents saw "cache miss → do a fresh review" and treated it as normal. No one knew the cache had been effectively offline the whole time.

Silent fallback on errors turns a HIGH-severity runtime defect into an invisible one.

Fix required

Distinguish cache-miss from cache-error in the cache-check output:

  • Empty/missing cache file{"hit":false, "reason":"cold"} → normal path, no stderr

  • CLI error / jq parse error / permission denial / SyntaxError → stderr WARN + distinct exit code → user-visible message:

    CACHE CHECK FAILED: <reason>
      Treating as miss, but this is a bug. Please file: github.com/bookedsolidtech/rea/issues
      Details: <error output>
    

Acceptance

Inject deliberate errors. Gate must emit a distinct WARN, not silently return {hit:false}:

  • Malformed .rea/audit.jsonl (corrupt jq parse) → WARN
  • Missing node_modules/.bin/rea → WARN
  • Permission denied on .rea/audit.jsonl read → WARN
  • rea binary exits non-zero with non-empty stderr → WARN

A cold cache (empty audit, no matching SHA) must NOT emit WARN — that's the normal flow.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions