Run artifact

evidence/prompts/20261024.142503.963Z_drydockstats_build_codex.prompt.md

System Instructions

This prompt is divided into three sections:

  1. System Instructions (this section) — structural orientation only. Do not treat this

section as task input.

  1. Input Context — begins with the heading # Input Context. All blocks are wrapped in

<pblock> tags. Two block types:

guidance attribute carries context-specific instructions; content is in a fenced block.

rules, instructions, or group headers.

  1. 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

</pblock>

<pblock label="Stories in this block" kind="section">

Stories in this block

</pblock>

<pblock label="Files on disk" kind="section">

Files on disk in the build directory

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>

<pblock label="Missing context files" kind="section"> Missing context files (named by the plan but not found):

</pblock>

COMPASS - Target Orientation

<pblock filename="COMPASS.md" role="compass" path="/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/COMPASS.md" guidance="Important: This is the core project intent, constraints, and guardrails. It should have presecedence in conflicts.">

# COMPASS: DrydockStats

## Compass

Build a command-line reporter for Drydock's LLM execution log, the Go executable `./cmd/ddkstat`,
as described in `sources/INSTRUCTIONS.md`. It reads a JSON Lines log, skips malformed and
duplicate lines without failing, and writes six CSV reports (summary, commands, targets, models,
daily, failures), each narrowed by optional Target and date filters.

Correctness is measured by `sources/run.sh`: it builds the executable with `go build` and makes
20 checks of exit code and standard output against `sources/llm_sample.jsonl`. The goal is every
check passing. The finished tool also runs against a real `logs/llm.jsonl`.

## Constraints

- Implement in Go 1.22 or newer with the standard library only. No third-party modules.
- The application root is a Go module; the executable's main package is `./cmd/ddkstat`.
- Parsing the log, aggregating, and formatting are separate, unit-tested functions.
- Diagnostics go to standard error and are never compared.

## Guardrails

- Do not modify, rewrite, regenerate, or substitute any file under `sources/`.
- Do not read `sources/run.sh` from application code, and do not hardcode a report row, a count,
  or a total. Every value comes from the log being read.
- Never write to the log being read.

## Verification Protocol

| Story kind | Command | Asserts |
|---|---|---|
| Every behavioral story | `sh bin/test.sh` | exit `0` |
| Terminal story (once, last) | `sh sources/run.sh` | exit `0` |

<!-- drydock:build-write-guardrail:start -->
## Build Write Guardrail

- Authorized build directory: `/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/build/DrydockStats`
- Authorized Target directory: `/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats`
- 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/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/blueprint/`
  - `/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/MANIFEST.md`
  - `/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/COMPASS.md`
  - `/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/QuarterDeck/`
  - `/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/evidence/`
<!-- drydock:build-write-guardrail:end -->

</pblock>

STACK - Technology HOW

<pblock filename="go_compact.md" role="stack" path="/mnt/c/Users/barlo/projects/drydock/Rigging/languages/go/go_compact.md">

<!-- Compacted from Rigging/languages/go/go.md sha256=aa96c7155b26f091e4f2ee9b7a47ff2202fc7c162254f2b8676779198c7147da on 2026-10-18 by Rigging maintenance -->

## Foundation Contract

The published shape of this foundation. It is built before every other foundation: a web server,
a database, or a CLI is built *into* this tree, this environment, and this test runner. Carried
verbatim into `go_compact.md`.

- source_root: internal/
- test_command: go test ./...
- environment: the module declared in `go.mod`; no vendored toolchain
- dependencies: `go.mod`

```
project/
  go.mod                  # module path; the Go toolchain version
  cmd/                    # one directory per binary, each package main
  internal/               # application packages; not importable outside this module
  bin/                    # launchers; each runs the toolchain, never a vendored copy
```

Application foundations add packages under `internal/`. The generated persistence library is a
separate module at `persistence/`, linked by the root `go.mod`.

### Native application layouts and fixtures

Initialize the root `go.mod` in the language foundation before the DATABASE block.
Use `cmd/app/main.go` for process startup, `internal/cli` for CLI behavior, and
`internal/appserver` for HTTP behavior. The root application module requires
`drydock.local/persistence v0.0.0` with `replace drydock.local/persistence => ./persistence`;
the generated persistence directory owns its nested module. Run both module test suites.

For a CLI, expose `Run(args []string, stdout, stderr io.Writer) int`, use a local
`flag.FlagSet` with `flag.ContinueOnError`, and test with `bytes.Buffer`. Only main calls
`os.Exit`. For HTTP, expose `NewHandler(...) http.Handler` using `net/http.ServeMux`.
Use `httptest.NewRecorder` and `httptest.NewRequest` for handler tests, or
`httptest.NewServer` with `t.Cleanup(server.Close)` when testing a real HTTP client.
Keep business logic in application packages and persistence access in the shipped library.

### How do we execute and measure Acceptance Criteria in this language?

An Acceptance Criterion (AC) is an executable check of Blueprint-required behavior. Native tests
use `testing` in `*_test.go`; the project gate is `go test ./...`. Within the existing Blueprint
Python AC container, execute a named test through the shipped helper:

```python
from drydock_go import run_test
result = run_test("./internal/orders", "TestCreateOrder")
assert result.passed, (result.status, result.stdout, result.stderr)
```

Drydock stages this helper beside the criterion. It runs `go test -json -count=1 -run` with an
exact test name, retains output and per-test outcomes, and rejects absent/skipped tests as proof.
The enclosing AC provides identity, timeout, result storage and repair state. Compilation errors
remain distinct from assertion failures in `result.status`. Coverage and persistence observations
require explicit instrumentation per criterion; unavailable observations are unknown.

A criterion that exercises the command line runs the built executable through the same helper,
never `go run`, which reports every non-zero program exit as 1:

```python
from drydock_go import cli_runner
code, out, err = cli_runner("--top", "0", "data.csv")
assert code == 2, (code, out, err)
```

`cli_runner` builds the single `./cmd/<name>` main package once with `go build` and returns
`(exit_code, stdout, stderr)`; pass `package="./cmd/<name>"` when there are several, and `input=`
for standard input. A failed build settles the criterion as `execution-error`.

### How does this language provide the shared persistence contract?

Use the shipped module in `Rigging/languages/go/persistence/`. Drydock copies it to the Target's
`persistence/`, generates `schema.go`, `testing.go` and a schema command from `DATABASE.md`, and
links it into the existing root `go.mod` as `drydock.local/persistence`. Driver versions and sums
are shipped; SQLite uses `go-sqlite3` (a C compiler and CGO are required), PostgreSQL uses `lib/pq`.
Run `go mod download` during dependency provisioning; execution requires these modules available.

Call `persistence.OpenDatabase(ctx, dsn)`, then typed methods such as
`db.Tickets.List(ctx, persistence.TicketsListInput{Status: "open"})`. Methods return a value and
an error. Optional inputs use pointers; read results are generated structs. Undeclared operations
and unsupported field types fail explicitly. Use `OpenSession(ctx, dsn)` for native database criteria;
empty DSN selects the configured, provisioned application store. Defer its cleanup and check the
returned error: it rolls back on success and failure, never applies schema or deletes the store.
Pass the same Store to the feature. Other connections and external effects require committed,
idempotent criteria with owned records and supported cleanup. Both engines retain autocommit
outside explicit rollback scopes.

The Go library and generator are verified on SQLite and PostgreSQL. Keep application SQL inside
the library; agents write callers. The language foundation must create `go.mod` before the
DATABASE step. Python Blueprint AC containers invoke the native Go tests through `run_test`.

---

## Consumer Rules

- Use `gofmt`, explicit errors, small consumer-owned interfaces and owned goroutine lifetimes.
- Keep business logic in `internal/` and entry points in `cmd/`; commit `go.mod` and `go.sum`.
- Gate with `go vet ./...`, `go build ./...` and `go test -race ./...`.

</pblock>

<pblock filename="common_compact.md" role="stack" path="/mnt/c/Users/barlo/projects/drydock/Rigging/stack/common_compact.md">

<!-- Compacted from /mnt/c/Users/barlo/projects/drydock/Rigging/stack/common.md sha256=2d665e4a232b3ef5b681149974e74928c8f5abb9adaac02604cc6b5987ac0f85 on 2026-10-24 by drydock rigging compact — regenerate with: drydock rigging compact --include-file {rel_source} -->

# Common Best Practices — Contract Surface

## Project Layout

### Rule: project-directory-layout

Every project must use the standard root layout and may add stack-specific directories.

Constraints: Include `bin/`, `data/` with `logs/` and `backups/`, `docs/`, `tests/`, optional `PROJECT/`, `.env`, `.env.example`, `.gitignore`, `CLAUDE.md`, and `Links.md`; keep runtime data under `data/`.

## Shell Scripts

### Rule: user-facing-operation-scripts

User-facing operations must be implemented as Bash scripts in `bin/`.

Constraints: Scripts must use standardized headers, `set -euo pipefail`, resolve project-relative paths, create `data/logs/`, log execution details, run from the project root, tee output to console and a timestamped log, and record completion.

### Rule: command-center-discovery-header

A discoverable script must begin with a Command Center header.

| Field | Required | Values |
|---|---:|---|
| `# CommandCenter Operation` | Yes | Literal |
| `# Name:` | Yes | Free text |
| `# Type:` | No | `daemon` or `batch`; defaults to `batch` |
| `# Port:` | No | Integer; daemon port |

Constraints: Scripts without `# CommandCenter Operation` remain valid but are not discoverable by Command Center.

### Rule: standard-scripts

Projects should provide applicable operation scripts with these names and purposes.

| Script | Type | Purpose |
|---|---|---|
| `bin/start.sh` | daemon | Start the development server |
| `bin/stop.sh` | batch | Stop the development server |
| `bin/test.sh` | batch | Run tests |
| `bin/build.sh` | batch | Build or compile |
| `bin/deploy.sh` | batch | Deploy to production |
| `bin/backup.sh` | batch | Back up data or databases |

### Rule: script-logging

Operation scripts must capture stdout and stderr in `data/logs/`.

Constraints: Log filenames must follow `<script>_<YYYY-MM-DD_HHMMSS>.log`; initial log lines must record timestamp, arguments, and working directory.

## Links

### Rule: links-file

Every project must provide a root-level `Links.md` containing one two-column Markdown table.

| Column | Requirement |
|---|---|
| `Label` | Short and descriptive |
| `URL` | Relevant project URL |

Constraints: Command Center reads this table and exposes the links through project configuration.

## Agent Instructions

### Rule: claude-file

Every project must provide a root-level `CLAUDE.md` with the following sections.

| Section | Required content |
|---|---|
| `## Project Overview` | Purpose and key features |
| `## Architecture` | Technology stack, key files, and patterns |
| `## Dev Commands` | Bash project commands in a code block |
| `## Service Endpoints` | `- Label: https://url` entries |
| `## Bookmarks` | Grouped links using `### Group` and `- [Title](URL)` |

Constraints: Normalize equivalent headings to the standard names: `Commands`, `Development Commands`, and `Build Commands` become `Dev Commands`; `Overview` and `Project Purpose` become `Project Overview`; `Stack` becomes `Architecture`.

## Version Control

### Rule: gitignore-and-secrets

Repositories must ignore secrets, generated files, and runtime data.

Constraints: Ignore `data/`, `*.db`, `*.log`, `.env`, `venv/`, `node_modules/`, Python caches and bytecode, `*.egg-info/`, `dist/`, `build/`, `.DS_Store`, and `Thumbs.db`; commit `.env.example` with placeholders.

### Rule: commit-message

Commit messages must use imperative, descriptive text without AI or tool mentions.

## Development Workflow

### Rule: task-commit

Completed, error-free tasks must be committed immediately.

### Rule: local-only-commit

Changes must be committed locally and must not be pushed.

### Rule: co-authorship

Commits must not contain `Co-authored-by` lines.

### Rule: restart-notice

Code-change responses for web-server projects must state whether a restart is required.

Constraints: Template, CSS, or static-only changes require the notice `No restart needed — browser refresh is enough.`; Python or JavaScript server changes require `Restart required — run the start script or equivalent.`

</pblock>

CONTEXT - Read-Only Support

<pblock filename="llm_sample.jsonl" role="context" path="/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/blueprint/llm_sample.jsonl">

{"schema_version":1,"execution_id":"20261014.063754.176Z-00bfbe21","started_at":"2026-10-14T06:37:54.176Z","status":"succeeded","job":{"command_name":"import_compass","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":191082},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":263315,"elapsed_ms":54872,"input_tokens":843,"output_tokens":7751,"turns":16,"cost_usd":0.0659295,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261014.063803.203Z-1b4a11fc","started_at":"2026-10-14T06:38:03.203Z","status":"succeeded","job":{"command_name":"analyze","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":198033},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":680177,"elapsed_ms":206797,"input_tokens":315,"output_tokens":23204,"turns":40,"cost_usd":0.1843527,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261014.064248.153Z-014dd8ac","started_at":"2026-10-14T06:42:48.153Z","status":"succeeded","job":{"command_name":"plan","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":158380},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":237022,"elapsed_ms":536780,"input_tokens":118,"output_tokens":19540,"turns":29,"cost_usd":0.1215202,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261014.065123.144Z-259dea0b","started_at":"2026-10-14T06:51:23.144Z","status":"succeeded","job":{"command_name":"build","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":123910},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":69822,"elapsed_ms":368594,"input_tokens":486,"output_tokens":2219,"turns":10,"cost_usd":0.0185632,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261014.065858.110Z-184f49db","started_at":"2026-10-14T06:58:58.110Z","status":"succeeded","job":{"command_name":"build","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":50579},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":547957,"elapsed_ms":594245,"input_tokens":229,"output_tokens":17031,"turns":22,"cost_usd":0.1401797,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261014.070839.778Z-204f0c88","started_at":"2026-10-14T07:08:39.778Z","status":"succeeded","job":{"command_name":"build","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":105182},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":456955,"elapsed_ms":440634,"input_tokens":91,"output_tokens":15170,"turns":3,"cost_usd":0.1216365,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261014.071648.059Z-310e5aac","started_at":"2026-10-14T07:16:48.059Z","status":"succeeded","job":{"command_name":"score release","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":5511},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":110560,"elapsed_ms":79707,"input_tokens":379,"output_tokens":9949,"turns":33,"cost_usd":0.06118,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261014.020414.582Z-db1fe4ea","started_at":"2026-10-14T02:04:14.582Z","status":"succeeded","job":{"command_name":"analyze","target":"Toml","llm":"gemini","model":"gemini-3-flash"},"prompt":{"bytes":19646},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":666217,"elapsed_ms":514139,"input_tokens":31425,"output_tokens":2638,"turns":35,"cost_usd":0.0556183,"model":"gemini-3-flash"}}}

{"schema_version":1,"execution_id":"20261014.021302.789Z-3ce7f48f","started_at":"2026-10-14T02:13:02.789Z","status":"succeeded","job":{"command_name":"plan","target":"Toml","llm":"gemini","model":"gemini-3-flash"},"prompt":{"bytes":11474},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":773835,"elapsed_ms":401081,"input_tokens":349,"output_tokens":15937,"turns":3,"cost_usd":0.0787087,"model":"gemini-3-flash"}}}
{"schema_version":1,"execution_id":"20261014.022019.878Z-bb25551f","started_at":"2026-10-14T02:20:19.878Z","status":"succeeded","job":{"command_name":"plan repair","target":"Toml","llm":"codex","model":"gpt-5.6-luna"},"prompt":{"bytes":15100},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":784113,"elapsed_ms":545642,"input_tokens":32923,"output_tokens":17142,"turns":24,"cost_usd":null}}}
{"schema_version":1,"execution_id":"20261014.023029.014Z-0ced8667","started_at":"2026-10-14T02:30:29.014Z","status":"succeeded","job":{"command_name":"build","target":"Toml","llm":"gemini","model":"gemini-3-flash"},"prompt":{"bytes":15755},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":316914,"elapsed_ms":129862,"input_tokens":2047,"output_tokens":19257,"turns":38,"cost_usd":0.0650117,"model":"gemini-3-flash"}}}
{"schema_version":1,"execution_id":"20261014.023324.526Z-aa8e3ffa","started_at":"2026-10-14T02:33:24.526Z","status":"succeeded","job":{"command_name":"build","target":"Toml","llm":"codex","model":"gpt-5.6-luna"},"prompt":{"bytes":56713},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":30973,"elapsed_ms":298475,"input_tokens":28293,"output_tokens":15277,"turns":22,"cost_usd":null}}}
{"schema_version":1,"execution_id":"20261014.023841.904Z-47b003f0","started_at":"2026-10-14T02:38:41.904Z","status":"failed","job":{"command_name":"diagnose","target":"Toml","llm":"gemini","model":"gemini-3-flash"},"prompt":{"bytes":199945},"result":{"returncode":1,"timed_out":false,"stats":{"cached_input_tokens":770301,"elapsed_ms":589419,"input_tokens":33526,"output_tokens":17499,"turns":32,"cost_usd":0.0990256,"model":"gemini-3-flash"}}}
{"schema_version":1,"execution_id":"20261014.024820.526Z-b7631290","started_at":"2026-10-14T02:48:20.526Z","status":"succeeded","job":{"command_name":"build","target":"Toml","llm":"gemini","model":"gemini-3-flash"},"prompt":{"bytes":196598},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":867407,"elapsed_ms":420430,"input_tokens":36378,"output_tokens":18859,"turns":23,"cost_usd":0.1087069,"model":"gemini-3-flash"}}}
{"schema_version":1,"execution_id":"20261014.024820.526Z-b7631290","started_at":"2026-10-14T02:48:20.526Z","status":"succeeded","job":{"command_name":"build","target":"Toml","llm":"gemini","model":"gemini-3-flash"},"prompt
{"schema_version":1,"execution_id":"20261015.061132.155Z-a5a1d0d4","started_at":"2026-10-15T06:11:32.155Z","status":"succeeded","job":{"command_name":"analyze","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":6178},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":316089,"elapsed_ms":492461,"input_tokens":527,"output_tokens":14991,"turns":10,"cost_usd":0.3212727,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.062050.655Z-c223ce93","started_at":"2026-10-15T06:20:50.655Z","status":"succeeded","job":{"command_name":"plan","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":138015},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":621305,"elapsed_ms":486287,"input_tokens":708,"output_tokens":8948,"turns":35,"cost_usd":0.3227355,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.062953.720Z-6e903a40","started_at":"2026-10-15T06:29:53.720Z","status":"succeeded","job":{"command_name":"build","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":184011},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":795934,"elapsed_ms":133239,"input_tokens":814,"output_tokens":27965,"turns":32,"cost_usd":0.6606972,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.063209.492Z-6e7eef79","started_at":"2026-10-15T06:32:09.492Z","status":"succeeded","job":{"command_name":"build","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":135666},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":777655,"elapsed_ms":261645,"input_tokens":580,"output_tokens":782,"turns":39,"cost_usd":0.2467665,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.063705.189Z-ddbdfb27","started_at":"2026-10-15T06:37:05.189Z","status":"succeeded","job":{"command_name":"build","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":32580},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":855668,"elapsed_ms":428001,"input_tokens":344,"output_tokens":2048,"turns":21,"cost_usd":0.2884524,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.064500.750Z-88091969","started_at":"2026-10-15T06:45:00.750Z","status":"succeeded","job":{"command_name":"build","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":124695},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":386078,"elapsed_ms":286946,"input_tokens":736,"output_tokens":12632,"turns":39,"cost_usd":0.3075114,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.065039.621Z-ebabd476","started_at":"2026-10-15T06:50:39.621Z","status":"failed","job":{"command_name":"diagnose","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":109737},"result":{"returncode":null,"timed_out":true,"stats":{"cached_input_tokens":240162,"elapsed_ms":26634,"input_tokens":156,"output_tokens":0,"turns":13,"cost_usd":0.3165966,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.065106.982Z-67114988","started_at":"2026-10-15T06:51:06.982Z","status":"succeeded","job":{"command_name":"build","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":115158},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":258927,"elapsed_ms":217864,"input_tokens":484,"output_tokens":26257,"turns":10,"cost_usd":0.4729851,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.065511.916Z-0ce635a3","started_at":"2026-10-15T06:55:11.916Z","status":"succeeded","job":{"command_name":"score release","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":29311},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":646233,"elapsed_ms":413197,"input_tokens":340,"output_tokens":10215,"turns":4,"cost_usd":0.3481149,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261015.083330.129Z-7a56f7e6","started_at":"2026-10-15T08:33:30.129Z","status":"succeeded","job":{"command_name":"build","target":"Toml","llm":"codex","model":"gpt-5.6-luna"},"prompt":{"bytes":116158},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":836994,"elapsed_ms":65133,"input_tokens":18708,"output_tokens":6053,"turns":31,"cost_usd":null}}}
{"schema_version":1,"execution_id":"20261015.083525.332Z-8c438a77","started_at":"2026-10-15T08:35:25.332Z","status":"succeeded","job":{"command_name":"build","target":"Toml","llm":"gemini","model":"gemini-3-flash"},"prompt":{"bytes":192675},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":244606,"elapsed_ms":68579,"input_tokens":39092,"output_tokens":18087,"turns":9,"cost_usd":0.0769938,"model":"gemini-3-flash"}}}
{"schema_version":1,"execution_id":"20261015.083525.332Z-8c438a77","started_at":"2026-10-15T08:35:25.332Z","status":"succeeded","job":{"command_name":"build","target":"Toml","llm":"gemini","model":"gemini-3-flash"},"prompt":{"bytes":192675},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":244606,"elapsed_ms":68579,"input_tokens":39092,"output_tokens":18087,"turns":9,"cost_usd":0.0769938,"model":"gemini-3-flash"}}}
{"schema_version":1,"execution_id":"20261015.083724.523Z-81d601c9","started_at":"2026-10-15T08:37:24.523Z","status":"succeeded","job":{"command_name":"score release","target":"Toml","llm":"codex","model":"gpt-5.6-luna"},"prompt":{"bytes":196828},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":813932,"elapsed_ms":587658,"input_tokens":30134,"output_tokens":2490,"turns":26,"cost_usd":null}}}
{"schema_version":1,"execution_id":"20261016.090553.093Z-bbffe24e","started_at":"2026-10-16T09:05:53.093Z","status":"succeeded","job":{"command_name":"plan","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":64506},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":612325,"elapsed_ms":83760,"input_tokens":687,"output_tokens":15334,"turns":3,"cost_usd":0.1385895,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261016.090710.576Z-4607f14a","started_at":"2026-10-16T09:07:10.576Z","status":"succeeded","job":{"command_name":"build","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":173199},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":871210,"elapsed_ms":358045,"input_tokens":257,"output_tokens":6056,"turns":34,"cost_usd":0.117658,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261016.091348.040Z-4e477a50","started_at":"2026-10-16T09:13:48.040Z","status":"succeeded","job":{"command_name":"build","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":36926},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":579034,"elapsed_ms":61501,"input_tokens":564,"output_tokens":9043,"turns":16,"cost_usd":0.1036824,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261016.091522.363Z-e192925e","started_at":"2026-10-16T09:15:22.363Z","status":"succeeded","job":{"command_name":"score release","target":"ReadingList","llm":"claude","model":"haiku"},"prompt":{"bytes":116159},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":732882,"elapsed_ms":72002,"input_tokens":135,"output_tokens":20367,"turns":10,"cost_usd":0.1752582,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261014.999999.000Z-deadbeef","started_at":"2026-10-14T07:08:39.778Z","status":"succeeded","job":{"command_name":"build","llm":"claude","model":"haiku"},"prompt":{"bytes":105182},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":456955,"elapsed_ms":440634,"input_tokens":91,"output_tokens":15170,"turns":3,"cost_usd":0.1216365,"model":"claude-haiku-5-5"}}}
{"schema_version":1,"execution_id":"20261016.031951.895Z-dffd7d86","started_at":"2026-10-16T03:19:51.895Z","status":"succeeded","job":{"command_name":"build","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":56587},"result":{"returncode":0,"timed_out":false}}
{"schema_version":1,"execution_id":"20261016.032512.700Z-7afe979b","started_at":"2026-10-16T03:25:12.700Z","status":"succeeded","job":{"command_name":"build","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":95401},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":372405,"elapsed_ms":132233,"input_tokens":602,"output_tokens":12582,"turns":23,"cost_usd":0.3022575,"model":"claude-sonnet-5-5"}}}
{"schema_version":1,"execution_id":"20261016.032821.624Z-fb733ab4","started_at":"2026-10-16T03:28:21.624Z","status":"succeeded","job":{"command_name":"score release","target":"CommonMark","llm":"claude","model":"sonnet"},"prompt":{"bytes":160786},"result":{"returncode":0,"timed_out":false,"stats":{"cached_input_tokens":516310,"elapsed_ms":209109,"input_tokens":256,"output_tokens":3257,"turns":37,"cost_usd":0.204516,"model":"claude-sonnet-5-5"}}}

</pblock>

<pblock filename="run.sh" role="context" path="/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/blueprint/run.sh">

#!/bin/sh
# run.sh — DrydockStats grader. Do not filter, skip, or reinterpret.
#
# Builds ./cmd/ddkstat with `go build` and compares every report's exit code and standard output
# over the supplied sample log with the known answer below. Standard error is never compared.
#
#   sh sources/run.sh                    from the application root (how `drydock uat` runs it)
#   sh uat/DrydockStats/bin/run.sh APP   from anywhere, grading the application root APP
#
# Exit 0 only when the build succeeds and every check passes.
set -u

HERE=$(cd "$(dirname "$0")" && pwd)
APP=$(cd "${1:-.}" && pwd)
if [ -f "$HERE/llm_sample.jsonl" ]; then DATA=$HERE; else DATA=$(cd "$HERE/../sources" && pwd); fi
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT INT TERM
BIN="$WORK/ddkstat"
LOG="$DATA/llm_sample.jsonl"
MISSING="$WORK/no-such-log.jsonl"

if ! (cd "$APP" && go build -o "$BIN" ./cmd/ddkstat); then
    echo "error: go build ./cmd/ddkstat failed at the application root $APP." >&2
    echo "The deliverable is a Go module whose main package is ./cmd/ddkstat." >&2
    exit 1
fi

PASSED=0
FAILED=0

# check <id> <expected exit> <ddkstat args...>  — expected standard output on stdin.
check() {
    id=$1
    want_rc=$2
    shift 2
    cat > "$WORK/want"
    (cd "$APP" && "$BIN" "$@") > "$WORK/got" 2> "$WORK/err"
    rc=$?
    if [ "$rc" -eq "$want_rc" ] && cmp -s "$WORK/want" "$WORK/got"; then
        PASSED=$((PASSED + 1))
        echo "PASS $id: ddkstat $*"
    else
        FAILED=$((FAILED + 1))
        echo "FAIL $id: ddkstat $*"
        echo "  exit: expected $want_rc, got $rc"
        diff "$WORK/want" "$WORK/got" | sed 's/^/  /'
        sed 's/^/  stderr: /' "$WORK/err"
    fi
}

# ── A. Every report over the whole sample ───────────────────────────────────────────────
check A1 0 summary "$LOG" <<'EOF'
records,skipped,succeeded,failed,first,last,input_tokens,cached_tokens,output_tokens,cost_usd,minutes
33,3,31,2,2026-10-14,2026-10-16,262526,17053317,398580,5.5245,159.4
EOF
check A2 0 commands "$LOG" <<'EOF'
command,calls,failed,input_tokens,cached_tokens,output_tokens,minutes
build,17,0,129705,8268539,209318,71.1
score release,5,0,31244,2819917,46278,22.7
plan,4,0,1862,2244487,59759,25.1
analyze,3,0,32267,1662483,40833,20.2
diagnose,2,2,33682,1010463,17499,10.3
import_compass,1,0,843,263315,7751,0.9
plan repair,1,0,32923,784113,17142,9.1
TOTAL,33,2,262526,17053317,398580,159.4
EOF
check A3 0 targets "$LOG" <<'EOF'
target,calls,failed,input_tokens,cached_tokens,output_tokens,cost_usd,minutes
CommonMark,12,1,5547,5786766,119677,3.7919,51.5
ReadingList,11,0,4104,5161259,145664,1.2485,47.6
Toml,10,1,252875,6105292,133239,0.4841,60.3
TOTAL,33,2,262526,17053317,398580,5.5245,159.4
EOF
check A4 0 models "$LOG" <<'EOF'
provider,model,calls,failed,input_tokens,cached_tokens,output_tokens,cost_usd
claude,claude-haiku-5-5,11,0,4104,5161259,145664,1.2485
claude,claude-sonnet-5-5,11,1,5547,5786766,119677,3.7919
claude,sonnet,1,0,0,0,0,0.0000
codex,gpt-5.6-luna,4,0,110058,2466012,40962,0.0000
gemini,gemini-3-flash,6,1,142817,3639280,92277,0.4841
TOTAL,,33,2,262526,17053317,398580,5.5245
EOF
check A5 0 daily "$LOG" <<'EOF'
date,calls,failed,tokens,minutes
2026-10-14,14,1,6944443,86.3
2026-10-15,12,1,7016674,57.8
2026-10-16,7,0,3753306,15.3
TOTAL,33,2,17714423,159.4
EOF
check A6 0 failures "$LOG" <<'EOF'
started_at,target,command,model,returncode,timed_out
2026-10-14T02:38:41.904Z,Toml,diagnose,gemini-3-flash,1,false
2026-10-15T06:50:39.621Z,CommonMark,diagnose,claude-sonnet-5-5,,true
EOF

# ── B. Filters ───────────────────────────────────────────────────────────────────────────
check B1 0 summary --target Toml --since 2026-10-15 "$LOG" <<'EOF'
records,skipped,succeeded,failed,first,last,input_tokens,cached_tokens,output_tokens,cost_usd,minutes
3,3,3,0,2026-10-15,2026-10-15,87934,1895532,26630,0.0770,12.0
EOF
check B2 0 commands --until 2026-10-14 "$LOG" <<'EOF'
command,calls,failed,input_tokens,cached_tokens,output_tokens,minutes
build,6,0,67524,2290028,87813,37.5
analyze,2,0,31740,1346394,25842,12.0
plan,2,0,467,1010857,35477,15.6
diagnose,1,1,33526,770301,17499,9.8
import_compass,1,0,843,263315,7751,0.9
plan repair,1,0,32923,784113,17142,9.1
score release,1,0,379,110560,9949,1.3
TOTAL,14,1,167402,6575568,201473,86.3
EOF
check B3 0 daily --since 2026-10-15 --until 2026-10-15 "$LOG" <<'EOF'
date,calls,failed,tokens,minutes
2026-10-15,12,1,7016674,57.8
TOTAL,12,1,7016674,57.8
EOF
check B4 0 failures --target CommonMark "$LOG" <<'EOF'
started_at,target,command,model,returncode,timed_out
2026-10-15T06:50:39.621Z,CommonMark,diagnose,claude-sonnet-5-5,,true
EOF
check B5 0 models --target ReadingList "$LOG" <<'EOF'
provider,model,calls,failed,input_tokens,cached_tokens,output_tokens,cost_usd
claude,claude-haiku-5-5,11,0,4104,5161259,145664,1.2485
TOTAL,,11,0,4104,5161259,145664,1.2485
EOF

# ── C. A filter that matches nothing ─────────────────────────────────────────────────────
check C1 0 commands --target NoSuchTarget "$LOG" <<'EOF'
command,calls,failed,input_tokens,cached_tokens,output_tokens,minutes
TOTAL,0,0,0,0,0,0.0
EOF
check C2 0 summary --target NoSuchTarget "$LOG" <<'EOF'
records,skipped,succeeded,failed,first,last,input_tokens,cached_tokens,output_tokens,cost_usd,minutes
0,3,0,0,,,0,0,0,0.0000,0.0
EOF

# ── E. Operational failures ──────────────────────────────────────────────────────────────
check E1 1 summary "$MISSING" < /dev/null

# ── U. Usage errors ──────────────────────────────────────────────────────────────────────
check U1 2 < /dev/null
check U2 2 frobnicate "$LOG" < /dev/null
check U3 2 summary < /dev/null
check U4 2 summary --since 2026-13-01 "$LOG" < /dev/null
check U5 2 summary --colour red "$LOG" < /dev/null
check U6 2 summary "$LOG" "$LOG" < /dev/null

TOTAL=$((PASSED + FAILED))
echo "DrydockStats: $PASSED passed, $FAILED failed (of $TOTAL)"
[ "$FAILED" -eq 0 ]

</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-Reports.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/blueprint/FEATURE-Reports.md" guidance="Feature Specification">

# FEATURE: CSV Reports

| Field       | Value |
|-------------|-------|
| Version     | 20261024 V1 |
| Description | Aggregates filtered execution records into six CSV reports. |
| Depends On  | FEATURE-LogIntake.md |
| Provides    | summary, commands, targets, models, daily, failures CSV reports |
| Consumes    | log parsing, record validation, duplicate detection, target and date filtering |

## Purpose

Provide the six operator reports from validated records after the filters supplied by `FEATURE-LogIntake.md`. All report values derive from those records; no report answer or total is hardcoded.

## Behavior

- `summary` reports the filtered record count, whole-file skipped count, success and failure counts, earliest and latest start dates, token totals, cost, and minutes. If no records match, the date fields are empty and numeric totals are zero.
- `commands` groups by command name and sorts by calls descending, then command name ascending.
- `targets` groups by Target and sorts by Target ascending.
- `models` groups by provider and selected model. Use the non-empty executed model from `result.stats.model`, otherwise `job.model`; sort by provider, then model, ascending.
- `daily` groups by start date and sorts ascending.
- `failures` includes failed records only, sorted by start time, then execution ID, ascending. Render a missing or null return code as an empty field, and `timed_out` as `true` or `false`.
- `commands`, `targets`, `models`, and `daily` end with a `TOTAL` row over the filtered records. `failures` and `summary` have no total row. An empty grouped report still includes its header and a zero-valued `TOTAL` row.
- CSV output has one header row, comma-separated fields, and `\n` line endings. Costs use four decimal places. Minutes sum elapsed milliseconds and convert to tenths with integer arithmetic: `t = (ms + 3000) / 6000`, rendered as `t / 10`, a decimal point, and `t % 10`.

## Programmatic Acceptance

=== AC reports-conformance ===
Intent: The six reports, filters, skipped-line handling, formatting, ordering, and empty-result output pass the supplied known-answer suite.
Suite: scoped

import os
import subprocess

result = subprocess.run(
    ["sh", "bin/test.sh"],
    capture_output=True,
    text=True,
    env={**os.environ},
)
print(result.stdout)
print(result.stderr, file=__import__("sys").stderr)
assert result.returncode == 0
=== END AC reports-conformance ===

=== AC model-selection ===
Intent: The report aggregation assigns a record to its executed model when present and its requested model otherwise.
Suite: scoped

import os

from pathlib import Path
import subprocess
import sys

result = subprocess.run(
    ["sh", "bin/test.sh"],
    capture_output=True,
    text=True,
    env={**os.environ},
)
print(result.stdout)
print(result.stderr, file=sys.stderr)
assert result.returncode == 0
=== END AC model-selection ===

## User Acceptance

- None.

## Guardrails

- Do not read or modify `sources/run.sh` from application code.
- Do not hardcode report rows, counts, totals, or expected answers.
- Do not write to the log being read.

</pblock>

<pblock filename="FEATURE-CLI.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/blueprint/FEATURE-CLI.md" guidance="Feature Specification">

# FEATURE: Command-Line Delivery

| Field       | Value |
|-------------|-------|
| Version     | 20261024 V1 |
| Description | Defines the command-line interface, error behavior, and Go test runner. |
| Depends On  | FEATURE-LogIntake.md, FEATURE-Reports.md |
| Provides    | ./cmd/ddkstat, bin/test.sh |
| Consumes    | log parsing, record validation, duplicate detection, target and date filtering, summary, commands, targets, models, daily, failures CSV reports |

## Purpose

Deliver the `ddkstat` command and project test runner. The command reads one log and writes one requested report to standard output.

## Command

```text
ddkstat <report> [--target <name>] [--since <YYYY-MM-DD>] [--until <YYYY-MM-DD>] <log>
```

The report name comes first, options follow it, and exactly one log path comes last. Supported reports are `summary`, `commands`, `targets`, `models`, `daily`, and `failures`.

`--target` matches `job.target` exactly. `--since` includes records on or after the given start date; `--until` includes records on or before it. Dates must be real calendar dates written `YYYY-MM-DD`.

## Error behavior

- A malformed invocation, unknown report or option, missing option value, missing or extra log path, or invalid date exits `2`.
- A log that cannot be opened or read exits `1`.
- Skipped malformed or duplicate records do not fail the command; successful processing exits `0`.
- On a command-level error, write no standard output and one diagnostic line to standard error. Skipped-line warnings also go to standard error and identify the input line number.
- Only `main` calls `os.Exit`; CLI behavior is exposed through `Run(args []string, stdout, stderr io.Writer) int`.

## Test runner

Provide a POSIX-compatible `bin/test.sh` that runs `go vet ./...` and `go test ./...` from the application root, and exits nonzero if either command fails. Keep tests in Go, using `testing`; cover parsing, filtering, every report, and each exit-code class with logs created by the tests.

## Programmatic Acceptance

=== AC cli-error-contract ===
Intent: Missing arguments and an unreadable log produce their specified exit statuses with no standard output.
Cite: sources/INSTRUCTIONS.md:87-95

import os
import subprocess
import sys

missing = subprocess.run(
    ["sh", "sources/run.sh"],
    capture_output=True,
    text=True,
    env={**os.environ},
)
print(missing.stdout)
print(missing.stderr, file=sys.stderr)
assert missing.returncode == 0
=== END AC cli-error-contract ===

=== AC test-runner ===
Intent: The project test runner exits successfully after vet and all Go tests pass.
Cite: sources/INSTRUCTIONS.md:97-99

import os
import subprocess
import sys

result = subprocess.run(
    ["sh", "sources/run.sh"],
    capture_output=True,
    text=True,
    env={**os.environ},
)
print(result.stdout)
print(result.stderr, file=sys.stderr)
assert result.returncode == 0
=== END AC test-runner ===

=== AC full-conformance ===
Intent: The terminal story passes all 20 supplied grader checks.
Suite: full

import os
import subprocess
import sys

result = subprocess.run(
    ["sh", "sources/run.sh"],
    capture_output=True,
    text=True,
    env={**os.environ},
)
print(result.stdout)
print(result.stderr, file=sys.stderr)
assert result.returncode == 0
=== END AC full-conformance ===

## User Acceptance

- None.

## Guardrails

- Do not modify, rewrite, regenerate, or substitute files under `sources/`.
- Never write to the log being read.
- Diagnostics go to standard error; command-level errors produce no standard output.

</pblock>

<pblock label="Build instructions" kind="instructions">

Build instructions for this block

Aggregate and format the six CSV reports. (report-generation)

Implement the six CSV reports from filtered records, with the specified totals, ordering, formatting, model selection, and empty-result behavior. Derive every value from the supplied log.

Deliver and verify the command-line interface, test runner, and full conformance gate. (cli-delivery)

Implement argument handling, report dispatch, standard error diagnostics, conventional exit codes, and the Go test runner. Add focused automated tests for parsing, filtering, reports, and CLI behavior.

As the terminal story, run the complete supplied grader and ensure it passes.

</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:

authoritative; implement them exactly.

Operating contract:

  1. Follow the write authorization and protected paths in the stacked COMPASS.md exactly.

That persisted guardrail is the sole authority for paths this build may modify.

  1. 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.

  1. Implement only this step. Use context, stack, and rules as constraints,

not as additional work to perform.

  1. Follow the stack and rules for languages, structure, naming, and branding.
  2. The programmatic acceptance assertions in the implements specifications 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.

  1. 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 — database criteria use the provisioned application store and the shipped rollback fixture, passing its connection into the feature. Other connections and durability tests use criterion-owned records, idempotent setup and checked cleanup through supported interfaces. Never replace the configured store, reapply schema, or delete unrelated business records. 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.

  1. Treat User Acceptance entries as review evidence requirements. Implement

the supporting behavior, but do not claim to have performed human judgment.

  1. The implements section is authoritative and intentionally stacked late in

the prompt as the recency anchor. Build that WHAT exactly; do not substitute generic framework defaults.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. FILES CHANGED must list only files actually written in the build working

directory. If no files were written, use RESULT: FAILED.

  1. 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>
  1. 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.