@deftai/directive-core 0.88.0 → 0.89.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/authz/actions.d.ts +55 -0
- package/dist/authz/actions.js +125 -0
- package/dist/authz/classify.d.ts +23 -0
- package/dist/authz/classify.js +217 -0
- package/dist/authz/closed-verb.d.ts +42 -0
- package/dist/authz/closed-verb.js +279 -0
- package/dist/authz/evaluate.d.ts +41 -0
- package/dist/authz/evaluate.js +298 -0
- package/dist/authz/index.d.ts +15 -0
- package/dist/authz/index.js +15 -0
- package/dist/authz/origin.d.ts +28 -0
- package/dist/authz/origin.js +64 -0
- package/dist/authz/paths.d.ts +6 -0
- package/dist/authz/paths.js +19 -0
- package/dist/authz/store.d.ts +40 -0
- package/dist/authz/store.js +317 -0
- package/dist/authz/templates.d.ts +139 -0
- package/dist/authz/templates.js +241 -0
- package/dist/authz/types.d.ts +111 -0
- package/dist/authz/types.js +41 -0
- package/dist/authz/verb-classification.d.ts +44 -0
- package/dist/authz/verb-classification.js +237 -0
- package/dist/branch/evaluate.js +6 -1
- package/dist/cache/fetch.js +10 -5
- package/dist/cache/io.d.ts +9 -2
- package/dist/cache/io.js +30 -10
- package/dist/cache/task-cache/store.js +11 -7
- package/dist/capacity/backfill.js +10 -4
- package/dist/category-b-namespace/index.js +10 -4
- package/dist/codebase/default-extractor.js +3 -0
- package/dist/codebase/map.js +11 -4
- package/dist/doctor/doctor-state.js +28 -4
- package/dist/doctor/main.d.ts +10 -0
- package/dist/doctor/main.js +160 -0
- package/dist/doctor/types.d.ts +11 -0
- package/dist/escalation/actions.d.ts +63 -0
- package/dist/escalation/actions.js +137 -0
- package/dist/escalation/index.d.ts +8 -0
- package/dist/escalation/index.js +8 -0
- package/dist/escalation/paths.d.ts +3 -0
- package/dist/escalation/paths.js +10 -0
- package/dist/escalation/store.d.ts +17 -0
- package/dist/escalation/store.js +172 -0
- package/dist/escalation/types.d.ts +73 -0
- package/dist/escalation/types.js +43 -0
- package/dist/eval/crud-telemetry.js +30 -10
- package/dist/eval/health.js +22 -7
- package/dist/eval/readback.js +11 -10
- package/dist/eval/run.js +32 -16
- package/dist/events/attribution-enrichment.js +10 -4
- package/dist/finish-loop/directive-finish-loop.d.ts +37 -0
- package/dist/finish-loop/directive-finish-loop.js +239 -0
- package/dist/finish-loop/grant-gate.d.ts +31 -0
- package/dist/finish-loop/grant-gate.js +169 -0
- package/dist/finish-loop/index.d.ts +11 -0
- package/dist/finish-loop/index.js +11 -0
- package/dist/finish-loop/main.d.ts +35 -0
- package/dist/finish-loop/main.js +365 -0
- package/dist/finish-loop/pr-finish-loop.d.ts +34 -0
- package/dist/finish-loop/pr-finish-loop.js +217 -0
- package/dist/finish-loop/progress.d.ts +17 -0
- package/dist/finish-loop/progress.js +45 -0
- package/dist/finish-loop/queue.d.ts +16 -0
- package/dist/finish-loop/queue.js +65 -0
- package/dist/finish-loop/types.d.ts +52 -0
- package/dist/finish-loop/types.js +10 -0
- package/dist/fs/contained-write.d.ts +101 -0
- package/dist/fs/contained-write.js +281 -0
- package/dist/hooks/classify/classify.d.ts +10 -0
- package/dist/hooks/classify/classify.js +37 -0
- package/dist/hooks/classify/index.d.ts +14 -0
- package/dist/hooks/classify/index.js +13 -0
- package/dist/hooks/classify/paths.d.ts +22 -0
- package/dist/hooks/classify/paths.js +72 -0
- package/dist/hooks/classify/payload.d.ts +16 -0
- package/dist/hooks/classify/payload.js +45 -0
- package/dist/hooks/classify/stdin.d.ts +12 -0
- package/dist/hooks/classify/stdin.js +63 -0
- package/dist/hooks/classify/tool-name.d.ts +18 -0
- package/dist/hooks/classify/tool-name.js +85 -0
- package/dist/hooks/classify/types.d.ts +41 -0
- package/dist/hooks/classify/types.js +7 -0
- package/dist/hooks/dispatcher.d.ts +21 -18
- package/dist/hooks/dispatcher.js +212 -163
- package/dist/hooks/fixtures/cases.d.ts +44 -0
- package/dist/hooks/fixtures/cases.js +595 -0
- package/dist/hooks/fixtures/index.d.ts +2 -0
- package/dist/hooks/fixtures/index.js +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/init-deposit/agent-hooks.js +27 -8
- package/dist/init-deposit/gitignore.js +11 -3
- package/dist/init-deposit/headless-manifest.js +12 -4
- package/dist/init-deposit/migrate.d.ts +1 -1
- package/dist/init-deposit/migrate.js +13 -3
- package/dist/init-deposit/prettierignore.js +10 -3
- package/dist/init-deposit/scaffold.js +35 -26
- package/dist/init-deposit/xbrief-projections.js +11 -4
- package/dist/intake/candidates-log.js +46 -35
- package/dist/intake/github-body-cli.d.ts +6 -0
- package/dist/intake/github-body-cli.js +17 -0
- package/dist/intake/github-body.d.ts +46 -3
- package/dist/intake/github-body.js +191 -20
- package/dist/intake/issue-emit.d.ts +1 -0
- package/dist/intake/issue-emit.js +41 -23
- package/dist/lifecycle/event-detect.js +12 -4
- package/dist/lifecycle/events.js +29 -20
- package/dist/lifecycle/lifecycle-hygiene.js +9 -3
- package/dist/packs/pack-render.js +19 -6
- package/dist/plan-sequence/store.js +11 -4
- package/dist/policy/hotfix-criteria.d.ts +79 -0
- package/dist/policy/hotfix-criteria.js +197 -0
- package/dist/policy/index.d.ts +4 -0
- package/dist/policy/index.js +31 -1
- package/dist/policy/intent-ceiling.d.ts +79 -0
- package/dist/policy/intent-ceiling.js +181 -0
- package/dist/policy/no-deft-directive.js +10 -3
- package/dist/policy/org-force-on-migration.js +9 -5
- package/dist/policy/require-human-merge.d.ts +75 -0
- package/dist/policy/require-human-merge.js +324 -0
- package/dist/policy/resolve.js +17 -6
- package/dist/policy/runtime-authority.d.ts +15 -2
- package/dist/policy/runtime-authority.js +23 -3
- package/dist/policy/write-fence.d.ts +78 -0
- package/dist/policy/write-fence.js +164 -0
- package/dist/pr-wait-mergeable/cascade.d.ts +10 -0
- package/dist/pr-wait-mergeable/cascade.js +28 -0
- package/dist/preflight/evaluate.js +10 -0
- package/dist/product-signal/consent.js +21 -5
- package/dist/product-signal/submit.js +22 -12
- package/dist/release/build-dist-runner.js +5 -2
- package/dist/release/build-dist.d.ts +19 -1
- package/dist/release/build-dist.js +50 -2
- package/dist/release/native-steps.js +7 -2
- package/dist/release-publish/pipeline.d.ts +13 -0
- package/dist/release-publish/pipeline.js +46 -1
- package/dist/scope/audit-log.js +19 -24
- package/dist/scope/decompose.js +10 -5
- package/dist/scope/decomposed-refs.js +18 -3
- package/dist/scope/demote.js +9 -2
- package/dist/scope/undo.js +9 -2
- package/dist/session/release-availability.js +26 -6
- package/dist/session/ritual-sentinel.js +19 -12
- package/dist/session/session-start.js +7 -0
- package/dist/staleness-tickler/state.js +26 -6
- package/dist/swarm/launch.js +13 -3
- package/dist/swarm/routing.js +9 -3
- package/dist/task-surface/index.js +24 -9
- package/dist/triage/bootstrap/gitignore.js +53 -10
- package/dist/triage/cache-path.js +10 -3
- package/dist/triage/welcome/summary.js +11 -4
- package/dist/triage/welcome/writers.js +45 -16
- package/dist/validate-content/validate-links.js +5 -0
- package/dist/value/readback.js +11 -6
- package/dist/vbrief-activate/activate.js +12 -4
- package/dist/vbrief-build/project-definition-io.js +14 -6
- package/dist/verify-source/contained-writes.d.ts +59 -0
- package/dist/verify-source/contained-writes.js +272 -0
- package/dist/verify-source/index.d.ts +1 -0
- package/dist/verify-source/index.js +1 -0
- package/dist/verify-source/openclaw-tier1.js +14 -1
- package/dist/verify-source/verify-stubs.js +3 -0
- package/dist/xbrief-migrate/migrate-project.js +26 -12
- package/dist/xbrief-migrate/transforms.d.ts +4 -2
- package/dist/xbrief-migrate/transforms.js +37 -14
- package/package.json +15 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync
|
|
2
|
-
import {
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync } from "node:fs";
|
|
2
|
+
import { join, relative, resolve } from "node:path";
|
|
3
|
+
import { containedWrite } from "../fs/contained-write.js";
|
|
3
4
|
import { assertWriteTargetSafe, ProjectionContainmentError } from "../fs/projection-containment.js";
|
|
4
5
|
import { checkGitClean } from "../migrate-preflight/index.js";
|
|
5
6
|
import { applyAgentsRefresh } from "../platform/agents-md.js";
|
|
@@ -48,19 +49,30 @@ function mapRelativePath(relativePath) {
|
|
|
48
49
|
: segment)
|
|
49
50
|
.join("/");
|
|
50
51
|
}
|
|
51
|
-
function writeMigratedFile(srcPath, destPath) {
|
|
52
|
-
|
|
52
|
+
function writeMigratedFile(projectRoot, srcPath, destPath) {
|
|
53
|
+
// #2980 wave C: product write sink routes through containedWrite.
|
|
54
|
+
const root = resolve(projectRoot);
|
|
53
55
|
if (srcPath.endsWith(LEGACY_ARTIFACT_SUFFIX)) {
|
|
54
56
|
const parsed = JSON.parse(readFileSync(srcPath, "utf8"));
|
|
55
57
|
const result = transformArtifactV06ToV08Transactional(parsed);
|
|
56
58
|
if (!result.ok) {
|
|
57
59
|
throw new Error(result.error);
|
|
58
60
|
}
|
|
59
|
-
|
|
61
|
+
containedWrite({
|
|
62
|
+
root,
|
|
63
|
+
target: destPath,
|
|
64
|
+
data: `${JSON.stringify(result.artifact, null, 2)}\n`,
|
|
65
|
+
mode: "replace",
|
|
66
|
+
});
|
|
60
67
|
return;
|
|
61
68
|
}
|
|
62
69
|
const raw = readFileSync(srcPath, "utf8");
|
|
63
|
-
|
|
70
|
+
containedWrite({
|
|
71
|
+
root,
|
|
72
|
+
target: destPath,
|
|
73
|
+
data: rewriteEmbeddedTokens(raw),
|
|
74
|
+
mode: "replace",
|
|
75
|
+
});
|
|
64
76
|
}
|
|
65
77
|
function backupMigrationInputs(projectRoot, legacyDir, migratedDir) {
|
|
66
78
|
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
@@ -100,7 +112,7 @@ function migrateLegacyTree(projectRoot, legacyDir, options) {
|
|
|
100
112
|
if (shouldOmitLegacyMigrationFile(rel))
|
|
101
113
|
continue;
|
|
102
114
|
const destPath = join(stagedDir, mapRelativePath(rel));
|
|
103
|
-
writeMigratedFile(srcPath, destPath);
|
|
115
|
+
writeMigratedFile(projectRoot, srcPath, destPath);
|
|
104
116
|
}
|
|
105
117
|
overlayCanonicalTriageCache(migratedDir, stagedDir);
|
|
106
118
|
renameOrReplace(stagedDir, migratedDir);
|
|
@@ -123,14 +135,16 @@ function migrateLegacyTree(projectRoot, legacyDir, options) {
|
|
|
123
135
|
/** Idempotently write the legacy-root deprecation marker (#2270 / #2869). */
|
|
124
136
|
function writeVbriefDeprecationMarker(projectRoot, legacyDir) {
|
|
125
137
|
const markerPath = join(legacyDir, VBRIEF_DEPRECATION_MARKER_FILENAME);
|
|
126
|
-
// Refuse leaf or parent-dir symlink escapes
|
|
127
|
-
assertWriteTargetSafe(projectRoot, legacyDir);
|
|
128
|
-
assertWriteTargetSafe(projectRoot, markerPath);
|
|
129
|
-
mkdirSync(legacyDir, { recursive: true });
|
|
138
|
+
// Refuse leaf or parent-dir symlink escapes via containedWrite (#2869 / #2980 wave C).
|
|
130
139
|
if (hasVbriefDeprecationMarker(legacyDir)) {
|
|
131
140
|
return;
|
|
132
141
|
}
|
|
133
|
-
|
|
142
|
+
containedWrite({
|
|
143
|
+
root: resolve(projectRoot),
|
|
144
|
+
target: markerPath,
|
|
145
|
+
data: VBRIEF_DEPRECATION_MARKER_BODY,
|
|
146
|
+
mode: "replace",
|
|
147
|
+
});
|
|
134
148
|
}
|
|
135
149
|
/**
|
|
136
150
|
* Converge a leftover legacy `vbrief/` root to an unambiguous state (#2270).
|
|
@@ -15,8 +15,10 @@ export declare function readDeclaredArtifactVersion(artifact: JsonObject): strin
|
|
|
15
15
|
export declare function rewriteEmbeddedTokens(value: string): string;
|
|
16
16
|
/**
|
|
17
17
|
* Convert a single v0.6 in-document artifact to v0.8 semantics.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Accepts classic `vBRIEFInfo@0.6` or hybrid `xBRIEFInfo@0.6` (layout renamed,
|
|
19
|
+
* envelope not bumped — #2970). Idempotent: v0.8 artifacts are returned
|
|
20
|
+
* unchanged (deep-cloned). Transactional: on failure the original input
|
|
21
|
+
* object is not mutated.
|
|
20
22
|
*/
|
|
21
23
|
export declare function transformArtifactV06ToV08(input: JsonObject): JsonObject;
|
|
22
24
|
/**
|
|
@@ -74,30 +74,53 @@ function isAlreadyV08Artifact(artifact) {
|
|
|
74
74
|
const info = artifact[MIGRATED_INFO_ROOT_KEY];
|
|
75
75
|
return isPlainObject(info) && info.version === VBRIEF_VERSION;
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Resolve a v0.6 info block from classic `vBRIEFInfo` or hybrid `xBRIEFInfo@0.6`.
|
|
79
|
+
* Prefer the classic key when both are present. Layout rename ≠ envelope bump (#2970).
|
|
80
|
+
*/
|
|
81
|
+
function resolveV06InfoBlock(artifact) {
|
|
82
|
+
if (LEGACY_INFO_ROOT_KEY in artifact) {
|
|
83
|
+
const legacyInfo = artifact[LEGACY_INFO_ROOT_KEY];
|
|
84
|
+
if (!isPlainObject(legacyInfo)) {
|
|
85
|
+
throw new TransformError(`'${LEGACY_INFO_ROOT_KEY}' must be an object`);
|
|
86
|
+
}
|
|
87
|
+
const declaredVersion = legacyInfo.version;
|
|
88
|
+
if (declaredVersion !== LEGACY_VBRIEF_VERSION) {
|
|
89
|
+
throw new TransformError(`expected ${LEGACY_INFO_ROOT_KEY}.version ${LEGACY_VBRIEF_VERSION}, got ${String(declaredVersion)}`);
|
|
90
|
+
}
|
|
91
|
+
return legacyInfo;
|
|
92
|
+
}
|
|
93
|
+
if (MIGRATED_INFO_ROOT_KEY in artifact) {
|
|
94
|
+
const hybridInfo = artifact[MIGRATED_INFO_ROOT_KEY];
|
|
95
|
+
if (!isPlainObject(hybridInfo)) {
|
|
96
|
+
throw new TransformError(`'${MIGRATED_INFO_ROOT_KEY}' must be an object`);
|
|
97
|
+
}
|
|
98
|
+
const declaredVersion = hybridInfo.version;
|
|
99
|
+
if (declaredVersion !== LEGACY_VBRIEF_VERSION) {
|
|
100
|
+
throw new TransformError(`expected hybrid ${MIGRATED_INFO_ROOT_KEY}.version ${LEGACY_VBRIEF_VERSION} (or ${VBRIEF_VERSION} for already-migrated), got ${String(declaredVersion)}`);
|
|
101
|
+
}
|
|
102
|
+
return hybridInfo;
|
|
103
|
+
}
|
|
104
|
+
throw new TransformError(`missing required legacy info block '${LEGACY_INFO_ROOT_KEY}' or hybrid '${MIGRATED_INFO_ROOT_KEY}'@${LEGACY_VBRIEF_VERSION} for v0.6 -> v0.8 transform`);
|
|
105
|
+
}
|
|
77
106
|
/**
|
|
78
107
|
* Convert a single v0.6 in-document artifact to v0.8 semantics.
|
|
79
|
-
*
|
|
80
|
-
*
|
|
108
|
+
* Accepts classic `vBRIEFInfo@0.6` or hybrid `xBRIEFInfo@0.6` (layout renamed,
|
|
109
|
+
* envelope not bumped — #2970). Idempotent: v0.8 artifacts are returned
|
|
110
|
+
* unchanged (deep-cloned). Transactional: on failure the original input
|
|
111
|
+
* object is not mutated.
|
|
81
112
|
*/
|
|
82
113
|
export function transformArtifactV06ToV08(input) {
|
|
83
114
|
const working = structuredClone(input);
|
|
84
115
|
if (isAlreadyV08Artifact(working)) {
|
|
85
116
|
return working;
|
|
86
117
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
const legacyInfo = working[LEGACY_INFO_ROOT_KEY];
|
|
91
|
-
if (!isPlainObject(legacyInfo)) {
|
|
92
|
-
throw new TransformError(`'${LEGACY_INFO_ROOT_KEY}' must be an object`);
|
|
93
|
-
}
|
|
94
|
-
const declaredVersion = legacyInfo.version;
|
|
95
|
-
if (declaredVersion !== LEGACY_VBRIEF_VERSION) {
|
|
96
|
-
throw new TransformError(`expected ${LEGACY_INFO_ROOT_KEY}.version ${LEGACY_VBRIEF_VERSION}, got ${String(declaredVersion)}`);
|
|
97
|
-
}
|
|
118
|
+
const info = resolveV06InfoBlock(working);
|
|
119
|
+
// Drop both keys so a dual-key hybrid cannot leave a stale vBRIEFInfo behind.
|
|
98
120
|
delete working[LEGACY_INFO_ROOT_KEY];
|
|
121
|
+
delete working[MIGRATED_INFO_ROOT_KEY];
|
|
99
122
|
working[MIGRATED_INFO_ROOT_KEY] = {
|
|
100
|
-
...
|
|
123
|
+
...info,
|
|
101
124
|
version: VBRIEF_VERSION,
|
|
102
125
|
};
|
|
103
126
|
const rewritten = deepRewriteValues(working);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0",
|
|
4
4
|
"description": "TypeScript engine core for the Directive framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -75,6 +75,14 @@
|
|
|
75
75
|
"types": "./dist/hooks/index.d.ts",
|
|
76
76
|
"default": "./dist/hooks/index.js"
|
|
77
77
|
},
|
|
78
|
+
"./authz": {
|
|
79
|
+
"types": "./dist/authz/index.d.ts",
|
|
80
|
+
"default": "./dist/authz/index.js"
|
|
81
|
+
},
|
|
82
|
+
"./escalation": {
|
|
83
|
+
"types": "./dist/escalation/index.d.ts",
|
|
84
|
+
"default": "./dist/escalation/index.js"
|
|
85
|
+
},
|
|
78
86
|
"./plan-sequence": {
|
|
79
87
|
"types": "./dist/plan-sequence/index.d.ts",
|
|
80
88
|
"default": "./dist/plan-sequence/index.js"
|
|
@@ -179,6 +187,10 @@
|
|
|
179
187
|
"types": "./dist/pr-watch/index.d.ts",
|
|
180
188
|
"default": "./dist/pr-watch/index.js"
|
|
181
189
|
},
|
|
190
|
+
"./finish-loop": {
|
|
191
|
+
"types": "./dist/finish-loop/index.d.ts",
|
|
192
|
+
"default": "./dist/finish-loop/index.js"
|
|
193
|
+
},
|
|
182
194
|
"./vbrief-build": {
|
|
183
195
|
"types": "./dist/vbrief-build/index.d.ts",
|
|
184
196
|
"default": "./dist/vbrief-build/index.js"
|
|
@@ -318,8 +330,8 @@
|
|
|
318
330
|
"provenance": true
|
|
319
331
|
},
|
|
320
332
|
"dependencies": {
|
|
321
|
-
"@deftai/directive-content": "^0.
|
|
322
|
-
"@deftai/directive-types": "^0.
|
|
333
|
+
"@deftai/directive-content": "^0.89.0",
|
|
334
|
+
"@deftai/directive-types": "^0.89.0",
|
|
323
335
|
"archiver": "^8.0.0"
|
|
324
336
|
},
|
|
325
337
|
"scripts": {
|