@deftai/directive-content 0.64.0 → 0.65.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/.githooks/_deft-run.sh +14 -0
- package/.githooks/pre-commit +6 -9
- package/.githooks/pre-push +4 -7
- package/Taskfile.yml +1 -0
- package/UPGRADING.md +26 -0
- package/package.json +1 -1
- package/tasks/verify.yml +7 -0
- package/templates/agents-entry.md +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Shared deft CLI resolver for .githooks/* (#2067).
|
|
2
|
+
# REPO_ROOT must be set before sourcing.
|
|
3
|
+
|
|
4
|
+
run_deft() {
|
|
5
|
+
if command -v deft >/dev/null 2>&1; then
|
|
6
|
+
deft "$@"
|
|
7
|
+
elif [ -f "$REPO_ROOT/packages/cli/dist/bin.js" ]; then
|
|
8
|
+
node "$REPO_ROOT/packages/cli/dist/bin.js" "$@"
|
|
9
|
+
else
|
|
10
|
+
echo "deft hooks: 'deft' not found on PATH and no local CLI at packages/cli/dist/bin.js." >&2
|
|
11
|
+
echo " Install: npm i -g @deftai/directive" >&2
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
}
|
package/.githooks/pre-commit
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
# .githooks/pre-commit -- deft CLI gates (#2049 / #747 / #798 / #1620).
|
|
3
3
|
#
|
|
4
4
|
# Activated by `git config core.hooksPath .githooks` via `task setup` or the
|
|
5
|
-
# deft installer (#1463). Pure POSIX shell;
|
|
5
|
+
# deft installer (#1463). Pure POSIX shell; prefers global `deft` on PATH,
|
|
6
|
+
# falls back to local packages/cli/dist/bin.js in the maintainer monorepo (#2067).
|
|
6
7
|
|
|
7
8
|
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
|
|
8
9
|
if [ -z "$REPO_ROOT" ]; then
|
|
@@ -10,16 +11,12 @@ if [ -z "$REPO_ROOT" ]; then
|
|
|
10
11
|
exit 1
|
|
11
12
|
fi
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
echo "deft pre-commit: 'deft' not found on PATH." >&2
|
|
15
|
-
echo " Install: npm i -g @deftai/directive" >&2
|
|
16
|
-
exit 1
|
|
17
|
-
fi
|
|
14
|
+
. "$REPO_ROOT/.githooks/_deft-run.sh"
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
run_deft verify:branch --project-root "$REPO_ROOT" || exit $?
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
run_deft verify:encoding --staged --project-root "$REPO_ROOT" || exit $?
|
|
22
19
|
|
|
23
20
|
if [ -d "$REPO_ROOT/vbrief" ]; then
|
|
24
|
-
|
|
21
|
+
run_deft verify:vbrief-conformance --staged --project-root "$REPO_ROOT" || exit $?
|
|
25
22
|
fi
|
package/.githooks/pre-push
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Pre-push does NOT invoke verify:branch (#747). HEAD-only default-branch
|
|
5
5
|
# protection remains on pre-commit; pre-push relies on preflight-gh for
|
|
6
|
-
# refspec-aware protection (#1814 Option A). Pure POSIX shell;
|
|
6
|
+
# refspec-aware protection (#1814 Option A). Pure POSIX shell; prefers global
|
|
7
|
+
# `deft` on PATH, falls back to local packages/cli/dist/bin.js (#2067).
|
|
7
8
|
|
|
8
9
|
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
|
|
9
10
|
if [ -z "$REPO_ROOT" ]; then
|
|
@@ -11,11 +12,7 @@ if [ -z "$REPO_ROOT" ]; then
|
|
|
11
12
|
exit 1
|
|
12
13
|
fi
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
echo "deft pre-push: 'deft' not found on PATH." >&2
|
|
16
|
-
echo " Install: npm i -g @deftai/directive" >&2
|
|
17
|
-
exit 1
|
|
18
|
-
fi
|
|
15
|
+
. "$REPO_ROOT/.githooks/_deft-run.sh"
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
run_deft preflight-gh --pre-push-stdin
|
|
21
18
|
exit $?
|
package/Taskfile.yml
CHANGED
package/UPGRADING.md
CHANGED
|
@@ -42,6 +42,32 @@ From v0.55.1 onwards `@deftai/directive` is published on npm. The canonical cons
|
|
|
42
42
|
|
|
43
43
|
Start a **new agent session** after steps 2–3 so the refreshed AGENTS.md and skills load from a clean context.
|
|
44
44
|
|
|
45
|
+
## Public contract layer — `@deftai/directive-types` (#1799)
|
|
46
|
+
|
|
47
|
+
Downstream TypeScript projects can import the canonical vBRIEF/policy contract instead of hand-mirroring JSON shapes:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import type { VBriefDocument, PlanPolicy, Status } from "@deftai/directive-types";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
JSON Schema for non-TS consumers ships from the same package:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"$schema": "https://vbrief.dev/schemas/vbrief-core-0.6.schema.json"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or import the artifact directly:
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
import schema from "@deftai/directive-types/schemas/vbrief-core-0.6.schema.json" assert { type: "json" };
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Supported public API:** `@deftai/directive-types` and its published schema subpaths only. **`@deftai/directive-core` is published for npm dependency resolution but is not a supported library surface** — use the `deft` / `directive` CLI for behavior.
|
|
68
|
+
|
|
69
|
+
**Schema source of truth:** `content/vbrief/schemas/vbrief-core.schema.json` in the directive repo. The types package mirrors it to `packages/types/schemas/` at build time; `deft` install also deposits schemas under project-root `vbrief/schemas/`. When in doubt, treat the directive repo canonical file as authoritative and refresh mirrors with `deft update` (install) or `@deftai/directive-types` (npm).
|
|
70
|
+
|
|
45
71
|
### `deft migrate` vs pre-v0.20 document-model migration
|
|
46
72
|
|
|
47
73
|
These commands are unrelated — do not confuse them:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive-content",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.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": [
|
package/tasks/verify.yml
CHANGED
|
@@ -45,6 +45,13 @@ tasks:
|
|
|
45
45
|
cmds:
|
|
46
46
|
- node "{{.DEFT_ROOT}}/packages/cli/dist/bin.js" verify-content-manifest --project-root "{{.DEFT_ROOT}}"
|
|
47
47
|
|
|
48
|
+
contract-drift:
|
|
49
|
+
desc: "Drift gate for the public contract layer (#1799). Asserts packages/types/schemas/vbrief-core-0.6.schema.json matches content/vbrief/schemas/vbrief-core.schema.json and that @deftai/directive-types Status/version constants align with the schema. Three-state exit (0 clean / 1 drift / 2 config error)."
|
|
50
|
+
deps:
|
|
51
|
+
- _ts-build
|
|
52
|
+
cmds:
|
|
53
|
+
- node "{{.DEFT_ROOT}}/packages/cli/dist/bin.js" verify-contract-drift --project-root "{{.DEFT_ROOT}}"
|
|
54
|
+
|
|
48
55
|
cursor-tier1:
|
|
49
56
|
desc: "Framework-source content gate (#1877): assert Cursor (cursor-composer / cursor-cloud-agent, Task-tool primitive) is enumerated as a Tier-1 descriptor in the swarm Phase 3 capability matrix AND the review-cycle monitoring tier table. Fails when a doc edit drops the Cursor descriptor and silently re-opens the Tier-3 blocking-poll misclassification. Three-state exit (0 clean / 1 missing marker / 2 config error)."
|
|
50
57
|
deps:
|
|
@@ -65,7 +65,7 @@ Check what exists before doing anything else:
|
|
|
65
65
|
`deft doctor` remains the install-integrity + toolchain + AGENTS.md managed-section freshness probe (#1308). When the managed-section is stale, the doctor points the operator at `deft agents:refresh` to regenerate AGENTS.md from `templates/agents-entry.md`. The canonical `scripts/doctor.py` (single owner post #1335/#1336) also detects payload staleness from the `<install>/VERSION` manifest and, when behind, emits the canonical upgrade command `npm i -g @deftai/directive@latest` (#1339 / #1409 / #1912).
|
|
66
66
|
|
|
67
67
|
**Canonical bootstrap / update path:** Install and upgrade via npm: `npm i -g @deftai/directive` (install) or `npm i -g @deftai/directive@latest` (upgrade). Node ≥ 20 is required to run Deft (the live gates run on the TypeScript engine). On a machine without Node, install Node first, then use npm — the frozen legacy Go installer (GitHub Releases) is only a legacy/offline + layout-migration bridge (#1912), not a Node-free path. Legacy `deft upgrade` / `run upgrade` are metadata-only acknowledgment and `deft relocate -- --confirm` is back-compat only; git-clone / submodule / legacy doctor surfaces are de-emphasized in UPGRADING.md / README / skills. Agent example: after installing, start your session; `deft doctor` tells you the exact state.
|
|
68
|
-
`deft triage:welcome` emits the triage one-liner and, when state is incomplete, nudges the operator at `deft triage:welcome --onboard` (#1143). Default mode is non-interactive; the `--onboard` flag runs the 6-phase interactive ritual.
|
|
68
|
+
`deft triage:welcome` emits the triage one-liner and, when state is incomplete, nudges the operator at `deft triage:welcome --onboard` (#1143). Default mode is non-interactive; the `--onboard` flag runs the 6-phase interactive ritual. D2's 4-hour suppression window governs repeat emission during session start; the canonical key compares structured fields from the latest `vbrief/.eval/summary-history.jsonl` record: `cache_empty`, `untriaged`, `stale_defer`, `in_flight`, `in_flight_filesystem`, `in_flight_cache_scoped`, `triage_scope_configured`, `wip_count`, `wip_cap`, `repos`, `scope_drift`, and `reconcilable` (#1279). Re-emission within the window occurs when any key field changes, including when the `[triage:scope]` discrepancy line appears or resolves.
|
|
69
69
|
|
|
70
70
|
## Resume nudge (conditional, #1269)
|
|
71
71
|
|