Run artifact

workspace/targets/FxRates/ANALYSIS.md

Blueprint Analysis: FxRates

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: ECB Rate Loading

IDStoryHigh-level AC
LOAD-001Initialize the rates storefxrates init creates an empty rates table, replacing any existing table.
LOAD-002Load an ECB history CSVfxrates load validates the complete file before writing, stores published rate text, replaces matching date and currency values, and reports date and rate counts.
LOAD-003Fetch and load ECB historyfxrates fetch downloads and extracts the ECB history file, then loads it with the same validation and reporting behavior; download failure exits 1.

Feature: Rates API

IDStoryHigh-level AC
API-001Report service healthGET /health returns status 200 and {"status":"ok"}.
API-002Report stored rate statisticsGET /stats returns date and rate counts and first and last publication dates, or null bounds when empty.
API-003List currencies with ratesGET /currencies returns EUR as base and currencies with stored rates in ascending order.
API-004Retrieve rates by effective dateGET /rates/{date} returns all rates for the latest publication on or before the requested date, or 404 if none exists.
API-005Retrieve latest ratesGET /rates/latest returns the latest publication's rates and identifies "latest" as the request.

Feature: Currency Conversion

IDStoryHigh-level AC
CONVERT-001Convert an amount between currenciesGET /convert uses the requested effective date or latest date, returns the exact six-decimal conversion rate and two-decimal result using half-even rounding, and returns 404 when a non-EUR currency lacks a rate.

Feature: Currency History

IDStoryHigh-level AC
HISTORY-001Retrieve currency history and statisticsGET /history/{code} returns the inclusive bounded publication points in ascending order and exact min, max, and six-decimal mean; an empty range returns zero count and null statistics, while a currency with no history returns 404.

Feature: CLI Usage and Validation

IDStoryHigh-level AC
CLI-001Report command usage errorsUnknown commands, wrong argument counts, and a non-integer port exit 2; operational file read failures exit 1 and rejected files exit 3, with no stdout on failures.

Feature: Automated Verification

IDStoryHigh-level AC
TEST-001Provide the offline automated test suitebin/test.sh runs the project's pytest suite successfully without network access, including successful and failed fetch behavior through a stubbed download.
TEST-002Verify complete supplied grader conformanceThe supplied sources/run.sh completes successfully with every grader check passing.

Story Guidance

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

None.

Surfaced Acceptance Criteria

None.

Source Inventory

PathContent kindDispositionReason
sources/INSTRUCTIONS.mdmarkdownanalyzedreadable UTF-8
sources/eurofxref-hist_2025-01.csvtextanalyzedreadable UTF-8
sources/eurofxref-hist_2025-02-03_04.csvtextanalyzedreadable UTF-8
sources/eurofxref-hist_bad.csvtextanalyzedreadable UTF-8
sources/run.shcodeanalyzedreadable UTF-8

Relationship Model

Source or groupRelationship typeRelated source or groupEvidenceDelivery implication
sources/INSTRUCTIONS.mdinstruction-to-testsources/run.shThe instructions identify run.sh as the scoring entry point; its command and HTTP checks exercise loading, errors, endpoints, effective dates, rounding, and live reload.Implement the described behavior before terminal grader verification; preserve the harness as a staged conformance asset.
sources/run.shtest-kit-to-implementationfxrates CLI and HTTP serviceThe harness invokes init, load, and serve, then checks HTTP behavior and exact output.Stories LOAD-001 through CLI-001 supply behavior verified by the terminal story.
sources/INSTRUCTIONS.mddependencysources/eurofxref-hist_2025-01.csv, sources/eurofxref-hist_2025-02-03_04.csv, sources/eurofxref-hist_bad.csvThe instructions define these as read-only scoring assets; the harness loads the good files and rejects the bad file.Stage the fixtures unchanged so loading and grader behavior can be verified.
sources/INSTRUCTIONS.mddependencygenerated relational layer and shipped persistence libraryThe database section mandates all database access through the generated relational layer and shipped library.Planning must establish repository-call contracts for persisted operations; application code must use the shipped boundary.
sources/INSTRUCTIONS.mdimplementation-to-helperbin/test.sh and pytest suiteThe instructions require an offline test suite and stubbed fetch tests.Keep tests bounded to their feature stories; terminal verification runs the supplied full grader.

Source Roles

PathRolePlan dispositionBuild disposition
sources/INSTRUCTIONS.mdnormative specification and conformance test suiteprompt-onlynone
sources/run.shconformance harnesscontextstage
sources/eurofxref-hist_2025-01.csvassetcontextstage
sources/eurofxref-hist_2025-02-03_04.csvassetcontextstage
sources/eurofxref-hist_bad.csvassetcontextstage

Planning Instructions

Delivery Shape

A Python command-line loader and FastAPI JSON service use the shared rates store. The CLI initializes the store, validates and loads local ECB CSV files, and can fetch and load the ECB archive. The service exposes health, store statistics, currency listing, effective-date rates, conversion, and bounded history. The end-to-end flow is initialize, load January data, start the service, request data locally, and verify live visibility after a later file load.

Story Realization Map

Story IDDurable Blueprint scopeEvidenceRelated filesRequires
LOAD-001Initialize the rates storesources/INSTRUCTIONS.md Database and Command line; sources/run.sh A1sources/run.shcapability
LOAD-002Validate and load ECB history CSVssources/INSTRUCTIONS.md ECB history file rules; sources/run.sh A2–A5, L1three CSV fixtures, sources/run.shcapability, integration
LOAD-003Fetch and load ECB historysources/INSTRUCTIONS.md fetch behavior and stubbed-download requirementsources/run.sh contextcapability, integration
API-001Health endpointsources/INSTRUCTIONS.md HTTP API; sources/run.sh H1sources/run.shcapability
API-002Store statistics endpointsources/INSTRUCTIONS.md HTTP API; sources/run.sh H2, L2sources/run.shcapability
API-003Currency listing endpointsources/INSTRUCTIONS.md HTTP API; sources/run.sh H3sources/run.shcapability
API-004Effective-date rate endpointsources/INSTRUCTIONS.md HTTP API; sources/run.sh H4–H7, L4January fixture, sources/run.shcapability
API-005Latest rates endpointsources/INSTRUCTIONS.md HTTP API; sources/run.sh H8, L3sources/run.shcapability
CONVERT-001Currency conversion endpointsources/INSTRUCTIONS.md HTTP API values and errors; sources/run.sh H9–H16January fixture, sources/run.shcapability
HISTORY-001Currency history endpointsources/INSTRUCTIONS.md HTTP API; sources/run.sh H17–H21, L5CSV fixtures, sources/run.shcapability
CLI-001CLI usage and validation behaviorsources/INSTRUCTIONS.md Command line exit codes; sources/run.sh U1–U4, A4–A5sources/run.shcapability
TEST-001Offline automated testssources/INSTRUCTIONS.md Tests and fetch rulestest suite, stubbed fetchtest harness
TEST-002Complete grader conformancesources/INSTRUCTIONS.md Run Harness; sources/run.shall implementation stories and staged assetsacceptance contract

Test and Acceptance Strategy

Use focused pytest coverage for each story's CLI or API behavior. Stub fetch downloads so automated tests remain offline and cover both successful loading and operational download failure. Use sources/run.sh as the terminal full-suite verification; TEST-002 depends on every implementation story and runs the complete harness. All other stories remain scoped to their own behavior.

Sequencing and Dependencies

Implement the store boundary and its stable repository-call contracts before persisted CLI and API behavior. Initialize and CSV load precede API stories that read rates. CLI error handling applies across commands. Fetch reuses the load behavior and can follow CSV loading. Focused tests follow their behavior; complete grader verification follows all implementation stories. Stage all three CSV fixtures and sources/run.sh unchanged.

Source Conflicts and Gaps

No conflicting source definitions or human-owned decisions remain. The instructions select Python 3.11+, FastAPI, uvicorn, SQLite, pytest, and TestClient; the product has no human-facing UI or protected resource requiring an auth decision. The load and fetch failures have explicit exit behavior; no separate deployment target is stated beyond local execution on 127.0.0.1.

Analysis Notes

generated: 2026-10-26 blueprint: /mnt/c/Users/barlo/projects/drydock/uat/FxRates/runs/20261026.202600/workspace/targets/FxRates/blueprint

Quality: Ready blockers: 0 questions: 0 features: 6 stories: 13 stack: Python 3.11+, FastAPI, uvicorn, SQLite, pytest, TestClient display_name: not proposed short_description: not proposed

None.