feat(extensions): native Babysitter turn handler - #551
Merged
Merged
Conversation
Add extensions/babysitter, a schema-2 extension on software-factory whose
eleven GitHub handlers turn Cloud's normalized delivery descriptor into one
cloud:babysitter-turn queue call:
f.capabilities.cloud.babysitterTurn.queue({ delivery }). It sends no
findings, head, label, session, lineage, or config. Unknown input, receipts
other than queued|duplicate, rejections, and a missing capability fail the
run. The manifest matches the #550 exporter permission shape.
#549's refusal is unchanged: hosted execution still refuses the handler
with plugin_unsupported. compat requires the surface release after 2.0.25.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Session-Id: 7d116c0d-6756-4905-ace7-1235559066ed
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the native Babysitter package the #550 handoff calls for, at
extensions/babysitter. It is a schema-2 extension onsoftware-factorywhose 11 GitHub handlers each turn Cloud's normalized delivery descriptor into onecloud:babysitter-turncall:babysitlabel, head), and resolves the bound Codex session.{ receiptId, status: 'queued' | 'duplicate' }, which completes the run assuccess. Rejections (policy refusals, in-doubt transport) fail the run once, with no retry or fallback. Any other receipt shape fails the run.eventTypethat doesn't match the handler's own subscription is refused before any call.github,codex, no MCP, writescloud:babysitter-turn,extends.handlers: true, no hooks. It holds no GitHub write authority.examples/babysitter(Claude review lenses, GitHub comments, merge-gate hook).The contract was agreed over Agent Relay with
babysitter-session-lineage-proposal, who owns Cloud core, Relay native-turn and RelayHistory receipts. They corrected two points, both applied: omitfindings, and use the receiptqueued|duplicate, with Cloud deduping by lineage plus live head sodeliveryIdis provenance only.What this does NOT do
plugin_unsupportedbefore either body runs. That is pinned by a test that goes through the real install, compose and execute path.Ctxhas nocapabilities, so the handler fails closed withdoes not provide the cloud:babysitter-turn write. Execution needs gate 8 / flows: AgentOptions has no permissions field in TypeScript, and it isn't enforced yet anywhere #442 isolation plus the Cloud capability adapter.compatis^2.0.26. The published@relayflows/surface@2.0.25registry cannot routepull_request.labeled,.unlabeledor.ready_for_review(install refuses withplugin_event_unroutable). A surface release must come first.docs/BABYSITTER-CATALOG-HANDOFF.mdwith path#extensions/babysitter, from the merged commit only. Rollout is not complete.Evidence (files in
evidence/babysitter-native-handler/)typecheck.txt:npm run typecheckandnpm run typecheck:tests, bothExit: 0.tests.txt: new suiteTests 31 passed (31). Neighbouring suites (catalog export, compose, plugin-extension, authored-flow incl. the fix(sdk): fail closed on hosted extension dispatch #549 tests, preflight):Tests 219 passed (219).mutation.txt: two mutations, each reverted, failing, restored byte-for-byte (sha256 matches), and passing again:refuses an event for another subscriptionfail.fails closed on …tests fail. Without the guard the run still fails, just as a raw TypeError; the guard pins a clear refusal.full-suite.txt: local fullnpm testhas 51 failures in 23 files, none in the new suite. 17 of those files also fail atorigin/main607ac67 with this change stashed (38 failures). The 6 files that failed only in the full run pass in isolation on this branch (40/40). Causes are load and timing (5s timeouts, relayflowd lease expiry, ENOTEMPTY cleanup). CI is the authority.The test suite uses the local surface, as CI does (
npm install ./packages/surface --prefix packages/sdk --no-save --ignore-scripts).🤖 Generated with Claude Code
Note
Medium Risk
New extension defines the Cloud turn boundary and strict input validation, but execution stays refused until gate 8 and the Cloud adapter ship; mis-validation could block turns once enabled.
Overview
Introduces the native Babysitter schema-2 flow extension at
extensions/babysitterfor Software Factory: eleven GitHub subscriptions each validate Cloud’s normalized delivery descriptor and issue a singlecloud:babysitter-turnqueue call with a minimal PR envelope (no head, session, findings, or GitHub writes).turn.tsfail-closes on schema drift, wrong subscription, or bad receipts;babysitter.flow.tsrequires a runtimecapabilities.cloud.babysitterTurnport and completes only onqueued/duplicatereceipts.Does not turn on production behavior: hosted dispatch still hits
plugin_unsupported(#549), today’s SDK has no capability field, andcompatpins surface/sdk^2.0.26forlabeled/unlabeled/ready_for_reviewrouting. Direct runs decline without queuing.Adds a 31-test SDK suite (compose, #549 refusal, #550 catalog export bytes, validation, capability guard) plus handoff doc updates and local evidence (typecheck, mutation checks, full-suite notes).
Reviewed by Cursor Bugbot for commit dcdc6bd. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Adds the native Babysitter extension at
extensions/babysitter, replacing the handoff in #550: a schema-2 extension onsoftware-factorywhose 11 GitHub handlers each turn Cloud's normalized delivery descriptor into onecloud:babysitter-turnqueue call. The handler sends no findings, head, label, session, lineage, or config; Cloud rechecks the live PR and bound session.{ receiptId, status: 'queued' | 'duplicate' }receipts complete the run; rejections and malformed input (raw webhook, unknown fields, wrong subscription, bad delivery ID/PR) fail once with no retry.plugin_unsupported, the SDKCtxhas nocapabilities, andcompatneeds a surface release after 2.0.25 to routelabeled,unlabeled, andready_for_review.examples/babysitter; this holds no GitHub write authority.Written for commit dcdc6bd. Summary will update on new commits.