@deftai/directive-content 0.82.0 → 0.84.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/Taskfile.yml +7 -0
- package/commands.md +16 -2
- package/docs/product-signal.md +6 -2
- package/docs/task-cache.md +37 -0
- package/package.json +1 -1
- package/packs/skills/skills-pack-0.1.json +4 -4
- package/skills/deft-directive-build/SKILL.md +30 -8
- package/skills/deft-directive-pre-pr/SKILL.md +13 -3
- package/skills/deft-directive-product-signal/SKILL.md +3 -1
- package/skills/deft-directive-swarm/SKILL.md +20 -7
- package/tasks/engine-pm-run.cjs +269 -0
- package/tasks/engine-pm-run.test.cjs +201 -0
- package/tasks/engine.yml +2 -135
package/Taskfile.yml
CHANGED
|
@@ -380,6 +380,13 @@ tasks:
|
|
|
380
380
|
cmds:
|
|
381
381
|
- task: ts:test
|
|
382
382
|
|
|
383
|
+
check:merge:
|
|
384
|
+
desc: "Merge chokepoint gate — explicit alias for check:framework-source (#1704). CI and PR gates SHOULD invoke this (or task check) as the single SoT so discrete workflow steps cannot drift."
|
|
385
|
+
deps:
|
|
386
|
+
- task: engine:_ts-build
|
|
387
|
+
cmds:
|
|
388
|
+
- task: check:framework-source
|
|
389
|
+
|
|
383
390
|
check:framework-source:
|
|
384
391
|
desc: "Run all framework source-repo pre-commit checks (TS-only after #1860). Sole wired consumer of maintainer-only core:build / core:clean."
|
|
385
392
|
deps:
|
package/commands.md
CHANGED
|
@@ -170,10 +170,22 @@ Current status: the validation, extractor, provider, registry, generated MAP, an
|
|
|
170
170
|
|
|
171
171
|
## Quality And Verification Commands
|
|
172
172
|
|
|
173
|
-
- `task check` -- primary directive repo pre-commit gate.
|
|
173
|
+
- `task check` -- primary directive repo pre-commit gate (merge chokepoint — #1704).
|
|
174
|
+
- `task check:merge` -- explicit merge-chokepoint alias for `check:framework-source` in the framework source repo (#1704).
|
|
174
175
|
- `task check:framework-source` -- framework-source lane.
|
|
175
176
|
- `task check:consumer` -- consumer-shape lane.
|
|
176
177
|
- `task check:slow` -- slower/full checks.
|
|
178
|
+
|
|
179
|
+
### Gate throughput — iteration fast lane (#1704)
|
|
180
|
+
|
|
181
|
+
> **Invariant:** every change MUST pass the full gate at least once before merge.
|
|
182
|
+
|
|
183
|
+
- ! **Iteration lane (agents + humans):** during implementation, use affected/static gates — targeted tests on changed paths, relevant static `verify:*` gates, `task coverage:hotspots` / `task verify:forward-coverage` — not full `task check` on every commit.
|
|
184
|
+
- ! **Merge chokepoint:** full `task check` (or `task check:merge` in framework source) before push/PR and in CI via the monolith merge-gate job (`.github/workflows/ci.yml` runs `check:merge`, not cached `deft check`, until `#1713` can invoke internal Taskfile shims).
|
|
185
|
+
- ! **Escape-rate safety:** consume `#1703` Tier-1 telemetry (`helped/crud-metrics.jsonl`) and `task eval:health` (Tier 0) before tightening fast-lane defaults — do not invent a separate metric surface.
|
|
186
|
+
- ~ **In-engine incrementality (#1713):** content-hash cache + runner-delegated affected selection are delivered separately.
|
|
187
|
+
- ~ **Merge queue:** deferred — GitHub merge queue adoption waits until the CI monolith + escape-rate signal are stable; batch merge throughput is the next lever after `#1713` cache lands (#1704 ROI order).
|
|
188
|
+
- ⊗ Skip the merge chokepoint because the iteration lane passed.
|
|
177
189
|
- `task verify:session-ritual` -- validate session-start ritual state.
|
|
178
190
|
- `task verify:branch` -- enforce default-branch protection.
|
|
179
191
|
- `task verify:hooks-installed` -- ensure local git hooks are configured; use `deft verify:hooks-installed --scope=agent` for agent-host hooks.
|
|
@@ -187,12 +199,14 @@ Use `task --list` for the exact current verify namespace.
|
|
|
187
199
|
|
|
188
200
|
### Agent-host direct-write hooks (#2438, #2596)
|
|
189
201
|
|
|
190
|
-
`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` covers direct edit/write tools and denies them until both existing gates pass: a fresh gated session ritual and an active/running xBRIEF accepted by canonical preflight. A second `PreToolUse` matcher covers spawn/Task tools (`Task`, `SubagentStart`, `spawn_subagent`, `start_agent`, `CreateAgent`) with the same pre-`start_agent` gate stack; explore spawns (`subagent_type: explore`) pass without implementation gates.
|
|
202
|
+
`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` covers direct edit/write tools and denies them until both existing gates pass: a fresh gated session ritual and an active/running xBRIEF accepted by canonical preflight. 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 same pre-`start_agent` gate stack; explore spawns (`subagent_type: explore`) pass without implementation gates.
|
|
191
203
|
|
|
192
204
|
- **Read-only explore (#1185):** Prefer Grok role deposit `default_capability_mode = "read-only"` (see [issue #1185](https://github.com/deftai/directive/issues/1185)). Hooks also deny direct writes when `DEFT_HOOK_READ_ONLY=1` or the host payload signals read-only capability. Implementation spawns remain blocked in read-only posture unless explicitly marked explore.
|
|
193
205
|
|
|
194
206
|
- Verify registration: `deft verify:hooks-installed --scope=agent` (or `--scope=all` for git + agent hooks).
|
|
195
207
|
- Repair missing/drifted entries: `deft update`.
|
|
208
|
+
- **Opt-out (#2752):** Set `plan.policy.hostHooks.<host>` to `false` in `xbrief/PROJECT-DEFINITION.xbrief.json` for any of the four deposited hosts (`claude`, `cursor`, `grok`, `codex`). Unset or `true` keeps the current fail-closed deposit. When a host is opted out, `deft update` / `directive init` skip creating or re-merging Directive-managed hook entries for that host; if a prior deposit left managed entries in the file, the next update strips only those entries and preserves unrelated settings. Inspect with `deft policy:show --field=hostHooks`. Doctor and `verify:hooks-installed --scope=agent` treat opted-out hosts as healthy — they do not recommend `deft update` to repair them.
|
|
209
|
+
- **Claude matcher scope:** Once `.claude/settings.json` hooks are loaded, Claude's `PreToolUse` matcher keys on tool names (`Edit`, `Write`, …), not target paths — matched tools can be gated for the whole session, including writes outside the project tree. Opt out of Claude hook deposit when that posture is unwanted.
|
|
196
210
|
- **Compact re-arm (#2113):** Cursor `preCompact` and Claude/Grok `PreCompact`/`PostCompact` call `deft hook:dispatch --event session.compact` to mark the gated session ritual stale after context compaction/resume; the existing PreToolUse gate then denies direct writes until `deft session:start` and `deft verify:session-ritual -- --tier=gated`. Codex has no native compact hook — operators must re-run the mutation ritual manually after compaction.
|
|
197
211
|
- Codex project hooks are trust-gated by Codex. Directive verifies only that the registrations are structurally current; after an install or changed hook hash, open `/hooks` in Codex and review/approve the project hook commands. Runtime trust cannot be inferred from the file alone.
|
|
198
212
|
- Directive writes only `.codex/hooks.json`; it does not parse or modify `.codex/config.toml`. Codex can also load inline hooks from `config.toml`, so avoid defining duplicate Directive commands there or they may run more than once. See the [Codex hooks documentation](https://learn.chatgpt.com/docs/hooks).
|
package/docs/product-signal.md
CHANGED
|
@@ -15,13 +15,15 @@ Capability-cost disclosure prints before `--confirm` applies `plan.policy.produc
|
|
|
15
15
|
|
|
16
16
|
Consent file: `%APPDATA%\\deft\\product-signal-consent.json` (Windows) or `~/.config/deft/product-signal-consent.json` (Unix).
|
|
17
17
|
|
|
18
|
+
Schema **v2** records the normalized `owner/repo` sink you authorize (#2767). Legacy v1 consent authorizes only the baked-in default `deftai/product-signal`; a custom `plan.policy.productSignal.sinkRepo` requires re-consent after grant.
|
|
19
|
+
|
|
18
20
|
```bash
|
|
19
|
-
task product-signal:consent -- --grant
|
|
21
|
+
task product-signal:consent -- --grant [--project-root .]
|
|
20
22
|
task product-signal:consent -- --revoke
|
|
21
23
|
task product-signal:status
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
Outbound requires **both** enable and consent.
|
|
26
|
+
`task product-signal:status` shows configured sink, consented sink, and whether they match. Outbound requires **both** enable and consent, and the configured sink must match the consented destination (including dry-run).
|
|
25
27
|
|
|
26
28
|
## Submit (ops / tests)
|
|
27
29
|
|
|
@@ -29,6 +31,8 @@ Outbound requires **both** enable and consent.
|
|
|
29
31
|
task product-signal:submit -- --surface pulse|portrait [--dry-run] [--json] [--nps 0-10]
|
|
30
32
|
```
|
|
31
33
|
|
|
34
|
+
Changing `sinkRepo` after consent soft-skips with `sink-unconsented` until you re-run consent for the new destination. Destination authorization cannot be bypassed with `skipGates`.
|
|
35
|
+
|
|
32
36
|
## Sink bootstrap (maintainers)
|
|
33
37
|
|
|
34
38
|
Internal (org) inbox: `deftai/product-signal` (overridable via `plan.policy.productSignal.sinkRepo`). Not public.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# In-engine content-hash task cache (#1713)
|
|
2
|
+
|
|
3
|
+
Legend (from RFC2119): !=MUST, ~=SHOULD, ⊗=MUST NOT.
|
|
4
|
+
|
|
5
|
+
**See also**: [Issue #1713](https://github.com/deftai/directive/issues/1713) | [Issue #1704](https://github.com/deftai/directive/issues/1704) (process face) | [Issue #2784](https://github.com/deftai/directive/issues/2784) (public types follow-up)
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
`deft check` can skip unchanged cacheable gates by replaying prior exit-0 results from a local content-hash cache. The cache ships inside the CLI — zero extra install for consumers — and directive dogfoods the same layer for its own gate stack.
|
|
10
|
+
|
|
11
|
+
Cache entries live under `.deft/cache/task/` (gitignored, local-only).
|
|
12
|
+
|
|
13
|
+
## Correctness guards
|
|
14
|
+
|
|
15
|
+
- ! Cache only passes (exit `0`). Failures always re-run.
|
|
16
|
+
- ! `codeVersion` (installed directive version) is part of every cache key.
|
|
17
|
+
- ! Volatile gates opt out via `cacheable: false` on the internal registry.
|
|
18
|
+
- ! Fail open to running when inputs cannot be enumerated — never fail open to passing.
|
|
19
|
+
- Escape hatches: `deft check --no-cache`, `deft cache:clear`.
|
|
20
|
+
|
|
21
|
+
## Runner affected-test delegation
|
|
22
|
+
|
|
23
|
+
Affected-test **selection** stays with the consumer test runner. Directive detects the runner and documents the fast-lane convention; the merge gate still runs the full suite (#1704).
|
|
24
|
+
|
|
25
|
+
| Runner | Detection | Fast-lane convention |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| vitest | `package.json` lists `vitest`, or `plan.policy.testRunner = vitest` | `vitest --changed` |
|
|
28
|
+
| jest | `package.json` lists `jest` / `@jest/core`, or policy override | `jest --onlyChanged` |
|
|
29
|
+
| go | `go.mod` present, or policy override | `go test` (native package cache) |
|
|
30
|
+
| pytest | `pytest.ini` / `pyproject.toml` / `requirements.txt`, or policy override | `pytest --testmon` |
|
|
31
|
+
| none | No match after config + heuristics | Full suite at merge gate |
|
|
32
|
+
|
|
33
|
+
Override: set `plan.policy.testRunner` in `PROJECT-DEFINITION.xbrief.json` to `vitest`, `jest`, `go`, `pytest`, or `none`.
|
|
34
|
+
|
|
35
|
+
## Internal registry (v1)
|
|
36
|
+
|
|
37
|
+
Gate contracts (`inputs`, `outputs`, `cacheable`, `codeVersion`) are **internal** to `@deftai/directive-core` until #2784 promotes a public `@deft/types` shape. Under-declaration lint runs over known read sets; incomplete enumeration disables caching for that task.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive-content",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.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": [
|