@deftai/directive-content 0.111.0 → 0.112.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/QUICK-START.md +16 -14
- package/Taskfile.yml +4 -0
- package/UPGRADING.md +64 -24
- package/commands.md +12 -12
- package/contracts/design-critique.md +18 -12
- package/docs/SUPPORT.md +43 -0
- package/docs/capabilities.md +110 -0
- package/docs/capability-overlay.json +197 -0
- package/docs/getting-started.md +131 -49
- package/package.json +1 -1
- package/packs/skills/skills-pack-0.1.json +8 -6
- package/scm/github.md +2 -0
- package/skills/deft-directive-design-critique/SKILL.md +8 -3
- package/skills/deft-directive-review-cycle/SKILL.md +12 -8
- package/skills/deft-directive-swarm/SKILL.md +8 -4
- package/skills/deft-directive-swarm/references/core-ops.md +1 -0
- package/skills/deft-directive-swarm/references/core-phase-0.md +1 -1
- package/skills/deft-directive-swarm/references/core-phase-3.md +7 -4
- package/skills/deft-directive-swarm/references/host-claude-code.md +3 -2
- package/skills/deft-directive-swarm/references/host-grok-build.md +4 -2
- package/skills/deft-directive-swarm/references/host-grokbot.md +151 -0
- package/tasks/docs.yml +19 -0
- package/tasks/migrate.yml +3 -1
- package/tasks/scm.yml +12 -1
- package/tasks/verify.yml +16 -0
- package/templates/PULL_REQUEST_TEMPLATE.md +12 -0
- package/templates/agent-prompt-preamble.md +2 -2
- package/templates/agents-entry.md +1 -1
package/scm/github.md
CHANGED
|
@@ -400,6 +400,8 @@ Agent `edit_files` operations can fail when structured file sections contain Uni
|
|
|
400
400
|
|
|
401
401
|
**Framework source (`deftai/directive` only):** use the maintainer catalog at repo-root `.github/ISSUE_LABELS.md` (#2609) — full facets, platform, machine/mirror set (`triaged`, `triage:*`). That path is **repository-only** (not deposited under `.deft/core/`); browse the live file on GitHub rather than a relative path from this shipped guide. Do not invent labels outside that catalog.
|
|
402
402
|
|
|
403
|
+
**Work claim (`status:claimed`, #4200).** Same-issue busy flag, not permission and not two-issue path overlap. Occupancy stays local. `#3607` `kind: pass` and PR review-owner leases stay separate. Verb: `task scm:issue:work-claim -- claim|show|release --issue N [--repo OWNER/NAME]` (`deft scm issue work-claim`). Session-start and `xbrief:preflight` MUST scan; warn is success (not a GitHub lock). Claim refuses read-only / no occupancy. Last-write-wins: the board can lie about who. Clear with `release` or `scope:complete`. ⊗ Invent the label per issue. ⊗ Hang the signal on `scope:promote`.
|
|
404
|
+
|
|
403
405
|
**When no project taxonomy file exists** (fallback shorthand; full kit is the consumer doc above):
|
|
404
406
|
|
|
405
407
|
**Type**: `bug`, `enhancement`, `documentation`, `duplicate`, `wontfix` (prefer existing repo names over inventing `feat` / bare `docs` twins); optional `urgent`
|
|
@@ -3,13 +3,16 @@ name: deft-directive-design-critique
|
|
|
3
3
|
description: >-
|
|
4
4
|
Thin router for the design-critique motion: triggers and pointer stops into
|
|
5
5
|
the contract, including the operator-gated loop. Use when the operator asks
|
|
6
|
-
for a design critique, design-critique, critique panel,
|
|
7
|
-
triage. Do NOT trigger on ordinary implement, build, or
|
|
6
|
+
for a design critique, design-critique, critique panel, mechanism-shaped
|
|
7
|
+
triage, arc, or run an arc. Do NOT trigger on ordinary implement, build, or
|
|
8
|
+
swarm work.
|
|
8
9
|
triggers:
|
|
9
10
|
- design critique
|
|
10
11
|
- design-critique
|
|
11
12
|
- critique panel
|
|
12
13
|
- mechanism-shaped triage
|
|
14
|
+
- arc
|
|
15
|
+
- run an arc
|
|
13
16
|
---
|
|
14
17
|
<!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY -->
|
|
15
18
|
<!-- Purpose: rendered skill -->
|
|
@@ -25,7 +28,7 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
|
25
28
|
|
|
26
29
|
## When to Use
|
|
27
30
|
|
|
28
|
-
- Operator asks for a design critique, a design-critique, a critique panel,
|
|
31
|
+
- Operator asks for a design critique, a design-critique, a critique panel, mechanism-shaped triage, arc, or run an arc
|
|
29
32
|
- ⊗ Ordinary implement, build, or swarm work
|
|
30
33
|
|
|
31
34
|
## Stops
|
|
@@ -46,6 +49,8 @@ Walk / walk all. Auto-stamp when agents agree: Operator verbs.
|
|
|
46
49
|
Parent chip write: scm:issue:design-critique-chip.
|
|
47
50
|
Chip apply miss is non-blocking convenience; do not halt. Ingest waits on the completed-arc record, not a catalog chip.
|
|
48
51
|
Run posture: parse closed tokens; else ask. Field lives in the contract.
|
|
52
|
+
Grok-bot detect default and widget apply-set live in the contract. Consume parseOperatorRunPosture.
|
|
53
|
+
Widgets: numbered Discuss and Back. Plain English first in main-chat.
|
|
49
54
|
|
|
50
55
|
Each critic dispatch EXITs after posting.
|
|
51
56
|
|
|
@@ -532,9 +532,9 @@ Workflow failover arming (Blacksmith cancelled → GH-hosted lane) is sibling is
|
|
|
532
532
|
~ **Eval / regression (#3090):** Given PR open + check SUCCESS + open inline P1s + agent text claims driving merge + turn ends with 0 subagents and no lease → **FAIL** (Owner Continuity Gate), not PASS.
|
|
533
533
|
|
|
534
534
|
### Review Monitoring
|
|
535
|
-
! **Background / independent dispatch (#1880 Gap D):** Long-running review-cycle owners and pollers (>~3 min) MUST be dispatched independently / in the background so the parent conversation stays interactive. On Cursor, use the Task tool background path (`run_in_background: true`) when the current agent is the top-level owner of that primitive (not a nested leaf — see Cursor leaf boundary). On Claude Code, top-level parents/orchestrators use the `Agent` tool with `run_in_background: true` (register primitive `claude-agent`, #3134); implementation leaves follow the Claude Code leaf boundary (blocking `pr:watch` or `stop-at: pr-open` sibling), not nested Agent. On Grok Build, top-level parents/orchestrators MAY `spawn_subagent` a review-monitor; grok-build **implementation leaves** follow the Grok Build leaf boundary (blocking `pr:watch` in this process, or `stop-at: pr-open` with a parent sibling) -- not nested `spawn_subagent`. This generalizes the Approach-1 sub-agent monitor rule to implementation and fix workers as well — foreground dispatch is reserved for short tasks. The parent receives completion via `DONE` / `BLOCKED` / `FAILED` per `templates/agent-prompt-preamble.md` §11.
|
|
535
|
+
! **Background / independent dispatch (#1880 Gap D):** Long-running review-cycle owners and pollers (>~3 min) MUST be dispatched independently / in the background so the parent conversation stays interactive. On Cursor, use the Task tool background path (`run_in_background: true`) when the current agent is the top-level owner of that primitive (not a nested leaf — see Cursor leaf boundary). On Claude Code, top-level parents/orchestrators use the `Agent` tool with `run_in_background: true` (register primitive `claude-agent`, #3134); implementation leaves follow the Claude Code leaf boundary (blocking `pr:watch` or `stop-at: pr-open` sibling), not nested Agent. On Grok Build, top-level parents/orchestrators MAY `spawn_subagent` a review-monitor; grok-build **implementation leaves** follow the Grok Build leaf boundary (blocking `pr:watch` in this process, or `stop-at: pr-open` with a parent sibling) -- not nested `spawn_subagent`. On Grok Bot, top-level parents/orchestrators MAY spawn via Task/executor/CloudAgent (register `grok-bot-executor`, #4201); grok-bot **implementation leaves** follow the Grok Bot leaf boundary (blocking `pr:watch` in this process, or `stop-at: pr-open` with a parent sibling) -- not nested executor spawn. This generalizes the Approach-1 sub-agent monitor rule to implementation and fix workers as well — foreground dispatch is reserved for short tasks. The parent receives completion via `DONE` / `BLOCKED` / `FAILED` per `templates/agent-prompt-preamble.md` §11.
|
|
536
536
|
|
|
537
|
-
! **Worker-owns-lifecycle (#1880 Gap C):** When this skill runs as part of an implementation worker scoped `drive-to: merge-ready`, the worker owns the full review/fix loop through merge-ready in its own tool loop — do NOT exit at PR-open expecting the orchestrator to spawn a separate review leaf. On grok-build / Cursor / Claude Code leaves that cannot nest a review-monitor, "own the loop" means blocking `pr:watch` in **this** process, then `pr:merge-ready` / merge in the same loop -- not spawning a child poller.
|
|
537
|
+
! **Worker-owns-lifecycle (#1880 Gap C):** When this skill runs as part of an implementation worker scoped `drive-to: merge-ready`, the worker owns the full review/fix loop through merge-ready in its own tool loop — do NOT exit at PR-open expecting the orchestrator to spawn a separate review leaf. On grok-build / grok-bot / Cursor / Claude Code leaves that cannot nest a review-monitor, "own the loop" means blocking `pr:watch` in **this** process, then `pr:merge-ready` / merge in the same loop -- not spawning a child poller.
|
|
538
538
|
|
|
539
539
|
! **Swarm monitor must not self-implement (#2843 / Gap C):** When a cohort monitor receives `BLOCKED` or DONE-with-blockers from a `drive-to: merge-ready` implementation leaf, the monitor MUST NOT enter the review/fix loop inline on Tier 1 — background-dispatch ONE continuation leaf scoped `drive-to: merge-ready` on the same worktree. Monitor-inline review-cycle is permitted only on Tier 3 or with explicit operator consent (see `skills/deft-directive-swarm/SKILL.md` Phase 5 completion-notification decision tree).
|
|
540
540
|
|
|
@@ -572,17 +572,17 @@ Cross-links: swarm decision tree `skills/deft-directive-swarm/references/core-ph
|
|
|
572
572
|
|
|
573
573
|
|
|
574
574
|
|
|
575
|
-
! Select the monitoring approach based on runtime capability detection (the matrix in `skills/deft-directive-swarm/SKILL.md` Phase 3 Step 1, extended per #1342 slices 1-2 for `spawn_subagent` / "grok-build", per #1877 for Cursor as first-class Tier-1 tiers, per #2876 for OpenClaw `sessions_spawn`,
|
|
575
|
+
! Select the monitoring approach based on runtime capability detection (the matrix in `skills/deft-directive-swarm/SKILL.md` Phase 3 Step 1, extended per #1342 slices 1-2 for `spawn_subagent` / "grok-build", per #1877 for Cursor as first-class Tier-1 tiers, per #2876 for OpenClaw `sessions_spawn`, per #3134 for Claude Code `claude-code` / `claude-agent`, and per #4201 for Grok Bot `grok-bot` / `grok-bot-executor`). Probe the environment (tool set + env vars) to obtain the stable platform descriptor (`grok-bot`, `grok-build`, `warp-orchestrated`, `warp-manual`, `cursor-composer`, `cursor-cloud-agent`, `claude-code`, `openclaw`, etc.) from the launch adapter / `get_platform_capabilities` and map the descriptor to the appropriate tier + dispatch primitive (`start_agent`, `spawn_subagent`, the Cursor `Task` tool, Claude Code `Agent` / `claude-agent`, OpenClaw `sessions_spawn`, or Grok Bot executor / `grok-bot-executor`). The descriptor (not hard-coded tool presence) is the single source of truth for both launch and review monitoring.
|
|
576
576
|
|
|
577
|
-
- **Tier 1 (orchestrated sub-agent)** → Approach 1 (spawn review-monitor sub-agent via the primitive matching the descriptor: `start_agent`, `spawn_subagent`, the Cursor `Task` tool with `run_in_background: true`, Claude Code `Agent` with `run_in_background: true` / register `claude-agent`,
|
|
577
|
+
- **Tier 1 (orchestrated sub-agent)** → Approach 1 (spawn review-monitor sub-agent via the primitive matching the descriptor: `start_agent`, `spawn_subagent`, the Cursor `Task` tool with `run_in_background: true`, Claude Code `Agent` with `run_in_background: true` / register `claude-agent`, OpenClaw `sessions_spawn`, or Grok Bot executor / register `grok-bot-executor`)
|
|
578
578
|
- **Tier 2 (no sub-agent primitive, but scheduler/timer/auto-reinvocation)** → Approach 2 (yield-between-polls) — includes OpenClaw `cron` / host scheduler **only when** `sessions_spawn` is unavailable (#2876)
|
|
579
579
|
- **Tier 3 (interactive session, nothing else)** → Approach 3 (blocking sleep loop as last resort)
|
|
580
580
|
|
|
581
|
-
! Detection: use the full runtime capability matrix (swarm Phase 3 + launch adapter from #1342 slice 2). The old single-probe for `start_agent` is superseded; the returned platform descriptor determines both the orchestration path and the MCP surface (see MCP probe below). If the descriptor is `grok-build` (spawn_subagent present, start_agent + WARP_* absent), treat as **Tier 1 for parents/orchestrators that own `spawn_subagent`**. A grok-build **implementation leaf** MUST NOT take the spawn_subagent poller path -- see Grok Build leaf boundary (#4130). The parent MAY Approach-1 spawn a sibling monitor only when the leaf envelope is `stop-at: pr-open`. If the descriptor is `cursor-composer` / `cursor-cloud-agent` (Cursor `Task` tool present, start_agent + WARP_* + spawn_subagent absent), treat as **Tier 1 with the backgrounded Cursor `Task` poller path** (#1877) — NOT Tier 3. Cursor's `Task` tool is a first-class sub-agent primitive; degrading a Cursor session to the Approach-3 blocking poll is the misclassification #1877 closes. If the descriptor is `claude-code` (Claude-unique `Agent` / `CLAUDECODE` / `DEFT_PROBE_CLAUDE_CODE` signals), treat as **Tier 1 with the backgrounded Claude Code `Agent` poller path** (#3134) — NOT Tier 3 and NOT `cursor-composer` (bare `Task` is not a Claude-unique signal). If the descriptor is `openclaw` (`sessions_spawn` present), treat as **Tier 1 with the backgrounded `sessions_spawn` poller path** (#2876) — NOT Approach 2 cron and NOT main-session gh poll.
|
|
581
|
+
! Detection: use the full runtime capability matrix (swarm Phase 3 + launch adapter from #1342 slice 2). The old single-probe for `start_agent` is superseded; the returned platform descriptor determines both the orchestration path and the MCP surface (see MCP probe below). If the descriptor is `grok-build` (spawn_subagent present, start_agent + WARP_* absent), treat as **Tier 1 for parents/orchestrators that own `spawn_subagent`**. A grok-build **implementation leaf** MUST NOT take the spawn_subagent poller path -- see Grok Build leaf boundary (#4130). The parent MAY Approach-1 spawn a sibling monitor only when the leaf envelope is `stop-at: pr-open`. If the descriptor is `cursor-composer` / `cursor-cloud-agent` (Cursor `Task` tool present, start_agent + WARP_* + spawn_subagent absent), treat as **Tier 1 with the backgrounded Cursor `Task` poller path** (#1877) — NOT Tier 3. Cursor's `Task` tool is a first-class sub-agent primitive; degrading a Cursor session to the Approach-3 blocking poll is the misclassification #1877 closes. If the descriptor is `claude-code` (Claude-unique `Agent` / `CLAUDECODE` / `DEFT_PROBE_CLAUDE_CODE` signals), treat as **Tier 1 with the backgrounded Claude Code `Agent` poller path** (#3134) — NOT Tier 3 and NOT `cursor-composer` (bare `Task` is not a Claude-unique signal). If the descriptor is `openclaw` (`sessions_spawn` present), treat as **Tier 1 with the backgrounded `sessions_spawn` poller path** (#2876) — NOT Approach 2 cron and NOT main-session gh poll. If the descriptor is `grok-bot` (Grok-Bot-unique widgets / executor / `DEFT_PROBE_GROK_BOT` / `GROK_BOT` signals), treat as **Tier 1 with the backgrounded Task/executor/CloudAgent poller path** (#4201) — NOT `grok-build` via bare `spawn_subagent` and NOT `cursor-composer` via bare `Task`. A grok-bot **implementation leaf** MUST NOT nested-spawn — see Grok Bot leaf boundary (#4201).
|
|
582
582
|
|
|
583
583
|
! Swarm **parents/orchestrators** (whether they own `start_agent`, `spawn_subagent`, or OpenClaw `sessions_spawn`) SHOULD prefer Approach 1 for a review-monitor **sibling** they spawn. A `spawn_subagent` **implementation leaf** MUST NOT spawn its own review-monitor -- the Grok Build leaf boundary (#4130) overrides this paragraph for grok-build leaves. Cursor Task and Claude Code leaves follow their leaf-boundary bullets below, not this spawn-your-own-monitor sentence. Approach 2's yield-between-polls is not self-sustaining for swarm agents (see warning below). Always include the canonical `templates/agent-prompt-preamble.md` (AGENTS.md read mandate, #810 xBRIEF gate, #798 PowerShell UTF-8, pre-PR + review-cycle mandates) when spawning a poller sub-agent.
|
|
584
584
|
|
|
585
|
-
! **Deterministic review-monitor gate (#2655 / #2814 / #2876 / #2893):** When Tier 1 is available **and** a dual-invoke probe succeeds for review-monitor verbs (`deft verify:review-monitor` / `deft review-monitor:register`, or `task deft:verify:review-monitor` / `task deft:review-monitor:register`), run that verify form before yielding, entering Approach 3, or claiming review monitoring started — CLI: `deft verify:review-monitor --pr <N> [--call-site solo]`; task: `task deft:verify:review-monitor -- --pr <N> [--call-site solo]`. After spawning Approach 1, claim the PR-anchored lease with the matching register form (CLI: `deft review-monitor:register --pr <N> --monitor-agent-id <id> --platform-primitive ...`; task: `task deft:review-monitor:register -- --pr <N> --monitor-agent-id <id> --platform-primitive start_agent|spawn_subagent|cursor-task|claude-agent|sessions_spawn|openclaw-sessions-spawn`). Release with the matching release form (CLI: `deft review-monitor:release --pr <N>`; task: `task deft:review-monitor:release -- --pr <N>`) when done. Exit `0` ready / `1` not ready or held-by-other / `2` config. The sole source of truth is the sticky GitHub PR comment (`<!-- deft:review-owner -->`); legacy `.deft/review-monitor.json` is obsolete and ignored. On register conflict, attach to the existing owner or stop — do not parallel-fix.
|
|
585
|
+
! **Deterministic review-monitor gate (#2655 / #2814 / #2876 / #2893):** When Tier 1 is available **and** a dual-invoke probe succeeds for review-monitor verbs (`deft verify:review-monitor` / `deft review-monitor:register`, or `task deft:verify:review-monitor` / `task deft:review-monitor:register`), run that verify form before yielding, entering Approach 3, or claiming review monitoring started — CLI: `deft verify:review-monitor --pr <N> [--call-site solo]`; task: `task deft:verify:review-monitor -- --pr <N> [--call-site solo]`. After spawning Approach 1, claim the PR-anchored lease with the matching register form (CLI: `deft review-monitor:register --pr <N> --monitor-agent-id <id> --platform-primitive ...`; task: `task deft:review-monitor:register -- --pr <N> --monitor-agent-id <id> --platform-primitive start_agent|spawn_subagent|cursor-task|claude-agent|sessions_spawn|openclaw-sessions-spawn|grok-bot-executor`). Release with the matching release form (CLI: `deft review-monitor:release --pr <N>`; task: `task deft:review-monitor:release -- --pr <N>`) when done. Exit `0` ready / `1` not ready or held-by-other / `2` config. The sole source of truth is the sticky GitHub PR comment (`<!-- deft:review-owner -->`); legacy `.deft/review-monitor.json` is obsolete and ignored. On register conflict, attach to the existing owner or stop — do not parallel-fix.
|
|
586
586
|
|
|
587
587
|
! **Missing review-monitor surface carve-out (#2878 / #2893):** When dual-invoke probes fail for `pr:watch` **and** `review-monitor:*` (no `deft` CLI, no `task deft:` include), do **not** invoke those gates and do **not** block Approach 1 on them. Fail-loud once with `missing-task: review-monitor` / `missing-task: pr:watch`, then:
|
|
588
588
|
1. Still spawn Approach 1 with the official gh-only fallback when a sub-agent primitive exists.
|
|
@@ -603,6 +603,8 @@ Cross-links: swarm decision tree `skills/deft-directive-swarm/references/core-ph
|
|
|
603
603
|
|
|
604
604
|
! **Grok Build leaf boundary (#4130 / #2797 analogue):** Nested `spawn_subagent` (implementation leaf spawning a second-level review-monitor) is unsupported. Nested spawn does not report to the parent, and the parent cannot re-prompt a live child (`resume_from` requires terminal). A Grok Build `drive-to: merge-ready` leaf MUST keep ownership in the same agent by blocking on `deft pr:watch <N>` (or `task deft:pr:watch -- <N>` when include-present), then `pr:merge-ready` / merge in the same loop. To use Approach 1, the envelope MUST instead be `stop-at: pr-open` so the orchestrator can spawn and register a sibling review-monitor with `--platform-primitive spawn_subagent`. ⊗ Nested-spawn a review-monitor (or any other `spawn_subagent`) from a grok-build implementation leaf and exit claiming monitoring is active. If the leaf needs another agent, it stops and reports `BLOCKED`; the parent owns the next spawn. Top-level parents/orchestrators that own `spawn_subagent` MAY still Approach-1 background a review-monitor.
|
|
605
605
|
|
|
606
|
+
! **Grok Bot leaf boundary (#4201 / #4130 analogue):** Nested Task/executor/CloudAgent (implementation leaf spawning a second-level review-monitor) is unsupported. A Grok Bot `drive-to: merge-ready` leaf MUST keep ownership in the same agent by blocking on `deft pr:watch <N>` (or `task deft:pr:watch -- <N>` when include-present), then `pr:merge-ready` / merge in the same loop. To use Approach 1, the envelope MUST instead be `stop-at: pr-open` so the orchestrator can spawn and register a sibling review-monitor with `--platform-primitive grok-bot-executor`. ⊗ Nested-spawn a review-monitor from a grok-bot implementation leaf and exit claiming monitoring is active. If the leaf needs another agent, it stops and reports `BLOCKED`; the parent owns the next spawn. Top-level parents/orchestrators that own the executor primitive MAY still Approach-1 background a review-monitor.
|
|
607
|
+
|
|
606
608
|
**Approach 1 (preferred -- sub-agent orchestration available per platform descriptor):**
|
|
607
609
|
|
|
608
610
|
! **Who may spawn (MUST, #4130):** The spawn list below is for the agent that **owns** the primitive as parent/orchestrator. Grok Build, Cursor, and Claude Code **implementation leaves** follow their leaf-boundary bullets -- they do not execute this spawn list. A grok-build leaf that follows the `spawn_subagent` steps in this Approach 1 paragraph is the #4130 incident path.
|
|
@@ -613,9 +615,9 @@ Cross-links: swarm decision tree `skills/deft-directive-swarm/references/core-ph
|
|
|
613
615
|
|
|
614
616
|
~ **Visible Control UI (OpenClaw / #3044):** When OpenClaw Control UI is the operator control plane, SHOULD spawn the review-monitor with `visible:true` when the tool surface allows so humans can inspect progress without attaching to the parent session; invisible empty settles are higher FC04 residual risk.
|
|
615
617
|
|
|
616
|
-
! When the platform descriptor indicates Tier 1 (sub-agent support) **and this agent owns the primitive as parent/orchestrator**, spawn a review-monitor sub-agent using the primitive matching the descriptor. ⊗ A grok-build / Cursor / Claude Code implementation leaf MUST NOT run these spawn steps.
|
|
618
|
+
! When the platform descriptor indicates Tier 1 (sub-agent support) **and this agent owns the primitive as parent/orchestrator**, spawn a review-monitor sub-agent using the primitive matching the descriptor. ⊗ A grok-build / grok-bot / Cursor / Claude Code implementation leaf MUST NOT run these spawn steps.
|
|
617
619
|
|
|
618
|
-
1. ! Launch via the matching primitive: `start_agent` (Warp), `spawn_subagent` (grok-build / TUI / non-Warp **parent**), the Cursor `Task` tool with `run_in_background: true` (`cursor-composer` / `cursor-cloud-agent`, #1877), the Claude Code `Agent` tool with `run_in_background: true` (`claude-code` / register `claude-agent`, #3134),
|
|
620
|
+
1. ! Launch via the matching primitive: `start_agent` (Warp), `spawn_subagent` (grok-build / TUI / non-Warp **parent**), the Cursor `Task` tool with `run_in_background: true` (`cursor-composer` / `cursor-cloud-agent`, #1877), the Claude Code `Agent` tool with `run_in_background: true` (`claude-code` / register `claude-agent`, #3134), OpenClaw `sessions_spawn` (`openclaw`, #2876), **or Grok Bot Task/executor/CloudAgent (`grok-bot` / register `grok-bot-executor`, #4201)** with a prompt that instructs it to poll for Greptile completion. For `spawn_subagent`, Cursor `Task`, Claude Code `Agent`, OpenClaw `sessions_spawn`, and Grok Bot executor the prompt MUST reference the canonical poller template `templates/swarm-greptile-poller-prompt.md` (with placeholders filled) plus the agent preamble; the working directory / context must be the PR branch (worktree or equivalent for hybrid).
|
|
619
621
|
2. ! The sub-agent polls using the mechanism for its primitive: for `spawn_subagent` use `get_command_or_subagent_output` (adaptive cadence: ~20-30s first check after push, ~60s second, ~90s thereafter; Greptile typically lands in 3-7 min); for `start_agent` the native messaging path; for the Cursor `Task` tool the backgrounded-task completion-notification path; for Claude Code `Agent` the backgrounded-agent completion-notification path; for OpenClaw `sessions_spawn` the host session completion / messaging channel (prefer `task pr:watch` inside the child when available). Front-load the first check to catch fast reviews.
|
|
620
622
|
3. ! When the exit condition is met (Greptile review current on the HEAD commit SHA, confidence meets resolved min (policy/dogfood/default; see Step 6 #3095), no P0/P1 remaining), the sub-agent reports completion back to the parent (via `send_message_to_agent`, the spawn_subagent result channel, or the OpenClaw sessions completion channel).
|
|
621
623
|
4. ! The main conversation pane stays fully interactive during monitoring -- the user (or parent monitor) can continue other work.
|
|
@@ -924,6 +926,8 @@ task lifecycle:event -- emit plan:approved \
|
|
|
924
926
|
- ⊗ Treat OpenClaw `cron` alone as Approach 1 — cron/timer is Approach 2 only if spawn is unavailable (#2876)
|
|
925
927
|
- ⊗ Route Claude Code babysit/shepherd/watch to Approach 3 blocking poll when Claude `Agent` spawn is available — use Approach 1 with backgrounded `Agent` / `claude-agent` (#3134)
|
|
926
928
|
- ⊗ Misclassify Claude Code as `cursor-composer` from bare `Task` alone (#3134)
|
|
929
|
+
- ⊗ Misclassify Grok Bot as `grok-build` via bare `spawn_subagent` or as `cursor-composer` via bare `Task` (#4201)
|
|
930
|
+
- ⊗ Nested executor / CloudAgent spawn from a grok-bot implementation leaf (#4201)
|
|
927
931
|
- ⊗ Expand active story scope past xBRIEF AC mid-babysit without follow-up issue or consented brief amend (#2881)
|
|
928
932
|
- ⊗ Treat confidence-only holds (0 P0/P1) as a mandate for unbounded redesign (#2881)
|
|
929
933
|
- ⊗ Dual-stop / conf-residual terminal halt without #3273 resume line (leftover class + residual class + resolved floor + standing vs one-shot + pursue residual / until floor or loop + skill section pointer) (#3273 / #3448)
|
|
@@ -80,6 +80,7 @@ Large multi-host skills use a **host-neutral core** plus **one** per-host adapte
|
|
|
80
80
|
| `cursor-composer` / `cursor-cloud-agent` | Cursor `Task` | [`references/host-cursor.md`](references/host-cursor.md) |
|
|
81
81
|
| `claude-code` | Claude `Agent` (`run_in_background`) / `claude-agent` | [`references/host-claude-code.md`](references/host-claude-code.md) |
|
|
82
82
|
| `openclaw` | `sessions_spawn` | [`references/host-openclaw.md`](references/host-openclaw.md) |
|
|
83
|
+
| `grok-bot` | Task / executor / CloudAgent (`grok-bot-executor`) | [`references/host-grokbot.md`](references/host-grokbot.md) |
|
|
83
84
|
| `grok-build` | `spawn_subagent` | [`references/host-grok-build.md`](references/host-grok-build.md) |
|
|
84
85
|
| `generic-terminal` (or explicit cloud) | serial / paste / `oz agent run-cloud` | [`references/host-generic.md`](references/host-generic.md) |
|
|
85
86
|
|
|
@@ -170,14 +171,16 @@ Thin pointer: dual-invoke `pr:merge-ready` / `pr:watch`; spawn **one** residual
|
|
|
170
171
|
3. ! **Probe for the Cursor `Task` tool** — Tier 1; descriptor `cursor-composer` / `cursor-cloud-agent` (#1877). Require Cursor signals (`CURSOR_*` or Cursor-only Task surface) — not bare `Task` alone.
|
|
171
172
|
4. ! **Probe for Claude Code** — Tier 1; descriptor `claude-code` (#3134). Claude-unique signals only: `Agent` (or `CreateAgent` / `SubagentStart`) with background / `run_in_background`, and/or `DEFT_PROBE_CLAUDE_CODE` / `DEFT_AGENT_RUNTIME=claude-code` / `CLAUDECODE`. ⊗ Misclassify as `cursor-composer` via bare `Task`.
|
|
172
173
|
5. ! **Probe for the OpenClaw `sessions_spawn` tool** — Tier 1; descriptor `openclaw` (#2875). Do NOT misclassify as `grok-build` or `generic-terminal`.
|
|
173
|
-
6. ! **Probe for
|
|
174
|
-
7. ! **
|
|
175
|
-
8. ! **
|
|
176
|
-
9.
|
|
174
|
+
6. ! **Probe for Grok Bot** — Tier 1; descriptor `grok-bot` (#4201). Unique signals only: question widgets, Task/executor/CloudAgent, routines, short main-chat beats, and/or `DEFT_PROBE_GROK_BOT` / `DEFT_HAS_GROK_BOT_WIDGETS` / `DEFT_HAS_GROK_BOT_EXECUTOR` / `DEFT_AGENT_RUNTIME=grok-bot` / `GROK_BOT`. Probe **before** `spawn_subagent`. ⊗ Misclassify as `grok-build` via bare `spawn_subagent`. ⊗ Misclassify as `cursor-composer` via bare `Task`.
|
|
175
|
+
7. ! **Probe for `spawn_subagent` tool** — descriptor `grok-build`.
|
|
176
|
+
8. ! **Select launch path automatically** — load the matching host adapter (route table). No static A/B/C menu.
|
|
177
|
+
9. ! **Return a stable platform descriptor** for Phase 4/6: `warp-orchestrated`, `warp-manual`, `cursor-composer`, `cursor-cloud-agent`, `claude-code`, `openclaw`, `grok-bot`, `grok-build`, or `generic-terminal`.
|
|
178
|
+
10. ? **Cloud escape hatch** — `oz agent run-cloud` only on explicit user request (host-generic).
|
|
177
179
|
|
|
178
180
|
⊗ Present static launch options instead of detecting capabilities at runtime.
|
|
179
181
|
⊗ Offer Warp-specific launch paths when not inside Warp.
|
|
180
182
|
⊗ Classify Claude Code as `cursor-composer` / `generic-terminal` when Claude-unique signals are present (#3134).
|
|
183
|
+
⊗ Classify Grok Bot as `grok-build` via bare `spawn_subagent`, or as `cursor-composer` via bare `Task`, when Grok-Bot-unique signals are present (#4201).
|
|
181
184
|
|
|
182
185
|
## Retained addressable sub-agents (#3158)
|
|
183
186
|
|
|
@@ -230,6 +233,7 @@ Named mode **beside** dispatch-and-collect. Canon: [`../../swarm/swarm.md`](../.
|
|
|
230
233
|
- ⊗ Skip Phase 0 approval before Phase 1
|
|
231
234
|
- ⊗ Misclassify OpenClaw `sessions_spawn` as `grok-build` or `generic-terminal` (#2875)
|
|
232
235
|
- ⊗ Misclassify Claude Code as `cursor-composer` / `generic-terminal` (#3134)
|
|
236
|
+
- ⊗ Misclassify Grok Bot as `grok-build` via bare `spawn_subagent` or as `cursor-composer` via bare `Task` (#4201)
|
|
233
237
|
- ⊗ Run multi-iteration repair/monitor loops without a failure stop or with silent continuation after the envelope is exhausted (#2442)
|
|
234
238
|
- ⊗ Dual-stop/hard-stop halt without #3273 resume line (leftover class + resolved floor + standing vs one-shot), or unlimited residual auto-retry without new operator consent (#3273 / #3448)
|
|
235
239
|
- ⊗ Hard-code 5/5 as the continue-until target, or park a class A already-touched leftover as a new story (#3448 / #2881 / #3095)
|
|
@@ -147,6 +147,7 @@ CONSTRAINTS:
|
|
|
147
147
|
- ⊗ Present Cursor sandbox UID 0 or sandbox-root cwd ownership as host-root access — `sandbox_uid_remap` means the sandbox identity is remapped to the host user, not real root (#1557)
|
|
148
148
|
- ⊗ Fall through to the manual-terminal fallback (Step 2b) when spawn_subagent is available -- Step 2d is the first-class grok-build launch path; manual terminal is for environments with no orchestration primitive at all (#1331)
|
|
149
149
|
- ⊗ Misclassify OpenClaw `sessions_spawn` as `grok-build` / `spawn_subagent` or fall through to `generic-terminal` when `sessions_spawn` is present — Step 2f is the first-class OpenClaw path and descriptor `openclaw` is Tier 1 (#2875)
|
|
150
|
+
- ⊗ Misclassify Grok Bot as `grok-build` via bare `spawn_subagent` or as `cursor-composer` via bare `Task` when Grok-Bot-unique signals are present — Step 2h is the first-class Grok Bot path and descriptor `grok-bot` is Tier 1 (#4201)
|
|
150
151
|
- ⊗ Hardcode Cursor/Warp/grok-only launch, monitor, or Phase 6 post-PR dispatch branches when the platform descriptor is `openclaw` — use `sessions_spawn` and the openclaw completion channel (#2875)
|
|
151
152
|
- ⊗ Surface, propose, or discuss the Phase 5 -> 6 merge cascade gate while `task swarm:verify-review-clean -- <pr-numbers...>` has not yet exited 0 on the current cohort (#1364). Keying the transition on poller lifecycle completion alone -- i.e. treating "every poller sub-agent returned a terminal message" as sufficient to surface the merge gate -- is the recurrence pattern from the #1166 swarm execution where multiple pollers exited with `clean_gate_holdout=confidence` (confidence == 3) and the monitor still raised the Phase 5 -> 6 gate. The cohort verifier is the only authoritative CLEAN signal at the cohort level; a poller's `clean_gate_holdout=*` exit IS a non-CLEAN report and MUST hold the gate even when every sub-agent has technically returned
|
|
152
153
|
|
|
@@ -46,7 +46,7 @@ Cross-links: Phase 3 Worker-owns-lifecycle (`references/core-phase-3.md`), revie
|
|
|
46
46
|
### Headless cohort fast-path: low-ceremony launch (C1 / #1387)
|
|
47
47
|
|
|
48
48
|
! `task swarm:launch` claims this worktree occupancy lease (`intent: swarm`) before emitting the manifest (#3433). A live foreign occupant fails closed.
|
|
49
|
-
! **Spawned mutating workers take their own worktree (#4066).** Phase 2/3 must put each implement/review/fix leaf on a uniquely reserved linked worktree (C3 worktree-map or `git worktree add`) *before* occupancy claim. Sharing the primary checkout with a live occupant is refuse, not grant-across-host.
|
|
49
|
+
! **Spawned mutating workers take their own worktree (#4066 / #4215).** Phase 2/3 must put each implement/review/fix leaf on a uniquely reserved linked worktree (C3 worktree-map or `git worktree add`) *before* occupancy claim. Sharing the primary checkout with a live occupant is refuse, not grant-across-host. Grok `spawn_subagent` implement dest is `cwd` only. `isolation=worktree` / `worktree_path` stay on reroot hosts (Cursor Task, Claude subagent, Codex). Do not advertise `worktree_path` for Grok. Terminal release is dispatcher-owned (`phase: terminal` + incarnation); do not tell a refused Grok child to steal master.
|
|
50
50
|
! When the operator supplies a **pre-approved cohort** via the **C1** `task swarm:launch` CLI, Phase 0 runs in headless / low-ceremony mode: the per-phase interactive approval gates (the Step 0c promote-fill prompts, the Step 0.5 lifecycle-bridge approval, and the Step 4/5 allocation approval) collapse into a SINGLE consent -- the `## Allocation context` token (#1378) carried in the dispatch envelope. The interactive promote-fill loop (Step 0a -- 0d below) is SKIPPED.
|
|
51
51
|
! The **C1** signature is `task swarm:launch -- --stories <ids|paths> [--group <label>] [--worktree-map <path>] [--base-branch <branch>] [--autonomous]`. `--stories` names the pre-approved story ids or xBRIEF paths; `--group` is an optional cohort label; `--worktree-map` points at the pre-created **C3** worktree-map JSON consumed in Phase 2; `--base-branch` overrides the default `master`; `--autonomous` runs without the interactive launch confirmation.
|
|
52
52
|
! The SINGLE consent is the #1378 `## Allocation context` token with `dispatch_kind: swarm-cohort` and a NON-NULL `allocation_plan_id` AND `batching_rationale` (the recognition contract in `templates/agent-prompt-preamble.md` § 2.5). That token IS the batched approval for the whole cohort -- the deterministic-question gates the interactive path runs (per [`../../contracts/deterministic-questions.md`](../../contracts/deterministic-questions.md)) are bypassed wholesale on the headless path, not asked once per phase.
|
|
@@ -28,17 +28,19 @@
|
|
|
28
28
|
3. ! **Probe for the Cursor `Task` tool** — when neither `start_agent` nor `WARP_*` is present, check the tool set for the Cursor `Task` sub-agent tool (dispatchable in the background via `run_in_background: true`) **with Cursor signals** (`CURSOR_COMPOSER` / `CURSOR_AGENT` or Cursor-only Task surface). Its presence indicates a Cursor environment with a **first-class Tier-1 sub-agent primitive** (#1877). Classify as `cursor-composer` for an interactive Composer session and `cursor-cloud-agent` for a Cursor cloud agent. Cursor is **Tier 1 → Approach 1** — do NOT let it fall through to `generic-terminal` / the Approach-3 blocking poll. ⊗ Classify from bare `Task` alone when Claude Code also exposes a similarly named tool (#3134).
|
|
29
29
|
4. ! **Probe for Claude Code** — when none of `start_agent`, `WARP_*`, or Cursor-classified `Task` is present, check for **Claude-unique** signals: the Claude Code `Agent` tool (or host-equivalent `CreateAgent` / `SubagentStart`) with background / `run_in_background: true`, and/or env `DEFT_PROBE_CLAUDE_CODE` / `DEFT_HAS_CLAUDE_AGENT` / `DEFT_AGENT_RUNTIME=claude-code` / `CLAUDECODE`. Classify as descriptor `claude-code`. Claude Code is **Tier 1 → Approach 1** (#3134) — do NOT misclassify as `cursor-composer` (bare `Task`) or fall through to `generic-terminal`. Engine env probe: `packages/core/src/review-monitor/tier-detection.ts` `probeMonitoringTier` (ordered after Cursor, before OpenClaw).
|
|
30
30
|
5. ! **Probe for the OpenClaw `sessions_spawn` tool** — when none of `start_agent`, `WARP_*`, Cursor, or Claude Code is present, check the tool set for OpenClaw `sessions_spawn` (optional `visible` flag). Its presence indicates an OpenClaw environment with a **first-class Tier-1 sub-agent primitive** (#2875). Classify as descriptor `openclaw`. OpenClaw is **Tier 1 → Approach 1** — do NOT misclassify it as `grok-build` (that uses `spawn_subagent`) or fall through to `generic-terminal`.
|
|
31
|
-
6. ! **Probe for
|
|
32
|
-
7. ! **
|
|
31
|
+
6. ! **Probe for Grok Bot** — when none of `start_agent`, `WARP_*`, Cursor, Claude Code, or OpenClaw is present, check for **Grok-Bot-unique** signals: question widgets, Task/executor/CloudAgent, routines, short main-chat beats, and/or env `DEFT_PROBE_GROK_BOT` / `DEFT_HAS_GROK_BOT_WIDGETS` / `DEFT_HAS_GROK_BOT_EXECUTOR` / `DEFT_AGENT_RUNTIME=grok-bot` / `GROK_BOT`. Classify as descriptor `grok-bot`. Grok Bot is **Tier 1 → Approach 1** (#4201) — do NOT misclassify as `grok-build` via bare `spawn_subagent` or as `cursor-composer` via bare `Task`. Probe **before** `spawn_subagent`. Engine env probe: `packages/core/src/review-monitor/tier-detection.ts` `probeMonitoringTier` (ordered after OpenClaw, before grok-build).
|
|
32
|
+
7. ! **Probe for `spawn_subagent` tool** — when none of `start_agent`, `WARP_*`, Cursor, Claude Code, OpenClaw `sessions_spawn`, or Grok Bot unique signals is present, check for `spawn_subagent` (Grok Build / non-Warp TUI launch adapter, #1342 slice 2). Its presence indicates the grok-build platform.
|
|
33
|
+
8. ! **Select launch path automatically** based on detection results — do NOT present static options:
|
|
33
34
|
- **`start_agent` available** → Orchestrated launch (Step 2a) — preferred path, fully automated, no manual tab management
|
|
34
35
|
- **`start_agent` unavailable, Warp detected** → Interactive Warp tabs (Step 2b) — full MCP, global rules, warm index; requires manual tab management
|
|
35
36
|
- **Cursor `Task` tool available (no `start_agent`, no `WARP_*`)** → Cursor sub-agent launch (Step 2e) via the `Task` tool with `run_in_background: true` (Tier 1 / Approach 1) — keeps the monitor pane interactive; descriptor is `cursor-composer` (interactive) or `cursor-cloud-agent` (cloud)
|
|
36
37
|
- **Claude Code available (no `start_agent`, no `WARP_*`, no Cursor classification)** → Claude Code launch (Step 2g) via `Agent` with `run_in_background: true` (Tier 1 / Approach 1) — descriptor is `claude-code` (#3134)
|
|
37
38
|
- **OpenClaw `sessions_spawn` available (no `start_agent`, no `WARP_*`, no Cursor, no Claude Code)** → OpenClaw launch (Step 2f) via `sessions_spawn` (Tier 1 / Approach 1) — descriptor is `openclaw`
|
|
39
|
+
- **Grok Bot unique signals available (no earlier Tier-1 primitive)** → Grok Bot launch (Step 2h) via Task/executor/CloudAgent (Tier 1 / Approach 1) — descriptor is `grok-bot` (#4201)
|
|
38
40
|
- **`grok-build` (`spawn_subagent` available, no earlier Tier-1 primitive)** → Grok Build launch (Step 2d) — first-class non-Warp path
|
|
39
41
|
- **No orchestration primitive detected** → `generic-terminal` degraded launch. Offer a **Serial self-execution downgrade** first: with explicit operator consent, the monitor may execute the prepared worker prompts itself one story at a time from the isolated worktrees. This preserves forward progress but is not true concurrent swarm execution.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
9. ! **Return a stable platform descriptor** for downstream phases — one of `warp-orchestrated` (start_agent available), `warp-manual` (Warp without start_agent), `cursor-composer` (Cursor `Task` tool, interactive Composer), `cursor-cloud-agent` (Cursor `Task` tool, cloud agent), `claude-code` (Claude Code `Agent` / Claude-unique env, #3134), `openclaw` (`sessions_spawn` available, non-Warp, non-Cursor, non-Claude), `grok-bot` (Grok-Bot-unique signals, #4201), `grok-build` (spawn_subagent available after earlier primitives absent), or `generic-terminal` (no orchestration primitives). The detection matrix MUST include explicit absence checks for `start_agent`, `WARP_*`, Cursor, Claude Code, OpenClaw `sessions_spawn`, and Grok Bot unique signals so the descriptors are unambiguous. Phase 4 monitoring and Phase 6 sub-agent dispatch read this stable platform descriptor as a single source of truth instead of re-running detection per call.
|
|
43
|
+
10. ? **Cloud escape hatch** — use `oz agent run-cloud` (Step 2c) ONLY if the user explicitly requests cloud execution. Never default to cloud. (The Cursor `cursor-cloud-agent` descriptor above is distinct — it is a Cursor-native cloud agent detected via the `Task` tool, not the `oz` escape hatch.)
|
|
42
44
|
|
|
43
45
|
! In `generic-terminal` mode, if the operator declines serial self-execution, the manual terminal prompt-paste fallback remains available: the user can paste each generated prompt into any terminal or agent interface with access to the matching worktree. Surface the tradeoff clearly: manual paste preserves user control but requires tab/process management and is still not automated orchestration.
|
|
44
46
|
|
|
@@ -168,6 +170,7 @@ Cross-references: `packages/core/src/swarm/routing.ts` (`SWARM_WORKER_ROLES`), `
|
|
|
168
170
|
- Cursor → `references/host-cursor.md`
|
|
169
171
|
- Claude Code → `references/host-claude-code.md`
|
|
170
172
|
- OpenClaw → `references/host-openclaw.md`
|
|
173
|
+
- Grok Bot → `references/host-grokbot.md`
|
|
171
174
|
- Grok Build → `references/host-grok-build.md`
|
|
172
175
|
- generic-terminal / cloud escape → `references/host-generic.md`
|
|
173
176
|
|
|
@@ -21,8 +21,9 @@ Probe order (must match engine `probeMonitoringTier` / `resolveDispatchProvider`
|
|
|
21
21
|
3. Cursor `Task` **with Cursor signals** (`CURSOR_COMPOSER` / `CURSOR_AGENT` or Cursor-only Task surface) → `cursor-composer` / `cursor-cloud-agent`
|
|
22
22
|
4. **Claude Code** (this descriptor) — see unique signals below → `claude-code`
|
|
23
23
|
5. OpenClaw `sessions_spawn` → `openclaw`
|
|
24
|
-
6.
|
|
25
|
-
7.
|
|
24
|
+
6. Grok Bot unique signals → `grok-bot`
|
|
25
|
+
7. `spawn_subagent` → `grok-build`
|
|
26
|
+
8. else → `generic-terminal` (Tier 3)
|
|
26
27
|
|
|
27
28
|
### Claude-unique signals (any one is sufficient when earlier probes are absent)
|
|
28
29
|
|
|
@@ -23,11 +23,13 @@ This path became first-class in #1342 (platform adapter slices 1-3) and is fully
|
|
|
23
23
|
|
|
24
24
|
### Step 2d: Grok Build Launch (spawn_subagent available)
|
|
25
25
|
|
|
26
|
-
! When the platform descriptor is `grok-build` (spawn_subagent detected, no start_agent, no WARP_*, no Cursor `Task`, no OpenClaw `sessions_spawn
|
|
26
|
+
! When the platform descriptor is `grok-build` (spawn_subagent detected, no start_agent, no WARP_*, no Cursor `Task`, no OpenClaw `sessions_spawn`, no Grok Bot unique signals), dispatch each worker via `spawn_subagent` with:
|
|
27
27
|
0. Create `<worktree>/.deft-scratch/subagent-status/` before spawn if launch/pre-dispatch did not already, and instruct the worker to heartbeat + commit early (#3730).
|
|
28
28
|
1. The canonical `templates/agent-prompt-preamble.md` content as the preamble
|
|
29
29
|
2. The standard worktree prompt (STEP 1-6 from the Prompt Template below), adapted to use `get_command_or_subagent_output` for polling rather than `start_agent` lifecycle events
|
|
30
|
-
3.
|
|
30
|
+
3. `tool_input.cwd` set to the agent's reserved linked worktree. Grok implement dest is `cwd` only. Do not pass `worktree_path`, `worktreePath`, `worktree`, or `isolation=worktree`.
|
|
31
|
+
|
|
32
|
+
! **Parent ritual HEAD-discontinuous / dest occupancy deny class (#4215).** Native `spawn_subagent` with `cwd` to a dest-proven reserved linked worktree must not require a live parent primary ritual. Occupancy-refused on the contended primary is why `session:start --rearm` on master is the wrong recovery, not a spawn skip. If native spawn is denied, record that deny text in the handback. CLI `grok --cwd` is last-resort after that deny, not a habit after the first failure. Do not dual-launch CLI and `spawn_subagent` on the same unit. Do not document CLI as the real Grok Build launch path.
|
|
31
33
|
|
|
32
34
|
~ This is the first-class non-Warp path. Workers use worktree state polling (`git status`, `git log`) and `get_command_or_subagent_output` as their coordination channel instead of Warp tab state.
|
|
33
35
|
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Host adapter: Grok Bot
|
|
2
|
+
|
|
3
|
+
Legend (RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
4
|
+
|
|
5
|
+
Descriptor: `grok-bot`. Grok Bot is **not** Grok Build. Register primitive: `grok-bot-executor` (`task review-monitor:register -- --platform-primitive grok-bot-executor`).
|
|
6
|
+
|
|
7
|
+
Load this file only after detect selects Grok Bot. Do not load other host adapters (#2928).
|
|
8
|
+
|
|
9
|
+
## Detection spike (ordered matrix placement) — #4201
|
|
10
|
+
|
|
11
|
+
! Grok Bot MUST be classified with **Grok-Bot-unique** signals. Probe those signals **before** probe 7 (`spawn_subagent` → `grok-build`). Same class as Claude-before-Task (#3134) and OpenClaw-before-grok-build (#2875).
|
|
12
|
+
|
|
13
|
+
⊗ Classify Grok Bot from bare `spawn_subagent` alone — that misclassifies as `grok-build`.
|
|
14
|
+
⊗ Classify Grok Bot from bare `Task` alone — that misclassifies as `cursor-composer`.
|
|
15
|
+
|
|
16
|
+
### Skill-side ordered probe (tool set + env)
|
|
17
|
+
|
|
18
|
+
Probe order (must match engine `probeMonitoringTier` / `resolveDispatchProvider`):
|
|
19
|
+
|
|
20
|
+
1. `start_agent` → `warp-orchestrated`
|
|
21
|
+
2. `WARP_*` → `warp-manual`
|
|
22
|
+
3. Cursor `Task` **with Cursor signals** (`CURSOR_COMPOSER` / `CURSOR_AGENT` or Cursor-only Task surface) → `cursor-composer` / `cursor-cloud-agent`
|
|
23
|
+
4. Claude Code (Claude-unique signals) → `claude-code`
|
|
24
|
+
5. OpenClaw `sessions_spawn` → `openclaw`
|
|
25
|
+
6. **Grok Bot** (this descriptor) — unique signals below → `grok-bot`
|
|
26
|
+
7. `spawn_subagent` → `grok-build`
|
|
27
|
+
8. else → `generic-terminal` (Tier 3)
|
|
28
|
+
|
|
29
|
+
### Grok-Bot-unique signals (any one is sufficient when earlier probes are absent)
|
|
30
|
+
|
|
31
|
+
| Signal | Notes |
|
|
32
|
+
|--------|--------|
|
|
33
|
+
| Question widgets | Operator-gate UI (`ask_user_question` / host widgets). Phase 0 / mid-scope / dual-stop map here. |
|
|
34
|
+
| Task / executor / CloudAgent | Worker spawn surface — **not** Cursor `Task` (requires `CURSOR_*`) and **not** Grok Build `spawn_subagent` |
|
|
35
|
+
| Routines | Grok Bot scheduled / routine surface |
|
|
36
|
+
| Short main-chat beats | Parent consolidate on the main chat (not a subagent pane) |
|
|
37
|
+
| `DEFT_PROBE_GROK_BOT` / `DEFT_HAS_GROK_BOT_WIDGETS` / `DEFT_HAS_GROK_BOT_EXECUTOR` | Explicit framework probe / override |
|
|
38
|
+
| `DEFT_AGENT_RUNTIME=grok-bot` (or `grokbot`) | Explicit runtime stamp |
|
|
39
|
+
| `GROK_BOT` | Host stamp |
|
|
40
|
+
|
|
41
|
+
! When both Cursor and Grok Bot signals could appear, **Cursor probes win** (earlier in the chain).
|
|
42
|
+
! When both OpenClaw and Grok Bot signals could appear, **OpenClaw probes win** (earlier in the chain).
|
|
43
|
+
! When Grok Bot unique signals are present **and** `spawn_subagent` is also present, **Grok Bot wins**. That is the misclassification this adapter exists to close.
|
|
44
|
+
|
|
45
|
+
! Engine env probe is env-centric (same pattern as Claude `CLAUDECODE` / Cursor `CURSOR_*`); skill prose names the tool fingerprint for agents that can see the tool set.
|
|
46
|
+
|
|
47
|
+
## Operator gates — widgets keep Discuss and Back (#1470 / #1563)
|
|
48
|
+
|
|
49
|
+
! Phase 0 / mid-scope / dual-stop operator gates on this host MUST use question widgets (or a numbered chat menu) that **visibly preserve** canonical numbered options, with the final two labels `Discuss` and `Back` in that order.
|
|
50
|
+
|
|
51
|
+
! Widget labels MUST include the canonical number (for example `1. Accept`). Agents accept fallback chat replies only when they match the displayed number or the exact displayed option text.
|
|
52
|
+
|
|
53
|
+
⊗ Drop `Discuss` / `Back` because the host widget UI has an `Other` affordance or alphabetic shortcuts — those do not satisfy [`../../../contracts/deterministic-questions.md`](../../../contracts/deterministic-questions.md) Host-UI portability (#1563).
|
|
54
|
+
|
|
55
|
+
## Consumer facade — three verbs (Phases 0–6 stay internal)
|
|
56
|
+
|
|
57
|
+
Expose **propose / launch / status**. Keep swarm Phases 0–6 as lazy-loaded depth. Do not load all host adapters just in case (#2928).
|
|
58
|
+
|
|
59
|
+
| Verb | Operator meaning | Depth (load on demand) |
|
|
60
|
+
|------|------------------|------------------------|
|
|
61
|
+
| **propose** | Name the cohort (stories / xBRIEFs), file-overlap, worktree plan. Does not spawn. | [`core-phase-0.md`](core-phase-0.md) then [`core-phase-1-2.md`](core-phase-1-2.md) |
|
|
62
|
+
| **launch** | Emit the C2 launch-manifest (`task swarm:launch`) then spawn via this adapter. Worktree isolation MUST before parallel spawn. | [`core-phase-3.md`](core-phase-3.md) + this file |
|
|
63
|
+
| **status** | Heartbeats, worktree git, PR/review state. Parent consolidate as **short main-chat beats**. | [`core-phase-4.md`](core-phase-4.md) |
|
|
64
|
+
|
|
65
|
+
! Human decision: one clear ask, then stop. Do not auto-dispatch arcs without operator consent (#3578 / #1702).
|
|
66
|
+
|
|
67
|
+
## Thin skill pack (Grok Bot consumers)
|
|
68
|
+
|
|
69
|
+
Discovery set — **thin routers only**. Each item points at the existing Directive skill. ⊗ Put normative contract bodies in these routers.
|
|
70
|
+
|
|
71
|
+
| Router | Points at |
|
|
72
|
+
|--------|-----------|
|
|
73
|
+
| setup | `skills/deft-directive-setup/SKILL.md` |
|
|
74
|
+
| xbrief | `skills/deft-directive-xbrief/SKILL.md` |
|
|
75
|
+
| triage | `skills/deft-directive-triage/SKILL.md` (work selection: `plan-sequence:current` then `triage:queue`) |
|
|
76
|
+
| swarm (facade) | this adapter + `skills/deft-directive-swarm/SKILL.md` (propose / launch / status above) |
|
|
77
|
+
| build | `skills/deft-directive-build/SKILL.md` |
|
|
78
|
+
| **arc** | Companion **#4202** — do not implement the design-critique thin arc router here |
|
|
79
|
+
|
|
80
|
+
## Doctor / cold-start (one happy path)
|
|
81
|
+
|
|
82
|
+
! One narratable path: `npx @deftai/directive doctor` → follow its one `Next command:` → optional agent-driven setup (`skills/deft-directive-setup/SKILL.md`).
|
|
83
|
+
|
|
84
|
+
! Hide package-manager and offline forks behind doctor. Do not invent a second Grok Bot install ladder. Category: Grok Bot is a **coding host**; Directive remains the repo practice layer (`docs/CATEGORY.md`).
|
|
85
|
+
|
|
86
|
+
## GitHub connector preference
|
|
87
|
+
|
|
88
|
+
! Prefer GitHub MCP / connector tools when the host exposes them. Fall back to `gh` / `ghx` (REST) when the connector is absent.
|
|
89
|
+
|
|
90
|
+
⊗ Invent a Grok-Bot-only GitHub client. The SCM contract stays `content/scm/github.md`.
|
|
91
|
+
|
|
92
|
+
## Launch — Step 2h
|
|
93
|
+
|
|
94
|
+
### Step 2h: Grok Bot Launch (unique signals detected) — #4201
|
|
95
|
+
|
|
96
|
+
! When the platform descriptor is `grok-bot` (Grok-Bot-unique signals detected; no `start_agent`, no `WARP_*`, no Cursor classification, no Claude Code, no OpenClaw `sessions_spawn`), dispatch each **leaf worker** via Task / executor / CloudAgent with:
|
|
97
|
+
|
|
98
|
+
1. The canonical `templates/agent-prompt-preamble.md` content as the preamble.
|
|
99
|
+
2. The standard worktree prompt (STEP 1–6 from the Prompt Template in `references/core-ops.md`).
|
|
100
|
+
3. The worktree path set to the agent's isolated git worktree.
|
|
101
|
+
4. ! **Worktree isolation MUST before parallel spawn** (Phase 2 / #4066). Fail loud if a parallel cohort would share the repo root.
|
|
102
|
+
5. ! **Background / non-blocking spawn** for any worker or poller whose loop runs longer than a short task (~3 min) so the parent main-chat stays interactive (#1880 Gap D).
|
|
103
|
+
6. ! **Deliberate model routing (#1739):** resolve `(dispatch_provider=grok-bot, worker_role)` via `task verify:routing` / `task swarm:routing-set`. Grok Bot is harness-bound — record `--harness-default`; `resolved_model` stays null.
|
|
104
|
+
|
|
105
|
+
! Parent consolidate → **short main-chat beats** (not a second worker pane dump). Human decision → one clear ask then stop.
|
|
106
|
+
|
|
107
|
+
~ This is the first-class Grok Bot path. It is **Tier 1 → Approach 1**. It MUST NOT be misclassified as `grok-build` via bare `spawn_subagent` or as `cursor-composer` via bare `Task`.
|
|
108
|
+
|
|
109
|
+
! Long pollers MUST honour the sub-agent heartbeat contract (`docs/subagent-heartbeat.md`, #1166).
|
|
110
|
+
|
|
111
|
+
## Nested executor boundary
|
|
112
|
+
|
|
113
|
+
! Nested Task / executor / CloudAgent (implementation leaf spawning leaf) is unsupported for an Approach 1 review-monitor. A Grok Bot **implementation leaf** MUST NOT nested-spawn a second-level review-monitor. Prefer either:
|
|
114
|
+
|
|
115
|
+
- (a) a `drive-to: merge-ready` leaf that owns a blocking dual-invoke `pr:watch` (`deft pr:watch` then `task deft:pr:watch`) in its own process, or
|
|
116
|
+
- (b) `stop-at: pr-open` with the dispatcher (parent that owns the executor primitive) launching a sibling monitor and registering it via dual-invoke `review-monitor:register -- --platform-primitive grok-bot-executor`.
|
|
117
|
+
|
|
118
|
+
! Top-level parents/orchestrators that own the executor primitive MAY Approach-1 background a review-monitor.
|
|
119
|
+
|
|
120
|
+
⊗ An implementation leaf backgrounds a nested executor poller and exits claiming monitoring is active.
|
|
121
|
+
|
|
122
|
+
If the leaf needs another agent, it stops and reports `BLOCKED`. The parent owns the next spawn.
|
|
123
|
+
|
|
124
|
+
## Babysit / review-monitor
|
|
125
|
+
|
|
126
|
+
! Babysit / PR shepherd on Grok Bot is **Approach 1** via executor / CloudAgent (`skills/deft-directive-review-cycle/SKILL.md`). Register with `--platform-primitive grok-bot-executor`.
|
|
127
|
+
|
|
128
|
+
! Long review-monitor ownership (>~3 min) MUST NOT block the parent main chat — background executor + parent yield (#1880 Gap D); heartbeats per #1166.
|
|
129
|
+
|
|
130
|
+
⊗ Fall through to Approach 3 blocking `sleep` poll when Grok Bot executor spawn is available.
|
|
131
|
+
⊗ Misclassify Grok Bot as `grok-build` because `spawn_subagent` is also on the tool list (#4201).
|
|
132
|
+
⊗ Misclassify Grok Bot as `cursor-composer` because a Task-like tool exists without Cursor signals (#4201).
|
|
133
|
+
|
|
134
|
+
## Monitor / completion channel
|
|
135
|
+
|
|
136
|
+
! Completion is host completion / parent main-chat announce for the Grok Bot executor path. Do not poll via Grok Build `get_command_or_subagent_output` unless that primitive is actually present under descriptor `grok-build`.
|
|
137
|
+
|
|
138
|
+
! Long pollers MUST honour on-disk heartbeats (`docs/subagent-heartbeat.md`, #1166).
|
|
139
|
+
|
|
140
|
+
! Pre-spawn verification and Duplicate-Agent rules in `references/core-phase-4.md` apply.
|
|
141
|
+
|
|
142
|
+
## Retained / continue-by-id (#3158)
|
|
143
|
+
|
|
144
|
+
! **Default one-shot after executor completion:** Grok Bot executor leaves that exit are typically terminal — prefer **split-dispatch** for mid-scope user-approval gates (#954) unless the host documents continue/resume of the same agent id.
|
|
145
|
+
? When the host supports re-attach or re-prompt of a still-live executor with context intact, treat as **retain-capable** for message-later / steer-mid-flight.
|
|
146
|
+
! Nested-executor boundary above still forbids implementation leaves from retaining a second-level review-monitor.
|
|
147
|
+
~ Stance: orchestration only (#3164). Grok Bot stays the coding host / CoS cockpit. Directive does not own Slack/calendar/bot roster orchestration.
|
|
148
|
+
|
|
149
|
+
## Phase handoff (see also core #2934)
|
|
150
|
+
|
|
151
|
+
! After coding cohort complete, same-turn next-phase tool dispatch or explicit terminal status — see `references/core-phase-5-6.md` and the thin SKILL MUST block. ⊗ End the turn with only narrative “I will spawn…”.
|
package/tasks/docs.yml
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
version: '3'
|
|
2
2
|
|
|
3
|
+
vars:
|
|
4
|
+
DEFT_ROOT: '{{joinPath .TASKFILE_DIR ".."}}'
|
|
5
|
+
|
|
3
6
|
# Maintainer documentation tasks.
|
|
4
7
|
#
|
|
5
8
|
# docs:rule-map renders the Rule Map: a maintainer-facing view of how the
|
|
@@ -35,3 +38,19 @@ tasks:
|
|
|
35
38
|
- task: :engine:invoke
|
|
36
39
|
vars:
|
|
37
40
|
ENGINE_CMD: 'rule-map --project-root "{{.USER_WORKING_DIR}}" --check'
|
|
41
|
+
|
|
42
|
+
capability-map:
|
|
43
|
+
desc: "Generate content/docs/capabilities.md from the capability overlay (#4099)"
|
|
44
|
+
dir: '{{.USER_WORKING_DIR}}'
|
|
45
|
+
deps:
|
|
46
|
+
- task: :engine:_ts-build
|
|
47
|
+
cmds:
|
|
48
|
+
- node "{{.DEFT_ROOT}}/packages/core/dist/docs/capability-map.js" --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}
|
|
49
|
+
|
|
50
|
+
capability-map:check:
|
|
51
|
+
desc: "Fail if committed content/docs/capabilities.md is stale or the overlay disagrees with registries (#4099)"
|
|
52
|
+
dir: '{{.USER_WORKING_DIR}}'
|
|
53
|
+
deps:
|
|
54
|
+
- task: :engine:_ts-build
|
|
55
|
+
cmds:
|
|
56
|
+
- node "{{.DEFT_ROOT}}/packages/core/dist/docs/capability-map.js" --project-root "{{.USER_WORKING_DIR}}" --check
|
package/tasks/migrate.yml
CHANGED
|
@@ -23,7 +23,9 @@ tasks:
|
|
|
23
23
|
ENGINE_CMD: 'migrate-preflight --project-root "{{.USER_WORKING_DIR}}" --deft-root "{{.DEFT_ROOT}}" {{.CLI_ARGS}}'
|
|
24
24
|
|
|
25
25
|
xbrief:
|
|
26
|
-
|
|
26
|
+
# Hop 2 on current npm (#4092). Hop 1 (`migrate:vbrief`) is frozen on the
|
|
27
|
+
# v0.59.0 tag only — current deposits must not ship that target.
|
|
28
|
+
desc: "Migrate consumer vbrief/ layout to xbrief/ with semantic v0.6->v0.8 transforms (#2110 / #2034). Hop 2 of the frozen two-hop path (#4092)."
|
|
27
29
|
dir: '{{.USER_WORKING_DIR}}'
|
|
28
30
|
deps:
|
|
29
31
|
- task: :engine:_ts-build
|
package/tasks/scm.yml
CHANGED
|
@@ -14,6 +14,7 @@ version: '3'
|
|
|
14
14
|
# - scm:issue:close (thin wrapper over `ghx|gh issue close`)
|
|
15
15
|
# - scm:issue:edit (thin wrapper over `ghx|gh issue edit`)
|
|
16
16
|
# - scm:issue:design-critique-chip (#3642 closed catalog remaining-set)
|
|
17
|
+
# - scm:issue:work-claim (#4200 same-issue busy flag)
|
|
17
18
|
# - scm:body:* (#1555 safe Markdown body posting via github-body TS CLI)
|
|
18
19
|
#
|
|
19
20
|
# Each command is a thin pass-through to `ghx <verb>` (when ghx is on PATH)
|
|
@@ -92,7 +93,7 @@ tasks:
|
|
|
92
93
|
ENGINE_CMD: 'scm issue edit {{.CLI_ARGS}}'
|
|
93
94
|
|
|
94
95
|
issue:design-critique-chip:
|
|
95
|
-
desc: "[#3642] Exclusive design-critique catalog chip -- task scm:issue:design-critique-chip -- --issue N --chip triage-ready|mechanism-shaped [--repo OWNER/NAME]"
|
|
96
|
+
desc: "[#3642] Exclusive design-critique catalog chip -- task scm:issue:design-critique-chip -- --issue N --chip triage-ready|mechanism-shaped|recut-needed [--repo OWNER/NAME]"
|
|
96
97
|
dir: '{{.USER_WORKING_DIR}}'
|
|
97
98
|
deps:
|
|
98
99
|
- task: :engine:_ts-build
|
|
@@ -101,6 +102,16 @@ tasks:
|
|
|
101
102
|
vars:
|
|
102
103
|
ENGINE_CMD: 'scm issue design-critique-chip {{.CLI_ARGS}}'
|
|
103
104
|
|
|
105
|
+
issue:work-claim:
|
|
106
|
+
desc: "[#4200] Same-issue busy flag -- task scm:issue:work-claim -- claim|show|release --issue N [--repo OWNER/NAME] [--json]"
|
|
107
|
+
dir: '{{.USER_WORKING_DIR}}'
|
|
108
|
+
deps:
|
|
109
|
+
- task: :engine:_ts-build
|
|
110
|
+
cmds:
|
|
111
|
+
- task: :engine:invoke
|
|
112
|
+
vars:
|
|
113
|
+
ENGINE_CMD: 'scm issue work-claim {{.CLI_ARGS}}'
|
|
114
|
+
|
|
104
115
|
body:issue:create:
|
|
105
116
|
desc: "[#1555] Safely create an issue body from --body-file without shell Markdown interpolation"
|
|
106
117
|
dir: '{{.USER_WORKING_DIR}}'
|
package/tasks/verify.yml
CHANGED
|
@@ -107,6 +107,14 @@ tasks:
|
|
|
107
107
|
vars:
|
|
108
108
|
ENGINE_CMD: 'verify-closing-keywords {{.CLI_ARGS}}'
|
|
109
109
|
|
|
110
|
+
docs-impact:
|
|
111
|
+
desc: "Declared-versus-touched documentation-impact check (#4099). --pr uses REST; --body-file for local. Fork PRs stay read-only."
|
|
112
|
+
deps:
|
|
113
|
+
- task: :engine:_ts-build
|
|
114
|
+
dir: '{{.USER_WORKING_DIR}}'
|
|
115
|
+
cmds:
|
|
116
|
+
- node "{{.DEFT_ROOT}}/packages/core/dist/docs/docs-impact.js" --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}
|
|
117
|
+
|
|
110
118
|
license-sync:
|
|
111
119
|
desc: "Drift guard for root LICENSE ↔ content/LICENSE.md and published package.json license fields (#2902). Three-state exit (0 clean / 1 drift / 2 config). Framework-source only."
|
|
112
120
|
# Framework-source-only gate: reads THIS repo's LICENSE + package manifests.
|
|
@@ -382,6 +390,14 @@ tasks:
|
|
|
382
390
|
vars:
|
|
383
391
|
ENGINE_CMD: 'verify:spec-prd-fresh --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
|
|
384
392
|
|
|
393
|
+
rule-map-fresh:
|
|
394
|
+
desc: "Fail-closed docs/RULE-MAP.md renderer freshness (#4095). Alias for docs:rule-map:check. Asserts byte-identical renderer output, filled grouping purposes, pack entries from named arrays, and Taskfile declaration counts. Not a consumer gate."
|
|
395
|
+
dir: '{{.USER_WORKING_DIR}}'
|
|
396
|
+
deps:
|
|
397
|
+
- task: :engine:_ts-build
|
|
398
|
+
cmds:
|
|
399
|
+
- task: :docs:rule-map:check
|
|
400
|
+
|
|
385
401
|
session-ritual:
|
|
386
402
|
desc: "Fail-closed session ritual verifier (#1348). Flags: --tier quick|gated / --json. Set DEFT_SESSION_RITUAL_SKIP=1 for headless workers and CI."
|
|
387
403
|
dir: '{{.USER_WORKING_DIR}}'
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
- `vbrief/pending/YYYY-MM-DD-slug.vbrief.json`
|
|
14
14
|
-->
|
|
15
15
|
|
|
16
|
+
## Documentation impact
|
|
17
|
+
|
|
18
|
+
<!-- Closed enum. Rationale is quoted data and is never a gate input.
|
|
19
|
+
change_class: add | change | withdraw | none
|
|
20
|
+
surfaces: none OR comma-separated command:<id> | skill-trigger:<id> | help:<id> | docs-site:<page>
|
|
21
|
+
`no user-doc impact` is refused when a registered command, skill, help key,
|
|
22
|
+
or public docs-site page is added or removed. Same-PR rule: coding/docs.md (#447). -->
|
|
23
|
+
|
|
24
|
+
change_class: none
|
|
25
|
+
surfaces: none
|
|
26
|
+
rationale: "Replace this quoted sentence with the actual documentation-impact rationale."
|
|
27
|
+
|
|
16
28
|
## Checklist
|
|
17
29
|
|
|
18
30
|
- [ ] `task check` passes locally (validate + lint + test; see `coding/testing.md`)
|
|
@@ -73,13 +73,13 @@ When the operator supplies an ordered plan (delivery sequence, cohort, checklist
|
|
|
73
73
|
|
|
74
74
|
## 2.6 Provider-neutral worker metadata (#1531)
|
|
75
75
|
|
|
76
|
-
Heterogeneous swarm dispatch (#1531) assigns each worker a **dispatch provider** (the runtime primitive that launched the agent), a **worker role** (what the agent is allowed to do), and a **selected backend** or **routing policy** (how the harness maps that role to a concrete agent). These fields are provider-neutral: Composer-class coding agents, Grok Build (`spawn_subagent`), Cursor/cloud agents, Claude Code (`claude-code` / `claude-agent`, #3134), OpenClaw (`sessions_spawn`, #2874 / #2879), and future adapters share the same contract.
|
|
76
|
+
Heterogeneous swarm dispatch (#1531) assigns each worker a **dispatch provider** (the runtime primitive that launched the agent), a **worker role** (what the agent is allowed to do), and a **selected backend** or **routing policy** (how the harness maps that role to a concrete agent). These fields are provider-neutral: Composer-class coding agents, Grok Build (`spawn_subagent`), Grok Bot (`grok-bot` / `grok-bot-executor`, #4201), Cursor/cloud agents, Claude Code (`claude-code` / `claude-agent`, #3134), OpenClaw (`sessions_spawn`, #2874 / #2879), and future adapters share the same contract.
|
|
77
77
|
|
|
78
78
|
! Every intentional backend-routed dispatch MUST carry a separate `## Worker metadata` section in the dispatch envelope, placed AFTER `## Allocation context` and BEFORE the task body. This section is advisory metadata for the worker and for audit; it does NOT replace, extend, or reorder the five-field #1378 `## Allocation context` recognition contract above.
|
|
79
79
|
|
|
80
80
|
When present, the section documents these fields in order:
|
|
81
81
|
|
|
82
|
-
- `dispatch_provider`: the runtime primitive that launched this worker -- e.g. `spawn_subagent`, `start_agent`, `sessions_spawn` (OpenClaw host; platform descriptor `openclaw` per #2874 / #2875), `cursor-composer`, `cursor-cloud-agent`, `claude-code` (Claude Code host; register primitive `claude-agent` per #3134), or a future adapter id. Names the harness surface, not the model.
|
|
82
|
+
- `dispatch_provider`: the runtime primitive that launched this worker -- e.g. `spawn_subagent`, `start_agent`, `sessions_spawn` (OpenClaw host; platform descriptor `openclaw` per #2874 / #2875), `cursor-composer`, `cursor-cloud-agent`, `claude-code` (Claude Code host; register primitive `claude-agent` per #3134), `grok-bot` (Grok Bot host; register primitive `grok-bot-executor` per #4201; not Grok Build), or a future adapter id. Names the harness surface, not the model.
|
|
83
83
|
- `worker_role`: the role boundary for this dispatch -- one of `leaf-implementation`, `orchestrator`, `review-monitor`, or `merge-release` (stable ids from `packages/core/src/swarm/routing.ts` `SWARM_WORKER_ROLES`). Tells the worker which preamble rules and skill surfaces apply.
|
|
84
84
|
- `selected_backend`: the stable backend id from `plan.policy.swarmSubagentBackend` / `task policy:subagent-backends` (accepted set today: `composer`, `grok-build`, `cursor-cloud` only — see `KNOWN_SUBAGENT_BACKEND_IDS`) | null -- which catalogued **coding** backend the operator selected for this role. OpenClaw is a **host / dispatch_provider** (`sessions_spawn` / descriptor `openclaw`), not a `swarmSubagentBackend` enum value; do not write `selected_backend: openclaw` into policy (#2879 Greptile P1).
|
|
85
85
|
- `routing_policy`: <path or reference to the operator's routing file / tiering policy> | null -- when backend selection is delegated to harness routing instead of a typed policy field, cite the policy handle here so postmortems can reconstruct the route. The canonical handle is the gitignored, per-machine `.deft/routing.local.json` (#1739), keyed by `(dispatch_provider, worker_role)`; set decisions with `deft swarm:routing-set --role <role> (--model <slug> | --harness-default)`.
|
|
@@ -21,7 +21,7 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
|
|
|
21
21
|
|
|
22
22
|
## Session-start ritual (#1149)
|
|
23
23
|
|
|
24
|
-
! On **mutation** session start, run `deft session:start`; before code-writing or `start_agent` dispatch run `deft verify:session-ritual -- --tier=gated` (stale after `plan.policy.sessionRitualStalenessHours`; records `deft verify:tools` / `deft doctor` / `deft verify:cache-fresh` / `deft agents:refresh` / `npm i -g @deftai/directive@latest`; #1149 / #1348) — `.deft/core/commands.md` § Session-start ritual. Recovery: `deft session:ready` (one-shot: start + gated ritual + cache recovery; #2993). The #3124 SCM mirror tip does not fire (`triage:classify --mirror` withdrawn, #4070).
|
|
24
|
+
! On **mutation** session start, run `deft session:start`; before code-writing or `start_agent` dispatch run `deft verify:session-ritual -- --tier=gated` (stale after `plan.policy.sessionRitualStalenessHours`; records `deft verify:tools` / `deft doctor` / `deft verify:cache-fresh` / `deft agents:refresh` / `npm i -g @deftai/directive@latest`; #1149 / #1348) — `.deft/core/commands.md` § Session-start ritual. Recovery: `deft session:ready` (one-shot: start + gated ritual + cache recovery; #2993). The #3124 SCM mirror tip does not fire (`triage:classify --mirror` withdrawn, #4070). Work-claim (#4200): catalog label `status:claimed`; verb `deft scm issue work-claim`; session-start and `xbrief:preflight` MUST scan; warn is success, not a lock; claim refuses read-only / no occupancy. Depth: `.deft/core/scm/github.md`.
|
|
25
25
|
|
|
26
26
|
## WIP cap
|
|
27
27
|
|