Skip to content

Code Review Specification: stake-backed attestation

@verdikta/common carries the data contracts of Verdikta's stake-backed security attestation: the listing spec (code_review.json) with its stake block, the public known-issues list (known_issues.json), the builder's baseline.json and signed attestation.json with the trusted-builder key sets, the pinned sandbox versions, the hunter's claim (finding.json), the outcome set, the settlement rule, and the fixture catalogue the design's validation section requires. The design itself lives in verdikta-arbiter, docs/development/stake-attestation-design.md; section numbers below refer to it.

Everything here is shared by the external adapter, the AI Node, the StakeAttestation contract's off-chain tooling and the attestation site, so every arbiter reads the same rules from the same package version. A change is a coordinated release.

Manifest key

A listing archive opts into claim judgement with one optional manifest key:

{
  "version": "1.0",
  "primary": { "filename": "primary_query.json" },
  "codeReview": "code_review.json"
}

The value is the file name of the spec inside the archive (§8.1). The primary file's outcomes must be exactly the outcome set below.

code_review.json

Schema: schemas/code_review.v1.json (JSON Schema draft-07, $id https://docs.verdikta.com/schemas/code_review.v1.json). Validate with codeReview.validateCodeReviewSpec(spec).

{
  "version": 1,
  "kind": "bug",
  "repo": "https://github.com/acme/vault",
  "baseCommit": "9c1e4f0a3b7d2e5c8f1a4b6d9e0c3f5a7b2d4e6f",
  "artifact": { "kind": "contract", "address": "0x1234…5678", "chainId": 8453 },
  "env": { "image": "ghcr.io/verdikta/stake-env@sha256:…", "from": "foundry",
           "platform": "linux/amd64", "unpackedBytes": 1200000000 },
  "attestation": "attestation.json",
  "commands": { "framework": "forge", "build": "forge build", "test": "forge test",
                "testFiles": "forge test --match-path $FILES", "testIds": "forge test --match-test $TEST_IDS" },
  "baseline": "baseline.json",
  "paths": { "tests": ["test/**"], "protected": ["foundry.toml", "lib/**", ".github/**"] },
  "limits": { "cpus": 2, "memoryMb": 4096, "buildSeconds": 90, "testSeconds": 180, "runSeconds": 360,
              "maxPatchBytes": 2000000 },
  "stake": {
    "awards": { "LOW": "0", "MEDIUM": "0.1 ETH", "HIGH": "0.4 ETH", "CRITICAL": "2 ETH" },
    "lowestClassCounted": "MEDIUM",
    "bondWei": "20000000000000000",
    "fixWindowDays": 30,
    "disputeWindowHours": 72,
    "disclosureGraceHours": 48,
    "revealWindowDays": 7,
    "scope": { "include": ["contracts/**"], "exclude": ["test/**", "script/**"] },
    "documents": ["README.md", "docs/**"],
    "knownIssues": "known_issues.json",
    "severityRubric": "immunefi-v2.3",
    "disclosureKey": "age1…",
    "valueAtRiskUsd": 1250000
  }
}
Field Rule
version 1
kind bug: the submission is a proof of concept, not a change. The only value v1 accepts; the field exists so another kind can be added without a format change
repo, baseCommit HTTPS URL; full commit hash (40 hex, or 64 for SHA-256 repositories)
artifact Optional; absent means repo. contract requires address and chainId. skill is in the schema but rejected (ARTIFACT_KIND_UNSUPPORTED) until its harness image exists (§8.8)
env Image pinned by digest (at most 512 characters), built from one of node22, python312, foundry; platform linux/amd64; attested unpacked size at most 6 GB. Only foundry is accepted in the MVP (BASE_IMAGE_UNSUPPORTED) until the Node and Python adapters ship (§17, §20 decision 17)
attestation File name of the builder's signed statement (§8.2; default ATTESTATION_FILE, attestation.json). The external adapter verifies it with codeReview.validateAttestation before any pull or work (below)
commands framework is one the runner can attach a JUnit reporter to (vitest, jest, mocha, pytest, forge); test is required; setup, build, testFiles, testIds, lint are optional here. A forge listing also has to pass the runner's rule (owner decision Q31): build is plain forge build, and test, testFiles (with $FILES) and testIds (with $TEST_IDS) are plain forge test, each with only the flags the runner allows, because the runner runs forge itself, with no shell. Anything else is COMMAND_NOT_ALLOWED, at listing and at claim. setup stays free-form: it runs only while the image is built. This package holds no copy of that grammar, because copies drift: the builder asks the runner (verdikta-arbiter code-runner/README.md, "The forge commands")
baseline File name of baseline.json (default BASELINE_FILE): per-test status at baseCommit over three runs (below). Optional in the schema, required in practice: the attestation binds a baseline, and validateAttestation reports a spec that names none (ATTESTATION_BINDING_MISMATCH)
paths Required. tests (required): where a claim's poc.patch may add files and nothing else (testPathsOnly, §10.1). protected: reset to the listed version before anything runs
limits Each value may only lower the class hard maximum (§9.1): 2 CPUs, 4096 MB, 90 s build, 360 s run, 2,000,000-byte patch; testSeconds may not exceed runSeconds. A value above the maximum is reported as LIMIT_ABOVE_CLASS_MAX, an image above 6 GB as IMAGE_ABOVE_CLASS_MAX. The time limits also have class floors, CLASS_TIME_FLOORS (owner decision Q84): 60 s build, 30 s test, 180 s run. The runner raises a time limit below its floor to the floor whatever the spec says, and a listing check's defaults are at least the floors (below, "Limits and the class time floors")
stake Required; below

Limits and the class time floors (owner decision Q84)

A spec's limits may only lower the class hard maximum, CLASS_HARD_LIMITS (§9.1). The three time limits also have a floor, CLASS_TIME_FLOORS: 60 s build, 30 s test and 180 s run. The runner applies both whatever the spec says: a time limit below its floor is raised to the floor, and a value above its maximum is refused before any work (LIMIT_ABOVE_CLASS_MAX). A spec may still state less than a floor. The schema's minimums stay at 1, so listings signed with lower values stay valid, and their claims run with the floors.

codeReview.effectiveTimeLimits(limits) gives the limits a run gets: a new frozen object with buildSeconds, testSeconds and runSeconds each raised to its floor, and every other key as given. It takes a spec's limits (undefined or null gives {}) or the runner's whole limits object. A time key that is absent or undefined is left out, since the class maximum applies to it and every floor is at or below its maximum. Raising keeps testSeconds within runSeconds. A value that is not a number is a TypeError.

A listing check's default limits are at least the floors, so a listing never states less time than its claims get.

The floors come from a timing run. A listing's default limits are three times what its listing check measures. That check runs on the signing workflow's runner, which measured three to four times faster than an arbiter running claims under gVisor (2 CPUs, 4096 MB). Listings signed with a 12 s build, 4 s test and 45 s run therefore left a claim no room, and every arbiter abstained at the build step. The floors are the same 3× margin on an arbiter's times, rounded up:

Floor Value From the arbiter's times
buildSeconds 60 a build of up to 15.5 s (3 × 15.5 = 47)
testSeconds 30 a suite run of up to 4.7 s (3 × 4.7 = 14)
runSeconds 180 its own listing check derived 156–167 s; also 60 + 3 × 30 + a 30 s prepare

Each floor is below its cap (90, 360, 360), so the 780 s deadline still holds, and the package refuses to load if a floor is above its cap or the test floor above the run floor.

The stake block (§8.1)

Field Rule
awards One amount per class, LOW to CRITICAL. An amount is a wei decimal string or ether with the unit ("0.4 ETH", up to 18 decimals). Awards must not decrease with severity (STAKE_AWARDS_NOT_MONOTONE), and every class at or above lowestClassCounted must pay more than 0 (STAKE_COUNTED_CLASS_UNPAID)
lowestClassCounted The lowest class that is paid and that the badge counts
bondWei The hunter's bond in wei, returned on any valid or DUPLICATE outcome and on a narrow INVALID, and forfeited on any other INVALID. A narrow INVALID is an INVALID whose valid mass is at least the floor narrowInvalidFloor (erratum E8 of §13.2, owner decisions Q70 and Q72): nothing is paid or published, and the bond comes back. The floor is not a field of this block: it is a program value the contract owner sets, from 250,000 (NARROW_INVALID_FLOOR_MIN) to the threshold T, and the contract copies it onto each listing when it is made, so a live listing keeps the floor its hunters saw. Its default, until the owner sets it, is T: an empty band, so every INVALID forfeits. A gate failure or a tamper flag puts all the mass on INVALID and is never narrow. settleBugOutcome takes the listing's floor as options.narrowInvalidFloor (below). A bond above the CRITICAL award is a warning (STAKE_BOND_EXCEEDS_TOP_AWARD). codeReview.minimumBondWei(awards, toleranceBps) gives p_tolerated × top award (§10.8)
fixWindowDays Optional. Default 14, or 30 for a contract artifact (§7.1)
disputeWindowHours Optional. Default 72
disclosureGraceHours Optional. Default 48: how long the maker has to flag a bad disclosure (§14)
revealWindowDays Optional. Default 7: how long after a claim becomes revealable before anyone may expire it (§13.2)
scope include globs (required) and exclude globs. A finding's affected paths must fall inside
documents Optional. Up to 16 globs naming where the code's requirements are written, such as README.md or docs/**, which the runner adds to the jurors' context pack right after the in-scope source (owner decision Q61 (a)). Below, "Stake documents"
knownIssues Optional. File name of the public known_issues.json inside the listing archive (below)
severityRubric immunefi-v2.3
disclosureKey Required. The maker's dedicated encryption key: an age recipient (age1…) or a base64 32-byte X25519 public key. Never the wallet key (§14). It must decode (parseDisclosureKey): a broken bech32 checksum, non-canonical base64 or a low-order point is STAKE_DISCLOSURE_KEY_INVALID, since no claim could be encrypted to it
valueAtRiskUsd Optional, shown by the record beside the stake

codeReview.effectiveStake(spec) returns the block with its defaults filled and the amounts as bigint wei.

Stake documents (owner decision Q61 (a))

The jurors' first question is whether the behaviour a PoC asserts is required of the code, by its specification, documentation, interface contract or the listing's scope (§10.3). stake.documents names where those requirements are written, such as README.md or docs/**, and the runner adds the files to the context pack right after the in-scope source. The field is optional. A listing without it, or with an empty list, validates as before, and its archives, packs and reports are byte for byte what they were before the field existed.

The field. At most STAKE_DOCUMENT_LIMITS.maxEntries (16) unique document globs. A document glob is a Glob as in scope (1 to 512 characters, no leading slash, no whitespace) that is also a plain repository path pattern in its one spelling, the way git lists paths. Its language is the scope's: README.md, docs/**, docs/**/*.md, **/*.md, **/docs/**, docs/*-spec-*.md and docs/v?/*.md are all document globs. codeReview.documentGlobProblem(entry) says why an entry is not one. validateCodeReviewSpec reports each bad entry at its own path (/stake/documents/<index>), with its own code, whether or not the rest of the spec is valid:

Code Entry
STAKE_DOCUMENT_OUTSIDE_REPOSITORY Has a .. segment or starts with /
STAKE_DOCUMENT_NOT_PLAIN Has a . or empty segment, a leading ./, a trailing /, a backslash or a NUL
STAKE_DOCUMENT_GLOB_INVALID Not a string, empty, longer than 512 characters (counted as code points, as the schema counts them), or holds whitespace
STAKE_DOCUMENT_DUPLICATE The same as an earlier entry; the detail names it

More than 16 entries, or a value that is not a list, is the schema's own issue (SCHEMA, at /stake/documents). Documents never widen the scope: a finding's affected paths must still fall inside scope.

Which files. codeReview.selectDocuments(treePaths, stake, affectedPaths) picks them, so the runner and the site pick alike:

  • The candidates are the listed commit's own file paths (git ls-tree -r at baseCommit), each a plain path in its one spelling. Nothing else is ever selected, so no document is outside the repository or the listed commit. The runner reads each one from the listed commit's objects by commit id, never from the work tree, so nothing the PoC writes reaches the tier.
  • Entries are taken in the listing's order, and each entry's matches in the UTF-8 byte order of their paths (the order git ls-tree -r lists them), each file once. The listing's order is its priority.
  • A glob matches as a scope glob does, by the same automaton: ** crosses directories, * and ? stay within one segment, and case counts. An entry that is not a document glob matches nothing.
  • The work is bounded. Documents are matched against every file of the listed commit, not a claim's few paths, and the automaton costs up to path length × glob length per pair: 16 crafted globs over 1,000 long file names took 42 seconds. So a path runs through the automaton only when it holds the glob's literal text (the characters before its first wildcard, after its last, and each run between, in order), and the automaton's work is counted: one step is one live state after one character.
  • Past maxMatchSteps (50,000,000), selectDocuments throws a RangeError whose message and code are DOCUMENTS_MATCH_TOO_COSTLY.
  • The count depends on the globs and the paths alone, so every host stops at the same point. Most paths never reach the automaton: 16 usual globs over 100,000 files take about 180,000 steps. A glob that matches every file of a 250,000-file tree takes about 30,000,000, and the tier reads 32 files whatever a glob matches. Globs written to cost reach the bound in about a second and a half, whatever the tree.
  • The builder runs selectDocuments on the listed commit and refuses a listing that throws, so a listing never stalls the arbiters on its claims. A runner that meets one anyway treats it as the requester's broken package.
  • A file also in scope: a matched file the source tier holds (an affected path in the stake's scope, by splitByStakeScope) appears once, in the source tier. It is reported as inSource and takes no place here. A document in scope that the finding does not name stays in the documents tier.
  • The first maxFiles (32) of the others are paths, read in that order. The rest are pastCap: left out, and the pack says how many.

Which files count. A document is a regular file (git mode 100644 or 100755) of at most maxFileBytes (1,000,000) bytes whose whole content is UTF-8 text: well-formed UTF-8 with no NUL byte (codeReview.isDocumentText). Anything else among paths is skipped with a note in the pack: a symlink or a submodule (a document never reaches into a submodule, whose files are not the listed commit's), a larger file (left unread), or a binary or other non-UTF-8 file.

The tier. CONTEXT_PACK_TIERS gives the pack's order: the PoC, the claim, the in-scope source, the documents, call sites, known issues, prior findings, the fix diff and the file tree. So the documents tier sits right after the in-scope source and before call sites. Its files are labelled as the maker's documents at the listed commit. The tier exists only when the listing names documents: without them, the pack has no documents tier, and every other tier keeps its rank, file names and bytes. buildClaimQuery does not name the documents. The query is the same with or without them, and the pack's tier is what tells the jurors.

Limits. STAKE_DOCUMENT_LIMITS.tierBytes holds what the tier takes, in bytes of the pack as the runner counts a tier (each file with its header line and fence allowance). They come from the class envelope's budget at the pack's 4 bytes per token:

Class Pack budget reserved (10%) max (20%)
code-standard 60,000 tokens = 240,000 bytes 24,000 48,000
code-premium 120,000 tokens = 480,000 bytes 48,000 96,000

Files are taken whole while they fit. The first one that does not fit is cut at a whole character and marked as cut, and the rest are left out. The pack's manifest counts each.

Over budget, lower tiers drop first, and the pack says so. Each tier takes its share in priority order, then room left over goes back up in the same order. The documents' share is reserved. It comes after the shares of the PoC, the claim and the source, and before those of the tiers below. So:

  • documents never take any of the PoC's, the claim's or the source's share. Like the share of every tier below, reserved comes before those tiers get more than their own share;
  • a hunter who pads poc.patch, report.md or the files the finding names cannot push the first reserved bytes of documents out;
  • past reserved, and up to max, documents take only room the tiers above leave;
  • when every tier is full, the tiers below give up the documents' share, lowest first: prior findings, then known issues, then call sites. The fix diff and the file tree, which have no share, get only what is left, as without documents.

Whatever a tier leaves out is counted in the manifest with its reason, as for every tier.

Rollout. An arbiter on an earlier package refuses a listing with documents (the stake block admits no unknown key), and a runner without the tier does not read them. A listing should name documents only once arbiters run a runner that builds the tier.

known_issues.json

Schema: schemas/known_issues.v1.json. Validate with codeReview.validateKnownIssues(list). Public, fixed at listing; a claim whose root cause matches an entry settles DUPLICATE (§8.4), even when the entry calls the behaviour intended or accepted (owner decision Q73 #5).

[
  { "id": "sha256:…",
    "title": "Rounding favours the vault on withdraw",
    "class": "LOW",
    "paths": ["contracts/Vault.sol"],
    "description": "Share-to-asset conversion on withdraw rounds down by up to one wei …" }
]

id is codeReview.knownIssueId(entry): sha256: plus the SHA-256 of the canonical JSON of the body (class, description, paths, title, in that key order). The ids are stored on-chain at listing, so a body that is edited afterwards no longer matches (KNOWN_ISSUE_ID_MISMATCH); an id may not repeat (KNOWN_ISSUE_DUPLICATE_ID). A list holds at most 256 entries (MAX_KNOWN_ISSUES, the contract's MAX_KNOWN_ISSUES). Known issues cannot be added after the listing opens: the maker fixes and rolls forward, or leaves the issue claimable.

baseline.json

Schema: schemas/baseline.v1.json. Validate with codeReview.validateBaseline(baseline, spec?). The environment builder runs the suite BASELINE_RUNS (3) times at baseCommit without network and records every test identity with its result on each run (§8.2 step 2).

{
  "version": 1,
  "baseCommit": "9c1e4f0a3b7d2e5c8f1a4b6d9e0c3f5a7b2d4e6f",
  "framework": "forge",
  "runs": 3,
  "tests": [
    { "id": "test/Vault.t.sol > VaultTest > test_deposit", "results": ["pass", "pass", "pass"] },
    { "id": "test/Oracle.t.sol > OracleTest > test_staleness_window", "results": ["pass", "fail", "pass"] }
  ],
  "stable": ["test/Vault.t.sol > VaultTest > test_deposit"],
  "unstable": ["test/Oracle.t.sol > OracleTest > test_staleness_window"],
  "timings": { "buildSeconds": 14.2, "testSeconds": [21.5, 20.9, 22.1] }
}
Field Rule
baseCommit, framework Equal to the spec's baseCommit and commands.framework when the spec is given (BASELINE_COMMIT_MISMATCH, BASELINE_FRAMEWORK_MISMATCH)
runs 3 (BASELINE_RUNS)
tests Each identity once (BASELINE_DUPLICATE_TEST), with exactly three results from BASELINE_TEST_RESULTS: pass, fail, error, skip
stable Exactly the identities that passed all three runs: the set the fix check compares against (§9.2 step 8)
unstable Every other identity. Excluded from the fix check up front; nothing learned later can add to it. A set that disagrees with the results, or names an identity not in tests, is BASELINE_SET_MISMATCH
timings Optional: build seconds, and suite seconds per run. Informational; the listing's limits are derived from them, and a listing check's defaults are at least the class time floors (above, "Limits and the class time floors")

codeReview.baselineSets(tests) is the rule itself, returning { stable, unstable } in the order given, for the builder to write and the validator to check. An empty stable set is a warning (BASELINE_NO_STABLE_TESTS): a fix check then has nothing to compare.

attestation.json

Schema: schemas/attestation.v1.json. The builder's signed statement that it validated this listing on these bytes (§8.2 step 5). A digest pins the image; the attestation states that validation happened on it.

{
  "version": 1,
  "trust": "production",
  "issuedAt": "2026-10-31T12:00:00Z",
  "repo": "https://github.com/acme/vault",
  "baseCommit": "9c1e4f0a3b7d2e5c8f1a4b6d9e0c3f5a7b2d4e6f",
  "env": {
    "image": "ghcr.io/verdikta/stake-env@sha256:…",
    "from": "foundry",
    "base": "ghcr.io/foundry-rs/foundry:v1.8.5@sha256:f00b02…",
    "platform": "linux/amd64",
    "unpackedBytes": 1200000000
  },
  "sha256": { "codeReview": "…", "baseline": "…", "knownIssues": "…" },
  "tools": { "runner": "1.0.0", "gvisor": "release-20260921.0", "semgrepRules": "2026.10" },
  "signature": { "algorithm": "Ed25519", "keyId": "…64 hex…", "value": "…base64…" }
}
Field Rule
version 1 (ATTESTATION_VERSION)
trust The trust set the statement is for, one of TRUST_MODES: production (a key in the package's trusted-builder set) or dev (a per-run harness key). It is inside the signed bytes, so a dev attestation can never satisfy production verification
issuedAt UTC to the second (YYYY-MM-DDTHH:MM:SSZ). Compared only with a key's retiredAt, never with the verifier's clock
repo, baseCommit Equal to the spec's
env image, from, platform and unpackedBytes equal to the spec's env; base is the upstream image the environment was built FROM, by digest (BASE_IMAGE_PINS)
sha256 Lowercase hex SHA-256 of the exact bytes of code_review.json, baseline.json and known_issues.json. knownIssues is null exactly when the spec names no known-issues file
tools The code-runner version, the gVisor release and the Semgrep rule-set version the listing was validated with
signature algorithm Ed25519 (ATTESTATION_SIGNATURE_ALGORITHM); keyId names the key; value is the 64-byte signature in canonical base64. The public key is never in the file

What is signed

codeReview.attestationSigningBytes(attestation) returns the bytes the signature covers: the line verdikta-attestation/v1 (ATTESTATION_SIGNING_CONTEXT), a newline, then the canonical JSON of every field except signature. The context line separates these signatures from anything else a builder key might ever sign.

codeReview.canonicalJson(value) is the canonical form: object keys sorted by UTF-16 code unit, no whitespace, strings escaped as JSON.stringify escapes them, integers in decimal — RFC 8785 restricted to the values these documents use. It throws TypeError on floats, unsafe integers, lone surrogates and anything that is not plain JSON, rather than give a value two forms. The key order in attestation.json therefore does not matter, and any change to a signed field breaks the signature.

A key id (codeReview.builderKeyId(publicKey)) is the lowercase hex SHA-256 of the 32-byte raw Ed25519 public key. It is derived from the key, so it cannot be reused for another key, and every key set checks it.

Producing one

  • codeReview.createAttestationStatement({ files, trust, issuedAt?, tools, base? }) builds the unsigned statement from the listing's bytes: it copies repo, baseCommit and env from files.codeReview, hashes the three files and fills tools.gvisor, tools.semgrepRules and env.base from the pins unless given. trust must be stated; tools.runner is required; the spec must name its baseline, and files.knownIssues is required when the spec names one. issuedAt defaults to now. Anything that would not make a schema-valid statement throws TypeError. It does not judge the spec (validateCodeReviewSpec does; the builder runs both), so a harness can attest a spec the external adapter must still refuse on its own merits.
  • codeReview.signAttestation(statement, privateKey) signs it with the caller's Ed25519 private key (a KeyObject, or PEM/DER) and returns a copy with signature. The package holds no private key.
  • codeReview.createDevBuilderKey() returns { privateKey, publicKey, keyId }, a fresh key pair for one harness run; publicKey is the base64 of the raw key, ready for dev trust. Nothing is stored.

Verifying one

codeReview.validateAttestation(attestation, { files, trust }) runs before any image pull or work (§9.1). attestation is the parsed attestation.json (or undefined when the archive has none); files holds the exact bytes (Buffer, Uint8Array, or a string hashed as UTF-8) of codeReview, baseline and knownIssues — the files the spec names. It returns { ok, issues, warnings }; an issue means the requester's package is broken (errored path, no commit), and every arbiter reaches the same answer from the same bytes: the checks read no clock and no network.

Code When
ATTESTATION_MISSING No attestation
SCHEMA, IMAGE_ABOVE_CLASS_MAX The file does not match the schema (an unknown field, an embedded public key, a non-canonical base64 signature, an image above 6 GB)
ATTESTATION_TRUST_MODE_MISMATCH The statement's trust is not the verification's mode
ATTESTATION_UNTRUSTED_KEY keyId is not in the trust set
ATTESTATION_KEY_RETIRED The key was retired at or before issuedAt
ATTESTATION_BAD_SIGNATURE The signature does not verify over the canonical bytes under that key
ATTESTATION_FILE_MISSING A bound file is not in files
ATTESTATION_HASH_MISMATCH A file's SHA-256 is not the bound one
ATTESTATION_SPEC_UNREADABLE code_review.json is not a JSON object
ATTESTATION_IMAGE_MISMATCH, ATTESTATION_PLATFORM_MISMATCH The attested image digest or platform is not the spec's
ATTESTATION_SPEC_MISMATCH The attested repo, baseCommit, env.from or env.unpackedBytes is not the spec's
ATTESTATION_BINDING_MISMATCH The spec names no baseline; or it names a known-issues file the attestation does not bind, or the reverse

Warnings: ATTESTATION_DEV_TRUST whenever dev trust verified it (never acceptable for a production listing; the external adapter must refuse dev trust on mainnet); ATTESTATION_TOOL_VERSION_DIFFERS when the listing was validated with a gVisor release or Semgrep rule set other than this release's pins; ATTESTATION_BASE_IMAGE_DIFFERS when env.base is not the pinned base image (by image or index digest).

Passing files values that are not bytes (a parsed object), or a trust option of any other shape, throws TypeError: those are programming errors, not properties of the listing.

Trusted-builder keys

  • codeReview.PRODUCTION_BUILDER_KEYS is the production set (§20 decision 5), frozen. An entry is { keyId, publicKey, retiredAt? }: the key id (required, and checked against the key), the base64 of the 32-byte raw public key, and an optional retirement time. Public keys only. It holds one key:
Key id Public key
c400af59dc75cf7cb0bc2430833d29047955ae99c18a1d007700588a84b45b13 uz7rKoXvOR8ut8NOUO5qoZHwsunMCq5yKtNRgskqAHU=
  • Production trust is the default: omit trust, or pass {} or { dev: false }. It reads only PRODUCTION_BUILDER_KEYS; no caller can add a key to it.
  • Dev trust is trust: { dev: true, keys: [{ publicKey, keyId?, retiredAt? }] } with publicKey the base64 raw key or a public KeyObject. It trusts exactly the keys given and never the production set. Keys passed without dev: true (exactly the boolean) throw. Harnesses generate a key per run with createDevBuilderKey(); no private key is committed anywhere. A dev-signed attestation fails production verification twice over: its key is not in the production set, and its signed trust is dev.
  • Rotation adds a key and keeps the old one valid for the listings it attested (§20 decision 5). The list ships in this package, so arbiters on different releases can answer differently about the same listing, and the order matters:
  • Add the new { keyId, publicKey } to src/codeReview/trustedBuilderKeys.js, release, and upgrade every arbiter. Both keys now verify. An arbiter that has not upgraded refuses the new key with ATTESTATION_UNTRUSTED_KEY.
  • Switch the builder to the new key.
  • Set retiredAt on the old key to a time after its last signature, and release. It keeps verifying what it attested: issuedAt before retiredAt. An attestation issued at or after that time gets ATTESTATION_KEY_RETIRED. Keep the entry while any listing it attested is open.

retiredAt is optional, and a key without one has no end date, for new attestations too. Verification reads no clock: it compares retiredAt with the issuedAt the signer wrote. - A compromised key is removed, not retired. issuedAt is the signer's own claim, so whoever holds the old private key can backdate past any retiredAt. Removing the entry fails every listing the key attested with ATTESTATION_UNTRUSTED_KEY, and if it was the only key, every production verification. Re-attesting writes a new attestation.json, so a new archive and CID, and StakeAttestation.list stores a listing's CID once. An open listing recovers only as a new listing.

Pinned sandbox versions (§7.2, §9.3)

Every arbiter's runner and the site's builder read these from the same package version; a bump is a coordinated release, and the attestation records what the listing was validated with.

Export Value
BASE_IMAGE_PINS.foundry { repository: 'ghcr.io/foundry-rs/foundry', version: 'v1.8.5', digest, indexDigest, reference, platform: 'linux/amd64' }. digest is the linux/amd64 image manifest sha256:f00b023f65e3aab6b7f994dd13b9faff1441aba92df60a53850cb644a4b8b3b5; indexDigest the multi-platform index sha256:32c8ea9ef052a440cb1620175987a3f49eff8b068a0c6a3d09ebf7f5f9a0e043; reference is repository:version@digest. Only foundry in the MVP (§20 decision 17)
OCI_PLATFORM linux/amd64, the only platform the runner serves
FORGE_FUZZ_SEED 0x76657264696b7461 (ASCII "verdikta"), passed to every forge run as --fuzz-seed so fuzz and invariant tests draw the same inputs on every host
GVISOR_RELEASE release-20260921.0, the runsc release the runner and builder sandbox with
SEMGREP_RULES_VERSION 2026.10, the version id of Verdikta's offline Semgrep rule set (honesty flags and the baseline scan)
CONFORMANCE_CANARY The conformance canary's expected report hash and what it came from (below)

The conformance canary (§7.2, §16)

A fixed listing and claim (verdikta-arbiter code-runner/conformance/) go through the real runner, under the pinned gVisor, on the class platform. codeReview.CONFORMANCE_CANARY holds the report hash that run gives. An arbiter's conformance self-test compares its own run with it (§16; the installer's node A8, not built yet).

Field Value
reportSha256 c8e190589f229ea299b4c5784d2e0880965550455d9b48a36aa6815606646592
runner 0.3.0 (RUNNER_VERSION in the runner)
gvisor release-20260921.0, equal to GVISOR_RELEASE
semgrepRules 2026.10, equal to SEMGREP_RULES_VERSION
platform linux/amd64, equal to OCI_PLATFORM
imageDigest, baseCommit, listingCid, bcid The canary's image, listed commit, listing and claim, as the report names them
source { run, commit, workflow, artifact }: run 42952941962 of Code Runner Calibration, at 9b4ff54, artifact conformance-and-calibration

The value comes from the run. A local run prints no hash, by design. The run's artifact is committed byte for byte under test/fixtures/code-review/conformance-and-calibration/, and test/unit/codeReviewConformance.test.js recomputes the pinned hash from the report in it with reportSha256. It also requires every field above to be the report's own, and the three pins beside them to agree, so a new GVISOR_RELEASE, SEMGREP_RULES_VERSION or OCI_PLATFORM fails the tests until the canary is re-pinned.

This repo's CI has no token to read another private repo, so the check that the committed bytes are the run's is a reader's:

RUN=42952941962
gh run view "$RUN" -R verdikta/verdikta-arbiter --log | grep 'conformance report sha256'
gh run download "$RUN" -R verdikta/verdikta-arbiter -n conformance-and-calibration -D /tmp/canary
cmp /tmp/canary/conformance.json test/fixtures/code-review/conformance-and-calibration/conformance.json
cmp /tmp/canary/calibration-results.json test/fixtures/code-review/conformance-and-calibration/calibration-results.json

GitHub keeps a run's artifact for 90 days (this one until 2027-02-09), so the committed copy is what stays. Its digest at the run was sha256:fbf0c627e4ad24851e3ff2a4127ca33d5b3bff58c1e23b4513c5a3072366361d.

What moves the hash. Every input the report names. RUNNER_VERSION is among them, so any runner release moves the hash even when nothing else changed. So do a new gVisor release, Semgrep rule version or base image, a change to the canary's recipe or claim, a change in what forge prints for its failure, and a change to this package's report schema or canonical form.

What a runner release has to do:

  1. In verdikta-arbiter, set the runner's version in code-runner/package.json. If the canary's inputs moved, run npm run conformance -- --write-lock in code-runner/ and commit conformance/canary.lock.json. A lock that no longer matches stops the conformance run and says so.
  2. Let the Code Runner Calibration workflow run. It runs npm run conformance -- --repeat 2 under the pinned gVisor, and records the hash in the job summary, a notice and the conformance-and-calibration artifact.
  3. Re-pin here. Download the artifact and copy both files over the committed ones. Update CONFORMANCE_CANARY in src/codeReview/pins.js from conformance.json (the hash, the versions, the inputs and source), and the literal values in test/unit/codeReviewConformance.test.js. If the artifact's calibration results changed what a case settles as, update the catalogue. npm test must pass.
  4. Publish a prerelease of this package.
  5. Pin that prerelease exactly in the arbiter's packages. Arbiters on it then expect the new hash, and arbiters on the old pin keep passing against the old one.

A bump of a pin in this package (GVISOR_RELEASE, SEMGREP_RULES_VERSION, BASE_IMAGE_PINS) goes the same way, except that step 2's run has to use the new pin before a release carries it: point the arbiter's branch at this package's branch (npm pack), run the workflow, and re-pin on the same branch.

finding.json

Schema: schemas/finding.v1.json. Validate with codeReview.validateFinding(finding, spec?). The claim archive (bCID) carries it beside report.md, poc.patch and, optionally, fix.patch (§8.5).

{
  "version": 1,
  "title": "Reentrancy in Vault.withdraw",
  "claimedClass": "HIGH",
  "rootCause": "Vault.withdraw sends ETH with call before it zeroes balances[msg.sender], so …",
  "affectedPaths": ["contracts/Vault.sol"],
  "poc": {
    "command": "forge test --match-test testReenterDrainsVault",
    "observable": "testReenterDrainsVault fails at the committed hash with \"attacker balance 2000000000000000000 > deposit 1000000000000000000\""
  },
  "fixIncluded": false
}
Field Rule
claimedClass LOW, MEDIUM, HIGH or CRITICAL. Below lowestClassCounted is allowed and warned (CLASS_BELOW_LOWEST_COUNTED): valid, published, unpaid
rootCause One paragraph, 20 to 2,000 characters, no blank line (ROOT_CAUSE_NOT_ONE_PARAGRAPH)
affectedPaths Repository-relative, no leading slash, no ..; each inside the stake's scope when the spec is given (PATH_OUT_OF_SCOPE, the inScope gate of §10.1)
poc.command The command a reader runs to reproduce the proof of concept. The runner does not execute it: it runs the listing's own testFiles and testIds (owner decision Q31), and reads the test names here and in poc.observable
poc.observable The assertion failure the runner must observe at the committed hash (claimedObservable, §10.1). The two fields must name a test the patch added and no other test. Quote what forge records in double quotes: each quoted fragment must be in the recorded failure of a named test on every run. With nothing quoted, the whole recorded message must appear in the text as written. So the rule is: name the test, and quote the message forge prints. A failure here settles INVALID
fixIncluded True when fix.patch is present. The fix is checked and reported but never changes the outcome

Against a spec whose kind is not bug, validation fails with SPEC_NOT_BUG.

Outcomes and settlement (§8.7)

A claim evaluation's primary file lists exactly ["INVALID", "DUPLICATE", "LOW", "MEDIUM", "HIGH", "CRITICAL"], in that order (codeReview.BUG_OUTCOMES; check with validateBugOutcomes). INVALID is first so the existing malformed-archive settlement (full mass on the first outcome) means what it should. The jury's vector sums to 1,000,000 as everywhere in Verdikta; the aggregator averages the clustered reveals with integer division, flooring each of the six components, so the vector it records sums to between 999,995 and 1,000,000 (OUTCOME_MASS_MIN_TOTAL), and settleBugOutcome accepts exactly that range. The contract settles it with the program threshold T (DEFAULT_SETTLEMENT_THRESHOLD, 500,001 — a strict majority, so an exact tie between two classes settles to the lower one — stands in for the contract's constant).

codeReview.settleBugOutcome(vector, stake, { threshold, narrowInvalidFloor }) is the rule:

  1. the claim is valid when the mass on LOW..CRITICAL together is at least T;
  2. if valid, the class is the highest class whose mass at-or-above reaches T (the median class when T is a majority), so a 40/35/25 split between three valid classes pays the middle one instead of nothing. The award is awards[class] when the class is at or above lowestClassCounted, else nothing; the bond is returned; the finding is published either way;
  3. otherwise the outcome is DUPLICATE when its mass is at least INVALID's, else INVALID. DUPLICATE returns the bond; INVALID forfeits it to the maker, unless it is narrow: its valid mass (the mass on LOW..CRITICAL) is at least the listing's narrowInvalidFloor, and then the bond comes back (erratum E8). Neither pays or publishes.

The floor decides only the bond, never the outcome: every vector settles to the same outcome at every floor, which is what the contract's differential test compares. INVALID already means a valid mass below T, so the band is [narrowInvalidFloor, T − 1]. narrowInvalidFloor is an integer from 250,000 (NARROW_INVALID_FLOOR_MIN, owner decision Q72) to the threshold in force, and defaults to it, the empty band, in which every INVALID forfeits as before E8; T itself is always accepted, so a threshold below 250,000 admits only the empty band. Any other value throws a TypeError. Pass the floor of the listing the claim was made on, and the vector settle applies: the claim round's, or the dispute panel's once it has replaced it.

A gate failure or a tamper flag arrives as the full mass on INVALID, which is exactly when the bond is forfeited: with no valid mass it is never narrow, so the contract never has to tell a gate failure from a jury rejection. A PoC that failed another integrity check, with reproduces failing only through that check, arrives as the full mass on DUPLICATE: bond back, no award (§9.5, §12, owner decision Q35). A test that passed, errored, was skipped, went missing or appeared twice on a run fails reproduces on its own, so it stays INVALID whatever integrity says. The External Adapter's settleReport decides this from the report's own fields. The result carries outcome, outcomeIndex, valid, duplicate, class, validMass, classMass, counted, paidWei, bond, published and narrow (true only on a narrow INVALID).

Gates this package decides (§10.1)

  • codeReview.pocPatchPathsGate(touchedPaths, spec) is testPathsOnly: every path poc.patch touches must match paths.tests and none may match paths.protected (framework configuration, lockfiles, CI: always the maker's, §9.2 steps 3–4). It returns { pass, outside, protected }: outside lists the touched paths not under paths.tests, protected the ones under paths.protected (a path can be in both). A patch that edits source is a fix and belongs in fix.patch; an empty patch fails. The gate fails closed on a path it cannot read as a plain repository path: one with a backslash (an ordinary file-name character on Linux, never a separator), NUL, or a ., .. or empty segment (git never writes these in a diff) is outside, reported as given, and matched against nothing.
  • codeReview.validateFinding(finding, spec) is inScope: the finding parses and every affected path is inside the stake's scope.
  • codeReview.splitByStakeScope(paths, scope) applies the stake's include/exclude globs; a path that is not a plain repository path is out of scope.

Globs are repository-relative: ** crosses directories, * and ? stay within one segment (** and * both cross line terminators in a file name), everything else is literal. The matcher has no dependency so every arbiter matches alike, and it does not backtrack: matchesAny and the gates run a glob as an automaton in time proportional to path length × glob length, so a requester's glob or a hunter's path cannot stall an arbiter. codeReview.globToRegExp(glob) returns an equivalent RegExp for display or trusted globs.

Verification Report (verdikta.claim-report/1, §9.4, §9.5)

Schema: schemas/claim_report.v1.json. The code-runner builds one report per claim; validate it with codeReview.validateClaimReport(report), hash it with codeReview.reportSha256(report). Example: test/fixtures/code-review/claim_report.valid.json.

Part Content
schema verdikta.claim-report/1 (CLAIM_REPORT_SCHEMA)
inputs Every input digest, so a published report can be reproduced: listingCid, bcid, envImage (sha256:…), platform, attestationSha256, baseCommit, pocPatchSha256, fixPatchSha256 (null without fix.patch), runner, gvisor, semgrepRules, and eaGates
inputs.gvisor The runtime actually used: the gVisor release (release-YYYYMMDD.N) or runc when the claim did not run under gVisor (local mode). Anything but GVISOR_RELEASE is a warning (REPORT_RUNTIME_NOT_PINNED): that report cannot hash like a production one. semgrepRules other than SEMGREP_RULES_VERSION warns REPORT_RULES_NOT_PINNED
inputs.eaGates disclosure and inScope, the gates the EA decides before any pull (§10.1). Inputs, not runner gates: the EA calls the runner only when both passed, so each is pass
gates The runner's gates in order (REPORT_GATES): applies, testPathsOnly, build, reproduces, integrity, claimedObservable; each pass, fail or not-run
poc The PoC run, tier B, or null when it never ran. testCount: how many tests the patch added. runCounts: runs per result (fail, pass, error, skip, missing, duplicate, notRun) over every run of every one of them, testCount × 3 in all. tests: each of them once (REPORT_DUPLICATE_TEST_ID), or the first 200 by id when there are more, with its result on each of the POC_RUNS (3) runs of the fixed schedule (fail = an assertion failure, pass, error, skip, missing, duplicate, not-run), kind and the normalised failure message. integrity: the checks of §9.5 (identityComplete, summaryConsistent, exitConsistent, protectedPathsUnchanged, frameworkUnchanged, dependenciesUnchanged) and tamperFlags (TAMPER_FLAG_KINDS). honestyFlags: tier-A facts about what the test does
fix The informational fix check: present, applies, builds, pocPasses, regressions (the first 200 regressed stable ids) with regressionCount, tier B and its own integrity
build status (equal to gates.build), tier A
findings Every lint/SAST finding kept, at most 50: tool, rule, severity (critical … info), file, line (null: file-level), message, triage (always null; Jev's annotation travels beside the report, never inside the hashed bytes)
flags existingTestsModified, skipMarkersAdded, protectedPathsTouched: plain repository paths
diff { files, added, removed } for the PoC and (or null) the fix

One outcome, one form. Every field is required; an absent value is null, never a missing key. Paths are plain repository paths in their one spelling (REPORT_PATH_NOT_PLAIN for ., .. or empty segments or a control character; the schema refuses leading slashes, backslashes and whitespace), and every string is well-formed Unicode (REPORT_TEXT_NOT_UNICODE), so every valid report has a hash. The gates follow from the facts beside them, and validateClaimReport checks that they do:

  • a gate runs exactly when the gates before it passed: applies always, testPathsOnly on a patch that applied, build when both passed, and claimedObservable on a PoC that reproduced (REPORT_GATE_ORDER), so a report is either complete or names the failure that stopped it; the PoC runs exactly when the build passed, and reproduces and integrity are decided on it (REPORT_POC_INCONSISTENT); build.status equals gates.build (REPORT_BUILD_INCONSISTENT); a touched protected path fails testPathsOnly (REPORT_FLAGS_INCONSISTENT);
  • gates.integrity passes exactly when every integrity check passed and there is no tamper flag, and a missing, duplicate or skip run anywhere in runCounts is incomplete identity (REPORT_INTEGRITY_INCONSISTENT);
  • poc.runCounts covers all testCount × 3 runs, equals the listed runs' counts when every test is listed and is at least them when the list is cut at 200, and tests holds min(testCount, 200) entries (REPORT_POC_INCONSISTENT). The PoC gates are derived from runCounts, so the bound on the list never changes an outcome: an omitted result is neither taken as a failure nor lost;
  • gates.reproduces passes exactly when integrity passed and every run of every test the patch added failed by assertion (runCounts.fail = testCount × 3; REPORT_REPRODUCES_INCONSISTENT), so a failed integrity check fails reproduces with it (§9.5). A run is not-run only when the schedule stopped after a run or an integrity check had already failed the gate; a schedule cut short with nothing against the claim is an abstention (§9.3), not a report (REPORT_POC_INCONSISTENT);
  • a test's kind is error when any run errored, else assertion when any run failed, else null with no message (REPORT_TEST_KIND_INCONSISTENT);
  • an absent fix takes the not-run value everywhere, a fix step after one that did not pass is not-run, and a fix that applied is always built, so builds is not-run exactly when applies did not pass (REPORT_FIX_INCONSISTENT).

Nothing host- or time-dependent. The schema has no field for a duration, a host name, an absolute path or a per-run directory, and refuses any field it does not define. The runner normalises free text (repository-relative paths, no timings); a message that names an absolute host path warns REPORT_TEXT_HOST_PATH.

The hash. codeReview.canonicalReportJson(report) validates the report and returns the canonical JSON (canonicalJson) of a copy whose unordered lists are sorted: PoC tests by id; findings by severity (critical first), file, line (file-level first), tool, rule, message; honesty flags by file, line, rule, message; tamper flags by kind, file, line; paths and regressions by UTF-16 code unit. The runs of the repeat schedule keep their order. Two hosts that observed the same outcome therefore hash alike whatever order they listed things in; the report the jury reads is these bytes, and reportSha256 is their SHA-256 (lowercase hex), logged and published in the justification (§9.3, §10.5). A runner that holds more entries than a list's limit (REPORT_LIMITS) keeps the first ones in this order.

Trusted evidence. codeReview.isTrustedPassingEvidence(report) is true when the report validates and its PoC run (tier B) passed every integrity check with no tamper flag (§9.5, §20 decision 6); { part: 'fix' } asks the same of the fix check. It says nothing about what the evidence shows (that is gates.reproduces), and it never throws on the report: anything it cannot read is untrusted.

The AI Node request (codeReview, §10.3, §11)

Schema: schemas/code_review_request.v1.json. The external adapter adds a codeReview field to its POST /api/rank-and-justify request; the AI Node accepts a request with one only if codeReview.validateCodeReviewRequest(field) passes. Text the jury reads (the context pack, report.md) travels as named attachments, not here. The AI Node shows the jury the report as canonicalReportJson(report), never as the object's own serialisation, so every arbiter's jurors read the same bytes whatever order the runner listed things in.

Field Rule
version 1
codeClass code-standard or code-premium: the envelope the AI Node applies. The EA sends code-standard for every claim (build plan A8)
deadlineMs Milliseconds the AI Node has from receipt (the EA's remaining time, §11): an integer from 1 to MAX_DEADLINE_MS (840,000, the job timeout)
report, reportSha256 The Verification Report (by reference to its schema, with its own rules under /report) and its hash (REQUEST_REPORT_HASH_MISMATCH)
claim { bcid, finding }: the claim's CID, equal to report.inputs.bcid (REQUEST_CLAIM_MISMATCH), and its finding.json (with validateFinding's rules under /claim/finding)
knownIssues The listing's known-issue ids, at most MAX_KNOWN_ISSUES (256)
priorFindings The prior valid claims' bCIDs, in request order, at most MAX_PRIOR_FINDINGS (8, erratum E2), never the claim itself (REQUEST_PRIOR_INCLUDES_CLAIM). By id only: their text reaches the jury inside the pack
dispute null, or on a dispute { statementCid, statement }: the maker's statement from the verdikta-dispute: line, at most 4,096 bytes of UTF-8 (REQUEST_DISPUTE_TOO_LONG), which the AI Node fences as the maker's argument

Code classes and panels (§10.4)

codeReview.CODE_CLASSES holds the two code classes; getCodeClass(keyOrId) looks one up by key or ClassID.

code-standard code-premium
ClassID (decision D1) 133 134
enabled false false
Pool openrouter: deepseek/deepseek-v4-pro-0813, moonshotai/kimi-k2.7-code, qwen/qwen3-coder, z-ai/glm-5.3, xiaomi/mimo-v2.6-pro, openai/gpt-oss-120b, google/gemini-4-argon; anthropic: claude-haiku-5-5, claude-sonnet-5-5, claude-opus-5-5; openai: gpt-6-luna, gpt-6-sol, gpt-5.6-terra; xai: grok-4.7 the standard pool plus openai gpt-6-astra, every model once
Envelope at most 3 models, NO_COUNTS 1, ITERATIONS 1, 6 outcomes; context pack 60,000 / juror output 32,000 tokens the same; 120,000 / 12,000 tokens
Hard limits CLASS_HARD_LIMITS (§9.1), with the time floors CLASS_TIME_FLOORS (owner decision Q84) the same

Pools are provider-qualified in the classmap's model-entry form ({ provider, model }): the provider as the classmap and the AI Node's provider factory name it, and the id that provider serves (an OpenRouter id is vendor/model). Jev is not in the pools: its client is not in this build (assumption A3). google/gemini-4-argon and claude-opus-5-5 joined the standard pool with the panels that use them (owner decision Q63); Gemini's only route is OpenRouter, since the AI Node has no Google provider class. The open-weight ids follow OpenRouter's naming and are checked against the provider's catalogue before a class is enabled; the calibration set measures each pool (§18).

Present, not enabled. The code classes are not in data/classmap.v1.json, so classMap.listClasses() still returns 128–132, getClass(133) is undefined, validateQueryAgainstClass calls 133 unknown, and integrate-classid and the bounty site do not see them. npm run validate:classmap refuses a classmap entry at 133 or 134 while its code class is not enabled; enabling one is adding it to the classmap and setting enabled together.

Panels (owner decision Q63; no Jev, assumption A3), as the listing and dispute archives' juryParameters:

  • CODE_STANDARD_PANEL: openrouter google/gemini-4-argon and openai gpt-6-luna, weight 0.5 each;
  • CODE_STANDARD_DISPUTE_PANEL: anthropic claude-opus-5-5 and openrouter google/gemini-4-argon, weight 0.5 each;

both with NO_COUNTS 1, ITERATIONS 1 and NUMBER_OF_OUTCOMES 6. The two panels differ, because the attestation site tells a listing archive from a dispute archive by its panel. A listing archive's manifest names its panel, so a panel change, like a change to the claim query (below), changes every listing archive built after it, the conformance canary's among them: the canary is re-pinned from a new run, never edited by hand.

codeReview.validateClassEnvelope(juryParameters, classKey = 'code-standard') is the envelope check the arbiter runs before any model is called; a manifest outside it is a requester error. It reports ENVELOPE_PANEL_SIZE (not 1 to 3 models), ENVELOPE_MODEL_NOT_IN_POOL (provider compared trimmed and in any case, as the AI Node resolves it; the model exactly), ENVELOPE_DUPLICATE_MODEL, ENVELOPE_NO_COUNTS, ENVELOPE_ITERATIONS (absent means 1), ENVELOPE_OUTCOMES, ENVELOPE_WEIGHT (each in (0, 1]), ENVELOPE_SCHEMA and CODE_CLASS_UNKNOWN.

Severity definitions and the claim query (§8.1, §10.3)

codeReview.SEVERITY_DEFINITIONS holds, per severityRubric, Verdikta's own class definitions for the repo and contract artifact kinds: a version, the source rubric it follows (immunefi-v2.3: the Immunefi Vulnerability Severity Classification System v2.3), and per kind a preamble and one definition per class. The text is written for stake listings in Verdikta's words and links the source; the source's wording is not reproduced. A change to any definition is a new version. severityDefinitions(rubricId, kind) returns one kind's set.

immunefi-v2.3 is at version 2. Version 2 states, in both kinds, the four readings the owner accepted with the blind calibration labels (Q62, 2026-11-09; verdikta-arbiter code-runner/calibration/cases/, node A7e):

Rule Reading Where the text states it
A Something broken with nothing lost is Low: any broken promise or documented behaviour, such as a function that answers wrong or reverts, a configuration, kind of signature or deposit refused, or a restriction that does not hold. Medium needs the proof of concept to show someone able to harm others, and the harm done to them. LOW, and MEDIUM's first and last sentences
B Value taken or locked is classed by its consequence, whoever brings it about (an attacker, another account or the code itself) and whoever holds it. Fee code that mints far more shares than are due is Critical; a fee recipient's or a depositor's funds locked for a period are High. Each preamble; CRITICAL and HIGH no longer begin with an attacker
C A lock that cannot end without an upgrade or an owner or admin stepping in is for good (Critical). A lock that ends after a time, at a later step of the normal flow, or once the activity renewing it stops is for a period (High). Each preamble
D An amount counts at the size the proof of concept shows: one worth less than the gas of the call that moves or mints it, such as one wei per call, counts as nothing taken, lost, owed or minted, whichever class it would otherwise meet, so the finding is Low. Each preamble, and LOW's last sentence

codeReview.buildClaimQuery(spec, rubricId?) returns the query of the listing archive's primary file: the artifact, the scope, the award table in wei and ether with what counts, lowestClassCounted, the definitions for the listing's rubric and artifact kind with the source link, and the six outcomes. It is a pure function of a valid spec (rubricId, when given, must be the spec's severityRubric), and throws a RangeError (CLAIM_QUERY_TOO_LONG) when the text would exceed the primary query limit (32,000 characters). The bytes for the example listing are pinned in test/fixtures/code-review/claim_query.bug.txt; a change to them is a change to what every juror reads, so it bumps CLAIM_QUERY_VERSION or the definitions' version.

CLAIM_QUERY_VERSION is 2. Version 2 states two rules the owner decided on 2026-11-10, and nothing else in the query changed from version 1:

  • The claim carries its consequence (Q66 (a)). The severity sentence reads: "Classify by the consequence the proof of concept demonstrates, or that follows from it by a concrete line of reasoning, which the claim sets out, tied to a file and line; a finding takes the highest class whose definition that consequence meets." The line of reasoning is the claim's: the jury adds no consequence the claim does not argue.
  • A listed known issue is DUPLICATE (Q73 #5; design §12, a resubmitted known issue is DUPLICATE). The outcome line reads: "DUPLICATE: the root cause is a listed known issue or a finding already valid on this listing, even when the entry calls the behaviour intended or accepted." A claim that restates such an entry settles DUPLICATE (bond back), not INVALID as behaviour "not required of the code".

Such a change also changes every listing archive built with it, so a listing signed before it no longer matches its re-issued archive. The conformance canary's listing is one of them: its archive's CID is in the canary's report, so a run under the changed text no longer gives the pinned CONFORMANCE_CANARY.reportSha256 and listingCid, and the canary has to be re-pinned from a new run (below).

Verifiable disclosure (§14, the disclosure gate of §10.1)

The maker's copy of a finding and the revealed archive are the same bytes by construction. src/codeReview/disclosure.js holds the one implementation the hunter's tool, the site's client, the EA and the maker share; it and the files it requires (disclosureAge.js, disclosureCodec.js, disclosureLine.js) use nothing Node-only, and a test bundles them with esbuild for the browser and runs the bundle with only browser globals. A client imports @verdikta/common/src/codeReview/disclosure, typed by disclosure.d.ts beside it (the codeReview index reads files and is for Node); everything is also on codeReview. Nothing in these files logs, and no message or gate reason carries key material. Primitives: @noble/curves (X25519), @noble/hashes (HKDF-SHA-256, HMAC, SHA-256), @noble/ciphers (ChaCha20-Poly1305) and @scure/base (bech32, base64), pinned exactly.

Keys. The disclosure key in stake.disclosureKey is an X25519 public key: an age recipient (age1…, lowercase bech32) or 32 bytes in padded base64, exactly what the schema's pattern admits. parseDisclosureKey(key) returns the 32 bytes and also refuses what the pattern cannot see: a bad bech32 checksum, non-canonical base64 (non-zero trailing bits), and a low-order point, to which anything encrypted is readable by all. On-chain the listing stores the same 32 bytes as bytes32. generateDisclosureKeyPair() returns { identity, recipient } as age-keygen writes them (the identity is the uppercase bech32 AGE-SECRET-KEY- string the maker keeps); disclosureRecipient(identity) is age-keygen -y. generateDisclosureSecrets() draws one claim's { contentKey, ephemeralKey } as 0x hex (bytes16, bytes32).

Encryption (build plan A1). The ciphertext is an age v1 file (age-encryption.org/v1) with one X25519 stanza. The content key is age's 16-byte file key, the ephemeral key is the 32-byte X25519 ephemeral secret, and the payload nonce, the only other random input, is derived from the content key:

payload nonce = HKDF-SHA-256(ikm = contentKey, salt = empty,
                             info = "verdikta-disclosure/v1 payload nonce")[:16]

So encryptForDisclosure(plaintext, disclosureKey, { contentKey, ephemeralKey }) returns the same bytes for the same inputs, and stock age -d decrypts them. It refuses an all-zero key (an uninitialised buffer, not a draw). A content key must never be reused: the tool draws fresh secrets per claim and keeps them beside the archive. decryptDisclosure(ciphertext, identity) reads any binary age v1 file for that identity, stock age -e output with several recipients included, and follows the spec's rules: canonical base64, stanza bodies wrapped at 64 columns, unknown stanza types ignored, scrypt never mixed with other stanzas, an all-zero shared secret aborts, the header MAC checked before any plaintext is released, and a payload of 64 KiB ChaCha20-Poly1305 chunks ending in one final chunk (empty only when the whole payload is) with nothing after it. ASCII armor is refused (NOT_AGE_V1): pass the binary file. Failures throw DisclosureError with a code: BAD_DISCLOSURE_KEY, BAD_IDENTITY, BAD_KEY_MATERIAL, NOT_AGE_V1, MALFORMED_HEADER, NO_MATCHING_IDENTITY, BAD_HEADER_MAC, MALFORMED_PAYLOAD, PAYLOAD_AUTH_FAILED (BAD_LINE_FIELD from the line formatters).

The gate. verifyDisclosure({ plaintext, ciphertext, archiveSha256, ciphertextSha256, contentKey, ephemeralKey, disclosureKey }) returns { ok, gate: 'disclosure', code, reason }. In order, and with constant-time comparisons, it fails with PLAINTEXT_HASH_MISMATCH when the revealed archive does not hash to archiveSha256, CIPHERTEXT_HASH_MISMATCH when the ciphertext fetched by CID does not hash to ciphertextSha256, and REENCRYPTION_MISMATCH when encrypting the archive with the revealed keys to the listing's disclosure key does not reproduce the ciphertext byte for byte; the reason names the hashes, never the keys. A malformed hash or key fails with MALFORMED_INPUT, an unusable listing key with BAD_DISCLOSURE_KEY (the listing's fault, not the claim's: the EA decides how that settles); a missing archive, ciphertext or field throws TypeError, since that is the caller's bug. Hashes and keys may be 0x hex or bytes; disclosureSha256(bytes) gives the commitments' form. The result reads nothing but its inputs, so every arbiter returns the same answer for the same bytes.

The addendum's machine lines (errata E1, E2). StakeAttestation.reveal writes the addendum (ClaimLogic._disclosureLine in verdikta-applications):

verdikta-disclosure: 0x<archiveSha256> 0x<ciphertextSha256> <ciphertextCid> 0x<contentKey> 0x<ephemeralKey>

and on a dispute a LF and verdikta-dispute: <statementCid>. Exactly: the prefix, single spaces, the five fields in that order, lowercase hex of 64, 64, 32 and 64 digits with leading zeros kept (OpenZeppelin's Strings.toHexString(value, length)), CIDs as given (46 to 100 ASCII letters and digits, the contract's _isValidCid), no trailing newline, nothing else, within the aggregator's 1,000 bytes. A disclosure line is 303 to 357 bytes, the pair at most 476. formatDisclosureLine, formatDisputeLine and formatAddendum({ disclosure, dispute }) write them; parseDisclosureLine, parseDisputeLine and parseAddendum read them strictly and return { ok, issues } with the fields (issue codes LINE_NOT_STRING, LINE_TOO_LONG, LINE_COUNT, LINE_NOT_ASCII, LINE_PREFIX, LINE_TOKEN_COUNT, LINE_FIELD; details never echo a value). stripAddendum(addendum) adds text, what of the addendum a model may see: '' for every addendum the contract writes, null for one that does not parse, so neither the keys nor a malformed addendum reaches a prompt.

Vectors. test/fixtures/code-review/disclosure-vectors.v1.json holds test-only keys, plaintexts, ciphertexts and lines, written by test/scripts/generate-disclosure-vectors.js with stock age: the deterministic ciphertexts by an independent Node crypto implementation (test/helpers/ageNodeReference.js) and decrypted by age -d, the others by age -e, and every line checked against StakeAttestation.reveal on Hardhat. The test identities are SHA-256 of a public seed, so the file holds no identity. Where stock age is on the path, the tests also run it live in both directions. reveal-plaintext-hash-mismatch and reveal-reencryption-mismatch are decided from these vectors.

Fixture catalogue (§18)

data/code-review-fixtures.v1.json, loaded by codeReview.loadFixtures(), lists every required counterexample and contract/settlement fixture of §18 and the Phase 0 exit criteria of §17: id, the layer that decides it (runner, ea, ai-node, jury, contract, dispatcher), what it must settle to, and, where a pure function in this package is involved, that helper and whether it exists yet. The downstream suites import the catalogue and write one test per case in their layer. In this package, cases with an implemented helper run for real (direct-request-no-attestation through validateAttestation; the six forged-evidence cases, junit-forged-early-exit to test-report-duplicate-identity, through isTrustedPassingEvidence; the two reveal cases through verifyDisclosure); a case whose helper is pending would run as a failing test until the helper lands. None is pending.

The six forged-evidence cases also carry two fields. report holds the facts of the report the case describes, and settles is what the External Adapter's settleReport answers on a report with those facts. The rule lives in verdikta-arbiter, which this repo's CI cannot read, so test/fixtures/code-review/integrity-settlements.v1.json records its answers, with the commit that gave them and each report's hash, and a test holds the catalogue to the record (test/scripts/record-integrity-settlements.js makes it again). forms says what real forge does for the case, each form with its own settles and its evidence. So junit-forged-early-exit settles DUPLICATE as a report, while the claim that forges it abstains, because the child has to kill forge: a signal death, with no report at all.

payment-round-timeout-retrigger follows erratum E6 (owner decision Q12): a round the arbiters ran that settled nothing never returns the bond at expiry, and only a submission the aggregator refused to start does (bond).

npm run validate:schemas compiles every schema under Ajv strict mode, checks the examples and the catalogue, and signs an attestation over the examples with a fresh dev key, checking that dev trust accepts it and production verification refuses it; npm run build runs it.