Does the checksum database work as Go's clock for the dependency gate?
Answered 2026-10-08: yes. Decided 2026-10-12: A, with the values as written. The decision and its reasons are in the I76I76 (closed): Measure the Go checksum-database clock of the dependency gate end to endFollow-up from the X21-dep-gate-registries spike (#32) and the review of its result (#75). comment that starts Decision (2026-10-12):. The specs already say this (PR192PR192 (merged): docs(spikes): X21 Go checksum-database clock measured end to endMeasures the Go checksum-database clock of the dependency gate end to end and adds the result to docs/spikes/X21-dep-gate-registries.md ("The Go clock end to end").). Source: I76I76 (closed): Measure the Go checksum-database clock of the dependency gate end to endFollow-up from the X21-dep-gate-registries spike (#32) and the review of its result (#75)., X21-dep-gate-registriesX21-dep-gate-registries: Dependency gate on real registriesCan wb-proxyd map a download to package, version and publish time for npm, PyPI, the Go module proxy, crates.io and Homebrew? (“The Go clock end to end”). Changes S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host., S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs. (“Host work the guest can cause”, “Accounting and event channels”), S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves. (“Host state”), S05-cliS05-cli: Command Line InterfaceSpecify wb, the single user-facing command. (wb gate reset go-clock) and S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…. Follows B32-dep-gate-registriesB32-dep-gate-registries: Can the dependency gate refuse young packages without breaking installs?Yes, with conditions.. Follow-up: I193I193 (open): Go branch and commit queries (go get foo@master, @<sha>) under the dependency gate's path formsFollow-up from the review of #192 (#76). (branch and commit queries).
Figure 1. The Go clock. The checksum database numbers each module version in the order it first appeared, and nobody can give a version an earlier number. The gate learns which number was current 7 days ago from the module index, and refuses anything newer.
Options
Section titled “Options”The choice is only about a point that exists but can’t be refreshed. Without any point, every option refuses all Go downloads and lists with the rule go-clock-uncalibrated.
Values
Section titled “Values”S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host. now sets these. Each is open for the maintainer to change, and the spike’s data supports them only as far as stated.
- 4 lookups in flight per VM, 8 requests in flight per
wb-proxyd, one of them kept for calibration. The strict choice: 8 at once ran clean. At 16 at once, the full list-filter run (4,074 lookups) and the freshgo getwith filtering (3,423) ran clean, and one other run, next to an install, got a connection reset. More was never tried. What it costs: every timing was measured at 16 at once, with lookups that weren’t verified, so no tile fetches. At 4 the lookups take about 4 times as long, and verifying adds about one tile request per cold lookup. That is inferred, not measured: filtering the 1,865 versions ofaws-sdk-gocold goes from 5.6 s to about 22 s before tiles, the freshgo getfrom 9.2 s to at most about 37 s before tiles, and a lockfile install of 179 modules gains up to about 4 s. - 6,000 uncached lookups a minute per VM. At 4 in flight and the 87 ms median, a VM makes about 2,760 lookups a minute, so this cap isn’t reached. It only matters if lookups get faster than about 40 ms. The fresh
go getwith filtering made 3,423 lookups, calibration included. - One retry after 1 second, 10 seconds per request upstream, 16 MiB of cached tiles per VM, and 1 MiB for calibration’s own tiles. The spike measured a median of 87 ms and a p95 of 176 ms per unverified lookup, and no retry, timeout, or tile.
- A deadline per request of 42 s plus 125 ms per uncached lookup and per lookup queued ahead of it, at most 5 minutes, and 2,000 versions per
@v/listand per queue. A cold verified lookup is two upstream requests, and 42 s fits a timeout, the backoff and a second timeout for each, so one retry of each always fits. 125 ms per lookup is 250 ms per round of 4 requests at two requests per verified lookup, and 250 ms is above the 176 ms p95. A full queue of 2,000 gets 292 s, within the 5-minute maximum. The longest list measured had 1,865, and the spike didn’t search for longer ones. Counting the queue ahead, with first-in, first-out service, lets a download admitted behind a cold list wait for it instead of failing. The cost is that wait, which can reach about 5 minutes. The counts are fixed when the request is admitted, and the 30 s wait for the first point doesn’t count toward the deadline. - 100,000 cached records per VM, least recently used evicted. The spike didn’t measure a cache, and an eviction only costs a lookup. A cache per VM, not one shared, closes a timing channel between VMs (SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another.). At a guessed 150 bytes an entry, that’s about 15 MiB per VM.
- 30 seconds of waiting for the first point after each start, and a retry every minute. The spike didn’t measure either. Its first list request, calibration included, took 1.1 to 1.5 s.
- 8 days of verified tree heads, one an hour, at most 192 stored heads of 1 KiB each, for the tree bound on a fresh point. Not measured: the spike didn’t keep heads.
Recovery
Section titled “Recovery”When two verified tree heads contradict each other, the smaller tree not being a prefix of the larger, the checksum database has forked or someone is answering in its place. That holds whether both heads came in one run, or one was stored before a restart. The gate then refuses every Go download, across restarts too, and keeps both heads as the proof. A proof of consistency that can’t be fetched only fails that request. The operator recovers with wb gate reset go-clock, a new command in S05-cliS05-cli: Command Line InterfaceSpecify wb, the single user-facing command.. It prints both heads and their receipt times and asks for confirmation. Without a terminal it refuses to run. wb-hostd then deletes the finding and the stored heads, writes a 5019 event, and restarts wb-proxyd. That restart resets every proxied stream of both VMs, claude API streams included, and Go requests wait up to 30 s for a new point. It doesn’t count toward the restart limit. At start, wb-proxyd checks a stored finding’s two heads and the contradiction again, and discards a finding that doesn’t hold. Across restarts, detection rests on wb-hostd keeping the heads and the finding: it can withhold them, but it can’t forge a contradiction, because both heads are signed.
Impact
Section titled “Impact”| Requirement | A. Keep the last point | B. Refuse on failure |
|---|---|---|
| SEC07-dep-gateSEC07-dep-gate: Dependency gatePackage downloads (npm, PyPI, Go modules, crates) are refused when the version is younger than a minimum age or has a known vulnerability at or above a severity threshold. young or vulnerable packages are refused | kept, stricter over time | kept |
| NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it. a refusal names its rule | refusals name the age rule, and the failure is logged | every refusal names go-clock-uncalibrated |
| SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped. memory and connections are capped | one refresh at a time, bounded cache | same |
Evidence
Section titled “Evidence”- verified 320 index entries sampled every 6 hours over 16 days all had a record already, and their record numbers follow first-seen time except for 4 pairs at most 3.8 s apart. Against the point, none was on the wrong side of the 7-day line. Source: X21-dep-gate-registriesX21-dep-gate-registries: Dependency gate on real registriesCan wb-proxyd map a download to package, version and publish time for npm, PyPI, the Go module proxy, crates.io and Homebrew?, “The Go clock end to end”.
- inferred The point is on the safe side of the cutoff. The nearest sample was about 2 hours from the cutoff, so the samples don’t show the boundary. The claim rests on the inversion width, 3.8 s at most, against the 1-minute margin. Source: same.
- inferred The spike’s point was about 8 minutes before the cutoff, not 1. It read one page of 400 index entries from 10 minutes before the cutoff, which at 3.3 records a second covers about 2 minutes. That is on the safe side. S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host. now pages until 1 minute before the cutoff. The 20 records of one window spread over 22 numbers. Source: same.
- assumed That the checksum database adds a version’s record when the module proxy first serves it. All 320 sampled versions had one, but nothing in the database’s design promises it. A point larger than the earliest verified tree head fetched at or after its cutoff is rejected (
go-clock-implausible). New records only raise a head, so a burst of new records that a guest causes can’t make a correct point fail that check. - verified Lockfile installs of cli/cli, fzf, caddy, node_exporter and hugo (589 module versions) passed through the gate, with no young version, in 3.4 to 32.4 s against 2.6 to 31.3 s without the spike’s proxy. Source: same.
- verified A fresh
go getof five modules@latestfailed with refuse on one young version and passed with filter. Source: same. - verified Filtering
@v/listwith one lookup per version, 16 at once, took 5.6 s for the 1,865 versions ofaws-sdk-goon a cold cache. Checking from the highest version down was cheaper but missed a young patch release, so S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host. keeps one lookup per version. Source: same. - verified With
index.golang.orgunreachable from the start, all 179 downloads of a lockfile install and every list of a fresh install were refused withgo-clock-uncalibrated. With the index taken away after the first point, both installs passed on the kept point (option A). Source: same. - verified Of 15 pseudo-versions of commits from before 2022, 14 were already in the checksum database. One got its first record from the gate’s lookup and was refused as young. Source: same.
- inferred A kept point never allows a version a fresh point would refuse. Each point is at or below the true record number at its own cutoff, and the database only appends. Follows from the order measured above.
- inferred In the spike,
wb-proxyd’s stand-in took each record number over TLS without checking them against the signed log. S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host. now haswb-proxydverify each lookup the waygolang.org/x/mod/sumdbdoes, and counts a reply that fails as a failed lookup (go-clock-lookup-failed). That library is how the go command checks the same log.
What this unblocks
Section titled “What this unblocks”- The Go part of the dependency gate in
wb-proxyd(SEC07-dep-gateSEC07-dep-gate: Dependency gatePackage downloads (npm, PyPI, Go modules, crates) are refused when the version is younger than a minimum age or has a known vulnerability at or above a severity threshold.), towards V1-M5-approvalsV1-M5-approvals: Approvals and policyApprovals with notifications and wb approve, learn mode, credential bindings, the dependency gate, wb trust with the boundary check, wb policy explain, and the toolchain reconcile.. - The conformance case for the gate in S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…, which now covers an unreachable
index.golang.org.
Details and glossary
Why not the time the module proxy reports. The .info file of a Go module version gives the time of the commit the version points at. Whoever tags a version picks the commit, so a version published today can look years old. In the first X21-dep-gate-registriesX21-dep-gate-registries: Dependency gate on real registriesCan wb-proxyd map a download to package, version and publish time for npm, PyPI, the Go module proxy, crates.io and Homebrew? run, 173 of 200 versions that the module proxy first saw that week claimed to be more than 7 days old.
Why the record number works. The checksum database adds a record the first time anyone asks for a version, and numbers the records in order. A version published today can only get today’s number. The gate doesn’t need the database to know any dates: it needs one number from 7 days ago, which it reads off versions that the module index lists as first seen then.
What a never-seen version means. When nobody has asked for a version before, the gate’s own lookup creates its record. The version then counts as published at that moment and is allowed 7 days later. That happened to one of 15 old commits tried.
Glossary
- Checksum database (
sum.golang.org): a public, append-only log of the hash of every Go module version. The go command checks downloads against it. - Module index (
index.golang.org): a public feed of module versions in the order the module proxy first saw them, with times. - Record number: the position of a version in the checksum database.
- Calibration point: the record number current 7 days ago.
- Pseudo-version: a version name the go command makes up for a commit that has no tag.