Skip to content

exec: v1.4 notify, simplified: no background contact after release - #396

Merged
jaredLunde merged 1 commit into
mainfrom
jared/exec-v14-notify-rev2
Oct 18, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
jared/exec-v14-notify-rev2

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

Revises the v1.4 "Sandbox job notify" spec (module doc of exec_endpoint), FLEET.md's "Job-end callbacks", the v1.4 fixtures and the coverage test together. Nothing is implemented yet; this is the contract the implementation tasks are held to.

The design rule now: after a job is released, the replica contacts the sandbox only on real use: a callback, the session's own use of its sandbox, a bash_job call, or the next open. Nothing runs on a timer. The one accepted difference from today is stated up front: an end no callback delivers (a dead or stopped sandbox, every attempt failed) is noticed at the next real use instead of within seconds.

Removed

  • The 5-minute sweep: any periodic contact keeps the sandbox awake.
  • The per-keep generation in the URL: a release now needs a successful keep plus a callback inside the window, which already proves the same URL and token.
  • The notify key set (upcoming/retired keys, the rotation procedure): the replica holds one seal secret, and a token under an old one gets 503 and falls back to next use.
  • The exited-only-with-leftovers and open-reconcile-spares-tracked-jobs requirements, which guarded things today's code doesn't guarantee either.
  • The proof's own reconcile: a release now starts a live reconcile, so a proof answers immediately.

Changed

  • Every end a reconcile finds is read by today's follow, so the notice, the failure policy and the error notice are today's. A sandbox that cannot be listed sends its released jobs back to today's follow.
  • A listed exited is applied as a stream's shell_exit is, so today's per-job record decides whether leftovers are reported. That includes today's one case that does report them: a background job that a bash_job call put back while its shell still ran.
  • The job ledger is entries in the transcript's fenced segment batch, written in the same batch as the end's message. reset_for_new_session drops the entries.
  • A callback is answered once the list is handed over, or 503 at 20 s. At most 16 callbacks wait per session.
  • Callbacks must carry exactly one Content-Length and no Transfer-Encoding. A duplicated session_id/tenant is refused at both the edge and the replica. Callbacks are handled only at /_beyond/agent, and every refusal has a fixed body.
  • The baseline notifier is one pinned curl invocation (wget is dropped).

The spec section goes from 576 to about 505 lines, with 50 requirements instead of 64. exec_notify_vectors now models the proof, a proof that overtakes keep, released jobs listed as exited, ended, lost or missing, an unreachable sandbox, duplicate query parameters and request framing. The previous test fails against the new fixtures (4 of 10), and the new one passes 10/10.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk

…very end read by today's follow

After release the replica now contacts the sandbox only on real use: a
callback, the session's own use of its sandbox, a bash_job call, or the
next open. The periodic sweep, the per-keep generation and the rotation key
set are gone. Every end a reconcile finds is read by today's follow, so the
notice, its failure policy and its error notice are today's; a listed
`exited` is applied as a stream's shell_exit, so today's per-job record
decides whether leftovers are reported. A sandbox that cannot be listed
sends its released jobs back to today's follow.

Also: the job ledger lives in the transcript's fenced segment batch; a
callback is answered once the list is handed over (or 503 at 20 s); exactly
one Content-Length and no Transfer-Encoding; duplicate query parameters
refused at the edge and the replica; the baseline notifier is pinned to one
curl invocation; at most 16 callbacks wait per session. The token is keyed
by the one seal secret the replica holds.

Fixtures gain receiver cases for the proof, a proof overtaking keep, a
released job listed exited, ended, lost or missing, an unreachable sandbox,
duplicate query parameters and request framing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk
@jaredLunde
jaredLunde enabled auto-merge October 18, 2026 22:26
@jaredLunde
jaredLunde added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit 0b69c3e Oct 18, 2026
13 checks passed
@jaredLunde
jaredLunde deleted the jared/exec-v14-notify-rev2 branch October 18, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant