Skip to content

feat(swarm): add bounded launch contract for exact candidate verification - #155442

Open
zozo123 wants to merge 20 commits into
openclaw:mainfrom
zozo123:feat/liquid-adaptive-test-time-compute
Open

zozo123 wants to merge 20 commits into
openclaw:mainfrom
zozo123:feat/liquid-adaptive-test-time-compute

Conversation

@zozo123

@zozo123 zozo123 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #156632

What Problem This Solves

Swarm can vary per-child model/thinking/fast-mode, but one verification lane cannot currently make its launch stricter than an ordinary collector.

A verifier needs three monotone controls without creating a second scheduler or permission plane:

  • restrict the explicit handoff to a bounded information boundary;
  • require the existing sandbox admission path and fail closed if unavailable;
  • bind an exact candidate to the existing replay fingerprint.

Solution

This PR adds one experimental boundedLaunch contract:

await agents.run("Verify this exact candidate.", {
  thinking: "high",
  boundedLaunch: {
    boundary: "artifact-only",
    requirements: {
      sandbox: "require",
      candidateDigest: "required",
      artifactRefs: "required",
    },
    candidateBinding: {
      version: 1,
      candidateDigest: "candidate:sha256:...",
      sourceDigest: "source:sha256:...",
      recipeDigest: "recipe:sha256:...",
      policyDigest: "policy:sha256:...",
    },
    handoff: {
      artifactRefs: ["artifact:candidate"],
    },
  },
});

Naming

The public name is intentionally boundedLaunch, not dynamics.

That follows current OpenClaw vocabulary: core already uses bounded launch contracts, frozen/sealed candidates, and candidate bindings. Population dynamics remains caller/plugin policy instead of becoming a second orchestration layer in core.

Architecture

Think of this as the freeze/seal measurement boundary:

high-entropy exploration -> select -> freeze/seal exact candidate -> bounded launch -> verify

A caller or plugin may adapt model, thinking level, fast mode, search width, or verification intensity from novelty, disagreement, correlation, resource pressure, or other policy signals. Core does not own that controller.

One conservation rule holds:

Compute may vary; authority may not increase.

No new tool, credential, approval, publish, merge, deploy, scheduler, or sandbox authority is introduced.

Existing owners remain authoritative:

  • sessions_spawn owns admission/execution;
  • the existing sandbox path owns sandbox: "require";
  • the registry owns replay/idempotency;
  • existing tool/source-execution policy is unchanged.

Evidence

Focused coverage verifies:

  • all four information boundaries project the handoff to only their allowed information class; candidate binding is fail-closed on boundaries that drop candidate identity;
  • unsupported authority-shaped fields (tools, credentials, publish, scheduler, instructions) fail before dispatch;
  • incompatible requirements fail before dispatch;
  • required sandbox admission uses the native spawn owner and never retries unsandboxed;
  • the exact candidateBinding covers candidate + source + recipe + policy digests;
  • replay rejects a change to any of those four binding dimensions;
  • calls without boundedLaunch preserve the existing launch path;
  • the native path carries only the filtered handoff into the child.

The binding proves which exact candidate/context was handed to verification. It does not prove that verification ran, was independent, or succeeded.

KISS / non-goals

This PR deliberately does not add:

  • adaptive population scheduling;
  • phase classification or a physics controller;
  • approval/publication authority;
  • a second scheduler;
  • a new sandbox owner.

Adaptive population policy remains separate in #158068 and can evolve independently.

Maintainer edits are enabled. The invariant matters more than preserving my exact implementation.

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: XL triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 22, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: ready, awaiting a maintainer decision.

What this changes

Adds an optional boundedLaunch contract that filters explicit handoff data, requests existing sandbox admission, and includes candidate identity in replay checks.

Example: A verifier receives artifact:a alongside a builder summary and requests sandbox: require.

  • Before: agents.run cannot express this combined handoff and admission contract.
  • After: artifact-only drops the summary, retains artifact:a, and refuses the launch if the native sandbox owner cannot admit it.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A coherent implementation with production-entry-point evidence and no concrete finding; outstanding product acceptance caps overall readiness.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): Contributor-supplied live Gateway traces show delivered handoff filtering and sandbox-required rejection; a scripted-provider Gateway run shows identical replay without redispatch and changed-binding rejection through production persistence. These traces use earlier names, whose retained preparation and replay behavior was checked against the narrowed implementation; they do not establish complete verifier isolation or independent verification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: A Code Mode verifier cannot request filtered explicit handoff, required sandbox admission, and candidate-bound replay together through agents.run.
Reason: The narrowed feature is coherent and avoids a competing scheduler or permission owner, but the linked discussion still requests a core-versus-extension placement decision.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep open for a focused product decision: this PR supplies a coherent launch capability missing from current main, with no concrete correctness finding, but core API placement remains unapproved.

Priority: P2
Reviewed head: 1c7ebb00c397b7a2f7543b4e805689db1882bc6a
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should OpenClaw support boundedLaunch directly on agents.run, or expose this composition through an extension seam?
  • Recommendation: Sponsor the narrow core contract: Accept the bounded launch option while retaining native admission, sandboxing, and replay ownership and the documented limits of handoff projection.
  • Why: The implementation and linked request establish a missing composition, but neither contributor preference nor previous automated reviews establish maintainer acceptance of a permanent core surface.

Before merge

None.

Findings

None.

Agent review details

How this fits together

Code Mode passes guest launch options through the Swarm bridge, which prepares the child task before existing replay lookup and native sessions_spawn admission.

flowchart LR
A[Code Mode agents.run] --> B[Bounded handoff preparation]
B --> C[Existing replay fingerprint]
C --> D[Requester scoped registry]
D --> E[Native spawn admission]
E --> F[Child agent]
Loading

Technical review

Best possible solution:

Choose the supported API placement, then retain one preparation step before existing fingerprinting and admission with the explicit-handoff guarantee documented precisely.

Do we have a high-confidence way to reproduce the issue?

This is a feature proposal; current-main source confirms the combined launch option is absent, and no bug reproduction or target execution was attempted.

Is this the best way to solve the issue?

The narrow preparation step appropriately reuses existing owners, but adopting its public core API requires product acceptance.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against de9c4ab5c0db.

Provenance checked

  • Code Mode Swarm launch construction and replay keeps the original intent (feat(swarm): add QuickJS guest orchestration #111298: Provide typed guest orchestration with requester-scoped replay and fingerprinting; the subsequent runtime extraction preserved those contracts while deferring cold loading.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +418, Tests +1000, Docs +155. Total +1573 across 13 files. Added test files: 5.

View PR surface stats
Area Files Added Removed Net
Source 6 421 3 +418
Tests 5 1000 0 +1000
Docs 2 155 0 +155
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 1576 3 +1573

Review metrics

Metric Value Why it matters
Public launch surface 1 optional agents.run field; 4 boundary modes This expands the supported guest API and warrants an explicit placement decision.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A concrete agent-runtime capability with bounded scope and demonstrated behavior, without evidence of an urgent existing workflow regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve the supported core-versus-extension placement with the Swarm feature owner.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (27 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-27T00:08:53.616Z sha 5f7365fd0d50ae5ab3ea5d5ca8364a4a5044132b :: blocked before merge. :: none
  • reviewed 2026-09-27T00:38:33.305Z sha 2495974 :: blocked before merge. :: none
  • reviewed 2026-09-27T05:54:41.651Z sha 2c2ba76 :: blocked before merge. :: none
  • reviewed 2026-09-27T13:28:16.269Z sha 5f525e8 :: blocked before merge. :: none
  • reviewed 2026-09-27T22:06:42.977Z sha 5f525e8 :: blocked before merge. :: none
  • reviewed 2026-10-04T11:36:59.876Z sha 43c2b63 :: blocked before merge. :: none
  • reviewed 2026-10-04T14:42:47.951Z sha 966265b :: blocked before merge. :: none
  • reviewed 2026-10-04T15:14:47.477Z sha 1ea47c5 :: blocked before merge. :: none

Reviewed October 31, 2026, 1:48 PM ET / 17:48 UTC (Revision 28).

@zozo123 zozo123 changed the title feat(swarm): adaptive test-time compute with Liquid dynamics feat(swarm): add adaptive test-time compute control plane Sep 22, 2026
@zozo123 zozo123 changed the title feat(swarm): add adaptive test-time compute control plane feat(swarm): add dynamics launch contract and adaptive compute advisories Sep 22, 2026
@zozo123
zozo123 force-pushed the feat/liquid-adaptive-test-time-compute branch from 42366a6 to b673791 Compare September 22, 2026 05:02

zozo123 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Final review head is now a single commit: b673791ef746e29736e98a1dc88519f94f729d9c.

Addressed the previous P2 capability-scope finding and the evidence gate:

  • PR title/body now distinguish delivered native launch/admission/replay mechanics from experimental semantic allocation policy.
  • Added authored ## Evidence with explicit repository/native-boundary evidence and evidence not claimed.
  • Heterogeneous per-lane thinking/model/fastMode is documented and regression-tested through the native bridge.
  • deepen is search-only and recommends suggestedThinking: "high"; it does not automatically relaunch work.
  • Added typed host vs external measurement provenance; native host does not fabricate semantic entropy/coherence/correlation.
  • Added separate acceptanceProgress reaction coordinate.
  • Split critical causes through typed verifier-conflict vs entropy-ambiguity triggers.
  • Renamed heuristic confidence to score and moved thresholds into named experimental constants.
  • Added full fold regression through exact sandbox-required verifier preparation.
  • Reframed Liquid/physics language as a phenomenological operator taxonomy, not thermodynamics.
  • Squashed 198 exploratory commits to one commit without changing the final merge tree.

The remaining model-backed native collector transcript and maintainer placement decision are stated explicitly rather than claimed as complete.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@zozo123
zozo123 force-pushed the feat/liquid-adaptive-test-time-compute branch 2 times, most recently from 901aaea to b8d914d Compare September 22, 2026 05:04

zozo123 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Final immutable review head: b8d914d401611eb0f69afaa835677c61bac4d3e5.

This is one commit, rebased on current PR base 3ff189887d035159bb3e609cead6f8b6719bd390, with no obsolete four-stack wording remaining. Please review this exact head; prior reviews refer to superseded heads.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@zozo123
zozo123 force-pushed the feat/liquid-adaptive-test-time-compute branch from 4ab2378 to 006a8ea Compare September 22, 2026 05:10

zozo123 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Current final feature head after the dependency-check fix: 006a8ea21b823b77767e06d6bf5a40dc111e400a.

The only change after the prior exact review request was removing the unnecessary public export from CONTROL_HEURISTICS after Knip correctly flagged it as an unused export. The constants remain named and used internally.

GitHub reports this head mergeable against current main; please review this exact head.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Sep 22, 2026

zozo123 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Current pushed head: cc3d96003180155bfb7fa8056544cdb18d1f7195.

Immediate CI fixes applied after the previous exact review:

  • fixed the no-map-spread lint violation in dynamics measurement cloning;
  • matched OpenClaw/oxfmt formatting for the affected docs and TypeScript;
  • no semantic/authority changes.

The exact review of the prior semantic head returned keep_open with high confidence. Please re-review this current style-fixed head.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Sep 22, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Sep 22, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Oct 4, 2026
@zozo123 zozo123 changed the title feat(swarm): add bounded candidate handoff and verifier launches feat(swarm): add bounded launch contract for exact candidate verification Oct 4, 2026

zozo123 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Current-main naming/architecture cleanup is now pushed at 966265bdb3e01de258e17dabd8ec073d44f431f8.

Key last-mile changes:

  • public option is now boundedLaunch, reserving "dynamics" for population-level policy;
  • exact candidate context is candidateBinding, matching current OpenClaw release vocabulary;
  • implementation moved from swarm/dynamics to swarm/bounded-launch;
  • replica terminology was removed in favor of sourceRunId / targetLaunchId;
  • candidate binding hashing now uses OpenClaw's canonical stableStringify;
  • tests cover all four information projections and reject authority-shaped fields before dispatch;
  • replay proof rejects changes to candidate/source/recipe/policy binding dimensions;
  • current main is merged cleanly; GitHub reports the PR mergeable.

The physics model is documentation-level only: high-entropy exploration -> freeze/seal exact candidate -> bounded launch -> verification. No phase controller, scheduler, or authority layer is added here.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

zozo123 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Final architecture/ownership pass is on current-main head 28f5cf930a10b61466aec6c212f0861925c3aa54.

Additional alignment since the prior exact review:

  • bounded-launch integration tests now use OpenClaw's current durable subagent-registry persistence fixture/owner;
  • boundedLaunch preserves existing target-agent, model, thinking, fast-mode, scheduler, admission, and source-policy paths rather than introducing parallel owners;
  • candidateBinding is now fail-closed for isolated and summary-only, so candidate identity cannot bypass the selected information boundary;
  • all four handoff projections remain explicit and authority-shaped fields are rejected before dispatch;
  • the implementation uses the shared isRecord/normalization primitives and current-main vocabulary;
  • adaptive/statistical-physics policy remains outside core; this PR is only the freeze/seal -> bounded launch -> verification seam.

No new scheduler, permission plane, credential owner, sandbox owner, approval, publish, merge, or deploy authority is introduced.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Oct 4, 2026

zozo123 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Final exact head is 1ea47c5d747b185aa39ea94d9674ddf90b21f762. The only delta from the prior reviewed head is Oxfmt normalization in two files; architecture and behavior are unchanged. @clawsweeper re-review

@zozo123

zozo123 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

@steipete mind taking a look? close/accept/edit as you wish. thanks!

…nfig owners

Current main retired swarm-scheduler.test-support in favor of the native lifecycle observer, requires prepared runtime config before spawnSubagentDirect, and removed the duplicate post-dispatch source recheck (openclaw#169646). Update the bounded launch fixtures accordingly; behavior under test is unchanged.
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 31, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. triage: refactor-only Candidate: refactor/cleanup-only PR without maintainer context.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Bounded launch contract for Swarm agents.run

1 participant