Run artifact

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

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

Stories built

Stacked context

Build directory changes

Pre-build acceptance observation

intent: A valid submission is accepted with a 303 redirect. return code: 1 error: malformed check: the assertion itself raised TypeError ('NoneType' object is not iterable) 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 --- marker = 'ac-add-redirect' client = <FlaskClient <Flask 'app_server'>> --- drydock: end values --- Traceback (most recent call last): File "add-book-redirects.py", line 11, in <module> cleanup() File "add-book-redirects.py", line 7, in cleanup for row in client.get("/books").get_json(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

intent: An added book is read back through GET /books with the supplied title and author. return code: 1 error: malformed check: the assertion itself raised TypeError ('NoneType' object is not iterable) 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 --- marker = 'ac-add-roundtrip' client = <FlaskClient <Flask 'app_server'>> --- drydock: end values --- Traceback (most recent call last): File "add-book-round-trip.py", line 13, in <module> cleanup() File "add-book-round-trip.py", line 9, in cleanup for row in client.get("/books").get_json(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

intent: An added book is present in the configured store when read through the persistence package. return code: 1 error: malformed check: the assertion itself raised TypeError ('NoneType' object is not iterable) 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 --- marker = 'ac-add-store' client = <FlaskClient <Flask 'app_server'>> --- drydock: end values --- Traceback (most recent call last): File "add-book-persists-in-store.py", line 14, in <module> cleanup() File "add-book-persists-in-store.py", line 10, in cleanup for row in client.get("/books").get_json(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

Post-build programmatic acceptance

intent: A valid submission is accepted with a 303 redirect. provisioning: not required error: excluded check: ERROR malformed

intent: An added book is read back through GET /books with the supplied title and author. provisioning: not required error: excluded check: ERROR malformed

intent: An added book is present in the configured store when read through the persistence package. provisioning: not required error: excluded check: ERROR malformed

Agent self-report (advisory)

The build agent declared a failure. This is advisory only; the programmatic acceptance above is the authority for this block's outcome.

The three criteria (add-book-redirects, add-book-round-trip, add-book-persists-in-store) each begin with cleanup(), which calls client.get("/books").get_json(). GET /books is not registered, so it returns 404 and get_json() returns None, raising TypeError before the POST assertions run. The add-book behavior itself is verified: the POST returns 303 and the stored row reads back, and empty submissions return 400. To pass these criteria, the list-books story (GET /books returning JSON) must be built, or the list story must be placed in the same block. bin/test.sh is also absent, which COMPASS requires for sources/full_test.sh; this belongs to a later block.

Build summary

Now I'll register the blueprint in the application factory.Adding POST /books intentionally changes the wiring test that asserted no book routes exist, so I'll update that assertion to the new route set.Project suite is green (46 passed). Now I'll run the three declared add-book acceptance criteria, scripts kept outside the build directory.All three criteria fail at their own cleanup step, before reaching the add-book assertions. Their setup calls GET /books, which belongs to the list-books story and isn't part of this block. To confirm the POST behavior itself, I'll run the same assertions against a throwaway store with the cleanup calls removed as a diagnostic (the criteria stay untouched).POST /books is implemented and the project suite passes (46 tests), but all three add-book acceptance criteria fail. Their setup calls GET /books, which belongs to the list-books story and is not part of this block. I did not add it, since this block is scoped to add-book.

What I built

Acceptance criteria

Choices I made

Not in this block

RESULT: FAILED

FILES CHANGED:

SUMMARY: POST /books is implemented as a thin blueprint over a Flask-free service. Trimmed valid submissions store through db.books.create and answer 303 to /. Empty or absent fields answer 400 with a reason and store nothing. Project suite: pytest -q 46 passed (26 baseline + 20 new add-book tests; the 25 cases in test_add_book.py are parametrized). Declared criteria: 0 of 3 pass, because their cleanup needs GET /books. Diagnostic POST checks pass on a throwaway store.

<blueprint-decisions> [{"spec":"FEATURE-AddBook.md","severity":"Material","subject":"Empty or absent title/author on POST /books","decision":"Rejection stories own validation, but COMPASS forbids storing empty values. I refuse with 400 and the reason rendered in the base.html alert region, and store nothing. Is that acceptable, or should the rejection stories own the response shape and this should only refuse without rendering?"}] </blueprint-decisions>

FAILURE_SUMMARY: Declared add-book criteria call GET /books in cleanup, which is the list-books story and is not implemented in this block.
FAILURE_DETAIL: The three criteria (add-book-redirects, add-book-round-trip, add-book-persists-in-store) each begin with cleanup(), which calls client.get("/books").get_json(). GET /books is not registered, so it returns 404 and get_json() returns None, raising TypeError before the POST assertions run. The add-book behavior itself is verified: the POST returns 303 and the stored row reads back, and empty submissions return 400. To pass these criteria, the list-books story (GET /books returning JSON) must be built, or the list story must be placed in the same block. bin/test.sh is also absent, which COMPASS requires for sources/full_test.sh; this belongs to a later block.