@deftai/directive-content 0.99.0 → 0.100.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/commands.md CHANGED
@@ -267,6 +267,9 @@ Current status: the validation, extractor, provider, registry, generated MAP, an
267
267
  - `task verify:xbrief-conformance` -- validate xBRIEF conformance surfaces.
268
268
  - `task verify:cache-fresh` -- validate cache freshness where required.
269
269
  - `task verify:capacity`, `task verify:wip-cap`, and `task verify:judgment-gates` -- policy/capacity gates.
270
+ - `task verify:orphan-active` -- fail closed when active/running xBRIEFs still point at closed issues or merged PRs (#2321).
271
+ - `task verify:completed-tracked` -- fail closed when closed scoped issues lack a tracked `xbrief/completed/` or `xbrief/cancelled/` artifact on the delivery tip (#3264); remediate with `task swarm:finalize-cohort` or a lifecycle PR. Standalone verb (not part of `task check`); use `--tip HEAD` when validating an in-flight land branch.
272
+ - `task verify:literal-ac` -- run stated acceptance commands from the active (or `--xbrief`) scope artifact **verbatim** before done (#3267); same flags/cwd; fail closed on non-zero. `--capture-only` lists resolved commands without executing. Standalone (not part of `task check`); required on ceremony dial rapid/minimal. Extends #973.
270
273
  - `task coverage:hotspots` / `deft coverage:hotspots` -- read the latest coverage report, compare global metrics to the project's vitest thresholds, fail closed below the branch floor or below configured headroom (default 0.3pp), and list lowest modules plus uncovered branch samples for git-diff paths (`--json` for agents). Complements `deft verify:forward-coverage` (#1310) and `--allow-coverage-debt=#N` (#2573); does not replace them.
271
274
 
272
275
  Use `task --list` for the exact current verify namespace.
@@ -299,15 +302,17 @@ When the workflow needs an Approach 1 monitor, scope the Cursor leaf `stop-at: p
299
302
 
300
303
  `directive init` and `deft update` idempotently merge Directive-owned entries into `.claude/settings.json`, `.grok/hooks/deft.json`, `.cursor/hooks.json`, and `.codex/hooks.json` while preserving unrelated settings. `SessionStart` refreshes resume bookkeeping on a non-blocking path. `PreToolUse` uses the lightweight `deft-hook` entrypoint rather than booting the full CLI router, reducing cold hook latency while retaining the same fail-closed ritual, scope, and runtime-authority decisions. Cursor `ApplyPatch` shares the direct-write registration, so each matched edit invokes one hook process. Cursor `preToolUse` deposits set `failClosed: true`, so allow decisions emit `{"permission":"allow"}` — empty stdout is treated as hook failure and would block Write tools. A second `PreToolUse` matcher covers spawn/Task tools (`Task`, `SubagentStart`, `spawn_subagent`, `start_agent`, `CreateAgent`) with the pre-`start_agent` gate stack for **implementation** spawns; explore and ephemeral postures skip active-xBRIEF (see three postures below).
301
304
 
302
- - **Spawn postures (#1185 / #3080):** PreToolUse classifies Task/spawn by **structural markers** (not free-text prompt NLP). Unmarked / default Multitask (`generalPurpose`) is treated as **implement** (fail closed). Session-level **assist** posture for direct scratch writes is the #1802 twin — see § Assist / research posture (#1802).
305
+ - **Spawn postures (#1185 / #3080 / #3259):** PreToolUse classifies Task/spawn by **structural markers** (not free-text prompt NLP). Unmarked / default Multitask (`generalPurpose`) is treated as **implement** (fail closed) unless session assist env is set (#3259). Session-level **assist** posture is the #1802 twin for scratch writes **and** for spawn when env markers apply — see § Assist / research posture (#1802).
303
306
 
304
307
  | Posture | Markers | Active xBRIEF | Typical work |
305
308
  |---|---|---|---|
306
309
  | **Implement** | default / `generalPurpose` / implement leaf / `drive-to: merge-ready` | **Required** | Features, bugs, PRs, scope lifecycle |
307
310
  | **Explore** | `subagent_type` or `worker_role` = `explore` (#1185) | Not required | Read-only research, orientation |
308
- | **Ephemeral** | `worker_role` (or `subagent_type`) ∈ {`ephemeral`, `docs`, `assist`} (#3080) | Not required | Brochure, pitch, disposable analysis notes |
311
+ | **Ephemeral** | Structural `worker_role`/`subagent_type` ∈ {`ephemeral`, `docs`, `assist`} (#3080); **or** session assist env `DEFT_SESSION_POSTURE` ∈ assist-set / `DEFT_HOOK_ASSIST=1` (#3259) | Not required | Brochure, pitch, disposable analysis, **local-dev ops** (`docker compose`, `pnpm dev`) |
309
312
 
310
- Gate order: explore allow (`spawn-explore-ready`) → ephemeral allow (`spawn-ephemeral-ready`) → else implementation stack (`inspectMutationGates`). If an ephemeral marker conflicts with implement envelope signals (`drive-to: merge-ready`, `worker_role: leaf-implementation`, swarm implement dispatch), **implement wins**. Ephemeral allowance does **not** authorize push/merge/deploy or skip `runtimeAuthority` / human-merge gates. **Anti-pattern:** invent a fake `scope:activate` only to dispatch brochure/docs work — use `worker_role: ephemeral` (or continue in the parent) instead. Deny text for missing active scope on implement spawns lists activate \| explore \| ephemeral recoveries.
313
+ Gate order: explore allow (`spawn-explore-ready`) → ephemeral allow (`spawn-ephemeral-ready`) → else implementation stack (`inspectMutationGates`). If an ephemeral marker (role field **or** session assist env) conflicts with implement envelope signals (`drive-to: merge-ready`, `worker_role: leaf-implementation`, swarm implement dispatch), **implement wins**. Ephemeral allowance does **not** authorize push/merge/deploy or skip `runtimeAuthority` / human-merge gates.
314
+
315
+ **Cursor Multitask delivery (#3259 residual of #3080):** Cursor often delivers only `subagent_type: generalPurpose` + prompt and cannot set structural `worker_role` fields. Free-text `[worker_role: ephemeral]` in the prompt is **not** sufficient (no NLP). Working Cursor local-dev paths: (1) parent Shell for `docker compose` / `pnpm dev` (no Task spawn gate); (2) session assist env (`DEFT_SESSION_POSTURE=assist` or `DEFT_HOOK_ASSIST=1`) so Multitask Task classifies as ephemeral; (3) hosts that can set structural `worker_role`/`subagent_type` ephemeral. **Anti-pattern:** invent a fake `scope:activate` only for brochure/docs/local-dev. Deny text for missing active scope lists activate \| explore \| ephemeral (structural/session-assist) \| parent Shell recoveries.
311
316
 
312
317
  - **Assist scratch direct writes (#1802):** PreToolUse allows Write/Edit under allowlisted gitignored roots (`.deft-scratch/**`, `temp/**`) when assist/ephemeral classification applies (`DEFT_SESSION_POSTURE=assist`, payload posture, or #3080 role markers) — decision code `write-assist-scratch-ready`. Skips ritual + active-scope; does **not** unlock tracked product paths. Fail closed outside the allowlist or without structural markers. Deny recovery for in-repo scope-not-ready mentions the assist scratch path (do not invent fake `scope:activate` for notes). Full rules: § Assist / research posture (#1802).
313
318
 
@@ -574,6 +579,7 @@ flowchart TD
574
579
  - Step 3 (`Pre-flight vBRIEF lifecycle sync`) fetches GitHub issue states via REST. On HTTP 403 rate-limit exhaustion it sleeps once (capped at 120s) and retries before failing.
575
580
  - When Step 3 still fails with rate-limit exhaustion, stderr includes a `gh api rate_limit` probe (`core.remaining`, reset time) and recovery guidance. After local `task vbrief:validate` (or `task xbrief:validate`) exits 0, operators may pass `--allow-vbrief-drift` to skip Step 3 for that cut — reserved for transient SCM bucket stalls, not unreviewed lifecycle drift.
576
581
  - `task swarm:*` -- readiness, launch, pre-dispatch deny gate (#3228), review-clean verification, and cohort completion.
582
+ - **Operator follow-up after dual-stop / hard stop (#3273):** when a dual-stop or conf-hold halt report lands, re-authorize one residual pass with phrases *pursue residual* / *follow-up hard-stop* / *same as conf-hold* / *continue dual-stopped PR* — steps in `skills/deft-directive-swarm` and `skills/deft-directive-review-cycle` § Operator follow-up after dual-stop / hard stop (not a separate task verb).
577
583
  - `task slice:*` -- feature-slice helpers.
578
584
  - `task policy:*` and `task capacity:*` -- policy inspection and allocation helpers.
579
585
 
package/main.md CHANGED
@@ -85,6 +85,18 @@ Parent epic: #3179 (self-improving under gates). Trajectory / refine constraint:
85
85
 
86
86
  Parent epic: #3179. Extends #782 / #1499 / #3145 verification-independence themes.
87
87
 
88
+ ## Thin Fail-Closed Design (#3265)
89
+
90
+ **Rule:** Prefer one thin, fail-closed deterministic check over long skill process or multi-surface first ships.
91
+
92
+ - ! Prefer **one fail-closed deterministic check** with **one remediation string** for the first ship of a process gap
93
+ - ! Treat skill-only / RFC2119 process closes as **incomplete** when the same rule can fail closed via `task`, doctor, or release preflight
94
+ - ! Prefer **thin closable slices** (optional complexity goes to a follow-up issue) over boil-the-ocean first ships
95
+ - ⊗ Close a process gap with skill MUST text alone when a gate surface exists and is not landed
96
+ - ⊗ Expand first-ship scope to multi-role matrices or multi-surface walls when one check plus one remediation would close the gap
97
+
98
+ See Rule Authority (deterministic > prose). Safety via formal gates: #1200. Gate integrity: #3156. Practice examples: #3237, #3264.
99
+
88
100
  **Decision Making:**
89
101
  - ! Follow established patterns in current context
90
102
  - ~ Question assumptions and probe for clarity
@@ -126,6 +138,7 @@ Loop engineering requires **two** stop conditions on multi-iteration autonomous
126
138
  - #1613 covers STOP when plan **preconditions** fail (reality mismatch). Dual stop covers the case where the plan is still "valid" but the agent must quit after N failed attempts, N identical no-progress outcomes, or a budget limit.
127
139
  - Skills name concrete defaults: `skills/deft-directive-build/SKILL.md` (implement / pre-PR loops), `skills/deft-directive-swarm/SKILL.md` and its Phase 4 / core-ops references (repair / monitor loops).
128
140
  - **Delivery / acceptance mechanical enforcement** (durable attempt ledger, material-progress circuit breaker, cross-revision budgets) is **#3143** — library: `packages/core/src/delivery-attempt/` (`evaluatePreDispatch`, unit ledger under `.deft/delivery-attempts/`). Docs: `content/docs/delivery-attempt.md`. #2442 is the principle + skill defaults; #3143 is the deterministic pre-dispatch gate. Route delivery/acceptance loops through that surface rather than inventing a parallel ledger.
141
+ - **Budget-aware effort / bank-the-pass (#3266)** is the success-side analog: when a hard turn or cost budget is detectable (`DEFT_MAX_TURNS` / `DEFT_MAX_BUDGET` / session:start `effort_budget`), bank the *stated* acceptance pass before self-imposed deepening; scale verification depth with remaining budget; fail-loud (#1006) when deepening is skipped. Core: `packages/core/src/session/effort-budget.ts`; guidance in build and pre-pr skills.
129
142
 
130
143
  **Adaptive Teaching:**
131
144
  - ~ When a recommendation is accepted without question, be concise
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive-content",
3
- "version": "0.99.0",
3
+ "version": "0.100.0",
4
4
  "description": "Shippable Directive framework content in the consumer .deft/core/ layout (C1 flatten), plus the engine surfaces (.githooks/, Taskfile.yml, tasks/) the deposit wires. Python-free per #2022 Phase 3. Refs #11, #1669, #1967.",
5
5
  "license": "MIT",
6
6
  "type": "module",