Skip to content

feat(placement): bind auto-placed delegated tasks before launching anywhere - #68

Merged
nullStack65 merged 3 commits into
release/native-0.1.10from
feat/native-0.1.10-placement-binding
Nov 18, 2026
Merged

nullStack65 merged 3 commits into
release/native-0.1.10from
feat/native-0.1.10-placement-binding

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Universal native thread placement (CLO-866), layer 2: a durable placement binding, plus the delegate_task and create_threads entrypoints. It builds on the merged placement policy (#67).

Current head: e361cfbcffbdce471f49a7fde45d44b6d4882a9f on release/native-0.1.10 at 35967547. There are three commits: f943506b (the slice), 6e841498 (review round 1 repair) and e361cfbc (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_threads also silently ignored target.environmentId and created the thread locally (fail-open).

Behavior at this head

  • delegate_task placement: "auto" is for work that needs nothing from the parent's checkout.
    • Candidates are this server and each linked environment whose link is reachable, not read-only, and not below the parent's effective runtime mode.
    • Evidence comes only from what each side reports about itself through the authenticated link: 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.
    • There is no substitution. driverKind without providerInstanceId is refused, and target.projectId is refused under auto before any binding or launch.
  • Modes. The parent's effective runtime and interaction modes, or narrower ones the caller asks for, are resolved through the normal ceilings before selection. They are forwarded explicitly, so no destination narrows them silently.
  • Durable placement binding before any effect. The chosen environment is bound to a caller-scoped key, 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 with target_required and binds nothing.
  • Remote launch bound to its link session (auto and named targets):
    • Before launching, the delegation binds the link incarnation, which is the link's per-link secret-store name, never the token. After the answer, it binds the child thread ID.
    • PeerLinks.resolve returns the incarnation of the same stored link whose token it uses. The launch is sent only under the bound incarnation: PeerForwarding.call and PeerMcpClient.call take expectedIncarnation and refuse before any handshake or request on a mismatch.
    • With no link to bind to, the launch is refused before anything is sent.
    • A retry under a replaced link never launches. It returns the task already recorded for the bound child, or refuses and says how to find the thread there.
    • A key is never rebound, and the refusal does not suggest retrying with a new key.
  • Named targets and local state keep their routes. A named target.environmentId and isolation go through chooseThreadPlacement as pinned or local-state. The existing local and remote paths still run every destination check.
  • create_threads is fail-closed. It admits through chooseThreadPlacement with requiresOrigin, and another environment is refused with invalid_request before anything is created.
  • No new queue, scheduler, controller, UI or founder ACL. Existing RemoteDelegation follow/recovery and receipt/event persistence are reused. The ARC workflow now typechecks @t3tools/shared and runs the threadPlacement, RemoteDelegation and OrchestratorMcpService tests.

Verification at e361cfbc

  • Typecheck: contracts, shared and server are clean. vp fmt --check and vp lint are clean on the changed files.
  • Workflow test list: 9 files, 242 tests passed locally.
  • Continuation verification: RemoteDelegation, PeerMcpClient, PeerForwarding and PeerLinks tests, 4 files and 79 tests, passed.
  • Real two-environment regressions (real OAuth links and MCP transport), each red on unfixed source twice before its fix:
    • A link replaced between the launch check and the send starts no second child. A deterministic re-link runs after the marker check and before credential resolution.
    • A launch with no link to bind to starts nothing, even if a link appears.
    • A launch whose answer was lost is never started again under a new link. This covers a sequential re-link and a recorded-child re-link.
    • An auto-placed task keeps its environment after a lost answer and a restart.
    • An auto-placed task runs at the parent's modes, never a narrower link's.
    • An auto-placed task refuses a project placement did not choose.
  • CI: ARC run 44247100447 at this exact head: success (all steps; 9 test files, 242 tests on the ARC runner).

Review history

  • Round 1 (requested changes on f943506b) had three findings:
    • P1: a lost answer followed by a replaced link duplicates the child.
    • P2: auto modes.
    • P3: auto target.projectId.
  • In 6e841498, P2 and P3 were fixed on attempt 1.
  • For P1, attempt 1 failed: linkedAt collides 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.
  • After the required stop and a read-only disposition packet, root authorized one transport-local correction (incarnation-carrying send, no rebind, no protocol redesign). This is e361cfbc. The original guard history is kept unchanged, and the continuation is recorded separately against it.

Known limits

  • Child launched under a replaced link but never recorded here: a retry refuses, and reconciliation is manual (the thread ID, or t3_thread_list with 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.
  • Launch refused because the link was replaced during the send: the key stays bound to the first link, and a retry refuses. Starting the work again is a deliberate new intent, made after checking that environment's threads.
  • Follow-up sends through a link (t3_thread_send) still use session-scoped keys. This is pre-existing and unchanged.
  • MCP session cache: PeerMcpClient keys 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.
  • Weights: the server weights every environment equally; client-side weights are not read.
  • Model-facing wording: the placement description was not checked with evals/, because that needs paid model runs.
  • Remaining CLO-866 entrypoints: t3_thread_launch auto, 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.
  • Pre-commit hook: bypassed with --no-verify. It fails on pre-existing knip findings outside the changed files, and on host Node being unable to load scripts/knip-schemas.ts. Format, lint, typecheck and tests were run manually as above.

Provenance

  • Model: claude-opus-5-5 (Claude Opus 5.5)
  • Task: CLO-866 universal native thread placement, layer 2 and its review round 1 repair, as the sole source owner
  • Agent/Harness: Claude Code in T3 Code

🤖 Generated with Claude Code

…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>
@nullStack65

Copy link
Copy Markdown
Owner Author

CHECKPOINT

CHECKPOINT: CLO-866 layer 2 (durable placement binding plus creation entrypoints) on the native 0.1.10 release line.

  • Scope: delegate_task placement:"auto" is bound before any launch in the existing command-receipt store. It is caller-scoped by request namespace and clientRequestId, and it is reused on retry, lost answer and restart. create_threads now admits through chooseThreadPlacement and refuses another environment instead of silently creating the thread locally. The ARC workflow now runs the placement, RemoteDelegation and OrchestratorMcpService suites.
  • Base: release/native-0.1.10 at 3596754. Head: f943506.
  • Local verification at this head, on a bounded runner:
    • Typecheck of contracts, shared and server is clean.
    • Format check and lint on the changed files are clean.
    • The workflow test list passes: 9 files, 237 tests.
    • Mutation check: removing the binding read makes the new lost-answer/restart test fail.
  • ARC run 44242725875 (pull_request) is queued; its result will follow.
  • Not verified: the evals/ model-facing description check, which needs paid model runs; live hosts were not touched.

@nullStack65

Copy link
Copy Markdown
Owner Author

RESULT

RESULT: CLO-866 layer 2 (durable placement binding plus creation entrypoints). The PR is ready for its one review. It is not merged.

  • Head: f943506. Base: release/native-0.1.10 at 3596754. Mergeable: true.
  • ARC run 44242725875 (pull_request, self-hosted t3code-ci-arc) completed with success at this exact head. All steps passed, including:
    • typecheck of contracts, shared, client-runtime, provider-core and server;
    • 9 test files, 237 tests, now including threadPlacement, RemoteDelegation and OrchestratorMcpService;
    • the server bundle, the web build and the compiled-output check.
  • Verified: an auto-placed task keeps its bound environment across a lost launch answer, a laptop restart and a now-saturated box. A new key with no eligible host fails explicitly, launches nothing and binds nothing. create_threads refuses another environment before creating anything. Removing the binding read makes the recovery test fail.
  • Not verified:
    • the evals/ check of the model-facing placement description, which needs paid model runs;
    • live host canary and restart behavior;
    • re-link-between-retries duplicate launch, which is pre-existing keyed-retry behavior.
  • Remaining CLO-866 work:
    • t3_thread_launch auto placement;
    • web/desktop/mobile creation, the CLI and external MCP launch;
    • fresh-thread schedules and Tots;
    • runtime canary and restart/stale-peer gates with the host owners.
  • Owned by root: the single review round, the green merge and host acceptance. No live hosts or Jeff's artifact were touched.

Copy link
Copy Markdown
Owner Author

Independent automated review R1 — changes required

Reviewed head f943506b4cb867ba92e8fcefd7e770c6b3f7cfcb against 35967547fadca5978a9a1c1caf400d523ad0bee5.
Reviewer: ChatGPT delegated agent /root/tots_runtime_route, independent of the native Claude Code implementer. This is automated technical review, not human approval. Root also inspected the changed files and the critical delegation/launch identity path.

  1. P1: relinking after an accepted launch with a lost response can duplicate the child. The placement receipt stores the environment, but RemoteDelegation.delegate launches before recording the parent task. PeerForwarding scopes the forwarded key; receiving McpOAuth uses client:<sessionId>, and project/handlers.ts hashes that namespace plus key into the launch/thread identity. A replacement OAuth link session therefore creates a new child for the same bound request. The disclosed limitation is real behavior of the new auto route. Preserve/reconcile a durable child or operation identity across relinking, or fail closed when the original ambiguous identity cannot be recovered. The current restart test preserves the link session and does not cover this transition.

  2. P2: inherited runtime mode is not preserved by auto placement. placeTask maps omitted/inherit to undefined, so candidate link/provider checks do not test the parent's effective mode. Remote delegation then omits it and the destination can choose a narrower/default mode. Resolve the intended effective mode before automatic selection, qualify candidates against it, and send it explicitly; retain separately scoped named-target semantics.

  3. P2: unpinned target.projectId bypasses the project evidence used to select the host. Candidate qualification resolves a project matching the parent repository, but actual delegation passes the explicit override to resolveRemoteProject, which immediately accepts that ID. Auto can qualify repository A and launch project B; local selection rejects the same input. Reject an unpinned project override for auto, or carry the exact authenticated project selection through launch.

The create_threads batch guard and first-writer receipt mechanics are sound. Exact-head ARC run 44242725875 passed. CodeRabbit's success status denotes a skipped base-branch review. No live-host or paid test was performed. Budget/account equivalence is not established by the current capability evidence; keep existing budget/admission restrictions and qualify that before runtime acceptance.

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>
@nullStack65

Copy link
Copy Markdown
Owner Author

CHECKPOINT

CHECKPOINT: CLO-866 PR68 review round 1 repair (3 findings), in one bounded round on the same branch.

  • Base: release/native-0.1.10 at 3596754 (unchanged).
  • Reviewed head: f943506. Revised head: 6e84149. Round delta: git diff f943506b 6e841498, 6 files.
  • Red baseline: the three new regressions ran twice on the unfixed source and failed both times, each for the reported reason. The retry under a new link launched a second child; the narrower link was accepted; and the task launched into the other project.

P1: lost answer, then a replaced OAuth link session, duplicates the child. Fixed on guarded attempt 2.

  • Attempt 1 failed: it used linkedAt as the session identity, which collides when two links are made within one clock tick (the test clock showed this).
  • Attempt 2 adds PeerLinks.session: the link's per-link random secret-store name (not the token), which changes exactly when the box's client:<sessionId> does.
  • RemoteDelegation.delegate binds <env>@<session> before launching, and binds the answered child thread ID before the record, both in the existing receipt store. A retry under a different session never launches. It returns the task already recorded for the bound child, or fails closed (orchestration_error) with how to find the thread there. Unreadable link storage also fails closed.
  • This applies to both auto and named-target remote delegation.
  • Regression, a launch whose answer was lost is never started again under a new link: the lost answer plus re-link refuses, the box's thread is unchanged and no task is recorded. A recorded task plus re-link returns the same task ID with no second launch.

P2: auto omitted/inherit mode. Fixed on attempt 1.

  • placeTask resolves the parent's effective runtime and interaction modes (or narrower ones requested) through the normal ceilings before selection.
  • Candidate links below that runtime mode are excluded, and the providers there must offer it.
  • Both modes are forwarded explicitly, so the destination's link or project defaults cannot silently narrow them. Named-target semantics are unchanged.
  • Regression: a parent at full-access/plan with an auto-accept-edits link fails with no-eligible-environment and launches nothing. With a full-access link, the box launches with full-access/plan.

P3: auto with target.projectId. Fixed on attempt 1. placement:"auto" refuses target.projectId with invalid_request before any binding or launch. Regression: nothing is launched on the box.

Guard. scripts/repair_attempt_guard.py, state at ~/.local/state/closura/repairs/clo-866-pr68-r1-F{1,2,3}.json:

  • F1: [failed, passed]
  • F2: [passed]
  • F3: [passed]

Checks at 6e84149.

  • Format, lint and server typecheck are clean.
  • The workflow test list plus PeerLinks and AgentAwarenessRelay: 11 files, 284 tests passed locally.
  • ARC run 44245310923 is queued.

Known limits. These are honest and unchanged in kind:

  • If a child was launched under a replaced link but never recorded here, the retry refuses; recovery is manual, using the thread ID or t3_thread_list there.
  • Follow-up sends (t3_thread_send through the link) keep the same session-scoped keys. That is a separate, pre-existing pattern and out of this round's scope.
  • evals/ was not run, because it needs paid model runs.
  • No live hosts were touched.

Copy link
Copy Markdown
Owner Author

R1 repair verification — P2/P3 closed; P1 remains open

Checked repair f943506b4cb867ba92e8fcefd7e770c6b3f7cfcb..6e8414980fa9991535b329d7e8771ec983f5f9a7 on unchanged base 35967547, by the retained independent automated reviewer. No second broad review or human approval is claimed.

  • P2 closed: auto resolves effective runtime/interaction modes, uses runtime mode for eligibility, and sends both modes explicitly.
  • P3 closed: unpinned auto project override is refused before selection/launch.
  • P1 only partly corrected: random per-link secret_name fixes the timestamp collision and the new test covers completed relink before retry, plus recorded-child recovery. However RemoteDelegation checks that name separately; PeerForwarding.call carries only environmentId, and PeerMcpClient.call independently resolves the current link/token later. A retry can match L1, then relinking installs L2 before transport resolution, and the request launches a second child under L2's OAuth namespace. The missing-session branch also skips the binding instead of refusing, allowing a link to appear before the later resolve.

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 (linkedAt collision); attempt2's sequential regression passed but does not close this send-boundary race. P2/P3 attempt1 passed. The author reports284tests/11files passing; new ARC44245310923 is collecting. No history reset or automatic third repair is authorized. Root requested the same author's read-only blocking-decision/transport-seam packet and will issue a concrete caller disposition under the existing repair-guard policy before further implementation. Keep this head unmerged.

@nullStack65

Copy link
Copy Markdown
Owner Author

BLOCKER

BLOCKER: 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.
RemoteDelegation.delegate reads links.session(env) (the row's secret_name) and binds remote-launch:<key> to <env>@<secret_name>. Then forwarding.call → PeerForwarding.forward → PeerMcpClient.call → links.resolve(env) reads the row and token again (PeerLinks.resolve: readRow, then secrets.get(row.secret_name)). The check and the credential actually used are two separate reads, so a PeerLinks.link() between them sends the launch under L2. The peer derives the thread ID from the bearer token's OAuth session (McpOAuth: requestNamespace = client:<sessionId>), so that launch creates a second child.

When links.session returns None, the delegation skips binding. A link created before resolve then sends an unbound launch, and a later re-link duplicates the child undetected.

Seam where one immutable credential and incarnation can be checked and used.

  • PeerLinks.resolve already reads secret_name and the token as one consistent pair from one row: if a re-link removes that secret, secrets.get returns None and resolve fails. It returns {link, url, token} but not the incarnation.
  • Smallest change: resolve also returns incarnation: row.secret_name. PeerMcpClient.call takes an optional expectedIncarnation and, right after resolve and before any POST (including openSession), fails closed on a mismatch.
  • PeerForwarding.call passes that option through forward → peers.call, used only by the launch in RemoteDelegation.delegate.
  • RemoteDelegation then requires a session: None means a refusal with "not linked" before binding or sending. It binds the marker to that incarnation and sends with expectedIncarnation.
  • Result: the incarnation that is checked is the one whose token is sent. No token leaves PeerLinks/PeerMcpClient, and auth, modes and link access are not widened.
  • Not recommended: resolving in RemoteDelegation and passing the credential down. That moves the token out of the transport.
  • Hygiene, not required for P1: the MCP session cache in PeerMcpClient is keyed by env + url, not incarnation, so after a re-link an L1-opened MCP session ID is sent with the L2 token. The namespace comes from the bearer token, so thread identity is unaffected; keying the cache by incarnation would remove the mix.

Fail-closed behavior under that design.

  • Session missing: invalid_request "not linked", with no binding and no send.
  • Incarnation mismatch at send: orchestration_error saying the environment was linked again during this launch and nothing was sent; nothing reaches the peer.
  • A retry with that key then hits the existing marker mismatch. It returns the recorded task if the child was bound, otherwise it refuses and names how to find the thread.

Deterministic interleaving reproduction, using test seams only.

  • makeLaptop already wraps the laptop's ThreadManagementService for RemoteDelegation, for the beforeFollow hook. A hook on bindIntent for the remote-launch: command ID can run linkTo(...) (a re-link) after the marker binds and before resolve.
  • Red at 6e84149:
    1. A lost first attempt under L1 (afterLaunch dies).
    2. Retry: the session read is L1, which matches the marker.
    3. The hook re-links to L2.
    4. resolve uses L2, the box launches a different thread, and the task is recorded against it.
    5. The assertion that the box thread is unchanged fails.
  • For the None branch: give RemoteDelegation a wrapped PeerLinks whose session returns None, then link. PeerMcpClient keeps the real one. Lost answer, re-link, retry gives a duplicate.

Repair history (do not reset).

  • Guard state is at ~/.local/state/closura/repairs/clo-866-pr68-r1-F1.json (also F2 and F3).
  • F1 attempt 1 failed: it used linkedAt as the session identity, which collides within one clock tick.
  • F1 attempt 2 passed its sequential test: it switched to the per-link secret_name through PeerLinks.session and binds remote-launch before the send and remote-child after the answer. It did not close the read/send race or the None branch.
  • F2 and F3 passed on attempt 1 and should be preserved.
  • The guard closes a passed bug to further attempts, so any further F1 work needs an explicit caller disposition, not a relabel.

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.

  1. Authorize the incarnation-carrying send above as the F1 continuation under a recorded disposition. It changes the PeerLinks.resolve, PeerMcpClient.call and PeerForwarding.call signatures in an additive, launch-only way.
  2. Decide whether a pre-send refusal from a marker this attempt inserted may be rebound. The recommendation is no: keep fail-closed, and the caller uses a new clientRequestId.
  3. Not available without a contract change on both sides: making the peer key forwarded launches by a cross-session link identity, so the original child is recovered instead of refused. The peer only knows peerLink: true, not which environment linked it.

Copy link
Copy Markdown
Owner Author

Caller disposition for the original P1 continuation

Root 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:

  1. Authorize the incarnation-carrying send described in packet item3. Return the incarnation from the same PeerLinks.resolve row that supplies the captured token. Carry an internal optional expectedIncarnation through the existing forwarding/client signatures; the launch compares it against that immutable resolved result before handshake or request. The already captured token must remain the token for the call and its MCP-session retry. No token leaves the current credential/transport services; no auth, mode or link-access expansion.
  2. Missing incarnation refuses before any launch. No skip-and-try fallback.
  3. Do not rebind a refused key, even if no send is observed for this attempt. Preserve first-writer binding and ambiguous acceptance. A different key is only a deliberately new intent after reconciling existing remote work, never an automatic retry instruction.
  4. Keep recorded-child recovery and P2/P3 intact. Do not expand this correction into cross-session protocol redesign or MCP-session-cache cleanup.

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>

Copy link
Copy Markdown
Owner Author

Retained R1 continuation verification — original findings closed

Checked only the caller-disposed P1 continuation 6e8414980fa9991535b329d7e8771ec983f5f9a7..e361cfbcffbdce471f49a7fde45d44b6d4882a9f, with the same independent automated reviewer. This is changed-findings verification, not another broad review or human approval.

P1 is closed by the inspected source and regression boundaries. PeerLinks.resolve returns the incarnation from the same stored row whose secret name supplies the captured token. expectedIncarnation reaches PeerMcpClient.call; a mismatch refuses before openSession or any MCP POST. The normal request and 404 session renewal reuse that captured token without resolving the link again. An absent incarnation now refuses before launch. The existing first-writer receipt is not rebound, and recovery of an already recorded child remains intact.

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.

@nullStack65

Copy link
Copy Markdown
Owner Author

RESULT

RESULT: 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.

  • Head: e361cfb. Base: release/native-0.1.10 at 3596754 (unchanged). Round delta: git diff 6e841498 e361cfbc, 6 files.
  • Source:
    • PeerLinks.resolve returns incarnation: the secret_name of the same row whose token it returns.
    • PeerMcpClient.call takes an optional expectedIncarnation and, right after resolve, refuses before openSession or any POST. The captured token stays in use for the call and its MCP-session retry.
    • PeerForwarding.call passes options.expectedIncarnation through. Existing callers are unchanged.
    • RemoteDelegation.delegate refuses with invalid_request when there is no link session, before binding or sending. It sends the launch with the bound incarnation and never rebinds a key. Its refusal help no longer suggests a new clientRequestId.
    • No auth, mode or link-access widening, no protocol redesign, and no change to the MCP session cache.
  • Red baseline, on the unfixed source plus the new tests, twice each (logs-r1c/red-5.log, red-6.log):
    • A link replaced between the launch check and the send starts no second child. A real-transport re-link runs after the marker check and before credential resolution, via a test-only bindIntent hook. Unfixed, the box launched a second thread.
    • A launch with no link to bind to starts nothing, even if a link appears. Unfixed, the launch went out unbound.
    • My first version of the no-link test never reached the session read: without a link, the remote project lookup refused first. Runs red-1 to red-4 were therefore superseded. The test now names target.projectId, so the session read is the first link-dependent step.
  • Verification:
    • Continuation run: RemoteDelegation, PeerMcpClient, PeerForwarding and PeerLinks tests, 4 files and 79 tests, passed. This includes both new cases, the sequential re-link, recorded-child, restart, P2 and P3 cases.
    • The workflow test list passed locally: 9 files, 242 tests.
    • Server typecheck, format and lint are clean.
    • ARC run 44247100447 at e361cfb: success, with 9 files and 242 tests on the runner.
  • Continuation accounting:
    • The original guard file ~/.local/state/closura/repairs/clo-866-pr68-r1-F1.json is unchanged, sha256 ca211d20c543c11647bce869d1db7c940bee3f96b49afa94ec3c31222642b012. Attempt 1 failed; attempt 2 passed sequentially but left the race.
    • This disposition-authorized continuation is recorded separately in clo-866-pr68-r1-F1-continuation-6970222770.json, which links to the original and its hash. Status: passed, exit 0, one verification run, no attempt budget claimed.
  • PR body: updated to this head's actual behavior, verification, review history, known limits and provenance (Model claude-opus-5-5, Task, Agent/Harness). The earlier body's re-link limit statement is corrected.
  • Remaining: root's bounded verification of the changed P1 behavior, and the merge. The other CLO-866 entrypoints and any live-host work are not started.

@nullStack65
nullStack65 merged commit a40cf0a into release/native-0.1.10 Nov 18, 2026
2 checks passed
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