Run artifact

evidence/prompt_outputs/20261026.152941.006Z_drydockstats_lineage_attribute_claude.output.txt

<requirement name="go-stdlib-module" stories="foundation,build-exe">
Implement in Go 1.22 or newer using only the standard library. The application root is a Go module, and its executable is the main package at `./cmd/ddkstat`. Tests run under `go test`.
</requirement>
<requirement name="run-harness" stories="verification">
The harness runs `go build -o <temporary path> ./cmd/ddkstat` and then runs 20 checks against
`sources/llm_sample.jsonl`. Each check compares one command's exit code and standard output with a
known answer.
</requirement>
<requirement name="command-line-syntax" stories="cli-args">
`<report>` comes first, options follow it, and the log path is last. Exactly one log path is
required. `<report>` is one of `summary`, `commands`, `targets`, `models`, `daily`, `failures`.
</requirement>
<requirement name="target-filter" stories="filter-target">
Keep only records whose `job.target` equals `<name>` exactly.
</requirement>
<requirement name="date-filters" stories="filter-dates">
Keep only records whose start date is on or after `<date>`.
</requirement>
<requirement name="date-option-validation" stories="cli-dates">
A date option must be a real calendar date written `YYYY-MM-DD`.
</requirement>
<requirement name="read-jsonl-log" stories="log-lines">
The log is JSON Lines in UTF-8: one JSON object per line. A record carries many fields. The
reporter reads only these and ignores every other field:
</requirement>
<requirement name="blank-lines" stories="log-lines">
**Blank lines** are ignored and not counted.
</requirement>
<requirement name="skipped-lines" stories="log-skip">
**Skipped lines.** A line is skipped when it is not a JSON object, when any of `execution_id`,
`started_at`, `status`, `job.command_name`, or `job.target` is absent or not a non-empty
string, or when its `execution_id` already appeared on an earlier line. The first occurrence of
an `execution_id` is kept. Each skipped line writes one warning to standard error naming its
line number. Skipping never changes the exit code.
</requirement>
<requirement name="missing-numbers" stories="log-numbers">
**Missing numbers.** An absent or `null` token count, cost, or duration counts as zero. A
record with no `result.stats` object at all is still a record.
</requirement>
<requirement name="record-model" stories="log-model">
**Model.** A record's model is `result.stats.model` when present and non-empty, otherwise
`job.model`.
</requirement>
<requirement name="failed-record" stories="log-lines">
**Failed.** A record is failed when `status` is not `succeeded`.
</requirement>
<requirement name="filters-apply-to-all" stories="filter-target,filter-dates,report-summary">
**Filters** apply to every report. The `skipped` count in `summary` counts skipped lines in the
whole file regardless of filters.
</requirement>
<requirement name="minutes-format" stories="value-format">
**Minutes.** A minutes column is the group's summed `elapsed_ms` written in tenths of a minute:
`t = (ms + 3000) / 6000` in integer division, written as `t / 10`, a `.`, and `t % 10`.
`95000` ms is `1.6`.
</requirement>
<requirement name="cost-format" stories="value-format">
**Cost.** A cost column is the group's summed `cost_usd` written with exactly four decimal
places, as Go's `%.4f` writes a `float64`.
</requirement>
<requirement name="byte-ordering" stories="report-commands,report-targets,report-models,report-daily,report-failures">
**Ordering.** Text is compared by byte value.
</requirement>
<requirement name="csv-output" stories="report-summary,report-commands,report-targets,report-models,report-daily,report-failures">
Every report writes CSV to standard output: one header row, then data rows, comma-separated, `\n`
line endings. Every report except `summary` and `failures` ends with a `TOTAL` row over all
filtered records. When no record matches, a report writes its header and, where it has one, a
`TOTAL` row of zeros (`0.0` minutes, `0.0000` cost).
</requirement>
<requirement name="summary-report" stories="report-summary">
`records,skipped,succeeded,failed,first,last,input_tokens,cached_tokens,output_tokens,cost_usd,minutes` | One row. `first` and `last` are the earliest and latest start dates, empty when no record matches.
</requirement>
<requirement name="commands-report" stories="report-commands">
`command,calls,failed,input_tokens,cached_tokens,output_tokens,minutes` | One per command, by calls descending, then command ascending. Then `TOTAL,…`.
</requirement>
<requirement name="targets-report" stories="report-targets">
`target,calls,failed,input_tokens,cached_tokens,output_tokens,cost_usd,minutes` | One per Target, by Target ascending. Then `TOTAL,…`.
</requirement>
<requirement name="models-report" stories="report-models">
`provider,model,calls,failed,input_tokens,cached_tokens,output_tokens,cost_usd` | One per provider and model pair, by provider then model ascending. Then `TOTAL,,…`.
</requirement>
<requirement name="daily-report" stories="report-daily">
`date,calls,failed,tokens,minutes` | One per start date, ascending. `tokens` is input plus cached plus output. Then `TOTAL,…`.
</requirement>
<requirement name="failures-report" stories="report-failures">
`started_at,target,command,model,returncode,timed_out` | One per failed record, by `started_at` then `execution_id` ascending. `returncode` is empty when `null` or absent. `timed_out` is `true` or `false`.
</requirement>
<requirement name="failure-diagnostics" stories="cli-exit">
A failing command writes nothing to standard output and one diagnostic line to standard error.
</requirement>
<requirement name="exit-codes" stories="cli-exit,cli-args,cli-dates">
| `0` | Success, including a log with skipped lines or no matching records. |
| `1` | Operational failure: the log cannot be opened or read. |
| `2` | Usage error: unknown report or option, missing option value, invalid date, missing or extra log path. |
</requirement>
<requirement name="test-script" stories="test-script">
The completed application provides a POSIX-compatible `bin/test.sh` that runs `go vet ./...` and
`go test ./...` from the application root and exits zero only when both pass. The suite covers
each report, each filter, each skip rule, and each exit code using logs written by the tests.
</requirement>