@xenonbyte/da-vinci-workflow 0.2.5 → 0.2.6
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/CHANGELOG.md +16 -0
- package/README.md +15 -9
- package/README.zh-CN.md +16 -9
- package/docs/dv-command-reference.md +18 -2
- package/docs/execution-chain-migration.md +14 -3
- package/docs/maintainer-bootstrap.md +102 -0
- package/docs/pencil-rendering-workflow.md +1 -1
- package/docs/skill-usage.md +31 -0
- package/docs/workflow-overview.md +40 -5
- package/docs/zh-CN/dv-command-reference.md +16 -2
- package/docs/zh-CN/maintainer-bootstrap.md +101 -0
- package/docs/zh-CN/pencil-rendering-workflow.md +1 -1
- package/docs/zh-CN/skill-usage.md +30 -0
- package/docs/zh-CN/workflow-overview.md +38 -5
- package/lib/audit.js +19 -0
- package/lib/cli/helpers.js +63 -2
- package/lib/cli.js +98 -0
- package/lib/gate-utils.js +56 -0
- package/lib/install.js +134 -6
- package/lib/lint-bindings.js +41 -28
- package/lib/lint-spec.js +403 -109
- package/lib/lint-tasks.js +571 -21
- package/lib/maintainer-readiness.js +317 -0
- package/lib/planning-parsers.js +190 -1
- package/lib/planning-quality-utils.js +81 -0
- package/lib/planning-signal-freshness.js +205 -0
- package/lib/scope-check.js +751 -82
- package/lib/sidecars.js +396 -1
- package/lib/task-review.js +2 -1
- package/lib/utils.js +15 -0
- package/lib/workflow-persisted-state.js +52 -32
- package/lib/workflow-state.js +1187 -249
- package/package.json +1 -1
package/lib/lint-bindings.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
|
-
const { STATUS } = require("./workflow-contract");
|
|
3
2
|
const {
|
|
4
3
|
unique,
|
|
5
4
|
resolveImplementationLanding,
|
|
6
|
-
resolveChangeDir,
|
|
7
5
|
parseBindingsArtifact,
|
|
8
6
|
readChangeArtifacts,
|
|
9
7
|
readArtifactTexts
|
|
10
8
|
} = require("./planning-parsers");
|
|
9
|
+
const { buildGateEnvelope, finalizeGateEnvelope } = require("./gate-utils");
|
|
10
|
+
const {
|
|
11
|
+
buildBasePlanningResultEnvelope,
|
|
12
|
+
finalizePlanningResult,
|
|
13
|
+
resolveChangeWithFindings
|
|
14
|
+
} = require("./planning-quality-utils");
|
|
11
15
|
|
|
12
16
|
function buildEnvelope(projectRoot, strict) {
|
|
13
17
|
return {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
projectRoot,
|
|
19
|
-
changeId: null,
|
|
20
|
-
strict,
|
|
18
|
+
...buildBasePlanningResultEnvelope(projectRoot, strict),
|
|
19
|
+
gates: {
|
|
20
|
+
bindingsHealth: null
|
|
21
|
+
},
|
|
21
22
|
summary: {
|
|
22
23
|
mappings: 0,
|
|
23
24
|
malformed: 0
|
|
@@ -29,13 +30,19 @@ function finalize(result) {
|
|
|
29
30
|
result.failures = unique(result.failures);
|
|
30
31
|
result.warnings = unique(result.warnings);
|
|
31
32
|
result.notes = unique(result.notes);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
return finalizePlanningResult(result);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function attachBindingsGateFindings(result, gate) {
|
|
37
|
+
for (const message of gate.blocking || []) {
|
|
38
|
+
result.failures.push(`[gate:bindingsHealth] ${message}`);
|
|
39
|
+
}
|
|
40
|
+
for (const message of gate.advisory || []) {
|
|
41
|
+
result.warnings.push(`[gate:bindingsHealth] ${message}`);
|
|
42
|
+
}
|
|
43
|
+
for (const message of gate.compatibility || []) {
|
|
44
|
+
result.notes.push(`[gate:bindingsHealth] ${message}`);
|
|
36
45
|
}
|
|
37
|
-
result.status = result.strict ? STATUS.BLOCK : STATUS.WARN;
|
|
38
|
-
return result;
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
function lintBindings(projectPathInput, options = {}) {
|
|
@@ -43,20 +50,22 @@ function lintBindings(projectPathInput, options = {}) {
|
|
|
43
50
|
const strict = options.strict === true;
|
|
44
51
|
const requestedChangeId = options.changeId ? String(options.changeId).trim() : "";
|
|
45
52
|
const result = buildEnvelope(projectRoot, strict);
|
|
53
|
+
const bindingsGate = buildGateEnvelope("bindingsHealth");
|
|
46
54
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!resolved.changeDir) {
|
|
55
|
+
const changeDir = resolveChangeWithFindings(projectRoot, requestedChangeId, result.failures, result.notes);
|
|
56
|
+
if (!changeDir) {
|
|
57
|
+
result.gates.bindingsHealth = finalizeGateEnvelope(bindingsGate, { strict });
|
|
51
58
|
result.notes.push("lint-bindings defaults to advisory mode; pass `--strict` to block on findings.");
|
|
52
59
|
return finalize(result);
|
|
53
60
|
}
|
|
54
|
-
result.changeId =
|
|
61
|
+
result.changeId = path.basename(changeDir);
|
|
55
62
|
|
|
56
|
-
const artifactPaths = readChangeArtifacts(projectRoot,
|
|
63
|
+
const artifactPaths = readChangeArtifacts(projectRoot, result.changeId);
|
|
57
64
|
const artifacts = readArtifactTexts(artifactPaths);
|
|
58
65
|
if (!artifacts.bindings) {
|
|
59
|
-
|
|
66
|
+
bindingsGate.blocking.push("Missing `pencil-bindings.md` for lint-bindings.");
|
|
67
|
+
result.gates.bindingsHealth = finalizeGateEnvelope(bindingsGate, { strict });
|
|
68
|
+
attachBindingsGateFindings(result, result.gates.bindingsHealth);
|
|
60
69
|
result.notes.push("lint-bindings defaults to advisory mode; pass `--strict` to block on findings.");
|
|
61
70
|
return finalize(result);
|
|
62
71
|
}
|
|
@@ -66,17 +75,19 @@ function lintBindings(projectPathInput, options = {}) {
|
|
|
66
75
|
result.summary.malformed = parsed.malformed.length;
|
|
67
76
|
|
|
68
77
|
if (parsed.mappings.length === 0) {
|
|
69
|
-
|
|
78
|
+
bindingsGate.blocking.push(
|
|
79
|
+
"No implementation-to-Pencil mappings were parsed from `pencil-bindings.md`."
|
|
80
|
+
);
|
|
70
81
|
}
|
|
71
82
|
if (parsed.malformed.length > 0) {
|
|
72
83
|
for (const malformed of parsed.malformed) {
|
|
73
|
-
|
|
84
|
+
bindingsGate.advisory.push(`Malformed binding mapping entry: "${malformed}".`);
|
|
74
85
|
}
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
for (const mapping of parsed.mappings) {
|
|
78
89
|
if (!mapping.implementation || !mapping.designPage) {
|
|
79
|
-
|
|
90
|
+
bindingsGate.advisory.push(`Malformed binding mapping entry: "${mapping.raw}".`);
|
|
80
91
|
continue;
|
|
81
92
|
}
|
|
82
93
|
|
|
@@ -86,21 +97,23 @@ function lintBindings(projectPathInput, options = {}) {
|
|
|
86
97
|
/missing|todo|gap|pending|temporary/i.test(note)
|
|
87
98
|
);
|
|
88
99
|
if (noteContainsIntentionalGap) {
|
|
89
|
-
|
|
100
|
+
bindingsGate.compatibility.push(
|
|
90
101
|
`Unresolved implementation landing for "${mapping.implementation}" (allowed by explicit notes).`
|
|
91
102
|
);
|
|
92
103
|
} else {
|
|
93
|
-
|
|
104
|
+
bindingsGate.advisory.push(`Unresolved implementation landing for "${mapping.implementation}".`);
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
107
|
|
|
97
108
|
if (mapping.designSource && !String(mapping.designSource).includes(".pen")) {
|
|
98
|
-
|
|
109
|
+
bindingsGate.advisory.push(
|
|
99
110
|
`Binding source for "${mapping.implementation}" does not look like a .pen path: "${mapping.designSource}".`
|
|
100
111
|
);
|
|
101
112
|
}
|
|
102
113
|
}
|
|
103
114
|
|
|
115
|
+
result.gates.bindingsHealth = finalizeGateEnvelope(bindingsGate, { strict });
|
|
116
|
+
attachBindingsGateFindings(result, result.gates.bindingsHealth);
|
|
104
117
|
result.notes.push("lint-bindings defaults to advisory mode; pass `--strict` to block on findings.");
|
|
105
118
|
return finalize(result);
|
|
106
119
|
}
|