@elvis1513/auto-coding-skill 2.2.1 → 3.0.1
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 +178 -46
- package/cli/assets/agents/browser-debugger.toml +5 -7
- package/cli/assets/agents/docs-researcher.toml +3 -5
- package/cli/assets/agents/explorer.toml +5 -10
- package/cli/assets/agents/fixer.toml +19 -17
- package/cli/assets/agents/reviewer.toml +14 -10
- package/cli/assets/skill/SKILL.md +152 -37
- package/cli/assets/skill/data/contracts/orchestration-v1.schema.json +475 -0
- package/cli/assets/skill/data/templates/ENGINEERING.md +226 -74
- package/cli/assets/skill/data/templates/bridges/AGENTS.md +4 -4
- package/cli/assets/skill/data/templates/docs/tasks/closure-log.md +7 -6
- package/cli/assets/skill/data/templates/docs/tasks/taskbook.md +11 -4
- package/cli/assets/skill/scripts/ap.py +3296 -545
- package/cli/src/index.js +411 -51
- package/cli/tests/ap_concurrency_test.py +1578 -0
- package/cli/tests/ap_profiles_test.py +242 -98
- package/cli/tests/index.test.js +410 -15
- package/package.json +4 -4
package/cli/tests/index.test.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import zlib from "node:zlib";
|
|
4
5
|
import { spawnSync } from "node:child_process";
|
|
5
6
|
import { fileURLToPath } from "node:url";
|
|
6
7
|
|
|
7
8
|
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
8
9
|
const cli = path.join(repoRoot, "cli", "src", "index.js");
|
|
9
10
|
const assetAp = path.join(repoRoot, "cli", "assets", "skill", "scripts", "ap.py");
|
|
11
|
+
// Frozen gzip/base64 fixture of the official v2.2.0 ENGINEERING body (frontmatter excluded).
|
|
12
|
+
const officialV220EngineeringBody = zlib.gunzipSync(Buffer.from(
|
|
13
|
+
"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",
|
|
14
|
+
"base64",
|
|
15
|
+
)).toString("utf8");
|
|
10
16
|
const managedAgentEfforts = {
|
|
11
17
|
"browser-debugger.toml": "xhigh",
|
|
12
18
|
"docs-researcher.toml": "medium",
|
|
@@ -97,7 +103,46 @@ function listProjectFiles(root) {
|
|
|
97
103
|
return out;
|
|
98
104
|
}
|
|
99
105
|
|
|
106
|
+
function fillRequiredAccess(repo, password = "local-dev-password") {
|
|
107
|
+
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
108
|
+
const text = fs.readFileSync(engineering, "utf8");
|
|
109
|
+
const block = [
|
|
110
|
+
"access:",
|
|
111
|
+
" project:",
|
|
112
|
+
" frontend:",
|
|
113
|
+
' url: "http://project-frontend.local"',
|
|
114
|
+
' username: "project-frontend-user"',
|
|
115
|
+
` password: ${JSON.stringify(password)}`,
|
|
116
|
+
" backend:",
|
|
117
|
+
' url: "http://project-backend.local"',
|
|
118
|
+
' username: "project-backend-user"',
|
|
119
|
+
` password: ${JSON.stringify(password)}`,
|
|
120
|
+
" jenkins:",
|
|
121
|
+
" frontend:",
|
|
122
|
+
' url: "http://jenkins-frontend.local"',
|
|
123
|
+
' username: "jenkins-frontend-user"',
|
|
124
|
+
` password: ${JSON.stringify(password)}`,
|
|
125
|
+
" backend:",
|
|
126
|
+
' url: "http://jenkins-backend.local"',
|
|
127
|
+
' username: "jenkins-backend-user"',
|
|
128
|
+
` password: ${JSON.stringify(password)}`,
|
|
129
|
+
" gitlab:",
|
|
130
|
+
' url: "http://gitlab.local"',
|
|
131
|
+
' username: "gitlab-user"',
|
|
132
|
+
` password: ${JSON.stringify(password)}`,
|
|
133
|
+
" nexus:",
|
|
134
|
+
" frontend:",
|
|
135
|
+
' url: "http://nexus-frontend.local"',
|
|
136
|
+
' username: "nexus-frontend-user"',
|
|
137
|
+
` password: ${JSON.stringify(password)}`,
|
|
138
|
+
].join("\n");
|
|
139
|
+
const updated = text.replace(/^access:\r?\n[\s\S]*?(?=^concurrency:)/m, `${block}\n\n`);
|
|
140
|
+
assert(updated !== text || text.includes(password), "required access block should be replaceable");
|
|
141
|
+
fs.writeFileSync(engineering, updated);
|
|
142
|
+
}
|
|
143
|
+
|
|
100
144
|
function assertStatusOk(repo) {
|
|
145
|
+
fillRequiredAccess(repo);
|
|
101
146
|
const result = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
102
147
|
const parsed = JSON.parse(result.stdout);
|
|
103
148
|
assert(parsed.results[0].ok === true, `status should be ok: ${result.stdout}`);
|
|
@@ -161,32 +206,82 @@ function testMinimalSyncConvergesWithinBudget() {
|
|
|
161
206
|
|
|
162
207
|
const files = listProjectFiles(repo);
|
|
163
208
|
const lines = files.reduce((total, file) => total + fs.readFileSync(file, "utf8").split(/\r?\n/).length, 0);
|
|
164
|
-
assert(files.length <=
|
|
165
|
-
assert(lines <=
|
|
209
|
+
assert(files.length <= 21, `minimal scaffold file budget exceeded: ${files.length}`);
|
|
210
|
+
assert(lines <= 9100, `minimal scaffold line budget exceeded: ${lines}`);
|
|
166
211
|
const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
|
|
167
212
|
assert(engineering.includes("profile: \"auto\""), "engineering should enable adaptive profiles");
|
|
168
|
-
assert(engineering.includes("
|
|
213
|
+
assert(engineering.includes("isolation: \"worktree\""), "engineering should require task worktree isolation");
|
|
214
|
+
assert(engineering.includes('completion: "push"'), "engineering should complete normal development at push");
|
|
215
|
+
assert(engineering.includes('gate_changed: "git diff --check"'), "generic projects should receive the fast diff gate");
|
|
169
216
|
assert(engineering.includes(`name: "${path.basename(repo)}"`), "project name should be initialized automatically");
|
|
217
|
+
assert(engineering.includes("## Subagent orchestration"), "engineering should install the orchestration contract");
|
|
218
|
+
assert(engineering.includes("Never run two writers in one worktree"), "engineering should enforce one writer per worktree");
|
|
219
|
+
const fixer = fs.readFileSync(path.join(repo, ".agents", "agents", "fixer.toml"), "utf8");
|
|
220
|
+
const reviewer = fs.readFileSync(path.join(repo, ".agents", "agents", "reviewer.toml"), "utf8");
|
|
221
|
+
const browserDebugger = fs.readFileSync(path.join(repo, ".agents", "agents", "browser-debugger.toml"), "utf8");
|
|
222
|
+
assert(fixer.includes("owned_paths"), "fixer should receive explicit path ownership");
|
|
223
|
+
assert(fixer.includes("不提交、不推送、不集成"), "fixer should leave Git lifecycle to the main agent");
|
|
224
|
+
assert(reviewer.includes("diff_fingerprint"), "reviewer verdict should bind to a stable diff");
|
|
225
|
+
assert(browserDebugger.includes('sandbox_mode = "read-only"'), "browser discovery should be read-only");
|
|
226
|
+
|
|
227
|
+
const incomplete = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
|
|
228
|
+
assert(incomplete.status !== 0, "status should require access values after scaffold creation");
|
|
229
|
+
const missing = JSON.parse(incomplete.stdout).results[0].missingConfigTokens;
|
|
230
|
+
for (const field of [
|
|
231
|
+
"access.project.frontend.password",
|
|
232
|
+
"access.project.backend.password",
|
|
233
|
+
"access.jenkins.frontend.password",
|
|
234
|
+
"access.jenkins.backend.password",
|
|
235
|
+
"access.gitlab.password",
|
|
236
|
+
"access.nexus.frontend.password",
|
|
237
|
+
]) {
|
|
238
|
+
assert(missing.includes(field), `status should report missing direct credential: ${field}`);
|
|
239
|
+
}
|
|
240
|
+
assert(!JSON.parse(incomplete.stdout).results[0].next.includes("upgrade"), "fresh projects with present blank fields should be told to fill them directly");
|
|
241
|
+
|
|
170
242
|
assertStatusOk(repo);
|
|
171
243
|
|
|
172
244
|
const doctor = run("python3", [path.join(repo, "docs", "tools", "autopipeline", "ap.py"), "--repo", repo, "doctor"], { check: false });
|
|
173
245
|
const doctorOutput = `${doctor.stdout}\n${doctor.stderr}`;
|
|
174
|
-
assert(doctor.status
|
|
175
|
-
for (const unexpected of ["target_env.name", "backend_root", "jenkins.base_url", "docs.api_doc"]) {
|
|
246
|
+
assert(doctor.status === 0, `filled generic project should pass the local doctor: ${doctorOutput}`);
|
|
247
|
+
for (const unexpected of ["target_env.name", "backend_root", "jenkins.base_url", "docs.api_doc", "gate_full"]) {
|
|
176
248
|
assert(!doctorOutput.includes(unexpected), `default doctor should not require optional field: ${unexpected}`);
|
|
177
249
|
}
|
|
178
250
|
}
|
|
179
251
|
|
|
180
|
-
function
|
|
252
|
+
function testStatusRejectsLegacyIsolation() {
|
|
253
|
+
const repo = tmpdir("legacy-isolation-status");
|
|
254
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
255
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
256
|
+
fillRequiredAccess(repo);
|
|
257
|
+
const engineeringPath = path.join(repo, "docs", "ENGINEERING.md");
|
|
258
|
+
const engineering = fs.readFileSync(engineeringPath, "utf8").replace(
|
|
259
|
+
'isolation: "worktree"',
|
|
260
|
+
'isolation: "legacy"',
|
|
261
|
+
);
|
|
262
|
+
fs.writeFileSync(engineeringPath, engineering);
|
|
263
|
+
|
|
264
|
+
const result = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
|
|
265
|
+
assert(result.status !== 0, "status must reject legacy isolation");
|
|
266
|
+
const parsed = JSON.parse(result.stdout).results[0];
|
|
267
|
+
assert(
|
|
268
|
+
parsed.invalidConfigTokens.includes("concurrency.isolation (must be worktree)"),
|
|
269
|
+
`status should identify the invalid isolation value: ${result.stdout}`,
|
|
270
|
+
);
|
|
271
|
+
assert(parsed.next.includes("upgrade --write"), "status should direct legacy projects through upgrade");
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function testOrdinaryNodeTestIsNotPromotedToAutomaticGate() {
|
|
181
275
|
const repo = tmpdir("node-gate-inference");
|
|
182
276
|
writeFile(path.join(repo, "package.json"), JSON.stringify({ scripts: { test: "node --test" } }, null, 2) + "\n");
|
|
183
277
|
run("node", [cli, "init"], { cwd: repo });
|
|
184
278
|
run("node", [cli, "sync", "--projects", repo]);
|
|
185
279
|
const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
|
|
186
|
-
assert(engineering.includes('gate_changed: "
|
|
187
|
-
assert(engineering.includes(
|
|
188
|
-
assert(engineering.includes(
|
|
280
|
+
assert(engineering.includes('gate_changed: "git diff --check"'), "ordinary test must not replace the fast default gate");
|
|
281
|
+
assert(!engineering.includes("gate_standard:"), "ordinary test must not seed an automatic standard gate");
|
|
282
|
+
assert(!engineering.includes("gate_full:"), "ordinary test must not seed an automatic full gate");
|
|
189
283
|
|
|
284
|
+
fillRequiredAccess(repo);
|
|
190
285
|
run("git", ["init", "-q"], { cwd: repo });
|
|
191
286
|
run("git", ["config", "user.email", "test@example.com"], { cwd: repo });
|
|
192
287
|
run("git", ["config", "user.name", "Auto Coding Test"], { cwd: repo });
|
|
@@ -195,7 +290,49 @@ function testOrdinaryNodeTestIsNotPromotedToFullGate() {
|
|
|
195
290
|
writeFile(path.join(repo, "migrations", "001.sql"), "-- migration\n");
|
|
196
291
|
const launcher = path.join(repo, "docs", "tools", "autopipeline", "ap.py");
|
|
197
292
|
const doctor = run("python3", [launcher, "--repo", repo, "doctor"], { check: false });
|
|
198
|
-
assert(doctor.status
|
|
293
|
+
assert(doctor.status === 0, `high-risk paths must not expand the local gate: ${doctor.stdout}\n${doctor.stderr}`);
|
|
294
|
+
const gate = run("python3", [launcher, "--repo", repo, "light-gate", "--scope", "changed"]);
|
|
295
|
+
assert(!gate.stdout.includes("[run] gate_changed"), "the default diff gate must not run twice");
|
|
296
|
+
assert((gate.stdout.match(/\[diff-check\] OK/g) || []).length === 1, "the built-in fast diff gate should run exactly once");
|
|
297
|
+
const expanded = run("python3", [launcher, "--repo", repo, "light-gate", "--scope", "full"], { check: false });
|
|
298
|
+
assert(expanded.status !== 0 && expanded.stderr.includes("invalid choice"), "light-gate must reject standard/full scopes instead of silently downgrading them");
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function testAccessPasswordsAreRequiredButNeverPrintedByStatus() {
|
|
302
|
+
const repo = tmpdir("required-access");
|
|
303
|
+
const secret = "unique-local-secret-7f91";
|
|
304
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
305
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
306
|
+
fillRequiredAccess(repo, secret);
|
|
307
|
+
|
|
308
|
+
const healthy = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
309
|
+
assert(!healthy.stdout.includes(secret), "status JSON must not echo configured passwords");
|
|
310
|
+
|
|
311
|
+
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
312
|
+
writeFile(engineering, fs.readFileSync(engineering, "utf8").replace(
|
|
313
|
+
` password: ${JSON.stringify(secret)}`,
|
|
314
|
+
' password: "" # direct value required\n password_env: "PROJECT_FRONTEND_PASSWORD"',
|
|
315
|
+
));
|
|
316
|
+
const missing = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
|
|
317
|
+
assert(missing.status !== 0, "an environment reference must not replace the required direct password");
|
|
318
|
+
assert(JSON.parse(missing.stdout).results[0].missingConfigTokens.includes("access.project.frontend.password"), "status should name the missing direct password field");
|
|
319
|
+
assert(!missing.stdout.includes(secret), "failed status JSON must not echo other configured passwords");
|
|
320
|
+
assert(!JSON.parse(missing.stdout).results[0].next.includes("upgrade"), "present but blank fields should not trigger a no-op upgrade recommendation");
|
|
321
|
+
|
|
322
|
+
for (const yamlValue of ["false", "[]", "{}", "2026-07-13", "0x10", "|"]) {
|
|
323
|
+
fillRequiredAccess(repo);
|
|
324
|
+
writeFile(engineering, fs.readFileSync(engineering, "utf8").replace(' password: "local-dev-password"', ` password: ${yamlValue}`));
|
|
325
|
+
const nonString = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
|
|
326
|
+
assert(JSON.parse(nonString.stdout).results[0].missingConfigTokens.includes("access.project.frontend.password"), `YAML non-string ${yamlValue} must not count as a credential string`);
|
|
327
|
+
}
|
|
328
|
+
fillRequiredAccess(repo);
|
|
329
|
+
writeFile(engineering, fs.readFileSync(engineering, "utf8").replace(' password: "local-dev-password"', ' password: "TO\\u0044O"'));
|
|
330
|
+
const escapedPlaceholder = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
|
|
331
|
+
assert(JSON.parse(escapedPlaceholder.stdout).results[0].missingConfigTokens.includes("access.project.frontend.password"), "escaped YAML placeholders must be decoded before validation");
|
|
332
|
+
|
|
333
|
+
writeFile(engineering, fs.readFileSync(engineering, "utf8").replace(/^access:\r?\n[\s\S]*?(?=^concurrency:)/m, ""));
|
|
334
|
+
const absent = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
|
|
335
|
+
assert(JSON.parse(absent.stdout).results[0].next.includes("upgrade --write"), "missing access paths should recommend configuration upgrade");
|
|
199
336
|
}
|
|
200
337
|
|
|
201
338
|
function testManagedAgentModelsInheritAndOverridesSurvive() {
|
|
@@ -314,6 +451,9 @@ function testBridgeIsGeneric() {
|
|
|
314
451
|
run("node", [cli, "init", "--force"], { cwd: repo });
|
|
315
452
|
run("python3", [assetAp, "--repo", repo, "install", "--bridges"]);
|
|
316
453
|
assert(exists(path.join(repo, "AGENTS.md")), "generic bridge should be created");
|
|
454
|
+
const bridge = fs.readFileSync(path.join(repo, "AGENTS.md"), "utf8");
|
|
455
|
+
assert(bridge.includes("Never run two writers in one worktree"), "bridge should expose writer isolation");
|
|
456
|
+
assert(bridge.includes("integrated"), "bridge should expose dependency ordering");
|
|
317
457
|
for (const filename of [`CO${"DEX.md"}`, `CLA${"UDE.md"}`]) {
|
|
318
458
|
assert(!exists(path.join(repo, filename)), "client-named bridge should not be created");
|
|
319
459
|
}
|
|
@@ -429,7 +569,7 @@ function testUpgradeInitializesNewEngineeringDefaults() {
|
|
|
429
569
|
const repo = tmpdir("upgrade-engineering-defaults");
|
|
430
570
|
const fakeHome = tmpdir("upgrade-engineering-home");
|
|
431
571
|
run("git", ["init", "-q"], { cwd: repo });
|
|
432
|
-
writeFile(path.join(repo, "package.json"), JSON.stringify({ scripts: { test: "node --test", "test:
|
|
572
|
+
writeFile(path.join(repo, "package.json"), JSON.stringify({ scripts: { test: "node --test", "test:changed": "node --test" } }, null, 2) + "\n");
|
|
433
573
|
run("node", [cli, "init"], { cwd: repo });
|
|
434
574
|
|
|
435
575
|
const projectAp = path.join(repo, ".agents", "skills", "auto-coding-skill", "scripts", "ap.py");
|
|
@@ -437,10 +577,58 @@ function testUpgradeInitializesNewEngineeringDefaults() {
|
|
|
437
577
|
|
|
438
578
|
const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
|
|
439
579
|
assert(engineering.includes(`name: "${path.basename(repo)}"`), "upgrade should initialize a newly created project name");
|
|
440
|
-
|
|
441
|
-
|
|
580
|
+
assert(engineering.includes('gate_changed: "npm run test:changed"'), "upgrade should infer only a dedicated changed-scope test");
|
|
581
|
+
assert(!engineering.includes("gate_standard:"), "upgrade must not infer an automatic standard gate");
|
|
582
|
+
assert(!engineering.includes("gate_full:"), "upgrade must not infer an automatic full gate");
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
function testUpgradeMigratesLegacyAutomaticGateToFastDefault() {
|
|
586
|
+
const repo = tmpdir("upgrade-legacy-fast-gate");
|
|
587
|
+
run("git", ["init", "-q"], { cwd: repo });
|
|
588
|
+
writeFile(path.join(repo, "package.json"), JSON.stringify({ scripts: { test: "node --test" } }, null, 2) + "\n");
|
|
589
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
590
|
+
writeFile(path.join(repo, "docs", "ENGINEERING.md"), [
|
|
591
|
+
"---",
|
|
592
|
+
"workflow:",
|
|
593
|
+
" mode: verify",
|
|
594
|
+
" profile: auto",
|
|
595
|
+
"project:",
|
|
596
|
+
' name: "legacy"',
|
|
597
|
+
"concurrency:",
|
|
598
|
+
" isolation: legacy",
|
|
599
|
+
" base_ref: origin/dev",
|
|
600
|
+
" target_branch: dev",
|
|
601
|
+
"commands:",
|
|
602
|
+
' gate_changed: "npm test"',
|
|
603
|
+
' gate_standard: "npm test"',
|
|
604
|
+
' gate_full: "npm run test:full"',
|
|
605
|
+
"gate:",
|
|
606
|
+
" default_scope: auto",
|
|
607
|
+
" fallback_scope: standard",
|
|
608
|
+
" full_on_unknown: true",
|
|
609
|
+
" no_change_scope: standard",
|
|
610
|
+
" rules: []",
|
|
611
|
+
"---",
|
|
612
|
+
"# Legacy engineering",
|
|
613
|
+
"",
|
|
614
|
+
].join("\n"));
|
|
615
|
+
|
|
616
|
+
run("python3", [assetAp, "--repo", repo, "upgrade", "--write"]);
|
|
617
|
+
const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
|
|
618
|
+
assert(engineering.includes("gate_changed: git diff --check"), "upgrade should replace the v3 auto-seeded npm test gate");
|
|
619
|
+
assert(engineering.includes("mode: dev"), "upgrade should migrate verify mode to fast development mode");
|
|
620
|
+
assert(engineering.includes("completion: push"), "upgrade should add push completion");
|
|
621
|
+
assert(engineering.includes("isolation: worktree"), "upgrade should migrate legacy isolation to worktree");
|
|
622
|
+
for (const key of ["default_scope", "fallback_scope", "no_change_scope"]) {
|
|
623
|
+
assert(engineering.includes(`${key}: changed`), `upgrade should migrate gate.${key} to changed`);
|
|
442
624
|
}
|
|
443
|
-
assert(engineering.includes(
|
|
625
|
+
assert(engineering.includes("full_on_unknown: false"), "upgrade should disable automatic full escalation");
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
function testRemovedVerificationFlagsFailFast() {
|
|
629
|
+
const repo = tmpdir("removed-verification-flags");
|
|
630
|
+
const result = run("python3", [assetAp, "--repo", repo, "commit-push", "T1", "--msg", "T1: test", "--require-jenkins"], { check: false });
|
|
631
|
+
assert(result.status !== 0 && result.stderr.includes("unrecognized arguments"), "removed post-push verification flags must fail instead of being ignored");
|
|
444
632
|
}
|
|
445
633
|
|
|
446
634
|
function testUpgradeInstallsRuntimeRequiredByLauncher() {
|
|
@@ -506,11 +694,210 @@ function testLedgerArchiveUpdatesExistingPeriodIndex() {
|
|
|
506
694
|
assert(index.includes("(2 files)"), `archive index should report cumulative design count: ${index}`);
|
|
507
695
|
}
|
|
508
696
|
|
|
697
|
+
function testManagedEngineeringSyncIsControlledAndIdempotent() {
|
|
698
|
+
const repo = tmpdir("managed-engineering");
|
|
699
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
700
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
701
|
+
|
|
702
|
+
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
703
|
+
const initial = fs.readFileSync(engineering, "utf8");
|
|
704
|
+
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=3\.0\.1 -->/;
|
|
705
|
+
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
706
|
+
assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
|
|
707
|
+
assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
|
|
708
|
+
|
|
709
|
+
const customized = initial
|
|
710
|
+
.replace("workflow:\n", "# project-frontmatter-comment\nworkflow:\n")
|
|
711
|
+
.replace(startPattern, "project note before managed workflow\n<!-- auto-coding-skill:managed-workflow:start version=3.0.0 -->")
|
|
712
|
+
.replace(endMarker, `${endMarker}\nproject note after managed workflow`)
|
|
713
|
+
.replace("## Execution profiles", "## Stale managed workflow");
|
|
714
|
+
writeFile(engineering, customized);
|
|
715
|
+
const staleStart = customized.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
716
|
+
const staleEnd = customized.indexOf(endMarker) + endMarker.length;
|
|
717
|
+
const outsideBefore = customized.slice(0, staleStart);
|
|
718
|
+
const outsideAfter = customized.slice(staleEnd);
|
|
719
|
+
|
|
720
|
+
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
721
|
+
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
722
|
+
assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
|
|
723
|
+
assert(dryResult.managedWorkflow.version === "3.0.1", "dry-run should expose the target workflow version");
|
|
724
|
+
assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
|
|
725
|
+
assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
|
|
726
|
+
|
|
727
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
728
|
+
const updated = fs.readFileSync(engineering, "utf8");
|
|
729
|
+
const updatedStart = updated.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
730
|
+
const updatedEnd = updated.indexOf(endMarker) + endMarker.length;
|
|
731
|
+
assert(updated.slice(0, updatedStart) === outsideBefore, "sync must preserve frontmatter and content before the managed block byte-for-byte");
|
|
732
|
+
assert(updated.slice(updatedEnd) === outsideAfter, "sync must preserve content after the managed block byte-for-byte");
|
|
733
|
+
assert(updated.includes("version=3.0.1"), "sync should install the current managed workflow version");
|
|
734
|
+
assert(updated.includes("## Execution profiles"), "sync should refresh stale managed workflow content");
|
|
735
|
+
|
|
736
|
+
fillRequiredAccess(repo);
|
|
737
|
+
const status = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
738
|
+
const statusResult = JSON.parse(status.stdout).results[0];
|
|
739
|
+
assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
|
|
740
|
+
assert(statusResult.managedWorkflow.version === "3.0.1", "status should expose the installed managed workflow version");
|
|
741
|
+
|
|
742
|
+
const beforeSecondSync = fs.readFileSync(engineering, "utf8");
|
|
743
|
+
const second = run("node", [cli, "sync", "--projects", repo, "--json"]);
|
|
744
|
+
assert(!JSON.parse(second.stdout).results[0].actions.some(item => item.path === "docs/ENGINEERING.md"), "current managed workflow should be idempotent");
|
|
745
|
+
assert(fs.readFileSync(engineering, "utf8") === beforeSecondSync, "idempotent sync must not rewrite ENGINEERING.md");
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
function testLegacyEngineeringMigrationPreservesExistingBody() {
|
|
749
|
+
const repo = tmpdir("legacy-managed-engineering");
|
|
750
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
751
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
752
|
+
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
753
|
+
const current = fs.readFileSync(engineering, "utf8");
|
|
754
|
+
const start = current.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
755
|
+
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
756
|
+
const end = current.indexOf(endMarker) + endMarker.length;
|
|
757
|
+
const legacyNote = "\n## Legacy project-specific workflow\n\nKeep this project note exactly.\n";
|
|
758
|
+
const legacy = `${current.slice(0, start)}${legacyNote}${current.slice(end)}`;
|
|
759
|
+
writeFile(engineering, legacy);
|
|
760
|
+
|
|
761
|
+
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
762
|
+
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
763
|
+
assert(dryResult.managedWorkflow.state === "legacy-custom", "unknown unmarked documents should be reported as a custom legacy migration");
|
|
764
|
+
assert(dryResult.managedWorkflow.preservedCustom === true, "custom legacy migration should expose its preservation policy");
|
|
765
|
+
assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
|
|
766
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
767
|
+
const migrated = fs.readFileSync(engineering, "utf8");
|
|
768
|
+
assert(migrated.includes("version=3.0.1"), "legacy migration should insert the current managed workflow");
|
|
769
|
+
assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
|
|
770
|
+
const migratedStart = migrated.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
771
|
+
const migratedEnd = migrated.indexOf(endMarker) + endMarker.length;
|
|
772
|
+
assert(`${migrated.slice(0, migratedStart)}${migrated.slice(migratedEnd)}` === legacy, "removing the inserted managed block should recover custom legacy content byte-for-byte");
|
|
773
|
+
|
|
774
|
+
const stable = fs.readFileSync(engineering, "utf8");
|
|
775
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
776
|
+
assert(fs.readFileSync(engineering, "utf8") === stable, "legacy migration should converge after one sync");
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
function testOfficialLegacyEngineeringBodyIsReplacedWithoutDuplication() {
|
|
780
|
+
const repo = tmpdir("official-legacy-engineering");
|
|
781
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
782
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
783
|
+
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
784
|
+
const current = fs.readFileSync(engineering, "utf8");
|
|
785
|
+
const frontmatter = current.match(/^---\r?\n[\s\S]*?\r?\n---(?:\r?\n|$)/)?.[0];
|
|
786
|
+
assert(frontmatter, "official legacy fixture requires frontmatter");
|
|
787
|
+
const customizedFrontmatter = frontmatter.replace("workflow:\n", "# keep-official-migration-config\nworkflow:\n");
|
|
788
|
+
writeFile(engineering, `${customizedFrontmatter}${officialV220EngineeringBody}`);
|
|
789
|
+
|
|
790
|
+
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
791
|
+
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
792
|
+
assert(dryResult.managedWorkflow.state === "legacy-official", `official body hash should select replacement migration: ${dryRun.stdout}`);
|
|
793
|
+
assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("official-legacy"), "official legacy action should identify replacement migration");
|
|
794
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
795
|
+
const migrated = fs.readFileSync(engineering, "utf8");
|
|
796
|
+
assert(migrated.startsWith(customizedFrontmatter), "official legacy migration must preserve YAML frontmatter byte-for-byte");
|
|
797
|
+
assert((migrated.match(/auto-coding-skill:managed-workflow:start/g) || []).length === 1, "official legacy migration should install exactly one managed workflow");
|
|
798
|
+
assert((migrated.match(/^## Execution profiles$/gm) || []).length === 1, "official legacy migration must replace rather than duplicate the old workflow body");
|
|
799
|
+
|
|
800
|
+
const stable = fs.readFileSync(engineering, "utf8");
|
|
801
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
802
|
+
assert(fs.readFileSync(engineering, "utf8") === stable, "official legacy migration should be idempotent");
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
function testMalformedManagedMarkersFailClosed() {
|
|
806
|
+
const cases = {
|
|
807
|
+
"single-start": "<!-- auto-coding-skill:managed-workflow:start version=3.0.0 -->\nold\n",
|
|
808
|
+
"single-end": "old\n<!-- auto-coding-skill:managed-workflow:end -->\n",
|
|
809
|
+
duplicate: "<!-- auto-coding-skill:managed-workflow:start version=3.0.0 -->\n<!-- auto-coding-skill:managed-workflow:start version=3.0.0 -->\n<!-- auto-coding-skill:managed-workflow:end -->\n",
|
|
810
|
+
nested: "<!-- auto-coding-skill:managed-workflow:start version=3.0.0 -->\n<!-- auto-coding-skill:managed-workflow:end -->\n<!-- auto-coding-skill:managed-workflow:end -->\n",
|
|
811
|
+
};
|
|
812
|
+
for (const [name, malformed] of Object.entries(cases)) {
|
|
813
|
+
const repo = tmpdir(`managed-marker-${name}`);
|
|
814
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
815
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
816
|
+
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
817
|
+
const text = fs.readFileSync(engineering, "utf8");
|
|
818
|
+
const start = text.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
819
|
+
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
820
|
+
const end = text.indexOf(endMarker) + endMarker.length;
|
|
821
|
+
writeFile(engineering, `${text.slice(0, start)}${malformed}${text.slice(end)}`);
|
|
822
|
+
const skill = path.join(repo, ".agents", "skills", "auto-coding-skill", "SKILL.md");
|
|
823
|
+
writeFile(skill, `user-sentinel-${name}\n`);
|
|
824
|
+
const before = fs.readFileSync(engineering, "utf8");
|
|
825
|
+
|
|
826
|
+
const result = run("node", [cli, "sync", "--projects", repo], { check: false });
|
|
827
|
+
assert(result.status !== 0 && result.stderr.includes("refusing to sync"), `${name}: malformed markers should reject sync`);
|
|
828
|
+
assert(fs.readFileSync(engineering, "utf8") === before, `${name}: rejected sync must not touch ENGINEERING.md`);
|
|
829
|
+
assert(fs.readFileSync(skill, "utf8") === `user-sentinel-${name}\n`, `${name}: preflight must reject before writing the skill`);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
function testSkillOnlySyncTouchesOnlySkill() {
|
|
834
|
+
const repo = tmpdir("skill-only-sync");
|
|
835
|
+
run("git", ["init", "-q"], { cwd: repo });
|
|
836
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
837
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
838
|
+
const skill = path.join(repo, ".agents", "skills", "auto-coding-skill", "SKILL.md");
|
|
839
|
+
const agent = path.join(repo, ".agents", "agents", "explorer.toml");
|
|
840
|
+
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
841
|
+
const launcher = path.join(repo, "docs", "tools", "autopipeline", "ap.py");
|
|
842
|
+
writeFile(skill, "stale skill\n");
|
|
843
|
+
writeFile(agent, `${fs.readFileSync(agent, "utf8")}\n# user-agent-sentinel\n`);
|
|
844
|
+
writeFile(engineering, `${fs.readFileSync(engineering, "utf8")}\nproject-engineering-sentinel\n`);
|
|
845
|
+
writeFile(launcher, `${fs.readFileSync(launcher, "utf8")}\n# user-launcher-sentinel\n`);
|
|
846
|
+
const untouched = new Map([[agent, fs.readFileSync(agent)], [engineering, fs.readFileSync(engineering)], [launcher, fs.readFileSync(launcher)]]);
|
|
847
|
+
|
|
848
|
+
const dryRun = run("node", [cli, "sync", "--projects", repo, "--components", "skill", "--dry-run", "--json"]);
|
|
849
|
+
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
850
|
+
assert(dryResult.components === "skill", "skill-only dry-run should expose its component scope");
|
|
851
|
+
assert(dryResult.actions.length === 1 && dryResult.actions[0].path === ".agents/skills/auto-coding-skill", "skill-only dry-run must plan only the skill directory");
|
|
852
|
+
assert(fs.readFileSync(skill, "utf8") === "stale skill\n", "skill-only dry-run must not write the skill");
|
|
853
|
+
|
|
854
|
+
run("node", [cli, "sync", "--projects", repo, "--components", "skill"]);
|
|
855
|
+
assert(fs.readFileSync(skill, "utf8").includes("# Auto Coding Skill"), "skill-only sync should refresh the managed skill");
|
|
856
|
+
for (const [file, content] of untouched) {
|
|
857
|
+
assert(fs.readFileSync(file).equals(content), `skill-only sync must not touch ${file}`);
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
const invalid = run("node", [cli, "sync", "--projects", repo, "--components", "docs"], { check: false });
|
|
861
|
+
assert(invalid.status !== 0 && invalid.stderr.includes("--components"), "sync should reject unknown component scopes");
|
|
862
|
+
const conflicting = run("node", [cli, "sync", "--projects", repo, "--components", "skill", "--reset-agent-models"], { check: false });
|
|
863
|
+
assert(conflicting.status !== 0, "skill-only sync should reject irrelevant agent reset options");
|
|
864
|
+
|
|
865
|
+
writeFile(skill, "legacy-task-sentinel\n");
|
|
866
|
+
writeFile(path.join(repo, ".git", "auto-coding-skill", "tasks", "T-LEGACY.json"), JSON.stringify({ schema: 1, task_id: "T-LEGACY" }));
|
|
867
|
+
const blocked = run("node", [cli, "sync", "--projects", repo, "--components", "skill"], { check: false });
|
|
868
|
+
assert(blocked.status !== 0 && blocked.stderr.includes("schema < 2"), "skill-only sync must block registered legacy tasks");
|
|
869
|
+
assert(blocked.stderr.includes("3.0.0 runtime") && blocked.stderr.includes("will not infer or auto-claim"), "legacy task error should give safe completion guidance");
|
|
870
|
+
assert(fs.readFileSync(skill, "utf8") === "legacy-task-sentinel\n", "blocked skill-only sync must not write the skill");
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
function testLegacyTaskPreflightRejectsWholeBatchAtomically() {
|
|
874
|
+
const first = tmpdir("legacy-batch-first");
|
|
875
|
+
const second = tmpdir("legacy-batch-second");
|
|
876
|
+
for (const repo of [first, second]) {
|
|
877
|
+
run("git", ["init", "-q"], { cwd: repo });
|
|
878
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
879
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
880
|
+
}
|
|
881
|
+
const firstSkill = path.join(first, ".agents", "skills", "auto-coding-skill", "SKILL.md");
|
|
882
|
+
const secondAgent = path.join(second, ".agents", "agents", "explorer.toml");
|
|
883
|
+
writeFile(firstSkill, "first-project-sentinel\n");
|
|
884
|
+
writeFile(secondAgent, `${fs.readFileSync(secondAgent, "utf8")}\n# second-project-sentinel\n`);
|
|
885
|
+
const secondAgentBefore = fs.readFileSync(secondAgent);
|
|
886
|
+
writeFile(path.join(second, ".git", "auto-coding-skill", "tasks", "T-V3.json"), JSON.stringify({ schema: 1, task_id: "T-V3" }));
|
|
887
|
+
|
|
888
|
+
const result = run("node", [cli, "sync", "--projects", `${first},${second}`], { check: false });
|
|
889
|
+
assert(result.status !== 0 && result.stderr.includes("entire sync batch"), "one legacy task should reject the complete multi-project batch");
|
|
890
|
+
assert(fs.readFileSync(firstSkill, "utf8") === "first-project-sentinel\n", "batch preflight must reject before writing an earlier clean project");
|
|
891
|
+
assert(fs.readFileSync(secondAgent).equals(secondAgentBefore), "batch preflight must not write the project containing the legacy task");
|
|
892
|
+
}
|
|
893
|
+
|
|
509
894
|
testPreflightAvoidsPartialInstall();
|
|
510
895
|
testDestVariants();
|
|
511
896
|
testLauncherFallsBackToGlobalRuntime();
|
|
512
897
|
testMinimalSyncConvergesWithinBudget();
|
|
513
|
-
|
|
898
|
+
testStatusRejectsLegacyIsolation();
|
|
899
|
+
testOrdinaryNodeTestIsNotPromotedToAutomaticGate();
|
|
900
|
+
testAccessPasswordsAreRequiredButNeverPrintedByStatus();
|
|
514
901
|
testManagedAgentModelsInheritAndOverridesSurvive();
|
|
515
902
|
testForcePreservesCustomAgentsAndModelOverrides();
|
|
516
903
|
testInvalidManagedAgentModelsFailStatusAndAreDroppedOnSync();
|
|
@@ -524,8 +911,16 @@ testTestingScaffoldMatchesCheckMatrixSchema();
|
|
|
524
911
|
testReviewScaffoldLeavesBaselineGenerationToBaselineCommand();
|
|
525
912
|
testUpgradePrefersModernProjectAssetsAndIgnoresRetiredTemplates();
|
|
526
913
|
testUpgradeInitializesNewEngineeringDefaults();
|
|
914
|
+
testUpgradeMigratesLegacyAutomaticGateToFastDefault();
|
|
915
|
+
testRemovedVerificationFlagsFailFast();
|
|
527
916
|
testUpgradeInstallsRuntimeRequiredByLauncher();
|
|
528
917
|
testLedgerArchiveRecognizesSettledStatuses();
|
|
529
918
|
testLedgerArchiveUpdatesExistingPeriodIndex();
|
|
919
|
+
testManagedEngineeringSyncIsControlledAndIdempotent();
|
|
920
|
+
testLegacyEngineeringMigrationPreservesExistingBody();
|
|
921
|
+
testOfficialLegacyEngineeringBodyIsReplacedWithoutDuplication();
|
|
922
|
+
testMalformedManagedMarkersFailClosed();
|
|
923
|
+
testSkillOnlySyncTouchesOnlySkill();
|
|
924
|
+
testLegacyTaskPreflightRejectsWholeBatchAtomically();
|
|
530
925
|
|
|
531
926
|
console.log("cli-installer-regression-ok");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvis1513/auto-coding-skill",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "CLI installer for
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "CLI installer for an isolated .agents engineering workflow with parallel Git worktrees, fast local gates, push-based completion, and safe cleanup.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"autocoding": "cli/src/index.js"
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"LICENSE"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"test": "node -c cli/src/index.js && node -c cli/src/sync-assets.js && node -c cli/tests/index.test.js && node cli/tests/index.test.js && python3 -c \"import ast, pathlib; files = ['cli/assets/skill/scripts/ap.py', 'cli/assets/skill/scripts/core.py', 'cli/assets/skill/scripts/http_checks.py', 'cli/assets/skill/scripts/scaffold_templates.py']; [ast.parse(pathlib.Path(rel).read_text(encoding='utf-8'), filename=rel, feature_version=(3, 11)) for rel in files]; print('python311-asset-grammar-ok')\" && python3 -m py_compile cli/assets/skill/scripts/ap.py cli/assets/skill/scripts/core.py cli/assets/skill/scripts/http_checks.py cli/assets/skill/scripts/scaffold_templates.py && python3 cli/tests/ap_profiles_test.py && python3 -c \"import pathlib, tomllib; files = sorted(pathlib.Path('cli/assets/agents').glob('*.toml')); [tomllib.loads(path.read_text(encoding='utf-8')) for path in files]; print('asset-agent-toml-ok')\" && find cli -type d -name '__pycache__' -prune -exec rm -rf {} +",
|
|
18
|
+
"test": "node -c cli/src/index.js && node -c cli/src/sync-assets.js && node -c cli/tests/index.test.js && node cli/tests/index.test.js && python3 -c \"import ast, pathlib; files = ['cli/assets/skill/scripts/ap.py', 'cli/assets/skill/scripts/core.py', 'cli/assets/skill/scripts/http_checks.py', 'cli/assets/skill/scripts/scaffold_templates.py']; [ast.parse(pathlib.Path(rel).read_text(encoding='utf-8'), filename=rel, feature_version=(3, 11)) for rel in files]; print('python311-asset-grammar-ok')\" && python3 -m py_compile cli/assets/skill/scripts/ap.py cli/assets/skill/scripts/core.py cli/assets/skill/scripts/http_checks.py cli/assets/skill/scripts/scaffold_templates.py && python3 cli/tests/ap_profiles_test.py && python3 cli/tests/ap_concurrency_test.py && python3 -c \"import pathlib, tomllib; files = sorted(pathlib.Path('cli/assets/agents').glob('*.toml')); [tomllib.loads(path.read_text(encoding='utf-8')) for path in files]; print('asset-agent-toml-ok')\" && find cli -type d -name '__pycache__' -prune -exec rm -rf {} +",
|
|
19
19
|
"test:src": "python3 -c \"import ast, pathlib; files = ['src/auto-coding-skill/scripts/ap.py', 'src/auto-coding-skill/scripts/core.py', 'src/auto-coding-skill/scripts/http_checks.py', 'src/auto-coding-skill/scripts/scaffold_templates.py']; [ast.parse(pathlib.Path(rel).read_text(encoding='utf-8'), filename=rel, feature_version=(3, 11)) for rel in files]; print('python311-src-grammar-ok')\" && python3 -m py_compile src/auto-coding-skill/scripts/ap.py src/auto-coding-skill/scripts/core.py src/auto-coding-skill/scripts/http_checks.py src/auto-coding-skill/scripts/scaffold_templates.py && python3 -c \"import pathlib, tomllib; files = sorted(pathlib.Path('src/agents').glob('*.toml')); [tomllib.loads(path.read_text(encoding='utf-8')) for path in files]; print('src-agent-toml-ok')\" && find src -type d -name '__pycache__' -prune -exec rm -rf {} +",
|
|
20
20
|
"check:assets": "node cli/src/sync-assets.js --check",
|
|
21
21
|
"sync-assets": "node cli/src/sync-assets.js",
|
|
22
|
-
"release:check": "npm run
|
|
22
|
+
"release:check": "npm run check:assets && npm run test:src && npm run test && npm pack --dry-run"
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"publishConfig": {
|