@deftai/directive-content 0.69.0 → 0.71.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.
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: deft-directive-feedback
3
+ description: >-
4
+ Batched session-end gap escalation for directive consumers. Collects
5
+ friction/gap reports, drafts deduped framework-gap issues against
6
+ deftai/directive, and files upstream only after explicit operator
7
+ confirmation.
8
+ ---
9
+
10
+ Read and follow: skills/deft-directive-feedback/SKILL.md
package/Taskfile.yml CHANGED
@@ -248,6 +248,12 @@ includes:
248
248
  triage-smoketest:
249
249
  taskfile: ./tasks/triage-smoketest.yml
250
250
  optional: true
251
+ # D17 (#1709): `task triage:metrics` trend readout from summary-history.jsonl.
252
+ # Inner task `metrics` is exposed as the user-facing alias `task triage:metrics`
253
+ # in the alias block below.
254
+ triage-metrics:
255
+ taskfile: ./tasks/triage-metrics.yml
256
+ optional: true
251
257
  # Windows maintainer onboarding fragment (#902). Exposes the inner task
252
258
  # `toolchain` as `task setup:toolchain`. Note: the root-level `setup` task
253
259
  # below (git-hooks bootstrap) coexists with `setup:toolchain` because
@@ -295,6 +301,21 @@ includes:
295
301
  capacity:
296
302
  taskfile: ./tasks/capacity.yml
297
303
  optional: true
304
+ # Tier 0 framework-eval surface (#1703). Exposes `task eval:health` --
305
+ # aggregates static self-consistency gates into a versioned health score.
306
+ eval:
307
+ taskfile: ./tasks/eval.yml
308
+ optional: true
309
+ # Gap escalation upstream filing (#1709 child 5). Exposes `task feedback:file` --
310
+ # confirmation-gated, deduped framework-gap issues for consumer projects.
311
+ feedback:
312
+ taskfile: ./tasks/feedback.yml
313
+ optional: true
314
+ # Pull-based value-awareness readbacks (#1709). Inner task `show` is exposed as
315
+ # `task value:show` via the include namespace key.
316
+ value:
317
+ taskfile: ./tasks/value.yml
318
+ optional: true
298
319
  # Pack-slicing surface (#1283 design, #1294 pilot, ADR-001 Layer B). Exposes
299
320
  # `task packs:slice` (named-slice API), `task packs:render` (regenerate the
300
321
  # meta/lessons.md projection), and `task packs:verify-drift` (the drift gate,
@@ -854,6 +875,13 @@ tasks:
854
875
  vars:
855
876
  CLI_ARGS: "{{.CLI_ARGS}}"
856
877
 
878
+ triage:metrics:
879
+ desc: "Trend lines from summary-history.jsonl (#1709 / D17). -- task triage:metrics -- [--window=7d|30d] [--format=text|json]"
880
+ cmds:
881
+ - task: triage-metrics:metrics
882
+ vars:
883
+ CLI_ARGS: "{{.CLI_ARGS}}"
884
+
857
885
  triage:queue:
858
886
  desc: "Print the ranked triage queue (#1128 / D11). -- task triage:queue [-- --repo OWNER/NAME] [--limit N]"
859
887
  cmds:
package/UPGRADING.md CHANGED
@@ -137,16 +137,21 @@ These commands are unrelated — do not confuse them:
137
137
 
138
138
  Current `@deftai/directive` npm releases no longer ship `task migrate:vbrief` or `scripts/migrate_vbrief.py` on the consumer deposit path (#2022 Phase 3). If your project still uses the pre-v0.20 flat document model (authoritative root `SPECIFICATION.md` / `PROJECT.md` without vBRIEF lifecycle folders), migrate **once** on a pinned release that still bundles the Python migrator, then join the normal npm upgrade path.
139
139
 
140
+ > **Durability & support horizon (#2297).** This is a **best-effort** path for a document model that predates v0.20. The permanence anchor is the **`v0.59.0` git tag** — GitHub serves a source tarball for any tag on demand (`https://github.com/deftai/directive/archive/refs/tags/v0.59.0.tar.gz`), so recovery does **not** depend on any uploaded release asset staying attached. As long as the tag exists, the migrator is reachable. If you cannot reach the frozen payload at all, use the **[Fresh-start fallback](#fresh-start-fallback-2297)** below.
141
+
140
142
  **Applies when:** `deft doctor` reports `Pre-cutover: migration needed`, or `task migrate:preflight` exits non-zero with a `document-model` FAIL line.
141
143
 
142
- **Pinned release:** `v0.59.0` (last release before the Python-free npm deposit; includes `scripts/migrate_vbrief.py`).
144
+ **Pinned tag:** `v0.59.0` — the last release before the Python-free npm deposit; the tagged tree includes `scripts/migrate_vbrief.py`.
145
+
146
+ **This is a two-hop chain.** The pre-v0.20 flat model does not migrate straight to the current layout: hop 1 is `task migrate:vbrief` on **v0.59.0** (flat → vBRIEF v0.6); hop 2 is `deft migrate:xbrief` on **current npm** (vBRIEF v0.6 → xBRIEF v0.8). Steps 5–6 below cover hop 2.
143
147
 
144
148
  **Steps:**
145
149
 
146
150
  1. Install **Python 3.11+** and **[uv](https://docs.astral.sh/uv/)** on the migration machine.
147
- 2. Deposit framework **v0.59.0** using one of:
148
- - **Frozen Go installer** at [GitHub Releases tag v0.59.0](https://github.com/deftai/directive/releases/tag/v0.59.0) (layout migration + full source tarball under `.deft/core/`), or
149
- - **Git submodule / clone:** `git checkout v0.59.0` in your framework checkout.
151
+ 2. Deposit framework **v0.59.0** using one of (git-tag methods first — they survive even if release assets are removed):
152
+ - **Source tarball from the tag:** `curl -fsSL https://github.com/deftai/directive/archive/refs/tags/v0.59.0.tar.gz | tar xz` (full source tree including the migrator), or
153
+ - **Git clone / submodule:** `git checkout v0.59.0` in your framework checkout, or
154
+ - **Frozen Go installer** at [GitHub Releases tag v0.59.0](https://github.com/deftai/directive/releases/tag/v0.59.0) (legacy bridge; relies on the uploaded asset, so prefer a git-tag method above for durability).
150
155
  3. From the project root, preview then apply:
151
156
  ```bash
152
157
  task migrate:preflight
@@ -160,6 +165,16 @@ Current `@deftai/directive` npm releases no longer ship `task migrate:vbrief` or
160
165
 
161
166
  ⊗ Run `npm i -g @deftai/directive@latest` / `deft update` on a project that still has authoritative pre-v0.20 root docs — the current deposit cannot run the migrator; follow the frozen path first.
162
167
 
168
+ #### Fresh-start fallback (#2297)
169
+
170
+ The automated migrator is a convenience, not the only route. If the `v0.59.0` payload is genuinely unreachable (tag deleted, no network, Python/uv unavailable, or the migrator errors on an unusual legacy shape), you are **not** stranded — port forward manually:
171
+
172
+ 1. On **current npm**, scaffold a clean project beside the old one: `directive init` (or `npx @deftai/directive init`). This produces the current xBRIEF layout directly, skipping both hops.
173
+ 2. Hand-port your content: copy the substance of the old `SPECIFICATION.md` / `PROJECT.md` into the new project definition and scope xBRIEFs the setup flow creates. Your prose is the source of truth; only the container format changed.
174
+ 3. Keep the old tree read-only for reference until the new project's `deft doctor` is green, then archive it.
175
+
176
+ This is lossless for content (you re-author the container, not the substance) and depends on nothing but current npm — so it is the guaranteed floor under the best-effort automated path.
177
+
163
178
  See [docs/BROWNFIELD.md](./docs/BROWNFIELD.md) for what migration produces and how content is preserved.
164
179
 
165
180
  ### One-time migration from the Go installer (legacy → npm)
@@ -175,6 +190,8 @@ If your current install uses the frozen Go installer (`deft-install`), migrate o
175
190
 
176
191
  The frozen Go installer remains available at [GitHub Releases](https://github.com/deftai/directive/releases) as a legacy / offline bridge but receives no further updates (#1912); Node ≥ 20 is still required to run Deft afterward. After this one-time step, the four-step npm path above is all you need for every future upgrade.
177
192
 
193
+ > **Security (#2305): only run the migration bridge against a repository you trust.** A malicious repo can commit `.deft` / `.deft/core` (or a parent) as a symlink that escapes the tree, causing the deposit to write framework content outside the project directory under your account. The canonical npm CLI now refuses a symlink-escaping deposit boundary, but the **frozen Go installer** (`cmd/deft-install/upgrade.go`) is **not** patched — it is explicitly won't-fix / risk-accepted (no further Go releases, #1912). Run it only on repositories you control or trust.
194
+
178
195
  ---
179
196
 
180
197
  ## Legacy layout refused by the npm CLI (#1912)
@@ -186,6 +203,8 @@ legacy layout; the frozen final Go installer is the one-and-only migration
186
203
  bridge. This is the run-from-npm, use-time gate that backs the one-time
187
204
  migration above.
188
205
 
206
+ > **Security (#2305): trust the repo before running the frozen migration bridge.** The npm CLI refuses a deposit whose `.deft` / `.deft/core` (or a parent) is a symlink escaping the resolved project tree, so a malicious repo cannot redirect the deposit to an arbitrary location under your account. The one residual exposure the npm gate cannot cover is running the **frozen Go bridge** against an untrusted repo during legacy migration (the Go binary acts before npm ever runs); it is explicitly won't-fix / risk-accepted (#1912). Only run the migration bridge against a repository you trust.
207
+
189
208
  **Legacy layouts the npm CLI refuses:**
190
209
 
191
210
  - a git-clone or git-submodule deposit of the framework;
package/events/README.md CHANGED
@@ -14,7 +14,7 @@ data-file-convention check follow-up
14
14
 
15
15
  - `registry.json` — single source of truth for every event name, category,
16
16
  payload contract, detector / emission pointer, and consumer pointers.
17
- Lists 5 `detection-bound` events and 4 `behavioral` events (9 total).
17
+ Lists 5 `detection-bound` events and 9 `behavioral` events (14 total).
18
18
  - `registry.schema.json` — schema validating the registry's shape, including
19
19
  the required `category` enum (`detection-bound` | `behavioral`).
20
20
  - `event-record.schema.json` — schema for individual emitted event records.
@@ -161,6 +161,83 @@
161
161
  "scripts/migrate_vbrief.py -- wires the emitter into all three _emit_legacy_artifacts call sites (SPECIFICATION / PROJECT / PRD captures)",
162
162
  "(deferred -- no downstream handler in this PR; future migrate:vbrief audit reporting and consumer-facing legacy-handling skills will subscribe by name)"
163
163
  ]
164
+ },
165
+ {
166
+ "name": "value:gate-catch",
167
+ "category": "behavioral",
168
+ "description": "A detection-bound gate refused an action (branch protection, session ritual, encoding, etc.) while value feedback is enabled. Powers attributed value readbacks (#1709).",
169
+ "trigger": "packages/core/src/events/attribution-ledger.ts::recordGateCatch when verify:branch (or other wired gate) returns a blocking exit and plan.policy.valueFeedback.emitEvents is allowed.",
170
+ "payload": {
171
+ "signal_class": "string enum -- always `value` for this event name",
172
+ "source": "string -- canonical gate id (e.g. verify:branch)",
173
+ "detail": "string -- one-line human context for the catch"
174
+ },
175
+ "consumers": [
176
+ "packages/core/src/events/attribution-ledger.ts -- emit helper gated on valueFeedback",
177
+ "(deferred) skills/deft-directive-sync -- budgeted session readback (#1709 child 4)"
178
+ ]
179
+ },
180
+ {
181
+ "name": "value:wip-cap-protect",
182
+ "category": "behavioral",
183
+ "description": "verify:wip-cap refused a merge/promote because pending+active count exceeds plan.policy.wipCap (#1124).",
184
+ "trigger": "packages/core/src/wip-cap/evaluate.ts when count >= cap without --allow-over-cap and valueFeedback emitEvents is allowed.",
185
+ "payload": {
186
+ "signal_class": "string enum -- always `value`",
187
+ "source": "string -- verify:wip-cap",
188
+ "count": "integer -- in-flight scope count",
189
+ "cap": "integer -- resolved wipCap"
190
+ },
191
+ "consumers": [
192
+ "packages/core/src/events/attribution-ledger.ts::recordWipCapProtect",
193
+ "(deferred) task deft:value:show trend readout (#1709 child 4)"
194
+ ]
195
+ },
196
+ {
197
+ "name": "bypass:off-flow",
198
+ "category": "behavioral",
199
+ "description": "Consumer went off-flow (skipped checks, wrote code without active vBRIEF, skipped pre-PR, etc.) while value feedback is enabled.",
200
+ "trigger": "packages/core/src/events/attribution-ledger.ts::recordBypassSignal from wired bypass detectors (initial taxonomy entry; sources land in follow-up stories).",
201
+ "payload": {
202
+ "signal_class": "string enum -- always `bypass`",
203
+ "source": "string -- detector id",
204
+ "detail": "string -- one-line context"
205
+ },
206
+ "consumers": [
207
+ "packages/core/src/events/attribution-ledger.ts",
208
+ "(deferred) boundary-awareness readback (#1709 child 4)"
209
+ ]
210
+ },
211
+ {
212
+ "name": "adoption:unused-capability",
213
+ "category": "behavioral",
214
+ "description": "Directive capability was applicable to the current work but unused (decompose, cost, pre-PR, etc.).",
215
+ "trigger": "packages/core/src/events/attribution-ledger.ts::recordAdoptionSignal and future adoption-registry module (#1709 child 3).",
216
+ "payload": {
217
+ "signal_class": "string enum -- always `adoption`",
218
+ "source": "string -- registry module id",
219
+ "capability": "string -- capability slug (e.g. decompose, pre-pr)",
220
+ "detail": "string -- one-line applicability context"
221
+ },
222
+ "consumers": [
223
+ "packages/core/src/events/attribution-ledger.ts",
224
+ "(deferred) packages/core/src/value/adoption-registry.ts (#1709 child 3)"
225
+ ]
226
+ },
227
+ {
228
+ "name": "friction:directive-gap",
229
+ "category": "behavioral",
230
+ "description": "Directive fell short (improvised workflow, gate false-positive, ambiguous rule) and may warrant upstream feedback.",
231
+ "trigger": "packages/core/src/events/attribution-ledger.ts::recordFrictionSignal from friction detectors and gap-escalation skill (#1709 child 5).",
232
+ "payload": {
233
+ "signal_class": "string enum -- always `friction`",
234
+ "source": "string -- detector id",
235
+ "detail": "string -- one-line gap description"
236
+ },
237
+ "consumers": [
238
+ "packages/core/src/events/attribution-ledger.ts",
239
+ "(deferred) task deft:feedback:file / deft-directive-feedback skill (#1709 child 5)"
240
+ ]
164
241
  }
165
242
  ]
166
243
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive-content",
3
- "version": "0.69.0",
3
+ "version": "0.71.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
  "type": "module",
6
6
  "files": [