@deftai/directive-core 0.86.0 → 0.88.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/dist/cache/scanner.d.ts +11 -1
- package/dist/cache/scanner.js +29 -4
- package/dist/check/gate-lists.js +2 -0
- package/dist/content-contracts/skills/helpers.d.ts +10 -0
- package/dist/content-contracts/skills/helpers.js +35 -0
- package/dist/deposit/copy-tree.d.ts +19 -1
- package/dist/deposit/copy-tree.js +134 -5
- package/dist/doctor/main.d.ts +6 -5
- package/dist/doctor/main.js +80 -18
- package/dist/doctor/taskfile.d.ts +8 -0
- package/dist/doctor/taskfile.js +19 -0
- package/dist/fs/projection-containment.d.ts +18 -0
- package/dist/fs/projection-containment.js +40 -0
- package/dist/hooks/dispatcher.d.ts +34 -2
- package/dist/hooks/dispatcher.js +234 -21
- package/dist/hooks/tools.d.ts +31 -0
- package/dist/hooks/tools.js +74 -0
- package/dist/init-deposit/agent-hooks.d.ts +1 -1
- package/dist/init-deposit/agent-hooks.js +38 -2
- package/dist/init-deposit/hygiene.d.ts +16 -0
- package/dist/init-deposit/hygiene.js +26 -0
- package/dist/init-deposit/init-dispatch.js +28 -0
- package/dist/init-deposit/prettierignore.js +2 -2
- package/dist/init-deposit/refresh.js +38 -7
- package/dist/init-deposit/scaffold.js +7 -3
- package/dist/init-deposit/xbrief-projections.js +6 -6
- package/dist/intake/issue-emit.d.ts +45 -2
- package/dist/intake/issue-emit.js +420 -17
- package/dist/intake/issue-ingest.js +65 -6
- package/dist/packs/pack-render.d.ts +33 -0
- package/dist/packs/pack-render.js +155 -9
- package/dist/packs/quarantine-ext.d.ts +10 -0
- package/dist/packs/quarantine-ext.js +26 -2
- package/dist/platform/platform-capabilities.js +3 -0
- package/dist/policy/index.d.ts +1 -0
- package/dist/policy/index.js +1 -0
- package/dist/policy/no-deft-directive.d.ts +59 -0
- package/dist/policy/no-deft-directive.js +103 -0
- package/dist/policy/org-force-on-migration.d.ts +52 -0
- package/dist/policy/org-force-on-migration.js +260 -22
- package/dist/policy/runtime-authority.d.ts +41 -0
- package/dist/policy/runtime-authority.js +274 -0
- package/dist/review-monitor/constants.js +3 -2
- package/dist/review-monitor/tier-detection.d.ts +6 -2
- package/dist/review-monitor/tier-detection.js +27 -2
- package/dist/scope/transition.js +43 -0
- package/dist/session/release-availability.d.ts +2 -0
- package/dist/session/release-availability.js +23 -8
- package/dist/session/session-start-hook.d.ts +3 -0
- package/dist/session/session-start-hook.js +15 -0
- package/dist/session/session-start.js +30 -0
- package/dist/swarm/routing-set-cli.js +5 -10
- package/dist/swarm/routing.d.ts +3 -2
- package/dist/swarm/routing.js +16 -4
- package/dist/triage/help/registry-data.d.ts +7 -7
- package/dist/triage/help/registry-data.js +15 -6
- package/dist/triage/queue/index.d.ts +1 -0
- package/dist/triage/queue/index.js +1 -0
- package/dist/triage/queue/show.d.ts +69 -0
- package/dist/triage/queue/show.js +293 -0
- package/dist/triage/scope/cli.js +3 -0
- package/dist/triage/scope/coverage.d.ts +2 -0
- package/dist/triage/scope/coverage.js +18 -3
- package/dist/verify-source/cursor-tier1.js +7 -2
- package/dist/verify-source/index.d.ts +1 -0
- package/dist/verify-source/index.js +1 -0
- package/dist/verify-source/openclaw-tier1.d.ts +37 -0
- package/dist/verify-source/openclaw-tier1.js +105 -0
- package/dist/xbrief-migrate/migrate-project.js +9 -5
- package/package.json +4 -3
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
export const OPENCLAW_TIER1_TARGETS = [
|
|
4
|
+
{
|
|
5
|
+
path: "content/skills/deft-directive-swarm/SKILL.md",
|
|
6
|
+
label: "swarm Phase 3 capability matrix (thin skill)",
|
|
7
|
+
markers: [
|
|
8
|
+
"Probe for the OpenClaw `sessions_spawn` tool",
|
|
9
|
+
"sessions_spawn",
|
|
10
|
+
"openclaw",
|
|
11
|
+
"host-openclaw.md",
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
path: "content/skills/deft-directive-swarm/references/host-openclaw.md",
|
|
16
|
+
label: "swarm OpenClaw host adapter",
|
|
17
|
+
markers: ["Step 2f: OpenClaw Launch", "sessions_spawn", "openclaw"],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
path: "packages/core/src/swarm/routing.ts",
|
|
21
|
+
label: "swarm routing dispatch_provider",
|
|
22
|
+
// Prefer operative identifiers (function + return), not free-floating prose.
|
|
23
|
+
markers: [
|
|
24
|
+
"export function resolveDispatchProvider",
|
|
25
|
+
'return "openclaw"',
|
|
26
|
+
"DEFT_HAS_SESSIONS_SPAWN",
|
|
27
|
+
"ROUTING_GATED_DISPATCH_PROVIDERS",
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: "packages/core/src/swarm/routing-set-cli.ts",
|
|
32
|
+
label: "swarm:routing-set provider resolution",
|
|
33
|
+
markers: ["resolveDispatchProvider", "openclaw"],
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
/** Collapse all runs of whitespace to a single space (substring-containment normalization). */
|
|
37
|
+
function normalizeWhitespace(text) {
|
|
38
|
+
return text.replace(/\s+/g, " ");
|
|
39
|
+
}
|
|
40
|
+
export function evaluateOpenclawTier1(projectRoot, options = {}) {
|
|
41
|
+
const root = resolve(projectRoot);
|
|
42
|
+
let isDir = false;
|
|
43
|
+
try {
|
|
44
|
+
isDir = statSync(root).isDirectory();
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
isDir = false;
|
|
48
|
+
}
|
|
49
|
+
if (!isDir) {
|
|
50
|
+
return {
|
|
51
|
+
code: 2,
|
|
52
|
+
findings: [],
|
|
53
|
+
message: `verify_openclaw_tier1: --project-root is not a directory: ${root}\n` +
|
|
54
|
+
" Recovery: pass an existing directory path.",
|
|
55
|
+
stream: "stderr",
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const targets = options.targets ?? OPENCLAW_TIER1_TARGETS;
|
|
59
|
+
const findings = [];
|
|
60
|
+
for (const target of targets) {
|
|
61
|
+
const full = join(root, target.path);
|
|
62
|
+
if (!existsSync(full)) {
|
|
63
|
+
return {
|
|
64
|
+
code: 2,
|
|
65
|
+
findings: [...findings],
|
|
66
|
+
message: `verify_openclaw_tier1: required surface file not found: ${target.path}\n` +
|
|
67
|
+
" Recovery: run from the framework source root, or update OPENCLAW_TIER1_TARGETS if the path moved.",
|
|
68
|
+
stream: "stderr",
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
let normalized;
|
|
72
|
+
try {
|
|
73
|
+
normalized = normalizeWhitespace(readFileSync(full, { encoding: "utf8" }));
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
77
|
+
return {
|
|
78
|
+
code: 2,
|
|
79
|
+
findings: [...findings],
|
|
80
|
+
message: `verify_openclaw_tier1: could not read ${target.path}: ${msg}`,
|
|
81
|
+
stream: "stderr",
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const missing = target.markers.filter((marker) => !normalized.includes(normalizeWhitespace(marker)));
|
|
85
|
+
if (missing.length > 0) {
|
|
86
|
+
findings.push({ path: target.path, label: target.label, missingMarkers: missing });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (findings.length > 0) {
|
|
90
|
+
const header = "verify_openclaw_tier1: OpenClaw is not fully enumerated as a Tier-1 descriptor (#2875).\n" +
|
|
91
|
+
" Root cause: an OpenClaw agent has a first-class backgroundable sub-agent primitive (sessions_spawn) and\n" +
|
|
92
|
+
" is therefore Tier 1 / Approach 1. If the matrix or routing surfaces drop the openclaw descriptor, an\n" +
|
|
93
|
+
" OpenClaw session silently degrades to grok-build misclassification or generic-terminal. Re-add the missing marker(s):";
|
|
94
|
+
const body = findings
|
|
95
|
+
.map((f) => ` ${f.path} (${f.label}) missing: ${f.missingMarkers.map((m) => `"${m}"`).join(", ")}`)
|
|
96
|
+
.join("\n");
|
|
97
|
+
return { code: 1, findings, message: `${header}\n${body}`, stream: "stderr" };
|
|
98
|
+
}
|
|
99
|
+
const msg = `verify_openclaw_tier1: OpenClaw enumerated as a Tier-1 descriptor in ${targets.length} surface(s) (#2875).`;
|
|
100
|
+
if (options.quiet) {
|
|
101
|
+
return { code: 0, findings: [], message: "", stream: "stdout" };
|
|
102
|
+
}
|
|
103
|
+
return { code: 0, findings: [], message: msg, stream: "stdout" };
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=openclaw-tier1.js.map
|
|
@@ -108,7 +108,7 @@ function migrateLegacyTree(projectRoot, legacyDir, options) {
|
|
|
108
108
|
// either removed (default) or retained for read-compat behind an explicit
|
|
109
109
|
// deprecation marker so it never looks like an active source of truth (#2270).
|
|
110
110
|
if (options.keepLegacy) {
|
|
111
|
-
writeVbriefDeprecationMarker(legacyDir);
|
|
111
|
+
writeVbriefDeprecationMarker(projectRoot, legacyDir);
|
|
112
112
|
}
|
|
113
113
|
else {
|
|
114
114
|
rmSync(legacyDir, { recursive: true, force: true });
|
|
@@ -120,13 +120,17 @@ function migrateLegacyTree(projectRoot, legacyDir, options) {
|
|
|
120
120
|
throw err;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
/** Idempotently write the legacy-root deprecation marker (#2270). */
|
|
124
|
-
function writeVbriefDeprecationMarker(legacyDir) {
|
|
123
|
+
/** Idempotently write the legacy-root deprecation marker (#2270 / #2869). */
|
|
124
|
+
function writeVbriefDeprecationMarker(projectRoot, legacyDir) {
|
|
125
|
+
const markerPath = join(legacyDir, VBRIEF_DEPRECATION_MARKER_FILENAME);
|
|
126
|
+
// Refuse leaf or parent-dir symlink escapes before mkdir/write (#2869).
|
|
127
|
+
assertWriteTargetSafe(projectRoot, legacyDir);
|
|
128
|
+
assertWriteTargetSafe(projectRoot, markerPath);
|
|
125
129
|
mkdirSync(legacyDir, { recursive: true });
|
|
126
130
|
if (hasVbriefDeprecationMarker(legacyDir)) {
|
|
127
131
|
return;
|
|
128
132
|
}
|
|
129
|
-
writeFileSync(
|
|
133
|
+
writeFileSync(markerPath, VBRIEF_DEPRECATION_MARKER_BODY, "utf8");
|
|
130
134
|
}
|
|
131
135
|
/**
|
|
132
136
|
* Converge a leftover legacy `vbrief/` root to an unambiguous state (#2270).
|
|
@@ -147,7 +151,7 @@ export function convergeLegacyVbriefRoot(projectRoot, options) {
|
|
|
147
151
|
rmSync(legacyDir, { recursive: true, force: true });
|
|
148
152
|
return "removed";
|
|
149
153
|
}
|
|
150
|
-
writeVbriefDeprecationMarker(legacyDir);
|
|
154
|
+
writeVbriefDeprecationMarker(projectRoot, legacyDir);
|
|
151
155
|
return "marker";
|
|
152
156
|
}
|
|
153
157
|
function renameOrReplace(src, dest) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"description": "TypeScript engine core for the Directive framework.",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
@@ -317,8 +318,8 @@
|
|
|
317
318
|
"provenance": true
|
|
318
319
|
},
|
|
319
320
|
"dependencies": {
|
|
320
|
-
"@deftai/directive-content": "^0.
|
|
321
|
-
"@deftai/directive-types": "^0.
|
|
321
|
+
"@deftai/directive-content": "^0.88.0",
|
|
322
|
+
"@deftai/directive-types": "^0.88.0",
|
|
322
323
|
"archiver": "^8.0.0"
|
|
323
324
|
},
|
|
324
325
|
"scripts": {
|