Run artifact

workspace/targets/ReadingList/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: An empty title on POST /books answers 400 with a non-empty reason naming the title field and stores nothing. return code: 1 error: malformed check: the assertion itself raised TypeError ('NoneType' object is not subscriptable) in its own frame, before reaching the code under test. No implementation can satisfy it. Each check runs as its own script in its own process, so a name bound by another check is not in scope. Repair the assertion in the Blueprint specification. stderr: --- drydock: values at failure --- body = None --- drydock: end values --- Traceback (most recent call last): File "reject-title-empty-json.py", line 29, in <module> assert isinstance(body["error"], str) ~~~~^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

intent: A whitespace-only title is treated as empty, rejected with 400, and nothing is stored. return code: 1 error: malformed check: the assertion itself raised TypeError ('NoneType' object is not subscriptable) in its own frame, before reaching the code under test. No implementation can satisfy it. Each check runs as its own script in its own process, so a name bound by another check is not in scope. Repair the assertion in the Blueprint specification. stderr: --- drydock: values at failure --- body = None --- drydock: end values --- Traceback (most recent call last): File "reject-title-whitespace.py", line 29, in <module> assert body["error"].strip() ~~~~^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

intent: A POST /books with no title field at all is rejected with 400 and nothing is stored. return code: 1 error: malformed check: the assertion itself raised TypeError ('NoneType' object is not subscriptable) in its own frame, before reaching the code under test. No implementation can satisfy it. Each check runs as its own script in its own process, so a name bound by another check is not in scope. Repair the assertion in the Blueprint specification. stderr: --- drydock: values at failure --- body = None --- drydock: end values --- Traceback (most recent call last): File "reject-title-missing.py", line 29, in <module> assert body["error"].strip() ~~~~^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

intent: A browser submission with an empty title is answered 400 with a re-rendered page and nothing is stored. return code: 0

Post-build programmatic acceptance

intent: An empty title on POST /books answers 400 with a non-empty reason naming the title field and stores nothing. provisioning: not required error: excluded check: ERROR malformed

intent: A whitespace-only title is treated as empty, rejected with 400, and nothing is stored. provisioning: not required error: excluded check: ERROR malformed

intent: A POST /books with no title field at all is rejected with 400 and nothing is stored. provisioning: not required error: excluded check: ERROR malformed

intent: A browser submission with an empty title is answered 400 with a re-rendered page and nothing is stored. target interpreter: /mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261023.144538/build/ReadingList/.venv/bin/python provisioning: not required return code: 0

Build summary

I'll start by inspecting the build working directory and the git state.The project already has AddBook, ListBooks, and RemoveBook code. Next I'll read the existing route, service, and test code this feature extends.The existing code already rejects an empty title with a reason and status 400. What's missing is the JSON path (error plus field). I'll check the persistence testing helpers and get a baseline test run before editing.Baseline is 75 passing. The plan:

I'll check where BookRejected is used first.Only the service and the route use BookRejected, so adding a field is contained. I'll make the service change first.Next, the route. It needs to choose JSON only when the client asks for exactly application/json, so browser and no-header requests keep the HTML response.Now the tests. I'll follow test_add_book.py's isolated-store fixture and read state back through the persistence layer. The JSON checks parse the body rather than matching text.The suite is green at 94 (75 existing plus 19 new). Next I'll run the four declared acceptance scripts verbatim from the spec, against the configured store (data/app.db), passing each through stdin so no scratch file is written.All four acceptance scripts pass. I'll confirm the working-tree changes are limited to this block's files.Block 7 (reject-empty-title) is built. All 94 tests pass and the four declared acceptance scripts pass.

The existing AddBook code already rejected an empty title with a reason and status 400. The gap was the JSON response, so this block adds that and the tests.

Changes:

Choices I made that the spec didn't settle:

Verification:

Outside this block: COMPASS.md requires bin/test.sh at the application root, and it does not exist yet. sources/full_test.sh will fail until a later block provides it.

<blueprint-decisions> [{"spec":"FEATURE-RejectEmptyTitle.md","severity":"Low","subject":"JSON rejection for an empty author and the Accept rule","decision":"The spec defines the JSON body only for the title. I return field \"author\" for an empty author, since the same JSON shape fits, and I choose JSON only when the client's preferred media type is exactly application/json, so / and browser Accept headers keep the HTML response. Is that acceptable, or should author rejections omit the JSON field?"}] </blueprint-decisions>

RESULT: SUCCESS

FILES CHANGED:

SUMMARY: Block 7 (reject-empty-title) adds a JSON rejection contract to the existing POST /books path. Title rejection already existed as a 400 HTML re-render with a reason; this block adds {error, field} JSON when the client asks for application/json, and records the failing field on BookRejected. Test run: pytest 94 passed (75 existing + 19 new). Declared acceptance scripts reject-title-empty-json, reject-title-whitespace, reject-title-missing, and reject-title-html each passed when run verbatim against data/app.db. sources/full_test.sh was not invoked because no criterion in this block declares it. Note for later blocks: COMPASS requires bin/test.sh at the application root; it does not exist yet.