Run artifact

workspace/targets/DrydockStats/MANIFEST.md

MANIFEST: DrydockStats

updated: 2026-10-26T15:29:21+00:00 state: approved blocks: 10

applied_specs: | ARCHITECTURE.md sha256=50e4c308b6e72eb915ea39843b4bfe2277ccd8adc8f1a3b1c07e6688d66829cb commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-2 applied_at=2026-10-26T15:36:57+00:00 build_sha256=a1c88499fd501fe2c12f5759ce8c8213ae6bd72348e4bc44350fea209a705ebe ARCHITECTURE_compact.md sha256=06372fb1a4ecf236fe5c011d288a95284294cc2a31660254ca4b15e4e596cd7c commit=fbd7ca673896eeb497eec86cc1682a9c95640574 applied_by=block-9 applied_at=2026-10-26T15:57:45+00:00 build_sha256=06372fb1a4ecf236fe5c011d288a95284294cc2a31660254ca4b15e4e596cd7c FEATURE-BuildExecutable.md sha256=3be1a24afd70a91b9eb8c9b345aba01e427d56c6902470fa4f41afaf9e32439c commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-7 applied_at=2026-10-26T15:48:01+00:00 build_sha256=8f149a19cca4c761390e25615fd7d681f501038cf8bd2af5fb1f50cd56f637b9 FEATURE-CliArgs.md sha256=c3e86fff994415615b2e7a688bb5e7cccf15c35ecad6449d20ade8e3a4bcabf8 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-2 applied_at=2026-10-26T15:36:57+00:00 build_sha256=888977cb159fa5b2dda52fee3d58e7b407d6647cd40e1e22b6c4e75b7db91a53 FEATURE-CliDates.md sha256=d1435b5c6e63a3e91e4ee85f89fe442cdeb2e22ea97b5c8d10e8830f4a2fee80 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-3 applied_at=2026-10-26T15:39:25+00:00 build_sha256=2729a8f6f8307e9c262942250064d6d7852a97a1e4d9dea06ba2ff6e2b355203 FEATURE-CliExit.md sha256=0d226ecbb5426d4167d79002332fc5842d304040bdd9692a3729aaa9fd853608 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-6 applied_at=2026-10-26T15:46:05+00:00 build_sha256=7721ef78181b6340d89a3acc8d194502b744a323b721b2f95867429a5cab1ea3 FEATURE-FilterDates.md sha256=6e093c792b879c5d814e5568b29767d723357167d52ccfd53d57c463ba99b7f6 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-5 applied_at=2026-10-26T15:43:45+00:00 build_sha256=50d999aeac95877aaac8e025cae194919b72614c4c9b220f867ca4b08b9ad096 FEATURE-FilterTarget.md sha256=375081b75e53f6691846359dc77dd931c0b2c2da232496c960c367ad36cfe121 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-5 applied_at=2026-10-26T15:43:45+00:00 build_sha256=56f4631e29c3cf57c0e36a2abd4df07f9f2463564ca6ee1e77f565e1f20dea2d FEATURE-LogLines.md sha256=7147d7e09dfef7af41504848eadfbf846cfd429c35340874048e89e5e870a815 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-2 applied_at=2026-10-26T15:36:57+00:00 build_sha256=b438128b360b6c06b66d66e2da1f50f8740a4a288bb5cf1c455316e3588cd8c6 FEATURE-LogModel.md sha256=24bc9e4260d5b1979d2e6d0d7a127bd6da4eacdebb11197ce2c257f6e94f0d33 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-4 applied_at=2026-10-26T15:41:58+00:00 build_sha256=05bc8206e2123e790e17fe13d15b0ba2c6b7a3ca6e10310a216a516b72a05926 FEATURE-LogNumbers.md sha256=3d1a6516ac212aed8ef342315982a7f14e0983cfe2344bc01d8229e6dbc45326 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-4 applied_at=2026-10-26T15:41:58+00:00 build_sha256=51cdce0df4c2a3f4bc1f8ce871a7b281cc93cc25e408e0e8ab3868fd42a1e6d4 FEATURE-LogSkip.md sha256=da7caa39383e6a713c3c75330de07fbe8b4b739eb03416e2cfe72128e6c49ef2 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-3 applied_at=2026-10-26T15:39:25+00:00 build_sha256=a9274335e4b9c08559790c477748042f7585d6706404c930c36f97b4bba1254b FEATURE-ReportCommands.md sha256=d1241b1c28e61814a7d48da09c6d3ed61613d9b505c0d2a49588ee3241180769 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-9 applied_at=2026-10-26T15:57:45+00:00 build_sha256=d2d3af7433927eff39fabef140a77b0b3743df03e6a27b34f0478513571730fb FEATURE-ReportDaily.md sha256=a58ff02305d8d38a1c75249125fcc5d974c510996a3dab50619a57a2633cd5c1 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-9 applied_at=2026-10-26T15:57:45+00:00 build_sha256=bedd41f0d7d3fb5aea23ad2a4a7c8d917eb824cd6661e0172e241c1dba4cf3cf FEATURE-ReportFailures.md sha256=7837a0532da3aceee17fa421c99d1392f9d07367011ac6ba16c25d81ccf86118 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-9 applied_at=2026-10-26T15:57:45+00:00 build_sha256=0a75191cf6b20b16f432946806ae331262b15f8586c433d791d63dbb77bd6d79 FEATURE-ReportModels.md sha256=d6e531f8a2ea8cfada2efa98894326aa4b4d3700dd893cf013a36086fe4def02 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-9 applied_at=2026-10-26T15:57:45+00:00 build_sha256=2d91af15467603c0c905614a01af150a0e398d308030b86acfe025bdfacad95d FEATURE-ReportSummary.md sha256=326530cd913025164a9f861042b92153cabe6fd0207c084a0ade6c89b7faeee7 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-9 applied_at=2026-10-26T15:57:45+00:00 build_sha256=0678a3fb100a6371f262aac4930ccbe303d58078a18c5169ba977e93e2296ba8 FEATURE-ReportTargets.md sha256=2a63a2d7187ef2bab3f81208a96fee994d557aba7b3578655df5be19b8924c98 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-9 applied_at=2026-10-26T15:57:45+00:00 build_sha256=6bdb8fc9635dfb4bd75b7c492a4848d6ceea57abe011ada355973216825d4d55 FEATURE-TestScript.md sha256=61cab938ee76eba95bd757f3ff0597363dc7ea34d47d7a226b09520b2ae1579d commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-2 applied_at=2026-10-26T15:36:57+00:00 build_sha256=5986c2d89abb254002dae2f08fba6c42a439dbaff4a9e3c3cda7ce9303641e7e FEATURE-ValueFormat.md sha256=af79667e373e8005afba73b5948e559aa7fec6149f49203af18e3bd206a4d815 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-8 applied_at=2026-10-26T15:49:56+00:00 build_sha256=d6b45109685fb871402ef9990d0c957ffc3cdb70d23bc27e9bb57a7151fdc725 VERIFICATION.md sha256=a9ffce0acc5c0fd4c8d9f58f270c7c1ccbe1d098efb19aed171e8275abca7fa0 commit=e3be2f8a10e1970dbe6c31a722517ea11bbd0d3b applied_by=block-10 applied_at=2026-10-26T16:00:56+00:00 build_sha256=6ca588b2f717018db34d1b3371b6dc4698faa1fd96c2bb1f59bb7364e422556e

story 1: Stand up the Go module, directory layout and test runner every other story builds into.

id: foundation finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-1.md summary: Stand up the Go module, directory layout and test runner every other story builds into. type: foundational kind: capability phase: 1 block: 1 implements: ARCHITECTURE.md instructions: | Create the root go.mod (module path ddkstat, Go 1.22 or newer, no require lines), the cmd/ddkstat and internal/ directories, and bin/. Use only the standard library; no database; no third-party module.

ARCHITECTURE.md fixes the package ownership every later story follows: internal/logread (parse, validate, dedupe, normalize records), internal/filter (pure record filters), internal/format (minutes and cost text), internal/report (one aggregate-and-write function per report), internal/cli (Run(args []string, stdout, stderr io.Writer) int, option parsing, report registry). Only cmd/ddkstat/main.go calls os.Exit. Pipeline order: parse arguments, read log, drop skipped and duplicate lines, filter, aggregate, format. stack: common.md, go.md stack_mode: builder size: 13637 provides: go.mod, internal/, cmd/ddkstat/ acceptance: yes state: closed/implemented

story 2: Read the JSON Lines log into records, ignoring blank lines and classifying failed calls.

id: log-lines finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-2.md summary: Read the JSON Lines log into records, ignoring blank lines and classifying failed calls. type: service kind: capability phase: 1 block: 2 implements: FEATURE-LogLines.md covers: LOG-001 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6662 provides: logread.Read, logread.Record consumes: go.mod instructions: | In internal/logread, read the log with bufio.Reader (no fixed line-length limit), one JSON object per physical line. A line that is empty after trimming whitespace is blank: ignored and not counted, but it still advances the physical line number. Decode each object into a Record carrying execution_id, started_at, status, command, target, provider (job.llm), requested model, executed model, token counts, cost, elapsed_ms, returncode (nullable), timed_out. A Record is Failed when status is not "succeeded". Date is the first 10 characters of started_at. Required Go tests: TestReadBlankLines, TestReadFailedStatus, TestReadStartDate. acceptance: yes depends: foundation state: closed/implemented

story 3: Parse the report name, options and log path into a validated invocation.

id: cli-args finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-2.md summary: Parse the report name, options and log path into a validated invocation. type: service kind: capability phase: 1 block: 2 implements: FEATURE-CliArgs.md covers: CLI-001 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 7282 provides: cli.ParseArgs consumes: go.mod instructions: | In internal/cli, ParseArgs(args) returns Options{Report, Target, Since, Until, LogPath} or a usage error. The first argument is the report and must be one of summary, commands, targets, models, daily, failures. Then come --target, --since, --until each taking one value, then exactly one log path. Use a hand-rolled or local flag.FlagSet parser with ContinueOnError. An option before the report name, an unknown report or option, a missing option value, a missing log path, or an extra positional argument is a usage error. A repeated option takes its last value. Required Go tests: TestParseReportAndLog, TestParseOptions, TestParseRepeatedOptionLastWins, TestParseOptionBeforeReportIsUsageError, TestParseUnknownReport, TestParseUnknownOption, TestParseMissingValue, TestParseLogPathCount. acceptance: yes depends: foundation state: closed/implemented

story 4: Provide bin/test.sh running go vet and go test.

id: test-script finding: ADVISORY: implemented, not verified — every binding criterion this story passed was already green before the story built, so none measured the work. Repair the criteria in the Blueprint to exercise this story and rebuild to obtain a verdict. evidence: evidence/block-2.md summary: Provide bin/test.sh running go vet and go test. type: service kind: test harness phase: 1 block: 2 implements: FEATURE-TestScript.md covers: BLD-002 accepts: st-002 context: ARCHITECTURE_compact.md stack: common.md, go.md stack_mode: consumer size: 7787 provides: bin/test.sh consumes: go.mod instructions: | POSIX sh script bin/test.sh: set -eu, cd to the application root (derived from the script path), run go vet ./... then go test ./..., and exit zero only when both pass. No bashisms. Acceptance runs sh bin/test.sh and requires exit status 0. acceptance: yes depends: foundation state: closed/implemented

story 5: Skip malformed, incomplete and duplicate lines with a stderr warning and no effect on the exit code.

id: log-skip finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-3.md summary: Skip malformed, incomplete and duplicate lines with a stderr warning and no effect on the exit code. type: service kind: capability phase: 1 block: 3 implements: FEATURE-LogSkip.md covers: LOG-002 accepts: st-004 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 7239 provides: logread.Read skip rules, logread.Result.Skipped consumes: logread.Read instructions: | Extend logread.Read to return the kept records plus a whole-file skipped count. Skip a line when it is not a JSON object, when any of execution_id, started_at, status, job.command_name, job.target is absent or not a non-empty string, or when its execution_id was already registered by an earlier kept line. A skipped line writes one warning to the supplied warning writer naming its 1-based physical line number (blank lines count toward numbering). A malformed line never registers its execution_id. Duplicate detection runs over the whole file before any filter. Required Go tests: TestSkipNotObject, TestSkipMissingField, TestSkipDuplicateKeepsFirst, TestMalformedDoesNotRegisterID, TestSkipWarningLineNumber. acceptance: yes depends: log-lines state: closed/implemented

story 6: Validate --since and --until as real YYYY-MM-DD calendar dates.

id: cli-dates finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-3.md summary: Validate --since and --until as real YYYY-MM-DD calendar dates. type: service kind: capability phase: 1 block: 3 implements: FEATURE-CliDates.md covers: CLI-002 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6462 provides: cli.ParseArgs date validation consumes: cli.ParseArgs instructions: | A date option value must parse with time.Parse("2006-01-02") and round-trip to the same text; 2026-13-01, 2026-02-30, "2026-1-5" and empty values are usage errors. Valid dates pass through unchanged. Required Go tests: TestDateValid, TestDateInvalidMonth, TestDateInvalidDay, TestDateWrongShape, TestDateMissingValue. acceptance: yes depends: cli-args state: closed/implemented

story 7: Treat absent, null or non-numeric token, cost and duration values as zero.

id: log-numbers finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-4.md summary: Treat absent, null or non-numeric token, cost and duration values as zero. type: service kind: capability phase: 1 block: 4 implements: FEATURE-LogNumbers.md covers: LOG-003 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6547 provides: logread.Record numeric normalization consumes: logread.Read instructions: | Normalize input_tokens, cached_input_tokens, output_tokens, cost_usd and elapsed_ms: absent, null, or a value of the wrong JSON type counts as zero. A record with no result.stats object remains a record, and a null or absent result.returncode is represented as no returncode. Required Go tests: TestNumbersAbsentAreZero, TestNumbersNullAreZero, TestNumbersNonNumericAreZero, TestNoStatsObjectStillRecord. acceptance: yes depends: log-skip state: closed/implemented

story 8: Attribute each record to the executed model, falling back to the requested model.

id: log-model finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-4.md summary: Attribute each record to the executed model, falling back to the requested model. type: service kind: capability phase: 1 block: 4 implements: FEATURE-LogModel.md covers: LOG-004 accepts: st-007 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6274 provides: logread.Record.Model consumes: logread.Read instructions: | Record.Model is result.stats.model when present and non-empty, otherwise job.model. Required Go tests: TestModelPrefersExecuted, TestModelFallsBackWhenAbsent, TestModelFallsBackWhenEmpty, TestModelFallsBackWithoutStats. acceptance: yes depends: log-skip state: closed/implemented

story 9: Filter records by exact job.target match.

id: filter-target finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-5.md summary: Filter records by exact job.target match. type: service kind: capability phase: 1 block: 5 implements: FEATURE-FilterTarget.md covers: FLT-001 accepts: st-006 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6276 provides: filter.ByTarget consumes: logread.Record instructions: | Pure function in internal/filter: ByTarget(records, name) keeps records whose Target equals name exactly (case-sensitive); an empty name means no target filter was given. Required Go tests: TestByTargetExact, TestByTargetCaseSensitive, TestByTargetNoMatch, TestByTargetUnset. acceptance: yes depends: log-numbers, log-model state: closed/implemented

story 10: Filter records by inclusive start-date range.

id: filter-dates finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-5.md summary: Filter records by inclusive start-date range. type: service kind: capability phase: 1 block: 5 implements: FEATURE-FilterDates.md covers: FLT-002 accepts: st-006 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6519 provides: filter.ByDateRange consumes: logread.Record instructions: | Pure function in internal/filter: ByDateRange(records, since, until) keeps records whose Date is >= since and <= until, both inclusive, compared as strings; an empty bound is unset. since later than until yields an empty result without error. Required Go tests: TestSinceInclusive, TestUntilInclusive, TestRangeBothBounds, TestSinceAfterUntilEmpty, TestBoundsUnset. acceptance: yes depends: log-numbers, log-model state: closed/implemented

story 11: Assemble the Run pipeline and map failures to exit codes 0, 1 and 2.

id: cli-exit finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-6.md summary: Assemble the Run pipeline and map failures to exit codes 0, 1 and 2. type: service kind: capability phase: 1 block: 6 implements: FEATURE-CliExit.md covers: CLI-003 accepts: st-008 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 7177 provides: cli.Run, cli.Register consumes: cli.ParseArgs, logread.Read, filter.ByTarget, filter.ByDateRange instructions: | Implement Run(args, stdout, stderr) int: ParseArgs; on usage error write one usage-summary line to stderr, nothing to stdout, return 2. Open and read the log (never write to it); if it cannot be opened or read write one diagnostic line to stderr, nothing to stdout, return 1. Otherwise read records, apply ByTarget then ByDateRange, and dispatch to the report writer registered under the report name in a registry map (cli.Register(name, fn) with fn(w io.Writer, records, skipped) error); each report story registers its own writer. An unregistered report writes nothing and returns 0 until its story lands. Skip warnings go to stderr. Report-writer errors return 1 with stdout untouched (buffer output and flush only on success). Required Go tests use bytes.Buffer: TestRunUsageErrorExit2, TestRunUsageErrorWritesNothingToStdout, TestRunMissingLogExit1, TestRunMissingLogWritesNothingToStdout, TestRunSkippedLinesStillExit0, TestRunFilterOrder. acceptance: yes depends: cli-dates, log-numbers, log-model, filter-target, filter-dates state: closed/implemented

story 12: Wire the ddkstat main package and keep the module standard-library only.

id: build-exe finding: ADVISORY: implemented, not verified — every binding criterion this story passed was already green before the story built, so none measured the work. Repair the criteria in the Blueprint to exercise this story and rebuild to obtain a verdict. evidence: evidence/block-7.md summary: Wire the ddkstat main package and keep the module standard-library only. type: service kind: capability phase: 1 block: 7 implements: FEATURE-BuildExecutable.md covers: BLD-001 accepts: st-003 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6347 provides: cmd/ddkstat consumes: cli.Run instructions: | cmd/ddkstat/main.go is package main: os.Exit(cli.Run(os.Args[1:], os.Stdout, os.Stderr)) and nothing else. go build ./cmd/ddkstat from the module root must succeed and go.mod must declare no require lines. Acceptance builds through drydock_go.cli_runner and checks the exit status of an invocation with no arguments (usage error); it invokes no report command. acceptance: yes depends: cli-exit state: closed/implemented

story 13: Provide shared minutes and cost text formatters.

id: value-format finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-8.md summary: Provide shared minutes and cost text formatters. type: service kind: capability phase: 2 block: 8 implements: FEATURE-ValueFormat.md context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6330 provides: format.Minutes, format.Cost consumes: go.mod instructions: |
In internal/format: Minutes(ms int64) string computes t = (ms + 3000) / 6000 in integer division and returns t/10, ".", t%10 (95000 ms is 1.6; 0 is 0.0). Cost(usd float64) string returns fmt.Sprintf("%.4f").
Required Go tests: TestMinutesRounding (cases derived from the formula), TestMinutesZero, TestCostFourPlaces, TestCostZero. acceptance: yes depends: foundation state: closed/implemented

story 14: Write the one-row summary report.

id: report-summary finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-9.md summary: Write the one-row summary report. type: service kind: capability phase: 2 block: 9 implements: FEATURE-ReportSummary.md covers: SUM-001 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6804 provides: ddkstat summary consumes: cli.Register, format.Minutes, format.Cost, logread.Record instructions: | Header records,skipped,succeeded,failed,first,last,input_tokens,cached_tokens,output_tokens,cost_usd,minutes. One row over the filtered records; skipped is the whole-file count regardless of filters; first and last are the earliest and latest start dates (empty when no record matches); cost via format.Cost, minutes via format.Minutes. Aggregation and formatting are separate functions with Go tests. Register as "summary".
Required Go tests: TestSummaryAggregate, TestSummaryEmptyFirstLast, TestSummarySkippedIgnoresFilters, TestSummaryWrite. Reachability check goes through drydock_go.cli_runner with a log written by the test. acceptance: yes depends: cli-exit, value-format state: closed/implemented

story 15: Write the targets report with cost and a TOTAL row.

id: report-targets finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-9.md summary: Write the targets report with cost and a TOTAL row. type: service kind: capability phase: 2 block: 9 implements: FEATURE-ReportTargets.md covers: TGT-001 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6499 provides: ddkstat targets consumes: cli.Register, format.Minutes, format.Cost, logread.Record instructions: | Header target,calls,failed,input_tokens,cached_tokens,output_tokens,cost_usd,minutes. One row per target ordered by target ascending (byte order), then TOTAL. Empty match writes the header and a zero TOTAL (0.0000 cost, 0.0 minutes). Register as "targets". Required Go tests: TestTargetsOrdering, TestTargetsTotalCost, TestTargetsEmpty, TestTargetsWrite. acceptance: yes depends: cli-exit, value-format state: closed/implemented

story 16: Write the commands report with a TOTAL row.

id: report-commands finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-9.md summary: Write the commands report with a TOTAL row. type: service kind: capability phase: 2 block: 9 implements: FEATURE-ReportCommands.md covers: CMD-001 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6560 provides: ddkstat commands consumes: cli.Register, format.Minutes, logread.Record instructions: | Header command,calls,failed,input_tokens,cached_tokens,output_tokens,minutes. One row per command ordered by calls descending then command ascending (byte order), then TOTAL over all filtered records. An empty match writes the header and a TOTAL row of zeros with 0.0 minutes. Text values are written unquoted. Register as "commands". Required Go tests: TestCommandsOrdering, TestCommandsTotal, TestCommandsEmpty, TestCommandsWrite. acceptance: yes depends: cli-exit, value-format state: closed/implemented

story 17: Write the models report grouped by provider and model with a TOTAL row.

id: report-models finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-9.md summary: Write the models report grouped by provider and model with a TOTAL row. type: service kind: capability phase: 2 block: 9 implements: FEATURE-ReportModels.md covers: MOD-001 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 6781 provides: ddkstat models consumes: cli.Register, format.Cost, logread.Record instructions: | Header provider,model,calls,failed,input_tokens,cached_tokens,output_tokens,cost_usd. One row per provider (job.llm) and Record.Model pair ordered by provider then model ascending (byte order), then a TOTAL row whose model column is empty (TOTAL,,...). Empty match writes the header and a zero TOTAL row. Register as "models".
Required Go tests: TestModelsGroupingUsesExecutedModel, TestModelsOrdering, TestModelsTotalEmptyModelColumn, TestModelsEmpty, TestModelsWrite. acceptance: yes depends: cli-exit, value-format state: closed/implemented

story 18: Write the failures report listing each failed record.

id: report-failures finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-9.md summary: Write the failures report listing each failed record. type: service kind: capability phase: 2 block: 9 implements: FEATURE-ReportFailures.md covers: FAIL-001 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 8028 provides: ddkstat failures consumes: cli.Register, logread.Record instructions: | Header started_at,target,command,model,returncode,timed_out. One row per failed record ordered by started_at then execution_id ascending (byte order). returncode is empty when null or absent; timed_out is true or false; model is Record.Model. No TOTAL row; an empty match writes the header only. Register as "failures". Required
Go tests: TestFailuresOrdering, TestFailuresNullReturncodeEmpty, TestFailuresTimedOutText, TestFailuresOnlyFailed, TestFailuresEmpty. acceptance: yes depends: cli-exit, value-format state: closed/implemented

story 19: Write the daily report with token totals and a TOTAL row.

id: report-daily finding: ADVISORY: implemented, not verified — no governed acceptance command covers this story. Declare one in ACCEPTANCE.json to gate it. evidence: evidence/block-9.md summary: Write the daily report with token totals and a TOTAL row. type: service kind: capability phase: 2 block: 9 implements: FEATURE-ReportDaily.md covers: DAY-001 context: ARCHITECTURE_compact.md stack: go.md stack_mode: consumer size: 8636 provides: ddkstat daily consumes: cli.Register, format.Minutes, logread.Record instructions: | Header date,calls,failed,tokens,minutes. One row per start date ascending; tokens is input plus cached plus output tokens; then TOTAL. Empty match writes the header and a zero TOTAL row. Register as "daily". Required
Go tests: TestDailyOrdering, TestDailyTokensSum, TestDailyTotal, TestDailyEmpty, TestDailyWrite. acceptance: yes depends: cli-exit, value-format state: closed/implemented

story 20: Run the supplied grader against the finished tool as the terminal gate.

id: verification finding: ADVISORY: implemented, not verified — every binding criterion this story passed was already green before the story built, so none measured the work. Repair the criteria in the Blueprint to exercise this story and rebuild to obtain a verdict. evidence: evidence/block-10.md summary: Run the supplied grader against the finished tool as the terminal gate. type: feature kind: integration phase: 3 block: 10 implements: VERIFICATION.md covers: BLD-003 accepts: st-001, st-005 instructions: |
Assembly and intent only: every report, filter, skip rule and exit code is built by member stories. The staged sources/run.sh and sources/llm_sample.jsonl are present in the build directory unmodified. The terminal criterion declares Suite: full, runs sh sources/run.sh unfiltered, prints its captured output, and asserts exit status 0. If it fails, repair the member behavior, never the staged assets or any report answer. stack: go.md stack_mode: consumer size: 4049 consumes: ddkstat summary, ddkstat commands, ddkstat targets, ddkstat models, ddkstat daily, ddkstat failures depends: report-summary, report-commands, report-targets, report-models, report-daily, report-failures, build-exe, test-script acceptance: yes state: closed/implemented