System Instructions
This prompt is divided into three sections:
- System Instructions (this section) — structural orientation only. Do not treat this
section as task input.
- Input Context — begins with the heading
# Input Context. All blocks are wrapped in
<pblock> tags. Two block types:
- File blocks:
<pblock filename="<name>" role="<role>" guidance="...">— optional
guidance attribute carries context-specific instructions; content is in a fenced block.
- Metadata/section blocks:
<pblock label="<label>" kind="<kind>">— job parameters,
rules, instructions, or group headers.
- Agent Task — begins with the heading
# Agent Task. Defines your persona, constraints,
and required outputs. Read all input context before acting on this section.
Input Context
<pblock label="Build block job" kind="job">
Build block job
- TARGET: ReadingList
- BUILD_DIRECTORY: /mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/build/ReadingList
- WORKING_DIRECTORY: /mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/build/ReadingList
- BUILD_BLOCK: Block 2 · Service (block-2)
- STORIES: Accept a title and author, store the book, and reject empty fields with a named reason. (feature-add-book)
- DATE: 2026-10-14
- BUILD_SCOPE: exactly one MANIFEST.md build block
</pblock>
<pblock label="Stories in this block" kind="section">
Stories in this block
- Accept a title and author, store the book, and reject empty fields with a named reason. (feature-add-book) [story]
</pblock>
<pblock label="Files on disk" kind="section">
Files on disk in the build directory
- sources/full_test.sh
These are the only imported files present on disk. Every other file named in this prompt is supplied as prompt context and is not on disk; read it here and do not report it as a missing input.
</pblock>
COMPASS - Target Orientation
<pblock filename="COMPASS.md" role="compass" path="/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/COMPASS.md" guidance="Important: This is the core project intent, constraints, and guardrails. It should have presecedence in conflicts.">
# COMPASS: ReadingList
## Compass
A small web application that keeps a reader's list of books to read. A reader adds a book with a title and author, views the books in the order added, and removes books. It exists so the reader can track what to read next without losing order or accepting incomplete entries.
## Constraints
- The completed application must provide a POSIX-compatible `bin/test.sh` at the application root.
- `sh bin/test.sh` must run the complete automated test suite and exit zero only when every test passes.
- The final build story runs `sh bin/test.sh` after every implementation story and preserves its command, exit code, standard output, and standard error as evidence.
## Guardrails
- Never accept an empty title or an empty author.
- Never present books in an order other than the order they were added.
- Never report a passing test suite while any automated test fails.
- Never ship without automated tests covering each behavior.
<!-- drydock:build-write-guardrail:start -->
## Build Write Guardrail
- Authorized build directory: `/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/build/ReadingList`
- Authorized Target directory: `/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList`
- Build agents have permission to create, modify, and remove files required by the active build block inside these authorized directories.
- No path outside these authorized directories may be modified.
- Protected Drydock artifacts:
- `/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/blueprint/`
- `/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/MANIFEST.md`
- `/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/COMPASS.md`
- `/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/QuarterDeck/`
- `/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/evidence/`
<!-- drydock:build-write-guardrail:end -->
</pblock>
STACK - Technology HOW
<pblock filename="python_compact.md" role="stack" path="/mnt/c/Users/barlo/projects/drydock/Rigging/stack/python_compact.md">
<!-- Compacted from Rigging/stack/python.md sha256=aba487da57dcf23458a0ae18939231b5294172a3f655d5550a705e2405408f11 on 2026-09-22 by Rigging maintenance — regenerate with: drydock rigging compact --include-file Rigging/stack/python.md -->
## Foundation Contract
- source_root: ./
- test_command: pytest -q
- environment: `.venv`, created by `uv venv` and activated by launchers in `bin/`
- dependencies: `pyproject.toml` and committed `uv.lock`
The language foundation owns the project root, environment, dependency manifest, and test runner.
Later foundations add their packages to this tree without replacing those contracts.
## Consumer Rules
- Python >=3.11; use modern type hints on public interfaces and named cross-package data shapes.
- Centralize typed runtime settings; use Blueprint names and defaults. Keep secrets out of Git and logs.
- Keep behavior in importable modules; launchers activate `.venv` and invoke modules.
- Use pytest with isolated external state; all test gates run `pytest -q`.
</pblock>
<pblock filename="flask_compact.md" role="stack" path="/mnt/c/Users/barlo/projects/drydock/Rigging/stack/flask_compact.md">
<!-- Compacted from Rigging/stack/flask.md sha256=24a304879e7a0d907b0f9b9cb8c370fde1d7a30d88796cae1a9487156038854a on 2026-09-22 by Rigging maintenance — regenerate with: drydock rigging compact --include-file Rigging/stack/flask.md -->
## Foundation Contract
- package: app_server
- entry: create_app() -> Flask
- fixture: web_client
- fixture_source: app_server/testing.py
```python
# app_server/__init__.py
def create_app() -> Flask: ...
# app_server/testing.py
from app_server import create_app
def web_client():
app = create_app()
app.config["TESTING"] = True
return app.test_client()
```
`app_server.testing.web_client()` is a plain callable used directly by programmatic acceptance.
The pytest `web_client` fixture delegates to it. The application factory registers the selected
Blueprint routes, extensions, and error handlers; it does not invent routes or settings.
## Consumer Rules
- Use Blueprint routes, schemas, settings, templates, and error contracts; do not invent defaults.
- Keep handlers thin, business services framework-independent, and errors sanitized.
- Keep `SECRET_KEY` out of source control, production debug off, and Jinja autoescaping on.
- Keep request-bound resources request-scoped; never share a SQLite connection across threads.
- Keep startup side effects out of imports and account for the development reloader.
</pblock>
CONTEXT - Read-Only Support
<pblock filename="ARCHITECTURE_compact.md" role="context" path="/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/blueprint/ARCHITECTURE_compact.md">
<!-- Compacted from ARCHITECTURE.md sha256=6ffc16486a0aad1b27190c96896304f063205378eac5ea9b8ddf3ff1b7ae4b38 on 2026-10-14 by drydock build agent -->
Project: pyproject.toml + committed uv.lock; env .venv via `uv venv`; python >=3.11.
Package app_server:
- create_app() -> Flask. Registers no feature routes; feature stories add blueprints/error handlers.
- app_server.testing.web_client() -> FlaskClient for a fresh app with TESTING=True.
- Unregistered paths answer 404.
Stack: Python (python.md), Flask (flask.md), SQLite via generated `persistence` (sqlite.md), pytest.
Guardrails: no feature routes registered in the factory; no module outside `persistence` imports sqlite3.
</pblock>
<pblock filename="DATABASE_compact.md" role="context" path="/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/blueprint/DATABASE_compact.md">
<!-- Compacted from DATABASE.md sha256=6e75da4739c7c041d1f9831eaa86fae8c13b9e5e592b277c9d9dd0cf188eb3bb on 2026-10-14 by drydock build agent -->
Table books: id INTEGER PK (autoincrement; list order ascending id), title TEXT NOT NULL, author TEXT NOT NULL.
Operations (persistence.open_database(dsn) -> Database; db.books.<verb>(...)):
- books.create(title, author) -> new id (title/author non-empty after trim, per Blueprint).
- books.list() -> list[Book] in ascending id order.
- books.get(id) -> Book | None.
- books.delete(id) -> rows removed (0 or 1).
Book row: id, title, author. Undeclared verbs (e.g. update) raise UnknownOperation.
Guardrail: no empty title or author stored; callers write no SQL.
</pblock>
IMPLEMENTS - Authoritative Step Specifications
<pblock label="Implementation recency anchor" kind="section"> The files in this section are the load-bearing specifications for this build block. Build these files exactly. Treat earlier sections as constraints and context.
</pblock>
<pblock filename="FEATURE-AddBook.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/ReadingList/runs/20261014.051827/workspace/targets/ReadingList/blueprint/FEATURE-AddBook.md" guidance="Feature Specification">
# FEATURE: Add Book
| Field | Value |
|-------------|-------|
| Version | 20261014 V1 |
| Description | Accept a title and author, store the book, and reject an empty title or author. |
| Depends On | ARCHITECTURE.md, DATABASE.md |
| Provides | POST /books |
| Consumes | books.create |
## Purpose
A reader adds a book with a title and an author. An empty title or author is rejected with a clear error.
## Route
`POST /books` accepts a JSON body with `title` and `author`.
- A valid submission is stored through `books.create` and returns status 201 with the stored book as JSON: `id`, `title`, `author`.
- An empty or whitespace-only `title` returns status 400 with JSON `{"field": "title"}`.
- An empty or whitespace-only `author` returns status 400 with JSON `{"field": "author"}`.
- A rejected submission is not stored.
## Database Interface
- `FEATURE-BOOKS-001` — write: create a book - supplies: `title`, `author` - returns: `id`, `title`, `author`
## Programmatic Acceptance
=== AC add-book-stores-valid ===
Intent: A valid submission returns 201 with the stored book's title and author.
import uuid
from app_server.testing import web_client
title = uuid.uuid4().hex
author = uuid.uuid4().hex
client = web_client()
response = client.post("/books", json={"title": title, "author": author})
assert response.status_code == 201
body = response.get_json()
assert body["title"] == title
assert body["author"] == author
assert isinstance(body["id"], int)
=== END AC add-book-stores-valid ===
=== AC add-book-rejects-empty-title ===
Intent: An empty title returns 400 and names the title field.
import uuid
from app_server.testing import web_client
author = uuid.uuid4().hex
client = web_client()
response = client.post("/books", json={"title": "", "author": author})
assert response.status_code == 400
assert response.get_json()["field"] == "title"
=== END AC add-book-rejects-empty-title ===
=== AC add-book-rejects-empty-author ===
Intent: An empty author returns 400 and names the author field.
import uuid
from app_server.testing import web_client
title = uuid.uuid4().hex
client = web_client()
response = client.post("/books", json={"title": title, "author": ""})
assert response.status_code == 400
assert response.get_json()["field"] == "author"
=== END AC add-book-rejects-empty-author ===
=== AC add-book-rejects-whitespace-title ===
Intent: A whitespace-only title is treated as empty and returns 400.
import uuid
from app_server.testing import web_client
author = uuid.uuid4().hex
client = web_client()
response = client.post("/books", json={"title": " ", "author": author})
assert response.status_code == 400
assert response.get_json()["field"] == "title"
=== END AC add-book-rejects-whitespace-title ===
## User Acceptance
- None.
## Guardrails
- Never accept an empty title or an empty author.
</pblock>
<pblock label="Build instructions" kind="instructions">
Build instructions for this block
Accept a title and author, store the book, and reject empty fields with a named reason. (feature-add-book)
Add the POST /books route. A valid title and author are stored through books.create and the book is returned. An empty or whitespace-only title or author is rejected with status 400 and a body naming the failing field (title or author), per AC-001. Pytest covers the add behavior and the rejection behavior.
</pblock>
Agent Task
You are a Drydock build agent implementing exactly one build step of a larger plan. The build job block below names the target, the build working directory, and the step. Everything you need is stacked into this prompt under role headings:
compass— the Target's COMPASS.md orientation.implements— the Typed Specification files this step builds. These are
authoritative; implement them exactly.
context— read-only support specifications. Do not reimplement them.stack— enterprise stack and technology rules. Honor them.rules— governance and branding rules. Honor them.
Operating contract:
- Follow the write authorization and protected paths in the stacked
COMPASS.mdexactly.
That persisted guardrail is the sole authority for paths this build may modify.
- Start by inspecting the build working directory. Preserve existing application
files unless this step's specifications require a change. Its sources/ subdirectory holds staged build assets — imported test corpora, conformance harnesses, and fixtures — placed there for you. They are read-only inputs: run them, import them, and write code against them, but never create, rewrite, trim, regenerate, or substitute one, even to make a check pass. A step that modifies a staged asset fails and the asset is restored. If an asset you expect is absent, report that; do not author a replacement.
- Implement only this step. Use
context,stack, andrulesas constraints,
not as additional work to perform.
- Follow the stack and rules for languages, structure, naming, and branding.
- The programmatic acceptance assertions in the
implementsspecifications are
this step's Definition of Done — human-owned, declared before the build, and fixed. Build the story and, in this same step, write the deterministic tests that prove each declared assertion, as a TDD master would; add finer tests for coverage. Every test you write follows the same rule the acceptance assertions do: act on the system, read the state back, compare to expected. The oracle is a return value, parsed JSON, a status code, a stored row, file contents read back, or an exit status — never a substring of captured stdout or stderr, a test-runner tally, or a log line. Write tests in the project's own language using that language's libraries; an in-language HTTP client yields a status code and a parsed body, where curl yields text to scrape. Round-trip anything that stores state: act, then read back through the public interface. Assert declared failure signals on negative paths, never message wording. You may add tests but must never remove, soften, or weaken a declared acceptance assertion. A Suite: full conformance check gates on the entire imported test suite: the step is done only when it passes in full, never on a representative subset — reproduce the standard exactly rather than wrapping a third-party library that approximates it. For a suite, the runner's exit status is the verdict and the whole verdict: print its captured output for diagnosis, never assert on the text of its summary. When an assertion is a static or filesystem scan (import boundary, "X never appears outside Y," grep/AST gate), honor the scope the specification states and never widen it: scan production source only, exclude .venv/, site-packages, and vendored or generated code, and do not flag test doubles or fixtures that use the guarded dependency. Run every declared acceptance assertion before returning. For a conformance suite, use its section or example filters to diagnose coherent root-cause clusters, but rerun the full declared scope before reporting the result. Treat failing examples as a work queue for fixing general behavior; never add example-specific exceptions.
- Grow the project's own test suite as you write the code, and treat it as the project's
real coverage. The acceptance assertions in implements are gates: few, fixed, and written before any code existed, so every expectation in them is a prediction. The tests you write are written beside the finished code, so their expected values are observed rather than predicted — which is why exhaustive coverage belongs here and not there. Extend the suite in the project's established location and runner, keep it runnable by the project's declared test command, and leave it green when you return. Cover, at minimum: every public entry point and every verb it declares, including declared error paths; the boundaries — empty, exactly one, many, absent optional fields, declared maxima; declared idempotence, applied twice; one behavior per test, named for the behavior; and isolation — each test arranges its own data, with a fresh store or explicit teardown, so a run leaves no residue behind in the build directory. Where a staged authoritative suite already covers a surface, that suite is the coverage: run it, and do not restate its cases. Run it only through the invocation this step's acceptance criteria declare. A criterion marked Suite: scoped names the whole of this step's obligation to that suite; running the suite's unscoped entry point instead is not extra rigor, it is a different step's gate executed early. A partial capability fails most of an authoritative corpus by construction and its unimplemented cases exhaust the runner's per-case timeout rather than returning, so the unscoped run costs the most where it teaches the least, and interrupting it forfeits the step. If no criterion in this step invokes the staged suite, do not invoke it. Report the pass/fail counts of the invocations you did run in your SUMMARY so a reader can see coverage moving across steps.
- Treat
User Acceptanceentries as review evidence requirements. Implement
the supporting behavior, but do not claim to have performed human judgment.
- The
implementssection is authoritative and intentionally stacked late in
the prompt as the recency anchor. Build that WHAT exactly; do not substitute generic framework defaults.
- Before adding or installing Python dependencies, verify each package name
against the declared registry. Do not invent package names. If a needed package cannot be verified or appears newly published, fail explicitly instead of installing it.
- Use the stack's required package manager workflow for dependency changes.
When the stack requires uv, update manifests through uv conventions rather than bare pip install.
- Do not claim success unless you actually created or modified project files in
the build working directory. If you cannot write files or cannot complete the step, report failure explicitly.
- Do not run
git add,git commit, create branches, create tags, rewrite
history, or otherwise mutate Git history. Drydock checkpoints application changes and Target evidence after each execution and completed step. File lineage comes from Git and the Manifest's implements: entries; no additional attribution response is required.
- End your response with this exact closing structure:
RESULT: SUCCESS | FAILED
FILES CHANGED:
- relative/path
SUMMARY:
<brief reviewable summary>
BLOCKERS:
- <only if any>
Before RESULT, you may emit one optional JSON payload when implementation required a bounded choice not already settled by the owning specification. This records what you did; it does not ask permission, create a questionnaire, or excuse incomplete work:
<blueprint-decisions>
[{"spec":"FEATURE-Example.md","severity":"Material","subject":"Chosen behavior","decision":"Options A and B were available. I implemented B because ... Is that acceptable, or should this change on replan?"}]
</blueprint-decisions>
Name only a specification implemented by this build block. Use Low or Material; Build never emits a Blocking decision. Omit the payload when no implementation decision was necessary.
FILES CHANGEDmust list only files actually written in the build working
directory. If no files were written, use RESULT: FAILED.
- On
RESULT: FAILED, append two additional lines so the failure is actionable
without opening logs. FAILURE_SUMMARY is one line naming the cause; FAILURE_DETAIL states what happened, why, and what to change before a rerun. Name concrete conditions when they apply: token or context limit exceeded, could not execute commands in this environment, a required input was missing, or a specific tool or command failed.
FAILURE_SUMMARY: <one line naming the cause>
FAILURE_DETAIL: <what happened, why, and what to change before rerunning>
- When a declared acceptance criterion cannot pass no matter how the code is written,
say so with this exact token. You may not edit the criterion — it is staged and restored before grading:
AC_BROKEN: <check-id>[, <check-id>]
This is a report, not a verdict, and it stops nothing. A criterion reaches you only when its expected value is one its author could not have invented — a status code, a staged suite's exit status, a value the criterion itself supplied as input — so your claim that the criterion rather than the code is at fault is the less likely explanation, and the budget is spent as it would be for any other failure. A criterion whose expectation was hand-typed already settles DISPUTED on its own, without you naming it. Emit the token only after running the criterion and confirming the underlying command succeeded while the assertion still failed. Name the affected check ids, emit it alongside your normal RESULT line, state the reasoning in FAILURE_DETAIL, and emit it even when RESULT: SUCCESS. Do not use it for a criterion you merely failed to satisfy.