VICTOR SHIH

Engineering Projects

Specification-driven software architectures, resilient execution pipelines, and pragmatic AI workflow automation.

PRODUCTION PLATFORM Architecture: Evidence-Based Execution & Telemetry

Trading Systems Research & Automated Execution Platform

Engineering Philosophy: Built to address automated trading as a systems engineering and data-integrity challenge rather than a standalone backtesting exercise. A profitable backtest alone does not prove system readiness—real-world architectures must handle stale market data, ambiguous execution states, transaction costs, and restart recovery before promotion.

Key Systems & Architectural Decisions:

  • Fail-Closed Data Validation: Stream continuity and freshness checks quarantine delayed or out-of-sequence market data rather than silently evaluating corrupted state.
  • Hypothesis vs. Execution Decoupling: Strictly separates signal generation from execution modeling so evaluation outcomes never depend on optimistic hidden fill assumptions.
  • Authoritative Append-Only Journal: Every runtime decision and order transition is persisted to a SHA-256 hash-chained event journal. Local SQLite databases and dashboards operate as rebuildable projections.
  • Hard Risk & Policy Gates: Enforces portfolio exposure ceilings, asset-specific notional safety buffers, and isolated position lifecycle boundaries that block actions when breached.
  • Evidence-Based Promotion Workflow: Requires hypotheses to pass frozen out-of-sample evaluation, deterministic simulation, and long-running shadow observation prior to promotion.
Python 3 WebSocket & REST Clients Event Sourcing (SHA-256) SQLite3 (WAL / Immutable) Deterministic Simulation Systemd Service TradingView Lightweight Charts
Live Quant Execution Terminal

Live execution telemetry displaying dynamic portfolio exposure, policy gate status, and multi-asset market radar.

AI WORKFLOW AUTOMATION Make.com • Google Gemini AI • Google Drive & Sheets

NZ Receipt AI Automation Pipeline & Automated BI Reporting

Compare vs. Native App ↓

Pragmatic Automation Approach: Built as an architectural counterpart to the native Android app to evaluate rapid delivery via multimodal AI orchestration. Dropping any New Zealand receipt photo into a monitored Google Drive folder automatically triggers an end-to-end pipeline: file routing, multimodal Google Gemini AI extraction, line-item iteration, structured ledger persistence, and live Google Sheets spending analytics—eliminating manual regex parser maintenance across merchants.

Make.com AI Receipt Automation Scenario

End-to-end Make.com orchestration: Drive Watcher → File Processing Move → Gemini AI Multimodal Extraction → Backoff Retry & Quarantine Branch → Line-Item Iterator → Google Sheets Ledger.

1. Event-Driven Ingestion & Resilient Error Handling

Monitors an intake Drive folder, moves files into a processing state to prevent duplicate runs, and implements a Make.com error-handler branch with a 2-minute backoff sleep & retry plus automatic quarantine routing if AI extraction fails twice.

2. Zero-Template Multimodal Parsing & Normalization

Extracts structured JSON directly from raw receipt photos without merchant-specific regex rules. Automatically normalizes cryptic store abbreviations (e.g., WW Milk Standard 3L → Standard Milk 3L), weighted units (KG / EA), and spending categories.

3. Relational Ledger Schema & Quality Flagging

Uses an Iterator module to expand receipt line items into atomic rows tagged with Receipt_ID and Receipt_First_Row flags, preventing double-counting of invoice totals while surfacing anomalies via a Receipts Needing Review counter.

4. Live Analytics & Multi-Dimensional BI Charts

Automatically recalculates Total Spending, Average Receipt, and GST totals alongside dynamic breakdowns and visual charts across Category, Month, Merchant (Woolworths, PAK'nSAVE, New World, BP, Uber, etc.), and Payment Method.

Make.com Orchestration Google Gemini AI (Multimodal) Google Drive API Google Sheets BI & Formulas Retry & Quarantine Pattern Structured JSON Schema

Automated Data Outputs & Live BI Dashboard

Itemized Google Sheets Ledger

1. Structured Itemized Ledger

Original vs. standardized item names, unit weights (KG/EA), and subtotals

Live Spending Analytics Summary

2. KPI & Exception Summary

Total Spend, GST, Receipts Needing Review flag, and 4 pivot tables

4-Panel Visual BI Charts

3. Automated Visual Analytics

Spending by Category, Monthly Trend, Merchant, and Payment Method

NATIVE ANDROID APPLICATION Java • MVVM • Clean Architecture • On-Device OCR

NZ Receipt Finance & Automated OCR Expense Tracker

GitHub Repo

Engineering Overview: A native Java Android application that transforms camera or gallery receipt images into structured, reconcilable expense records using Google ML Kit OCR, visual row reconstruction, and deterministic rule-based parsers. Designed around MVVM and Clean Architecture with an eight-document specification baseline to ensure strict separation of presentation, domain, and data layers.

1. Boundary Detection & Visual Row Reconstruction

Detects receipt paper regions (`Auto: PAPER_REGION`) with interactive corner handles and reconstructs skewed physical text lines from raw ML Kit bounding boxes before parsing.

2. Extensible Supermarket Parser Interfaces

Implements merchant auto-detection and modular parser interfaces supporting major New Zealand retailers (Woolworths/Countdown, PAK'nSAVE, Tai Ping, Chemist Warehouse) and two-level category rules.

3. Human-in-the-Loop Review & Reconciliation

Cross-checks the OCR-extracted Printed Total vs. Calculated Total ($93.38 vs. $93.38) in an editable review screen prior to Room v2 database persistence, preventing silent OCR errors.

4. Specification-Driven Workflow & 31 JVM Tests

Governed by an 8-document systems analysis baseline and verified by a local JVM suite of 31 unit tests covering OCR row reconstruction, parser selection, category matching, use cases, and ViewModels.

Java (Android SDK) MVVM & Clean Architecture CameraX & Google ML Kit OCR Room v2 / SQLite JUnit (31 Local JVM Tests) Specification-Driven Agentic Workflow

End-to-End Mobile Application Workflow

Auto Paper Region Detection

1. Contour Cropping

Auto PAPER_REGION boundary detection

Receipt Review & Total Check

2. OCR Verification

Printed ($93.38) vs Calculated ($93.38)

Receipt History List

3. Multi-Store Ledger

PAK'nSAVE, Tai Ping, Chemist Warehouse

Spending Analytics Dashboard

4. Spending Analytics

Interactive drill-downs & category budgets

ARCHITECTURAL TRADE-OFF ANALYSIS

Engineering Comparison: Native App vs. AI Workflow Automation

Implementing the exact same receipt-expense problem across two distinct paradigms highlighted when to invest in custom software engineering versus when to ship rapidly with AI-driven workflow orchestration.

Dimension Native Android App (Custom Engineering) AI Automation Pipeline (Make + Gemini + Sheets)
Development Velocity Weeks of structured engineering (MVVM, UI screens, CameraX, Room migrations, 31 unit tests). Hours to prototype & deploy using visual orchestration and pre-built Google Workspace connectors.
Parsing Accuracy & Generalization Deterministic and fast, but brittle when retailers alter receipt layouts—requires new Java parser classes per supermarket. High zero-shot generalization across unfamiliar merchants, bilingual text, and irregular layouts, plus semantic item normalization.
Privacy, Offline & Cost 100% offline & private; zero ongoing API/cloud costs once installed on the device. Requires internet connectivity, cloud storage, and external LLM API calls (usage-based token & Make operation quotas).
UX & Human Verification Interactive cropping handles and immediate on-screen Printed vs. Calculated reconciliation before saving. Frictionless background ingestion (just upload photo to Drive); exceptions are surfaced asynchronously via a review flag in Sheets.
Engineering Takeaway Best for consumer-facing mobile products requiring offline reliability, custom UX, and zero marginal compute cost. Best for internal business tools, personal operations, and rapid MVP validation where time-to-value and format flexibility dominate.