VEAI-LAB. ← All case studies
Case Study · Cloud / Serverless Ops

Reconciling a Drifted Production Lambda Without Exposing Care Data

A health-safety production OCR pipeline had silently drifted away from its source repository. I proved the exact divergence with a read-only export and hashing, blocked the regression path, and reconciled the code back into main through reviewed PRs and tests — without ever touching production data.

Project: ParkinSync · Role: Solo engineer / technical PM · Evidence: public repo larai-w/ParkinSync (issues #26/#27, PRs #30/#31)
ParkinSync serverless architecture on AWS — API Gateway, Lambda with data reconciliation, DynamoDB, and Cognito
ParkinSync — serverless architecture on AWS (Lambda · DynamoDB · API Gateway · Cognito · CDK).

Context

ParkinSync is a small, real-world care-analytics system: it OCRs a paper caregiver log, enriches it with weather, and writes a normalized daily schema. The OCR step runs as an AWS Lambda in production, processing a family member's real care records daily.

The handoff notes carried a nagging risk: "production Lambda code may not match main." Until that was resolved, the repository's tests couldn't be trusted to describe production behavior — a dangerous gap for a system on a health-safety path.

Constraints

What I did — and deliberately didn't do

I did not "just redeploy main," the tempting one-line fix. I first proved what production actually ran, then chose remediation from evidence.

The operational story (the core)

Using read-only AWS APIs (get-function / get-function-configuration), I exported the deployed function's code only — never its environment variables (which can hold secrets) — and hashed it. The result was decisive:

The divergence went both ways: the deployed branch had operational hardening main lacked (idempotent S3 processing, OCR-failure quarantine + notification, filename-based date recovery, broader date parsing), while main had a richer 25-column output schema and safer URL-decoding of S3 keys the deployed code had dropped. Neither side was simply "newer."

Decision & tradeoff

Redeploying main would have regressed production by removing idempotency and failure-quarantine from a health-safety path. Adopting the deployed code wholesale would have lost the canonical output schema. I recommended and executed a third option: port the hardened capabilities into main by hand, keeping main's better schema and decoding — reconciling the two rather than picking a loser.

Architecture & technical decisions

Delivery & governance

With no team, I made the process the reviewer: framed the work as GitHub issues #26/#27 with acceptance criteria and a release gate; shipped via reviewed PRs #30 and #31, each green on CI; wrote a sanitised reconciliation doc capturing hashes, the decision, a non-sensitive smoke test, and rollback evidence — with placeholders instead of real identifiers.

Outcomes

Honest limitations

Lessons

Evidence

Repo: github.com/larai-w/ParkinSync — issues #26, #27; PRs #30, #31. Docs: PRODUCTION_LAMBDA_RECONCILIATION.md, OCR_HARDENING_PORT.md, the deploy.sh guardrail, and tests/test_lambda_function.py (29 tests).

Need this kind of delivery discipline?

Hands-on technical project management for cloud and GenAI builds — evidence-first, from first sprint to release.

Book a Free Consultation