Skip to content

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).

guest, untrustedgo commandgo get, go mod downloadhostwb-proxyd: dependency gaterecord at or below the point: oldabove it, or no point: refusedindex.golang.orgfirst-seen timessum.golang.orgrecord numbershourly: the pointper version, cached403 with the rule

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.

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.

When the hourly refresh fails, the gate keeps using the point it has, retries every minute, and logs go-clock-stale with the point’s age. wb status shows the age, and a refusal gives it too. A kept point lasts only until the next restart. After a restart the gate computes a point before it decides: the stored point is only shown in wb status, so requests wait up to 30 s for the first computation, as on a new install.

When the hourly refresh fails, the gate drops its point and refuses every Go request until the index answers again.

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 fresh go get with 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 of aws-sdk-go cold goes from 5.6 s to about 22 s before tiles, the fresh go get from 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 get with 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/list and 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.

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.

RequirementA. Keep the last pointB. 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 refusedkept, stricter over timekept
NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it. a refusal names its rulerefusals name the age rule, and the failure is loggedevery refusal names go-clock-uncalibrated
SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped. memory and connections are cappedone refresh at a time, bounded cachesame
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.