@deftai/directive-content 0.55.1 → 0.55.2
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/QUICK-START.md
CHANGED
|
@@ -4,9 +4,19 @@ You are reading this because a user told you to, or because a stale `AGENTS.md`
|
|
|
4
4
|
|
|
5
5
|
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
6
6
|
|
|
7
|
-
## Installing Deft
|
|
7
|
+
## Installing Deft (canonical — npm)
|
|
8
8
|
|
|
9
|
-
! If Deft is **not yet installed** and you were told to "
|
|
9
|
+
! If Deft is **not yet installed** and you were told to "install Deft into this directory," the canonical install is npm (Node ≥ 20 required):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm i -g @deftai/directive
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Once installed, run `directive` (or the `deft` alias) from your project directory. Continue with Step 1 below.
|
|
16
|
+
|
|
17
|
+
### Legacy / no-Node fallback (frozen Go installer, #1912)
|
|
18
|
+
|
|
19
|
+
If Node is not available, the frozen legacy Go installer is the fallback. Do NOT build from a source checkout and do NOT guess a path. Each one-liner downloads the correct release binary from `releases/latest/download`, makes it executable, then runs it headless.
|
|
10
20
|
|
|
11
21
|
**macOS (Intel + Apple Silicon):**
|
|
12
22
|
|
|
@@ -26,7 +36,7 @@ curl -fsSL -o /tmp/deft-install https://github.com/deftai/directive/releases/lat
|
|
|
26
36
|
Invoke-WebRequest -Uri https://github.com/deftai/directive/releases/latest/download/install-windows-amd64.exe -OutFile $env:TEMP\deft-install.exe; & $env:TEMP\deft-install.exe --yes --repo-root . --json
|
|
27
37
|
```
|
|
28
38
|
|
|
29
|
-
⊗ Do NOT `go build` from a source checkout or a developer-specific path (e.g. a hardcoded `/Users/<name>/...` clone)
|
|
39
|
+
⊗ Do NOT `go build` from a source checkout or a developer-specific path (e.g. a hardcoded `/Users/<name>/...` clone). Once the installer finishes, continue with Step 1 below.
|
|
30
40
|
|
|
31
41
|
## Step 1 — Who are you?
|
|
32
42
|
|
package/UPGRADING.md
CHANGED
|
@@ -8,6 +8,29 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
## Canonical upgrade — npm (v0.55.1+)
|
|
12
|
+
|
|
13
|
+
From v0.55.1 onwards `@deftai/directive` is published on npm. The canonical upgrade command is:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i -g @deftai/directive@latest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run from any shell with Node ≥ 20. After upgrading, start a new agent session so the refreshed AGENTS.md and skills load from a clean context. Run `directive doctor` to confirm the install state.
|
|
20
|
+
|
|
21
|
+
### One-time migration from the Go installer (legacy → npm)
|
|
22
|
+
|
|
23
|
+
If your current install uses the frozen Go installer (`deft-install`), migrate once:
|
|
24
|
+
|
|
25
|
+
1. Install Node ≥ 20 if not already present.
|
|
26
|
+
2. Run `npm i -g @deftai/directive` to install from npm.
|
|
27
|
+
3. In your project, run `directive agents:refresh` to update AGENTS.md with the npm-based managed section.
|
|
28
|
+
4. Verify with `directive doctor` — the install-integrity check confirms the npm payload is current.
|
|
29
|
+
|
|
30
|
+
The frozen Go installer remains available at [GitHub Releases](https://github.com/deftai/directive/releases) as a no-Node fallback but receives no further updates (#1912). After this one-time step, `npm i -g @deftai/directive@latest` is the only upgrade command you need.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
11
34
|
## Big-jump triage — multi-version upgrades (start here)
|
|
12
35
|
|
|
13
36
|
> **Multi-version jump?** Start here. This guide is ordered newest-first, so a consumer jumping several minor versions otherwise has to read every section to infer which ones apply and in what order. This entry point maps **version-range buckets** to the sections that apply and the **apply-order** to run them in.
|
|
@@ -25,23 +48,25 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
|
25
48
|
- **From v0.25.x — manual (breaking).** The deft-cache on-disk layout changed: [From v0.25.x → v0.26.0](#from-v025x--v0260-deft-cache-unified-layer-breaking).
|
|
26
49
|
- **From v0.26.x — auto-handled (interactive).** Run the triage adoption ritual: [From v0.26.x → v0.27](#from-v026x---v027-triage-adoption-via-task-triagewelcome).
|
|
27
50
|
- **From v0.27.x — mostly auto-handled.** Pick up the install manifest and the `deft/` → `.deft/core/` layout: [From v0.27.x → v0.28](#from-v027x---v028-canonical-install-manifest-at-installversion), [From deft/ → .deft/core/](#from-deft---deftcore), and [From drifted AGENTS.md → current install](#from-drifted-agentsmd---current-install-task-upgrade-repair-path-1061).
|
|
28
|
-
- **From v0.28–v0.36 (and the final hop to current) — auto-handled.**
|
|
51
|
+
- **From v0.28–v0.36 (and the final hop to current) — auto-handled.** If still on the Go-installer layout, follow the [One-time migration from the Go installer](#one-time-migration-from-the-go-installer-legacy--npm) above, then `npm i -g @deftai/directive@latest` for all future upgrades.
|
|
29
52
|
|
|
30
|
-
**Final step for every bucket.** Finish on the canonical
|
|
53
|
+
**Final step for every bucket.** Finish on the canonical upgrade command, then let the doctor confirm you are current:
|
|
31
54
|
|
|
32
55
|
```bash
|
|
33
|
-
|
|
56
|
+
npm i -g @deftai/directive@latest
|
|
34
57
|
```
|
|
35
58
|
|
|
36
|
-
Then run `
|
|
59
|
+
Then run `directive doctor`: it checks install integrity and tells you whether any further hop is still due. If still on a Go-installer layout, follow the [One-time migration from the Go installer](#one-time-migration-from-the-go-installer-legacy--npm) first.
|
|
37
60
|
|
|
38
61
|
---
|
|
39
62
|
|
|
40
63
|
## Canonical installer + doctor handoff (v0.37+ / Epic-5+6 #1339 #1340, #1409)
|
|
41
64
|
|
|
42
|
-
**The
|
|
65
|
+
> **Note (v0.55.1+):** npm is now the canonical install and upgrade path. See [Canonical upgrade — npm](#canonical-upgrade--npm-v0551) above. The Go-installer install path documented here is a **frozen legacy bridge** (#1912); it remains accurate for consumers still on that layout.
|
|
66
|
+
|
|
67
|
+
**Legacy Go-installer path (for archaeology / migration reference):**
|
|
43
68
|
|
|
44
|
-
1. Download and run the platform-specific installer binary from GitHub Releases
|
|
69
|
+
1. Download and run the platform-specific installer binary from GitHub Releases.
|
|
45
70
|
2. The installer writes the payload + manifest + AGENTS.md + skills, then **deterministically calls `scripts/doctor.py --session --json`** at the end.
|
|
46
71
|
3. Doctor (now the single owner of all health/install-integrity/staleness logic) reads the `<install>/VERSION` manifest and, when the recorded sha lags the remote ref, emits a **clear recommendation** to run the canonical headless upgrader: `deft-install --yes --upgrade --repo-root . --json`.
|
|
47
72
|
4. On subsequent sessions `task doctor` / `run doctor` (thin shims to the canonical `scripts/doctor.py`) continue to surface the same guidance.
|
|
@@ -132,7 +157,7 @@ This manual exclude is harmless to keep, but it becomes unnecessary once the ins
|
|
|
132
157
|
|
|
133
158
|
- ⊗ It does NOT mutate any filesystem state during detection or emission.
|
|
134
159
|
- ⊗ It does NOT block the CLI invocation it fires alongside; the gate stays exit-0 for manifest drift (mirrors the #801 remote-version probe's informational-only contract).
|
|
135
|
-
- ⊗ It does NOT auto-rewrite the manifest -- writing belongs to `task upgrade` / `run install` / `oz-agent-upgrade
|
|
160
|
+
- ⊗ It does NOT auto-rewrite the manifest -- writing belongs to `task upgrade` / `run install` / `oz-agent-upgrade`.
|
|
136
161
|
- ⊗ It does NOT call `read_yn` / interactive confirm helpers; the advisory is a one-line warn, not a prompt.
|
|
137
162
|
|
|
138
163
|
### Rollback
|
|
@@ -194,7 +219,7 @@ The doctor's FAIL `detail` strings name the exact commands the operator should r
|
|
|
194
219
|
<!-- 992-pr3: From deft/ -> .deft/core/ migration BEGIN -->
|
|
195
220
|
## From deft/ -> .deft/core/
|
|
196
221
|
|
|
197
|
-
- **Applies when:** `.deft/core/run gate` reports a non-A install layout state (`B`, `C`, or `D`) -- equivalently, the new `_check_upgrade_gate` install-layout auto-prompt fires `[deft] install layout state: <X> (<description>). Run .deft/core/run relocate to upgrade. (Y/n)` on every CLI invocation. The four states inspected by the detector are: **A** pure `deft/` (legacy install; AGENTS.md + framework agree at the legacy path -- working today, no action required), **B** pure `.deft/core/` (current installer /
|
|
222
|
+
- **Applies when:** `.deft/core/run gate` reports a non-A install layout state (`B`, `C`, or `D`) -- equivalently, the new `_check_upgrade_gate` install-layout auto-prompt fires `[deft] install layout state: <X> (<description>). Run .deft/core/run relocate to upgrade. (Y/n)` on every CLI invocation. The four states inspected by the detector are: **A** pure `deft/` (legacy install; AGENTS.md + framework agree at the legacy path -- working today, no action required), **B** pure `.deft/core/` (current installer / sync skill / oz output -- AGENTS.md may still say `deft/` and the contract diverges), **C** hybrid (both `deft/` and `.deft/core/` present -- agents follow whichever they read first), **D** AGENTS.md only (managed-section markers present but no framework directory -- partial install). State A is the only non-firing state in v0.27 -- a future cycle decides whether to deprecate the legacy path. (#992)
|
|
198
223
|
- **Safe to auto-run:** No -- the relocator is wipe-and-reinstall by design and operator consent is required at every gate-prompt invocation. The cmd_gate auto-prompt is purely informational: it asks `(Y/n)` as a visual consent affordance but the gate itself NEVER invokes `task relocate` automatically and NEVER mutates filesystem state. This mirrors the **#884 ghx-install consent gate** precedent (`task setup` prompts before invoking the upstream installer; the only non-interactive paths are explicit `--yes` or env-var opt-out). The relocator's own `task relocate` surface ALSO prompts `[y/N]` on bare invocation; pass `--confirm` to skip the prompt in scripted use, never as a default. The relocator writes a gzip snapshot tarball to `.deft-cache/relocate-snapshot-<UTC-timestamp>.tar.gz` BEFORE any wipe so a botched relocate is recoverable.
|
|
199
224
|
- **Restart required:** Yes -- the marker v1 -> v2 bump (PR1) intentionally fires `agents-md=stale` on every current install on the first `cmd_gate` invocation post-v0.27. After the relocator completes, AGENTS.md is re-rendered with the v2 managed-section markers; chase with a fresh agent session so the refreshed `AGENTS.md` (Implementation Intent Gate, Branch Policy Disclosure, Multi-agent orchestration discipline, etc.) loads from a clean context. Your current session still holds the pre-relocate `AGENTS.md` in memory; restarting closes that drift.
|
|
200
225
|
- **Commands:**
|
|
@@ -210,18 +235,18 @@ The doctor's FAIL `detail` strings name the exact commands the operator should r
|
|
|
210
235
|
The gate-side detector inspects three filesystem facts at the consumer project root: presence of `deft/` (legacy framework dir), presence of `.deft/core/` (canonical framework dir), and presence of managed-section markers in `AGENTS.md`. The four states map onto those facts as follows:
|
|
211
236
|
|
|
212
237
|
- **State A** -- `deft/` present, `.deft/core/` absent. Legacy install. **No prompt fires.** Working today; relocate is OPTIONAL in v0.27. Operators on state A can keep their legacy install indefinitely or relocate proactively.
|
|
213
|
-
- **State B** -- `deft/` absent, `.deft/core/` present. Current installer /
|
|
238
|
+
- **State B** -- `deft/` absent, `.deft/core/` present. Current installer / sync skill / oz output. **Prompt fires.** AGENTS.md may still reference `deft/` paths (pre-PR1 contract); the relocator re-renders AGENTS.md with the v2 markers and aligns the contract.
|
|
214
239
|
- **State C** -- both `deft/` AND `.deft/core/` present. Hybrid. **Prompt fires.** Agents follow whichever path they read first; the relocator wipes both and reinstalls into `.deft/core/` only (single-namespace contract per the v0.27 DesignChoice).
|
|
215
240
|
- **State D** -- neither directory present, AGENTS.md with managed markers present. Partial install. **Prompt fires.** Typically a cancelled / interrupted install; the relocator does a fresh canonical install into `.deft/core/`.
|
|
216
241
|
|
|
217
242
|
### What the relocator does
|
|
218
243
|
|
|
219
|
-
`task relocate` runs `scripts/relocate.py` (PR2). The implementation is wipe-and-reinstall by design: one idempotent code path across states A/B/C/D/F that enforces the canonical `.deft/core/` namespace contract from #11 (read-only packaged assets), has a trivial test surface (state matrix x relocator -> assert end state), catches stale framework versions for free (state B benefits even though no path move is needed), and aligns with the npm
|
|
244
|
+
`task relocate` runs `scripts/relocate.py` (PR2). The implementation is wipe-and-reinstall by design: one idempotent code path across states A/B/C/D/F that enforces the canonical `.deft/core/` namespace contract from #11 (read-only packaged assets), has a trivial test surface (state matrix x relocator -> assert end state), catches stale framework versions for free (state B benefits even though no path move is needed), and aligns with the npm rail packaging semantics that #11 ships. Per phase, the relocator:
|
|
220
245
|
|
|
221
246
|
1. **Pre-flight gates** -- hard-fails without `--force` when the framework dir is git-tracked + customized (preserved-files list printed) OR any `vbrief/active/*.vbrief.json` has `plan.status == "running"` (active swarm).
|
|
222
247
|
2. **Snapshot** -- writes a gzip tarball to `.deft-cache/relocate-snapshot-<UTC-timestamp>.tar.gz` covering `deft/` + `.deft/core/` + `AGENTS.md` so the operation is reversible via `task relocate -- --rollback`.
|
|
223
248
|
3. **Wipe** -- removes both `deft/` (if present) and `.deft/core/` (if present) -- the operation is contractually idempotent across source states.
|
|
224
|
-
4. **Reinstall** -- copies the framework source into `.deft/core/`. The bootstrap path
|
|
249
|
+
4. **Reinstall** -- copies the framework source into `.deft/core/`. The bootstrap path fetches a fresh framework copy to a temp dir and runs the relocator FROM that copy, so the in-place framework about to be wiped never executes its own wipe (BOOTSTRAP NEVER SELF-DESTRUCTIVE).
|
|
225
250
|
5. **AGENTS.md re-render** -- bumps the managed-section bytes to the v2 marker contract using the `_wrap_legacy_in_markers` semantics from `run` (#794) so consumer notes outside the bracketed region survive verbatim.
|
|
226
251
|
6. **`.gitignore` update** -- ensures `.deft/core/` is gitignored by default per the #845 / `.deft-cache/` precedent (hidden-namespace contract).
|
|
227
252
|
7. **Advisory grep** -- scans consumer files OUTSIDE `.deft/core/` for legacy framework path references and prints findings (CI workflows, external scripts, dotfiles that hardcode the pre-v0.27 path). See `scripts/_relocate_states.py::advise_external_hardcodes()` for the exact search constant + grep semantics. The relocator NEVER auto-rewrites these -- CI / external tooling that hardcodes the legacy path is out of framework's control; the operator decides whether to update each surface.
|
package/package.json
CHANGED