
The truck with the top off The truck in the driveway Rear three quarter, with the garage behind The engine out of the truck on the hoist The block on the stand with the crankshaft in The painted block on the engine stand The engine on its stand in front of the truck Timing belt and cam pulleys on, covers off The supercharger fitted The engine harness laid out, branches tagged with tape
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.
- 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
| Lane | Hardware / Software |
|---|---|
| Status | In progress |
| Role | I made every decision, set the rules, did the physical work and took the measurements |
| Agent | Claude Code, Anthropic's coding agent |
| Dates | In progress, November 2026 |
| Vehicle | 1988 Toyota 4Runner getting a rebuilt, supercharged 1998 5VZ-FE V6 (3.4 L) |
| Stack | Python, Markdown, JSON, hand-written HTML, CSS and SVG |
| Hosting | Cloudflare 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
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.
| Verdict | Lines | What it means |
|---|---|---|
| MATCH | 163 | Agrees with the factory manual |
| FIX | 26 | Wrong or incomplete text, a broken cross-reference, or a link to the wrong page |
| OMISSION | 15 | The numbers were right, but steps, cautions or specs from the manual were missing |
| LABEL | 3 | Advice that isn't Toyota's and had to be marked that way |
| Total | 207 | Every line of the guide |
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.
Sources
Toyota factory service manuals, wiring diagrams, and meter readings from the truck.
Forum posts are leads to check, not sources.
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.
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.
Then, same notes, three outputs:
Connector diagrams
Printed garage binder
Website
Build guard
The site build stops on a private detail, a manual file or a broken link.
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.
08
Roles
My job and the agent's job
| Me | The agent (Claude Code) |
|---|---|
| Made every decision | Searched the manuals |
| Set the rules | Wrote the notes |
| Did all the physical work | Ran the audits and cross-checks |
| Took the measurements | Wrote the generators and the site |
09
Stack
Stack and links
| Code | About 1,000 lines of Python, standard library plus Pillow, no framework |
|---|---|
| Content | 18 research notes in Markdown, 143 connector pins in one JSON file |
| Site | Static pages built by the Python generators, with hand-written HTML, CSS and SVG |
| Hosting | Cloudflare Pages, with a Pages Function and KV for the checklist state |
| AI tool | Claude Code (Anthropic's coding agent) |
| Progress | 65 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.