Metaphi AI

Autonomous software engineer for legacy systems.

npm install -g @metaphi-ai/hum
creditcard-payment-system-co
HLD.md
1# CreditCard Payment System Co. — High Level Design (HLD)
2 
3> Source: `docs/CreditCard Payment System Co - HLD.pdf` (7 pages, C4-style: Context Diagram,
4> Container Diagram, Features/Tasks backlog). This file is the project's readable rendering of
5> that document. The two diagram pages in the PDF are embedded images; the content below is
6> taken from the document's prose, which is the authoritative text.
7 
8## Context Diagram — the two layers
9 
10The platform splits into two layers sitting side by side.
11 
12### Abstraction Infrastructure Layer (left side)
13 
14This layer serves as the gatekeeper and translation pipeline for the platform. It sits outside
15the core logic to simulate network traffic and normalize data before it hits the main systems.
16 
17- **Simulation and Mocking (Yellow):** It hosts virtual environments like the **Mastercard MIPs
18  Simulator** and **VISA VEAs Simulator**. This allows the platform to mimic real-world financial
19  traffic (authorizations and clearing files) safely without needing a live connection to payment
20  card networks.
21- **Message Normalization:** It functions as an interface layer. It accepts complex,
22  network-specific messages (like **ISO 8583** streams), unpacks them, and converts them into a
23  unified **"Common Format"** that the core system understands.
24- **Bidirectional Formatting:** It works in reverse as well. When the system needs to talk back
25  to the networks, this layer translates the internal format back into the strict ISO rules
26  required by Mastercard and VISA.
27 
28### Core Mainframe Layer (right side)
29 
30This layer is the central nervous system of the application. It acts as the secure domain-driven
31engine where the actual business rules, transactional records, and data mutations are processed
32and stored.
33 
34- **Domain-Driven Isolation:** It segments critical financial features into clear boundaries
35  (**Authorization, Financial, Chargeback, Customer, Policies, Fraud, and Rewards**) so components
36  stay modular.
37- **Hybrid Execution Model:** It manages the split-second lifecycle of a transaction by running
38  two distinct operations side-by-side:
39  - **The Real-Time Engine (Pink/Red):** Handles immediate, sub-second responses required to
40    validate credit status, check fraud policies, and safely approve or decline active checkouts.
41  - **The Asynchronous Engine (Green):** Handles the heavy background heavy-lifting like running
42    nightly billing cycles, generating points rewards, balancing ledgers, and running massive
43    file reconciliations.
44- **Data Persistence:** It holds the authoritative datastores (such as the core **Financial
45  database**, **Authorization logs**, and **Chargeback archives**) ensuring full auditing
46  capability and data integrity.
47 
48## Container Diagram — the Core Mainframe Layer's seven domains
$hum
▄▄ ▄█▘ hum 0.1.59
▄▄▟▙███▙▖ kimi-k3 · johndoe@gmail.com
▀▜█▛▙▚▖ ~/workspace/creditcard-payment-system-co
we need to add a Product that is related to an Account. Every account is linked to a Product Code. Every Product will hold parameters specific to that Product. We will implement later policies based on Products. Do what a Senior Engineer needs to do in order to add support to a Product in this system.
I'll start by exploring the repository to understand the current state of the system: the DB2 schema, account structures, and conventions, before designing the Product entity.
reading docs/HLD.md
reading core_mainframe_layer/DB2/customer_ddl.sql
I have the full picture now. Two real design forks emerged that I'll surface for SME review while I proceed on my picks.
╭ ✦ Decision Review
│ The schema already has CREDIT_CARD.PRODUCT CHAR(2) holding the card network ('VS'/'MC'), read by SCUS004, and PAYMENT_POLICY keyed by that same 'product'. These are network/brand, not the commercial Product the user now wants at account level.
│ ? Which would you pick?
│ 1. Defer rename, document collision
│ 2. Rename old PRODUCT to NETWORK now
│ a number picks · type an answer
Decisions are on the record; proceeding with my picks (dedicated PRODUCT_PARAMETER table; defer the network rename). Now the DDL: PRODUCT and PRODUCT_PARAMETER go into the Customer Domain DDL, parenting ACCOUNT.
editing core_mainframe_layer/DB2/customer_ddl.sql
writing core_mainframe_layer/src/copy/CCUS005.cpy
writing core_mainframe_layer/src/subroutines/SCUS006.cbl
harwell · run_unit temp/product_prove
3 jobs ok · PRVPRD, OAUT002, BAUT001
All three jobs green, and the prove output confirms every behavior. Verifying the batch outputs byte-for-byte against the golden files.
EOD-REPORT-MATCHES · RECEO-MATCHES
Product support is in place and proven in the sandbox.
10m 49s · 32 steps · $1.61 session
⠙ waiting for your pick · 47m 0s
[answer to your question «Which would you pick?»] Rename old PRODUCT to NETWORK now
The SME picked the rename. Executing it now: first, let me map every reference to the old PRODUCT-as-network naming.
writing core_mainframe_layer/src/subroutines/SCUS004.cbl
editing core_mainframe_layer/src/subroutines/SAUT004.cbl
harwell · run_unit temp/product_prove
3 jobs ok · PRVPRD, OAUT002, BAUT001
MSGOUT-MATCHES-BYTE-FOR-BYTE
Rename applied per your pick, and the whole estate is proven green on the renamed schema.
5m 25s · 22 steps · $2.57 session
│ ? Would you merge this as it stands?
│ 1. yes
│ 2. no
⠙ waiting for your answer · 38m 58s
answered: yes · looks good
commit everything done up until now
On development, matching the repo's type(scope): commit style. Committing the Product feature and the network rename as one coherent change set.
[development f52f872] feat(customer): add Product entity linked to Account, with per-product parameters
what next?
kimi-k3 · $2.57 · / for commands

Model routing

01Plan the Product entitykimi-k3the hardest and longest-running tasks
02Write CCUS005.cpy and SCUS006.cbldeepseek-v4-flashsub-agents on a cheaper route
03Prove it: run_unit temp/product_provesandboxcompiled and run, nothing on your machine

Model routing

Every step goes to the model that is best at it.

  • Kimi K3the hardest and longest-running tasks
  • Kimi K2.7 Codetuned for code
  • DeepSeek V4 Flashquick answers
  • GLM 5.3reasons before every answer
  • GLM 5.2quick
  • GPT‑5.6OpenAI's strongest
  • Your own hostany OpenAI‑compatible endpoint
# payments
Y
You14:20

@Humboldt Fix #003 Chargeback Management: the CICS screen that creates, reads, updates and deletes chargebacks, and lets us dispute one.

H
HumboldtAPP14:20

session started on modal

  • Read HLD backlog, DATA_CONTRACTS, COBOL_STYLE, DDL
  • Inventory existing subroutines + CICS infra
  • DDL: POLICIES, FRAUD_POLICIES, PAN_STORE
  • Fix #003 Chargeback Management CICS

Tackle your biggest challenges.

  • Mainframe modernization

    harwell · run_unit temp/product_prove · 3 jobs ok · PRVPRD, OAUT002, BAUT001

  • Java and .NET upgrades

    ▸ Upgrade pom.xml to Boot 3.5 + Java 21

  • Monolith breakups

    + banking/api/BankAccountApi.java (72 lines)

  • ERP customizations

    ✎ tests/test_module.py · test_customer_reference

  • Enterprise application development

    pull request #418 open · 2 h 21 min · $3.10

  • Application maintenance

    ◼ Fix: @PastOrPresent on birthDate, @Valid on both endpoints

Integrations.

Connect

Get started.

Get a demoAdd to Slack
npm install -g @metaphi-ai/hum