Run artifact

workspace/targets/CsvStat/evidence/block-4.md

Evidence: Block 4 ยท Service (block-4)

Stories built

Acceptance tooling authorization

Stacked context

Build directory changes

Pre-build acceptance observation

intent: Every malformed argument form exits 2 and writes nothing to standard output. return code: 1 stdout: [] 2 csvstat: missing file argument

['/tmp/tmpftcd3ltg/in.csv', '/tmp/tmpftcd3ltg/other.csv'] 2 csvstat: unexpected argument "/tmp/tmpftcd3ltg/other.csv" after file or extra file

['--frobnicate', '/tmp/tmpftcd3ltg/in.csv'] 2 csvstat: flag provided but not defined: -frobnicate

['--column'] 2 csvstat: flag needs an argument: -column

['--freq'] 2 csvstat: flag needs an argument: -freq

['--freq', 'sensor', '--top'] 2 csvstat: flag needs an argument: -top

['--freq', 'sensor', '--top', '0', '/tmp/tmpftcd3ltg/in.csv'] 0 stderr: --- drydock: values at failure --- code = 0 args = ['--freq', 'sensor', '--top', '0', '/tmp/tmpftcd3ltg/in.csv'] --- drydock: end values --- Traceback (most recent call last): File "usage-errors-exit-two.py", line 30, in <module> assert code == 2, (args, code) ^^^^^^^^^
AssertionError: (['--freq', 'sensor', '--top', '0', '/tmp/tmpftcd3ltg/in.csv'], 0)

intent: A usage error writes exactly one non-blank diagnostic line to standard error. return code: 0 stdout: csvstat: missing file argument

intent: A usage error is reported as 2 even when the named file does not exist. return code: 1 stdout: csvstat: open /tmp/tmputn6e6sx/no-such-file.csv: no such file or directory stderr: --- drydock: values at failure --- code = 1 --- drydock: end values --- Traceback (most recent call last): File "usage-errors-before-file-open.py", line 9, in <module> assert code == 2, code ^^^^^^^^^
AssertionError: 1

intent: Well-formed invocations are not rejected as usage errors. return code: 0 stdout: ['/tmp/tmp6ss5r7fo/in.csv'] 0

['--column', 'qty', '/tmp/tmp6ss5r7fo/in.csv'] 0

['--freq', 'sensor', '/tmp/tmp6ss5r7fo/in.csv'] 0

['--freq', 'sensor', '--top', '2', '/tmp/tmp6ss5r7fo/in.csv'] 0

intent: --column writes the profile header and exactly one row, equal to that column's row in the full profile. return code: 1 stderr: --- drydock: values at failure --- parsed = [] full = [['column', 'type', 'rows', 'nulls', 'distinct', 'min', 'max', 'sum', 'mean', 'median'], ['id', 'integer', '3', '0', '3', '1', '4', '7', '2.33', '2.00'], ['price', 'number', '3', '0', '3', '1.50', '3.00', '6.75', '2.25', '2.25'], ['label', 'text', '3', '0', '3', 'a', 'c', '', '', '']] --- drydock: end values --- Traceback (most recent call last): File "column-profile-single-row.py", line 21, in <module> assert parsed[0] == full[0] ~~^^^
IndexError: list index out of range

intent: A padded header name is trimmed, so the trimmed name selects the column and is reported. return code: 1 stderr: --- drydock: values at failure --- parsed = [] --- drydock: end values --- Traceback (most recent call last): File "column-profile-trimmed-header.py", line 18, in <module> assert len(parsed) == 2 ^^^^^^^^^^^^^^^^ AssertionError

intent: A column name absent from the header exits 3 with empty standard output. return code: 1 stderr: --- drydock: values at failure --- code = 0 --- drydock: end values --- Traceback (most recent call last): File "column-profile-unknown-column.py", line 13, in <module> assert code == 3, code ^^^^^^^^^
AssertionError: 0

intent: Column names match case-sensitively, so a different case is an unknown column. return code: 1 stderr: --- drydock: values at failure --- code = 0 --- drydock: end values --- Traceback (most recent call last): File "column-profile-case-sensitive.py", line 14, in <module> assert code == 3, code ^^^^^^^^^
AssertionError: 0

intent: A ragged file with --column exits 3 and writes nothing to standard output. return code: 0 stdout: csvstat: /tmp/tmpeuoy9ipj/ragged.csv: line 3: record has 3 fields, header has 2

intent: The supplied ragged fixture exits 3, writes nothing to standard output, and writes one diagnostic line. return code: 0 stdout: csvstat: sources/ragged.csv: line 4: record has 4 fields, header has 3

intent: The diagnostic for a ragged record carries the number of the line holding that record. return code: 0 stdout: csvstat: /tmp/tmpno0e759c/ragged_case.csv: line 4: record has 3 fields, header has 2

intent: An empty file is rejected with exit 3 and nothing on standard output. return code: 0 stdout: csvstat: /tmp/tmpn8m8f9bu/empty.csv: no header record: input is empty or blank

intent: A file containing only blank lines is rejected as empty with exit 3. return code: 0 stdout: csvstat: /tmp/tmpslhzo9pj/blank.csv: no header record: input is empty or blank

intent: An empty header name is rejected with exit 3 and nothing on standard output. return code: 0 stdout: csvstat: /tmp/tmpkoag8lt7/emptyname.csv: header column 2 is empty

intent: A repeated header name, including one repeated only after trimming, is rejected with exit 3. return code: 0 stdout: csvstat: /tmp/tmpfbats8s8/repeated.csv: header name "dup" is repeated

intent: A rejected file under --column still exits 3 with nothing on standard output. return code: 0 stdout: csvstat: sources/ragged.csv: line 4: record has 4 fields, header has 3

intent: A path that does not exist exits 1 and writes nothing to standard output. return code: 0 stdout: csvstat: open /tmp/tmpd_yhi93b/no-such-file.csv: no such file or directory

intent: A missing file under --freq also exits 1 with nothing on standard output. return code: 0 stdout: csvstat: open /tmp/tmpe1w5vm97/absent.csv: no such file or directory

intent: A missing file under --column also exits 1 with nothing on standard output. return code: 0 stdout: csvstat: open /tmp/tmpn988au76/absent.csv: no such file or directory

intent: A directory named as the file cannot be read and exits 1 with nothing on standard output. return code: 0 stdout: csvstat: /tmp/tmp9rh9iyrs: read csv: read /tmp/tmp9rh9iyrs: is a directory

intent: A readable fixture is not treated as unreadable and exits 0. return code: 0 stdout: column,type,rows,nulls,distinct,min,max,sum,mean,median sku,empty,0,0,0,,,,, price,empty,0,0,0,,,,, in_stock,empty,0,0,0,,,,,

intent: The default frequency listing for a named column equals the top five counts computed independently from the fixture. return code: 0 stdout: value,count Sales,8 Engineering,7 Support,7 Finance,2

intent: With --top 2 exactly the first two ordered rows are listed. return code: 0 stdout: value,count east,9 north,9

intent: Null values (empty, NA, N/A, NULL in any case) are not listed in a frequency listing. return code: 0 stdout: value,count 4,4 2,3 3,1

intent: Padded values are trimmed before counting, so padded and unpadded spellings count together. return code: 0 stdout: value,count Globex,10 Acme Corp,9 Umbrella,7 Initech,3 Hooli,1

intent: A column with no non-null values lists only the header. return code: 0 stdout: value,count

intent: A column name absent from the header exits 3 and writes nothing to standard output. return code: 1 stdout: csvstat: no column named "nosuch" stderr: --- drydock: values at failure --- code = 2 --- drydock: end values --- Traceback (most recent call last): File "freq-unknown-column-rejected.py", line 6, in <module> assert code == 3, code ^^^^^^^^^
AssertionError: 2

intent: A column name differing only in case from a header name is not found and exits 3. return code: 1 stdout: csvstat: no column named "DEPARTMENT" stderr: --- drydock: values at failure --- code = 2 --- drydock: end values --- Traceback (most recent call last): File "freq-name-is-case-sensitive.py", line 14, in <module> assert code == 3, code ^^^^^^^^^
AssertionError: 2

Post-build programmatic acceptance

intent: Every malformed argument form exits 2 and writes nothing to standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: [] 2 csvstat: missing file argument; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['/tmp/tmptcxshsru/in.csv', '/tmp/tmptcxshsru/other.csv'] 2 csvstat: unexpected argument "/tmp/tmptcxshsru/other.csv" after file or extra file; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--frobnicate', '/tmp/tmptcxshsru/in.csv'] 2 csvstat: flag provided but not defined: -frobnicate; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--column'] 2 csvstat: flag needs an argument: -column; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--freq'] 2 csvstat: flag needs an argument: -freq; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--freq', 'sensor', '--top'] 2 csvstat: flag needs an argument: -top; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--freq', 'sensor', '--top', '0', '/tmp/tmptcxshsru/in.csv'] 2 csvstat: --top 0 is not a positive integer; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--freq', 'sensor', '--top', '-1', '/tmp/tmptcxshsru/in.csv'] 2 csvstat: --top -1 is not a positive integer; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--freq', 'sensor', '--top', 'abc', '/tmp/tmptcxshsru/in.csv'] 2 csvstat: invalid value "abc" for flag -top: "abc" is not a decimal integer; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--top', '3', '/tmp/tmptcxshsru/in.csv'] 2 csvstat: --top requires --freq; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

['--column', 'qty', '--freq', 'qty', '/tmp/tmptcxshsru/in.csv'] 2 csvstat: --column cannot be combined with --freq; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

intent: A usage error writes exactly one non-blank diagnostic line to standard error. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: missing file argument; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

intent: A usage error is reported as 2 even when the named file does not exist. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: --top requires --freq; usage: csvstat [--column <name>] <file> | csvstat --freq <name> [--top <n>] <file>

intent: Well-formed invocations are not rejected as usage errors. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: ['/tmp/tmpsctabn7b/in.csv'] 0

['--column', 'qty', '/tmp/tmpsctabn7b/in.csv'] 0

['--freq', 'sensor', '/tmp/tmpsctabn7b/in.csv'] 0

['--freq', 'sensor', '--top', '2', '/tmp/tmpsctabn7b/in.csv'] 0

intent: --column writes the profile header and exactly one row, equal to that column's row in the full profile. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: column,type,rows,nulls,distinct,min,max,sum,mean,median id,integer,3,0,3,1,4,7,2.33,2.00

column,type,rows,nulls,distinct,min,max,sum,mean,median price,number,3,0,3,1.50,3.00,6.75,2.25,2.25

column,type,rows,nulls,distinct,min,max,sum,mean,median label,text,3,0,3,a,c,,,

intent: A padded header name is trimmed, so the trimmed name selects the column and is reported. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: column,type,rows,nulls,distinct,min,max,sum,mean,median qty,integer,2,0,2,1,2,3,1.50,1.50

intent: A column name absent from the header exits 3 with empty standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmp6i6ckalr/in.csv: no column named "nosuch"

intent: Column names match case-sensitively, so a different case is an unknown column. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmpwp9zjwxb/in.csv: no column named "QTY"

intent: A ragged file with --column exits 3 and writes nothing to standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmp_51zz7ki/ragged.csv: line 3: record has 3 fields, header has 2

intent: The supplied ragged fixture exits 3, writes nothing to standard output, and writes one diagnostic line. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: sources/ragged.csv: line 4: record has 4 fields, header has 3

intent: The diagnostic for a ragged record carries the number of the line holding that record. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmph618i3f8/ragged_case.csv: line 4: record has 3 fields, header has 2

intent: An empty file is rejected with exit 3 and nothing on standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmp0ljanamc/empty.csv: no header record: input is empty or blank

intent: A file containing only blank lines is rejected as empty with exit 3. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmpstrfntbn/blank.csv: no header record: input is empty or blank

intent: An empty header name is rejected with exit 3 and nothing on standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmpv4uvv38u/emptyname.csv: header column 2 is empty

intent: A repeated header name, including one repeated only after trimming, is rejected with exit 3. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmpdrugtg3a/repeated.csv: header name "dup" is repeated

intent: A rejected file under --column still exits 3 with nothing on standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: sources/ragged.csv: line 4: record has 4 fields, header has 3

intent: A path that does not exist exits 1 and writes nothing to standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: open /tmp/tmply63mrxu/no-such-file.csv: no such file or directory

intent: A missing file under --freq also exits 1 with nothing on standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: open /tmp/tmp6nqlag7r/absent.csv: no such file or directory

intent: A missing file under --column also exits 1 with nothing on standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: open /tmp/tmpgh5gw1hw/absent.csv: no such file or directory

intent: A directory named as the file cannot be read and exits 1 with nothing on standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: /tmp/tmphq_dcnzw: read csv: read /tmp/tmphq_dcnzw: is a directory

intent: A readable fixture is not treated as unreadable and exits 0. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: column,type,rows,nulls,distinct,min,max,sum,mean,median sku,empty,0,0,0,,,,, price,empty,0,0,0,,,,, in_stock,empty,0,0,0,,,,,

intent: The default frequency listing for a named column equals the top five counts computed independently from the fixture. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: value,count Sales,8 Engineering,7 Support,7 Finance,2

intent: With --top 2 exactly the first two ordered rows are listed. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: value,count east,9 north,9

intent: Null values (empty, NA, N/A, NULL in any case) are not listed in a frequency listing. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: value,count 4,4 2,3 3,1

intent: Padded values are trimmed before counting, so padded and unpadded spellings count together. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: value,count Globex,10 Acme Corp,9 Umbrella,7 Initech,3 Hooli,1

intent: A column with no non-null values lists only the header. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: value,count

intent: A column name absent from the header exits 3 and writes nothing to standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: sources/orders.csv: no column named "nosuch"

intent: A column name differing only in case from a header name is not found and exits 3. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stdout: csvstat: sources/employees.csv: no column named "DEPARTMENT"

Build summary

The baseline gate is green, but several declared behaviors are missing: --column is a stub that writes nothing, --top/--column/--freq combinations aren't rejected, and an unknown --freq column exits 2 instead of 3. I'll make those changes now.Now I'll update the one existing test that encoded the old exit-2 behavior for an unknown --freq column, and add tests for the new paths.I accidentally wrote a near-duplicate freq test; removing it before running the suite.Gate is green. Next I'll exercise the built binary against the declared acceptance cases directly, since the Python cli_runner harness isn't available here.RESULT: SUCCESS

The five stories in this block are implemented. sh bin/test.sh (vet, then the full Go test suite) passes. I did not run the Python acceptance criteria through drydock_go.cli_runner, because that helper isn't on disk here. I checked the same cases by running the built binary directly, and they match the declared exit codes and stdout/stderr shape.

FILES CHANGED:

SUMMARY:

Direct checks on the binary:

Choices I made: