@deftai/directive-content 0.101.0 → 0.103.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/UPGRADING.md CHANGED
@@ -282,7 +282,9 @@ A normal framework upgrade is **one PR**, not two stacked PRs. The deposited `de
282
282
 
283
283
  **Do not** split a routine version bump into “deposit-only” then “pin/GENERATION” PRs — that re-creates engine / deposit / pin skew between merges. **Do** keep product feature work on a separate branch/PR from the framework upgrade. Consumers should **not** hand-roll a forked `deft-core-guard.yml` for normal upgrades — the deposited workflow already enforces pin-only + lock follow-through.
284
284
 
285
- Refs: [#3127](https://github.com/deftai/directive/issues/3127), [#3193](https://github.com/deftai/directive/issues/3193), [#1430](https://github.com/deftai/directive/issues/1430), [#3117](https://github.com/deftai/directive/issues/3117).
285
+ **Load fix (#3345):** if GitHub Actions shows workflow name as the path string `.github/workflows/deft-core-guard.yml` (not `deft-core-guard`), or historical runs are 0s/0 jobs and the required check `no-mixed-core-and-app` never appears on PRs, the deposited workflow failed to load (invalid YAML from an unindented Python heredoc). Run `deft update` (or re-init deposit) so the fixed workflow is rewritten, then open a normal upgrade PR — classic branch protection that requires `no-mixed-core-and-app` can clear once the job posts.
286
+
287
+ Refs: [#3127](https://github.com/deftai/directive/issues/3127), [#3193](https://github.com/deftai/directive/issues/3193), [#1430](https://github.com/deftai/directive/issues/1430), [#3117](https://github.com/deftai/directive/issues/3117), [#3345](https://github.com/deftai/directive/issues/3345).
286
288
 
287
289
  Machine-readable skill exit line (for agents/operators):
288
290
 
package/commands.md CHANGED
@@ -275,7 +275,7 @@ Current status: the validation, extractor, provider, registry, generated MAP, an
275
275
  - `task verify:capacity`, `task verify:wip-cap`, and `task verify:judgment-gates` -- policy/capacity gates.
276
276
  - `task verify:orphan-active` -- fail closed when active/running xBRIEFs still point at closed issues or merged PRs (#2321).
277
277
  - `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.
278
- - `task verify:ac` -- product-first acceptance gate (#3284). Runs `plan.acceptance.commands` (or #3267 literal ledger) **verbatim** before done; records AC-source rung (`stated`/`derived`/`project_floor`). Empty commands require `none_stated: true`. Primary name used first in `task check` (fail-fast); `--soft-missing-xbrief` for check composition. Rapid ceremony = AC-only; pressure/degraded makes hygiene advisory. `--capture-only` lists resolved commands without executing. Extends #3267 / #973.
278
+ - `task verify:ac` -- product-first acceptance gate (#3284). Runs `plan.acceptance.commands` (or #3267 literal ledger) **verbatim** before done; records AC-source rung (`stated`/`derived`/`project_floor`). Empty commands require `none_stated: true`. Empty resolution is not a green run when the project has no suite floor (`soft_empty` + stamp-acceptance remedy, #3334). Primary name used first in `task check` (fail-fast); `--soft-missing-xbrief` for check composition. Rapid ceremony = AC-only; pressure/degraded makes hygiene advisory. `--capture-only` lists resolved commands without executing. Extends #3267 / #973.
279
279
  - `task verify:literal-ac` -- #3267 mechanism alias for verbatim stated-command run (same flags/cwd); prefer `verify:ac` for product-first done-gate.
280
280
  - `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.
281
281
 
@@ -32,12 +32,40 @@ Externalize intermediate state so it doesn't consume context window.
32
32
 
33
33
  Load only what's needed, when it's needed.
34
34
 
35
+ Directive practices **human-curated context partitioning**: structure the
36
+ world so agents can inspect an index (AGENTS.md → main.md → REFERENCES.md →
37
+ skill scope / pack slices), then load only the slices the task needs. That is
38
+ lazy load by design — partition first, then select — not "paste everything and
39
+ hope attention holds."
40
+
35
41
  - ! **Follow [REFERENCES.md](../../REFERENCES.md)** for lazy-loading guidance
36
42
  - ~ Maintain lightweight references (file paths, line numbers, search queries) rather than full file contents
43
+ - ~ Prefer **handles** over paste when the host can dereference: paths, pack
44
+ slices (`task packs:slice`), xBRIEF ids, cache keys, issue/PR numbers — pass
45
+ the handle and load on demand instead of inlining large contents
37
46
  - ~ Use **targeted retrieval**: `grep`, line ranges, `head`/`tail` — not whole-file reads
38
47
  - ⊗ **Speculatively loading files** "just in case"
39
48
  - ? Pre-fetch a file only when the next step certainly requires it
40
49
 
50
+ **Related patterns (do not conflate):**
51
+
52
+ - **Code Mode** ([patterns/code-mode.md](../patterns/code-mode.md), #2593) —
53
+ compact tool discovery + sandboxed execute so large *capability* catalogs
54
+ do not bloat the prompt. Context partitioning (this section) is about
55
+ *what docs and state* enter context; Code Mode is about *how tools are
56
+ invoked*.
57
+ - **RLM (citation only):** Recursive Language Models are one recent research
58
+ framing of model-driven partition → recurse → combine over a prompt-as-
59
+ environment ([arxiv:2512.24601](https://arxiv.org/abs/2512.24601); popular
60
+ write-up: [raw.works/rlms-are-the-new-reasoning-models](https://raw.works/rlms-are-the-new-reasoning-models)).
61
+ Directive's human-curated partitions are **architecturally related**, not
62
+ an identity claim that "lazy load is an RLM." Headline claims such as
63
+ "100× context" are **benchmark-dependent and still being validated** —
64
+ treat them as motivation for partitioning, not as product guarantees.
65
+ Model-driven runtime partitioning (the model slices and re-queries without
66
+ a human-authored index) is a different instantiation from REFERENCES /
67
+ skill-scope curation.
68
+
41
69
  ## Strategy 3: Compress
42
70
 
43
71
  Reduce token count while preserving signal.
@@ -35,6 +35,18 @@ When tasks have dependencies, express them as vBRIEF edges:
35
35
  - ~ Carry the summary forward, not the full history
36
36
  - ≉ Re-reading entire conversation history when a checkpoint exists
37
37
 
38
+ ## Partition → recurse → combine
39
+
40
+ For large codebases or long documents, **partition** the work into slices,
41
+ **recurse** (or re-enter) with focused context per slice, then **combine**
42
+ results at a higher checkpoint — rather than stuffing the whole surface into
43
+ one window. This is the long-horizon form of human-curated context
44
+ partitioning ([context.md](./context.md) Strategy 2 Select; research framing
45
+ on #487). Prefer handles and slice summaries over pasting full subtree
46
+ contents. Hierarchical compression of *what already happened* remains
47
+ [fractal-summaries.md](./fractal-summaries.md); do not treat that file as a
48
+ rebrand of external RLM identity.
49
+
38
50
  ## Progress Tracking
39
51
 
40
52
  - ~ Maintain `./vbrief/plan.vbrief.json` for multi-phase work — this is the session-level tactical plan (the *how right now*)
@@ -87,7 +87,8 @@ use parallel invokes when multiple edits are needed.
87
87
 
88
88
  When composition is large (many steps, dynamic graphs), **do not** invent
89
89
  deeper nested tool packs. Prefer fewer tools via code abstraction / Code
90
- Mode / a host-side program (related: #1167, #2593) and multi-step token
90
+ Mode / a host-side program (related: #1167, #2593; pattern:
91
+ [patterns/code-mode.md](../patterns/code-mode.md)) and multi-step token
91
92
  breakpoints (#1170). Those reduce **how many** tools exist; this section
92
93
  shapes **how each remaining tool looks** at the dialect layer.
93
94
 
@@ -119,7 +120,7 @@ and consumer MCP / product-agent schemas:
119
120
  | Concern | Where it lives |
120
121
  |---------|----------------|
121
122
  | **How each tool's args sample** (this doc) | Flat grammar, low nesting tax |
122
- | **How many tools** exist | Code Mode / DSL / abstraction (#1167, #2593) |
123
+ | **How many tools** exist | [Code Mode](../patterns/code-mode.md) / DSL / abstraction (#1167, #2593) — compact `search`/`describe` + sandboxed `execute` |
123
124
  | **When multi-step burns tokens** | Breakpoints / long-horizon (#1170) |
124
125
  | **Security of tool use** | `patterns/llm-app.md` (schema validate, least privilege) |
125
126
  | **Protocol / model-tier cost after shape** | Cost-envelope notes (e.g. #3078) |
@@ -1,6 +1,6 @@
1
1
  # Consumer check contract (`verify:consumer-check-contract`)
2
2
 
3
- Refs: #3145 · Related: #3070 consumer gate integrity, #1519 check:consumer · Policy: #3189 coverageDebt / checkResume
3
+ Refs: #3145 · Related: #3070 consumer gate integrity, #1519 check:consumer · Policy: #3314 coverageDebt / checkResume (reserved)
4
4
 
5
5
  ## Problem
6
6
 
@@ -49,34 +49,26 @@ Root cause of red `greenfield-python-free-smoke` after #3145: the gate only insp
49
49
 
50
50
  `consumer-gate-integrity` proves Taskfile includes resolve. This gate proves the **required enforcement set** is present and composed — not merely that a random verify task exists.
51
51
 
52
- ## Coverage-debt hatch and local check resume (#3189)
52
+ ## Coverage-debt hatch and local check resume (#3314)
53
53
 
54
- Release-born hatch and suite-stamp features must not expand to consumers as silent defaults. Project policy lives under `plan.policy` in PROJECT-DEFINITION:
54
+ Release-born hatch and suite-stamp features must not expand to consumers as silent defaults. Two **plain optional** fields live under `plan.policy` in PROJECT-DEFINITION. Both default off. Both are **reserved** — `task check` and `task release` do not read them.
55
55
 
56
- | Field | Shape | Fail-closed when unset |
56
+ | Field | Shape | Fail-closed when absent / invalid / off |
57
57
  |---|---|---|
58
- | `coverageDebt` | `status: unset \| decided`, `mode: off \| warn \| hatch`, `autoFile` (hatch only; default false) | mode off — no hatch soft-pass |
59
- | `checkResume` | `status: unset \| decided`, `localStamp: off \| on`, `ciTrustsLocalStamp: false` (fixed v1) | localStamp off; **CI never trusts a laptop stamp** |
58
+ | `coverageDebt.mode` | `off \| warn \| hatch` | no hatch soft-pass |
59
+ | `checkResume.localStamp` | `off \| on` | no local suite-stamp resume; **CI never trusts a laptop stamp** |
60
60
 
61
- **Unset vs decided-off:** Unset keeps fail-closed *behavior* and still **nags** on interactive mutation session-start. Decided-off is quiet. Inspect with `deft policy:show --field=coverageDebt` and `--field=checkResume`. Doctor check `coverage-check-resume-policy` surfaces undecided as an **advisory skip** (never hard-fails doctor or `check:consumer`).
61
+ Inspect with `deft policy:show --field=coverageDebt` and `--field=checkResume`. Doctor check `coverage-check-resume-policy` reports a **malformed typed block** (advisory skip). Absent or valid values pass. Interactive mutation session-start prints a one-line disclosure when either field is non-default; silent when both default.
62
62
 
63
- ### Skippable session nudge
63
+ `task check` is fail-closed **by policy**. The live manual hatch is `--allow-coverage-debt=#N` (#2866). Framework `task release` Step 5 hatch is #3187. These flags do not control either path.
64
64
 
65
- On interactive cold or re-arm **mutation** session-start, when either field is unset:
65
+ ### Expansion gates
66
66
 
67
- - **Why:** long checks fail late or barely miss coverage; the project chooses fail-closed, warn, or hatch with a debt issue on **this** repo; local machines may resume a green suite at the same HEAD; CI must not trust a laptop stamp.
68
- - **What:** one bundled choice — **Strict** (recommended), **Hatch-aware**, or **Later** (plus Discuss / Back per #1470).
69
- - **Later** does **not** set `status=decided`; the next ritual nags again.
70
- - **Stop nag** only after Strict / Hatch-aware (preset write) or **dismiss-with-reason** (visible on policy:show / doctor).
71
- - Headless / CI / non-TTY: nudge is skipped (fail-open; never blocks).
72
-
73
- ### Expansion gates (after decided)
74
-
75
- | Feature | Expand to consumers? | Gate |
67
+ | Feature | Status | Notes |
76
68
  |---|---|---|
77
- | Fast-before-slow gate ordering | Yes (universal UX) | No policy wait |
78
- | Local suite stamp resume | When `checkResume.localStamp=on` | Local only; CI ignores |
79
- | Coverage hatch / auto-file | When `coverageDebt.mode=hatch` (+ optional `autoFile`) | Ledger on **this** consumer repo |
69
+ | Fast-before-slow gate ordering | Available | Universal UX; no policy wait |
70
+ | Local suite stamp resume | **Reserved** | Setting exists; consumer expansion not implemented |
71
+ | Coverage hatch / auto-file | **Reserved** | Setting exists; consumer expansion not implemented. Live hatch: `--allow-coverage-debt=#N` (#2866) |
80
72
  | CI trusts local stamp | **Not v1** | Separate RFC |
81
73
 
82
74
  ### Non-goals
@@ -84,4 +76,4 @@ On interactive cold or re-arm **mutation** session-start, when either field is u
84
76
  - Silent default-on hatch for consumers.
85
77
  - Auto-filing coverage-debt issues on **deftai/directive** from a consumer tree — the ledger is always **this** repo.
86
78
  - USER.md as source of truth for ship bars (personal never weakens the project bar).
87
- - Blocking headless CI on the nudge.
79
+ - A session-start Strict / Hatch-aware / Later quiz.
@@ -92,9 +92,34 @@ Cross-cutting process/architecture decisions often have empty `activeScopeRefs`.
92
92
  | Chat / transcripts | Non-goal |
93
93
  | Full inter-run memory (#2741) | Related consumer later; not owned by this surface |
94
94
 
95
+ ## Overlap-cluster dispose (#3315)
96
+
97
+ ! Human-dispose an overlap cluster with `task decision:write`. Put **every** member issue number in `relatedIssues`. Repeat `--related-issue` once per member, or pass `--body-file` JSON with `relatedIssues: [N, M, ...]`. Include a `revisitTrigger`. Free-text MAY name the relationship (duplicate / consolidate / not-duplicate / parent-child / related) and a proposed canonical. No new schema.
98
+
99
+ ! Before re-recommending an overlap, portfolio-priority runs `task decision:list -- --issue N --json` per cited member and parks only when a dispose decision's `relatedIssues` covers this overlap's members, unless `revisitTrigger` applies. This is **advisory skill diligence**, not a `task check` gate.
100
+
101
+ ⊗ Treat the portfolio brief as the decision record (#3198/#3201). ⊗ Auto-close member issues from a dispose write. ⊗ Replace `triage:mark-duplicate`. ⊗ Project cluster labels.
102
+
103
+ **Boundaries**
104
+
105
+ | Surface | Role |
106
+ |---------|------|
107
+ | #886 | Governance tracker |
108
+ | #1178 | Pre-filing |
109
+ | #786 | PR-output cluster |
110
+ | #3198/#3201 | Brief is never the decision record |
111
+ | #1396 (this log) | Phase-1 home for dispose records |
112
+ | `triage:mark-duplicate` | Unchanged |
113
+ | Cluster labels | No projection |
114
+
115
+ **Ledger earning condition**
116
+
117
+ A dedicated tracked ledger (`xbrief/.triage-cache/duplicate-clusters.jsonl` + verbs) is **deferred**. Build only when a portfolio/coupling pass re-litigates a cluster **despite** a dispose decision already listing the member issue numbers. Design archive: #3310 (do not re-derive).
118
+
95
119
  ## Consumers
96
120
 
97
121
  - Portfolio dispose (#3198 / #3201 / pilot #3200)
122
+ - Overlap-cluster dispose (#3315); ledger archive #3310
98
123
  - Process policy dogfood (SCM label-mirror first mass-apply #1423)
99
124
  - Multi-agent handoff continuity (related #2741 class)
100
125
 
package/main.md CHANGED
@@ -313,11 +313,14 @@ See [`skills/deft-directive-refinement/SKILL.md`](./content/skills/deft-directiv
313
313
 
314
314
  **Learning:**
315
315
  - ~ Continuously improve agent workflows
316
- - ~ Before implementing, LOAD relevant prior lessons via the content-pack slice surface: discover packs with `task deft:packs:slice --list-packs`, discover a pack's slices with `task deft:packs:slice <pack> --list`, then read the slice you need (read the slice, not the whole file)
317
- - ~ When repeated correction or better approach found, codify in `./lessons.md`
316
+ - ~ Before implementing, LOAD prior lessons: (1) content-pack slice surface `task deft:packs:slice --list-packs`, then `task deft:packs:slice <pack> --list` / the needed slice; (2) when present, also read project `./lessons.md` informal inbox so one-off prose is not invisible to the next session
317
+ - ~ Ask: could this failure recur with a different query or different session?
318
+ - One-off / non-recurrable prose → write `./lessons.md` (informal inbox, readable on next load above); promote durable lessons into the lessons pack source then `task packs:render` — ⊗ hand-edit generated `meta/lessons.md`
319
+ - Recurrable structural gap → propose skill or directive change via GitHub issue/PR under [Self-Improving, Not Self-Editing (#3164)](#self-improving-not-self-editing-3164) gates — never mid-run constitution self-edit
318
320
  - ? Modify `./lessons.md` without prior approval
319
321
  - ~ When using codified instruction, inform user which rule was applied
320
322
  - ! Promote constitution-tier improvements (skills, policy, managed AGENTS rules) through issue / PR / quality gate — not mid-run self-edit (see [Self-Improving, Not Self-Editing (#3164)](#self-improving-not-self-editing-3164))
323
+ - ? Escalate via kaizen runtime when that skill exists (#666) — pointer only; do not invent the skill here
321
324
 
322
325
  **Observation:**
323
326
  - ~ Think beyond immediate task
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@deftai/directive-content",
3
- "version": "0.101.0",
3
+ "version": "0.103.0",
4
+ "deftConsumerDeposit": true,
4
5
  "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
6
  "license": "MIT",
6
7
  "type": "module",
@@ -13,6 +13,16 @@
13
13
  "path": "patterns/agent-skill-supply-chain.md",
14
14
  "body": null
15
15
  },
16
+ {
17
+ "id": "code-mode",
18
+ "title": "Code Mode \u2014 compact search + sandboxed execute (#2593)",
19
+ "description": "Pattern for **code-mediated tool use**: the model writes and runs code that orchestrates capabilities, instead of requesting each tool call separately against a large static catalog. The public surface stays tiny (typically `search` / `describe` for progressive discovery and `execute` for sandboxed capability calls); the broader capability graph lives behind that surface in typed code.",
20
+ "triggers": [
21
+ "code-mode"
22
+ ],
23
+ "path": "patterns/code-mode.md",
24
+ "body": null
25
+ },
16
26
  {
17
27
  "id": "executor-layer-credentials",
18
28
  "title": "Executor-layer credentials (#806)",