Run artifact

workspace/targets/LayersTesting/evidence/block-7.md

Evidence: Block 7 · Service (block-7)

Stories built

Acceptance tooling authorization

Stacked context

Build directory changes

Pre-build acceptance observation

intent: a valid file loads every row keeping its txn_id, prints the declared two CSV rows, and each stored row reads back with the cents derived from the input text. return code: 1 stdout: error: loading transactions is not implemented yet stderr: --- drydock: values at failure --- code = 1 --- drydock: end values --- Traceback (most recent call last): File "load-transactions-success.py", line 26, in <module> assert code == 0 ^^^^^^^^^ AssertionError

intent: a final row naming an unknown account rejects the whole file with exit 3, and none of the ten valid rows before it is stored. return code: 1 stderr: --- drydock: values at failure --- code = 1 --- drydock: end values --- Traceback (most recent call last): File "load-transactions-unknown-reference-stores-nothing.py", line 22, in <module> assert code == 3 ^^^^^^^^^ AssertionError

intent: each invalid date, amount, memo, or txn_id rejects the file with exit 3 and stores neither the bad row nor the valid row before it. return code: 1 stderr: --- drydock: values at failure --- bad = ['920000201', '2026-02-30', 'ZZMC1', 'ZZMC3', '10.00', 'impossible date'] code = 1 --- drydock: end values --- Traceback (most recent call last): File "load-transactions-invalid-fields.py", line 31, in <module> assert code == 3, bad ^^^^^^^^^
AssertionError: ['920000201', '2026-02-30', 'ZZMC1', 'ZZMC3', '10.00', 'impossible date']

intent: a txn_id repeated inside the file, or already stored, rejects the whole file with exit 3 and leaves the stored row unchanged. return code: 1 stderr: --- drydock: values at failure --- code = 1 --- drydock: end values --- Traceback (most recent call last): File "load-transactions-duplicate-ids-rejected.py", line 24, in <module> assert code == 3 ^^^^^^^^^ AssertionError

intent: a file whose combined effect leaves an account below zero is rejected with exit 3 and stores no row, even though each row is individually well formed. return code: 1 stderr: --- drydock: values at failure --- code = 1 --- drydock: end values --- Traceback (most recent call last): File "load-transactions-negative-balance-rejected.py", line 23, in <module> assert code == 3 ^^^^^^^^^ AssertionError

intent: a withdrawal listed before the deposit that funds it is accepted because the balance rule uses the combined effect of all rows, and both rows are stored. return code: 1 stdout: error: loading transactions is not implemented yet stderr: --- drydock: values at failure --- code = 1 --- drydock: end values --- Traceback (most recent call last): File "load-transactions-balance-considers-whole-file.py", line 25, in <module> assert code == 0 ^^^^^^^^^ AssertionError

intent: a wrong header exits 3 with nothing stored, an unreadable file exits 1, and a missing file argument exits 2. return code: 0

Post-build programmatic acceptance

intent: a valid file loads every row keeping its txn_id, prints the declared two CSV rows, and each stored row reads back with the cents derived from the input text. target interpreter: /mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261027.135355/build/LayersTesting/.venv/bin/python provisioning: not required return code: 0 stdout: table,loaded transactions,3

intent: a final row naming an unknown account rejects the whole file with exit 3, and none of the ten valid rows before it is stored. target interpreter: /mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261027.135355/build/LayersTesting/.venv/bin/python provisioning: not required return code: 0

intent: each invalid date, amount, memo, or txn_id rejects the file with exit 3 and stores neither the bad row nor the valid row before it. target interpreter: /mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261027.135355/build/LayersTesting/.venv/bin/python provisioning: not required return code: 0

intent: a txn_id repeated inside the file, or already stored, rejects the whole file with exit 3 and leaves the stored row unchanged. target interpreter: /mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261027.135355/build/LayersTesting/.venv/bin/python provisioning: not required return code: 0

intent: a file whose combined effect leaves an account below zero is rejected with exit 3 and stores no row, even though each row is individually well formed. target interpreter: /mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261027.135355/build/LayersTesting/.venv/bin/python provisioning: not required return code: 0

intent: a withdrawal listed before the deposit that funds it is accepted because the balance rule uses the combined effect of all rows, and both rows are stored. target interpreter: /mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261027.135355/build/LayersTesting/.venv/bin/python provisioning: not required return code: 0 stdout: table,loaded transactions,2

intent: a wrong header exits 3 with nothing stored, an unreadable file exits 1, and a missing file argument exits 2. target interpreter: /mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261027.135355/build/LayersTesting/.venv/bin/python provisioning: not required return code: 0

Build summary

Existing load commands and core validators cover most of what this step needs. I'll get a baseline test run before editing.Baseline is green: 365 passed. Now I'll replace the transactions placeholder with the validating loader, reusing the existing read_rows, validators, check_no_negative, and run_all.I wrote the undo wrong: _remove calls its argument positionally, but transactions.delete takes txn_id= as a keyword. Fixing that with a dedicated undo helper.Now the tests. I'll follow tests/test_load.py: act through cli_runner, read back through the store, and cover the declared acceptance cases plus boundaries and a rollback path.That last test is wrong: a -0.01 row on an empty account is overdrawn and would be rejected, and the or True assertion checks nothing. I'll rewrite the whole file cleanly.Running the new tests first, then the full suite and the grader.The suite is green at 389 passed. The grader shows 37 of 43 passing; the six failures are all ledger report, which is outside this block. Let me confirm the load-transaction checks specifically pass.RESULT: SUCCESS

ledger load transactions <csv> now validates the whole file before its first write and inserts all rows as one unit. The pytest suite passes (389 tests, including 24 new ones). The grader is at 37 of 43: all 6 failures are ledger report checks (C1–C3, H1–H3), which belong to a later block. Every load-transactions check passes, including B3 (120 seed rows) and D1 (the bad file, which exits 3 with nothing stored).

FILES CHANGED:

SUMMARY:

Choices I made: