perf(daemon): sign only a checkout at startup, through the validated cache

Merged
TH
3d ago
+222-105

Summary

Daemon startup resolves its code origin first. An installed daemon registers no signature and walks no import graph: clients compare installed trees by origin and version alone. A checkout daemon signs its running entry through the stat-validated cache. Daemon and client share this rule in host-kit's resolveDaemonCodeIdentity; each picks the entry. An embedder's codeIdentity still wins, and a checkout without a process entry registers unknown.

Before / after

Registration of a built installed tree:

  • base: codeOrigin: installed, codeSignature: graph:129:…
  • head: codeOrigin: installed, no codeSignature

Compatibility decisions do not change. Lifecycle diagnostics no longer show an installed daemon's signature.

Signature cost at db7844f, 20 samples per median, macOS, load about 34:

EntryWalk (base)Head
installed, built (129 modules)15.3 msnot computed
checkout, built (129)15.3 ms1.9 ms warm cache
checkout, source (1684)229.7 ms17.2 ms warm cache

Installed spawn-to-registration: no resolvable change (medians 329/301 ms over 30 samples, 298/304 ms over 60).

Validation

At 814679cd28:

  • Startup-identity, launch-spec, client-metadata, code-signature, cache, record-publication, eager-closure (no growth) and package-boundary tests pass.
  • Fallow audit and production exports: clean.
  • CI owns other gates, including typecheck.

At db7844f: base sources fail the installed and warm-checkout cases; live daemons matched an uncached walk.

Self-review only.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.