Skip to content
Atreyu Sutton
The home page of the live build site. A headline reads "A 1998 engine in a 1988 truck, planned with an AI agent that has to show its sources", beside a diagram of wires running from the 1998 engine harness to the 1988 truck plugs, above four counters: 143, 207, 53 and 23 / 65
The home page of the live site

Hardware / Software

Custom Engine Rebuild Wiring and Swap Agent

I used an AI coding agent to research and document a 1998-engine-into-1988-truck swap, and built the verification process that checks its output against factory manuals and meter readings before I act on it.

Live site5vz-swap.pages.dev

  • LLM evaluation
  • AI agents
  • Human-in-the-loop
  • Grounding
  • Python
  • Data pipelines
guide lines audited against the factory manual
207
of those lines needed fixing
44
community wiring chart entries re-verified
53
build jobs done
23 / 65

Audit figures come from the project's research notes. The job count is as of November 2026 and updates on the live site.

I'm swapping a rebuilt, supercharged 1998 Toyota V6 into a 1988 4Runner, and I used an AI coding agent for the research, documentation and tooling. Because a wrong pin or torque spec costs real hardware, I built a verification process around the model: factory-manual sources only, a line-by-line audit of its output, meter readings as ground truth, and a build that fails on bad data.

The audit graded 207 lines of AI-written instructions and found 44 that needed fixing, none of which a quick read would have caught.

This is applied AI: agent workflow, evaluation and verification. I did not train or fine-tune a model. The build is also still in progress. 23 of the 65 jobs on the checklist are done, and the engine has not run in the truck yet.

01

Spec

LaneHardware / Software
StatusIn progress
RoleI made every decision, set the rules, did the physical work and took the measurements
AgentClaude Code, Anthropic's coding agent
DatesIn progress, November 2026
Vehicle1988 Toyota 4Runner getting a rebuilt, supercharged 1998 5VZ-FE V6 (3.4 L)
StackPython, Markdown, JSON, hand-written HTML, CSS and SVG
HostingCloudflare Pages, with a Pages Function and KV for the checklist state

02

Problem

An AI agent that isn't allowed to guess

The engineering problem: the truck keeps its original 5-speed manual and its original gauges, and the 1998 engine runs on a plug-in standalone ECU. So the electronics of a 1998 engine have to live inside a 1988 truck, and the signals between them have to be traced across two sets of factory wiring diagrams.

The AI problem is the one every applied-AI team has: how do you use a language model on a task where a confident wrong answer is expensive? Here a wrong pin number can destroy an engine computer and a wrong torque spec can destroy an engine. I couldn't take the model's word for anything, so I designed a process around it.

Nothing gets used because the model said it. Every number has to trace back to a factory manual page or a meter reading on this truck.

03

Method

Six checks between the model and the truck

An UNVERIFIED tag, as quoted on the live case study
N5-1 is most likely the fuel pump output. UNVERIFIED.
Check: key ON, ground N5-8 → N5-1 reads 12 V.
  • Grounding

    Check 1

    The agent may only use Toyota's factory service manuals and wiring diagrams as sources. Every spec carries the manual page code so I can check it by hand.

  • Evaluation

    Check 2

    A second pass re-read the manual and graded every line of the AI-written build guide as MATCH, FIX, OMISSION or LABEL. The result is in the next section.

  • Verifying outside knowledge

    Check 3

    The wiring plan started from a well-known forum write-up. Before using it, the agent checked 53 entries pin by pin against Toyota's diagrams. It found three wrong function labels and a swapped pair of pins. One wire labeled "not used" was really the main power feed for the airflow sensor, idle valve and oxygen-sensor heaters.

  • Ground truth from the truck

    Check 4

    Documents are checked against meter readings I take on the truck. When a document and the meter disagree, the meter wins.

  • Explicit uncertainty

    Check 5

    Anything not confirmed by a manual page or a measurement is tagged UNVERIFIED and comes with the exact test that would settle it. The example below is one of those tags.

  • One source of truth, and a build that can fail

    Check 6

    143 connector pins live in one JSON file. Python generators produce the connector diagrams, the printed garage binder and the website from the same notes.

04

Audit

The first draft was 79% right

The agent wrote the first draft of the engine build guide from the manual. Then a second pass re-read the manual and graded the guide line by line. Across 207 lines: 163 match, 26 fix, 15 omission, 3 label.

So the first draft was 79% right, and the 21% that wasn't was the dangerous kind: steps missing from a sequence, cautions left out, cross-references to the wrong step. No torque, clearance or angle contradicted the manual. All the fixes were applied.

VerdictLinesWhat it means
MATCH163Agrees with the factory manual
FIX26Wrong or incomplete text, a broken cross-reference, or a link to the wrong page
OMISSION15The numbers were right, but steps, cautions or specs from the manual were missing
LABEL3Advice that isn't Toyota's and had to be marked that way
Total207Every line of the guide
The audit result as it appears on the live case study

05

Pipeline

From manual page to garage floor

The notes are the only thing the outputs are built from. There are 18 research notes, each answering one question: the power budget, the gauge signals, every plug on the harness, a full wiring audit, and so on.

The site build fails if a private detail or a copyrighted manual file would be published, or if any link is broken. The check below is the end of the build script.

Factory manuals, wiring diagrams and meter readings feed research notes and one pin data file. Audits and pin-by-pin checks correct the notes. Python generators turn the notes into connector diagrams, a printed binder and the website. The site build stops if it finds a private detail, a manual file or a broken link.
  1. Sources

    Toyota factory service manuals, wiring diagrams, and meter readings from the truck.

    Forum posts are leads to check, not sources.

  2. Then, the agent searches and writes:

    Notes and data

    18 research notes in Markdown. 143 connector pins in one JSON file.

    Every spec carries its manual page code.

  3. Then, a second pass grades the first:

    Checks

    Line-by-line audit, pin-by-pin verification, UNVERIFIED tags with the test that settles each one.

    Fixes go back into the notes.

  4. Then, same notes, three outputs:

    Connector diagrams

    Printed garage binder

    Website

  5. Build guard

    The site build stops on a private detail, a manual file or a broken link.

tools/build_site.py, the end of main()
    problems = privacy_check()
    broken = link_check()
    if problems or broken:
        print('\n'.join(['PRIVACY:'] + problems[:40] + ['LINKS:'] + broken[:40]), file=sys.stderr)
        raise SystemExit(f'build failed: {len(problems)} privacy hits, {len(broken)} broken links')

06

Failures

What went wrong

The checks exist because they kept finding things.

  • 44 of 207 lines needed work

    That is the score for the first AI draft before any checking. It was mostly right, with the errors in places a quick read would not catch.

  • A bug in the page generator

    The audit caught a bug in the page generator: four spec chips linked to page 1 of the manual instead of their own page.

  • The manual that didn't cover the engine

    The notes assumed a 1988 repair manual covered the V6's wiring. Reading it page by page showed it covers only the four-cylinder. The correction is logged and the affected items are still marked open.

  • When the sources disagree

    Two pages of the same factory manual imply opposite polarity for one signal. The note doesn't pick one. It specifies a bench test that decides it.

07

Gallery

What the notes turn into

These are pages from the live site. The connector faces are generated from the pin data. The pages record one truck's build. They are not a how-to, and the wiring is not validated for anyone else's truck.

Which 1998 harness wires are kept, moved or removed
A connector face generated from the pin data, beside the real plug
Wiring sheet for the MAP sensor, wideband oxygen sensor and CAN bus
The live build checklist, 23 of 65 done

08

Roles

My job and the agent's job

MeThe agent (Claude Code)
Made every decisionSearched the manuals
Set the rulesWrote the notes
Did all the physical workRan the audits and cross-checks
Took the measurementsWrote the generators and the site

09

Stack

Stack and links

CodeAbout 1,000 lines of Python, standard library plus Pillow, no framework
Content18 research notes in Markdown, 143 connector pins in one JSON file
SiteStatic pages built by the Python generators, with hand-written HTML, CSS and SVG
HostingCloudflare Pages, with a Pages Function and KV for the checklist state
AI toolClaude Code (Anthropic's coding agent)
Progress65 jobs on the live build checklist, 23 done as of November 2026

The live case study, the build checklist and the wiring diagrams are public and linked at the top of this page. The source repo is private. The factory manuals are Toyota's and are not published.