Repository navigation
feat(placement): bind auto-placed delegated tasks before launching anywhere - #68
Conversation
…ywhere delegate_task gains placement:"auto" for work that needs nothing from the parent's checkout. The environment comes from this server's and authenticated linked environments' own orchestrator_capabilities answers (host load, exact provider instance and model, mode within the link) and the peer's project list. It is bound to the caller-scoped request key in the existing command receipt store before any launch, and every retry, lost answer or restart reuses that binding instead of choosing again. A named target or a worktree/shared isolation never reaches capacity placement, and the existing local and remote paths still run all their checks. create_threads no longer ignores target.environmentId: its threads share the parent's checkout, so another environment is refused explicitly. The ARC workflow now typechecks @t3tools/shared and runs the placement, remote delegation and orchestrator MCP suites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHECKPOINTCHECKPOINT: CLO-866 layer 2 (durable placement binding plus creation entrypoints) on the native 0.1.10 release line.
|
RESULTRESULT: CLO-866 layer 2 (durable placement binding plus creation entrypoints). The PR is ready for its one review. It is not merged.
|
Independent automated review R1 — changes requiredReviewed head
The Root is holding this head for the same source owner's bounded correction and meaningful regression evidence. Deferred UI/CLI/launch/schedule/Tots entrypoints remain unfinished rollout scope, not additional findings against this PR. |
…nd project under auto Review round 1 on the placement binding. - A remote launch binds the link session that took it (the link's per-link secret name, not a timestamp) and, once answered, the child thread there, in the existing receipt store. A retry under a replaced link no longer launches a second child: it returns the task already recorded for that child, or refuses with how to find the thread there. Covers auto and named targets. - placement:"auto" resolves the parent's effective runtime and interaction modes (or narrower ones asked for) before choosing, excludes links whose access is below them, and forwards both explicitly so no destination narrows them silently. - placement:"auto" refuses target.projectId before any binding or launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHECKPOINTCHECKPOINT: CLO-866 PR68 review round 1 repair (3 findings), in one bounded round on the same branch.
P1: lost answer, then a replaced OAuth link session, duplicates the child. Fixed on guarded attempt 2.
P2: auto omitted/inherit mode. Fixed on attempt 1.
P3: auto with Guard.
Checks at 6e84149.
Known limits. These are honest and unchanged in kind:
|
R1 repair verification — P2/P3 closed; P1 remains openChecked repair
The required boundary is the SAME resolved row that supplies the token used for handshake/call/MCP-session retry. Carry and enforce the expected incarnation there, or use an equivalently pinned internal credential snapshot; another earlier read is insufficient. Missing incarnation must refuse. This is source-reachable asynchronous behavior, not an asserted live-host reproduction. Preserved attempt history: P1 attempt1 failed ( |
BLOCKERBLOCKER: PR68 R1 P1 disposition packet (read-only). Head 6e84149 on base 3596754. No code edits, commits or new tests. CI run 44245310923 was left untouched. Confirmed: the P1 race is real at 6e84149. When Seam where one immutable credential and incarnation can be checked and used.
Fail-closed behavior under that design.
Deterministic interleaving reproduction, using test seams only.
Repair history (do not reset).
Remaining risk at 6e84149. A re-link that coincides with a remote launch, or a link appearing during an unbound launch, can still duplicate a child and leave the original without a parent task. It needs a human re-link inside a narrow window, but it is exactly the P1 class. Blocking decision for root.
|
Caller disposition for the original P1 continuationRoot has read the retained author's read-only packet, the retained review, and the actual credential-resolution/send implementation. The existing full-rollout authorization includes this bounded correction. Under the canonical repair-guard clause requiring a concrete caller disposition before further implementation, the decision is:
Preserve the original F1 bug ID and both guard records exactly: attempt1 failed, attempt2 passed its sequential test but left the semantic race. Do not reset, relabel, erase history or claim a fresh attempt allowance. Record this caller disposition and the bounded continuation's outcome with the original P1 history. This is a specific design resolution after the required stop/report, not permission for an open-ended experiment loop. Verification: deterministic real-transport relink after marker check/before credential resolution and missing-incarnation cases must demonstrate the unfixed failure and then no extra remote child; retain sequential relink/recorded-child checks. Run only affected typechecks/tests plus ordinary existing ARC. Stop and return the concrete result if this correction fails. Root retains changed-findings verification and merge. |
…s bound to Continuation of review finding P1 under the root disposition (#68 (comment)). The launch checked its link session in one read and the transport resolved the link again for the send, so a link replaced in between still sent it under the new session and started a second child there. PeerLinks.resolve now returns the incarnation of the same stored link whose token it returns; PeerForwarding.call and PeerMcpClient.call carry an optional expectedIncarnation and refuse before any handshake or request when it does not match. RemoteDelegation sends its launch only under the incarnation it bound, refuses outright when there is no link to bind to, and never rebinds a key. Its refusal no longer suggests retrying with a new key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Retained R1 continuation verification — original findings closedChecked only the caller-disposed P1 continuation P1 is closed by the inspected source and regression boundaries. The added real OAuth/HTTP harness interleaves replacement after the launch-binding check and before transport resolution, plus a link appearing after the missing-session read. Its transport uses the real link service. The repeated same-key retry checks that the refusal does not rebind or create another child. This is synthetic regression/source evidence, not a live-host reproduction. Previously closed P2 and P3 are unchanged. The original F1 history remains: attempt1 failed on timestamp collision; attempt2 passed the sequential case but left the send-boundary race. The bounded continuation follows root's concrete caller disposition; the author reports the original guard file is byte-identical and the continuation's 79 tests in 4 files passed. No counter reset or new attempt budget is claimed. Merge still awaits the exact-head ordinary ARC run 44247100447 and the author's truthful current PR body. At this read, typecheck had passed and the test step was running. No runtime deployment is authorized by this review receipt alone. |
RESULTRESULT: the original P1 continuation under the root disposition. It is ready for root's bounded verification of the changed P1 behavior; it is not merged.
|
Universal native thread placement (CLO-866), layer 2: a durable placement binding, plus the
delegate_taskandcreate_threadsentrypoints. It builds on the merged placement policy (#67).Current head:
e361cfbcffbdce471f49a7fde45d44b6d4882a9fonrelease/native-0.1.10at35967547. There are three commits:f943506b(the slice),6e841498(review round 1 repair) ande361cfbc(the root-authorized P1 continuation).Problem
The shared placement policy (
chooseThreadPlacement) existed, but no creation path reached it and nothing recorded an automatic decision durably.create_threadsalso silently ignoredtarget.environmentIdand created the thread locally (fail-open).Behavior at this head
delegate_taskplacement: "auto"is for work that needs nothing from the parent's checkout.orchestrator_capabilities(hostResources, the exact provider instance and model,canRunChildTask, runtime modes) plus that environment's own project list for this repository. Caller-supplied booleans are never evidence.driverKindwithoutproviderInstanceIdis refused, andtarget.projectIdis refused under auto before any binding or launch.command:mcp:<requestNamespace>:placement:delegate-task:<clientRequestId>, in the existing command-receipt store. The first writer wins, and the binding is always read back. Retries, lost answers, reconnects and restarts reuse it and never choose again. If nothing is eligible, the call fails withtarget_requiredand binds nothing.PeerLinks.resolvereturns the incarnation of the same stored link whose token it uses. The launch is sent only under the bound incarnation:PeerForwarding.callandPeerMcpClient.calltakeexpectedIncarnationand refuse before any handshake or request on a mismatch.target.environmentIdandisolationgo throughchooseThreadPlacementas pinned or local-state. The existing local and remote paths still run every destination check.create_threadsis fail-closed. It admits throughchooseThreadPlacementwithrequiresOrigin, and another environment is refused withinvalid_requestbefore anything is created.@t3tools/sharedand runs thethreadPlacement,RemoteDelegationandOrchestratorMcpServicetests.Verification at
e361cfbcvp fmt --checkandvp lintare clean on the changed files.RemoteDelegation,PeerMcpClient,PeerForwardingandPeerLinkstests, 4 files and 79 tests, passed.Review history
f943506b) had three findings:target.projectId.6e841498, P2 and P3 were fixed on attempt 1.linkedAtcollides within one clock tick. Attempt 2 passed its sequential test, but root verification found the check/send race and the missing-session branch still open.e361cfbc. The original guard history is kept unchanged, and the continuation is recorded separately against it.Known limits
t3_thread_listwith that environment). The peer has no cross-session link identity, so automatic recovery would need a protocol change on both sides; that is out of scope.t3_thread_send) still use session-scoped keys. This is pre-existing and unchanged.PeerMcpClientkeys its cache by environment and URL, not incarnation. Thread identity comes from the token, so it is unaffected; this was left as is by the disposition.placementdescription was not checked withevals/, because that needs paid model runs.t3_thread_launchauto, web/desktop/mobile creation, CLI, external MCP launch, fresh-thread schedules and Tots, plus runtime canary and restart/stale-peer gates on hosts. No live hosts or Jeff's artifact were touched.--no-verify. It fails on pre-existing knip findings outside the changed files, and on host Node being unable to loadscripts/knip-schemas.ts. Format, lint, typecheck and tests were run manually as above.Provenance
claude-opus-5-5(Claude Opus 5.5)🤖 Generated with Claude Code