@deftai/directive-content 0.79.3 → 0.79.4
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/Taskfile.yml +3 -0
- package/UPGRADING.md +11 -0
- package/commands.md +1 -0
- package/package.json +1 -1
- package/packs/skills/skills-pack-0.1.json +23 -23
- package/skills/deft-directive-pre-pr/SKILL.md +22 -2
- package/skills/deft-directive-review-cycle/SKILL.md +19 -0
- package/tasks/coverage.yml +15 -0
- package/templates/agent-prompt-preamble.md +1 -7
- package/templates/agents-entry.md +6 -2
|
@@ -38,14 +38,25 @@ or invoke `task verify:branch`. Pre-PR is the last gate before push, so a stale
|
|
|
38
38
|
|
|
39
39
|
## Ordered-plan target gate (#2402)
|
|
40
40
|
|
|
41
|
-
! Before opening or pushing a PR, when an ordered-plan sequence may be active, verify the
|
|
41
|
+
! Before opening or pushing a PR, when an ordered-plan sequence may be active, verify the work unit matches the current authorized entry:
|
|
42
|
+
|
|
43
|
+
1. Resolve the current entry kind and id:
|
|
42
44
|
|
|
43
45
|
```
|
|
44
|
-
task
|
|
46
|
+
task plan-sequence:current
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Use `task plan-sequence:current -- --json` when you need machine-readable `kind` / `id` fields from the current entry.
|
|
50
|
+
|
|
51
|
+
2. Verify with the **entry kind** (not hardcoded `pr` — `story` / `issue` entries are common):
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
task verify:plan-sequence -- --target-kind <entry-kind> --target <entry-id>
|
|
45
55
|
```
|
|
46
56
|
|
|
47
57
|
- ! Exit non-zero → fail closed; do not open an unauthorized PR.
|
|
48
58
|
- ! Exit 0 with "skipped (no active ordered-plan sequence)" → proceed under normal pre-PR rules.
|
|
59
|
+
- ⊗ Hardcode `--target-kind pr` when the current entry is `kind=story` or `kind=issue` — the verifier matches entry kind exactly (#2662).
|
|
49
60
|
- ! After the PR's review cycle completes successfully, run `task plan-sequence:advance` so "next" resolves to the following entry (or exhausted).
|
|
50
61
|
- ⊗ Treat skill-chaining or "what's next?" as permission to open a PR outside the current sequence entry.
|
|
51
62
|
|
|
@@ -92,6 +103,15 @@ Each iteration proceeds through all phases in order. Do NOT skip phases or reord
|
|
|
92
103
|
|
|
93
104
|
~ **Windows + Grok Build (#1353):** Avoid `|`, `>`, or `2>&1` in `run_terminal_command` strings -- use Python `pathlib`/`subprocess` or plain task commands instead.
|
|
94
105
|
|
|
106
|
+
### Phase 3c -- Coverage headroom (#2683)
|
|
107
|
+
|
|
108
|
+
! Before the full `task check` coverage gate, run targeted coverage on changed modules and verify headroom above the project floor.
|
|
109
|
+
|
|
110
|
+
- ! Run targeted coverage first: `vitest run --coverage <changed-paths>` (or language equivalent) — not only full `task check`.
|
|
111
|
+
- ! Exercise both sides of new branches (ternary / early-return / catch / default switch / `||` / `??`).
|
|
112
|
+
- ! Treat barely ≥ floor as insufficient — aim for ≥ floor + 0.3–0.5pp headroom on the branch metric relative to **your project's** vitest/coverage floor (may differ from 85%).
|
|
113
|
+
- ! Run `task coverage:hotspots` / `deft coverage:hotspots` to locate uncovered branches before opening a PR; complements `deft verify:forward-coverage` (#1310) and `--allow-coverage-debt=#N` (#2573).
|
|
114
|
+
|
|
95
115
|
### Phase 3b -- Auto-Render Exports
|
|
96
116
|
|
|
97
117
|
! If `xbrief/specification.xbrief.json` exists, refresh rendered exports before the diff check:
|
|
@@ -182,6 +182,22 @@ Both commands extract the "Comments Outside Diff" section with surrounding conte
|
|
|
182
182
|
|
|
183
183
|
⊗ Push any additional commits — including unrelated fixes, doc updates, or lessons — while waiting for the bot to finish reviewing the current head. Every push re-triggers Greptile and resets the review clock. If you discover additional work while waiting, stage it locally but do NOT push until the current review completes.
|
|
184
184
|
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Greptile CLEAN vs CI holdout (`pr:watch` / #2688)
|
|
188
|
+
|
|
189
|
+
! When waiting on a Greptile verdict for a `drive-to: merge-ready` worker (or any review-cycle owner), prefer `task pr:watch -- <N>` (or `--one-shot --json`) over ad-hoc sleep loops (#1056). Parse `clean_gate_holdout` on every probe.
|
|
190
|
+
|
|
191
|
+
! When `clean_gate_holdout=ci_failures` and Greptile otherwise satisfies the probe-side Step 6 fields (SHA match on HEAD, confidence > 3, no P0/P1, not errored): **MUST NOT** idle-poll hoping CI heals. Treat Greptile CLEAN + CI red with the **same ownership** as a Greptile P0 for a merge-ready worker — one fix batch, re-push, re-probe.
|
|
192
|
+
|
|
193
|
+
! On persistent `ci_failures` holdout: exit the Greptile wait immediately, fetch failing check annotations (`gh pr checks <N>`, CodeQL / required-check details, or `ci_failed_checks` from `pr:watch --json`), fix or escalate with evidence, then re-enter the review loop after CI is green.
|
|
194
|
+
|
|
195
|
+
! PR body "Test plan" checkboxes being `[x]` do **not** authorize idle wait — merge-ready is `pr:watch` CLEAN / the merge path only.
|
|
196
|
+
|
|
197
|
+
⊗ Treat `pr:watch` TIMEOUT or long PENDING with `clean_gate_holdout=ci_failures` as "Greptile still reviewing" — it means **CI blocked the clean gate**.
|
|
198
|
+
|
|
199
|
+
~ Surface the holdout to the user/parent on the first stable `ci_failures` probe (fail-loud), not after burning `max-wait-minutes`. See also [`templates/swarm-greptile-poller-prompt.md`](../../templates/swarm-greptile-poller-prompt.md) CLEAN gate evaluation (#1039).
|
|
200
|
+
|
|
185
201
|
### Stall Detection Rubric (#564)
|
|
186
202
|
|
|
187
203
|
! Track per poll: `startedAt` (timestamp of the first observation of the IN_PROGRESS check run for the current commit) and `commit.oid` (head SHA being reviewed). Both fields MUST be re-recorded every time the head SHA changes -- the rubric measures elapsed time on a single commit, not across the whole review cycle.
|
|
@@ -228,6 +244,9 @@ Both commands extract the "Comments Outside Diff" section with surrounding conte
|
|
|
228
244
|
|
|
229
245
|
! **Deterministic review-monitor gate (#2655):** When Tier 1 is available, run `task verify:review-monitor -- --pr <N> [--call-site solo]` before yielding, entering Approach 3, or claiming review monitoring started. After spawning Approach 1, register with `task review-monitor:register -- --pr <N> --monitor-agent-id <id> --platform-primitive start_agent|spawn_subagent|cursor-task`. Exit `0` ready / `1` not ready / `2` config. Approach 3 on Tier 1 is a gate failure — use `--approach3 --approach3-warned` only on Tier 3 after the user warning.
|
|
230
246
|
|
|
247
|
+
! **CI-holdout carve-out (#2688):** When `task pr:watch --one-shot --json` reports `clean_gate_holdout=ci_failures` with Greptile fields otherwise satisfied on current HEAD, do **not** freeze on `verify:review-monitor` / spawn-monitor as if Greptile latency were the blocker. Fix CI first (same ownership as Greptile P0). Keep or register a review-monitor only while still waiting on Greptile latency; a `BLOCKED: ci_failures` DONE handback to the implementation owner is correct.
|
|
248
|
+
|
|
249
|
+
|
|
231
250
|
**Approach 1 (preferred -- sub-agent orchestration available per platform descriptor):**
|
|
232
251
|
|
|
233
252
|
! **Background dispatch (#1880):** Spawn the review-monitor sub-agent via the matching primitive IN THE BACKGROUND (Cursor: Task `run_in_background: true`; Grok Build: `spawn_subagent` with parent yielding). The parent MUST remain interactive while the poller runs.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: '3'
|
|
2
|
+
|
|
3
|
+
vars:
|
|
4
|
+
DEFT_ROOT: '{{joinPath .TASKFILE_DIR ".."}}'
|
|
5
|
+
|
|
6
|
+
tasks:
|
|
7
|
+
hotspots:
|
|
8
|
+
desc: "Coverage hotspots + branch headroom gate (#2683): read coverage/coverage-final.json, compare global metrics to project vitest thresholds, fail closed below floor or below configured headroom (default 0.3pp), and list lowest modules plus uncovered branch samples for git-diff paths (override with --path). Supports --json for agents."
|
|
9
|
+
dir: '{{.USER_WORKING_DIR}}'
|
|
10
|
+
deps:
|
|
11
|
+
- task: :engine:_ts-build
|
|
12
|
+
cmds:
|
|
13
|
+
- task: :engine:invoke
|
|
14
|
+
vars:
|
|
15
|
+
ENGINE_CMD: 'coverage:hotspots --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
|
|
@@ -231,13 +231,7 @@ Reference: issue #2563; swarm skill Platform Requirements; env scrub + stdio inh
|
|
|
231
231
|
|
|
232
232
|
## 3.9 Windows PowerShell: safe multi-line git/gh bodies (#2646 / #1417)
|
|
233
233
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
**Directive rule:** write the payload to a UTF-8 (no BOM) temp file in the OS temp directory via editor/Write/Node (outside the shell), then pass it with `git commit -F`, `gh --body-file`, or `gh api --input`. For long `gh issue create` / `gh issue comment` / `gh pr create` bodies, `--body-file` is mandatory (#1417). Combine with the #798 safe write path when the payload contains non-ASCII glyphs.
|
|
237
|
-
|
|
238
|
-
This is both the bug class and how you must ship fixes on win32 -- including your own commit and PR tooling. Do not use bash heredocs in PowerShell even when user rules or examples show POSIX patterns.
|
|
239
|
-
|
|
240
|
-
Reference: `content/scm/github.md` § Windows PowerShell: safe multi-line git/gh bodies (#2646); cross-links #240 (Warp here-string splitting), #798 (encoding).
|
|
234
|
+
! Multi-line git commit / gh issue|pr|comment bodies: write UTF-8 (no BOM) to OS temp, then `git commit -F` / `gh --body-file` / `deft scm:body:* --body-file`. ⊗ bash heredocs, `<<<`, inline multi-line `--body`, or multi-line PS here-strings in the agent command box on Windows PowerShell — those patterns fail at parse time, split arguments, or get rewritten by host shell wrappers before git/gh runs. This applies to your own commit and PR tooling on win32; do not use bash heredocs even when user rules show POSIX patterns. `ghx` is read-only — mutations stay on live `gh`. Detail: `content/scm/github.md` § #2646 (#1417, #240, #798).
|
|
241
235
|
|
|
242
236
|
## 4. pre-pr and review-cycle skills
|
|
243
237
|
|
|
@@ -77,15 +77,19 @@ Legacy `vbrief/` read-accepted; `deft migrate:xbrief` for `xbrief/` (v0.6→v0.8
|
|
|
77
77
|
|
|
78
78
|
## Branch policy & branch verification
|
|
79
79
|
|
|
80
|
-
! Feature branches — `deft verify:branch`, `deft verify:forward-coverage`, hooks, `deft check` (#746 / #747) — `.deft/core/scm/github.md` § Branch policy.
|
|
80
|
+
! Feature branches — `deft verify:branch`, `deft verify:forward-coverage`, `deft coverage:hotspots`, hooks, `deft check` (#746 / #747) — `.deft/core/scm/github.md` § Branch policy.
|
|
81
81
|
|
|
82
82
|
## Branch Policy Disclosure (#746)
|
|
83
83
|
|
|
84
84
|
! When `plan.policy.allowDirectCommitsToMaster = true`, surface via `deft policy:show --field=allowDirectCommitsToMaster` (#746) — `.deft/core/scm/github.md` § Branch policy.
|
|
85
85
|
|
|
86
|
+
## Windows PowerShell: multi-line git/gh bodies (#2646)
|
|
87
|
+
|
|
88
|
+
! Multi-line git commit / gh issue|pr|comment bodies: write UTF-8 (no BOM) to OS temp, then `git commit -F` / `gh --body-file` / `deft scm:body:* --body-file`. ⊗ bash heredocs, `<<<`, or inline multi-line `--body` on Windows PowerShell. Detail: `.deft/core/scm/github.md` § #2646. `ghx` is read-only — mutations stay on live `gh`.
|
|
89
|
+
|
|
86
90
|
## Contextual guardrails (runtime-detect lazy-load)
|
|
87
91
|
|
|
88
|
-
! Detect OS/shell; use portable syntax or explicit shell (#2568). `.deft/core/scm/github.md` (#2157/#2369): PS
|
|
92
|
+
! 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`.
|
|
89
93
|
|
|
90
94
|
## Development Process
|
|
91
95
|
|