Run artifact

workspace/targets/DupFind/ANALYSIS.md

Blueprint Analysis: drydock DupFind Uat Case

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: Module and Build

IDStoryHigh-level AC
MODBUILD-001Establish Go module at application root with main package at ./cmd/dupfindgo build ./cmd/dupfind succeeds using only the standard library
MODBUILD-002Provide POSIX bin/test.sh running go vet and go testbin/test.sh exits zero only when go vet ./... and go test ./... both pass

Feature: Directory Walk and Eligibility

IDStoryHigh-level AC
WALK-001Walk the directory recursively including hidden files and directoriesEvery regular file under the directory, including names beginning ., is considered
WALK-002Exclude symbolic links from considerationSymbolic links are neither followed nor reported
WALK-003Exclude files smaller than the minimum sizeFiles with size below --min-size (default 1) are ignored; zero-byte files are never reported

Feature: Duplicate Detection

IDStoryHigh-level AC
DUP-001Group candidate files by exact sizeOnly files sharing a size are read for hashing
DUP-002Group same-size files by SHA-256 digestFiles with identical size and digest form one group of two or more files
DUP-003Compute reclaimable bytes per groupReclaimable bytes equal size × (files − 1)
DUP-004Order groups and assign group numbersGroups ordered by reclaimable bytes descending then digest ascending; numbered from 1
DUP-005Order paths within a groupPaths relative to directory, / separator, no leading ./, byte-ascending order
DUP-006Skip unreadable files with a stderr warningUnreadable file produces one stderr warning line and does not change exit code

Feature: Command Line Interface

IDStoryHigh-level AC
CLI-001Parse --summary, --min-size <bytes>, and one directory argumentOptions precede the directory; exactly one directory is accepted
CLI-002Reject malformed arguments with exit code 2Missing or extra arguments, unknown option, or non-positive-integer --min-size exit 2 with empty stdout
CLI-003Reject missing or non-directory target with exit code 1Nonexistent path or non-directory exits 1 with empty stdout

Feature: Listing Output

IDStoryHigh-level AC
LIST-001Write CSV listing with header group,size,sha256,pathOne row per file in every duplicate group; header only when no duplicates
LIST-002Quote CSV fields per RFC 4180Fields containing comma, double quote, or newline are quoted via encoding/csv

Feature: Summary Output

IDStoryHigh-level AC
SUM-001Write summary row with header groups,duplicate_files,reclaimable_bytesSingle row totals groups, duplicate files, and reclaimable bytes; 0,0,0 when none

Story Guidance

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

None.

Surfaced Acceptance Criteria

IDStory IDCriterion
AC-001WALK-001Hidden files and directories are traversed and their regular files considered
AC-002WALK-002A symbolic link pointing at a regular file is not reported and its target is not followed
AC-003DUP-001Only files sharing a size are opened for hashing
AC-004DUP-002Digest is lowercase hexadecimal SHA-256 of full file contents
AC-005LIST-001Listing rows match header order group,size,sha256,path
AC-006SUM-001Summary duplicate_files equals sum of files − 1 across groups
AC-007CLI-002Usage errors write nothing to standard output and one diagnostic line to standard error
AC-008CLI-003Operational errors write nothing to standard output and one diagnostic line to standard error
AC-009DUP-006Unreadable file warning is written to standard error only
AC-010MODBUILD-002Test suite covers each rule, each output form, and each exit code against real temporary directories

Source Inventory

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

Relationship Model

Source or groupRelationship typeRelated source or groupEvidenceDelivery implication
sources/run.shinstruction-to-testsources/INSTRUCTIONS.mdrun.sh cites the 15 checks, the ./cmd/dupfind build target, and the exit-code table defined in INSTRUCTIONS.mdImplementation must satisfy INSTRUCTIONS.md; run.sh is the external acceptance verdict and is staged, not authored
sources/INSTRUCTIONS.mddependencyCommand, Output, Exit codes sectionsRules 1–6 define the duplicate test that drives all listing and summary outputWalk, hash, group, and output stories depend on the Rules section

Source Roles

PathRolePlan dispositionBuild disposition
sources/INSTRUCTIONS.mdauthor intentcompassprompt-only
sources/run.shconformance harnesscontextstage

Planning Instructions

Delivery Shape

The system is a single-binary Go CLI. Input: one directory path plus optional --summary and --min-size flags. Output: CSV on standard output (listing or summary) with exit codes 0, 1, or 2. Flow: parse arguments → validate directory → walk recursively → filter regular non-empty files at or above minimum size → group by size → hash same-size groups with SHA-256 → form duplicate groups → order and number → emit CSV.

Story Realization Map

Test and Acceptance Strategy

Story-scoped tests run per feature area with bounded scope. The terminal verification story depends on every implementation story and runs the full bin/test.sh suite (Suite: full). Sea Trial st-001 executes sh sources/run.sh as the sole acceptance verdict.

Sequencing and Dependencies

Build (MODBUILD-001) precedes all feature stories. CLI-001 precedes CLI-002 and CLI-003. Walk stories precede Duplicate Detection. DUP-001 precedes DUP-002. DUP-002 precedes DUP-003 and DUP-004. Listing and Summary output stories depend on DUP-004 and DUP-005. MODBUILD-002 is the terminal gate.

Source Conflicts and Gaps

Analysis Notes

generated: 2026-10-25 blueprint: /mnt/c/Users/barlo/projects/drydock/uat/DupFind/runs/20261025.174005/workspace/targets/DupFind/blueprint

Quality: Ready blockers: 0 questions: 0 features: 6 stories: 16 stack: Go 1.22+ (standard library only) display_name: not proposed short_description: not proposed

Selected behaviors (unattended policy):