@deftai/directive-content 0.111.0 → 0.113.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/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, or mechanism-shaped
7
- triage. Do NOT trigger on ordinary implement, build, or swarm work.
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, or mechanism-shaped triage
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
 
@@ -84,25 +84,25 @@ The release pipeline's Step 9/10/11 git mutations carry the bypass in subprocess
84
84
 
85
85
  ### Parallel prep — #1880 Gap D (#2692)
86
86
 
87
- ! Phase 1 long steps (`task reconcile:issues -- --apply-lifecycle-fixes`, cache refresh when ritual-stale, `task check`) and Phase 3 `task release:e2e` MUST be backgrounded or subagent-dispatched when the host supports it (Cursor: Task tool `run_in_background: true`), with progress surfaced via DONE/heartbeat — same ownership as review-cycle / merge-ready workers (#1880 Gap D). The operator conversation MUST stay interactive for version magnitude confirmation, `--summary`, and the Phase 2 dry-run `yes`/`back`/`quit` gate while prep runs. (`task ci:local` is historical and removed.)
87
+ ! Phase 1 long steps (`task reconcile:issues -- --apply-lifecycle-fixes`, cache refresh when ritual-stale) and Phase 3 `task release:e2e` MUST be backgrounded or subagent-dispatched when the host supports it (Cursor: Task tool `run_in_background: true`), with progress surfaced via DONE/heartbeat — same ownership as review-cycle / merge-ready workers (#1880 Gap D). The operator conversation MUST stay interactive for version magnitude confirmation, `--summary`, and the Phase 2 dry-run `yes`/`back`/`quit` gate while prep runs. (`task ci:local` is historical and removed.)
88
88
 
89
89
  ! **Checklist:** Phase 1 prep parallelized — long prep started in background before (or while) collecting version magnitude / summary / npm irrevocability disclosure.
90
90
 
91
91
  ! On Windows PowerShell, do NOT wrap long task output in `Select-Object -Last` (it buffers until the process exits); stream to the terminal or log to a file and read incrementally. See `scm/github.md` § #2646 / Windows encoding guidance for related PS pitfalls.
92
92
 
93
- ⊗ Foreground-block the operator chat on reconcile / `check` / `release:e2e` when background dispatch is available (#1880 Gap D / #2692).
93
+ ⊗ Foreground-block the operator chat on reconcile / `release:e2e` when background dispatch is available (#1880 Gap D / #2692).
94
94
 
95
95
  ### Fixable check failure — file-and-merge before resume (#2859)
96
96
 
97
- ! When Step 4 (`task check`) fails on a **fixable product or test defect** (hang, failing test, validation bug — not operator env misconfiguration), the release cut MUST pause and route the blocker through normal issue → xBRIEF → feature branch → PR → merge before resuming Phase 1.
97
+ ! When **pipeline Step 5** fails on a **fixable product or test defect** (hang, failing test, validation bug — not operator env misconfiguration), the release cut MUST pause and route the blocker through normal issue → xBRIEF → feature branch → PR → merge before resuming Phase 1.
98
98
 
99
99
  ? **Step 5 branch-coverage threshold misses** during `task release` (Vitest branch coverage below 85% with no other failure mode) are carved out to § Step 5 branch-coverage threshold — open-issue ledger hatch (#2866) below — not this file-and-merge path.
100
100
 
101
101
  **Required path:**
102
102
  1. File a GitHub issue with root cause, recurrence signature, and acceptance criteria.
103
103
  2. Ingest / promote / activate scope xBRIEF; implement on a feature branch with `drive-to: merge-ready`.
104
- 3. Merge; confirm `task check` is green for the failure mode.
105
- 4. Resume the release cut from Phase 1 (re-run Step 4).
104
+ 3. Merge; confirm pipeline Step 5 is green for the failure mode.
105
+ 4. Resume the release cut from Phase 1 (re-run pipeline Step 5).
106
106
 
107
107
  ⊗ Lead with an inline-only hotfix on the release branch / default branch without a tracked issue and merged PR.
108
108
  ⊗ Suggest untracked `--skip-ci` or `--allow-skip-ci` without a **tracked issue number** as the first recovery when the failure is a clear, shippable bug.
@@ -116,7 +116,7 @@ See [`docs/RELEASING.md`](../../../docs/RELEASING.md) § Fixable check failure d
116
116
 
117
117
  ### Step 5 branch-coverage threshold — open-issue ledger hatch (#2866 / #3187)
118
118
 
119
- ! When **`task release` Step 5** fails on Vitest coverage below the 85% goal, apply this hatch **only** when **branches** is the **sole** metric below 85% (hairline branch miss — lines, functions, and statements all ≥ 85%). Confirm via the Step 5 failure output, `coverage/coverage-final.json`, or `task coverage:hotspots` before hatching. If **any other metric** is also below 85%, or the failure is a hang / failing test / non-coverage defect, STOP — use § Fixable check failure — file-and-merge before resume (#2859) instead.
119
+ ! When **`task release` Step 5** fails on Vitest coverage below the 85% goal, apply this hatch **only** when **branches** is the **sole** metric below 85% (hairline branch miss — lines, functions, and statements all ≥ 85%). Confirm via the Step 5 failure output or `task coverage:hotspots` before hatching. Do not treat `coverage/coverage-final.json` as live until [#4244](https://github.com/deftai/directive/issues/4244). If **any other metric** is also below 85%, or the failure is a hang / failing test / non-coverage defect, STOP — use § Fixable check failure — file-and-merge before resume (#2859) instead.
120
120
 
121
121
  **Runtime disclosure (#2573):** `--allow-coverage-debt=#N` sets vitest coverage thresholds to zero for the release Step 5 run (`vitest.config.ts`). The hatch is justified only for branch-only hairlines; the filed debt issue MUST require restoring **all four metrics** (lines, functions, branches, statements) to ≥ 85% before close.
122
122
 
@@ -176,13 +176,12 @@ See [`docs/RELEASING.md`](../../../docs/RELEASING.md) § Routine vs hard cut for
176
176
  2. ! Confirm the next version number (`X.Y.Z`) with the user. Major / minor / patch decision flows from the `[Unreleased]` content (breaking change → major; new feature → minor; fix-only → patch)
177
177
  ! After the version is confirmed, name the mint CLI for that version. The operator runs it immediately before Phase 4 (not now): `deft authz:grant -- --template release-publish --target <version> --confirm` plus typed `mint` on a real TTY. Do **not** wait for a live grant before Phase 3 — a grant for the cut version cannot satisfy rehearsal `target=0.0.1` in a clone with no `.deft/authz`, and a Phase-1 mint can expire (`1h`) during long e2e before production Step 10. ⊗ `task authz:grant` (not a Taskfile target). ⊗ Treat a live grant as a Phase 3 precondition.
178
178
  3. ! Inspect `[Unreleased]` content vs the proposed version bump. If a breaking change appears in `### Changed` / `### Removed` but only a patch is proposed, surface the mismatch and ask the user to choose
179
- 4. ! Verify `task check` passes locally. (`task ci:local` is historical and removed.) The `task release` script will refuse to proceed otherwise -- but Phase 1 catches it earlier — **on failure from a fixable defect, STOP and follow § Fixable check failure below (#2859); do NOT proceed to step 5**
180
- 5. ! Verify `gh auth status` reports authenticated (`task release` will refuse otherwise)
181
- 6. ! **Run `task reconcile:issues -- --apply-lifecycle-fixes` to clear any closed-issue / non-completed-folder xBRIEFs before invoking `task release`** (#734). The release pipeline carries the deterministic gate at Step 3 (`task reconcile:issues -- --apply-lifecycle-fixes`, refuses with `EXIT_VIOLATION` on any Section (c) mismatch), but Phase 1 is the operator's first-line defence -- running the apply-mode flag here is the canonical clean path; `--allow-vbrief-drift` on the pipeline exists only as the explicit-acknowledgment escape hatch (analogous to `--allow-dirty`). The recurrence record is the v0.21.0 cut, which surfaced 13 stranded xBRIEFs (8 cycle-relevant + 5 historical residue) post-publish; the gate now blocks that drift before any irreversible action
182
- 7. ! **Verify the proposed `v<version>` tag is not already in use locally, on origin, or as a published GitHub release** (#784). The release pipeline carries the deterministic gate at Step 4 (`the release tag-availability gate`, refuses with `EXIT_VIOLATION` before any state mutation -- CHANGELOG promotion, ROADMAP refresh, build, commit), but Phase 1 is the operator's first-line defence. Quickly probe with `git tag -l v<version>` (local), `git ls-remote --tags origin refs/tags/v<version>` (remote), and `gh release view v<version> --repo <owner>/<repo>` (release-only, where `gh release view` exits 0 only when the release exists). The recurrence record is the v0.22.0 v0.23.0 release attempt on 2026-05-01: the operator typed `0.22.0` (the prior release from 12 hours earlier) and the legacy pipeline ran 8 steps before failing at `git tag` -- leaving a wrong-version local commit + `dist/deft-0.22.0.zip` orphan + manual `git reset --hard` recovery. The new pre-flight gate blocks that mode before any irreversible action
183
- 8. ! **Verify the npm credential path is configured before cutting the tag** (#1910, #1909). A `v*` tag now auto-triggers `.github/workflows/npm-publish.yml`, which publishes the four `@deftai/directive*` packages with `npm publish --provenance`. Confirm the publish path can authenticate: either the `NPM_TOKEN` repo secret is present (`gh secret list --repo <owner>/<repo>` shows `NPM_TOKEN`) OR an npm OIDC trusted publisher is configured for the `@deftai/directive*` packages. If neither is in place, WARN loudly that the tag will fire a publish job that fails (red X on the tag, no packages) -- the operator may still proceed for a GitHub-only release, but the npm channel will not land until #1909's credential is provisioned. Cross-reference #1909.
184
- 9. ! **Disclose npm irrevocability before any tag push (#1972, #2002, #3527).** A `v<version>` tag push is the **real npm publish gate** -- NOT Phase 5 or `task release:publish`. Tag push fires `.github/workflows/npm-publish.yml` in a separate workflow that is NOT draft-gated; npm packages ship immediately and **cannot be retracted** (`npm unpublish` is forbidden). Recovery is forward-only: deprecate, dist-tag, or ship a patch. The last human gates before npm goes live are: (a) Phase 2 dry-run `yes`, (b) a human-origin closed-verb grant (`deft authz:grant -- --template release-publish --target <version> --confirm` or `DEFT_ALLOW_RELEASE_PUBLISH=1`). `task release` fails closed at the Step 10–11 tag-push boundary without that grant. Phase 5 only controls GitHub release visibility (draft → public); it does NOT gate npm. The draft-flip `release:publish` closed-verb check remains (#1095).
185
- 10. ~ Ask the operator for an optional one-line release **summary** (recommended 80-160 chars; can be skipped). The summary is the canonical narrative for THIS release across three audiences: (a) injected as a Markdown blockquote at the top of the promoted `CHANGELOG.md [<version>]` section, (b) auto-flowed into the GitHub release body via the existing `_section_for_version` pickup, and (c) populated VERBATIM into the Phase 8 Slack `*Summary*:` slot. Capture the wording once here; do NOT regenerate per-audience downstream
179
+ 4. ! Verify `gh auth status` reports authenticated (`task release` will refuse otherwise)
180
+ 5. ! **Run `task reconcile:issues -- --apply-lifecycle-fixes` to clear any closed-issue / non-completed-folder xBRIEFs before invoking `task release`** (#734). The release pipeline carries the deterministic gate at Step 3 (`task reconcile:issues -- --apply-lifecycle-fixes`, refuses with `EXIT_VIOLATION` on any Section (c) mismatch), but Phase 1 is the operator's first-line defence -- running the apply-mode flag here is the canonical clean path; `--allow-vbrief-drift` on the pipeline exists only as the explicit-acknowledgment escape hatch (analogous to `--allow-dirty`). The recurrence record is the v0.21.0 cut, which surfaced 13 stranded xBRIEFs (8 cycle-relevant + 5 historical residue) post-publish; the gate now blocks that drift before any irreversible action
181
+ 6. ! **Verify the proposed `v<version>` tag is not already in use locally, on origin, or as a published GitHub release** (#784). The release pipeline carries the deterministic gate at Step 4 (`the release tag-availability gate`, refuses with `EXIT_VIOLATION` before any state mutation -- CHANGELOG promotion, ROADMAP refresh, build, commit), but Phase 1 is the operator's first-line defence. Quickly probe with `git tag -l v<version>` (local), `git ls-remote --tags origin refs/tags/v<version>` (remote), and `gh release view v<version> --repo <owner>/<repo>` (release-only, where `gh release view` exits 0 only when the release exists). The recurrence record is the v0.22.0 v0.23.0 release attempt on 2026-05-01: the operator typed `0.22.0` (the prior release from 12 hours earlier) and the legacy pipeline ran 8 steps before failing at `git tag` -- leaving a wrong-version local commit + `dist/deft-0.22.0.zip` orphan + manual `git reset --hard` recovery. The new pre-flight gate blocks that mode before any irreversible action
182
+ 7. ! **Verify the npm credential path is configured before cutting the tag** (#1910, #1909). A `v*` tag now auto-triggers `.github/workflows/npm-publish.yml`, which publishes the four `@deftai/directive*` packages with `npm publish --provenance`. Confirm the publish path can authenticate: either the `NPM_TOKEN` repo secret is present (`gh secret list --repo <owner>/<repo>` shows `NPM_TOKEN`) OR an npm OIDC trusted publisher is configured for the `@deftai/directive*` packages. If neither is in place, WARN loudly that the tag will fire a publish job that fails (red X on the tag, no packages) -- the operator may still proceed for a GitHub-only release, but the npm channel will not land until #1909's credential is provisioned. Cross-reference #1909.
183
+ 8. ! **Disclose npm irrevocability before any tag push (#1972, #2002, #3527).** A `v<version>` tag push is the **real npm publish gate** -- NOT Phase 5 or `task release:publish`. Tag push fires `.github/workflows/npm-publish.yml` in a separate workflow that is NOT draft-gated; npm packages ship immediately and **cannot be retracted** (`npm unpublish` is forbidden). Recovery is forward-only: deprecate, dist-tag, or ship a patch. The last human gates before npm goes live are: (a) Phase 2 dry-run `yes`, (b) a human-origin closed-verb grant (`deft authz:grant -- --template release-publish --target <version> --confirm` or `DEFT_ALLOW_RELEASE_PUBLISH=1`). `task release` fails closed at the Step 10–11 tag-push boundary without that grant. Phase 5 only controls GitHub release visibility (draft public); it does NOT gate npm. The draft-flip `release:publish` closed-verb check remains (#1095).
184
+ 9. ~ Ask the operator for an optional one-line release **summary** (recommended 80-160 chars; can be skipped). The summary is the canonical narrative for THIS release across three audiences: (a) injected as a Markdown blockquote at the top of the promoted `CHANGELOG.md [<version>]` section, (b) auto-flowed into the GitHub release body via the existing `_section_for_version` pickup, and (c) populated VERBATIM into the Phase 8 Slack `*Summary*:` slot. Capture the wording once here; do NOT regenerate per-audience downstream
186
185
 
187
186
  ⊗ Skip the version-bump magnitude check -- a patch release that ships breaking changes is the kind of regression that Repair Authority [AXIOM] (#709) is designed to prevent.
188
187
 
@@ -376,7 +375,7 @@ Where `<one-line guidance>` is one of:
376
375
 
377
376
  ## Anti-Patterns
378
377
 
379
- - ⊗ Foreground-block the operator chat on Phase 1 long prep (`reconcile:issues`, cache refresh, `check`) or Phase 3 `release:e2e` when background / subagent dispatch is available (#1880 Gap D / #2692) — the interactive channel must stay free for version confirmation, `--summary`, and the Phase 2 dry-run gate
378
+ - ⊗ Foreground-block the operator chat on Phase 1 long prep (`reconcile:issues`, cache refresh) or Phase 3 `release:e2e` when background / subagent dispatch is available (#1880 Gap D / #2692) — the interactive channel must stay free for version confirmation, `--summary`, and the Phase 2 dry-run gate
380
379
  - ⊗ Wrap long release-prep task output in PowerShell `Select-Object -Last` — it buffers until exit and makes the session look hung (#2692)
381
380
  - ⊗ Run `task release` without a Phase 2 dry-run preview -- the dry-run is the only safe place to catch a bad version, malformed CHANGELOG, or wrong base branch
382
381
  - ⊗ Skip Phase 3 (e2e rehearsal) on the assumption that "the dry-run is enough" -- the e2e harness catches gh-CLI auth issues, repo permission gaps, and pipeline-shape regressions that the dry-run cannot detect
@@ -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`, and per #3134 for Claude Code `claude-code` / `claude-agent`). Probe the environment (tool set + env vars) to obtain the stable platform descriptor (`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`, or OpenClaw `sessions_spawn`). The descriptor (not hard-coded tool presence) is the single source of truth for both launch and review monitoring.
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`, or OpenClaw `sessions_spawn`)
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), **or OpenClaw `sessions_spawn` (`openclaw`, #2876)** with a prompt that instructs it to poll for Greptile completion. For `spawn_subagent`, Cursor `Task`, Claude Code `Agent`, and OpenClaw `sessions_spawn` 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).
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 `spawn_subagent` tool** — descriptor `grok-build`.
174
- 7. ! **Select launch path automatically** — load the matching host adapter (route table). No static A/B/C menu.
175
- 8. ! **Return a stable platform descriptor** for Phase 4/6: `warp-orchestrated`, `warp-manual`, `cursor-composer`, `cursor-cloud-agent`, `claude-code`, `openclaw`, `grok-build`, or `generic-terminal`.
176
- 9. ? **Cloud escape hatch** `oz agent run-cloud` only on explicit user request (host-generic).
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. Ad-hoc host spawn (Grok `spawn_subagent`, Cursor Task, Claude subagent) uses the same destination field (`isolation=worktree` / `worktree_path` / `cwd`). Terminal release is dispatcher-owned (`phase: terminal` + incarnation); do not tell a refused Grok child to steal master.
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 `spawn_subagent` tool** — when none of `start_agent`, `WARP_*`, Cursor, Claude Code, or OpenClaw `sessions_spawn` is present, check for `spawn_subagent` (Grok Build / non-Warp TUI launch adapter, #1342 slice 2). Its presence indicates the grok-build platform.
32
- 7. ! **Select launch path automatically** based on detection results do NOT present static options:
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
- 8. ! **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-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, and OpenClaw `sessions_spawn` 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.
41
- 9. ? **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
+ 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. `spawn_subagent` → `grok-build`
25
- 7. else → `generic-terminal` (Tier 3)
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`), dispatch each worker via `spawn_subagent` with:
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. The worktree path set to the agent's isolated git worktree
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
- desc: "Migrate consumer vbrief/ layout to xbrief/ with semantic v0.6->v0.8 transforms (#2110 / #2034)."
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