@deftai/directive-content 0.76.0 → 0.77.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.
@@ -25,6 +25,10 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
25
25
  - User says "build this", "implement the spec", or "start building"
26
26
  - Resuming a partially-built project that has story xBRIEFs in `xbrief/active/`
27
27
 
28
+ ## Ordered-plan / cohort exhaustion (#2402)
29
+
30
+ ! When processing an approved multi-story cohort or an active ordered-plan sequence, stop after the final approved entry. Do not promote or dispatch adjacent stories from queue intuition. Continuation language advances only within the approved order; skill-chaining is non-authorizing.
31
+
28
32
  ## Step 0 -- Implementation Preflight (#810)
29
33
 
30
34
  - ! Before starting any new implementation story or switching from one story to another, MUST run `git status --short --branch`.
@@ -35,6 +35,20 @@ or invoke `task verify:branch`. Pre-PR is the last gate before push, so a stale
35
35
 
36
36
  ! Every numbered-menu prompt rendered in this skill (per-finding decision menus in Phase 4 Diff, the Phase 5 Loop restart-vs-exit gate) MUST follow [`../../contracts/deterministic-questions.md`](../../contracts/deterministic-questions.md): the final two numbered options MUST be `Discuss` and `Back`, in that order. The Discuss-pause semantic is documented verbatim there -- implicit resumption is forbidden.
37
37
 
38
+
39
+ ## Ordered-plan target gate (#2402)
40
+
41
+ ! Before opening or pushing a PR, when an ordered-plan sequence may be active, verify the PR target matches the current authorized entry:
42
+
43
+ ```
44
+ task verify:plan-sequence -- --target-kind pr --target <issue-or-entry-id>
45
+ ```
46
+
47
+ - ! Exit non-zero → fail closed; do not open an unauthorized PR.
48
+ - ! Exit 0 with "skipped (no active ordered-plan sequence)" → proceed under normal pre-PR rules.
49
+ - ! After the PR's review cycle completes successfully, run `task plan-sequence:advance` so "next" resolves to the following entry (or exhausted).
50
+ - ⊗ Treat skill-chaining or "what's next?" as permission to open a PR outside the current sequence entry.
51
+
38
52
  ## When to Use
39
53
 
40
54
  - ! Before pushing a branch for PR creation
@@ -21,6 +21,18 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
21
21
 
22
22
  ! This skill requires **GitHub** as the SCM platform and the **GitHub CLI (`gh`)** to be installed and authenticated. PR comment fetching, check-run queries, and review submission all depend on `gh`.
23
23
 
24
+
25
+ ## Ordered-plan exit / advance (#2402)
26
+
27
+ ! When the review-cycle exit condition is met (no P0/P1 remaining / CLEAN verdict):
28
+
29
+ 1. Return control to the caller — do **not** discover adjacent backlog work.
30
+ 2. If an ordered-plan sequence is active and this PR matched the current entry, run `task plan-sequence:advance`.
31
+ 3. If another entry remains, the caller may continue **only** to that entry (one unit).
32
+ 4. If the sequence is exhausted, stop and ask. Do not open another PR from queue intuition or chaining text.
33
+
34
+ ⊗ Exit the review cycle into `task triage:queue` or an unrelated PR without fresh operator approval.
35
+
24
36
  ## When to Use
25
37
 
26
38
  - User says "review cycle", "check reviews", or "run review cycle" on a PR
@@ -76,6 +76,13 @@ This path became first-class in #1342 (platform adapter slices 1-3) and is fully
76
76
  ⊗ Re-prompt the operator for per-phase batching approval, or run the interactive promote-fill loop (Step 0a -- 0d), when a pre-approved cohort is supplied via `task swarm:launch` -- the headless path's single #1378 consent already authorizes the batch, and re-prompting mid-cohort violates the all-or-nothing dispatch-envelope rule (#954).
77
77
  ? The interactive queue-driven path (Step 0 below) remains the DEFAULT when no pre-approved cohort is supplied; the headless fast-path is the opt-in low-ceremony route for a cohort the operator has already curated and approved upstream.
78
78
 
79
+
80
+ ### Ordered-plan / cohort exhaustion (#2402)
81
+
82
+ ! When the approved cohort (or an active `plan-sequence` of kind `swarm`/`cohort`/`delivery`) is exhausted, stop. Do not promote, queue, open, or dispatch adjacent work after the final approved entry unless the operator explicitly authorizes a new cohort or queue-driven selection.
83
+
84
+ ! Continuation language ("next", "proceed") advances only within the approved cohort order — not into triage-queue remainder.
85
+
79
86
  ### Step 0: Queue-driven cohort selection (#1142 / N2)
80
87
 
81
88
  ! Phase 0 is queue-driven: consult the triage cache (D2 / #1122 + D11 / #1128) for the ranked promotion candidates, then fill the WIP cap. Do NOT pick the cohort by hand from `xbrief/pending/` or `xbrief/active/` -- the queue is the canonical record of "what's next?" per AGENTS.md `## Cache-as-authoritative work selection (#1149)`. The four sub-phases below run in canonical order; existing Step 0.5 (lifecycle bridge) and Steps 1-5 (readiness / blockers / allocation / present / approval) proceed unchanged after Phase 0d.
@@ -59,9 +59,14 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
59
59
  5. ⊗ Re-classify items already terminally decided (accept / reject / mark-duplicate) without explicit operator approval -- the audit log is append-only and supersession runs through Layer 5 (`task triage:reset <N>`), not through silent re-walks.
60
60
  6. ⊗ Block issue creation solely because no label was selected, or invent ad hoc labels outside the repository's existing label set.
61
61
 
62
+
63
+ ## Ordered-plan precedence (#2402)
64
+
65
+ ! Before queue selection on bare "what's next?", run `task plan-sequence:current`. Active sequence → that entry only; exhausted → fail closed and ask. Explicit "what's the queue?" / "build a cohort" still use Phase 2. Chaining is non-authorizing. ⊗ Reuse triage `continuationNumbers`/`continuationOrder` for ordered-plan state.
66
+
62
67
  ## Phase 2 -- Present
63
68
 
64
- ! Render the ranked queue before suggesting any specific issue. The cache-as-authoritative rule in AGENTS.md (`## Cache-as-authoritative work selection (#1149)`) is binding: the agent ! MUST consult `task triage:queue` and surface the result before proposing work from memory.
69
+ ! When no ordered-plan is active, render `task triage:queue` before suggesting work (#1149). Active sequence yields to the ordered-plan entry (#2402).
65
70
 
66
71
  1. ! Run `task triage:queue --limit=N` (D11 / #1128) -- default `N=10` per the umbrella Current Shape v3 WIP cap. Output is grouped `[RESUME]` -> `[URGENT]` -> untriaged -> other; within-group ordering follows the consumer-supplied `plan.policy.triageRankingLabels[]` (framework default empty per §12 boundary), tiebroken by `updated_at` descending.
67
72
  2. ! For per-item detail, run `task triage:show <N>` -- prints the cached upstream payload, the latest triage decision, the audit timeline, and the active-xBRIEF reference flag. Exit 0 on hit, 1 on cache miss (re-sync per Phase 0).
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ /**
5
+ * Spawn the deft CLI from DEFT_ENGINE_CMD without shell-interpolating operator
6
+ * text (#2547). go-task forwards user args into ENGINE_CMD; apostrophes in
7
+ * --summary and similar free-text flags must not break mvdan/sh parsing.
8
+ *
9
+ * Lives under tasks/ (not repo-root scripts/) so @deftai/directive-content
10
+ * prepack ships it beside tasks/engine.yml (#2022 Phase 3).
11
+ */
12
+
13
+ const { spawnSync } = require("node:child_process");
14
+
15
+ /** Minimal POSIX-ish shell word splitter (double/single quotes, escapes). */
16
+ function shellSplit(input) {
17
+ const out = [];
18
+ let cur = "";
19
+ let quote = null;
20
+ for (let i = 0; i < input.length; i++) {
21
+ const c = input[i];
22
+ if (quote) {
23
+ if (c === quote) {
24
+ quote = null;
25
+ continue;
26
+ }
27
+ if (c === "\\" && quote === '"' && i + 1 < input.length) {
28
+ cur += input[++i];
29
+ continue;
30
+ }
31
+ cur += c;
32
+ continue;
33
+ }
34
+ if (c === '"' || c === "'") {
35
+ quote = c;
36
+ continue;
37
+ }
38
+ if (/\s/.test(c)) {
39
+ if (cur) {
40
+ out.push(cur);
41
+ cur = "";
42
+ }
43
+ continue;
44
+ }
45
+ cur += c;
46
+ }
47
+ if (cur) {
48
+ out.push(cur);
49
+ }
50
+ return out;
51
+ }
52
+
53
+ function main() {
54
+ const mode = process.argv[2];
55
+ const target = process.argv[3];
56
+ let cmdLine = "";
57
+ if (process.env.DEFT_ENGINE_CMD_JSON) {
58
+ try {
59
+ cmdLine = JSON.parse(process.env.DEFT_ENGINE_CMD_JSON);
60
+ } catch {
61
+ console.error("deft: DEFT_ENGINE_CMD_JSON is not valid JSON");
62
+ process.exit(2);
63
+ }
64
+ } else {
65
+ cmdLine = String(process.env.DEFT_ENGINE_CMD || "");
66
+ }
67
+ cmdLine = cmdLine.trim();
68
+ const argv = shellSplit(cmdLine);
69
+ if (argv.length === 0) {
70
+ console.error("deft: DEFT_ENGINE_CMD is empty");
71
+ process.exit(2);
72
+ }
73
+ if (!mode || !target) {
74
+ console.error("deft: engine-invoke usage: engine-invoke.cjs <vendored|global> <bin-or-cli>");
75
+ process.exit(2);
76
+ }
77
+
78
+ let execPath;
79
+ let execArgv;
80
+ if (mode === "vendored") {
81
+ execPath = process.execPath;
82
+ execArgv = [target, ...argv];
83
+ } else if (mode === "global") {
84
+ execPath = target;
85
+ execArgv = argv;
86
+ } else {
87
+ console.error(`deft: engine-invoke unknown mode ${JSON.stringify(mode)}`);
88
+ process.exit(2);
89
+ }
90
+
91
+ const result = spawnSync(execPath, execArgv, {
92
+ encoding: "utf8",
93
+ stdio: ["ignore", "pipe", "pipe"],
94
+ env: process.env,
95
+ // Global deft/directive on Windows are .cmd shims; shell:false cannot spawn them (#2415).
96
+ shell: mode === "global" && process.platform === "win32",
97
+ maxBuffer: 16 * 1024 * 1024,
98
+ });
99
+ if (result.stdout) {
100
+ process.stdout.write(result.stdout);
101
+ }
102
+ if (result.stderr) {
103
+ process.stderr.write(result.stderr);
104
+ }
105
+ const code = result.status;
106
+ process.exit(code === null ? 1 : code);
107
+ }
108
+
109
+ if (require.main === module) {
110
+ main();
111
+ }
112
+
113
+ module.exports = { shellSplit };
package/tasks/engine.yml CHANGED
@@ -171,6 +171,11 @@ tasks:
171
171
  # Run from the operator project root so deft verbs resolve USER_WORKING_DIR
172
172
  # correctly; without this, included engine.yml defaults cwd to tasks/ (#2022).
173
173
  dir: '{{.USER_WORKING_DIR}}'
174
+ # Operator free-text (e.g. release --summary with apostrophes) must not be
175
+ # interpolated into the shell script body — JSON env transport + argv-spawn in
176
+ # tasks/engine-invoke.cjs (#2547). Avoids shell parse breaks for `'` and `\`.
177
+ env:
178
+ DEFT_ENGINE_CMD_JSON: '{{ .ENGINE_CMD | toSlash | toJson }}'
174
179
  cmds:
175
180
  - |
176
181
  set -eu
@@ -197,10 +202,9 @@ tasks:
197
202
  }
198
203
  " "$root_pkg" || exit $?
199
204
  fi
200
- node "$bin" {{.ENGINE_CMD}}
205
+ node "{{.TASKFILE_DIR}}/engine-invoke.cjs" vendored "$bin"
201
206
  elif [ "$is_buildable_source" = 1 ]; then
202
- engine_cmd='{{.ENGINE_CMD}}'
203
- first_token="${engine_cmd%% *}"
207
+ first_token=$(node -e "process.stdout.write(JSON.parse(process.env.DEFT_ENGINE_CMD_JSON||'\"\"').split(/\\s+/)[0]||'')")
204
208
  is_runtime_verb=0
205
209
  case " ${first_token} " in
206
210
  " session:start "|" session-start "|\
@@ -245,7 +249,7 @@ tasks:
245
249
  console.error('deft: using global '+cli+' ('+gv+'); source checkout is v'+srcVer+' — run task build for a local engine match.');
246
250
  }
247
251
  " "{{.DEFT_ROOT}}" "$global_cli" >&2 || true
248
- "$global_cli" {{.ENGINE_CMD}}
252
+ node "{{.TASKFILE_DIR}}/engine-invoke.cjs" global "$global_cli"
249
253
  else
250
254
  echo "deft: CLI artifact missing at {{.DEFT_ROOT}}/packages/cli/dist/bin.js" >&2
251
255
  if [ "$is_runtime_verb" = 1 ]; then
@@ -257,9 +261,9 @@ tasks:
257
261
  exit 2
258
262
  fi
259
263
  elif command -v deft >/dev/null 2>&1; then
260
- deft {{.ENGINE_CMD}}
264
+ node "{{.TASKFILE_DIR}}/engine-invoke.cjs" global deft
261
265
  elif command -v directive >/dev/null 2>&1; then
262
- directive {{.ENGINE_CMD}}
266
+ node "{{.TASKFILE_DIR}}/engine-invoke.cjs" global directive
263
267
  else
264
268
  echo "deft: neither {{.DEFT_ROOT}}/packages/cli/dist/bin.js nor a global deft command is available." >&2
265
269
  echo " Install with: npm i -g @deftai/directive" >&2
@@ -0,0 +1,47 @@
1
+ version: '3'
2
+
3
+ # tasks/plan-sequence.yml -- ordered-plan continuation boundary (#2402)
4
+
5
+ vars:
6
+ DEFT_ROOT: '{{joinPath .TASKFILE_DIR ".."}}'
7
+
8
+ tasks:
9
+ set:
10
+ desc: "Set the active ordered-plan sequence from --file JSON (#2402)"
11
+ dir: '{{.USER_WORKING_DIR}}'
12
+ deps:
13
+ - task: :engine:_ts-build
14
+ cmds:
15
+ - task: :engine:invoke
16
+ vars:
17
+ ENGINE_CMD: 'plan-sequence set --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
18
+
19
+ current:
20
+ desc: "Show the current ordered-plan entry (#2402)"
21
+ dir: '{{.USER_WORKING_DIR}}'
22
+ deps:
23
+ - task: :engine:_ts-build
24
+ cmds:
25
+ - task: :engine:invoke
26
+ vars:
27
+ ENGINE_CMD: 'plan-sequence current --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
28
+
29
+ clear:
30
+ desc: "Clear the active ordered-plan sequence (#2402)"
31
+ dir: '{{.USER_WORKING_DIR}}'
32
+ deps:
33
+ - task: :engine:_ts-build
34
+ cmds:
35
+ - task: :engine:invoke
36
+ vars:
37
+ ENGINE_CMD: 'plan-sequence clear --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
38
+
39
+ advance:
40
+ desc: "Mark current entry complete and advance the ordered-plan index (#2402)"
41
+ dir: '{{.USER_WORKING_DIR}}'
42
+ deps:
43
+ - task: :engine:_ts-build
44
+ cmds:
45
+ - task: :engine:invoke
46
+ vars:
47
+ ENGINE_CMD: 'plan-sequence advance --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
package/tasks/verify.yml CHANGED
@@ -242,6 +242,16 @@ tasks:
242
242
  vars:
243
243
  ENGINE_CMD: 'verify-session-ritual --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
244
244
 
245
+ plan-sequence:
246
+ desc: "Fail-closed ordered-plan target check (#2402). Flags: --target-kind <kind> --target <id> / --json. Skips (exit 0) when no active sequence."
247
+ dir: '{{.USER_WORKING_DIR}}'
248
+ deps:
249
+ - task: :engine:_ts-build
250
+ cmds:
251
+ - task: :engine:invoke
252
+ vars:
253
+ ENGINE_CMD: 'verify-plan-sequence --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
254
+
245
255
  tools:
246
256
  desc: "Detect required Deft host tools and print install or manual guidance (#1187). Flags: --install / --yes / --json"
247
257
  dir: '{{.USER_WORKING_DIR}}'
@@ -49,6 +49,28 @@ Worked example (a swarm-cohort member):
49
49
 
50
50
  A `solo` dispatch sets `dispatch_kind: solo`, MAY leave `allocation_plan_id` / `batching_rationale` null, and lists only its own xBRIEF in `cohort_vbriefs`; such a section does NOT by itself satisfy the consent token, so the Story Start Gate falls through to the #1371 prose carve-out for a lone interactive dispatch.
51
51
 
52
+ ## 2.55 Ordered-plan continuation boundary (#2402)
53
+
54
+ When the operator supplies an ordered plan (delivery sequence, cohort, checklist, review batch, or phase list), continuation language is bounded by that sequence — not by the triage queue, skill chaining, or adjacent backlog memory.
55
+
56
+ ! Record the active sequence with `task plan-sequence:set -- --file <json>` (persists `.deft/plan-sequence.json`). Inspect with `task plan-sequence:current`; advance with `task plan-sequence:advance`; clear with `task plan-sequence:clear`.
57
+
58
+ ! Before creating or dispatching a new external work unit (PR, branch, story activation, sub-agent implementation task), when a sequence is active run `task verify:plan-sequence -- --target-kind <kind> --target <id-or-title>`. Exit non-zero means fail closed.
59
+
60
+ ! "next" / "what's next?" / "proceed" / "resume" / "move on" means **exactly one** next unit in the **narrowest active** ordered sequence. Unit type is inherited from that sequence.
61
+
62
+ ! When the sequence is exhausted (`continuation_past_final` defaults false), stop and ask. Do not open PR 3 after an approved two-PR plan. Do not consult `task triage:queue`, open-issue intuition, or skill-chaining instructions to invent the next unit.
63
+
64
+ ! Explicit queue/backlog asks ("what's the queue?", "build a cohort") remain queue-driven even mid-plan. Bare "what's next?" is **not** such an ask while a sequence is active.
65
+
66
+ ! Skill-exit chaining instructions are advisory entrypoints only — they do not authorize adjacent work unless it matches the current ordered-plan entry or a fresh operator directive.
67
+
68
+ ! Review-cycle exit returns to the ordered-plan context and authorizes at most the next sequence entry (after `plan-sequence:advance` for the completed PR). Cohort/build flows stop after the final approved entry.
69
+
70
+ ⊗ Reuse triage queue `continuationNumbers` / `continuationOrder` for ordered-plan state — those fields are for `[RESUME]` / stale-defer ordering only.
71
+
72
+ ⊗ Treat affirmative continuation ("yes", "proceed") as permission to widen past the approved sequence.
73
+
52
74
  ## 2.6 Provider-neutral worker metadata (#1531)
53
75
 
54
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, and future adapters share the same contract.
@@ -7,16 +7,7 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
7
7
 
8
8
  ## Session routing (#2176)
9
9
 
10
- ! **Read-only default** until mutation intent (Q&A, Plan Mode, ticket-shaping): load AGENTS.md, main.md, USER.md, `xbrief/PROJECT-DEFINITION.xbrief.json`; confirm Deft alignment ("Deft Directive active" + addressing-name from USER.md); do not run mutable `deft session:start`, triage welcome, sync, or branch-policy ceremony unless the operator asks or the task is implementation-ready (#2176). Full contract: `.deft/core/commands.md` § Session routing.
11
-
12
- **Bootstrap card** (before answering):
13
- - `deft` / `directive` won't run → README.md § Cold-start bootstrap (#2273); ⊗ never `.deft/core/`
14
- - Pre-cutover artifacts → `.deft/core/.agents/skills/deft-directive-setup/SKILL.md` § Pre-Cutover Detection Guard (#2068)
15
- - USER.md missing → setup SKILL Phase 1; `xbrief/PROJECT-DEFINITION.xbrief.json` missing → setup SKILL Phase 2 (#1813); ⊗ respond before phase completes
16
- - Config complete → read main.md → USER.md → PROJECT-DEFINITION (USER.md wins on conflicts); ~ `deft-directive-sync` on return
17
-
18
- **Mutation boundary:** code-writing, scope lifecycle, `start_agent`, commits, push, or release → `deft session:start` then `deft verify:session-ritual -- --tier=gated` per `.deft/core/commands.md` § Session-start ritual (#1149).
19
- - ? `deft session:start -- --read-only` — alignment only, no ritual-state (#2176)
10
+ ! **Read-only default** until mutation intent: load AGENTS.md / main.md / USER.md / `xbrief/PROJECT-DEFINITION.xbrief.json`; resolve USER.md via `deft session:start` (`USER.md resolved …`; win32 `%APPDATA%\deft\USER.md`; unix `~/.config/deft/USER.md`; ⊗ invent `~/.config/deft` on Windows #2544); confirm Deft alignment + addressing-name; ⊗ no mutable `deft session:start` / triage welcome / sync / branch-policy unless asked or implementation-ready (#2176) `.deft/core/commands.md` § Session routing. Bootstrap: cold-start → README § Cold-start (#2273) ⊗ never `.deft/core/`; pre-cutover → setup Pre-Cutover (#2068); missing USER.md / PROJECT-DEFINITION → setup Phase 1/2 (#1813) ⊗ before answering; else main → USER → PROJECT-DEFINITION; ~ sync. Mutation → `deft session:start` then `deft verify:session-ritual -- --tier=gated` (#1149). ? `deft session:start -- --read-only` (#2176).
20
11
 
21
12
  ## Session-start ritual (#1149)
22
13
 
@@ -24,11 +15,11 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
24
15
 
25
16
  ## WIP cap
26
17
 
27
- ! Respect `plan.policy.wipCap` (default 20) — at cap `deft scope:promote` refuses; relief via `deft scope:demote --batch --older-than-days 30` (#2319 / #1121). Full WIP workflow: `.deft/core/.agents/skills/deft-directive-swarm/SKILL.md`.
18
+ ! Respect `plan.policy.wipCap` (default 20) — at cap `deft scope:promote` refuses; relief via `deft scope:demote --batch --older-than-days 30` (#2319 / #1121). Full WIP: `.deft/core/.agents/skills/deft-directive-swarm/SKILL.md`.
28
19
 
29
20
  ## xBRIEF layout (#2034 / #2110)
30
21
 
31
- Projects on legacy `vbrief/` still read-accepted; run `deft migrate:xbrief` for `xbrief/` (v0.6→v0.8). `x-vbrief/` tokens read-accepted until migrated.
22
+ Legacy `vbrief/` read-accepted; `deft migrate:xbrief` for `xbrief/` (v0.6→v0.8). `x-vbrief/` tokens read-accepted until migrated.
32
23
 
33
24
  ## Unmanaged project header (#2065)
34
25
 
@@ -36,9 +27,9 @@ Projects on legacy `vbrief/` still read-accepted; run `deft migrate:xbrief` for
36
27
 
37
28
  ## Cache-as-authoritative work selection (#1149)
38
29
 
39
- ! "what next?" / cohort / queue `deft triage:queue --limit=10` (D11 / #1128); present ranked list first `.deft/core/commands.md` § Backlog Triage.
30
+ ! "what next?" ordered-plan first (#2402 / `deft plan-sequence:*`); else `deft triage:queue --limit=10` (D11) — `commands.md` § Backlog Triage.
40
31
 
41
- ⊗ Recommend issue or xBRIEF without `deft triage:queue` (or showing its result).
32
+ ⊗ Recommend work without queue/plan consult; widen past an exhausted plan.
42
33
 
43
34
  ## Umbrella status reading (#1152 / #2066)
44
35
 
@@ -48,61 +39,59 @@ Projects on legacy `vbrief/` still read-accepted; run `deft migrate:xbrief` for
48
39
 
49
40
  ## Deterministic questions runtime obligation (#1470)
50
41
 
51
- ! Any agent-initiated structured question MUST include `Discuss` and `Back` as the final two options full Discuss-pause semantic in `.deft/core/contracts/deterministic-questions.md` (#1470 / #767).
42
+ ! Structured questions MUST end with `Discuss` and `Back` — `.deft/core/contracts/deterministic-questions.md` (#1470 / #767).
52
43
 
53
44
  ## Issue body→comments reading (#2143)
54
45
 
55
- ! Fetch body + `issues/<N>/comments` via REST before requirements or dispatch — `.deft/core/templates/agent-prompt-preamble.md` § 5.6 / `deft issue:ingest` (#2143).
56
-
57
- ⊗ Build a dispatch envelope from the issue body alone when the issue has comments.
46
+ ! Fetch body + `issues/<N>/comments` via REST before requirements or dispatch — `.deft/core/templates/agent-prompt-preamble.md` § 5.6 / `deft issue:ingest` (#2143). ⊗ Build a dispatch envelope from the issue body alone when the issue has comments.
58
47
 
59
48
  ## Content packs
60
49
 
61
- ! Before improvising, discover packs with `deft packs:slice --list-packs`, then load via `deft packs:slice <pack> --list` / `deft packs:slice <pack> <slice>` — full pack surface in `.deft/core/commands.md` (§ packs); never enumerate pack or slice names here.
50
+ ! Before improvising: `deft packs:slice --list-packs`, then `deft packs:slice <pack> --list` / `deft packs:slice <pack> <slice>` — `commands.md` (§ packs); never enumerate names here.
62
51
 
63
52
  ## Codebase MAP Projection (#1595 / #1498)
64
53
 
65
- ! `plan.architecture.codeStructure` is durable SoT; `.planning/codebase/MAP.md` is generated orientation use `deft codebase:map` / `deft verify:codebase-map-fresh` (`.deft/core/commands.md` § Project And Architecture). ⊗ Do not hand-edit the MAP, block unrelated work on stale/absent MAP, or treat the projection as more authoritative than the xBRIEF metadata (#1595 / #1498).
54
+ ! `plan.architecture.codeStructure` is durable SoT; `.planning/codebase/MAP.md` is generated — `deft codebase:map` / `deft verify:codebase-map-fresh` (`commands.md`). ⊗ Do not hand-edit MAP, block on stale/absent MAP, or elevate projection above xBRIEF (#1595 / #1498).
66
55
 
67
56
  ## Skills
68
57
 
69
- ! Skill routing lives in the **Skills Index** (Level-0) in `.deft/core/REFERENCES.md` — scan it before improvising; read a `SKILL.md` only on index match. `welcome` / `onboard triage` → `deft triage:welcome --onboard` (N3 / #1143); `lessons` / `prior art` Content packs `packs:slice` above.
58
+ ! **Skills Index** (Level-0) in `.deft/core/REFERENCES.md` — scan before improvising; read `SKILL.md` only on index match. `welcome` / `onboard triage` → `deft triage:welcome --onboard` (N3 / #1143); lessons → packs:slice.
70
59
 
71
60
  ## Review-surface precedence (#2308)
72
61
 
73
- ! Route review work through `deft-directive-review-cycle` — `.deft/core/.agents/skills/deft-directive-review-cycle/SKILL.md`; host tools (`bugbot`, `security-review`, `review-*` skills) advisory-only (#2308).
62
+ ! Route review through `deft-directive-review-cycle` — `.deft/core/.agents/skills/deft-directive-review-cycle/SKILL.md`; host `bugbot` / `security-review` / `review-*` advisory-only (#2308).
74
63
 
75
64
  ## Value feedback and attribution (#1709)
76
65
 
77
- ! `plan.policy.valueFeedback.enabled` defaults OFF — opt-in via `deft policy:show --field=valueFeedback` / `deft policy:enable-value-feedback -- --confirm`; detail via `deft value:show`; gaps via `deft feedback:file`; rules in `.deft/core/.agents/skills/deft-directive-feedback/SKILL.md` (#1709).
66
+ ! `plan.policy.valueFeedback.enabled` defaults OFF — `deft policy:show --field=valueFeedback` / `deft policy:enable-value-feedback -- --confirm`; `deft value:show`; `deft feedback:file`; `.deft/core/.agents/skills/deft-directive-feedback/SKILL.md` (#1709).
78
67
 
79
68
  ## Eval and framework health (#1703)
80
69
 
81
- ! Run `deft eval:health` when orienting or after gate/policy changes (Tier 0; 4-hour debounce). Maintainer release eval: `deft eval:run` / `deft eval:report` (#1703).
70
+ ! `deft eval:health` when orienting or after gate/policy changes (Tier 0; 4-hour debounce). Release: `deft eval:run` / `deft eval:report` (#1703).
82
71
 
83
72
  ## Branch policy & branch verification
84
73
 
85
- ! Work on feature branches — `deft verify:branch`, `deft verify:forward-coverage`, hooks, and `deft check` enforce default-branch protection (#746 / #747); full surfaces in `.deft/core/scm/github.md` § Branch policy.
74
+ ! Feature branches — `deft verify:branch`, `deft verify:forward-coverage`, hooks, `deft check` (#746 / #747) `.deft/core/scm/github.md` § Branch policy.
86
75
 
87
76
  ## Branch Policy Disclosure (#746)
88
77
 
89
- ! When `plan.policy.allowDirectCommitsToMaster = true`, surface policy at session start via `deft policy:show --field=allowDirectCommitsToMaster` (#746) — full phrasing and override paths in `.deft/core/scm/github.md` § Branch policy.
78
+ ! When `plan.policy.allowDirectCommitsToMaster = true`, surface via `deft policy:show --field=allowDirectCommitsToMaster` (#746) — `.deft/core/scm/github.md` § Branch policy.
90
79
 
91
80
  ## Contextual guardrails (runtime-detect lazy-load)
92
81
 
93
- ! Lazy-load `.deft/core/scm/github.md` sections before risky ops (#2157 / #2369): PowerShell → `deft verify:encoding` (#798); TS capture (#1366); cascade → `deft pr:wait-mergeable-and-merge` (#1369); SCM → `deft verify:scm-boundary` (#884).
82
+ ! Lazy-load `.deft/core/scm/github.md` before risky ops (#2157 / #2369): PowerShell → `deft verify:encoding` (#798); TS capture (#1366); cascade → `deft pr:wait-mergeable-and-merge` (#1369); SCM → `deft verify:scm-boundary` (#884).
94
83
 
95
84
  ## Development Process
96
85
 
97
86
  ### Implementation Intent Gate (#810)
98
87
 
99
- ! `deft xbrief:preflight -- <path>` on `xbrief/active/` before code-writing; action-verb directive (`build`, `implement`, `ship`, `swarm`, `run agents`, `start agent`) (#810) — `.deft/core/commands.md` § Scope xBRIEF Lifecycle.
88
+ ! `deft xbrief:preflight -- <path>` on `xbrief/active/` before code-writing; action-verb (`build`, `implement`, `ship`, `swarm`, `run agents`, `start agent`) (#810) — `commands.md` § Scope xBRIEF Lifecycle.
100
89
 
101
90
  ### Story Start Gate
102
91
 
103
- ! `git status --short --branch` + `deft verify:story-ready`; lifecycle via `deft scope:promote -- <path>` / `deft scope:activate -- <path>` / `deft scope:complete -- <active-story-path>` (#1378) — `.deft/core/commands.md` § Scope xBRIEF Lifecycle.
92
+ ! `git status --short --branch` + `deft verify:story-ready`; `deft scope:promote -- <path>` / `deft scope:activate -- <path>` / `deft scope:complete -- <active-story-path>` (#1378) — `commands.md` § Scope xBRIEF Lifecycle.
104
93
 
105
94
  ## Commands
106
95
 
107
- ! Directive product commands use the `/deft:directive:*` namespace (#418 / #1670); the full command and alias table lives in `.deft/core/commands.md` — load on demand, not rendered here.
96
+ ! `/deft:directive:*` namespace (#418 / #1670); full table in `.deft/core/commands.md` — load on demand.
108
97
  <!-- /deft:managed-section -->
@@ -13,8 +13,8 @@ Directive runs against arbitrary repositories, including private monorepos with
13
13
  ## Rules
14
14
 
15
15
  - ! Read-only, session-start, and session-ritual flows (`deft session:start`, `deft verify:session-ritual`, `deft verify:tools`) MUST perform no npm/pnpm registry access. Tool-presence probes MUST use PATH lookups (`which`/`accessSync`) or `--version` checks, never a subcommand that can resolve dependencies or query a registry.
16
- - ! `deft doctor` MUST default to an OFFLINE tier: no check in the default run may contact an npm/pnpm registry. The one check that can (`payload-staleness`, which resolves the latest framework version via `git ls-remote` and falls back to `npm view <package> version`) is gated behind the explicit `--network` flag and is skipped by default with a pointer to that flag.
17
- - ! Before a network-gated check runs, `deft doctor --network` MUST print a disclosure line naming the tool and registry class it may contact (e.g. "may contact your git remote and, as a fallback, the npm registry") BEFORE any network call is attempted.
16
+ - ! `deft doctor` MUST default to an OFFLINE tier: no check in the default run may contact an npm/pnpm registry. The one check that can (`payload-staleness`, which uses `git ls-remote` to verify the installed pin and `npm view <package> version` to compare a release-tag install with the latest stable package) is gated behind the explicit `--network` flag and is skipped by default with a pointer to that flag.
17
+ - ! Before a network-gated check runs, `deft doctor --network` MUST print a disclosure line naming the tool and registry class it may contact (for example, "may contact your git remote and the npm registry") BEFORE any network call is attempted.
18
18
  - ! Any future doctor check, session step, or read-only command that needs to invoke `npm`/`pnpm` in a way that can reach a registry MUST follow the same pattern: explicit flag or subcommand, disclosed registry class before the call, and offline by default.
19
19
  - ~ Where a package-manager operation is unavoidable in an explicitly-invoked flow (e.g. a release or install workflow that legitimately needs to fetch packages), prefer offline/frozen modes (`--offline`, `--prefer-offline`, `--frozen-lockfile`) when the operation only needs to validate local state rather than resolve fresh metadata.
20
20
  - ⊗ MUST NOT invoke `npm`/`pnpm` subcommands that can contact a registry from any code path reachable by `session:start`, `verify:session-ritual`, `verify:tools`, or the default `deft doctor` invocation.