Run artifact

workspace/targets/LayersTesting/ANALYSIS.md

Blueprint Analysis: drydock Layers Testing 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: CLI Foundation

IDStoryHigh-level AC
CLI-001Provide the executable command dispatcherledger is executable, recognizes every documented command, emits CSV on success, diagnostics on failure, and uses the specified exit codes.
CLI-002Provide command usage and argument validationInvalid commands, reports, tables, and argument counts are rejected consistently, with help text available for every command and sub-verb.

Feature: Persistence and Schema

IDStoryHigh-level AC
DB-001Create and reinitialize the ledger schemaledger init drops and recreates the three tables through the shipped persistence layer and leaves them empty.
DB-002Resolve configured database storageThe application selects DATABASE_URL, then DATABASE_PATH, then data/app.db, supporting SQLite paths and PostgreSQL DSNs through the persistence boundary.

Feature: CSV Import

IDStoryHigh-level AC
LOAD-001Load validated account and category CSV filesValid account and category files load atomically and report the table and row count.
LOAD-002Load validated transaction CSV files atomicallyTransaction files validate headers, fields, references, duplicate keys, and balance rules before any write; rejected files leave all tables unchanged.

Feature: Ledger Operations

IDStoryHigh-level AC
ACCT-001Manage accountsUsers can add, get, rename, and delete accounts with correct rows, duplicate and in-use rejection, and not-found behavior.
TXN-001Post, read, amend, and delete transactionsUsers can post, get, amend, and delete transactions with generated identifiers, validation, formatted amounts, and not-found behavior.
TXN-002Enforce non-negative balancesAny posting, amendment, deletion, or load that would make an account balance negative is rejected atomically.
TRANSFER-001Execute atomic account transfersA transfer creates outgoing and incoming rows with consecutive IDs and transfer memos, or creates neither row when rejected.

Feature: Reports

IDStoryHigh-level AC
REPORT-001Report balances by accountThe balances report lists accounts in code order with transaction counts, balances, and a total row.
REPORT-002Report totals by categoryThe category report includes zero-activity categories, calculates inflow, outflow, and net values, and emits a total row.
REPORT-003Report totals by monthThe monthly report groups transactions by ascending YYYY-MM, calculates totals, and emits a total row.

Feature: Verification

IDStoryHigh-level AC
TEST-001Provide the project test runnerbin/test.sh runs the automated suite and exits zero only when every test passes.
TEST-002Pass the supplied conformance harnessThe complete supplied harness passes without modifying its assertions, fixtures, or execution sequence.

Story Guidance

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

None.

Surfaced Acceptance Criteria

IDStory IDCriterion
AC-001CLI-002The CLI shall provide discoverable help text for every command and sub-verb defined by the product contract.
AC-002DB-002When the configured database is unreachable or required tables are missing, the CLI shall report an operational failure with exit code 1 and no standard-output data.
AC-003TXN-001Transaction amounts shall be stored as integer cents and rendered with exactly two decimal places.
AC-004TXN-001Invalid calendar dates, malformed amounts, invalid codes, and invalid text lengths shall be rejected before writing.
AC-005LOAD-001A load with an unreadable file or mismatched header shall fail without changing persisted data.

Source Inventory

PathContent kindDispositionReason
sources/INSTRUCTIONS.mdmarkdownanalyzedreadable UTF-8
sources/run.shcodeanalyzedreadable UTF-8
sources/seed_accounts.csvtextanalyzedreadable UTF-8
sources/seed_categories.csvtextanalyzedreadable UTF-8
sources/seed_transactions.csvtextanalyzedreadable UTF-8
sources/seed_transactions_bad.csvtextanalyzedreadable UTF-8

Relationship Model

Source or groupRelationship typeRelated source or groupEvidenceDelivery implication
sources/INSTRUCTIONS.mdinstruction-to-testsources/run.shThe instructions define the command, data, output, and exit-code contract exercised by the harness.Build stories from the normative contract and reserve the full harness for terminal verification.
sources/run.shtest-kit-to-implementationledgerThe harness invokes the executable through schema, load, report, CRUD, transfer, error, and reinitialization phases.Every implementation story must expose the command behavior used by its scoped checks.
sources/seed_accounts.csv, sources/seed_categories.csv, sources/seed_transactions.csvfixture-to-verificationsources/run.shThe harness loads these files and compares known counts and reports.Stage all fixtures and preserve their contents.
sources/seed_transactions_bad.csvfixture-to-verificationLOAD-002, sources/run.shThe bad fixture verifies atomic rejection when a later row references an unknown account.Load validation must occur before the first write.
sources/INSTRUCTIONS.mddependencyshipped persistence libraryThe application must access relational storage only through the shipped library.Repository calls and configuration belong behind the persistence boundary.

Source Roles

PathRolePlan dispositionBuild disposition
sources/INSTRUCTIONS.mdnormative specificationprompt-onlyprompt-only
sources/run.shconformance harnesscontextstage
sources/seed_accounts.csvassetcontextstage
sources/seed_categories.csvassetcontextstage
sources/seed_transactions.csvassetcontextstage
sources/seed_transactions_bad.csvassetcontextstage

Planning Instructions

Delivery Shape

Deliver an executable Python CLI named ledger backed by the shipped relational persistence library. It consumes command arguments and CSV files, persists accounts, categories, and transactions, and emits deterministic CSV reports or diagnostics. The required flow is schema initialization, validated atomic loading, ledger mutations, reporting, and scoped tests followed by the complete conformance harness.

Story Realization Map

StoryBlueprint scopeEvidenceRelated filesDelivery kind
CLI-001command dispatch and output contractsources/INSTRUCTIONS.md, sources/run.shledgercapability
CLI-002usage and argument validationsources/INSTRUCTIONS.mdledgercapability
DB-001schema lifecyclesources/INSTRUCTIONS.md, sources/run.shpersistence packagemigration
DB-002database configuration and failure handlingsources/INSTRUCTIONS.mdpersistence packageintegration
LOAD-001account/category importssources/INSTRUCTIONS.md, seed CSVssources/seed_accounts.csv, sources/seed_categories.csvcapability
LOAD-002transaction imports and atomic validationsources/INSTRUCTIONS.md, bad fixturesources/seed_transactions.csv, sources/seed_transactions_bad.csvcapability
ACCT-001account CRUDsources/INSTRUCTIONS.md, sources/run.shledgercapability
TXN-001transaction CRUDsources/INSTRUCTIONS.md, sources/run.shledgercapability
TXN-002balance invariantsources/INSTRUCTIONS.md, sources/run.shpersistence/domain validationcapability
TRANSFER-001atomic transferssources/INSTRUCTIONS.md, sources/run.shledgercapability
REPORT-001balance reportsources/INSTRUCTIONS.md, sources/run.shledgercapability
REPORT-002category reportsources/INSTRUCTIONS.md, sources/run.shledgercapability
REPORT-003monthly reportsources/INSTRUCTIONS.md, sources/run.shledgercapability
TEST-001local automated suitesources/INSTRUCTIONS.mdbin/test.shtest harness
TEST-002full supplied verificationsources/run.shstaged harness and fixturesacceptance contract

Test and Acceptance Strategy

Each implementation story receives focused tests for its commands, validation, formatting, and persistence behavior. Feature verification remains scoped to the story under test. TEST-002 is the single terminal verification story; its acceptance assertion declares Suite: full and runs the complete supplied harness. It depends on every implementation story. TEST-001 runs the project suite only.

Sequencing and Dependencies

Create the Python and persistence foundation before command stories. Establish schema and repository contracts before imports, mutations, and reports. Implement validation before writes and fixtures before verification. Build bin/test.sh after the application test structure exists. Run the full harness only after all implementation stories and staged fixtures are complete. PostgreSQL support is an integration path; SQLite is the supplied execution path.

Source Conflicts and Gaps

No contradictory product definitions were found. The sources define a CLI, persistence model, command contract, validation rules, fixtures, and complete verification flow. Help text is not specified in detail, so its minimum discoverable coverage is surfaced for planning. No authentication, external service, UI, or sensitive-data workflow is implied.

Analysis Notes

generated: 2026-10-20 blueprint: /mnt/c/Users/barlo/projects/drydock/uat/LayersTesting/runs/20261020.191708/workspace/targets/LayersTesting/blueprint

Quality: Ready blockers: 0 questions: 0 features: 6 stories: 15 stack: Python 3.11+, SQLite, shipped persistence library, pytest, POSIX shell display_name: not proposed short_description: not proposed

Project type: cli. No unresolved cross-source conflicts or human-owned decisions remain.