@deftai/directive-content 0.110.0 → 0.111.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.
Files changed (35) hide show
  1. package/SKILL.md +13 -13
  2. package/Taskfile.yml +16 -15
  3. package/commands.md +9 -7
  4. package/contracts/design-critique.md +20 -3
  5. package/conventions/machine-generated-banner.md +9 -9
  6. package/conventions/rule-ownership.json +3 -3
  7. package/docs/scope-provenance.md +2 -0
  8. package/main.md +22 -22
  9. package/package.json +1 -1
  10. package/packs/rules/rules-pack-0.1.json +1 -1
  11. package/packs/skills/skills-pack-0.1.json +3 -3
  12. package/skills/deft-directive-design-critique/SKILL.md +2 -1
  13. package/skills/deft-directive-release/SKILL.md +22 -17
  14. package/skills/deft-directive-review-cycle/SKILL.md +45 -12
  15. package/skills/deft-directive-swarm/references/core-phase-0.md +2 -1
  16. package/skills/deft-directive-swarm/references/core-phase-3.md +1 -1
  17. package/skills/deft-directive-swarm/references/host-grok-build.md +15 -1
  18. package/tasks/policy.yml +2 -2
  19. package/tasks/scope.yml +16 -25
  20. package/tasks/triage-actions.yml +3 -4
  21. package/tasks/triage-bootstrap.yml +2 -2
  22. package/tasks/triage-bulk.yml +6 -7
  23. package/tasks/triage-classify.yml +2 -2
  24. package/tasks/triage-queue.yml +2 -2
  25. package/tasks/triage-reconcile.yml +2 -2
  26. package/tasks/triage-scope-drift.yml +2 -2
  27. package/tasks/triage-scope.yml +2 -2
  28. package/tasks/triage-smoketest.yml +3 -3
  29. package/tasks/triage-subscribe.yml +2 -2
  30. package/tasks/triage-summary.yml +2 -2
  31. package/tasks/triage-welcome.yml +2 -2
  32. package/tasks/verify.yml +14 -1
  33. package/templates/agent-prompt-preamble.md +4 -1
  34. package/templates/agents-entry.md +4 -4
  35. package/templates/design-critique-brief.md +2 -0
@@ -12,8 +12,8 @@ version: '3'
12
12
  # declarations -- user-facing flags (`--label`, `--milestone`, `--issue`,
13
13
  # `--issue-note`, `--actor`) are forwarded via {{.CLI_ARGS}}.
14
14
  #
15
- # Companion script: scripts/triage_subscribe.py (+ shim).
16
- # Companion tests: tests/test_triage_subscribe.py.
15
+ # Handler: packages/cli/src/triage-subscribe.ts via engine:invoke (packages/cli/dist).
16
+ # Help registry: packages/core/src/triage/help/registry-data.ts (edit in place).
17
17
 
18
18
  vars:
19
19
  DEFT_ROOT: '{{joinPath .TASKFILE_DIR ".."}}'
@@ -12,8 +12,8 @@ version: '3'
12
12
  # `--no-history`, `--json`) are forwarded via {{.CLI_ARGS}} and go-task's
13
13
  # incremental-build cache layer would silently swallow them.
14
14
  #
15
- # Companion script: scripts/triage_summary.py
16
- # Companion tests: tests/test_triage_summary.py
15
+ # Handler: packages/cli/src/triage-summary.ts via engine:invoke (packages/cli/dist).
16
+ # Help registry: packages/core/src/triage/help/registry-data.ts (edit in place).
17
17
  # Pattern reference: tasks/triage-scope.yml (D12 / #1131 / merged via #1190).
18
18
 
19
19
  vars:
@@ -13,8 +13,8 @@ version: '3'
13
13
  # `--no-subprocess`) are forwarded via {{.CLI_ARGS}} and go-task's
14
14
  # incremental-build cache layer would silently swallow them.
15
15
  #
16
- # Companion script: scripts/triage_welcome.py (+ scripts/_triage_welcome_cli.py)
17
- # Companion tests: tests/test_triage_welcome.py
16
+ # Handler: packages/cli/src/triage-welcome.ts via engine:invoke (packages/cli/dist).
17
+ # Help registry: packages/core/src/triage/help/registry-data.ts (edit in place).
18
18
  # Pattern reference: tasks/triage-summary.yml (D2 / #1122).
19
19
 
20
20
  vars:
package/tasks/verify.yml CHANGED
@@ -369,6 +369,19 @@ tasks:
369
369
  vars:
370
370
  ENGINE_CMD: 'codebase-map-fresh --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
371
371
 
372
+
373
+ spec-prd-fresh:
374
+ desc: "Fail-closed SPECIFICATION.md / PRD.md render-freshness gate (#4086). Re-renders to a buffer and fails on banner or projection diff. Banner canon and full projection freshness are separate assertions. Modeled on verify:codebase-map-fresh."
375
+ dir: '{{.USER_WORKING_DIR}}'
376
+ deps:
377
+ - task: :engine:_ts-build
378
+ # Per conventions/task-caching.md: no sources/generates because this gate
379
+ # forwards project-root through CLI_ARGS.
380
+ cmds:
381
+ - task: :engine:invoke
382
+ vars:
383
+ ENGINE_CMD: 'verify:spec-prd-fresh --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
384
+
372
385
  session-ritual:
373
386
  desc: "Fail-closed session ritual verifier (#1348). Flags: --tier quick|gated / --json. Set DEFT_SESSION_RITUAL_SKIP=1 for headless workers and CI."
374
387
  dir: '{{.USER_WORKING_DIR}}'
@@ -401,7 +414,7 @@ tasks:
401
414
  ENGINE_CMD: 'verify:tools {{.CLI_ARGS}}'
402
415
 
403
416
  scm-boundary:
404
- desc: "Detection-bound gate against raw `gh` / `ghx` subprocess calls outside `scripts/scm.py` (#1145 / N5). Scans verb-layer Python files (`scripts/triage_*.py`, `scripts/scope_*.py`, `scripts/slice_*.py`, `scripts/_triage_*.py`, `scripts/_scope_*.py`, `scripts/resume_conditions.py`, `scripts/issue_ingest.py`) and fails loud when any of them invoke `gh` directly instead of going through `scm.call(source, verb, args)`. Three-state exit (0 clean / 1 violations / 2 config error). Document an exception via `--allow-list <path>` (file with newline-separated glob patterns)."
417
+ desc: "Detection-bound gate against raw `gh` / `ghx` subprocess calls (#1145 / N5). TypeScript verbs route through packages/core/src/scm/call.ts. The scanner still globs retired scripts/triage_*.py paths (vacuous; owner packages/core/src/verify-source/scm-boundary.ts SCOPE_GLOBS). Three-state exit (0 clean / 1 violations / 2 config error). Document an exception via `--allow-list <path>`."
405
418
  dir: '{{.USER_WORKING_DIR}}'
406
419
  deps:
407
420
  - task: :engine:_ts-build
@@ -97,6 +97,7 @@ Populate `selected_backend` OR `routing_policy` (or both when the operator sets
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
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.
100
+ - ! **Spawned mutating workers take their own worktree (#4066).** Implement-class spawn must carry `isolation=worktree` or a linked `worktree_path`/`cwd` before occupancy claim. 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. Grok `spawn_subagent` cannot rewrite PreToolUse input -- pass cwd to the reserved worktree.
100
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.
101
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.
102
103
 
@@ -486,10 +487,12 @@ These rules bind **orchestrators** dispatching implementation, fix, or review-cy
486
487
 
487
488
  **Worker-owns-lifecycle (Gap C):**
488
489
 
489
- - ! When dispatching an implementation worker, the dispatch envelope MUST declare the unit-of-work boundary explicitly: `stop-at: pr-open` (worker opens PR and exits) OR `drive-to: merge-ready` (worker owns PR + Greptile review cycle + fix batches through merge-ready as ONE unit of work, spawning its own review poller per `skills/deft-directive-review-cycle/SKILL.md` monitoring tiers). Default for story implementation dispatches is `drive-to: merge-ready`.
490
+ - ! When dispatching an implementation worker, the dispatch envelope MUST declare the unit-of-work boundary explicitly: `stop-at: pr-open` (worker opens PR and exits) OR `drive-to: merge-ready` (worker owns PR + Greptile review cycle + fix batches through merge-ready as ONE unit of work, following `skills/deft-directive-review-cycle/SKILL.md` monitoring tiers). On hosts whose leaves cannot nest a review-monitor (Cursor #2797, Claude Code #3134, Grok Build #4130), merge-ready means blocking `pr:watch` in **this** process -- not spawning a child poller. Default for story implementation dispatches is `drive-to: merge-ready`.
490
491
  - ! **Envelope selection SLA (#3153):** Choose the boundary before spawn using the swarm decision tree (`skills/deft-directive-swarm/references/core-phase-0.md` — capacity stall, conf-only residual, wall-clock budget, large multi-gate, host nest limits). Happy-path default remains `drive-to: merge-ready`. A **deliberate** `stop-at: pr-open` is valid only with an immediate partner merge-path owner per `skills/deft-directive-review-cycle/SKILL.md` § Partner merge-path (babysit / Approach 1 lease / parent-retained — not freestyle global babysit). Under human-merge policy, that owner (or an explicit handoff recipient) remains responsible through merge + `scope:complete` — do not stand down at CLEAN alone. Consumer pin: `templates/agents-entry.md` § Envelope selection SLA. Silent PR-open handback for a worker already scoped merge-ready remains **forbidden**.
491
492
  - ! **Cursor Task ownership split (#2797 / #2814):** A Cursor `Task` implementation leaf MUST NOT spawn another Cursor `Task` review-monitor: nested Task (leaf spawning leaf) is unsupported/unreliable. A Cursor `drive-to: merge-ready` leaf instead owns a blocking `task pr:watch -- <N>` in its own process. To use an Approach 1 monitor, scope the leaf `stop-at: pr-open`; the orchestrator that owns the Task primitive then launches the sibling monitor and runs `task review-monitor:register -- --pr <N> --monitor-agent-id <id> --platform-primitive cursor-task` (GitHub sticky `<!-- deft:review-owner -->` lease — not local JSON).
492
493
  - ⊗ Let a Cursor leaf background `task pr:watch` and claim review monitoring is active. The process dies with the leaf and has no GitHub review-owner lease; treat that claim as a regression/eval failure and let `task verify:review-monitor -- --pr <N>` fail closed.
494
+ - ! **Grok Build ownership split (#4130 / #2797 analogue):** A `spawn_subagent` implementation leaf MUST NOT nested-spawn a review-monitor or any other `spawn_subagent`. 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 instead owns a blocking `deft pr:watch <N>` (or `task deft:pr:watch -- <N>`) in its own process, then `pr:merge-ready` / merge in the same loop. To use an Approach 1 monitor, scope the leaf `stop-at: pr-open`; the orchestrator that owns `spawn_subagent` then launches the sibling monitor and registers `--platform-primitive spawn_subagent`. If the leaf needs another agent, it stops and reports `BLOCKED`.
495
+ - ⊗ Tell a grok-build leaf to spawn its own review poller, or let it nested-spawn `spawn_subagent` and claim monitoring is active.
493
496
  - ! **Post-merge scope lifecycle (#2321 / Gap C / #3429 / #3476):** Workers scoped `stop-at: pr-open` MUST NOT run `task scope:complete` before exit — their activation checkpoint rides into master on merge. The **orchestrator** (or Phase 6 `task swarm:finalize-cohort` / `task swarm:complete-cohort` on the headless path) MUST run `task scope:complete` or `task scope:cancel` for each shipped story xBRIEF after its PR merges. Workers scoped `drive-to: merge-ready` (or `drive-to: merge`) MUST include `task scope:complete` on their active xBRIEF as part of the same unit of work (after merge when appropriate). After merge (or observing merge) of issue `#N`, run `task verify:orphan-active -- --issue N`. Exit `0` is required before `DONE`. Exit `1` shipped → run the printed `task scope:complete -- <path>`. Exit `1` unresolved lookup → retry / emit `BLOCKED`; ⊗ complete unfinished scope. After `scope:complete`, `task verify:completed-tracked -- --issue N` MUST be exit `0` against `origin/<deliveryBranch>` (not feature-worktree HEAD) before `DONE` (#3476). Exit `1` missing tracked artifact → not DONE; remediate with `task swarm:finalize-cohort` or a lifecycle PR. `scope:complete` stays filesystem-only — ⊗ teach every leaf to commit on master.
494
497
  - ! Workers scoped `drive-to: merge-ready` MUST drive to merge-ready in their own tool loop — pre-PR, push, PR open, review-cycle poll/fix loop, and the #1259 Step 6 fail-closed exit — without handing back at PR-open for the orchestrator to re-dispatch separate leaf agents for review or fixes.
495
498
  - ⊗ Re-dispatch a separate review-monitor or fix agent after an implementation worker exits at PR-open when the original envelope scoped `drive-to: merge-ready` — that split recreates cross-agent state-handoff hazards and terminal lifecycle gaps (#1878 / Gap C).
@@ -29,9 +29,9 @@ Deft is installed in .deft/core/. Full guidelines: .deft/core/main.md
29
29
 
30
30
  ## xBRIEF layout (#2034 / #2110)
31
31
 
32
- Legacy `vbrief/`; `deft migrate:xbrief` (v0.6→v0.8). New writes `"version": "0.8"`. Depth: `main.md` (#3600).
33
- ! Completed xBRIEFs are record of *what is*, zero authority over *what to build next* (#3383). Current contract = active xBRIEF + human operator live instruction. Depth: `main.md` Persistence; build skill declare-the-contract / halt-and-ask.
34
- ⊗ Treat a completed xBRIEF as the next-build contract.
32
+ ! Writes: `./xbrief/` (`PROJECT-DEFINITION.xbrief.json`, `plan.xbrief.json`, `specification.xbrief.json`) as `"xBRIEFInfo"` `"version": "0.8"`. Legacy `vbrief/`; `deft migrate:xbrief`.
33
+ ! Completed xBRIEFs are record of *what is*, zero authority over *what to build next* (#3383). Current contract = active xBRIEF + human operator live instruction.
34
+ ⊗ Treat a completed xBRIEF as the next-build contract. ⊗ Emit `"version": "0.6"` on new writes.
35
35
 
36
36
  ## Unmanaged project header (#2065)
37
37
 
@@ -92,7 +92,7 @@ Legacy `vbrief/`; `deft migrate:xbrief` (v0.6→v0.8). New writes `"version": "0
92
92
 
93
93
  ## Envelope selection SLA (#3153)
94
94
 
95
- ! Default story / through-merge unit of work is `drive-to: merge-ready`. Deliberate `stop-at: pr-open` is allowed only when a **partner merge-path owner** is planned (review-cycle babysit / Approach 1 lease / parent-retained) for Greptile + CI + post-merge `scope:complete` — triggers: capacity stall, wall-clock budget, large multi-gate, host nest limits (swarm Phase 0 decision tree). Depth: `deft-directive-swarm` + `deft-directive-review-cycle` partner merge-path.
95
+ ! Default story / through-merge unit of work is `drive-to: merge-ready`. Deliberate `stop-at: pr-open` is allowed only when a **partner merge-path owner** is planned (review-cycle babysit / Approach 1 lease / parent-retained) for Greptile + CI + post-merge `scope:complete` — triggers: capacity stall, wall-clock budget, large multi-gate, host nest limits (Cursor / Claude Code / Grok Build #4130; swarm Phase 0 decision tree). Depth: `deft-directive-swarm` + `deft-directive-review-cycle` partner merge-path.
96
96
  ! Under human-merge policy, a **durable** owner (parent/monitor sticky lease or Phase 6 closer) MUST remain for post-merge `scope:complete` — CLEAN alone is not lifecycle complete; ⊗ stand down at CLEAN with no reachable owner.
97
97
  ⊗ Silent PR-open handback for a worker already scoped `drive-to: merge-ready`.
98
98
  ⊗ `stop-at: pr-open` without a named babysit / merge-path owner, or dual review-monitor leases on recovery (#3044 / #2261).
@@ -12,6 +12,7 @@ Dispatch envelope skeleton for one critic or synthesis pass. Fill the fields. Re
12
12
  - Critic role (fresh | resume):
13
13
  - Id ceiling (GitHub comment id, inclusive):
14
14
  - SHA at dispatch:
15
+ - Run posture (`arc-mode: direct` | `arc-mode: checkout`):
15
16
  - Target (work issue or umbrella):
16
17
  - Audit targets (marker ids, comma-separated, or `none`; ids only, no parent rationale):
17
18
  - Seat families (N≥3: three claimed families before spawn):
@@ -38,6 +39,7 @@ Read, do not restate:
38
39
  |---|---|
39
40
  | Gate (ADR-005) | Stop 1 — Gate |
40
41
  | Stop 1 `refutation-target:` | Stop 1 — Gate |
42
+ | Run posture `arc-mode:` | Stop 1 — Gate |
41
43
  | Variant selection | Stop 2 — Variant selection |
42
44
  | Parent-facing dispatch rules | Parent-facing dispatch rules |
43
45
  | Critic method | Critic method |