Documentation Inspector kit
Inspector kit
One inspection is one folder. A read-only script captures each host, and five commands take the folder from the first step to a signed and checked proof record. The kit handles no key, opens no keystore, contacts no host and touches no chain.
The same flow in words
inspect newstarts the job folder: the schedule, an empty findings file, the capture script and a code for this inspection.- On each GPU host the capture script runs read-only queries and writes one file with the serial numbers, a telemetry snapshot, the time and the code.
- The capture files go into the job’s
captures/folder. The inspector enters findings infindings.json. inspect buildmatches serials to the schedule, checks each capture, rates every exception, writes the report, the proof record and the evidence index, and prints the record digest.- The inspector signs the digest himself, with his own key. The kit signs nothing.
inspect signchecks the signature and files it, so the record and the report carry it.inspect verifyrebuilds everything from the evidence files, recomputes the digest and checks the signature.
The commands#
node src/inspect.mjs new <job-folder> --schedule <file> --type F|Q|E --date YYYY-MM-DD
[--inspector-id <id>] [--key-id <address>] [--valid-until <date or UTC time>] [--config <file>]
node src/inspect.mjs build <job-folder> [--issued-at YYYY-MM-DDTHH:MM:SSZ] [--reissue]
node src/inspect.mjs sign <job-folder> --signer <address> --signature <0x + 130 hex>
node src/inspect.mjs verify <job-folder> [--key-id <address>] [--require-signature]
node src/inspect.mjs revocation-digest <address>
The kit needs Node 22 or later and no packages. Checking a signature also needs Foundry's cast on the PATH. An option a command does not know is an error.
Quick start#
Try it on the invented sample job.
cd prototype/collector
npm run -s sample-job
open build-output/job-demo/result/report.html
The sample builds to PASS with 16 of 16 units matched, and verify confirms every file. The sample is not signed, so the last line reads Signature: not signed.
Note. Keep real jobs outside the repository. A real job folder holds a client's schedule and serial numbers, which must never be committed.
Start a job#
inspect new copies the collateral schedule into the folder, writes an empty findings file, copies the capture script in, and draws the code of this inspection: 16 hex characters, written to job.json.
The code is not a key and signs nothing. The inspector gives it out on the day, and each capture carries it, so a capture made before the inspection cannot be passed off as today's.
| Option | Meaning |
|---|---|
--inspector-id <id> | The inspector's id. It is in the report and is hashed into the record digest. --inspector is another spelling. Without it the id is DEMO-not-a-real-inspector |
--key-id <address> | The address of the key the inspector will sign with. Optional. When set, sign refuses any other signer |
--valid-until <date or UTC time> | An explicit valid-until. It may not be more than 104 days after the inspection date |
--config <file> | Other validity days or default ratings |
| Engagement type | Meaning | Valid for (proposed) |
|---|---|---|
| F | Funding inspection | 90 days |
| Q | Periodic re-verification | 90 days plus 14 days' grace |
| E | Event inspection | 90 days, a placeholder |
The tools build no record that is valid for more than 104 days. The registry's own cap is 105 days, because a valid-until date runs to the last second of its day.
Capture each host#
sh ibc-capture.sh <code> [output-folder]
Run it in a session the inspector controls or watches. It writes one file, <host>.ibc-capture.txt, and prints that file's SHA-256, which the inspector notes at once. The file holds a short header (host, capture time in UTC, the code, the SHA-256 of the script itself) and four sections.
| Section | Command | Used for |
|---|---|---|
identity | nvidia-smi --query-gpu=index,serial,uuid,name,vbios_version,driver_version --format=csv | The serial match |
telemetry | nvidia-smi --query-gpu=index,serial,utilization.gpu,memory.used,temperature.gpu,power.draw --format=csv | Recorded per matched unit. Not rated |
dcgm | dcgmi discovery -l | Kept as evidence. Not parsed |
system | uname -srm | Kept as evidence |
The script only reads. It changes no setting, installs nothing, needs no root and opens no network connection. A tool that is not installed is recorded as such, and the capture goes on. It never overwrites a capture.
Raw nvidia-smi output saved by hand as <host>.txt is also accepted in the captures/ folder. Such a file carries no time and no code. The report's scope then names those hosts. The record does not.
Build the report#
node src/inspect.mjs build <job-folder>
It matches the serial numbers read from the hosts to the schedule, checks every capture, rates each exception, and writes the result folder. See Report and proof record for what is in it. It then prints the record digest and stops. It signs nothing and checks no signature.
No file in the result carries a build time. The same job gives the same bytes on every build, which is what lets verify compare them.
The issue time#
The record has an issuedAt field, inside the digest. build takes it from the clock the first time, in UTC and whole seconds, or from --issued-at. It keeps it in issue.json in the job folder, together with the hash of the record without it.
- A rebuild of the same record keeps the time.
- If the evidence or the findings changed, the record is another record.
buildtakes a new time, strictly later than the old one, and removessignature.json, because the old signature is over another digest. --reissuetakes a new time on purpose.
build prints a note when registry v2 would refuse the record as built, for example when the inspection date is more than one day after the issue time. It is a note, not an error.
Exceptions from the serial match#
| Type | Meaning |
|---|---|
MISSING | On the schedule, not read from any host |
EXTRA | Read from a host, not on the schedule |
DUPLICATE_IN_SCHEDULE | The same serial on two or more schedule lines |
DUPLICATE_IN_READ | The same serial read more than once |
UNREADABLE | A GPU reported no serial, or a line could not be parsed |
MODEL_MISMATCH | The serial matches, but the model differs |
An exception that no finding explains becomes a Red finding. The inspector can explain one in the findings file; a warranty replacement not yet on the schedule is Amber in the standard. The result is never PASS while the exceptions count is above zero.
Problems with a capture#
Each is a Red finding, because a read that cannot be relied on means the collateral cannot be verified.
| Code | Meaning |
|---|---|
NONCE_MISMATCH | The capture carries another code than this job's |
DATE_MISMATCH | The capture time is more than one day from the inspection date |
TRUNCATED | The file has no end marker |
NO_IDENTITY, IDENTITY_FAILED | The identity query is missing, was cut off, or ended with an error |
NO_HOST, NO_TIME | The header lacks the host or a readable time |
The overall result#
| Open findings | Result |
|---|---|
| Any Red | FAIL |
| Amber only | PASS_WITH_EXCEPTIONS |
| None, or Green only | PASS |
Sign the record#
The kit never creates, opens, reads or stores a key, and never asks for a password. The inspector signs the digest with his own key, in his own terminal. build prints the line:
cast wallet sign --account <your inspector account> <record digest>
cast asks him for the keystore password and prints a signature of 65 bytes. He then hands the signature to the kit:
node src/inspect.mjs sign <job-folder> --signer <his key id> --signature <what cast printed>
sign does four things, in this order, and writes nothing if one fails:
- It recomputes the digest from the job folder. It never takes a digest from anywhere else.
- It checks the envelope itself: 65 bytes, last byte 27 or 28, and
snot above half the curve order. A last byte of 0 or 1 is rewritten to 27 or 28. A highsis refused.castwould accept both; the registry would not. - It checks the signer against the job's
keyId, if one was set atnew. - It asks
cast wallet verifywhether that key signed that digest. This uses public values only.
It then writes signature.json in the job folder and rebuilds, so proof-record.json, report.html and onchain-encoding.json carry the signature. The digest does not change, because the signatures are outside it.
A signature shows which key issued the record and that no field changed afterwards. It does not show that the facts are true, and it does not show that the key is the inspector's. That comes from the engagement letter, which names the key id. See Keys.
Verify a result#
node src/inspect.mjs verify <job-folder> --key-id <the key in the engagement letter> --require-signature
Anyone holding the job folder can run it, with no key. It re-hashes every evidence file, regenerates every file of the result and compares bytes, recomputes the digest, and checks each signature with cast. It prints ok or DIFFERENT per item and ends with VERIFIED or NOT VERIFIED (exit code 1).
| Call | Signature line |
|---|---|
--key-id <address>, and that key signed | Signature: VERIFIED. Signed by <address>, the key given with --key-id. |
--key-id <address>, another key signed | DIFFERENT, exit code 1 |
No --key-id | signed by <address>: compare this with the key in your engagement letter |
| The record is not signed | not signed. Exit code 1 only with --require-signature |
Always give --key-id. job.json is not evidence and is not hashed; a key id in it is only a cross-check, since whoever rebuilds a folder can rewrite it. The reader's side of this command is on Check a record yourself.
The revocation digest#
node src/inspect.mjs revocation-digest <address>
It computes, with no network, the digest a key holder signs to revoke that key, and prints the line to sign. It sends nothing. See Keys.
The plain builder#
src/cli.mjs is the builder without a job folder. It takes the issue time from the clock, so two runs give two digests, and it has no signing step. The v1 Coston2 drivers still call it. Use inspect for a record that is signed and checked.
From here to the chain#
| Path | Driver | State |
|---|---|---|
| Signed record, registry v2 | prototype/e2e/coston2-v2.sh | Built and checked offline and on a local chain. Not yet run by the owner on Coston2 |
| Registry v1, the earlier demo | prototype/e2e/coston2-job.sh | Posts a job's record through the test machine. Registry v1 stores the digest as given and checks no signature |
Both are on Coston2 demo.
What a capture shows, and what it does not#
- It shows which devices answered on which host, at what time, after the code was given out.
- It does not show who owns the devices or where the host is. The standard covers that with a physical inspection and a written confirmation from the facility operator.
- Whoever controls the host can make it answer anything. The capture is only as good as the inspector's control or sight of the session. Manufacturer hardware evidence, which would bind the answer to a genuine device, is not collected.
Not verified. The capture script has run only against a stand-in for nvidia-smi. It has not run on a host with a GPU, and DCGM output is captured but not parsed. No real inspector key has signed a record: the tests sign with the unlocked test account of a local chain, and otherwise use a stand-in for cast.