Run artifact

workspace/targets/DrydockStats/ANALYSIS.md

Blueprint Analysis: DrydockStats

Commander Expectations

Crew

CrewCharge
CommanderDefines intent and decides what done means.
Team LeadConfirms epic completeness and stakeholder expectations.
Planning CrewAuthors atomic specifications and the ordered Manifest.
Shipyard CrewBuilds the tickets without synchronous Commander access.

Story List

Feature: Log Intake

IDStoryHigh-level AC
INTAKE-001Read and validate JSON Lines recordsBlank lines are ignored; malformed, incomplete, and duplicate records are skipped with a line-number warning, and skipped counts are retained for summary.
INTAKE-002Apply Target and date filtersTarget matching is exact; inclusive start-date filters apply to every report, while summary skipped count covers the whole file.

Feature: Report Generation

IDStoryHigh-level AC
REPORT-001Generate summary reportSummary contains filtered record counts, skipped count, success and failure counts, date bounds, token totals, cost, and rounded minutes.
REPORT-002Generate command and Target reportsGrouped reports include calls, failures, token totals, and minutes; Target report also includes cost, and rows follow the specified ordering.
REPORT-003Generate provider and model reportRows group by provider and executed model when present, otherwise requested model; include calls, failures, token totals, and cost in the specified ordering.
REPORT-004Generate daily reportRows group by start date and include calls, failures, token totals, and minutes in ascending date order.
REPORT-005Generate failures reportFailed records are listed by start time and execution ID, with nullable return code rendered empty and timeout rendered as a boolean.

Feature: Command-Line Delivery

IDStoryHigh-level AC
CLI-001Handle command usage and operational errorsValid invocations run the requested report; malformed arguments exit 2 and unreadable logs exit 1, with no standard output on either error.
CLI-002Provide build, test, and conformance verificationThe Go module builds the command using only the standard library; bin/test.sh runs vet and all automated tests, and the supplied grader passes every case.

Story Guidance

Named stories planning must produce. Authoritative record: STORY_GUIDANCE.json.

None.

Surfaced Acceptance Criteria

IDStory IDCriterion
AC-001INTAKE-001Missing or null token counts, cost, and duration contribute zero; records without a stats object remain valid.
AC-002REPORT-001Minutes are rounded to tenths using the specified integer formula, and cost is formatted to exactly four decimal places.
AC-003REPORT-002Command rows sort by calls descending then command ascending; Target rows sort by Target ascending.
AC-004REPORT-003Provider/model rows sort by provider then model ascending; total rows and empty-result output follow the required CSV format.
AC-005REPORT-004Empty-result reports include headers and zero totals where the report defines a total row; summary has empty first/last dates when no records match.
AC-006CLI-001Every report emits CSV with \n line endings; failing commands emit one diagnostic line to standard error.

Source Inventory

PathContent kindDispositionReason
sources/INSTRUCTIONS.mdmarkdownanalyzedreadable UTF-8
sources/llm_sample.jsonltextanalyzedreadable UTF-8
sources/run.shcodeanalyzedreadable UTF-8

Relationship Model

Source or groupRelationship typeRelated source or groupEvidenceDelivery implication
sources/INSTRUCTIONS.mdinstruction-to-testsources/run.shInstructions identify the supplied script as scoring entry point and define expected report behavior.Implement the documented interface and output; the terminal verification story runs the supplied grader.
sources/run.shtest-kit-to-implementation./cmd/ddkstatGrader builds the command and compares report exit codes and stdout.Build the executable before full conformance verification.
sources/llm_sample.jsonldependencysources/run.shGrader reads the synthetic sample log for its known-answer checks.Stage the sample with the grader; it is a fixture, not an implementation story.
sources/INSTRUCTIONS.mddependencybin/test.shInstructions require a POSIX script running go vet ./... and go test ./....Implement automated tests and the test runner; the terminal verification story depends on implementation stories.

Source Roles

PathRolePlan dispositionBuild disposition
sources/INSTRUCTIONS.mdauthor intentcontextprompt-only
sources/llm_sample.jsonlassetcontextstage
sources/run.shconformance harnesscontextstage

Planning Instructions

Delivery Shape

A Go command-line reporter reads a JSON Lines execution log, skips blank and invalid or duplicate records, applies optional Target and inclusive date filters, then writes one of six CSV reports to standard output. The execution flow is argument validation, log reading and record validation, filtering, aggregation, report formatting, and output. The summary retains the whole-file skipped count.

Story Realization Map

Story IDDurable Blueprint scopeEvidenceRelated filesDelivery need
INTAKE-001JSON Lines parsing and validationsources/INSTRUCTIONS.md rules 1–3sources/llm_sample.jsonlCapability and focused parser tests
INTAKE-002Target and date filteringsources/INSTRUCTIONS.md Command and rule 6sources/llm_sample.jsonlCapability and focused filter tests
REPORT-001Summary aggregation and CSV outputsources/INSTRUCTIONS.md Output: summarysources/run.shCapability and focused report tests
REPORT-002Command and Target aggregation and CSV outputsources/INSTRUCTIONS.md Output: commands and targetssources/run.shCapability and focused report tests
REPORT-003Provider/model aggregation and CSV outputsources/INSTRUCTIONS.md Model rule and Output: modelssources/run.shCapability and focused report tests
REPORT-004Daily aggregation and CSV outputsources/INSTRUCTIONS.md Output: dailysources/run.shCapability and focused report tests
REPORT-005Failure record selection and CSV outputsources/INSTRUCTIONS.md Failed rule and Output: failuressources/run.shCapability and focused report tests
CLI-001Argument parsing, exit codes, and diagnosticssources/INSTRUCTIONS.md Command and Exit codessources/run.shCapability and focused CLI tests
CLI-002Module build, test script, and complete grader verificationsources/INSTRUCTIONS.md Stack and Tests; sources/run.shsources/run.sh, sources/llm_sample.jsonlTest harness and terminal acceptance contract

Test and Acceptance Strategy

Keep parser, filter, report, and CLI checks focused within their stories. CLI-002 is the sole terminal verification story; it depends on every implementation story and runs the complete supplied grader. The Sea Trial verifies the same full grader by its exit status. bin/test.sh independently runs vet and the complete Go test suite.

Sequencing and Dependencies

Implement parsing before filtering and aggregation. Implement the report aggregations and CLI error handling before terminal verification. The module and executable must build before either test runner or grader runs. Stage the grader and its sample fixture together.

Source Conflicts and Gaps

None.

Analysis Notes

generated: 2026-10-24 blueprint: /mnt/c/Users/barlo/projects/drydock/uat/DrydockStats/runs/20261024.141859/workspace/targets/DrydockStats/blueprint

Quality: Ready blockers: 0 questions: 0 features: 3 stories: 9 stack: Go 1.22 or newer; standard library only display_name: not proposed short_description: not proposed

None.