Skip to content

Add ApexTrust Banking single-file MVP, specs, docs, and deployment/test plans#3

Open
support371 wants to merge 2 commits into
mainfrom
codex/execute-rebranding-and-mvp-implementation-plan
Open

Add ApexTrust Banking single-file MVP, specs, docs, and deployment/test plans#3
support371 wants to merge 2 commits into
mainfrom
codex/execute-rebranding-and-mvp-implementation-plan

Conversation

@support371

@support371 support371 commented Feb 26, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Rebrand and converge the project into an institutional single-file MVP named ApexTrust Banking with clear naming conventions (APT-, apextrust_*) and audit/compliance focus.
  • Provide an executable demo entrypoint and authoritative product requirements to reduce drift between docs and implementation.
  • Surface operational artifacts (deployment checklist, test plan, task proposals) to support release readiness and follow-up work.

Description

  • Add a self-contained demo web app at app/index.html implementing signup provisioning, region-specific account rails, deposit quote/expiry/settlement, ledger-derived balances, KYC workflow, card eligibility (GEM-ATR), ratings, incidents, compliance center, append-only audit chain with hash verification, JSON exports, and admin surfaces.
  • Add SPEC.md capturing the MVP requirements, data model, acceptance criteria, and branding/naming rules.
  • Add AGENT_TASKS.md with a phased task plan and DEPLOYMENT.md template documenting release metadata, pre-deploy checklist, and rollback guidance.
  • Add docs/TEST_PLAN.md with a manual smoke test checklist and update TASK_PROPOSALS.md and README.md to reflect the ApexTrust branding and quick-start instructions.

Testing

  • No automated tests were executed as part of this change; a smoke test plan was added at docs/TEST_PLAN.md to guide manual verification.
  • The single-file demo is intended to be runnable by opening app/index.html and exercising the manual smoke checklist.
  • JSON export and audit integrity behaviors are exercised by the UI export buttons and the built-in verifyAudit() function documented in the app.
  • CI or automated checks for docs-to-artifact consistency are proposed in TASK_PROPOSALS.md but not yet implemented.

Codex Task

Summary by Sourcery

Introduce the ApexTrust Banking single-file MVP demo with aligned specifications, branding, and operational artifacts for deployment and manual testing.

New Features:

  • Add a self-contained institutional banking demo web app at app/index.html with client and admin flows for accounts, deposits, KYC, cards, compliance, incidents, ratings, and audit logging.
  • Define the ApexTrust Banking MVP product specification, requirements, and data model in SPEC.md.
  • Provide an agent task plan in AGENT_TASKS.md outlining phased delivery of the ApexTrust Banking MVP.
  • Add a deployment tracker template in DEPLOYMENT.md to capture release metadata, checklists, and rollback procedures.
  • Introduce a manual smoke test plan in docs/TEST_PLAN.md for validating core ApexTrust Banking flows.

Enhancements:

  • Rework README.md to describe ApexTrust Banking, its quick-start entrypoint, core documentation, and current vs. future architecture.
  • Refine TASK_PROPOSALS.md to focus on ApexTrust Banking documentation consistency, quick-start validation, roadmap alignment, and CI doc checks.

Tests:

  • Document a structured manual smoke test checklist for the ApexTrust Banking MVP covering navigation, signup, deposits, KYC, cards, compliance, incidents, and exports.

Open with Devin

@sourcery-ai

sourcery-ai Bot commented Feb 26, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduce the ApexTrust Banking single-file institutional demo MVP with a self-contained web app, backed by formal product specs and operational docs for deployment, testing, and follow-up work, along with updated task proposals and README branding.

Sequence diagram for client signup and auto-provisioning flow

sequenceDiagram
  actor Client
  participant UI as BrowserUI
  participant App as ApexTrustApp
  participant State
  participant Audit as AuditLog

  Client->>UI: Fill signup form (name, email, password, region)
  Client->>UI: Click Create Client Profile
  UI->>App: signup(name, email, password, region)
  App->>State: Validate unique email
  App->>State: Create User(role=client, region)
  App->>State: Create KycRecord(status=pending)
  App->>App: provisionAccount(user)
  App->>State: Add region-specific Account
  App->>State: Set Session.currentUserId
  App->>Audit: log(action=signup, payload={userId, region})
  App->>State: saveState() to localStorage
  App-->>UI: Navigate to dashboard
  UI-->>Client: Show ledger KPIs, KYC status, reference code
Loading

Sequence diagram for deposit quote, expiry, settlement, and ledger update

sequenceDiagram
  actor Client
  participant UI as BrowserUI
  participant App as ApexTrustApp
  participant State
  participant Audit as AuditLog

  Client->>UI: Enter deposit amount
  Client->>UI: Click Create Quote
  UI->>App: createDepositQuote(amount)
  App->>State: Compute fee and net
  App->>State: Create Deposit(status=quoted, expiresAt)
  App->>Audit: log(action=deposit_quote, payload={amount})
  App->>State: saveState()
  App-->>UI: Render quote with expiry and memo instructions

  Client->>UI: Click Settle on quoted deposit
  UI->>App: settleDeposit(depositId)
  App->>State: Load Deposit by id
  App->>App: checkExpiry(expiresAt)
  alt Quote expired
    App->>State: Update Deposit.status=expired
    App->>Audit: log(action=deposit_expired, payload={depositId})
    App->>State: saveState()
    App-->>UI: Show expired status
  else Quote valid
    App->>State: Update Deposit.status=settled
    App->>State: Append LedgerEntry(type=deposit_settlement, direction=credit, amount=net)
    App->>Audit: log(action=deposit_settled, payload={depositId, net})
    App->>State: saveState()
    App-->>UI: Redirect to dashboard with updated balance
  end
Loading

Sequence diagram for card eligibility, issuance, and purchase impact on ledger

sequenceDiagram
  actor Client
  participant UI as BrowserUI
  participant App as ApexTrustApp
  participant State
  participant Audit as AuditLog

  Client->>UI: Open Cards view
  UI->>App: loadCards()
  App->>State: Read User, KycRecord, LedgerEntry
  App->>App: cardEligibility(user)
  App-->>UI: Show blockers or Issue Card button

  alt All eligibility conditions met
    Client->>UI: Click Issue Card
    UI->>App: issueCard()
    App->>State: Create Card(status=active, last4)
    App->>Audit: log(action=card_issued, payload={clientId})
    App->>State: saveState()
    App-->>UI: Show issued card

    Client->>UI: Click Simulate $25 Purchase
    UI->>App: simulateCardPurchase(cardId)
    App->>State: Load Card
    App->>State: Append LedgerEntry(type=card_purchase, direction=debit, amount=25)
    App->>Audit: log(action=card_purchase, payload={cardId, amount})
    App->>State: saveState()
    App-->>UI: Redirect to dashboard with reduced balance
  else Eligibility blocked
    UI-->>Client: Display reasons (KYC, portfolio, region)
  end
Loading

Sequence diagram for audit log tamper detection and verification

sequenceDiagram
  actor Admin
  participant UI as BrowserUI
  participant App as ApexTrustApp
  participant State
  participant Audit as AuditLog

  Admin->>UI: Open Settings or Admin Audit view
  UI->>App: verifyAudit()
  App->>State: Iterate AuditEntry list
  loop For each entry from second to last
    App->>Audit: Compare current.prevHash with previous.hash
    App->>Audit: Recompute hash from entry fields
  end
  alt All links and hashes match
    App-->>UI: Return status OK
  else Mismatch detected
    App-->>UI: Return status CHECK
  end
  UI-->>Admin: Display Audit Integrity pill (OK or CHECK)

  Admin->>UI: Click Tamper Audit Entry (test)
  UI->>App: tamperAuditEntry()
  App->>State: Mutate stored AuditEntry.actor
  App->>State: saveState()
  Admin->>UI: Re-run Verify Integrity
  UI->>App: verifyAudit()
  App-->>UI: Return status CHECK
  UI-->>Admin: Highlight audit chain failure
Loading

ER diagram for ApexTrust Banking MVP data model

erDiagram
  USERS {
    string id
    string name
    string email
    string password
    string role
    string region
    string referenceCode
  }

  ACCOUNTS {
    string id
    string clientId
    string region
    string rail
    string routing
    string sortCode
    string account
    string clabe
    string pixKey
    string iban
    string bic
    string createdAt
  }

  KYC_RECORDS {
    string id
    string clientId
    string status
    string updatedAt
  }

  KYC_DOCUMENTS {
    string kycRecordId
    string name
    string submittedAt
  }

  DEPOSITS {
    string id
    string clientId
    number amount
    number fee
    number net
    number rate
    string status
    string expiresAt
    string createdAt
  }

  CARDS {
    string id
    string clientId
    string last4
    string status
    string createdAt
  }

  LEDGER_ENTRIES {
    string id
    string clientId
    string type
    number amount
    string currency
    string direction
    string ts
    string source
  }

  RATINGS {
    string id
    string clientId
    number reliability
    number support
    number transparency
    string assertion
    string comment
    string createdAt
  }

  INCIDENTS {
    string id
    string severity
    string status
    string impact
    string mitigation
    string rca
    string createdAt
    string updatedAt
    string resolvedAt
    string owner
  }

  COMPLIANCE_POSTURE {
    string id
    string kycAml
    string sanctions
    string dataProtection
    string incidentResponse
    string changeMgmt
    string vendorRisk
    string uptime
    string latency
    string errorRate
    string lastDeploy
    string lastIncident
  }

  AUDIT_ENTRIES {
    string id
    string ts
    string actor
    string action
    string payload
    string prevHash
    string hash
  }

  CONSENTS {
    string id
    string clientId
    string version
    string ts
  }

  USERS ||--o{ ACCOUNTS : owns
  USERS ||--o{ KYC_RECORDS : has
  KYC_RECORDS ||--o{ KYC_DOCUMENTS : includes
  USERS ||--o{ DEPOSITS : funds
  USERS ||--o{ CARDS : holds
  USERS ||--o{ LEDGER_ENTRIES : balanceFrom
  USERS ||--o{ RATINGS : rates
  USERS ||--o{ CONSENTS : accepts
  DEPOSITS ||--o{ LEDGER_ENTRIES : settlesInto
  CARDS ||--o{ LEDGER_ENTRIES : charges
  COMPLIANCE_POSTURE ||--o{ INCIDENTS : records
  USERS ||--o{ AUDIT_ENTRIES : actor
Loading

Class diagram for ApexTrust Banking single-file MVP state and domain model

classDiagram
  class ApexTrustApp {
    +string storageKey
    +State state
    +string currentRoute
    +loadState()
    +saveState()
    +getCurrentUser() User
    +isAdmin() bool
    +log(action, payload)
    +verifyAudit() string
    +provisionAccount(user)
    +render()
  }

  class State {
    +User[] users
    +Session sessions
    +Account[] accounts
    +KycRecord[] kyc
    +Deposit[] deposits
    +Card[] cards
    +LedgerEntry[] ledger
    +Rating[] ratings
    +Incident[] incidents
    +CompliancePosture compliance
    +AuditEntry[] audit
    +Consent[] consents
  }

  class Session {
    +string currentUserId
  }

  class User {
    +string id
    +string name
    +string email
    +string password
    +string role
    +string region
    +string referenceCode
  }

  class Account {
    +string id
    +string clientId
    +string region
    +string rail
    +string routing
    +string sortCode
    +string account
    +string clabe
    +string pixKey
    +string iban
    +string bic
    +string createdAt
  }

  class KycRecord {
    +string id
    +string clientId
    +string status
    +KycDocument[] documents
    +string updatedAt
  }

  class KycDocument {
    +string name
    +string submittedAt
  }

  class Deposit {
    +string id
    +string clientId
    +number amount
    +number fee
    +number net
    +number rate
    +string status
    +string expiresAt
    +string createdAt
  }

  class Card {
    +string id
    +string clientId
    +string last4
    +string status
    +string createdAt
  }

  class LedgerEntry {
    +string id
    +string clientId
    +string type
    +number amount
    +string currency
    +string direction
    +string ts
    +string source
  }

  class Rating {
    +string id
    +string clientId
    +number reliability
    +number support
    +number transparency
    +string assertion
    +string comment
    +string createdAt
  }

  class Incident {
    +string id
    +string severity
    +string status
    +string impact
    +string mitigation
    +string rca
    +string createdAt
    +string updatedAt
    +string resolvedAt
    +string owner
  }

  class CompliancePosture {
    +string kycAml
    +string sanctions
    +string dataProtection
    +string incidentResponse
    +string changeMgmt
    +string vendorRisk
    +string uptime
    +string latency
    +string errorRate
    +string lastDeploy
    +string lastIncident
  }

  class AuditEntry {
    +string id
    +string ts
    +string actor
    +string action
    +any payload
    +string prevHash
    +string hash
  }

  class Consent {
    +string id
    +string clientId
    +string version
    +string ts
  }

  ApexTrustApp o-- State
  State o-- Session
  State o-- User
  State o-- Account
  State o-- KycRecord
  State o-- Deposit
  State o-- Card
  State o-- LedgerEntry
  State o-- Rating
  State o-- Incident
  State o-- CompliancePosture
  State o-- AuditEntry
  State o-- Consent

  User "1" --> "*" Account : owns
  User "1" --> "1" KycRecord : has
  User "1" --> "*" Deposit : creates
  User "1" --> "*" Card : holds
  User "1" --> "*" LedgerEntry : balanceFrom
  User "1" --> "*" Rating : submits
  User "1" --> "*" Consent : records

  Deposit "1" --> "*" LedgerEntry : settlement
  Card "1" --> "*" LedgerEntry : purchases
  ApexTrustApp --> AuditEntry : log
  ApexTrustApp --> AuditEntry : verifyAudit
Loading

File-Level Changes

Change Details Files
Add a self-contained single-file ApexTrust Banking demo app implementing client and admin flows with auditability, compliance surfaces, and JSON exports.
  • Implement a single-page HTML app with embedded CSS/JS and navigation-driven views for client and admin areas.
  • Model in-memory state persisted via localStorage using ApexTrust-prefixed keys for users, accounts, KYC, deposits, ledger, cards, ratings, incidents, compliance posture, audit chain, and consents.
  • Implement signup provisioning that assigns client role, region-specific rails, immutable reference code, and KYC record plus account provisioning.
  • Add deposit quote creation with fee/net calc, expiries, settlement simulation into ledger, and reference-code memo instructions.
  • Provide KYC workflow with document submission for clients and approve/reject controls for admins, gating card eligibility.
  • Add GEM-ATR-style card eligibility rules, issuance, freeze/unfreeze, card purchases, and ledger integration.
  • Implement a derived-portfolio ledger, client/admin dashboards, and role-based visibility (RLS-like filtering).
  • Implement append-only hash-chained audit log, integrity verification, and multiple JSON export endpoints (user pack, ratings, incidents, compliance, audit).
app/index.html
Formalize ApexTrust Banking product requirements, flows, and data model in a specification document.
  • Define branding and naming rules including ApexTrust Banking name, APT- reference codes, and apextrust localStorage prefixes.
  • Enumerate required client and admin pages and their responsibilities.
  • Specify core functional requirements across signup, regions/rails, deposits, KYC, cards, ledger, audit, and RLS behavior.
  • Describe compliance, ratings, incidents, and reporting modules plus required JSON exports.
  • Capture entities and relationships in a demo data model and list acceptance criteria and out-of-scope items for the MVP.
SPEC.md
Introduce operational deployment and testing documentation for the MVP.
  • Add a deployment tracker template with release metadata, pre-deploy checklist, validation, rollback, and redeploy sections.
  • Provide a manual smoke test plan that walks through navigation, signup/provisioning, deposits/ledger, KYC/cards, compliance, incidents, and exports.
  • Define a phased agent task plan covering branding, core journeys, trust controls, governance/audit, and QA/release readiness.
DEPLOYMENT.md
docs/TEST_PLAN.md
AGENT_TASKS.md
Rebrand the project to ApexTrust Banking and update follow-up task proposals toward docs/entrypoint consistency and quality.
  • Update README to ApexTrust Banking branding, document quick-start instructions pointing to app/index.html with admin credentials, and link to core docs, deployment, and test plan.
  • Revise task proposals to focus on documentation polish and naming consistency, quick-start validation around app/index.html, roadmap vs implementation alignment, and future CI checks for docs-to-artifact consistency.
README.md
TASK_PROPOSALS.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@support371
support371 marked this pull request as ready for review February 26, 2026 04:58
sourcery-ai[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment thread app/index.html
Comment on lines +392 to +398
download('apextrust-user-transparency-pack.json', {
user: me,
kyc: state.kyc.find(k => k.clientId === me.id),
accounts: state.accounts.filter(a => a.clientId === me.id),
deposits: state.deposits.filter(d => d.clientId === me.id),
ledger: state.ledger.filter(l => l.clientId === me.id)
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 User Transparency Pack export leaks plaintext password

When a user clicks "Export User Transparency Pack" on the Compliance Center page, the downloaded JSON file includes the user's plaintext password.

Root Cause

At app/index.html:392, the export serializes the full me object (user: me), which is the raw user record from state.users. This record includes the password field (see the user schema at app/index.html:65 and signup at app/index.html:187).

The exported JSON will contain:

{
  "user": {
    "id": "u_abc",
    "name": "John",
    "email": "john@example.com",
    "password": "mysecretpassword",
    ...
  },
  ...
}

Impact: Any user who exports their transparency pack and shares or stores the file will have their password exposed in cleartext. This is especially problematic since the export is framed as a "transparency pack" that users might share with third parties.

Suggested change
download('apextrust-user-transparency-pack.json', {
user: me,
kyc: state.kyc.find(k => k.clientId === me.id),
accounts: state.accounts.filter(a => a.clientId === me.id),
deposits: state.deposits.filter(d => d.clientId === me.id),
ledger: state.ledger.filter(l => l.clientId === me.id)
});
download('apextrust-user-transparency-pack.json', {
user: { id: me.id, name: me.name, email: me.email, role: me.role, region: me.region, referenceCode: me.referenceCode },
kyc: state.kyc.find(k => k.clientId === me.id),
accounts: state.accounts.filter(a => a.clientId === me.id),
deposits: state.deposits.filter(d => d.clientId === me.id),
ledger: state.ledger.filter(l => l.clientId === me.id)
});
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant