Run artifact

workspace/targets/DrydockStats/evidence/block-6.md

Evidence: Block 6 · Service (block-6)

Stories built

Acceptance tooling authorization

Stacked context

Build directory changes

Pre-build acceptance observation

intent: A usage error returns exit code 2. return code: 1 error: unverified acceptance: not-run stderr: DRYDOCK_NATIVE_RESULT={"status": "not-run"} --- drydock: values at failure --- result = GoResult(passed=False, status='not-run', return_code=0, stdout='{"Time":"2026-10-26T11:43:53.837383525-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:53.843887608-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:53.843925755-04:00","Action":"output","Package":"ddkstat/internal… (+331 chars) --- drydock: end values --- Traceback (most recent call last): File "cli-exit-usage-code.py", line 4, in <module> assert result.passed, (result.status, result.stdout, result.stderr) ^^^^^^^^^^^^^
AssertionError: ('not-run', '{"Time":"2026-10-26T11:43:53.837383525-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:53.843887608-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:53.843925755-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"PASS\\n"}\n{"Time":"2026-10-26T11:43:53.844467736-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"ok \\tddkstat/internal/cli\\t0.007s [no tests to run]\\n"}\n{"Time":"2026-10-26T11:43:53.844488267-04:00","Action":"pass","Package":"ddkstat/internal/cli","Elapsed":0.007}\n', '')

intent: A usage error writes nothing to standard output. return code: 1 error: unverified acceptance: not-run stderr: DRYDOCK_NATIVE_RESULT={"status": "not-run"} --- drydock: values at failure --- result = GoResult(passed=False, status='not-run', return_code=0, stdout='{"Time":"2026-10-26T11:43:54.749694969-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:54.75606815-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:54.756109733-04:00","Action":"output","Package":"ddkstat/internal/… (+330 chars) --- drydock: end values --- Traceback (most recent call last): File "cli-exit-usage-stdout-empty.py", line 4, in <module> assert result.passed, (result.status, result.stdout, result.stderr) ^^^^^^^^^^^^^
AssertionError: ('not-run', '{"Time":"2026-10-26T11:43:54.749694969-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:54.75606815-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:54.756109733-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"PASS\\n"}\n{"Time":"2026-10-26T11:43:54.756894364-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"ok \\tddkstat/internal/cli\\t0.007s [no tests to run]\\n"}\n{"Time":"2026-10-26T11:43:54.756925244-04:00","Action":"pass","Package":"ddkstat/internal/cli","Elapsed":0.007}\n', '')

intent: An unreadable log returns exit code 1. return code: 1 error: unverified acceptance: not-run stderr: DRYDOCK_NATIVE_RESULT={"status": "not-run"} --- drydock: values at failure --- result = GoResult(passed=False, status='not-run', return_code=0, stdout='{"Time":"2026-10-26T11:43:55.783163461-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:55.792182712-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:55.792220482-04:00","Action":"output","Package":"ddkstat/internal… (+330 chars) --- drydock: end values --- Traceback (most recent call last): File "cli-exit-missing-log-code.py", line 4, in <module> assert result.passed, (result.status, result.stdout, result.stderr) ^^^^^^^^^^^^^
AssertionError: ('not-run', '{"Time":"2026-10-26T11:43:55.783163461-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:55.792182712-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:55.792220482-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"PASS\\n"}\n{"Time":"2026-10-26T11:43:55.792952827-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"ok \\tddkstat/internal/cli\\t0.010s [no tests to run]\\n"}\n{"Time":"2026-10-26T11:43:55.792973459-04:00","Action":"pass","Package":"ddkstat/internal/cli","Elapsed":0.01}\n', '')

intent: An unreadable log writes nothing to standard output. return code: 1 error: unverified acceptance: not-run stderr: DRYDOCK_NATIVE_RESULT={"status": "not-run"} --- drydock: values at failure --- result = GoResult(passed=False, status='not-run', return_code=0, stdout='{"Time":"2026-10-26T11:43:56.945248237-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:56.951969998-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:56.952010619-04:00","Action":"output","Package":"ddkstat/internal… (+331 chars) --- drydock: end values --- Traceback (most recent call last): File "cli-exit-missing-log-stdout-empty.py", line 4, in <module> assert result.passed, (result.status, result.stdout, result.stderr) ^^^^^^^^^^^^^
AssertionError: ('not-run', '{"Time":"2026-10-26T11:43:56.945248237-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:56.951969998-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:56.952010619-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"PASS\\n"}\n{"Time":"2026-10-26T11:43:56.952799399-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"ok \\tddkstat/internal/cli\\t0.007s [no tests to run]\\n"}\n{"Time":"2026-10-26T11:43:56.952843587-04:00","Action":"pass","Package":"ddkstat/internal/cli","Elapsed":0.008}\n', '')

intent: A log containing skipped lines still exits 0. return code: 1 error: unverified acceptance: not-run stderr: DRYDOCK_NATIVE_RESULT={"status": "not-run"} --- drydock: values at failure --- result = GoResult(passed=False, status='not-run', return_code=0, stdout='{"Time":"2026-10-26T11:43:57.953338698-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:57.962328987-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:57.962378715-04:00","Action":"output","Package":"ddkstat/internal… (+330 chars) --- drydock: end values --- Traceback (most recent call last): File "cli-exit-skipped-lines-ok.py", line 4, in <module> assert result.passed, (result.status, result.stdout, result.stderr) ^^^^^^^^^^^^^
AssertionError: ('not-run', '{"Time":"2026-10-26T11:43:57.953338698-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:57.962328987-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:57.962378715-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"PASS\\n"}\n{"Time":"2026-10-26T11:43:57.963314609-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"ok \\tddkstat/internal/cli\\t0.010s [no tests to run]\\n"}\n{"Time":"2026-10-26T11:43:57.963338453-04:00","Action":"pass","Package":"ddkstat/internal/cli","Elapsed":0.01}\n', '')

intent: The registered writer receives records narrowed by the target and date filters and the whole-file skipped count. return code: 1 error: unverified acceptance: not-run stderr: DRYDOCK_NATIVE_RESULT={"status": "not-run"} --- drydock: values at failure --- result = GoResult(passed=False, status='not-run', return_code=0, stdout='{"Time":"2026-10-26T11:43:59.05211728-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:59.058327764-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:59.058399-04:00","Action":"output","Package":"ddkstat/internal/cli… (+327 chars) --- drydock: end values --- Traceback (most recent call last): File "cli-exit-filter-order.py", line 4, in <module> assert result.passed, (result.status, result.stdout, result.stderr) ^^^^^^^^^^^^^
AssertionError: ('not-run', '{"Time":"2026-10-26T11:43:59.05211728-04:00","Action":"start","Package":"ddkstat/internal/cli"}\n{"Time":"2026-10-26T11:43:59.058327764-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"testing: warning: no tests to run\\n"}\n{"Time":"2026-10-26T11:43:59.058399-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"PASS\\n"}\n{"Time":"2026-10-26T11:43:59.058934022-04:00","Action":"output","Package":"ddkstat/internal/cli","Output":"ok \\tddkstat/internal/cli\\t0.007s [no tests to run]\\n"}\n{"Time":"2026-10-26T11:43:59.058955696-04:00","Action":"pass","Package":"ddkstat/internal/cli","Elapsed":0.007}\n', '')

Post-build programmatic acceptance

intent: A usage error returns exit code 2. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stderr: DRYDOCK_NATIVE_RESULT={"status": "pass"}

intent: A usage error writes nothing to standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stderr: DRYDOCK_NATIVE_RESULT={"status": "pass"}

intent: An unreadable log returns exit code 1. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stderr: DRYDOCK_NATIVE_RESULT={"status": "pass"}

intent: An unreadable log writes nothing to standard output. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stderr: DRYDOCK_NATIVE_RESULT={"status": "pass"}

intent: A log containing skipped lines still exits 0. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stderr: DRYDOCK_NATIVE_RESULT={"status": "pass"}

intent: The registered writer receives records narrowed by the target and date filters and the whole-file skipped count. target interpreter: /mnt/c/Users/barlo/projects/drydock/.venv/bin/python provisioning: not required return code: 0 stderr: DRYDOCK_NATIVE_RESULT={"status": "pass"}

Build summary

The block needs cli.Run and cli.Register, six named tests, and main.go wired to call Run. The existing ParseArgs, logread.Read, and filter functions already provide the pieces. Writing the implementation now.Now the tests. The six named acceptance tests go in one file, plus a few finer cases (writer error, success-path output, unregistered report). They read state back through the writer and the exit code rather than matching message text.Next, main.go becomes the only os.Exit caller, delegating to cli.Run.The cli-exit step is implemented. All six declared acceptance tests pass, and sh bin/test.sh exits 0. sh sources/run.sh exits 1, but only because the report writers belong to later blocks.

Changes

Checks

Choices I made

RESULT: SUCCESS

FILES CHANGED:

SUMMARY: Implemented cli.Run and cli.Register with exit codes 0, 1, and 2. Buffered report output is written to stdout only on writer success. main delegates to Run. The six declared acceptance tests pass, along with finer tests. bin/test.sh exits 0. sources/run.sh still fails 13 of 20 checks because report writers from later blocks are not yet registered.

BLOCKERS:

<blueprint-decisions> [{"spec":"FEATURE-CliExit.md","severity":"Low","subject":"Register behavior on duplicate report name","decision":"Register overwrites any writer already registered under the same name, without panicking. Duplicate registration is silent. Is that acceptable, or should it fail loudly on replan?"}] </blueprint-decisions>