Skip to content
All work
Software DevelopmentDiagnosticsResearch

PC Diagnostic Platform

An engineering and research project to build a single PC diagnostic system in which every hardware value records whether it was measured, where it came from, and why it is missing if it is, so that any conclusion can be traced back to recorded evidence. It is built in gated phases from an owner-written specification, with a Rust core, a C# Windows agent and a TypeScript and PostgreSQL contract layer. Five of the specification's 23 phases have passed their gates, the fifth being telemetry, and the work continues.

Role
Project owner — specification, direction and decisions; AI-assisted engineering (Claude Code as lead engineer)
Timeline
Oct 2026 — Present
Status
in progress
RustC# / .NET 8TypeScriptJSON Schema (2020-12)PostgreSQL (PGlite)ajvVitestxUnitGitHub ActionsWMICPUIDPDH performance countersD3DKMTClaude Code
Specification phases through their gate
5 of 23Phases 1 and 2, committed on 3 October 2026; Phase 3, completed on 4 October 2026 once CI passed on Linux and Windows; and Phase 4, completed on 9 October 2026 once CI passed on the Phase 4 commit on Linux and Windows, including the Linux discovery tests as a standard user and as root on a GitHub-hosted virtual machine; and Phase 5, telemetry, completed on 11 October 2026 once CI passed on the Phase 5 commit on Linux and Windows, again with the Linux steps as a standard user and as root on a virtual machine. Each has a written gate report.
Tests passed at the Phase 5 local gate
3,160Rust 1,178, C# 103, TypeScript and database 1,879; 0 failed, alongside 53,918 fixture checks including 386 negative cases. Run on 11 October 2026 on the development PC by a separate gate agent, rather than taken from the implementing agents' reports. Earlier gates passed 1,119 tests (Phase 2), 1,432 (Phase 3) and 2,196 (Phase 4).
Confirmed review findings fixed in Phase 5
103 of 103Thirteen reviewers, with a separate verifier trying to refute each finding: 109 findings after de-duplication, 6 refuted, 103 confirmed (2 blocking, 34 major). A second set of verifiers then checked every fix: 92 fixed, 10 partly fixed and 1 made worse. A remediation pass then completed those 11; its own fixes were checked by the full local gate, not by a second verifier. A review of the fixes raised 10 regression claims, all confirmed; 9 were fixed and 1 waits for an elevated run. In Phase 4, 68 of 68 confirmed findings were fixed; in Phase 2, 53 of 55, with 2 kept as design decisions.
Development PC identifiers found in Phase 5 output
0111 search strings of 30 kinds, taken from the development PC's own identifiers, among them serial numbers, the system UUID, MAC addresses, interface GUIDs and the computer name, searched for across 619 files at the Phase 5 local gate; none found, and a positive control found all 111. At the Phase 4 gate, 85 forms across 537 files: none found. At the Phase 2 gate, 6 raw serials checked across 9 real-hardware test runs: none appeared.

The problem

Whether a PC is worth upgrading, keeping or replacing depends on facts that are hard to see: what is actually installed, what condition it is in, and what it can run. Those facts are easy to state and hard to check: an advertised component or figure is a claim until it is detected and tested. The specification does not accept a conclusion such as 'CPU: good' without the measurements behind it, and a value that could not be read should say so rather than be quietly filled in. The project sets out to build one diagnostic system that records what a PC contains, what condition it is in and what it can do, with evidence attached to every value, so that anything concluded later can be traced back to what was actually measured.

Research

The specification states requirements, not answers, and several of them are open technical questions, so the project tracks them as research questions and records evidence for and against each approach as phases complete. None is answered yet. How can evidence be preserved so that every conclusion traces to recorded, reproducible observations and missing data is never silently filled in? How can stress testing run within hardware protections, and refuse to run when safety telemetry is missing? Can a pre-boot environment work with Secure Boot left on, through a signed boot chain, and share one diagnostic system with Legacy boot? Can a component be recognised across boot environments and visits without storing its raw serial numbers? How should measured performance be kept apart from estimates, so that an estimate can never pass as verified? And how can AI-assisted, multi-agent engineering be verified to the standard a diagnostic tool needs? Technology choices were investigated the same way, with the rejected options written down: WinPE was ruled out for the pre-boot environment because redistribution needs separate Microsoft licensing and modern kits have no Legacy BIOS path; a bare UEFI application has no drivers for USB networking, NVMe health or GPUs; and an unsigned image that asks users to disable Secure Boot was rejected outright.

Planning

I wrote a master engineering specification before any code existed, on 3 October 2026. It fixes the stack, sets a 23-phase build order and puts a gate at the end of every phase: run the tests, build what changed, check for regressions, document what works and what fails, commit, update the architecture documents, and do not proceed on an unstable foundation. Each gate produces a written report of files changed, tests run, passed and failed, limitations and the next step. In Phase 2, after the design was settled, a lead review drew a cut line: machinery that no real caller could exercise yet was specified but deferred to the phase that will first use it, so that raw disk identity collection, for example, waits until it can be tested against real hardware. The aim is that nothing is built that the gate cannot test. Alongside the code, the project keeps a dated, append-only record of every stage, decision, problem and fix.

Design

The design takes the specification's evidential rules and turns each one into something the data model enforces rather than a convention. Every hardware value records whether it was measured, unavailable, not applicable or mock, together with its source and unit; an unavailable value must carry the error behind it, and mock data is labelled at every level, so a guess cannot pass as a reading. Raw measurement, derived metric, finding, interpretation and recommendation are separate kinds of record: a finding must cite evidence and the rule and rule version that produced it, an interpretation cannot cite a seller's claim as its evidence, and an estimate carries a range and can never be marked verified. History is append-only. Each save records its sequence and a hash of the save before it, and saves are ordered by that lineage rather than by timestamp, because a pre-boot environment and Windows keep different clocks and a correct save can appear to go backwards in time. Stable schema files are hash-locked, so changing one means publishing a new version. The Phase 2 design came from three independent proposals written to different priorities, scored by three judges, combined in one synthesis and put through two adversarial critique rounds that closed 46 gaps before any of it was implemented.

Architecture

A polyglot monorepo, with the language for each part fixed by the specification. A Rust core reads hardware directly — CPUID and the raw SMBIOS firmware tables on any platform; WMI, the registry, the Win32 firmware interface, read-only storage protocol queries, the display configuration, the network interface tables, the operating system's performance counters and the graphics kernel's statistics on Windows; procfs, sysfs and efivarfs on Linux — and writes a diagnostic session through a command-line tool. Since Phase 4 it records storage identity and NVMe health, memory slots, GPU and PCI Express link details, network adapters and displays, under two rules: no read may change a device's state, and no value that identifies a machine may reach the output. Since Phase 5 it also records behaviour over time: a recorder samples processor load, clock and power, GPU activity, memory, disk activity and NVMe health at fixed rates, from sources that need no kernel driver and under the rule that no read may wake a device, writes them to an append-only evidence log in chunks that is recovered after a crash, and records every metric the machine cannot report as unavailable with its reason. A C# (.NET 8) Windows agent finds open sessions, on the USB data volume first and then in the local store, and asks the core to continue them; it never modifies another machine's session or a mock one. A TypeScript layer holds the contract types, strict schema validation, the schema registry and the integrity and lifecycle checks, and a PostgreSQL ingest library stores every revision append-only, tested against a real PostgreSQL engine running in-process. One JSON Schema (draft 2020-12) is the contract between all of them: the Rust, C# and TypeScript types are written by hand, and each language's tests validate fixtures and real output against the same schema, rather than generating code from it. One diagnostic visit is one session; it can be continued in another environment only on the same machine, and a weakly identified machine is never merged with another. The pre-boot environment is designed as a minimal Linux image behind a signed shim, GRUB and kernel chain, so that one USB can serve UEFI with Secure Boot enabled, Legacy BIOS and network boot; no bootable image has been built yet. GitHub Actions runs four jobs: Rust on Windows (on an elevated runner), Rust on Linux (with real-hardware steps as a standard user and as root), the C# agent with integration tests that drive the real Rust core, and the TypeScript, schema, fixture and database suite.

Challenges

  1. 01

    A CPU clock the operating system got wrong

    On the test laptop, WMI reported a base clock of 2101 MHz for a processor rated at 1.6 GHz. The CPUID leaf that gives the base frequency directly was masked by the Windows hypervisor, because the machine runs virtualisation-based security. No automated test caught it; checking real output against known facts about the machine did. The fix is a documented order of sources — the CPUID leaf first, then the rated frequency in the processor's brand string, then WMI, labelled as unverified — with a unit test. The same check found a second defect before the Phase 1 commit: the Windows agent crashed on a relative path to the core, now resolved to an absolute path, with launch failures reported instead of thrown.

  2. 02

    A locked schema that could be edited unnoticed

    Stable schema files are meant to be immutable, but the adversarial review showed that one could be edited and its hash lock updated to match without anything noticing. The registry test now compares stable entries against the previous commit's registry, and after the Phase 2 commit an in-place edit with an updated lock was shown to be rejected. The same check showed that the schema-check script on its own would still accept such an edit, so this protection depends on the TypeScript registry test running in CI — which, at that point, had never run.

  3. 03

    A stale USB copy that could reopen a closed visit

    A session can live on the USB stick and in the local store at the same time. The review found that an out-of-date copy on the stick could reopen a visit that had already been closed. The Windows agent now withholds every copy of a session that has been closed. Across the review, fixed findings were given regression tests where practical, so that a fixed defect cannot quietly return.

  4. 04

    Linux code that had only ever been type-checked

    Development happens on Windows, so the Linux hardware providers were compiled and linted locally but never run, and the review found that CI as written would only have exercised the weak-identity path. A CI step was added that runs the real-hardware identity and scan tests as root on Linux, with an unidentified machine counted as a failure. In the first CI run those 13 tests ran and passed — the first execution of the Linux code — though on a GitHub-hosted virtual machine rather than physical hardware.

  5. 05

    A first CI run that failed on Windows

    The first CI run, on 4 October 2026 (UK time), failed one Windows-only test. The test built a relative path from the checkout to the temporary directory, and on GitHub's Windows runners those sit on different drives, where no relative path can exist. Because the premise of the test was wrong rather than the code it tested, it was classified as a test defect, and the test now creates its temporary directory under the current directory. Cargo stops at the first failing test binary, so several Windows test binaries did not run in that job. The corrected test was committed with Phase 3 and passed on GitHub's Windows runner on 4 October, and CI now runs the Rust tests without fail-fast, so one failing test binary can no longer hide the others.

  6. 06

    Reads that looked harmless but could wake a device

    Phase 4 reads devices more directly, and an adversarial review confirmed 5 blocking findings. On Linux, reading a PCI Express link's width or speed resumes a suspended device on recent kernels, and on older ones returns all ones, which had been recorded as a 63-lane link; the core now checks a device's power state before any such read and accepts only link widths PCI Express can encode. Two Linux sources could have carried a virtual-machine bus identifier into the output and now use fixed path templates, and two Windows display values that had no evidence behind them are no longer recorded as measured. A review of the fixes then found 10 regressions, among them a guard that would have reported every USB network adapter as asleep; each was verified and fixed.

  7. 07

    A Linux identity premise that CI disproved

    The design assumed that a Linux scan without root is always weakly identified, because the machine identifiers it relies on are readable only by root. The first Phase 4 CI run showed one of them readable without root on GitHub's Linux runner while another was denied, so the machine was identified and its components keyed, and on one machine the keys would have depended on privilege. The rule is now that any denied identifier read makes the identity weak; Windows is unaffected, and the Linux real-hardware steps then passed as a standard user and as root.

  8. 08

    A cost limit judged by an instrument that could not see the cost

    Phase 5 limits the recorder's own processor time to 1 % of one logical processor, and the first gate run reported 0.06 %. An adversarial review showed that the figure, the recorded channel and the gate's independent check all read the operating system's tick-based process accounting, which charges whole clock ticks and misses most of the work of threads that wake on timers and run for less than a tick; the design's own estimate from cycle counts had been 0.4 to 0.5 %. The gate now measures the CPU cycles of the recorder's process, converted with a counter rate the test calibrates itself, and the limit was not relaxed: the ten-minute run measured 0.536 %. In that run, on a machine that was not quiet, the tick-based figure read 0.547 %, so the under-reporting rests on the reviewers' reproductions and not on the gate run.

  9. 09

    Readings filed under the wrong stream, and a stored path that was trusted

    The same review confirmed 103 findings, 2 of them blocking. If one sensor source timed out while opening, every later sampler wrote its readings into its neighbour's log, so a CPU value could be sealed under the header of a disk metric; a sampler is now given its stream only once the list of started streams is final. And recovery of an interrupted recording opened files by a path stored in the session file, which travels on removable media, so an edited file could make the tool copy a file from outside the session's own folder; no stored path is trusted now. A second set of verifiers then checked every fix and found 10 partly fixed and 1 made worse, which a remediation pass completed, and a review of the fixes raised 10 regression claims, all of which held. The fix round was interrupted by an application restart and by a move of the repository to another drive, and was finished by a continuation that checked every finding against the code again.

The solution

After the first three phases the platform was a thin, verified path through every layer rather than a feature set; Phase 4 widened its hardware discovery on that path, and Phase 5 added the recording of readings over time. On the test laptop the core created a session from a real hardware scan, continued it and closed it across three saves, each with a verified parent hash; the Windows agent continued, closed and mirrored the same session; the TypeScript layer read every revision with no integrity problems; and the database ingested them as linked revisions of one strongly identified PC. The method around the code is as much a part of the solution as the code. The engineering was AI-assisted: Anthropic's Claude Code (model Claude Opus 5.5) acted as lead engineer under my specification and decisions, orchestrating multi-agent workflows of independent designers, judges, critics, implementers working in dependency order, adversarial reviewers and refuting verifiers. The implementing agents' own reports are not accepted as evidence: up to Phase 3 the lead re-ran each gate itself before it was recorded, and in Phases 4 and 5 a separate gate agent ran the full local gate, with the lead re-running selected checks; real-hardware output is checked against known facts about the machine; and decisions with a material effect on architecture, security, data integrity, publication or disclosure come to me.

Result

Phase 1, committed on 3 October 2026, passed its gate with 45 of 45 tests (Rust 21, C# 8, TypeScript 16). Phase 2, committed the same day, defined 29 entities across 22 schema files, 15 of them stable and hash-locked, with 133 deterministic mock fixtures; its gate, re-run by the lead, passed 1,119 tests with none failing and one skipped, plus 12,551 fixture checks including 326 negative cases. Shared test vectors gave identical results across languages, including seven migration vectors that were deep-equal in Rust, in TypeScript and in the fixture generator's reference implementation. A scan of the working tree for the test laptop's real serial numbers and system UUID found none. The repository was then published privately, and the first CI run started at 00:15 BST on 4 October (23:15 UTC on 3 October): three of four jobs passed, including the TypeScript suite with 949 tests and the C# agent with 92. Phase 3, completed on 4 October 2026, built the architecture of the Rust diagnostic core: isolated provider calls with deadlines, a report of every kind of hardware source including those the build does not have, a registry and resolver for test definitions, and pure safety logic. Its gate, re-run by the lead, passed 358 Rust tests plus 30 in release mode, 95 C# tests and 979 TypeScript tests, and an adversarial review confirmed 40 of 49 de-duplicated findings, of which 39 were fixed with regression tests and one was partly fixed. The first CI run on the Phase 3 commit failed one Linux test that had hard-coded the result expected on Windows; once the test was corrected, all four CI jobs passed, with 406 Rust test executions on Linux and 388 on Windows (including release-mode and root re-runs) and none failing. Phase 4 extended hardware discovery to storage identity and NVMe health, memory slots, the raw firmware tables, GPU and PCI Express link details, network adapters and displays. Its local gate on 9 October 2026, run by a separate gate agent, passed 669 Rust tests, 101 C# tests and 1,426 TypeScript tests, and release-mode tests ran the parsers against 131 binary test vectors generated independently from the published specifications, each mutated 10,000 times; an adversarial review confirmed 68 of 77 de-duplicated findings, 5 of them blockers, and all 68 were fixed, after which a review of the fixes found 10 regressions, all fixed; and a search for 85 forms of the development PC's own identifiers across 537 files found none. In CI after the fixes, the TypeScript job was lost twice to a runner shutdown, traced to database tests that never closed their test databases and used up the runner's memory; once that was fixed, two further runs on the work-in-progress branch passed all four jobs. CI then passed on the Phase 4 commit on Linux and Windows, including the Linux root and non-root real-hardware steps, which completed the phase on 9 October 2026. Phase 5 added telemetry: a recorder in the core that samples processor, GPU, memory and storage readings over time from sources that need no kernel driver, writes them to an evidence log that survives a crash, and records every metric it cannot read as unavailable with its reason. Its local gate on 11 October 2026, run by a separate gate agent, passed 1,178 Rust tests, 103 C# tests and 1,879 TypeScript tests. On the development PC a recording holds 81 channels of readings and 24 recorded as unavailable, the CPU temperature among them, because Windows does not state it without a kernel driver; five kills of the recorder were each recovered and then verified by two further implementations; and the recorder's own cost measured 0.536 % of one logical processor in CPU cycles over ten minutes, against a limit of 1 %. An adversarial review confirmed 103 of 109 de-duplicated findings, 2 of them blockers, and a separate verifier checked every fix: 92 were fixed, 10 partly fixed and 1 made worse, and a remediation pass then closed those 11, though its own fixes were not verified a second time; a review of the fixes raised 10 regression claims, of which 9 were fixed and 1 waits for an elevated run. A search for 111 identifier strings of the development PC across 619 files found none. CI then passed on the Phase 5 commit on Linux and Windows, including the Linux steps as a standard user and as root on a virtual machine, which completed the phase on 11 October 2026. The limits are stated as plainly as the results. All real-hardware verification so far is on one Lenovo laptop (Intel Core i5-10210U, 16 GB, Windows 11 Pro, UEFI with Secure Boot disabled), and no elevated run on it took place in Phase 4 or Phase 5, so the elevated path was exercised only on GitHub's Windows runner; the Linux runs were on a virtual machine, and no Linux sensor reader has run on physical hardware; no real sleep was observed during a recording, so suspend handling rests on simulated clocks; no bootable image exists yet; no real test or benchmark runs yet, so the safety logic has been exercised only by tables of samples; and the contracts for tests and findings have so far been exercised only by fixtures.

What I took from it

  • Real output catches what tests do not. Both Phase 1 defects were found by checking what the core reported against known facts about the machine, not by the test suite that existed at the time.

  • A protection that only runs in CI is only as good as CI running. The schema lock is enforced only by a test, and that test protects later changes only when it runs in CI, which needed a remote repository. Until the first CI run, the protection existed on paper.

  • Defer what you cannot exercise. Specifying machinery early is cheap; building it before anything can call it produces code the gate cannot test.

  • A finding deserves a challenge before a fix. In the Phase 2 review, a verifier whose job was to refute each finding rejected 2 of 57 before they prompted any change; whether both rejections were right was not independently checked.

  • Ordering by timestamp fails when two environments keep different clocks. Lineage — sequence and parent hash — orders saves correctly where wall-clock time can run backwards.

  • AI-assisted engineering needs evidence from outside the model. The reviewing and implementing agents share a model family, so their blind spots may be correlated. The checks that do not share them are real hardware, CI and the owner's decisions; the re-runs of each gate, by the lead up to Phase 3 and by a separate gate agent in Phases 4 and 5, replace the implementing agents' reports with fresh test results, but they are made by the same model family.

  • A limit is only as good as the instrument that checks it. The recorder's cost limit first passed at 0.06 %, read from accounting that cannot see short timer-driven work; an instrument that under-reports can pass a limit the program does not meet. The gate now counts CPU cycles, and the figure it reports is 0.536 %.