Skip to content

sniff_file_envelope collapses an unreadable file into 'unrecognised', and the receipt sends the user to a shape-sniffing function #478

Closed

Description

@fdaviddpt

Found by the v0.24.0 gate 3 round-2 release audit (strategy A, ranked misreports). Not blocking; carried forward.

pipeline/extract.py:334-336 -- sniff_file_envelope returns "unrecognised" from both the
except OSError arm (line 334) and the exhausted-file fallthrough (line 336). The docstring names the
collapse honestly at lines 319-321. The receipt does not.

scripts/save-session.sh:276 logs:

unrecognised transcript envelope, 0 exchanges read (not a quiet session -- see pipeline/host.sniff_envelope)

A user whose transcript is simply unreadable -- a permission error, a bad mount, a file that vanished --
is pointed at a shape-sniffing function, which is the wrong place to look and the wrong question to ask.

Corroborating: coverage marks extract.py:331-332, 334-336 as unexecuted by the whole suite, so
the unreadable arm has no test behind it either. The audit's own finding rests on reading the code and
the coverage report rather than on a run of that arm -- stated so the next person does not inherit it as
observed.

Fix: name the OSError separately, in the returned value or in the log line, so "could not read it"
and "read it, did not recognise it" stop rendering alike. A test that exercises the arm comes with it.

Activity

  1. added
    bug
    priority:low
    cohort-3
    on Aug 29, 2026
  2. self-assigned this
    on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcohort-3priority:low

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions