Run artifact

workspace/targets/CsvStat/blueprint/FEATURE-UnreadableFile.md

FEATURE: Unreadable File

FieldValue
Version20261025 V1
DescriptionExits 1 with an empty standard output when the named file cannot be opened or read.
Depends OnFEATURE-FailureDiagnostics.md
Providesexit code 1
Consumescli.Run, csvdata.Read

Purpose

Exit code 1 is the operational-failure code. It is used when the file named on the command line does not exist, is not permitted to be read, or fails while being read. It is distinct from exit 3, which means the file was read but its content was rejected.

Behavior

Programmatic Acceptance

=== AC unreadable-missing-file ===
Intent: A path that does not exist exits 1 and writes nothing to standard output.
Requires: executable=go; scope=test

import os import tempfile from drydock_go import cli_runner

with tempfile.TemporaryDirectory() as tmp: missing = os.path.join(tmp, "no-such-file.csv") assert not os.path.exists(missing) code, out, err = cli_runner(missing) print(out) print(err) assert code == 1, code assert out == "", out lines = [ln for ln in err.splitlines() if ln.strip()] assert len(lines) == 1, lines === END AC unreadable-missing-file ===

=== AC unreadable-missing-file-freq ===
Intent: A missing file under --freq also exits 1 with nothing on standard output.
Requires: executable=go; scope=test

import os import tempfile from drydock_go import cli_runner

with tempfile.TemporaryDirectory() as tmp: missing = os.path.join(tmp, "absent.csv") code, out, err = cli_runner("--freq", "anything", missing) print(out) print(err) assert code == 1, code assert out == "", out === END AC unreadable-missing-file-freq ===

=== AC unreadable-missing-file-column ===
Intent: A missing file under --column also exits 1 with nothing on standard output.
Requires: executable=go; scope=test

import os import tempfile from drydock_go import cli_runner

with tempfile.TemporaryDirectory() as tmp: missing = os.path.join(tmp, "absent.csv") code, out, err = cli_runner("--column", "anything", missing) print(out) print(err) assert code == 1, code assert out == "", out === END AC unreadable-missing-file-column ===

=== AC unreadable-directory-as-file ===
Intent: A directory named as the file cannot be read and exits 1 with nothing on standard output.
Requires: executable=go; scope=test

import tempfile from drydock_go import cli_runner

with tempfile.TemporaryDirectory() as tmp: code, out, err = cli_runner(tmp) print(out) print(err) assert code == 1, code assert out == "", out === END AC unreadable-directory-as-file ===

=== AC unreadable-readable-file-still-succeeds ===
Intent: A readable fixture is not treated as unreadable and exits 0.
Requires: executable=go; scope=test

from drydock_go import cli_runner

code, out, err = cli_runner("sources/header_only.csv") print(out) print(err) assert code == 0, code assert out != "" === END AC unreadable-readable-file-still-succeeds ===

User Acceptance

Guardrails