sdtk-code-kit 0.2.1 → 0.3.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/README.md +204 -204
- package/assets/manifest/toolkit-bundle.manifest.json +147 -147
- package/assets/manifest/toolkit-bundle.sha256.txt +5 -5
- package/bin/sdtk-code.js +14 -14
- package/package.json +44 -44
- package/src/commands/agent-team.js +174 -0
- package/src/commands/build.js +53 -53
- package/src/commands/doctor.js +51 -51
- package/src/commands/generate.js +11 -11
- package/src/commands/guardrails.js +215 -215
- package/src/commands/help.js +257 -244
- package/src/commands/init.js +98 -98
- package/src/commands/plan.js +53 -53
- package/src/commands/readiness.js +77 -77
- package/src/commands/resume.js +61 -61
- package/src/commands/runtime.js +224 -224
- package/src/commands/ship.js +59 -59
- package/src/commands/sleep.js +132 -132
- package/src/commands/start.js +89 -89
- package/src/commands/status.js +77 -77
- package/src/commands/update.js +11 -11
- package/src/commands/verify.js +71 -71
- package/src/index.js +112 -108
- package/src/lib/agent-team-export.js +409 -0
- package/src/lib/agent-team-plan.js +514 -0
- package/src/lib/args.js +107 -107
- package/src/lib/errors.js +41 -41
- package/src/lib/powershell.js +65 -65
- package/src/lib/project-target-guard.js +53 -53
- package/src/lib/scope.js +72 -72
- package/src/lib/ship-readiness.js +281 -281
- package/src/lib/sleep-plan.js +175 -175
- package/src/lib/sleep-report.js +229 -229
- package/src/lib/toolkit-payload.js +72 -72
- package/src/lib/trust-events.js +185 -166
- package/src/lib/trust-file-scope.js +154 -154
- package/src/lib/trust-policy.js +212 -212
- package/src/lib/trust-redact.js +35 -35
- package/src/lib/trust-trace.js +179 -179
- package/src/lib/update.js +344 -344
- package/src/lib/workflow-artifact.js +503 -503
- package/src/lib/workflow-build.js +127 -127
- package/src/lib/workflow-doctor.js +83 -83
- package/src/lib/workflow-handoff.js +1029 -1029
- package/src/lib/workflow-intake.js +101 -101
- package/src/lib/workflow-plan.js +193 -193
- package/src/lib/workflow-review-packet.js +650 -650
- package/src/lib/workflow-ship.js +213 -213
- package/src/lib/workflow-state.js +438 -438
- package/src/lib/workflow-verify.js +393 -393
package/src/commands/verify.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const path = require("path");
|
|
4
|
-
const { parseFlags, requireFlag, validatePattern } = require("../lib/args");
|
|
5
|
-
const { ValidationError } = require("../lib/errors");
|
|
6
|
-
const { runVerify } = require("../lib/workflow-verify");
|
|
7
|
-
|
|
8
|
-
const FLAG_DEFS = {
|
|
9
|
-
"feature-key": { type: "string" },
|
|
10
|
-
"project-path": { type: "string" },
|
|
11
|
-
evidence: { type: "string", multiple: true },
|
|
12
|
-
"batch-summary": { type: "string" },
|
|
13
|
-
"changed-file": { type: "string", multiple: true },
|
|
14
|
-
"exclude-file": { type: "string", multiple: true },
|
|
15
|
-
"truth-sync-target": { type: "string", multiple: true },
|
|
16
|
-
"commit-include": { type: "string", multiple: true },
|
|
17
|
-
"commit-exclude": { type: "string", multiple: true },
|
|
18
|
-
caveat: { type: "string", multiple: true },
|
|
19
|
-
"reviewer-guidance": { type: "string", multiple: true },
|
|
20
|
-
"spec-status": { type: "string" },
|
|
21
|
-
"spec-note": { type: "string", multiple: true },
|
|
22
|
-
"quality-status": { type: "string" },
|
|
23
|
-
"quality-note": { type: "string", multiple: true },
|
|
24
|
-
"debug-note": { type: "string", multiple: true },
|
|
25
|
-
complete: { type: "boolean" },
|
|
26
|
-
blocked: { type: "boolean" },
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const FEATURE_KEY_RE = /^[A-Z0-9_]+$/;
|
|
30
|
-
|
|
31
|
-
function cmdVerify(args) {
|
|
32
|
-
const { flags, positional } = parseFlags(args, FLAG_DEFS);
|
|
33
|
-
if (positional.length > 0) {
|
|
34
|
-
throw new ValidationError('Unexpected positional arguments. Use flags only for "verify".');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const featureKey = requireFlag(flags, "feature-key", "feature-key");
|
|
38
|
-
validatePattern(
|
|
39
|
-
featureKey,
|
|
40
|
-
FEATURE_KEY_RE,
|
|
41
|
-
"feature-key",
|
|
42
|
-
"Must use UPPER_SNAKE_CASE, for example ORDER_MGMT."
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
const projectPath = flags["project-path"] ? path.resolve(flags["project-path"]) : process.cwd();
|
|
46
|
-
const result = runVerify(projectPath, featureKey, flags);
|
|
47
|
-
|
|
48
|
-
console.log("SDTK-CODE workflow verify");
|
|
49
|
-
console.log(` Feature key: ${featureKey}`);
|
|
50
|
-
console.log(` Lane: ${result.lane}`);
|
|
51
|
-
console.log(` Status: ${result.phaseStatus}`);
|
|
52
|
-
console.log(` Artifact: ${result.artifactPath}`);
|
|
53
|
-
console.log(` Review: ${result.reviewPacketPath}`);
|
|
54
|
-
console.log(` Evidence: ${result.evidenceCount}`);
|
|
55
|
-
console.log(
|
|
56
|
-
` Gates: evidence=${result.evidenceGate}, spec=${result.specGateStatus}, quality=${result.qualityGateStatus}`
|
|
57
|
-
);
|
|
58
|
-
console.log(` Next phase: ${result.nextPhase}`);
|
|
59
|
-
console.log(` Engine: ${result.suggestedEngineSkills.join(", ")}`);
|
|
60
|
-
if (Array.isArray(result.provenanceWarnings) && result.provenanceWarnings.length > 0) {
|
|
61
|
-
result.provenanceWarnings.forEach((warning) => {
|
|
62
|
-
console.log(` Warning: provenance: ${warning}`);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
module.exports = {
|
|
70
|
-
cmdVerify,
|
|
71
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { parseFlags, requireFlag, validatePattern } = require("../lib/args");
|
|
5
|
+
const { ValidationError } = require("../lib/errors");
|
|
6
|
+
const { runVerify } = require("../lib/workflow-verify");
|
|
7
|
+
|
|
8
|
+
const FLAG_DEFS = {
|
|
9
|
+
"feature-key": { type: "string" },
|
|
10
|
+
"project-path": { type: "string" },
|
|
11
|
+
evidence: { type: "string", multiple: true },
|
|
12
|
+
"batch-summary": { type: "string" },
|
|
13
|
+
"changed-file": { type: "string", multiple: true },
|
|
14
|
+
"exclude-file": { type: "string", multiple: true },
|
|
15
|
+
"truth-sync-target": { type: "string", multiple: true },
|
|
16
|
+
"commit-include": { type: "string", multiple: true },
|
|
17
|
+
"commit-exclude": { type: "string", multiple: true },
|
|
18
|
+
caveat: { type: "string", multiple: true },
|
|
19
|
+
"reviewer-guidance": { type: "string", multiple: true },
|
|
20
|
+
"spec-status": { type: "string" },
|
|
21
|
+
"spec-note": { type: "string", multiple: true },
|
|
22
|
+
"quality-status": { type: "string" },
|
|
23
|
+
"quality-note": { type: "string", multiple: true },
|
|
24
|
+
"debug-note": { type: "string", multiple: true },
|
|
25
|
+
complete: { type: "boolean" },
|
|
26
|
+
blocked: { type: "boolean" },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const FEATURE_KEY_RE = /^[A-Z0-9_]+$/;
|
|
30
|
+
|
|
31
|
+
function cmdVerify(args) {
|
|
32
|
+
const { flags, positional } = parseFlags(args, FLAG_DEFS);
|
|
33
|
+
if (positional.length > 0) {
|
|
34
|
+
throw new ValidationError('Unexpected positional arguments. Use flags only for "verify".');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const featureKey = requireFlag(flags, "feature-key", "feature-key");
|
|
38
|
+
validatePattern(
|
|
39
|
+
featureKey,
|
|
40
|
+
FEATURE_KEY_RE,
|
|
41
|
+
"feature-key",
|
|
42
|
+
"Must use UPPER_SNAKE_CASE, for example ORDER_MGMT."
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const projectPath = flags["project-path"] ? path.resolve(flags["project-path"]) : process.cwd();
|
|
46
|
+
const result = runVerify(projectPath, featureKey, flags);
|
|
47
|
+
|
|
48
|
+
console.log("SDTK-CODE workflow verify");
|
|
49
|
+
console.log(` Feature key: ${featureKey}`);
|
|
50
|
+
console.log(` Lane: ${result.lane}`);
|
|
51
|
+
console.log(` Status: ${result.phaseStatus}`);
|
|
52
|
+
console.log(` Artifact: ${result.artifactPath}`);
|
|
53
|
+
console.log(` Review: ${result.reviewPacketPath}`);
|
|
54
|
+
console.log(` Evidence: ${result.evidenceCount}`);
|
|
55
|
+
console.log(
|
|
56
|
+
` Gates: evidence=${result.evidenceGate}, spec=${result.specGateStatus}, quality=${result.qualityGateStatus}`
|
|
57
|
+
);
|
|
58
|
+
console.log(` Next phase: ${result.nextPhase}`);
|
|
59
|
+
console.log(` Engine: ${result.suggestedEngineSkills.join(", ")}`);
|
|
60
|
+
if (Array.isArray(result.provenanceWarnings) && result.provenanceWarnings.length > 0) {
|
|
61
|
+
result.provenanceWarnings.forEach((warning) => {
|
|
62
|
+
console.log(` Warning: provenance: ${warning}`);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = {
|
|
70
|
+
cmdVerify,
|
|
71
|
+
};
|
package/src/index.js
CHANGED
|
@@ -1,108 +1,112 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { cmdBuild } = require("./commands/build");
|
|
4
|
-
const { cmdDoctor } = require("./commands/doctor");
|
|
5
|
-
const {
|
|
6
|
-
const {
|
|
7
|
-
const {
|
|
8
|
-
const {
|
|
9
|
-
const {
|
|
10
|
-
const {
|
|
11
|
-
const {
|
|
12
|
-
const {
|
|
13
|
-
const {
|
|
14
|
-
const {
|
|
15
|
-
const {
|
|
16
|
-
const {
|
|
17
|
-
const {
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
case "
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return
|
|
77
|
-
case "
|
|
78
|
-
return
|
|
79
|
-
case "
|
|
80
|
-
return
|
|
81
|
-
case "
|
|
82
|
-
return
|
|
83
|
-
case "
|
|
84
|
-
return
|
|
85
|
-
case "
|
|
86
|
-
return
|
|
87
|
-
case "
|
|
88
|
-
return
|
|
89
|
-
case "
|
|
90
|
-
return
|
|
91
|
-
case "
|
|
92
|
-
return
|
|
93
|
-
case "
|
|
94
|
-
return
|
|
95
|
-
case "
|
|
96
|
-
return
|
|
97
|
-
case "
|
|
98
|
-
return
|
|
99
|
-
case "
|
|
100
|
-
return
|
|
101
|
-
case "
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { cmdBuild } = require("./commands/build");
|
|
4
|
+
const { cmdDoctor } = require("./commands/doctor");
|
|
5
|
+
const { cmdAgentTeam } = require("./commands/agent-team");
|
|
6
|
+
const { cmdGuardrails } = require("./commands/guardrails");
|
|
7
|
+
const { cmdHelp } = require("./commands/help");
|
|
8
|
+
const { cmdReadiness } = require("./commands/readiness");
|
|
9
|
+
const { cmdInit } = require("./commands/init");
|
|
10
|
+
const { cmdPlan } = require("./commands/plan");
|
|
11
|
+
const { cmdResume } = require("./commands/resume");
|
|
12
|
+
const { cmdRuntime } = require("./commands/runtime");
|
|
13
|
+
const { cmdShip } = require("./commands/ship");
|
|
14
|
+
const { cmdStart } = require("./commands/start");
|
|
15
|
+
const { cmdStatus } = require("./commands/status");
|
|
16
|
+
const { cmdSleep } = require("./commands/sleep");
|
|
17
|
+
const { cmdUpdate } = require("./commands/update");
|
|
18
|
+
const { cmdVerify } = require("./commands/verify");
|
|
19
|
+
const { ValidationError } = require("./lib/errors");
|
|
20
|
+
|
|
21
|
+
function getVersion() {
|
|
22
|
+
const pkg = require("../package.json");
|
|
23
|
+
return pkg.version;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function parseCommand(argv) {
|
|
27
|
+
if (!argv || argv.length === 0) {
|
|
28
|
+
return { command: "help", args: [] };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const [first, ...rest] = argv;
|
|
32
|
+
if (first === "-h" || first === "--help") {
|
|
33
|
+
return { command: "help", args: [] };
|
|
34
|
+
}
|
|
35
|
+
if (first === "-v" || first === "--version") {
|
|
36
|
+
return { command: "version", args: [] };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return { command: first, args: rest };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const COMMANDS = new Set([
|
|
43
|
+
"help",
|
|
44
|
+
"version",
|
|
45
|
+
"init",
|
|
46
|
+
"runtime",
|
|
47
|
+
"start",
|
|
48
|
+
"plan",
|
|
49
|
+
"build",
|
|
50
|
+
"verify",
|
|
51
|
+
"ship",
|
|
52
|
+
"status",
|
|
53
|
+
"doctor",
|
|
54
|
+
"guardrails",
|
|
55
|
+
"readiness",
|
|
56
|
+
"resume",
|
|
57
|
+
"sleep",
|
|
58
|
+
"agent-team",
|
|
59
|
+
"update",
|
|
60
|
+
]);
|
|
61
|
+
|
|
62
|
+
async function run(argv) {
|
|
63
|
+
const { command, args } = parseCommand(argv);
|
|
64
|
+
|
|
65
|
+
if (!COMMANDS.has(command)) {
|
|
66
|
+
throw new ValidationError(
|
|
67
|
+
`Unknown command: "${command}". Run "sdtk-code --help" for available commands.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
switch (command) {
|
|
72
|
+
case "help":
|
|
73
|
+
return cmdHelp();
|
|
74
|
+
case "version":
|
|
75
|
+
console.log(`sdtk-code-kit ${getVersion()}`);
|
|
76
|
+
return 0;
|
|
77
|
+
case "init":
|
|
78
|
+
return cmdInit(args);
|
|
79
|
+
case "runtime":
|
|
80
|
+
return cmdRuntime(args);
|
|
81
|
+
case "start":
|
|
82
|
+
return cmdStart(args);
|
|
83
|
+
case "plan":
|
|
84
|
+
return cmdPlan(args);
|
|
85
|
+
case "build":
|
|
86
|
+
return cmdBuild(args);
|
|
87
|
+
case "verify":
|
|
88
|
+
return cmdVerify(args);
|
|
89
|
+
case "ship":
|
|
90
|
+
return cmdShip(args);
|
|
91
|
+
case "status":
|
|
92
|
+
return cmdStatus(args);
|
|
93
|
+
case "doctor":
|
|
94
|
+
return cmdDoctor(args);
|
|
95
|
+
case "guardrails":
|
|
96
|
+
return cmdGuardrails(args);
|
|
97
|
+
case "readiness":
|
|
98
|
+
return cmdReadiness(args);
|
|
99
|
+
case "resume":
|
|
100
|
+
return cmdResume(args);
|
|
101
|
+
case "sleep":
|
|
102
|
+
return cmdSleep(args);
|
|
103
|
+
case "agent-team":
|
|
104
|
+
return cmdAgentTeam(args);
|
|
105
|
+
case "update":
|
|
106
|
+
return cmdUpdate(args);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
module.exports = {
|
|
111
|
+
run,
|
|
112
|
+
};
|