@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.
Files changed (70) hide show
  1. package/dist/cache/scanner.d.ts +11 -1
  2. package/dist/cache/scanner.js +29 -4
  3. package/dist/check/gate-lists.js +2 -0
  4. package/dist/content-contracts/skills/helpers.d.ts +10 -0
  5. package/dist/content-contracts/skills/helpers.js +35 -0
  6. package/dist/deposit/copy-tree.d.ts +19 -1
  7. package/dist/deposit/copy-tree.js +134 -5
  8. package/dist/doctor/main.d.ts +6 -5
  9. package/dist/doctor/main.js +80 -18
  10. package/dist/doctor/taskfile.d.ts +8 -0
  11. package/dist/doctor/taskfile.js +19 -0
  12. package/dist/fs/projection-containment.d.ts +18 -0
  13. package/dist/fs/projection-containment.js +40 -0
  14. package/dist/hooks/dispatcher.d.ts +34 -2
  15. package/dist/hooks/dispatcher.js +234 -21
  16. package/dist/hooks/tools.d.ts +31 -0
  17. package/dist/hooks/tools.js +74 -0
  18. package/dist/init-deposit/agent-hooks.d.ts +1 -1
  19. package/dist/init-deposit/agent-hooks.js +38 -2
  20. package/dist/init-deposit/hygiene.d.ts +16 -0
  21. package/dist/init-deposit/hygiene.js +26 -0
  22. package/dist/init-deposit/init-dispatch.js +28 -0
  23. package/dist/init-deposit/prettierignore.js +2 -2
  24. package/dist/init-deposit/refresh.js +38 -7
  25. package/dist/init-deposit/scaffold.js +7 -3
  26. package/dist/init-deposit/xbrief-projections.js +6 -6
  27. package/dist/intake/issue-emit.d.ts +45 -2
  28. package/dist/intake/issue-emit.js +420 -17
  29. package/dist/intake/issue-ingest.js +65 -6
  30. package/dist/packs/pack-render.d.ts +33 -0
  31. package/dist/packs/pack-render.js +155 -9
  32. package/dist/packs/quarantine-ext.d.ts +10 -0
  33. package/dist/packs/quarantine-ext.js +26 -2
  34. package/dist/platform/platform-capabilities.js +3 -0
  35. package/dist/policy/index.d.ts +1 -0
  36. package/dist/policy/index.js +1 -0
  37. package/dist/policy/no-deft-directive.d.ts +59 -0
  38. package/dist/policy/no-deft-directive.js +103 -0
  39. package/dist/policy/org-force-on-migration.d.ts +52 -0
  40. package/dist/policy/org-force-on-migration.js +260 -22
  41. package/dist/policy/runtime-authority.d.ts +41 -0
  42. package/dist/policy/runtime-authority.js +274 -0
  43. package/dist/review-monitor/constants.js +3 -2
  44. package/dist/review-monitor/tier-detection.d.ts +6 -2
  45. package/dist/review-monitor/tier-detection.js +27 -2
  46. package/dist/scope/transition.js +43 -0
  47. package/dist/session/release-availability.d.ts +2 -0
  48. package/dist/session/release-availability.js +23 -8
  49. package/dist/session/session-start-hook.d.ts +3 -0
  50. package/dist/session/session-start-hook.js +15 -0
  51. package/dist/session/session-start.js +30 -0
  52. package/dist/swarm/routing-set-cli.js +5 -10
  53. package/dist/swarm/routing.d.ts +3 -2
  54. package/dist/swarm/routing.js +16 -4
  55. package/dist/triage/help/registry-data.d.ts +7 -7
  56. package/dist/triage/help/registry-data.js +15 -6
  57. package/dist/triage/queue/index.d.ts +1 -0
  58. package/dist/triage/queue/index.js +1 -0
  59. package/dist/triage/queue/show.d.ts +69 -0
  60. package/dist/triage/queue/show.js +293 -0
  61. package/dist/triage/scope/cli.js +3 -0
  62. package/dist/triage/scope/coverage.d.ts +2 -0
  63. package/dist/triage/scope/coverage.js +18 -3
  64. package/dist/verify-source/cursor-tier1.js +7 -2
  65. package/dist/verify-source/index.d.ts +1 -0
  66. package/dist/verify-source/index.js +1 -0
  67. package/dist/verify-source/openclaw-tier1.d.ts +37 -0
  68. package/dist/verify-source/openclaw-tier1.js +105 -0
  69. package/dist/xbrief-migrate/migrate-project.js +9 -5
  70. 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(join(legacyDir, VBRIEF_DEPRECATION_MARKER_FILENAME), VBRIEF_DEPRECATION_MARKER_BODY, "utf8");
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.86.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.86.0",
321
- "@deftai/directive-types": "^0.86.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": {