← BBS SG Bank submission · All documents

Intent profile

Status: complete

Artifact: 0e0655e7-62be-4351-b2c3-b954feb6c49b

Vision

Modernize the synthetic BBS SG Bank daily COBOL batch into a one-day working prototype that preserves the legacy fixed-width flat-file ledger contract and cent-accurate behavior while eliminating the documented O(m × n) per-operation scan/rewrite bottleneck through indexed account lookups, one deterministic end-of-batch ledger write, and golden-file parity validation.

Target personas

Core features

In Scope

Out of Scope

Technical constraints

Confidence

Overall: 90%

The provided code analysis, selected recommendations, and user modernization instructions give a strong basis for extracting scope and constraints, with only minor uncertainty around exact UI/API expectations versus the narrowed selected-recommendation scope.
SectionScoreWhyHow to Improve
Vision93%The modernization objective is clearly stated and reinforced by source comments, README content, assessment findings, and selected recommendations.Confirm whether the prototype should remain COBOL-based, be reimplemented in another language, or include both baseline and modern implementations.
Target personas78%Personas are inferred from the educational modernization context rather than explicitly named user roles in the codebase.Name the exact demo and engineering users who will operate the prototype, such as developer, QA tester, stakeholder reviewer, or instructor.
Core features94%The selected assessment recommendations provide a clear authoritative scope for indexed lookups, single ledger write, and parity fixtures.Confirm whether the operator dashboard, APIs, and audit history are implementation requirements for this phase or supporting demo requirements outside the selected assessment scope.
Technical constraints93%The legacy file formats, COBOL implementation details, precision rules, performance targets, and non-production boundaries are well specified.Specify the target runtime, compiler or interpreter, operating system, and whether GnuCOBOL, Python, or another modernization stack should be used.

Modernization Analysis

Review the proposals below and select the modernization areas you want to pursue. You can reply in the chat to confirm your choices or ask follow-up questions.

Tech Stack

Language, framework, and tooling modernization

#AreaCurrentProposedRationale
1Batch processing engineSingle COBOL program in bank.cob using line-sequential flat files and repeated full-ledger scans for each operation.Introduce a modern batch engine implementation that reads accounts.dat once into an indexed in-memory account map keyed by the 8-digit account ID, processes operations sequentially, and writes the ledger once at the end of the batch while retaining the COBOL program as the parity baseline.This directly removes the documented O(m × n) I/O hotspot while preserving the external fixed-width flat-file contract and legacy business semantics.
2Ledger write strategyFor every accepted operation, bank.cob writes all account rows to accounts.tmp and then copies accounts.tmp back over accounts.dat.Accumulate accepted balance mutations in memory and perform one deterministic end-of-batch write through a same-directory temporary file followed by final replacement.A single write phase reduces file-system work, narrows mutation windows, and makes rollback and parity comparison easier to reason about.
3Record parsing and formattingFixed-width pipe-delimited layouts are embedded as COBOL substring offsets such as ops-row(1:1), ops-row(3:8), and bank-row(10:12).Define an explicit record contract for accounts.dat and operations.dat in the modern engine, preserving accounts.dat as IIIIIIIIBBBBBBBBBBBB and operations.dat as KSSSSSSSSTTTTTTTTAAAAAAAAAAAA.Making the layout explicit protects byte-identical output behavior and reduces the chance of accidental formatting drift during modernization.
4Testing frameworkNo automated tests, benchmark fixtures, or parity harness are present in the repository.Add golden-file parity tests that execute the COBOL baseline and the modern engine against the same fixtures and compare final ledger bytes, processed count, rejected count, and total cents.The modernization depends on preserving cent-accurate behavior, so executable parity tests are required before and during performance refactoring.
5Prototype API and operator visibilityThe legacy program only reads local files and prints PROCESSED, REJECTED, and TOTAL_CENTS to stdout.Expose a small prototype API and dashboard surface limited to batch execution, run status, parity results, rejection summaries, audit history, generated ledger download, and performance measurements.This supports the requested one-day demo without expanding into production banking functionality or changing the core ledger contract.

Packages & Dependencies

Dependency upgrades and vulnerability remediation

#AreaCurrentProposedRationale
1COBOL baseline compilerCompiler/runtime version is not specified in the repository.Use a pinned COBOL baseline runner such as GnuCOBOL 3.2 for local parity execution, or IBM Enterprise COBOL 6.5.x / OpenText Visual COBOL 10.0 where those environments are the chosen host.Pinning the baseline compiler makes parity results reproducible and aligns the legacy execution path with currently supported COBOL tooling.
2Golden-file and regression testsNo testing dependency or framework is present.Add a test harness using pytest 8.x for fixture-driven parity tests, including valid deposits, withdrawals, transfers, malformed rows, insufficient funds, missing accounts, self-transfers, zero amounts, and non-numeric amounts.A lightweight test framework turns the legacy ledger behavior into living specifications and reduces regression risk during the batch-engine rewrite.
3Benchmark measurementThe README mentions parity benchmarking, but no benchmark package or repeatable benchmark assets are present.Use pytest-benchmark 5.x or a small dedicated timing harness with fixture sets for 1,200 accounts × 400 operations and 5,000 accounts × 500 operations.Measured performance must be reproducible and labeled clearly, especially because the current 28.6x and 128.1x speedups are local prototype results pending independent review.
4Prototype API layerNo HTTP API package exists; the batch is invoked as a local program over files.For the one-day prototype, use FastAPI 0.115.x or later with Pydantic 2.x for typed request and response validation around batch runs, results, audit history, and parity reports.A small typed API makes the modernization testable without introducing a large application platform or implying production banking readiness.
5Prototype dashboard UINo user interface package exists.Use a minimal React 19 + Vite 7 + Tailwind CSS 4 prototype frontend for the operator dashboard and clearly labeled legacy-terminal visual simulation.This provides the requested before/after demo surface while keeping the UI lightweight and explicitly scoped to prototype observability.

Infrastructure

Hosting, orchestration, and platform modernization

#AreaCurrentProposedRationale
1Batch runtime executionThe program assumes accounts.dat, operations.dat, and accounts.tmp exist in the current working directory.Package the prototype in a reproducible local container or scripted development environment with mounted fixture directories and pinned compiler/runtime versions.A controlled runtime prevents environment drift from invalidating parity or performance results while avoiding unnecessary production infrastructure.
2Ledger publicationaccounts.dat is repeatedly rewritten during the batch through accounts.tmp for each accepted operation.Write the final ledger once to a same-directory temporary output, validate record counts and optional checksums, then replace the target ledger in a final publish step.This reduces partial-write exposure and supports explicit migration and rollback notes without changing the fixed-width ledger contract.
3CI and regression verificationNo CI/CD or automated verification is visible.Add a CI job that builds/runs the COBOL baseline, executes the modern engine, runs golden-file parity tests, and records benchmark outputs for the required fixture sizes.Automated parity gates ensure that performance improvements do not silently alter accepted/rejected behavior or final balances.
4Fixture and output managementNo benchmark fixtures, golden outputs, or structured run artifacts are present in the repository.Store synthetic fixture inputs, expected COBOL outputs, modern outputs, summaries, timings, and comparison results as versioned test artifacts.Versioned artifacts make the modernization independently reviewable and prevent benchmark claims from relying on undocumented local state.
5Audit and run historyThe batch emits only stdout summary lines and mutates the ledger file.Record prototype audit events for run started, run completed, run failed, fixture selected, ledger generated, parity executed, and performance measured.Audit history supports demo traceability and engineering review while remaining clearly labeled as prototype-level evidence, not production compliance.

Technical Capabilities

New capabilities unlocked by modernization

#AreaCurrentProposedRationale
1Indexed account lookupEach operation reopens and scans accounts.dat to find source and destination accounts.Load accounts.dat once into an indexed in-memory structure keyed by account ID and perform constant-time or logarithmic lookups during operation processing.This removes the main Data Weight bottleneck and makes performance scale with account and operation volume far more predictably.
2Single-pass operation processingThe legacy batch validates and rewrites the ledger operation by operation.Process operations sequentially against the in-memory ledger state and apply accepted mutations immediately in memory while counting rejected rows.Sequential in-memory processing preserves legacy ordering semantics while eliminating repeated full-file I/O.
3One final ledger write per batchThe entire account file is rewritten for every accepted operation.Perform one deterministic final ledger serialization after all operations are processed, preserving original account ordering and fixed-width formatting.This dramatically reduces write volume and enables byte-identical final-balance comparison against the COBOL baseline.
4Golden-file behavioral parityBehavioral rules are embedded in COBOL code and comments without executable regression coverage.Use golden fixtures to verify valid deposits, withdrawals, transfers, overdraft rejection, invalid-row rejection, missing accounts, self-transfers, zero amounts, malformed rows, final ledger output, and summary totals.Golden-file testing protects the legacy contract while allowing the implementation strategy to change.
5Measured performance reportingThe source documents an intentional scaling bottleneck, but the repository does not provide reproducible benchmark runs.Measure and report runtime for 1,200 accounts × 400 operations and 5,000 accounts × 500 operations, clearly labeling preliminary speedups as local prototype results on one host pending independent review.Transparent measurement demonstrates the value of the indexed design without overstating benchmark validity.
6Prototype run observabilityOnly PROCESSED, REJECTED, and TOTAL_CENTS are printed to stdout.Expose structured run results containing processed count, rejected count, total cents, duration, rejection summary, parity status, and generated ledger artifact references.Structured results make the batch testable through APIs and usable from the requested operator dashboard without changing ledger semantics.

Risk Register

Top risks for this modernization effort

#AreaRiskLikelihoodImpactMitigation
1Ledger behavior parityThe modern engine may subtly diverge from COBOL behavior for rejected rows, overdrafts, missing accounts, or operation ordering.highhighCreate golden fixtures for every documented acceptance and rejection case, run both COBOL and modern engines on the same inputs, and block changes unless final ledger bytes and summary counts match.
2Fixed-width formattingOutput may be numerically correct but not byte-identical because of padding, field width, newline, ordering, or delimiter differences.mediumhighDefine the account and operation record layouts explicitly, compare generated accounts.dat byte-for-byte, and include newline and ordering checks in parity tests.
3Single final write phaseA failed batch could leave a partial output or overwrite the original ledger incorrectly if the temp-file replacement is implemented poorly.mediumhighWrite to a same-directory temp file, validate record counts before publish, replace only at the final step, retain original inputs, and document rollback to the COBOL baseline.
4Performance claimsLocal speedup numbers such as 28.6x and 128.1x may be interpreted as independently validated production benchmarks.mediummediumLabel those values as local prototype results on one host pending independent review and store repeatable benchmark fixtures, commands, host details, and raw timings.
5Scope controlThe prototype could drift into production banking, compliance, identity, or real customer-data assumptions beyond the selected modernization scope.mediummediumKeep the implementation limited to synthetic fixtures, indexed batch processing, one-write ledger output, parity tests, performance reporting, and clearly labeled prototype/demo UI surfaces.