Repository navigation
Design and plan a hook-based integration that lets the Swarm subsystem… - #4
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 10dad0d9-14e5-41b6-a9cf-814317eced36) |
| if p.get("dry_run") and not task["notes_json"].get("dry_run"): | ||
| return "dry-run" | ||
| if p["verdict"] not in ("pass", "waive"): | ||
| return "fail" | ||
| try: | ||
| if not float(p["issued_at"]) + float(p["expires_s"]) > now: | ||
| return "expired" | ||
| except (KeyError, TypeError, ValueError): | ||
| return "mismatch" |
There was a problem hiding this comment.
Expired failures remain authoritative If a failing verdict has expired before a target is reconciled,
_check_row still returns fail before checking its expiry. Reconciliation can therefore send the target into rework or escalation based on expired evidence instead of requiring a fresh gate run. Check expiry for failing verdicts too.
Knowledge Base Used: Gate evaluation
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/taskstore.py
Line: 333-341
Comment:
**Expired failures remain authoritative** If a failing verdict has expired before a target is reconciled, `_check_row` still returns `fail` before checking its expiry. Reconciliation can therefore send the target into rework or escalation based on expired evidence instead of requiring a fresh gate run. Check expiry for failing verdicts too.
**Knowledge Base Used:** [Gate evaluation](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/gate-evaluation.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| /** Ready = the plan's tasks with an empty depends_on list (the only definition; no Task Store re-read). */ | ||
| function readyTaskIds(json: Record<string, unknown>): string[] { | ||
| const tasks = Array.isArray(json.tasks) ? json.tasks : []; | ||
| const ids: string[] = []; | ||
| for (const t of tasks) { | ||
| if (typeof t !== "object" || t === null) continue; | ||
| const { task_id, depends_on } = t as { task_id?: unknown; depends_on?: unknown }; | ||
| if (typeof task_id === "string" && Array.isArray(depends_on) && depends_on.length === 0) ids.push(task_id); |
There was a problem hiding this comment.
Reused plans advertise stale work Repeating
/swarm uses the creation-time plan snapshot, and this function calls any task with no dependencies “ready” without checking its current state. A root task already running or DONE is advertised to a new A01 dispatch turn, creating avoidable duplicate-dispatch attempts despite the live status API marking it ineligible.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: omp/src/commands.ts
Line: 56-63
Comment:
**Reused plans advertise stale work** Repeating `/swarm` uses the creation-time plan snapshot, and this function calls any task with no dependencies “ready” without checking its current state. A root task already running or `DONE` is advertised to a new A01 dispatch turn, creating avoidable duplicate-dispatch attempts despite the live status API marking it ineligible.
**Knowledge Base Used:**
- [Orchestration workflow](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/orchestration-workflow.md)
- [OMP integration](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/omp-integration.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| key = _ed25519_key() | ||
| if key is not None: | ||
| sig = key.sign(_canonical(env)) | ||
| env["sig"] = "ed25519:" + base64.b64encode(sig).decode() | ||
| else: | ||
| secret = os.environ.get("SWARM_SIGNING_KEY", "dev-insecure-key").encode() | ||
| # an empty SWARM_SIGNING_KEY counts as unset, exactly as verify_envelope treats it | ||
| secret = (os.environ.get("SWARM_SIGNING_KEY") or "dev-insecure-key").encode() | ||
| if audit and not os.environ.get("SWARM_SIGNING_KEY"): |
There was a problem hiding this comment.
Invalid signing key produces assignment If
SWARM_ED25519_KEY is set but cannot be loaded and no HMAC key is configured, this function silently signs task.assign with the public development key. The verifier rejects that signature under the same configuration, so an agent enforcing signed assignments receives an unverifiable assignment rather than an immediate key-configuration error.
Knowledge Base Used: Result envelopes and verdicts
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/envelope.py
Line: 148-155
Comment:
**Invalid signing key produces assignment** If `SWARM_ED25519_KEY` is set but cannot be loaded and no HMAC key is configured, this function silently signs `task.assign` with the public development key. The verifier rejects that signature under the same configuration, so an agent enforcing signed assignments receives an unverifiable assignment rather than an immediate key-configuration error.
**Knowledge Base Used:** [Result envelopes and verdicts](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/result-envelopes-and-verdicts.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| def real_key_configured() -> bool: | ||
| """True when a non-dev signing key is configured (loadable Ed25519 seed or HMAC secret).""" | ||
| return _ed25519_key() is not None or bool(os.environ.get("SWARM_SIGNING_KEY")) |
There was a problem hiding this comment.
Public key satisfies required signing If a protected configuration explicitly sets
SWARM_SIGNING_KEY=dev-insecure-key, SWARM_REQUIRE_KEY=1 treats that publicly known value as a real key. Development-key verdicts then verify and the approval check can pass, defeating the required-key protection. Reject the known development value when a real key is required.
How this was verified: The required-key check accepts any nonempty HMAC secret, and verification uses that secret verbatim without checking whether it is the public development value.
Knowledge Base Used: Result envelopes and verdicts
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/envelope.py
Line: 114-116
Comment:
**Public key satisfies required signing** If a protected configuration explicitly sets `SWARM_SIGNING_KEY=dev-insecure-key`, `SWARM_REQUIRE_KEY=1` treats that publicly known value as a real key. Development-key verdicts then verify and the approval check can pass, defeating the required-key protection. Reject the known development value when a real key is required.
**How this was verified:** The required-key check accepts any nonempty HMAC secret, and verification uses that secret verbatim without checking whether it is the public development value.
**Knowledge Base Used:** [Result envelopes and verdicts](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/result-envelopes-and-verdicts.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This comment has been minimized.
This comment has been minimized.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: d018d13e-81c4-4db9-980d-3d6e57477aed) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 20b566ee-e966-4760-bc25-d2ac8071af51) |
| env["SWARM_CHILD"] = "0" | ||
| env["AIO_SWARM_AFTER_ORCH"] = "1" | ||
| subprocess.Popen( | ||
| ["python3", str(hook_path), "--brief", f"gsd-autonomous follow-on after a01 {corr or ''}"], |
There was a problem hiding this comment.
Follow-on run never starts The launcher passes a fixed brief,
gsd-autonomous follow-on after a01, that contains none of the terms accepted by autonomous_run.py's classifier. The child exits before planning or running Swarm, although the completion was marked as fired. Greptile automatically discovered a related ticket stating that the completion trigger must invoke the existing Swarm entry point, which informed this comment.
Knowledge Base Used: Autonomous run hooks
Source Used: Linear — [n3] Define the hook trigger condition and firing mechanism
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/hook_trigger.py
Line: 47
Comment:
**Follow-on run never starts** The launcher passes a fixed brief, `gsd-autonomous follow-on after a01`, that contains none of the terms accepted by `autonomous_run.py`'s classifier. The child exits before planning or running Swarm, although the completion was marked as fired. Greptile automatically discovered a related ticket stating that the completion trigger must invoke the existing Swarm entry point, which informed this comment.
**Knowledge Base Used:** [Autonomous run hooks](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/autonomous-run-hooks.md)
**Source Used:** Linear — [\[n3\] Define the hook trigger condition and firing mechanism](https://linear.app/swcstudio/issue/SPE-6056/n3-define-the-hook-trigger-condition-and-firing-mechanism)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| ["python3", str(hook_path), "--brief", f"gsd-autonomous follow-on after a01 {corr or ''}"], | ||
| cwd=str(Path(__file__).resolve().parent.parent), |
There was a problem hiding this comment.
Follow-on targets wrong repository If the child proceeds past classification after a hook fires in an installed application workspace, it starts in the AgentSwarm checkout without
--cwd. autonomous_run.py therefore plans and runs against the checkout instead of the application. It also receives a placeholder rather than the user's brief, so the planned work does not reflect the request.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/hook_trigger.py
Line: 47-48
Comment:
**Follow-on targets wrong repository** If the child proceeds past classification after a hook fires in an installed application workspace, it starts in the AgentSwarm checkout without `--cwd`. `autonomous_run.py` therefore plans and runs against the checkout instead of the application. It also receives a placeholder rather than the user's brief, so the planned work does not reflect the request.
**Knowledge Base Used:**
- [Autonomous run hooks](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/autonomous-run-hooks.md)
- [Orchestration workflow](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/orchestration-workflow.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| except Exception: | ||
| pass # fail open |
There was a problem hiding this comment.
Failed dispatch cannot recover If the subprocess fails to start, or exits before dispatching work, the trigger has already been recorded as seen and
FIRED. This handler swallows the spawn error, and a redelivered completion is skipped as a duplicate, permanently losing its follow-on run. Greptile automatically discovered a related ticket stating that interrupted dispatches must remain recoverable across FIRED, RUNNING, and terminal transitions, which informed this comment.
Knowledge Base Used: Autonomous run hooks
Source Used: Linear — [n7] Evaluate risks across idempotency, concurrency, and failure paths
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/hook_trigger.py
Line: 54-55
Comment:
**Failed dispatch cannot recover** If the subprocess fails to start, or exits before dispatching work, the trigger has already been recorded as seen and `FIRED`. This handler swallows the spawn error, and a redelivered completion is skipped as a duplicate, permanently losing its follow-on run. Greptile automatically discovered a related ticket stating that interrupted dispatches must remain recoverable across FIRED, RUNNING, and terminal transitions, which informed this comment.
**Knowledge Base Used:** [Autonomous run hooks](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/autonomous-run-hooks.md)
**Source Used:** Linear — [\[n7\] Evaluate risks across idempotency, concurrency, and failure paths](https://linear.app/swcstudio/issue/SPE-6058/n7-evaluate-risks-across-idempotency-concurrency-and-failure-paths)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| hooks["Stop"] = [ | ||
| {"hooks": [{"type": "command", "command": complete_cmd}]} | ||
| ] |
There was a problem hiding this comment.
Installer removes existing Stop hooks If an application workspace already has
Stop handlers, installing AgentSwarm replaces their entire list with this handler. Those existing completion handlers no longer run after installation; preserve them when adding the new registration.
| hooks["Stop"] = [ | |
| {"hooks": [{"type": "command", "command": complete_cmd}]} | |
| ] | |
| stop_hooks = hooks.setdefault("Stop", []) | |
| complete_hook = {"hooks": [{"type": "command", "command": complete_cmd}]} | |
| if complete_hook not in stop_hooks: | |
| stop_hooks.append(complete_hook) |
Knowledge Base Used: Agent artifact generation
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/build_agents.py
Line: 257-259
Comment:
**Installer removes existing Stop hooks** If an application workspace already has `Stop` handlers, installing AgentSwarm replaces their entire list with this handler. Those existing completion handlers no longer run after installation; preserve them when adding the new registration.
```suggestion
stop_hooks = hooks.setdefault("Stop", [])
complete_hook = {"hooks": [{"type": "command", "command": complete_cmd}]}
if complete_hook not in stop_hooks:
stop_hooks.append(complete_hook)
```
**Knowledge Base Used:** [Agent artifact generation](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/agent-artifact-generation.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: e6b9b60c-eae6-48c8-8cdc-e90e20bce594) |
| def __init__(self, path: str | Path | None = None, *, root: str | Path | None = None): | ||
| self.root = Path(root) if root else Path(".") | ||
| self.claude_path = self.root / ".claude" / "swarm-state.json" | ||
| self.swarm_path = (swarm_dir(root, create=True) / "swarm-state.json") if root else (Path(".swarm") / "swarm-state.json") |
There was a problem hiding this comment.
Completion trigger loses its run If
SWARM_DIR points outside the workspace and ./.swarm does not exist, the completion hook records the trigger ID in the configured database but tries to write this mirror under ./.swarm. That write fails before the follow-on run starts. The hook suppresses the error, and a repeated completion is skipped because its ID is already recorded.
| self.swarm_path = (swarm_dir(root, create=True) / "swarm-state.json") if root else (Path(".swarm") / "swarm-state.json") | |
| self.swarm_path = swarm_dir(root, create=True) / "swarm-state.json" |
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/state_store.py
Line: 83
Comment:
**Completion trigger loses its run** If `SWARM_DIR` points outside the workspace and `./.swarm` does not exist, the completion hook records the trigger ID in the configured database but tries to write this mirror under `./.swarm`. That write fails before the follow-on run starts. The hook suppresses the error, and a repeated completion is skipped because its ID is already recorded.
```suggestion
self.swarm_path = swarm_dir(root, create=True) / "swarm-state.json"
```
**Knowledge Base Used:**
- [Task and run state](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/task-and-run-state.md)
- [Autonomous run hooks](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/autonomous-run-hooks.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| SDLC = re.compile( | ||
| r"\b(build|implement|add|create|fix|refactor|migrate|deploy|release|ship|write tests?|set up|setup|integrate|scaffold|upgrade)\b", | ||
| re.I | re.A, |
There was a problem hiding this comment.
Direct test requests are skipped A request such as “test checkout” matched the previous shared classifier, but this expression accepts only “write test” or “write tests,” not
test on its own. The prompt hook therefore adds no orchestration guidance, and autonomous_run.py exits before starting a plan. Preserve direct testing requests when aligning the shared and OMP classifiers.
Knowledge Base Used: Autonomous run hooks
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/signal_detector.py
Line: 15-17
Comment:
**Direct test requests are skipped** A request such as “test checkout” matched the previous shared classifier, but this expression accepts only “write test” or “write tests,” not `test` on its own. The prompt hook therefore adds no orchestration guidance, and `autonomous_run.py` exits before starting a plan. Preserve direct testing requests when aligning the shared and OMP classifiers.
**Knowledge Base Used:** [Autonomous run hooks](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/autonomous-run-hooks.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.…n1-n8 plan; opt-in AIO_SWARM_AFTER_ORCH; state/obs/trigger/detector shims; thin classify delegates; .claude/swarm-state.json obs) - New swarm/ modules for state idempotency, observability, signal detection, hook trigger per n8 execution plan. - Thin shims + on_a01_complete.py for a01-complete / uplift end signal. - Adopted n6 defaults (a01 signal, opt-in, seq default, separate state). - Guardrails stub + n5 6-state projection. - Enables parallel gsd run after ultrathink/orchestrate via hooks. - Tests and smoke pass; no regression. Part of rebuilding Swarm for gsd + claude-ultrathink autonomous via hooks.
…esses greptile completion handler never registered; enables AIO_SWARM_AFTER_ORCH trigger for gsd+ultrathink) - merge_claude_settings and write_grok_hooks now also emit Stop -> on_a01_complete.py - .grok/hooks updated - install dry-run messages updated - matches n3/n8 design for hook reg This should allow the after-orchestrate signal to fire.
…er FIRED (addresses greptile P1 firing never starts swarm; actual detached kick for gsd follow-on)
…1-specific detect, stable dedup+optin parse, .claude primary+unique tmp+GSD root, invoke entry) - on_a01: sys.path for workspace - signal: full guards + a01 check - trigger: stable id, explicit bool, invoke - state: .claude advertised, pid tmp, root append - keeps opt-in, idemp, fail-open Ready for 5/5 review and merge per ultrathink-ship.
…uard, and state store
ca55021 to
6015382
Compare
| elif meta.get("is_error") or meta.get("returncode"): | ||
| result, err = None, SwarmError(ErrorCode.E_EXEC, f"agent session reported error (rc={meta.get('returncode')})", | ||
| task_id=tid) |
There was a problem hiding this comment.
Errored sessions abort scheduling When a headless agent exits nonzero or reports
is_error, this branch uses ErrorCode.E_EXEC, which does not exist. It raises AttributeError instead of rejecting the result, aborting the scheduling round and leaving the task in progress rather than entering the retry path.
Knowledge Base Used: Orchestration workflow
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/swarm_run.py
Line: 827-829
Comment:
**Errored sessions abort scheduling** When a headless agent exits nonzero or reports `is_error`, this branch uses `ErrorCode.E_EXEC`, which does not exist. It raises `AttributeError` instead of rejecting the result, aborting the scheduling round and leaving the task in progress rather than entering the retry path.
**Knowledge Base Used:** [Orchestration workflow](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/orchestration-workflow.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| from .errors import SwarmError | ||
| raise SwarmError(f"E-POLICY {err}") |
There was a problem hiding this comment.
Signing failure raises TypeError In a required-key configuration with no usable key, this branch calls
SwarmError without its required message argument. Signing raises TypeError instead of a policy error, so a runner building an assignment aborts the round without reporting the key-configuration failure.
| from .errors import SwarmError | |
| raise SwarmError(f"E-POLICY {err}") | |
| raise SwarmError(ErrorCode.E_POLICY, err) |
Knowledge Base Used: Swarm execution foundation
Prompt To Fix With AI
This is a comment left during a code review.
Path: swarm/envelope.py
Line: 152-153
Comment:
**Signing failure raises TypeError** In a required-key configuration with no usable key, this branch calls `SwarmError` without its required message argument. Signing raises `TypeError` instead of a policy error, so a runner building an assignment aborts the round without reporting the key-configuration failure.
```suggestion
raise SwarmError(ErrorCode.E_POLICY, err)
```
**Knowledge Base Used:** [Swarm execution foundation](https://app.greptile.com/swcstudio/-/custom-context/knowledge-base/swcstudiospace/agent-swarm/-/docs/swarm-execution-foundation.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
The branch implements an opt-in (AIO_SWARM_AFTER_ORCH) hook-based trigger wiring Swarm execution to fire after orchestrate/ultrathink completion, with supporting modules (swarm/hook_trigger.py, swarm/signal_detector.py, swarm/observability.py, swarm/state_store.py, swarm/paths.py, swarm/verdicts.py, swarm/results.py, swarm/schema.py), a .claude/swarm-state.json observability artifact, extensive test coverage (test_autonomous_run.py, test_hook.py, test_ingest_parity.py, etc.), CI workflow addition, and a long commit history showing iterative Greptile-review-driven hardening (idempotency, fail-closed gate handling, dedup, signal classification, lease/transition semantics). The gsd signals show milestone v2.0 with all 7 phases verified passed and audit scores 38/38 requirements, 7/7 phases, 23/23 integration, 8/8 flows (status 'tech_debt' only, not failing). Clarifications q1-q4 appear addressed in spirit: default options (a01-orchestrator completion signal, opt-in flag, separate swarm-state file) match what was implemented per commit messages referencing AIO_SWARM_AFTER_ORCH and .claude/swarm-state.json.
Linked issues
Fixes SPE-6053 — [n1] Map current Swarm, hooks, orchestrate/ultrathink, and gsd touchpoints
https://linear.app/swcstudio/issue/SPE-6053/n1-map-current-swarm-hooks-orchestrateultrathink-and-gsd-touchpoints
Fixes SPE-6054 — [n2] Decompose integration into independent subsystems
https://linear.app/swcstudio/issue/SPE-6054/n2-decompose-integration-into-independent-subsystems
Fixes SPE-6055 — [n4] Define the parallel execution model and safety boundaries for Swarm units
https://linear.app/swcstudio/issue/SPE-6055/n4-define-the-parallel-execution-model-and-safety-boundaries-for-swarm
Fixes SPE-6056 — [n3] Define the hook trigger condition and firing mechanism
https://linear.app/swcstudio/issue/SPE-6056/n3-define-the-hook-trigger-condition-and-firing-mechanism
Fixes SPE-6057 — [n5] Define observability and gsd-consistent state/log tracking
https://linear.app/swcstudio/issue/SPE-6057/n5-define-observability-and-gsd-consistent-statelog-tracking
Fixes SPE-6058 — [n7] Evaluate risks across idempotency, concurrency, and failure paths
https://linear.app/swcstudio/issue/SPE-6058/n7-evaluate-risks-across-idempotency-concurrency-and-failure-paths
Fixes SPE-6059 — [n6] Identify unresolved ambiguities requiring user confirmation
https://linear.app/swcstudio/issue/SPE-6059/n6-identify-unresolved-ambiguities-requiring-user-confirmation
Fixes SPE-6060 — [n8] Produce ordered, parallelizable execution plan for the coding agent
https://linear.app/swcstudio/issue/SPE-6060/n8-produce-ordered-parallelizable-execution-plan-for-the-coding-agent
Notion task: https://app.notion.com/p/3edbc1a0c7ae8118b153dbc1a86b4f27?pvs=204
Assessment
ultrathink graph ut-muqh4o5a-4ccc266d
Note
High Risk
Changes orchestration leasing, fail-closed gates, hook-fired autonomous runs, and multi-host install paths—areas where mis-wiring can skip work, target the wrong repo, or weaken gate enforcement.
Overview
This PR tightens how the swarm runs against application repos and how gates record verdicts, while adding Trae SOLO, omp, and post-orchestrator hook integration plus CI.
Orchestration and gates: Generated A01 and gate-agent prompts (Claude, Grok, and aligned Trae copies) now require
--repo <app>on plan/status/run tools, store state under<app>/.swarm, lease ready tasks (CLAIMED→IN_PROGRESS) before dispatch, ingesttask.result, and forbid the orchestrator from hand-writing gate verdicts. Gate agents (A08/A09/A10/A12) run each gate script once with the gate task id (scripts write verdicts ongate_fortargets); dry-run gate output is restricted to runner dry-runs. A09’s public verdict vocabulary moves topass/fail(legacy aliases documented).New host surfaces: Adds a generated Trae kit (15 prompts,
registration.json,/swarmcommand, README). Documents and wires an omp extension (.omp/config.yml, package/skills stubs, expandedCLAUDE.md/READMEfor install, guard, and/swarm). GitHub Actions CI runs pytest, agent build checks, and bun tests.Hooks and autonomous kickoff: Grok hook config uses repo-relative hook paths and registers a Stop handler (
on_a01_complete.py→ opt-inAIO_SWARM_AFTER_ORCH/swarm.hook_trigger).autonomous_run.pydelegates classification toswarm.signal_detector, resolvesSWARM_DIRper target repo, skipsswarm_runwhen planning fails, forwards--correlation-id, and addsompruntime. Adds sample.claude/swarm-state.jsonfor observability shape.Docs/examples: README and CLAUDE.md examples consistently pass
--repo; rootpackage.jsontest script targetstests/tsonly.Reviewed by Cursor Bugbot for commit ca55021. Bugbot is set up for automated code reviews on this repo. Configure here.
The PR does not appear safe to merge while errored sessions abort scheduling, recovered plans run without leases, event validation fails, and lost leases can coexist with locally completed tasks.
Fix with agent prompt
Summary
The PR adds an opt-in completion hook and extends Swarm with substrate-backed graph binding, event forwarding, leases, handoffs, governed memory, and per-agent workspace credentials.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Hook[Completion hook] --> Auto[Autonomous runner] Auto --> Plan[Plan] Plan --> Bind[Bind and register graph] Plan --> Tasks[(Task Store)] Tasks --> Claim{Claim node} Claim --> Agent[Agent session] Agent --> Gate[Gate script] Gate --> Review[Reconcile results] Review --> Complete[Complete node] Review --> Handoff[Write handoff] Tasks --> Log[Local event log] Log --> Tee[Substrate event tee]Reviews (4) · Last reviewed commit: "fix: resolve review findings for complet..." · Reviewed by Greptile