Skip to content

kernel: non-UTF-8 bytes in a discovered record raise an uncaught UnicodeDecodeError out of doctor_report #95

Description

@SollanSystems

Pre-existing _read_json class (loop/contract.py:48: path.read_text(encoding="utf-8") wrapped only for json.JSONDecodeError) — reproduced on the untouched .loop/repair/ path, so it pre-dates Slice 2. But Slice 2's .loop/evidence/ discovery adds a worker-written directory to the reachable surface, so hostile bytes now have a natural author. It fails closed (non-zero, traceback), so R007's substance holds — but the traceback should be a typed finding. Fix: widen the except to (UnicodeDecodeError, OSError) → typed invalid_json/unreadable_file; note this changes repair/state/manifest behavior too, so it needs its own small slice with tests across all consumers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions