TRAIL Search tells a brand what to change on its pages so that AI answer engines can read and cite them. A prescription is worth nothing until it is on the page, and most clients cannot put it there: the shop runs on a hosted commerce platform, or nobody on their side edits the site's source. This layer is how an approved change reaches a client's page anyway, by whichever channel the client's own permissions allow.
- RoleFounder of TRAIL Labs and sole engineer
- TimelineBuilt July to September 2026. Serving client traffic
- EdgeCloudflare Workers, Workers KV, HTMLRewriter, Analytics Engine
- Admin consoleTypeScript, Next.js, Prisma on a MongoDB replica set
- PlatformCafe24 Admin API through an OAuth app
- Quality745 tests across the Worker and the console. Lint with zero warnings, type-check and tests on every commit
Three channels

| Channel | When it applies | How the change reaches the page | State of the build |
|---|---|---|---|
| A · Platform app | The shop runs on Cafe24 | An installed OAuth app writes product descriptions and SEO fields through the Admin API | Install, token handling, throttled client, product reads and writes with a dry-run mode: built and tested. Applying from the console is not wired in yet |
| B · Direct source | We built the client’s site | The change goes into the site’s code | Manual. The console shows the prescription to paste |
| C · Edge relay | Neither of the above | A Cloudflare Worker in front of the site merges the content into the HTML as it streams. The origin is not modified | End to end: approve, plan, apply, served |
The edge relay is the channel for clients who can offer neither of the other two, and it is the one that carries the most risk. A Worker in front of a client’s shop sits on the path of every page view and every order. Most of the engineering in this project is about making that position safe.
The rules the layer is built on
- Our failure must not become the client’s failure. Any exception in the Worker returns the origin’s own response. A broken configuration disables injection for that site instead of applying half of it.
- Nothing ships without a person. Every change is a proposal with evidence, adopted or skipped by a named person. A site’s write scope is off until someone grants more.
- Add, never overwrite. The Worker adds to a page’s structured data and leaves the site’s own name, price and rating alone. The origin is live and our copy is a snapshot.
- The same bytes for everyone. There is no branch on the user agent. A crawler and a person receive identical content.
- Read the plan before you write. Every write to the edge is shown first as a plan: what would be written, what would be deleted. Applying is a second, explicit step.
Reading order
- ArchitectureThe admin console, the Worker, and the one thing they share. The KV contract, sync semantics, platform limits, and the decisions behind the design.
- The edge relayA request through the Worker: classify, fetch once, guard, merge. Fail-open in code, and how structured data is merged and not replaced.
- The Cafe24 appOAuth install, tokens that rotate on every refresh, a lock that lets only one process refresh, and a client that stays under the rate limit.
- The approval inboxProposals with evidence, four decision states, the write scope, plan and apply, and an apply log with before and after values.
- An edge latency postmortemA latency criterion that failed on the first measurement, and the six ways the first client connection went wrong.
- ResultsEach claim with the mechanism and the test behind it.
Results in three lines
- A change reaches a client’s page without the client editing anything: the Worker reads a payload from KV and merges it into the origin’s HTML in a stream.
- Any exception in the Worker returns the origin’s response. Tests assert the edge cases: broken KV data, error pages, non-HTML responses, a POST with a body, and a dead origin answered with a 502 and no retry.
- 745 tests run on every commit, with lint at zero warnings and a type-check, across the Worker and the admin console.
