feat(babysitter): pin standalone launch artifact

Merged
KJ
2mo ago
+890-62

Summary

  • commit the exact standalone Babysitter launch source and digest manifest
  • pin the credential-free operator policy to agent-relay-code[bot] + babysit
  • explicitly assert enforcedAgentWriteScope: true and add a reproducibility/drift gate
  • normalize the dynamic reviewer CLI/model to required strings and make the shipped-source audit track that exact single call
  • document that Cloud must bind this exact SHA-256 to daemon-only PR read/comment authority before deployment

Artifact SHA-256: eed5e5de88d9477c3155c205310d4c4c060b8de2fcdb9ddbbe8c8c517cf22e2d (33,927 bytes)

This PR does not deploy or enable a listener.

Verification

  • node --experimental-strip-types --test examples/babysitter/tests/*.test.ts — exit 0; 92 pass, 7 deliberate TODO gates
  • cd packages/sdk && ./node_modules/.bin/vitest run tests/shipped-source-models.test.ts — 2/2 passed, including the formerly failing artifact model-pin gate
  • node examples/babysitter/build-standalone.mjs --check — exact digest reproduced
  • git diff --check — pass

Rollout prerequisite

Do not deploy this artifact through a generic launcher. Cloud #4226 pins this exact content identity, rejects profile drift, launches without a repository grant or house funding, exposes only a single-repository daemon credential with PR/check/status read plus issue-comment write, and atomically caps acting runs at 2/head and 5/PR lineage. Unknown digests and broader authority fail closed.


[!NOTE]
Medium Risk
Changes standalone admission and deployment contract (digest allowlist, headSha gate, agent scope assertion); behavior is well-tested but Cloud must honor the new binding before safe rollout.

Overview
Pins the standalone Babysitter to a committed, content-addressable launch bundle under artifacts/, with a manifest recording byte size, SHA-256, credential-free standalone-policy.json (agent-relay-code[bot] / babysit), and enforcedAgentWriteScope: true for Cloud allowlisting.

Tightens launch semantics: babysitter.pullRequest.headSha is now required from Cloud; after a live GitHub reread, the flow declines if the live head does not match that server claim—before signals, agent diagnosis, or comment—so per-head admission quotas stay aligned with the diagnosable head.

Build/CI: build-standalone.mjs no longer takes an operator policy path; it always bundles the pinned policy into artifacts/ and adds --check / npm run check:standalone to block drift. New artifact tests and standalone unit tests cover head binding; SDK adds esbuild and a shipped-source waiver for the bundled flow.

Reviewed by Cursor Bugbot for commit 713ec13e8a3bc7406834507cfd0d88adbe4f6c43. Bugbot is set up for automated code reviews on this repo. Configure here.