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: Quakes
- BUILD_DIRECTORY: /mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/build/Quakes
- WORKING_DIRECTORY: /mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/build/Quakes
- BUILD_BLOCK: Block 2 · Service (block-2)
- STORIES: Summarize events from a saved GeoJSON FeatureCollection. (summary), Report event counts and maximum magnitudes by day. (daily), List the largest events from a saved GeoJSON FeatureCollection. (top), Report event counts and maximum magnitudes by region. (regions), Find events within a haversine distance of a point. (near), Provide the automated test suite and run final conformance verification. (verify)
- DATE: 2026-10-24
- BUILD_SCOPE: exactly one MANIFEST.md build block
</pblock>
<pblock label="Stories in this block" kind="section">
Stories in this block
- Summarize events from a saved GeoJSON FeatureCollection. (summary) [story]
- Report event counts and maximum magnitudes by day. (daily) [story]
- List the largest events from a saved GeoJSON FeatureCollection. (top) [story]
- Report event counts and maximum magnitudes by region. (regions) [story]
- Find events within a haversine distance of a point. (near) [story]
- Provide the automated test suite and run final conformance verification. (verify) [story]
</pblock>
<pblock label="Files on disk" kind="section">
Files on disk in the build directory
- sources/quakes_2025-01-01_07.geojson
- sources/run.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>
<pblock label="Missing context files" kind="section"> Missing context files (named by the plan but not found):
- context: INSTRUCTIONS.md
</pblock>
COMPASS - Target Orientation
<pblock filename="COMPASS.md" role="compass" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/COMPASS.md" guidance="Important: This is the core project intent, constraints, and guardrails. It should have presecedence in conflicts.">
# COMPASS: Quakes
## Compass
Build a command-line earthquake feed reporter, an executable named `quakes` at the application
root, as described in `sources/INSTRUCTIONS.md`. It downloads a period of the USGS event feed as
GeoJSON and writes five CSV reports from a saved file: summary, largest events, events per day,
events per region, and events within a haversine distance of a point.
Correctness is measured by `sources/run.sh`: 26 checks of exit code and standard output against a
frozen 44-event USGS snapshot. The goal is every check passing.
## Constraints
- Implement in Python 3.11 or newer with the standard library only.
- Provide an executable named `quakes` at the application root, invoked as `./quakes <command>`.
- Reading the file, filtering, computing each report, and formatting are separate, unit-tested
functions.
- Tests stub the HTTP call; no test opens a network connection.
- 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` or the snapshot from application code, and do not hardcode a
report row, a count, or a distance. Every value comes from the file 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/Quakes/runs/20261024.065111/build/Quakes`
- Authorized Target directory: `/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes`
- 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/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/`
- `/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/MANIFEST.md`
- `/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/COMPASS.md`
- `/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/QuarterDeck/`
- `/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/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/languages/python/python_compact.md">
<!-- Compacted from Rigging/languages/python/python.md sha256=fe344456a351e3237cfe3bae2408a69758d401430b935f60c15f91b9a97e8016 on 2026-10-18 by Rigging maintenance -->
## 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.
### How do we execute and measure Acceptance Criteria in this language?
An Acceptance Criterion (AC) is an executable check of Blueprint-required behavior. Use the
existing Programmatic Acceptance format: a Python script with assertions against the built
product. Drydock executes each criterion through `languages/python/acceptance/runner.py`; `pytest -q`
runs the project test suite. Retain the criterion ID, observed values, stdout/stderr and result;
an assertion failure fails the check. The harness reports failure operands and available case
counts. Code coverage and persistence interactions require explicit instrumentation; record
available observations as key/value data associated with the criterion. Missing observations
are unknown, not proof that code or an interaction was unused.
### How does this language provide the shared persistence contract?
Use `stack/persistence.md`. Drydock copies `Rigging/languages/python/persistence/{db,sqlite,postgres}.py` and generates
`persistence/{schema,__init__,testing}.py` plus `schema.sql` from `DATABASE.md`. Call
`open_database(dsn)` and `db.<table>.<operation>(...)`; use `persistence.testing.db_session()`
for criteria. SQLite uses the standard library; PostgreSQL needs `psycopg[binary]` in the project
dependencies. Both engines ship together and the DSN selects the engine. Library verification
lives in `tests/test_shipped_database.py`; a Target still verifies its own schema and operations.
## 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="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>
<pblock filename="cli.md" role="stack" path="/mnt/c/Users/barlo/projects/drydock/Rigging/stack/cli.md">
# Command-Line Application
**Type:** cli
**Version:** 20260920 V1
**Tier:** platform
**Category:** Technologies
**Foundation:** cli
**Description:** Command-line application structure: entry point, argument parsing, exit codes, cross-platform launchers, and testing without spawning a process.
Technology reference. This file does not change between projects.
Prerequisites: `stack/common.md`, `languages/python/python.md`
---
## Foundation Contract
The published shape of this foundation. Drydock synthesizes the story that builds it and every
acceptance criterion writes against these names. Carried verbatim into `cli_compact.md`.
- package: cli
- entry: main(argv: list[str] | None = None) -> int
- fixture: cli_runner
- fixture_source: cli/testing.py
```python
# cli/__init__.py
def main(argv: list[str] | None = None) -> int:
...
# cli/testing.py
import contextlib
import io
from cli import main
def cli_runner(*args: str) -> tuple[int, str, str]:
"""Return (exit_code, stdout, stderr) without spawning a process."""
out, err = io.StringIO(), io.StringIO()
with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
code = main(list(args))
return code, out.getvalue(), err.getvalue()
# conftest.py
import pytest
from cli import testing
@pytest.fixture
def cli_runner():
return testing.cli_runner
```
A criterion imports `cli_runner` from `cli.testing`, calls `cli_runner("status", "--json")`, and
asserts on the returned tuple. It does not call `subprocess.run`, which measures the installed
console script and the shell rather than the code the story wrote.
---
## 1. Directory Layout
**Rule**: Command code lives in `cli/`. The root holds only packaging and infrastructure files.
```
project/
pyproject.toml # [project.scripts] declares the console script
cli/
__init__.py # main() — the single entry point
commands.py # one function per command; no argument parsing
parser.py # argparse construction; no behavior
bin/
run.sh # bash launcher
run.ps1 # PowerShell launcher
tests/
```
**Why**: Parsing, behavior, and launching are three contracts. Collapsing them produces a command
that cannot be tested without a shell.
---
## 2. Entry Point and Exit Codes
**Rule**: `main(argv=None) -> int` parses, dispatches, and returns an exit code. It never calls
`sys.exit` and never raises for an expected failure. The console script is the only caller that
translates the return value into a process exit.
```python
# cli/__init__.py
import sys
from cli.parser import build_parser
from cli import commands
def main(argv: list[str] | None = None) -> int:
args = build_parser().parse_args(argv)
try:
return commands.dispatch(args)
except OperationalError as exc:
print(f"error: {exc}", file=sys.stderr)
return 1
```
```toml
# pyproject.toml
[project.scripts]
mytool = "cli:main"
```
**Exit codes**: `0` success, `1` operational failure, `2` usage error. `argparse` already returns
`2` for a usage error; do not override it.
**Why**: A `main` that returns rather than exits is callable from a test in-process. A `main` that
calls `sys.exit` forces every criterion to spawn a subprocess and measure the shell.
---
## 3. Parsing Is Separate From Behavior
**Rule**: `parser.py` builds the `argparse` tree and returns it. `commands.py` holds one function
per command taking plain arguments, not a `Namespace`. Neither imports the other.
```python
# cli/parser.py
import argparse
def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(prog="mytool")
sub = parser.add_subparsers(dest="command", required=True)
status = sub.add_parser("status", help="Report current state")
status.add_argument("--json", action="store_true")
return parser
```
```python
# cli/commands.py
def status(*, as_json: bool) -> int:
...
def dispatch(args) -> int:
if args.command == "status":
return status(as_json=args.json)
return 2
```
**Why**: Behavior tested through a `Namespace` is behavior tested through the parser. Separating
them lets a criterion call `status(as_json=True)` directly.
---
## 4. Cross-Platform Launchers
**Rule**: Ship both launchers. They locate the environment and invoke the package entry point;
they contain no business logic. A launcher that makes a decision is a second implementation of the
command.
```bash
#!/usr/bin/env bash
# bin/run.sh — locate the environment and hand off. No business logic.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [ -d "$ROOT/.venv" ]; then
source "$ROOT/.venv/bin/activate"
fi
exec python -m cli "$@"
```
```powershell
# bin/run.ps1 — locate the environment and hand off. No business logic.
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $PSScriptRoot
$Activate = Join-Path $Root ".venv\Scripts\Activate.ps1"
if (Test-Path $Activate) { & $Activate }
python -m cli @args
exit $LASTEXITCODE
```
```python
# cli/__main__.py — makes `python -m cli` work identically on both platforms
import sys
from cli import main
sys.exit(main())
```
**Why**: `python -m cli` is the one invocation both launchers share, so the two scripts cannot
drift in behavior — only in how they find the interpreter. `exit $LASTEXITCODE` is required in
PowerShell; without it the exit code is discarded and a failing command reports success.
---
## 5. Output and Streams
**Rule**: Results go to stdout, diagnostics to stderr. A `--json` mode prints one JSON document to
stdout and nothing else. Never interleave progress text into a machine-readable stream.
**Why**: A caller piping stdout to `jq` receives the progress lines too, and the command becomes
unusable in a pipeline.
---
## 6. Testing Without a Process
**Rule**: Test through `main(["status", "--json"])` or the `cli_runner` fixture. Reserve
`subprocess.run` for one packaging test asserting the installed console script exists and runs.
```python
def test_status_reports_json(cli_runner):
code, out, err = cli_runner("status", "--json")
assert code == 0
assert json.loads(out)["state"] == "ready"
assert err == ""
```
**Why**: In-process tests are fast, debuggable, and measure the code. Subprocess tests measure the
installed environment, which is a different and much smaller question.
---
## Checklist
- [ ] `cli/` package; `main(argv=None) -> int` that returns rather than exits
- [ ] `[project.scripts]` declares the console script
- [ ] `cli/__main__.py` so `python -m cli` works
- [ ] Both `bin/run.sh` and `bin/run.ps1`, neither holding logic; `.ps1` ends with `exit $LASTEXITCODE`
- [ ] Parsing in `parser.py`, behavior in `commands.py`, no import between them
- [ ] Exit codes `0` / `1` / `2` used consistently
- [ ] Results on stdout, diagnostics on stderr, `--json` emits nothing else
- [ ] Criteria use `cli_runner`; at most one subprocess test for packaging
</pblock>
CONTEXT - Read-Only Support
<pblock filename="quakes_2025-01-01_07.geojson" role="context" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/quakes_2025-01-01_07.geojson">
{"type":"FeatureCollection","metadata":{"generated":1792699897000,"url":"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2025-01-01&endtime=2025-01-08&minmagnitude=5.0&orderby=time-asc","title":"USGS Earthquakes","status":200,"api":"2.8.2","count":44},"features":[
{"type":"Feature","properties":{"mag":5.5,"place":"153 km S of Isangel, Vanuatu","time":1735706358208,"updated":1742247240040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":466,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgsd","title":"M 5.5 - 153 km S of Isangel, Vanuatu"},"geometry":{"type":"Point","coordinates":[169.3819,-20.9273,22]},"id":"us6000pgsd"},
{"type":"Feature","properties":{"mag":5,"place":"13 km NW of Āwash, Ethiopia","time":1735718987701,"updated":1742247241040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":385,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgtj","title":"M 5.0 - 13 km NW of Āwash, Ethiopia"},"geometry":{"type":"Point","coordinates":[40.0976,9.0855,10]},"id":"us6000pgtj"},
{"type":"Feature","properties":{"mag":5,"place":"64 km NW of Rabaul, Papua New Guinea","time":1735724382334,"updated":1742247242040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":385,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgu0","title":"M 5.0 - 64 km NW of Rabaul, Papua New Guinea"},"geometry":{"type":"Point","coordinates":[151.7147,-3.8338,10]},"id":"us6000pgu0"},
{"type":"Feature","properties":{"mag":5.1,"place":"74 km NW of Rabaul, Papua New Guinea","time":1735734382490,"updated":1742247243040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":400,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgup","title":"M 5.1 - 74 km NW of Rabaul, Papua New Guinea"},"geometry":{"type":"Point","coordinates":[151.6971,-3.7219,10]},"id":"us6000pgup"},
{"type":"Feature","properties":{"mag":6.1,"place":"South Sandwich Islands region","time":1735739304752,"updated":1742247244040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":572,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgv4","title":"M 6.1 - South Sandwich Islands region"},"geometry":{"type":"Point","coordinates":[-26.7059,-56.4095,70]},"id":"us6000pgv4"},
{"type":"Feature","properties":{"mag":5.3,"place":"southeast of Easter Island","time":1735756071182,"updated":1742247247040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":432,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgx1","title":"M 5.3 - southeast of Easter Island"},"geometry":{"type":"Point","coordinates":[-100.6636,-36.1244,10]},"id":"us6000pgx1"},
{"type":"Feature","properties":{"mag":5.2,"place":"southern Mid-Atlantic Ridge","time":1735766861595,"updated":1742247250040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":416,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgy5","title":"M 5.2 - southern Mid-Atlantic Ridge"},"geometry":{"type":"Point","coordinates":[-16.0574,-42.4343,10]},"id":"us6000pgy5"},
{"type":"Feature","properties":{"mag":5.1,"place":"111 km E of ‘Ohonua, Tonga","time":1735780264639,"updated":1742247251040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":400,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgz5","title":"M 5.1 - 111 km E of ‘Ohonua, Tonga"},"geometry":{"type":"Point","coordinates":[-173.8784,-21.3225,10]},"id":"us6000pgz5"},
{"type":"Feature","properties":{"mag":5.5,"place":"Balleny Islands region","time":1735786457931,"updated":1742247252040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":465,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pgzq","title":"M 5.5 - Balleny Islands region"},"geometry":{"type":"Point","coordinates":[155.7048,-62.3342,10]},"id":"us6000pgzq"},
{"type":"Feature","properties":{"mag":5.1,"place":"110 km SE of Modisi, Indonesia","time":1735795943434,"updated":1742247253040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":400,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000ph0e","title":"M 5.1 - 110 km SE of Modisi, Indonesia"},"geometry":{"type":"Point","coordinates":[125.1945,-0.2006,56.271]},"id":"us6000ph0e"},
{"type":"Feature","properties":{"mag":5.4,"place":"72 km NW of Rabaul, Papua New Guinea","time":1735801599333,"updated":1742247254040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":449,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000ph16","title":"M 5.4 - 72 km NW of Rabaul, Papua New Guinea"},"geometry":{"type":"Point","coordinates":[151.7189,-3.7199,10]},"id":"us6000ph16"},
{"type":"Feature","properties":{"mag":5.1,"place":"33 km N of Āwash, Ethiopia","time":1735803690364,"updated":1742247254040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":409,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000ph1c","title":"M 5.1 - 33 km N of Āwash, Ethiopia"},"geometry":{"type":"Point","coordinates":[40.1383,9.2824,10]},"id":"us6000ph1c"},
{"type":"Feature","properties":{"mag":5,"place":"66 km WNW of Rabaul, Papua New Guinea","time":1735833427193,"updated":1742247257040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":385,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000ph9f","title":"M 5.0 - 66 km WNW of Rabaul, Papua New Guinea"},"geometry":{"type":"Point","coordinates":[151.6398,-3.9094,19.054]},"id":"us6000ph9f"},
{"type":"Feature","properties":{"mag":6.1,"place":"84 km NNW of Calama, Chile","time":1735850615253,"updated":1742247259040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":606,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phap","title":"M 6.1 - 84 km NNW of Calama, Chile"},"geometry":{"type":"Point","coordinates":[-69.1069,-21.7109,99]},"id":"us6000phap"},
{"type":"Feature","properties":{"mag":5.4,"place":"52 km NNE of Āwash, Ethiopia","time":1735852706833,"updated":1742247259040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":452,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phb3","title":"M 5.4 - 52 km NNE of Āwash, Ethiopia"},"geometry":{"type":"Point","coordinates":[40.2761,9.4426,10]},"id":"us6000phb3"},
{"type":"Feature","properties":{"mag":5.1,"place":"71 km NW of Rabaul, Papua New Guinea","time":1735868848923,"updated":1742247261040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":400,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phc9","title":"M 5.1 - 71 km NW of Rabaul, Papua New Guinea"},"geometry":{"type":"Point","coordinates":[151.7104,-3.7423,10]},"id":"us6000phc9"},
{"type":"Feature","properties":{"mag":5.5,"place":"South Sandwich Islands region","time":1735871597419,"updated":1742247262040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":465,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phce","title":"M 5.5 - South Sandwich Islands region"},"geometry":{"type":"Point","coordinates":[-25.9578,-58.7696,86]},"id":"us6000phce"},
{"type":"Feature","properties":{"mag":5,"place":"128 km SE of Phek, India","time":1735878758138,"updated":1742247263040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":389,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phdf","title":"M 5.0 - 128 km SE of Phek, India"},"geometry":{"type":"Point","coordinates":[95.5118,24.9577,154.635]},"id":"us6000phdf"},
{"type":"Feature","properties":{"mag":5.2,"place":"19 km NW of Metahāra, Ethiopia","time":1735914436790,"updated":1742247267040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":427,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phl5","title":"M 5.2 - 19 km NW of Metahāra, Ethiopia"},"geometry":{"type":"Point","coordinates":[39.7855,9.0119,10]},"id":"us6000phl5"},
{"type":"Feature","properties":{"mag":5.5,"place":"45 km NNE of Āwash, Ethiopia","time":1735923706324,"updated":1742247268040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":481,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phnz","title":"M 5.5 - 45 km NNE of Āwash, Ethiopia"},"geometry":{"type":"Point","coordinates":[40.3457,9.3575,10]},"id":"us6000phnz"},
{"type":"Feature","properties":{"mag":5,"place":"Southwest Indian Ridge","time":1735944926242,"updated":1742247271040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":385,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phr5","title":"M 5.0 - Southwest Indian Ridge"},"geometry":{"type":"Point","coordinates":[63.4991,-27.9633,10]},"id":"us6000phr5"},
{"type":"Feature","properties":{"mag":5.7,"place":"52 km N of Āwash, Ethiopia","time":1735951941078,"updated":1742247271040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":671,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phrk","title":"M 5.7 - 52 km N of Āwash, Ethiopia"},"geometry":{"type":"Point","coordinates":[40.1219,9.4591,8]},"id":"us6000phrk"},
{"type":"Feature","properties":{"mag":5,"place":"35 km N of Āwash, Ethiopia","time":1736021145606,"updated":1742247279040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":393,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phw1","title":"M 5.0 - 35 km N of Āwash, Ethiopia"},"geometry":{"type":"Point","coordinates":[40.1365,9.2988,10]},"id":"us6000phw1"},
{"type":"Feature","properties":{"mag":5.3,"place":"7 km E of Lakatoro, Vanuatu","time":1736029417252,"updated":1742247280040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":432,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phws","title":"M 5.3 - 7 km E of Lakatoro, Vanuatu"},"geometry":{"type":"Point","coordinates":[167.4828,-16.1014,36.934]},"id":"us6000phws"},
{"type":"Feature","properties":{"mag":5.1,"place":"40 km ENE of Pondaguitan, Philippines","time":1736068602355,"updated":1742247284040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":401,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000phz2","title":"M 5.1 - 40 km ENE of Pondaguitan, Philippines"},"geometry":{"type":"Point","coordinates":[126.5325,6.4682,132.697]},"id":"us6000phz2"},
{"type":"Feature","properties":{"mag":6.2,"place":"56 km SSE of La Libertad, El Salvador","time":1736097525784,"updated":1784300743759,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":663,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pi09","title":"M 6.2 - 56 km SSE of La Libertad, El Salvador"},"geometry":{"type":"Point","coordinates":[-89.1775,13.0007,46]},"id":"us6000pi09"},
{"type":"Feature","properties":{"mag":5,"place":"73 km NW of Rabaul, Papua New Guinea","time":1736097883116,"updated":1742247286040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":385,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pi0k","title":"M 5.0 - 73 km NW of Rabaul, Papua New Guinea"},"geometry":{"type":"Point","coordinates":[151.6914,-3.7391,10]},"id":"us6000pi0k"},
{"type":"Feature","properties":{"mag":5.2,"place":"31 km S of Kirakira, Solomon Islands","time":1736124731514,"updated":1742247289040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":416,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pi39","title":"M 5.2 - 31 km S of Kirakira, Solomon Islands"},"geometry":{"type":"Point","coordinates":[161.868,-10.734,97.196]},"id":"us6000pi39"},
{"type":"Feature","properties":{"mag":5.2,"place":"Tibetan Plateau","time":1736177206849,"updated":1742247296040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":417,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pi67","title":"M 5.2 - Tibetan Plateau"},"geometry":{"type":"Point","coordinates":[87.0306,33.4298,10]},"id":"us6000pi67"},
{"type":"Feature","properties":{"mag":5.1,"place":"113 km E of Hasaki, Japan","time":1736181879772,"updated":1742247297040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":400,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pi7a","title":"M 5.1 - 113 km E of Hasaki, Japan"},"geometry":{"type":"Point","coordinates":[142.081,35.8134,10]},"id":"us6000pi7a"},
{"type":"Feature","properties":{"mag":5.2,"place":"77 km SSW of Fīrūzābād, Iran","time":1736182790092,"updated":1742247297040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":417,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pi7c","title":"M 5.2 - 77 km SSW of Fīrūzābād, Iran"},"geometry":{"type":"Point","coordinates":[52.3922,28.1592,10]},"id":"us6000pi7c"},
{"type":"Feature","properties":{"mag":5,"place":"43 km WSW of Port-Vila, Vanuatu","time":1736198445820,"updated":1742247299040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":386,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pi8v","title":"M 5.0 - 43 km WSW of Port-Vila, Vanuatu"},"geometry":{"type":"Point","coordinates":[167.9443,-17.9111,35]},"id":"us6000pi8v"},
{"type":"Feature","properties":{"mag":7.1,"place":"2025 Southern Tibetan Plateau Earthquake","time":1736211916734,"updated":1754895022632,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"red","sig":2787,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pi9w","title":"M 7.1 - 2025 Southern Tibetan Plateau Earthquake"},"geometry":{"type":"Point","coordinates":[87.3781,28.6036,10]},"id":"us6000pi9w"},
{"type":"Feature","properties":{"mag":5.4,"place":"96 km NNE of Lobuche, Nepal","time":1736212153529,"updated":1742247300040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":"green","sig":449,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pks1","title":"M 5.4 - 96 km NNE of Lobuche, Nepal"},"geometry":{"type":"Point","coordinates":[87.1968,28.7537,10]},"id":"us6000pks1"},
{"type":"Feature","properties":{"mag":5.2,"place":"100 km NNE of Lobuche, Nepal","time":1736212254880,"updated":1742247300040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":416,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pks6","title":"M 5.2 - 100 km NNE of Lobuche, Nepal"},"geometry":{"type":"Point","coordinates":[87.1343,28.8057,10]},"id":"us6000pks6"},
{"type":"Feature","properties":{"mag":5.2,"place":"Southern Tibetan Plateau","time":1736212407197,"updated":1742247300040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":422,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pia7","title":"M 5.2 - Southern Tibetan Plateau"},"geometry":{"type":"Point","coordinates":[87.4659,28.4421,10]},"id":"us6000pia7"},
{"type":"Feature","properties":{"mag":5.2,"place":"83 km NE of Lobuche, Nepal","time":1736212482239,"updated":1742247301040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":416,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pkpp","title":"M 5.2 - 83 km NE of Lobuche, Nepal"},"geometry":{"type":"Point","coordinates":[87.356,28.5282,10]},"id":"us6000pkpp"},
{"type":"Feature","properties":{"mag":5,"place":"Southern Tibetan Plateau","time":1736213065911,"updated":1742247301040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":385,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000piak","title":"M 5.0 - Southern Tibetan Plateau"},"geometry":{"type":"Point","coordinates":[87.4575,28.4845,10]},"id":"us6000piak"},
{"type":"Feature","properties":{"mag":5,"place":"Southern Tibetan Plateau","time":1736213833647,"updated":1742247302040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":385,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000piar","title":"M 5.0 - Southern Tibetan Plateau"},"geometry":{"type":"Point","coordinates":[87.2321,28.7969,10]},"id":"us6000piar"},
{"type":"Feature","properties":{"mag":5,"place":"Fiji region","time":1736223330187,"updated":1742247306040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":385,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pic9","title":"M 5.0 - Fiji region"},"geometry":{"type":"Point","coordinates":[-176.843,-17.6376,370.004]},"id":"us6000pic9"},
{"type":"Feature","properties":{"mag":5.6,"place":"Izu Islands, Japan region","time":1736238690553,"updated":1742247308040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":"green","sig":485,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pida","title":"M 5.6 - Izu Islands, Japan region"},"geometry":{"type":"Point","coordinates":[138.4289,31.6194,358]},"id":"us6000pida"},
{"type":"Feature","properties":{"mag":5.2,"place":"Mid-Indian Ridge","time":1736267939524,"updated":1742247311040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":416,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pifb","title":"M 5.2 - Mid-Indian Ridge"},"geometry":{"type":"Point","coordinates":[77.9555,-37.6508,10]},"id":"us6000pifb"},
{"type":"Feature","properties":{"mag":5.3,"place":"Volcano Islands, Japan region","time":1736270628611,"updated":1742247311040,"tsunami":0,"magType":"mww","type":"earthquake","status":"reviewed","alert":null,"sig":432,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pife","title":"M 5.3 - Volcano Islands, Japan region"},"geometry":{"type":"Point","coordinates":[142.0996,24.2827,534.482]},"id":"us6000pife"},
{"type":"Feature","properties":{"mag":5,"place":"38 km NNW of Komodo, Indonesia","time":1736272341671,"updated":1742247312040,"tsunami":0,"magType":"mb","type":"earthquake","status":"reviewed","alert":null,"sig":386,"url":"https://earthquake.usgs.gov/earthquakes/eventpage/us6000pifl","title":"M 5.0 - 38 km NNW of Komodo, Indonesia"},"geometry":{"type":"Point","coordinates":[119.3325,-8.2744,10]},"id":"us6000pifl"}
],"bbox":null}
</pblock>
<pblock filename="run.sh" role="context" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/run.sh">
#!/bin/sh
# run.sh — Quakes grader. Do not filter, skip, or reinterpret.
#
# Runs ./quakes over the frozen USGS snapshot and compares every report's exit code and standard
# output with the known answer below. Standard error is never compared. No network is used.
#
# sh sources/run.sh from the application root (how `drydock uat` runs it)
# sh uat/Quakes/bin/run.sh APP from anywhere, grading the application root APP
#
# Exit 0 only when every check passes.
set -u
HERE=$(cd "$(dirname "$0")" && pwd)
APP=$(cd "${1:-.}" && pwd)
if [ -f "$HERE/quakes_2025-01-01_07.geojson" ]; then DATA=$HERE; else DATA=$(cd "$HERE/../sources" && pwd); fi
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT INT TERM
BIN="$APP/quakes"
QUAKES="$DATA/quakes_2025-01-01_07.geojson"
printf 'this is not json\n' > "$WORK/garbage.json"
printf '{"type":"Feature","properties":{},"geometry":null}\n' > "$WORK/feature.json"
if [ ! -x "$BIN" ]; then
echo "error: no executable ./quakes at the application root $APP." >&2
echo "The deliverable is an executable named quakes at the application root." >&2
exit 1
fi
PASSED=0
FAILED=0
# check <id> <expected exit> <quakes 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: quakes $*"
else
FAILED=$((FAILED + 1))
echo "FAIL $id: quakes $*"
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 snapshot ──────────────────────────────────────────────────
check A1 0 summary "$QUAKES" <<'EOF'
events,first,last,min_mag,max_mag,mean_mag,tsunami
44,2025-01-01T04:39:18Z,2025-01-07T17:52:21Z,5.0,7.1,5.30,0
EOF
check A2 0 top "$QUAKES" <<'EOF'
time,mag,depth_km,place,id
2025-01-07T01:05:16Z,7.1,10.0,2025 Southern Tibetan Plateau Earthquake,us6000pi9w
2025-01-05T17:18:45Z,6.2,46.0,"56 km SSE of La Libertad, El Salvador",us6000pi09
2025-01-01T13:48:24Z,6.1,70.0,South Sandwich Islands region,us6000pgv4
2025-01-02T20:43:35Z,6.1,99.0,"84 km NNW of Calama, Chile",us6000phap
2025-01-04T00:52:21Z,5.7,8.0,"52 km N of Āwash, Ethiopia",us6000phrk
2025-01-07T08:31:30Z,5.6,358.0,"Izu Islands, Japan region",us6000pida
2025-01-01T04:39:18Z,5.5,22.0,"153 km S of Isangel, Vanuatu",us6000pgsd
2025-01-02T02:54:17Z,5.5,10.0,Balleny Islands region,us6000pgzq
2025-01-03T02:33:17Z,5.5,86.0,South Sandwich Islands region,us6000phce
2025-01-03T17:01:46Z,5.5,10.0,"45 km NNE of Āwash, Ethiopia",us6000phnz
EOF
check A3 0 daily "$QUAKES" <<'EOF'
date,events,max_mag
2025-01-01,7,6.1
2025-01-02,8,6.1
2025-01-03,6,5.5
2025-01-04,3,5.7
2025-01-05,3,6.2
2025-01-06,5,5.2
2025-01-07,12,7.1
TOTAL,44,7.1
EOF
check A4 0 regions "$QUAKES" <<'EOF'
region,events,max_mag
Ethiopia,7,5.7
Papua New Guinea,6,5.4
Nepal,3,5.4
Southern Tibetan Plateau,3,5.2
Vanuatu,3,5.5
Indonesia,2,5.1
Japan region,2,5.6
South Sandwich Islands region,2,6.1
2025 Southern Tibetan Plateau Earthquake,1,7.1
Balleny Islands region,1,5.5
Chile,1,6.1
El Salvador,1,6.2
Fiji region,1,5.0
India,1,5.0
Iran,1,5.2
Japan,1,5.1
Mid-Indian Ridge,1,5.2
Philippines,1,5.1
Solomon Islands,1,5.2
Southwest Indian Ridge,1,5.0
Tibetan Plateau,1,5.2
Tonga,1,5.1
southeast of Easter Island,1,5.3
southern Mid-Atlantic Ridge,1,5.2
EOF
# ── B. Options ───────────────────────────────────────────────────────────────────────────
check B1 0 top --n 3 "$QUAKES" <<'EOF'
time,mag,depth_km,place,id
2025-01-07T01:05:16Z,7.1,10.0,2025 Southern Tibetan Plateau Earthquake,us6000pi9w
2025-01-05T17:18:45Z,6.2,46.0,"56 km SSE of La Libertad, El Salvador",us6000pi09
2025-01-01T13:48:24Z,6.1,70.0,South Sandwich Islands region,us6000pgv4
EOF
check B2 0 summary --min-mag 5.5 "$QUAKES" <<'EOF'
events,first,last,min_mag,max_mag,mean_mag,tsunami
10,2025-01-01T04:39:18Z,2025-01-07T08:31:30Z,5.5,7.1,5.88,0
EOF
check B3 0 regions --min-mag 5.4 "$QUAKES" <<'EOF'
region,events,max_mag
Ethiopia,3,5.7
South Sandwich Islands region,2,6.1
2025 Southern Tibetan Plateau Earthquake,1,7.1
Balleny Islands region,1,5.5
Chile,1,6.1
El Salvador,1,6.2
Japan region,1,5.6
Nepal,1,5.4
Papua New Guinea,1,5.4
Vanuatu,1,5.5
EOF
check B4 0 daily --min-mag 6 "$QUAKES" <<'EOF'
date,events,max_mag
2025-01-01,1,6.1
2025-01-02,1,6.1
2025-01-05,1,6.2
2025-01-07,1,7.1
TOTAL,4,7.1
EOF
check B5 0 top --min-mag 5.1 --n 4 "$QUAKES" <<'EOF'
time,mag,depth_km,place,id
2025-01-07T01:05:16Z,7.1,10.0,2025 Southern Tibetan Plateau Earthquake,us6000pi9w
2025-01-05T17:18:45Z,6.2,46.0,"56 km SSE of La Libertad, El Salvador",us6000pi09
2025-01-01T13:48:24Z,6.1,70.0,South Sandwich Islands region,us6000pgv4
2025-01-02T20:43:35Z,6.1,99.0,"84 km NNW of Calama, Chile",us6000phap
EOF
# ── C. Distance search ───────────────────────────────────────────────────────────────────
check C1 0 near --lat 27.72 --lon 85.32 --radius 800 "$QUAKES" <<'EOF'
distance_km,time,mag,place,id
214.8,2025-01-07T01:10:54Z,5.2,"100 km NNE of Lobuche, Nepal",us6000pks6
216.8,2025-01-07T01:09:13Z,5.4,"96 km NNE of Lobuche, Nepal",us6000pks1
219.0,2025-01-07T01:14:42Z,5.2,"83 km NE of Lobuche, Nepal",us6000pkpp
222.3,2025-01-07T01:37:13Z,5.0,Southern Tibetan Plateau,us6000piar
224.4,2025-01-07T01:05:16Z,7.1,2025 Southern Tibetan Plateau Earthquake,us6000pi9w
225.3,2025-01-07T01:13:27Z,5.2,Southern Tibetan Plateau,us6000pia7
226.2,2025-01-07T01:24:25Z,5.0,Southern Tibetan Plateau,us6000piak
655.6,2025-01-06T15:26:46Z,5.2,Tibetan Plateau,us6000pi67
EOF
check C2 0 near --lat 35.68 --lon 139.69 --radius 1500 "$QUAKES" <<'EOF'
distance_km,time,mag,place,id
216.3,2025-01-06T16:44:39Z,5.1,"113 km E of Hasaki, Japan",us6000pi7a
466.3,2025-01-07T08:31:30Z,5.6,"Izu Islands, Japan region",us6000pida
1288.3,2025-01-07T17:23:48Z,5.3,"Volcano Islands, Japan region",us6000pife
EOF
check C3 0 near --lat 9.03 --lon 38.74 --radius 300 --min-mag 5.3 "$QUAKES" <<'EOF'
distance_km,time,mag,place,id
159.0,2025-01-04T00:52:21Z,5.7,"52 km N of Āwash, Ethiopia",us6000phrk
174.7,2025-01-02T21:18:26Z,5.4,"52 km NNE of Āwash, Ethiopia",us6000phb3
180.0,2025-01-03T17:01:46Z,5.5,"45 km NNE of Āwash, Ethiopia",us6000phnz
EOF
check C4 0 near --lat 0 --lon 0 --radius 100 "$QUAKES" <<'EOF'
distance_km,time,mag,place,id
EOF
# ── D. Nothing matches ───────────────────────────────────────────────────────────────────
check D1 0 summary --min-mag 9 "$QUAKES" <<'EOF'
events,first,last,min_mag,max_mag,mean_mag,tsunami
0,,,,,,0
EOF
check D2 0 daily --min-mag 9 "$QUAKES" <<'EOF'
date,events,max_mag
TOTAL,0,
EOF
# ── E. Operational failures ──────────────────────────────────────────────────────────────
check E1 1 summary "$WORK/no-such-file.geojson" < /dev/null
check E2 1 summary "$WORK/garbage.json" < /dev/null
check E3 1 summary "$WORK/feature.json" < /dev/null
# ── U. Usage errors ──────────────────────────────────────────────────────────────────────
check U1 2 < /dev/null
check U2 2 frobnicate "$QUAKES" < /dev/null
check U3 2 near --lat 27.72 --lon 85.32 "$QUAKES" < /dev/null
check U4 2 top --n 0 "$QUAKES" < /dev/null
check U5 2 summary --min-mag big "$QUAKES" < /dev/null
check U6 2 near --lat 95 --lon 0 --radius 10 "$QUAKES" < /dev/null
check U7 2 summary --n 3 "$QUAKES" < /dev/null
check U8 2 summary < /dev/null
TOTAL=$((PASSED + FAILED))
echo "Quakes: $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-Summary.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/FEATURE-Summary.md" guidance="Feature Specification">
# FEATURE: Summary
| Field | Value |
|-------------|-------|
| Version | 20261024 V1 |
| Description | Produces summary statistics for events in a saved GeoJSON FeatureCollection. |
| Depends On | |
| Provides | quakes summary |
| Consumes | |
## Purpose
Summarize the events in a saved GeoJSON file, optionally filtering by minimum magnitude.
## Workflow
1. Read the supplied FeatureCollection and normalize each feature into an event.
2. Exclude events with null magnitude and apply `--min-mag` to all remaining events.
3. Compute count, earliest and latest UTC event times, minimum, maximum and mean magnitudes, and tsunami count.
4. Write the result as CSV with the defined header and one data row.
`properties.time` is milliseconds since the Unix epoch; output times are UTC, truncated to whole seconds. Mean magnitude uses two decimal places rounded half up. An empty result writes `0,,,,,,0` after the header.
## CLI Contract
`quakes summary [--min-mag <m>] <file>`
Magnitude values are decimals matching `-?[0-9]+(\.[0-9]+)?`. Success exits 0, operational file or FeatureCollection errors exit 1, and malformed or unsupported arguments exit 2. A failing command writes no standard output and one diagnostic line to standard error.
## Programmatic Acceptance
=== AC summary-success ===
Intent: The summary command succeeds on a supplied FeatureCollection.
Requires: executable=./quakes; scope=test
import json
import tempfile
from pathlib import Path
from cli.testing import cli_runner
event = {"type": "Feature", "id": "a", "properties": {
"mag": 5.0, "place": "Test Place", "time": 1735689600000, "tsunami": 1
}, "geometry": {"type": "Point", "coordinates": [0, 0, 1]}}
with tempfile.TemporaryDirectory() as directory:
source = Path(directory) / "events.json"
source.write_text(json.dumps({"type": "FeatureCollection", "features": [event]}))
code, stdout, stderr = cli_runner("summary", str(source))
assert code == 0
=== END AC summary-success ===
=== AC summary-invalid-file ===
Intent: An unreadable or invalid input file returns the operational exit code.
from cli.testing import cli_runner
code, stdout, stderr = cli_runner("summary", "missing-file.geojson")
assert code == 1
=== END AC summary-invalid-file ===
## User Acceptance
- None.
## Guardrails
- Every summary value must be computed from the input file.
- Apply `--min-mag` consistently and exclude null magnitudes.
- Emit CSV with newline line endings.
</pblock>
<pblock filename="FEATURE-Daily.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/FEATURE-Daily.md" guidance="Feature Specification">
# FEATURE: Daily
| Field | Value |
|-------------|-------|
| Version | 20261024 V1 |
| Description | Groups saved earthquake events by UTC date and reports daily totals. |
| Depends On | |
| Provides | quakes daily |
| Consumes | |
## Purpose
Report the number of events and maximum magnitude for each UTC date in the input file.
## Workflow
1. Read events, exclude null magnitudes, and apply the optional minimum magnitude.
2. Group matching events by the first ten characters of their UTC timestamp.
3. Sort dates ascending and compute each date's count and maximum magnitude.
4. Emit a final `TOTAL` row with overall event count and maximum magnitude.
Maximum magnitudes use one decimal place. With no matching events, the total maximum magnitude is empty.
## CLI Contract
`quakes daily [--min-mag <m>] <file>`
Success exits 0; operational file or FeatureCollection errors exit 1; usage errors exit 2. Failures write no standard output and one diagnostic line to standard error.
## Programmatic Acceptance
=== AC daily-empty ===
Intent: An empty event file produces a successful daily report with an empty total maximum.
import json
import tempfile
from pathlib import Path
from cli.testing import cli_runner
with tempfile.TemporaryDirectory() as directory:
source = Path(directory) / "empty.json"
source.write_text(json.dumps({"type": "FeatureCollection", "features": []}))
code, stdout, stderr = cli_runner("daily", str(source))
assert code == 0
=== END AC daily-empty ===
=== AC daily-filter ===
Intent: The minimum magnitude option is accepted and the report succeeds.
import json
import tempfile
from pathlib import Path
from cli.testing import cli_runner
event = {"type": "Feature", "id": "input-id", "properties": {
"mag": 5.5, "place": "Input Place", "time": 1735689600000, "tsunami": 0
}, "geometry": {"type": "Point", "coordinates": [0, 0, 1]}}
with tempfile.TemporaryDirectory() as directory:
source = Path(directory) / "events.json"
source.write_text(json.dumps({"type": "FeatureCollection", "features": [event]}))
code, stdout, stderr = cli_runner("daily", "--min-mag", "6", str(source))
assert code == 0
=== END AC daily-filter ===
## User Acceptance
- None.
## Guardrails
- Use UTC dates and ascending date order.
- Include the total row, including when no events match.
- Compute all values from the supplied file.
</pblock>
<pblock filename="FEATURE-Top.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/FEATURE-Top.md" guidance="Feature Specification">
# FEATURE: Top
| Field | Value |
|-------------|-------|
| Version | 20261024 V1 |
| Description | Lists the largest earthquake events from a saved GeoJSON FeatureCollection. |
| Depends On | |
| Provides | quakes top |
| Consumes | |
## Purpose
List up to the requested number of largest events, optionally filtered by minimum magnitude.
## Workflow
1. Read and normalize the events from the input FeatureCollection.
2. Exclude null magnitudes and apply `--min-mag`.
3. Sort by magnitude descending, then event time ascending.
4. Keep the first `--n` events (default 10) and write the defined CSV header and rows.
Magnitude and depth are formatted to one decimal place, with depth rounded half up.
## CLI Contract
`quakes top [--min-mag <m>] [--n <count>] <file>`
`<count>` is a positive integer. Success exits 0; unreadable or invalid input exits 1; malformed or unsupported arguments exit 2. Failures write no standard output and one diagnostic line to standard error.
## Programmatic Acceptance
=== AC top-options ===
Intent: The top command accepts its count option and succeeds on a supplied event file.
import json
import tempfile
from pathlib import Path
from cli.testing import cli_runner
event = {"type": "Feature", "id": "input-id", "properties": {
"mag": 5.5, "place": "Input Place", "time": 1735689600000, "tsunami": 0
}, "geometry": {"type": "Point", "coordinates": [0, 0, 1]}}
with tempfile.TemporaryDirectory() as directory:
source = Path(directory) / "events.json"
source.write_text(json.dumps({"type": "FeatureCollection", "features": [event]}))
code, stdout, stderr = cli_runner("top", "--n", "1", str(source))
assert code == 0
=== END AC top-options ===
=== AC top-invalid-count ===
Intent: A nonpositive count returns the usage exit code.
import json
import tempfile
from pathlib import Path
from cli.testing import cli_runner
event = {"type": "Feature", "id": "input-id", "properties": {
"mag": 5.5, "place": "Input Place", "time": 1735689600000, "tsunami": 0
}, "geometry": {"type": "Point", "coordinates": [0, 0, 1]}}
with tempfile.TemporaryDirectory() as directory:
source = Path(directory) / "events.json"
source.write_text(json.dumps({"type": "FeatureCollection", "features": [event]}))
code, stdout, stderr = cli_runner("top", "--n", "0", str(source))
assert code == 2
assert stdout == ""
=== END AC top-invalid-count ===
## User Acceptance
- None.
## Guardrails
- Ordering is magnitude descending and then time ascending.
- The count must be positive.
- Event values come from the file; do not hardcode report output.
</pblock>
<pblock filename="FEATURE-Regions.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/FEATURE-Regions.md" guidance="Feature Specification">
# FEATURE: Regions
| Field | Value |
|-------------|-------|
| Version | 20261024 V1 |
| Description | Groups saved earthquake events by region and reports event counts. |
| Depends On | |
| Provides | quakes regions |
| Consumes | |
## Purpose
Report counts and maximum magnitudes grouped by the source-defined region of each event.
## Region Rule
The region is the text after the last comma and space in `place`, or the whole place when no such delimiter occurs. A null place is `Unknown`, which is also its region.
## Workflow
1. Read and normalize events, exclude null magnitudes, and apply `--min-mag`.
2. Group by region, count events, and compute each group's maximum magnitude.
3. Sort groups by event count descending, then region ascending.
4. Write CSV with one row per region.
Maximum magnitudes use one decimal place.
## CLI Contract
`quakes regions [--min-mag <m>] <file>`
Success exits 0; operational file or FeatureCollection errors exit 1; usage errors exit 2. Failures write no standard output and one diagnostic line to standard error.
## Programmatic Acceptance
=== AC regions-command ===
Intent: The regions command succeeds for a FeatureCollection with an event.
import json
import tempfile
from pathlib import Path
from cli.testing import cli_runner
event = {"type": "Feature", "id": "input-id", "properties": {
"mag": 5.5, "place": "Input Place, Region", "time": 1735689600000, "tsunami": 0
}, "geometry": {"type": "Point", "coordinates": [0, 0, 1]}}
with tempfile.TemporaryDirectory() as directory:
source = Path(directory) / "events.json"
source.write_text(json.dumps({"type": "FeatureCollection", "features": [event]}))
code, stdout, stderr = cli_runner("regions", str(source))
assert code == 0
=== END AC regions-command ===
=== AC regions-filter ===
Intent: The minimum magnitude option is accepted and returns success.
import json
import tempfile
from pathlib import Path
from cli.testing import cli_runner
event = {"type": "Feature", "id": "input-id", "properties": {
"mag": 5.5, "place": "Input Place, Region", "time": 1735689600000, "tsunami": 0
}, "geometry": {"type": "Point", "coordinates": [0, 0, 1]}}
with tempfile.TemporaryDirectory() as directory:
source = Path(directory) / "events.json"
source.write_text(json.dumps({"type": "FeatureCollection", "features": [event]}))
code, stdout, stderr = cli_runner("regions", "--min-mag", "6", str(source))
assert code == 0
=== END AC regions-filter ===
## User Acceptance
- None.
## Guardrails
- Apply the same magnitude filter used by all reports.
- Region extraction follows the exact delimiter rule.
- Derive all rows and counts from the input file.
</pblock>
<pblock filename="FEATURE-Near.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/FEATURE-Near.md" guidance="Feature Specification">
# FEATURE: Near Earthquake Events
| Field | Value |
|-------------|-------|
| Version | 20261024 V1 |
| Description | Finds saved earthquake events within a requested distance of a point. |
| Depends On | ARCHITECTURE.md |
| Provides | quakes near |
| Consumes | saved GeoJSON FeatureCollection |
## Purpose
The `near` command lists events within a radius of a latitude and longitude. It reads a saved GeoJSON FeatureCollection and writes a CSV report to standard output.
## Trigger and inputs
```text
quakes near --lat <deg> --lon <deg> --radius <km> [--min-mag <m>] <file>
```
The file is the final argument. Options may follow the command in any order. `--min-mag` uses the shared report default when omitted. Decimal values match `-?[0-9]+(\.[0-9]+)?`.
## Behavior
- Reject latitude outside −90 to 90, longitude outside −180 to 180, and radius that is not positive as usage errors.
- Require all of `--lat`, `--lon`, and `--radius`; reject missing values, malformed decimals, extra files, and options not listed for this command.
- Apply the magnitude filter before reporting. Events with null magnitude are excluded.
- Compute great-circle distance with the haversine formula on a sphere of radius 6371.0 km. Include events whose distance is at most the requested radius.
- Order matches by distance ascending, then event time ascending.
- Write CSV with the header `distance_km,time,mag,place,id`. Format distance to one decimal place using round half up, magnitude to one decimal place, and event time in UTC as `YYYY-MM-DDTHH:MM:SSZ`, truncated to whole seconds.
- A null place is `Unknown`. Use the standard region and event parsing rules described in `ARCHITECTURE.md`.
- A valid request with no matching events succeeds and emits the header only.
- On usage errors, return exit code 2. On unreadable or invalid GeoJSON input, return exit code 1. On failure, write no standard output and one diagnostic line to standard error.
## Programmatic Acceptance
=== AC near-valid-request ===
Intent: A valid near request is accepted by the CLI.
from cli.testing import cli_runner
code, _, _ = cli_runner(
"near", "--lat", "0", "--lon", "0", "--radius", "1", "sources/quakes_2025-01-01_07.geojson"
)
assert code == 0
=== END AC near-valid-request ===
=== AC near-required-options ===
Intent: A near request missing a required coordinate is rejected as a usage error.
from cli.testing import cli_runner
code, _, _ = cli_runner(
"near", "--lat", "0", "--lon", "0", "sources/quakes_2025-01-01_07.geojson"
)
assert code == 2
=== END AC near-required-options ===
=== AC near-coordinate-bounds ===
Intent: A latitude outside the documented range is rejected as a usage error.
from cli.testing import cli_runner
code, _, _ = cli_runner(
"near", "--lat", "95", "--lon", "0", "--radius", "1", "sources/quakes_2025-01-01_07.geojson"
)
assert code == 2
=== END AC near-coordinate-bounds ===
=== AC near-invalid-file ===
Intent: An invalid GeoJSON file is reported as an operational failure without standard output.
from cli.testing import cli_runner
from pathlib import Path
invalid_file = Path("near-invalid.geojson")
invalid_file.write_text("not json\n")
try:
code, stdout, _ = cli_runner(
"near", "--lat", "0", "--lon", "0", "--radius", "1", str(invalid_file)
)
assert code == 1
assert stdout == ""
finally:
invalid_file.unlink(missing_ok=True)
=== END AC near-invalid-file ===
## User Acceptance
- None.
## Guardrails
- Do not hardcode report rows, counts, or distances; derive every reported value from the input file.
- Do not read or depend on `sources/run.sh` from application code.
</pblock>
<pblock filename="FEATURE-Verification.md" role="implements" path="/mnt/c/Users/barlo/projects/drydock/uat/Quakes/runs/20261024.065111/workspace/targets/Quakes/blueprint/FEATURE-Verification.md" guidance="Feature Specification">
# FEATURE: Verification
| Field | Value |
|-------------|-------|
| Version | 20261024 V1 |
| Description | Provides the offline pytest suite and final conformance verification workflow. |
| Depends On | FEATURE-Fetch.md, FEATURE-Summary.md, FEATURE-Top.md, FEATURE-Daily.md, FEATURE-Regions.md, FEATURE-Near.md |
| Provides | bin/test.sh, pytest suite, final conformance verification |
| Consumes | quakes fetch, quakes summary, quakes top, quakes daily, quakes regions, quakes near |
## Purpose
The project provides a POSIX-compatible `bin/test.sh` that runs the project's pytest suite from the application root and exits zero only when every test passes. The suite covers each report command, behavior-changing options, region and distance rules, fetch through a stubbed HTTP response, and exit codes. Tests use files written by the tests and never open a network connection.
After all command capabilities are implemented, run the supplied grader from the application root as the final conformance check.
## Programmatic Acceptance
=== AC verification-test-suite ===
Intent: The project test launcher succeeds after running the automated tests.
import subprocess
result = subprocess.run(
["sh", "bin/test.sh"],
capture_output=True,
text=True,
)
print(result.stdout)
print(result.stderr)
assert result.returncode == 0
=== END AC verification-test-suite ===
=== AC verification-full-conformance ===
Intent: The complete supplied grader passes against the finished command set.
Suite: full
import subprocess
result = subprocess.run(
["sh", "sources/run.sh"],
capture_output=True,
text=True,
)
print(result.stdout)
print(result.stderr)
assert result.returncode == 0
=== END AC verification-full-conformance ===
## User Acceptance
- None.
## Guardrails
- Keep `sources/run.sh` and the frozen GeoJSON snapshot unchanged.
- Tests must stub the HTTP call for fetch and must not use the network.
- Run the supplied grader only as the full terminal conformance check after all implementation stories are complete.
</pblock>
<pblock label="Build instructions" kind="instructions">
Build instructions for this block
Summarize events from a saved GeoJSON FeatureCollection. (summary)
Implement summary calculations and CSV output from the supplied file, including magnitude filtering, time bounds, magnitude statistics, tsunami count, empty results, and the specified operational and usage exit codes.
Report event counts and maximum magnitudes by day. (daily)
Implement daily grouping, ordering, maximum magnitudes, total row, shared magnitude filtering, and CSV output according to the source instructions.
List the largest events from a saved GeoJSON FeatureCollection. (top)
Implement top-event selection, ordering, count option, shared magnitude filtering, and CSV output according to the source instructions.
Report event counts and maximum magnitudes by region. (regions)
Implement region extraction and grouping, ordering, maximum magnitudes, shared magnitude filtering, and CSV output according to the source instructions.
Find events within a haversine distance of a point. (near)
Implement coordinate and radius validation, haversine distance on the specified sphere, inclusive radius matching, nearest-first ordering, shared magnitude filtering, and CSV output.
Provide the automated test suite and run final conformance verification. (verify)
Provide bin/test.sh and a pytest suite that covers the commands, options, failures, and stubbed fetch behavior without network access. This is the terminal story: its acceptance runs the supplied full conformance suite after all implementation stories close.
</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 — 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.
- 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.