Bonis Systems LLC · Engineering Work Sample
Found, fixed, tested, deployed
Three production defects from my own systems — what the defect was, how it was fixed, the test that locks it, and the revision it shipped in. Two of the behaviour claims below can be re-run against the live services with the commands in §01; a third is a plain fetch of a public file.
Why you can see all of this. These are production systems I own and operate, so you get the commit hash, the test file, the line counts and the date each fix shipped. The repositories are private (read access on request); the running behaviour is public — two of the claims below can be checked with a single curl each, given in §01. If a claim here is wrong, it is falsifiable in about two minutes. That is the point.
01
At a glance
Three defects across two production services, each closed the same way: reproduce, fix at the root, lock with a regression test, deploy, then verify against the platform rather than assuming.
Exhibits
3
Regression tests added
2
Live-behaviour verified
3/3
Services
2
| # | Defect | Class | Commit | Shipped |
|---|---|---|---|---|
| A | Missing required argument leaked a raw runtime error | Input validation | 090776e | 2026-08-14 |
| B | Malformed JSON returned an HTML page with a stack trace | Error contract | 655eafa | 2026-08-14 |
| C | Eight defects found and closed in one pass | Frontend / API | 3bfe1f7 | 2026-08-14 |
Two checks a stranger can run right now (Exhibits A and B)
$ curl -s -X POST https://client.example/api/knox/mcp -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"verify_anchor","arguments":{}}}'
→ {"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"hash is required and must be 64 hex characters (SHA-256)."…}} # typed, no runtime error
$ curl -s -X POST https://trustailaw.com/api/mcp -H 'content-type: application/json' -d '{not json'
→ 400 application/json {"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error: invalid JSON."…}} # no HTML, no stack
$ curl -s https://client.example/robots.txt # Exhibit C, the ninth finding: the live file is the repository's policy02
Exhibit A — the validation that only guarded half the input
Commit 090776e · 2026-08-14 · 2 files, +151 / −15
Missing required argument returned a raw runtime error
The defect
A JSON-RPC handler validated argument shape but never argument presence. A malformed value was rejected cleanly. Omitting the value entirely skipped validation and failed downstream inside a string operation, surfacing the internal exception to the caller:
verify_anchor {"hash":"abc"} → -32602 "Invalid hash. Must be 64 lowercase hex characters." ✓ typed
verify_anchor {} → isError:true, "Cannot read properties of
undefined (reading 'toLowerCase')" ✗ raw
Why it mattered
Two different rejection shapes for the same category of bad input means a client cannot depend on one error contract. The leaked message also discloses an implementation detail — that unchecked input reaches a .toLowerCase() call. Not exploitable on its own; exactly the kind of inconsistency that widens under fuzzing.
The fix
Rather than patch the one handler that surfaced it, I extracted two shared guards — presence-and-type checks for hex hashes and for required strings — and applied them across all three handlers carrying the same class of bug. Absent and malformed inputs now share one typed rejection.
The test
tests/knox-mcp-arg-validation.test.ts — a new 123-line suite, 6/6 passing, asserting that the absent-argument path and the malformed-argument path return the identical typed error.
Proof it is live
Deployed and retested against the running service: verify_anchor {} now returns -32602 "hash is required…" with no runtime-error string. Shipped 2026-08-14 (confirmed on the platform at the time; later releases have since shipped) and re-verified on the wire on 2026-08-16 — the §01 command — for the absent, malformed and wrong-type argument alike.
03
Exhibit B — the error the framework answered before my code could
Commit 655eafa · 2026-08-14 · 2 files, +45 / −0
Malformed JSON returned an HTML error page containing a stack trace
The defect
A JSON-RPC endpoint's own handlers were correct — but a malformed request body never reached them. the framework's JSON body parser threw upstream in middleware, and the framework's default error handler answered with an HTML page containing a server-side stack trace. Two failures at once: the JSON-RPC contract was broken, and implementation detail leaked.
Why it mattered
This is the failure mode unit tests miss. Every handler test passed, because the bug lived in the layer before the handlers. It was only visible by hitting the running service with a deliberately broken body.
The fix
Stage one (8/14, commit 655eafa): a JSON parse-error middleware installed immediately after the body parser — the protocol path returns a spec-correct -32700, other API paths return clean JSON. +45 lines, 0 deletions — additive; no existing branch was modified. Stage two (8/16, commit 2d7b5c5): re-auditing this document, I probed the sibling error classes and found one still reaching the framework's default handler — an unsupported charset (charset=utf-99) returned a 415 HTML page with a stack trace. The 8/14 fix had guarded the instance, not the class. Replaced it with one catch-all handler for every body-parser error class (parse failure, unsupported charset/encoding, oversized body, aborted request): clean JSON on every path, JSON-RPC shapes on the protocol path, never HTML, never a stack; and the service now runs in production mode (confirmed on the live release), so even an unhandled error can no longer render a stack. The test file was also changed to exercise the real handler module instead of a mirror of it — a test that restates the code passes when the code is wrong.
The test
tests/mcp.test.js — extended by 22 lines on 8/14 (12/12); on 8/16 two more teeth (unsupported charset on the protocol path → JSON -32600; oversized body on another path → JSON 413) and the mirror replaced with the real module — 14/14.
Proof it is live
Stage one re-verified on the wire 2026-08-16: a malformed body returns a clean -32700 with no HTML; a missing required field still returns -32602; valid requests still succeed. Stage one shipped 2026-08-14. Stage two shipped on 2026-08-16, confirmed serving all traffic, and re-probed on the wire the same minute: charset=utf-99 now returns 415 application/json with -32600 "Invalid request: unsupported charset" — no HTML, no stack, no paths — and the running service is in production mode.
04
Exhibit C — a full browser walk, and the eight things it found
Commit 3bfe1f7 · 18 files, +223 / −76
Eight defects closed in one pass
The method
A scripted browser walk over every distinct page template of a production Next.js application (28 sitemap routes plus the footer routes) — not a smoke test of the happy path, but a real traversal recording console errors, failed network requests, missing assets, and broken interactive components.
What it surfaced
Nine findings. Eight were code defects, closed together in one commit: a map dead on the wire — the content-security policy blocked the CDN stylesheet and every tile host; cured by self-hosting the assets and correcting the policy, an API route returning non-200 under a state the tests never exercised, and layout-shell issues. The ninth was a crawler-policy configuration that disagreed between the repository and what was actually served at the edge — closed at the edge, not in code (next row).
The judgment call worth noting
One "defect" was a disagreement between the committed configuration and the live response. Rather than change the code to match the wire, I checked which one was correct — the repository was right and an edge-layer setting was overriding it. Fixing the symptom would have made the code wrong and the tests green.
Proof it is live
The eight code fixes shipped together on 2026-08-14 (confirmed on the platform at the time; another release followed the same night with an unrelated fix folded in). The ninth was closed in the edge configuration and is visible today: the live robots.txt serves the repository's policy.
05
How I work
These are the rules I hold myself to — stated with their real scope, because a rule that reads as absolute and is not is worse than no rule.
- Fix the class, not the instance. Exhibit A appeared in one handler and was fixed in three, behind shared guards. Exhibit B is the counter-example that proves the rule: the 8/14 fix guarded one error class, the 8/16 re-audit found its sibling, and the cure was a catch-all. A bug that exists once usually exists three times.
- Every logic fix lands with a regression test (Exhibits A and B). Exhibit C's eight were locked by re-running the browser walk, not by unit tests — seven were surface fixes, and one was a logic fix that shipped verified on the wire without its own unit test: the one place this rule bent, named here rather than hidden in the word "surface". If a logic fix is not locked by a test, it is not fixed — it is postponed.
- Deploy state is verified, never inferred. A fast response does not mean your code is live. I check the platform for the running revision before saying anything shipped — and this document's first draft named the wrong revision for Exhibit C, caught by re-auditing it against the record before sending. Verification includes verifying the write-up.
- Lighthouse 90+ and axe-core 0 violations are my standard for viewer-facing pages. Exhibit C's changed pages shipped with that sweep deferred to the following session; this document was itself run through Lighthouse and axe-core before it went out, and the first pass failed (contrast, no language attribute, no landmark, scroll regions unreachable by keyboard); the fixes are in this file and the re-run result is stated in the footer. Accessibility is not a follow-up ticket.
- On any surprise, stop and write it down. Pushing through an unexplained result is how a small defect becomes an incident.
- Prefer additive fixes. Exhibit B stage one was +45 / −0 — no existing branch was modified. Additive is not the same as risk-free (stage two shows what a narrow addition can leave open), but it keeps the blast radius legible.
Verification. Commit hashes, file paths, line counts, and test results are from the repositories named. Behaviour was re-verified against the live services on 2026-08-16 with the commands in §01. Each release was confirmed on the platform when it shipped, and both services were re-checked serving all traffic on 2026-08-16 (re-checked on the send date). This document, re-run 2026-08-16 after the fixes: Lighthouse 100 / 100 / 100 / 100 (mobile, three runs, floor) and axe-core 0 violations across light and dark, desktop and mobile. Severity labels are my own assessment. All of these defects were surfaced by my own adversarial input testing and scripted browser walks, not by a downstream report.
Jonis Fields · Bonis Systems LLC · [email protected] · +1 (210) 452-3767
Jonis Fields · Bonis Systems LLC · [email protected] · +1 (210) 452-3767