Run artifact

workspace/targets/DrydockStats/blueprint/FEATURE-CLI.md

FEATURE: Command-Line Delivery

FieldValue
Version20261024 V1
DescriptionDefines the command-line interface, error behavior, and Go test runner.
Depends OnFEATURE-LogIntake.md, FEATURE-Reports.md
Provides./cmd/ddkstat, bin/test.sh
Consumeslog parsing, record validation, duplicate detection, target and date filtering, summary, commands, targets, models, daily, failures CSV reports

Purpose

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

Command

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

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

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

Error behavior

Test runner

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

Programmatic Acceptance

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

import os import subprocess import sys

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

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

import os import subprocess import sys

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

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

import os import subprocess import sys

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

User Acceptance

Guardrails