@deftai/directive-content 0.116.0 → 0.118.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.
@@ -31,10 +31,12 @@ or switch to a different spec-generating strategy. This gate is the single
31
31
  orchestration point for strategy composition.
32
32
 
33
33
  ! The chaining gate MUST always be shown — even when the interview strategy is
34
- invoked directly with no prior strategy.
34
+ invoked directly with no prior strategy — except the identity-only Starting-new
35
+ skip below (#4390).
35
36
  ! The chaining gate is a **blocking question**. The AI MUST present the options
36
37
  and wait for the user to choose before proceeding.
37
- ⊗ Skip the chaining gate or proceed to the sizing gate without presenting it.
38
+ ⊗ Skip the chaining gate or proceed to the sizing gate without presenting it,
39
+ except the identity-only Starting-new / Proceed invocation named below.
38
40
 
39
41
  ### When It Appears
40
42
 
@@ -44,17 +46,31 @@ and wait for the user to choose before proceeding.
44
46
 
45
47
  ### Brownfield Detector
46
48
 
47
- Before rendering menu options, classify the repo (align with setup Phase 3):
49
+ Before rendering menu options, classify the repo (same rule as setup Phase 3; #4390 recut of the #2925 identity-OR-scopes probe):
48
50
 
49
- - **Brownfield** when **either**:
50
- - `PROJECT-DEFINITION` exists under `./xbrief/` or legacy `./vbrief/` (`PROJECT-DEFINITION.xbrief.json` or `PROJECT-DEFINITION.vbrief.json`), **or**
51
- - any lifecycle folder (`proposed/`, `pending/`, `active/`, `completed/`, `cancelled/` under `xbrief/` or legacy `vbrief/`) has scope records
52
- - **Greenfield** otherwise
51
+ - **Identity-only** when BOTH:
52
+ - live PROJECT-DEFINITION `plan.items` is empty (`[]` or absent), AND
53
+ - no convention-valid `*.xbrief.json` / `*.vbrief.json` in lifecycle folders (`proposed/`, `pending/`, `active/`, `completed/`, `cancelled/` under `./xbrief/` or legacy `./vbrief/`). Exclude `.gitkeep` and `*.premigrate.*`. PROJECT-DEFINITION itself is identity, not a scope record.
54
+ - **Scoped (brownfield)** when `plan.items` is non-empty OR at least one convention-valid scope file exists
55
+ - **Greenfield** otherwise (no PROJECT-DEFINITION and no convention-valid scope file)
53
56
 
54
57
  ! The detector MUST run on every Chaining Gate presentation.
58
+ ! Identity-only and greenfield share the Proceed / Starting-new default. Scoped/brownfield defaults to Add-scope.
59
+ ⊗ Treat PROJECT-DEFINITION existence alone as brownfield.
60
+ ⊗ Use session-age ("this setup turn just wrote identity") as the probe.
61
+ ⊗ Invent a "finished Phase 3" marker.
55
62
  ⊗ Offer only the greenfield-framed **Proceed to specification** default on a brownfield repo.
56
63
  ⊗ Treat brownfield as a full create path without an explicit Replace/scrap confirm.
57
64
 
65
+ ### Starting-new / Proceed skip (#4390)
66
+
67
+ ! Starting-new (setup Phase 3) and Proceed (this gate) MUST ask what to build before writing a scope.
68
+
69
+ ? When setup Phase 3 already selected **Starting a new project specification** on identity-only, this Chaining Gate MAY be skipped for that invocation and the agent may continue to the Sizing Gate. Written reason: identity-only default is already Proceed; the prior identity-OR-scopes detector re-defaulted to Add-scope one step later and skipped the product interview.
70
+
71
+ ⊗ Skip this gate on scoped/brownfield repos.
72
+ ⊗ Skip this gate when the operator chose Add-scope, Update, or Replace.
73
+
58
74
  ### Options
59
75
 
60
76
  ! Numbered Chaining Gate menus (greenfield and brownfield examples below) MUST end with `Discuss` and `Back` as the final two options per [deterministic-questions.md](../contracts/deterministic-questions.md).
@@ -63,11 +79,14 @@ Present groups sourced from the `Type` column in
63
79
  [strategies/README.md](./README.md#strategy-types). The **default path** depends
64
80
  on the brownfield detector:
65
81
 
66
- **Default path (greenfield):**
67
- 1. **Proceed to specification** (default) — continue to the [Sizing Gate](#sizing-gate) for a full create path
82
+ **Default path (greenfield or identity-only):**
83
+ 1. **Proceed to specification** (default) — ask what to build; continue to the [Sizing Gate](#sizing-gate) for a full create path
84
+
85
+ **Identity-only also keeps Add-scope / Update / Replace / Process-only on the menu** (same vocabulary as setup Phase 3). They are not the default.
68
86
 
69
87
  **Default path (brownfield) — create-vs-update menu:**
70
- 1. **Add scope to this project** (default) — load existing project identity + preparatory artifacts; **skip** the greenfield "what are we building?" interview; gather only the new scope; emit **one** proposed scope record; apply the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light) on write
88
+ 1. **Add scope to this project** (default) — load existing project identity + preparatory artifacts; **skip** the greenfield "what are we building?" interview only after capturing an explicit product or slice description; gather only the new scope; emit **one** proposed scope record; apply the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light) on write
89
+ - ! On identity-only Add-scope: capture a product or slice description, or do not emit a proposed xBRIEF. ⊗ Synthesize the first scope from Overview / directory name / init seed. Swarm's `xbrief/proposed/` scan is in scope for that skip.
71
90
  2. **Update project definition** — run a **delta** interview against existing identity; apply the [Spec-Generating Guard](./artifact-guards.md#spec-generating-guard-full); **merge** narratives (prefer enrich/merge when the user declines replace)
72
91
  3. **Replace specification (scrap)** — full recreate equivalent to greenfield Proceed; **only** after explicit affirmative (`yes` / `confirmed`); vague replies (`proceed`, `ok`, `go ahead`) are **not** acceptance
73
92
  - ! On confirmed scrap, continue to the [Sizing Gate](#sizing-gate) as a full create path
@@ -147,7 +166,32 @@ Ready to generate the specification. Before we proceed, would you like to:
147
166
  10. Back
148
167
  ```
149
168
 
150
- **Brownfield:**
169
+ **Identity-only** (PROJECT-DEFINITION exists; empty `plan.items`; no convention-valid scopes) — same options as setup Phase 3; Proceed is the default:
170
+
171
+ ```
172
+ This repo has project identity but no scopes yet. Before we proceed:
173
+
174
+ 1. Proceed to specification (default) — ask what to build; full create path
175
+ 2. Add scope to this project — keep identity; requires an explicit product or slice description
176
+ 3. Update project definition — delta interview; merge narratives (Spec-Generating Guard)
177
+ 4. Replace specification (scrap) — requires explicit yes/confirmed; full recreate
178
+ 5. Process-only (keep Phase 2 identity) — leave strategy; no new scope; no spec write
179
+
180
+ --- Preparatory (loops back) ---
181
+ 6. Run a research phase — investigate the domain, find libraries, identify pitfalls
182
+ 7. Run a discuss phase — lock key decisions using Feynman technique
183
+ 8. Run a probe phase — adversarially stress-test the plan; surface assumptions, edge cases, and risks
184
+ 9. Run a map phase — analyze existing codebase conventions
185
+
186
+ --- Switch strategy ---
187
+ 10. Switch to yolo — auto-pilot picks all answers
188
+ 11. Switch to speckit — formal spec process with story readiness before implementation
189
+ 12. Other (specify)
190
+ 13. Discuss
191
+ 14. Back
192
+ ```
193
+
194
+ **Brownfield** (scoped):
151
195
 
152
196
  ```
153
197
  This repo already has a project definition and/or scopes. Before we proceed:
package/tasks/verify.yml CHANGED
@@ -113,7 +113,9 @@ tasks:
113
113
  - task: :engine:_ts-build
114
114
  dir: '{{.USER_WORKING_DIR}}'
115
115
  cmds:
116
- - node "{{.DEFT_ROOT}}/packages/core/dist/docs/docs-impact.js" --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}
116
+ - task: :engine:invoke
117
+ vars:
118
+ ENGINE_CMD: 'docs-impact --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
117
119
 
118
120
  license-sync:
119
121
  desc: "Drift guard for root LICENSE ↔ content/LICENSE.md and published package.json license fields (#2902). Three-state exit (0 clean / 1 drift / 2 config). Framework-source only."
@@ -307,8 +309,28 @@ tasks:
307
309
  vars:
308
310
  ENGINE_CMD: 'verify:scope-provenance --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
309
311
 
312
+ evaluator-surface:
313
+ desc: "Declared evaluator-surface diff gate (#4386 / #3156): fail when Taskfile.yml, tasks/verify.yml, gate-lists, coverage config, or the detector itself changes without xbrief/evaluator-surface-disposition.json covering those paths. Disclosure only -- a commit-body issue/PR URL is not #3164 authorization. Prior color is unobserved. Flags: --base-ref / --staged / --path / --quiet. Three-state exit (0 skip or disclosed / 1 missing disposition / 2 config)."
314
+ dir: '{{.USER_WORKING_DIR}}'
315
+ deps:
316
+ - task: :engine:_ts-build
317
+ cmds:
318
+ - task: :engine:invoke
319
+ vars:
320
+ ENGINE_CMD: 'verify:evaluator-surface --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
321
+
322
+ consumer-test-lane:
323
+ desc: "Consumer declared-test-command lane (#4386): run plan.policy.testCommand or package.json scripts.test. Skip when undeclared -- do not invent go test ./... or a shipped-library default. Does not replace verify:ac (PRODUCT_FIRST_AC_GATE). Flags: --quiet. Three-state exit (0 skip or pass / 1 declared command failed / 2 config)."
324
+ dir: '{{.USER_WORKING_DIR}}'
325
+ deps:
326
+ - task: :engine:_ts-build
327
+ cmds:
328
+ - task: :engine:invoke
329
+ vars:
330
+ ENGINE_CMD: 'verify:consumer-test-lane --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
331
+
310
332
  consumer-check-contract:
311
- desc: "Consumer check-composition contract (#3145): fail when tasks/verify.yml or check aggregate omit required enforcement gates (verify:test-boundary, verify:scope-provenance, verify:consumer-check-contract). CI omissions warn by default. Flags: --framework-source / --enforce / --warn / --quiet. Three-state exit (0 clean or warn / 1 missing / 2 config)."
333
+ desc: "Consumer check-composition contract (#3145): fail when tasks/verify.yml or check aggregate omit required enforcement gates (verify:test-boundary, verify:scope-provenance, verify:consumer-check-contract, verify:evaluator-surface). CI omissions warn by default. Flags: --framework-source / --enforce / --warn / --quiet. Three-state exit (0 clean or warn / 1 missing / 2 config)."
312
334
  dir: '{{.USER_WORKING_DIR}}'
313
335
  deps:
314
336
  - task: :engine:_ts-build
@@ -96,7 +96,7 @@ Populate `selected_backend` OR `routing_policy` (or both when the operator sets
96
96
 
97
97
  **Role-boundary expectations (all providers):** the same boundaries apply whether the worker runs on Composer, Grok Build, Cursor/cloud, Claude Code, OpenClaw, or a future adapter:
98
98
 
99
- - ! `leaf-implementation` workers implement scoped xBRIEF work in their assigned worktree only -- gates (`task check`, file-scope audit, Greptile review cycle) are model-agnostic and MUST still pass.
99
+ - ! `leaf-implementation` workers implement scoped xBRIEF work in their assigned worktree only -- gates (prefer `deft check`; else tree-correct `task deft:check` on include-only consumers or `task check` in framework source; file-scope audit; Greptile review cycle) are model-agnostic and MUST still pass. These are one gate, not two sequential runs. Do not add a fourth probe (#2893 / #4379).
100
100
  - ! **Spawned mutating workers take their own worktree (#4066 / #4295).** Implement-class spawn must dest-place before occupancy claim. Grok `spawn_subagent` dest is `cwd` only (cannot rewrite PreToolUse input). Claude/Codex keep `isolation=worktree` or a linked path. Cursor Task has no local dest field — dest-placing is a dest-rooted window (nursery inherit) or `@cursor/sdk` `Agent.create({ local: { cwd } })`; do not advertise Task dest keys. Sharing the primary checkout with a live occupant is refuse, not `occupancy:grant` across hosts. Master/primary occupancy is the exception (`release-cut`, `policy-restore`, operator-directed default-branch work). `--read-only` never claims. On DONE/terminal the dispatcher compare-and-releases the recorded child tree (incarnation + parent-id); do not steal the parent's lease to recover.
101
101
  - ! `orchestrator`, `review-monitor`, and `merge-release` roles MUST run on strong or review-capable agents; dispatchers MUST NOT route these roles to cheap leaf backends.
102
102
  - ⊗ Route a cheap leaf backend onto the merge cascade, Phase 5->6 release gate, conflict-resolution rebase, or review-cycle merge-ready decision -- these are irreversible-damage surfaces that stay on the strong tier regardless of provider.
@@ -3,7 +3,7 @@
3
3
 
4
4
  Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
5
5
 
6
- ! If any .deft/core/.agents/skills/ path here cannot be read (missing, stale, or a redirect stub), read .deft/core/QUICK-START.md and follow it it refreshes this section idempotently for the current version.
6
+ ! If any .deft/core/.agents/skills/ path here cannot be read (missing, stale, or a redirect stub), recover (#4090): `directive doctor`, else `npm i -g @deftai/directive@<pin>` (package.json) then doctor. never a payload path.
7
7
 
8
8
  ## Temporary test kill-switch (#3039)
9
9
 
@@ -12,12 +12,12 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
12
12
 
13
13
  ## Hook runtime unavailable (#3785)
14
14
 
15
- ! Opaque non-zero exit (usually 127) on every mutation = `deft-hook` is not executable on this host, not a Directive deny — no Directive code ran, and no in-session flag reaches it. Out of band: `deft policy:disable-host-hooks --host cursor --confirm`, or install the runtime (`npm i -g @deftai/directive`). Depth: `.deft/core/docs/hook-runtime-unavailable.md`.
15
+ ! Opaque non-zero exit (usually 127) on every mutation = `deft-hook` is not executable on this host, not a Directive deny — no Directive code ran, and no in-session flag reaches it. Out of band: `deft policy:disable-host-hooks --host cursor --confirm`, or install the runtime (`npm i -g @deftai/directive@<pin>`). Depth: `.deft/core/docs/hook-runtime-unavailable.md`.
16
16
  ⊗ Hand-edit `failClosed` in `.cursor/hooks.json` — the next `deft update` rewrites it and silently re-arms the lockout.
17
17
 
18
18
  ## Session routing (#2176)
19
19
 
20
- ! **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). Occupancy (#3433/#3611/#3755/#3926): bearer-id, not auth/lineage; `occupancy:grant` → `commands.md`. ? `deft session:start -- --read-only` (#2176).
20
+ ! **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 (#2273) #4090 (`directive doctor`, then `npm i -g @deftai/directive@<pin>`) ⊗ never a payload path; 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). Occupancy (#3433/#3611/#3755/#3926): bearer-id, not auth/lineage; `occupancy:grant` → `commands.md`. ? `deft session:start -- --read-only` (#2176).
21
21
 
22
22
  ## Session-start ritual (#1149)
23
23
 
@@ -73,9 +73,10 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
73
73
  ! **Default always-pins:** `deft-directive-build`, `deft-directive-pre-pr`, `deft-directive-review-cycle`, `deft-directive-swarm` — read each `SKILL.md` when that work type starts.
74
74
  ! Policy-anchored review-response (#3452): HEAD policy before out-of-model. Depth: review-cycle SKILL.
75
75
  ⊗ Pin entire language packs, deployment docs, or framework bulk into AGENTS.md — pins are for false-negative-sensitive process gates only (#2508).
76
- ! **Dual stop (#2442):** multi-iteration work MUST have success + failure/budget stop (max iters / no-progress / budget); single-turn exempt; halt with operator-visible report; ⊗ thrash. Defaults: build, swarm, review-cycle skills. See main.md Dual Stop Rule. Ledger #3143 (`packages/core/src/delivery-attempt/`).
76
+ ! **Dual stop (#2442):** multi-iteration work MUST have success + failure/budget stop (max iters / no-progress / budget); single-turn exempt; halt with operator-visible report; ⊗ thrash. Defaults: build, swarm, review-cycle skills. See main.md Dual Stop Rule. Ledger #3143.
77
77
  ## Rule Authority [AXIOM]
78
78
  ! Prefer `task deft:*` over AGENTS.md prose. See main.md.
79
+ ! Merge chokepoint (#4379 / #2893): prefer `deft check`; else `task deft:check` on include-only consumers. One gate, not two runs.
79
80
  ## Thin Fail-Closed Design (#3265)
80
81
  ! One fail-closed `task deft:*` check + one remediation. See main.md.
81
82
  ## Writing bar (#3368)
@@ -131,8 +132,8 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
131
132
 
132
133
  ## Branch policy & branch verification
133
134
 
134
- ! Feature branches — `deft verify:branch`, `deft verify:forward-coverage` (90% warn-first changed-branch coverage, not the 75 floor, #3514), `deft coverage:hotspots`, hooks, `deft check` (#746 / #747) — `.deft/core/scm/github.md` § Branch policy.
135
- ! Test placement + scope provenance (#3145) — `deft verify:test-boundary` (warn-only until authored policy), `deft verify:scope-provenance` (`--enforce` is empty-scope only; declared `file_scope` without base approval fails closed), `deft verify:consumer-check-contract` (check composition fails closed; CI omissions warn) (docs: `docs/test-boundary.md`, `docs/scope-provenance.md`, `docs/consumer-check-contract.md`).
135
+ ! Feature branches — `deft verify:branch`, `deft verify:forward-coverage` (90% warn-first, not the 75 floor, #3514), `deft coverage:hotspots`, hooks, `deft check` (#746 / #747) — `.deft/core/scm/github.md` § Branch policy.
136
+ ! Test placement + scope provenance (#3145) — `deft verify:test-boundary` (warn-only until authored policy), `deft verify:scope-provenance` (`--enforce` empty-scope only; declared `file_scope` without base approval fails closed), `deft verify:consumer-check-contract` (composition fails closed; CI omissions warn), `deft verify:evaluator-surface`, `deft verify:consumer-test-lane` (docs: `docs/test-boundary.md`, `docs/scope-provenance.md`, `docs/consumer-check-contract.md`).
136
137
 
137
138
  ## Branch Policy Disclosure (#746)
138
139
 
@@ -145,7 +146,7 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
145
146
  ## Contextual guardrails (runtime-detect lazy-load)
146
147
 
147
148
  ! Detect OS/shell; use portable syntax or explicit shell (#2568). `.deft/core/scm/github.md` (#2157/#2369): PS encoding→`deft verify:encoding` (#798); TS capture; cascade→`deft pr:wait-mergeable-and-merge`; SCM→`deft verify:scm-boundary`.
148
- ! Forge outage (#3422): drop GitHub I/O on attributed outage or repeated 429/502/503; report once to the human; re-probe on `plan.policy.forgeOutageRetryMinutes` (default 30; USER.md Personal wins). Depth: `scm/github.md` § #3180. Complements #3167 / #3180.
149
+ ! Forge outage (#3422): drop GitHub I/O on attributed outage or repeated 429/502/503; report once to the human; re-probe on `plan.policy.forgeOutageRetryMinutes` (default 30; USER.md Personal wins). Depth: `scm/github.md` § #3180.
149
150
 
150
151
  ## Development Process
151
152
 
@@ -612,7 +612,7 @@
612
612
  "sessionRitualStalenessHours": {
613
613
  "type": "integer",
614
614
  "minimum": 1,
615
- "description": "Maximum age, in hours, for .deft/ritual-state.json before the fail-closed session ritual verifier requires task session:start to run again. Default: 4."
615
+ "description": "Maximum age, in hours, for .deft/ritual-state.json before the fail-closed session ritual verifier requires task session:start to run again. Default: 8."
616
616
  },
617
617
  "forgeOutageRetryMinutes": {
618
618
  "type": ["integer", "null"],