@elvis1513/auto-coding-skill 3.0.0 → 3.0.2

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.
@@ -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,33 +206,100 @@ 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 <= 20, `minimal scaffold file budget exceeded: ${files.length}`);
165
- assert(lines <= 8200, `minimal scaffold line budget exceeded: ${lines}`);
209
+ assert(files.length <= 23, `minimal scaffold file budget exceeded: ${files.length}`);
210
+ assert(lines <= 10000, `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
213
  assert(engineering.includes("isolation: \"worktree\""), "engineering should require task worktree isolation");
169
- assert(engineering.includes("target_env_required: false"), "target verification should be opt-in in generic scaffold");
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");
170
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
+
171
242
  assertStatusOk(repo);
172
243
 
173
244
  const doctor = run("python3", [path.join(repo, "docs", "tools", "autopipeline", "ap.py"), "--repo", repo, "doctor"], { check: false });
174
245
  const doctorOutput = `${doctor.stdout}\n${doctor.stderr}`;
175
- assert(doctor.status !== 0 && doctorOutput.includes("gate command"), "empty generic repo should require only a real gate command");
176
- 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"]) {
177
248
  assert(!doctorOutput.includes(unexpected), `default doctor should not require optional field: ${unexpected}`);
178
249
  }
179
250
  }
180
251
 
181
- function testOrdinaryNodeTestIsNotPromotedToFullGate() {
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 testStatusRejectsLegacyGateEscalation() {
275
+ const repo = tmpdir("legacy-gate-status");
276
+ run("node", [cli, "init"], { cwd: repo });
277
+ run("node", [cli, "sync", "--projects", repo]);
278
+ const engineeringPath = path.join(repo, "docs", "ENGINEERING.md");
279
+ const engineering = fs.readFileSync(engineeringPath, "utf8").replace(
280
+ ' full_on_unknown: false\n no_change_scope: "changed"\n profile_log:',
281
+ ' full_on_unknown: true\n full_on: ["prod_config"]\n no_change_scope: "changed"\n rules:\n - match: ["Jenkinsfile"]\n scope: "full"\n commands: ["gate_full"]\n profile_log:',
282
+ );
283
+ fs.writeFileSync(engineeringPath, engineering);
284
+ const status = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
285
+ assert(status.status === 2, "legacy automatic gate escalation must make status non-zero");
286
+ const invalid = JSON.parse(status.stdout).results[0].invalidConfigTokens;
287
+ for (const expected of ["gate.full_on", "gate.full_on_unknown", "gate.rules[].scope", "gate.rules[].commands"]) {
288
+ assert(invalid.some(item => item.includes(expected)), `status should report ${expected}`);
289
+ }
290
+ }
291
+
292
+ function testOrdinaryNodeTestIsNotPromotedToAutomaticGate() {
182
293
  const repo = tmpdir("node-gate-inference");
183
294
  writeFile(path.join(repo, "package.json"), JSON.stringify({ scripts: { test: "node --test" } }, null, 2) + "\n");
184
295
  run("node", [cli, "init"], { cwd: repo });
185
296
  run("node", [cli, "sync", "--projects", repo]);
186
297
  const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
187
- assert(engineering.includes('gate_changed: "npm test"'), "ordinary test should seed the changed gate");
188
- assert(engineering.includes('gate_standard: "npm test"'), "ordinary test should seed the standard gate");
189
- assert(engineering.includes('gate_full: ""'), "ordinary test must not be promoted to the full gate");
298
+ assert(engineering.includes('gate_changed: "git diff --check"'), "ordinary test must not replace the fast default gate");
299
+ assert(!engineering.includes("gate_standard:"), "ordinary test must not seed an automatic standard gate");
300
+ assert(!engineering.includes("gate_full:"), "ordinary test must not seed an automatic full gate");
190
301
 
302
+ fillRequiredAccess(repo);
191
303
  run("git", ["init", "-q"], { cwd: repo });
192
304
  run("git", ["config", "user.email", "test@example.com"], { cwd: repo });
193
305
  run("git", ["config", "user.name", "Auto Coding Test"], { cwd: repo });
@@ -196,7 +308,49 @@ function testOrdinaryNodeTestIsNotPromotedToFullGate() {
196
308
  writeFile(path.join(repo, "migrations", "001.sql"), "-- migration\n");
197
309
  const launcher = path.join(repo, "docs", "tools", "autopipeline", "ap.py");
198
310
  const doctor = run("python3", [launcher, "--repo", repo, "doctor"], { check: false });
199
- assert(doctor.status !== 0 && `${doctor.stdout}\n${doctor.stderr}`.includes("full gate command"), "high-risk work should block until a dedicated full gate is configured");
311
+ assert(doctor.status === 0, `high-risk paths must not expand the local gate: ${doctor.stdout}\n${doctor.stderr}`);
312
+ const gate = run("python3", [launcher, "--repo", repo, "light-gate", "--scope", "changed"]);
313
+ assert(!gate.stdout.includes("[run] gate_changed"), "the default diff gate must not run twice");
314
+ assert((gate.stdout.match(/\[diff-check\] OK/g) || []).length === 1, "the built-in fast diff gate should run exactly once");
315
+ const expanded = run("python3", [launcher, "--repo", repo, "light-gate", "--scope", "full"], { check: false });
316
+ assert(expanded.status !== 0 && expanded.stderr.includes("invalid choice"), "light-gate must reject standard/full scopes instead of silently downgrading them");
317
+ }
318
+
319
+ function testAccessPasswordsAreRequiredButNeverPrintedByStatus() {
320
+ const repo = tmpdir("required-access");
321
+ const secret = "unique-local-secret-7f91";
322
+ run("node", [cli, "init"], { cwd: repo });
323
+ run("node", [cli, "sync", "--projects", repo]);
324
+ fillRequiredAccess(repo, secret);
325
+
326
+ const healthy = run("node", [cli, "status", "--projects", repo, "--json"]);
327
+ assert(!healthy.stdout.includes(secret), "status JSON must not echo configured passwords");
328
+
329
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
330
+ writeFile(engineering, fs.readFileSync(engineering, "utf8").replace(
331
+ ` password: ${JSON.stringify(secret)}`,
332
+ ' password: "" # direct value required\n password_env: "PROJECT_FRONTEND_PASSWORD"',
333
+ ));
334
+ const missing = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
335
+ assert(missing.status !== 0, "an environment reference must not replace the required direct password");
336
+ assert(JSON.parse(missing.stdout).results[0].missingConfigTokens.includes("access.project.frontend.password"), "status should name the missing direct password field");
337
+ assert(!missing.stdout.includes(secret), "failed status JSON must not echo other configured passwords");
338
+ assert(!JSON.parse(missing.stdout).results[0].next.includes("upgrade"), "present but blank fields should not trigger a no-op upgrade recommendation");
339
+
340
+ for (const yamlValue of ["false", "[]", "{}", "2026-07-13", "0x10", "|"]) {
341
+ fillRequiredAccess(repo);
342
+ writeFile(engineering, fs.readFileSync(engineering, "utf8").replace(' password: "local-dev-password"', ` password: ${yamlValue}`));
343
+ const nonString = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
344
+ assert(JSON.parse(nonString.stdout).results[0].missingConfigTokens.includes("access.project.frontend.password"), `YAML non-string ${yamlValue} must not count as a credential string`);
345
+ }
346
+ fillRequiredAccess(repo);
347
+ writeFile(engineering, fs.readFileSync(engineering, "utf8").replace(' password: "local-dev-password"', ' password: "TO\\u0044O"'));
348
+ const escapedPlaceholder = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
349
+ assert(JSON.parse(escapedPlaceholder.stdout).results[0].missingConfigTokens.includes("access.project.frontend.password"), "escaped YAML placeholders must be decoded before validation");
350
+
351
+ writeFile(engineering, fs.readFileSync(engineering, "utf8").replace(/^access:\r?\n[\s\S]*?(?=^concurrency:)/m, ""));
352
+ const absent = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
353
+ assert(JSON.parse(absent.stdout).results[0].next.includes("upgrade --write"), "missing access paths should recommend configuration upgrade");
200
354
  }
201
355
 
202
356
  function testManagedAgentModelsInheritAndOverridesSurvive() {
@@ -315,6 +469,9 @@ function testBridgeIsGeneric() {
315
469
  run("node", [cli, "init", "--force"], { cwd: repo });
316
470
  run("python3", [assetAp, "--repo", repo, "install", "--bridges"]);
317
471
  assert(exists(path.join(repo, "AGENTS.md")), "generic bridge should be created");
472
+ const bridge = fs.readFileSync(path.join(repo, "AGENTS.md"), "utf8");
473
+ assert(bridge.includes("Never run two writers in one worktree"), "bridge should expose writer isolation");
474
+ assert(bridge.includes("integrated"), "bridge should expose dependency ordering");
318
475
  for (const filename of [`CO${"DEX.md"}`, `CLA${"UDE.md"}`]) {
319
476
  assert(!exists(path.join(repo, filename)), "client-named bridge should not be created");
320
477
  }
@@ -430,7 +587,7 @@ function testUpgradeInitializesNewEngineeringDefaults() {
430
587
  const repo = tmpdir("upgrade-engineering-defaults");
431
588
  const fakeHome = tmpdir("upgrade-engineering-home");
432
589
  run("git", ["init", "-q"], { cwd: repo });
433
- writeFile(path.join(repo, "package.json"), JSON.stringify({ scripts: { test: "node --test", "test:full": "node --test" } }, null, 2) + "\n");
590
+ writeFile(path.join(repo, "package.json"), JSON.stringify({ scripts: { test: "node --test", "test:changed": "node --test" } }, null, 2) + "\n");
434
591
  run("node", [cli, "init"], { cwd: repo });
435
592
 
436
593
  const projectAp = path.join(repo, ".agents", "skills", "auto-coding-skill", "scripts", "ap.py");
@@ -438,10 +595,58 @@ function testUpgradeInitializesNewEngineeringDefaults() {
438
595
 
439
596
  const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
440
597
  assert(engineering.includes(`name: "${path.basename(repo)}"`), "upgrade should initialize a newly created project name");
441
- for (const key of ["gate_changed", "gate_standard"]) {
442
- assert(engineering.includes(`${key}: "npm test"`), `upgrade should initialize commands.${key} from the ordinary Node test script`);
598
+ assert(engineering.includes('gate_changed: "npm run test:changed"'), "upgrade should infer only a dedicated changed-scope test");
599
+ assert(!engineering.includes("gate_standard:"), "upgrade must not infer an automatic standard gate");
600
+ assert(!engineering.includes("gate_full:"), "upgrade must not infer an automatic full gate");
601
+ }
602
+
603
+ function testUpgradeMigratesLegacyAutomaticGateToFastDefault() {
604
+ const repo = tmpdir("upgrade-legacy-fast-gate");
605
+ run("git", ["init", "-q"], { cwd: repo });
606
+ writeFile(path.join(repo, "package.json"), JSON.stringify({ scripts: { test: "node --test" } }, null, 2) + "\n");
607
+ run("node", [cli, "init"], { cwd: repo });
608
+ writeFile(path.join(repo, "docs", "ENGINEERING.md"), [
609
+ "---",
610
+ "workflow:",
611
+ " mode: verify",
612
+ " profile: auto",
613
+ "project:",
614
+ ' name: "legacy"',
615
+ "concurrency:",
616
+ " isolation: legacy",
617
+ " base_ref: origin/dev",
618
+ " target_branch: dev",
619
+ "commands:",
620
+ ' gate_changed: "npm test"',
621
+ ' gate_standard: "npm test"',
622
+ ' gate_full: "npm run test:full"',
623
+ "gate:",
624
+ " default_scope: auto",
625
+ " fallback_scope: standard",
626
+ " full_on_unknown: true",
627
+ " no_change_scope: standard",
628
+ " rules: []",
629
+ "---",
630
+ "# Legacy engineering",
631
+ "",
632
+ ].join("\n"));
633
+
634
+ run("python3", [assetAp, "--repo", repo, "upgrade", "--write"]);
635
+ const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
636
+ assert(engineering.includes("gate_changed: git diff --check"), "upgrade should replace the v3 auto-seeded npm test gate");
637
+ assert(engineering.includes("mode: dev"), "upgrade should migrate verify mode to fast development mode");
638
+ assert(engineering.includes("completion: push"), "upgrade should add push completion");
639
+ assert(engineering.includes("isolation: worktree"), "upgrade should migrate legacy isolation to worktree");
640
+ for (const key of ["default_scope", "fallback_scope", "no_change_scope"]) {
641
+ assert(engineering.includes(`${key}: changed`), `upgrade should migrate gate.${key} to changed`);
443
642
  }
444
- assert(engineering.includes('gate_full: "npm run test:full"'), "upgrade should infer full only from a dedicated test:full script");
643
+ assert(engineering.includes("full_on_unknown: false"), "upgrade should disable automatic full escalation");
644
+ }
645
+
646
+ function testRemovedVerificationFlagsFailFast() {
647
+ const repo = tmpdir("removed-verification-flags");
648
+ const result = run("python3", [assetAp, "--repo", repo, "commit-push", "T1", "--msg", "T1: test", "--require-jenkins"], { check: false });
649
+ assert(result.status !== 0 && result.stderr.includes("unrecognized arguments"), "removed post-push verification flags must fail instead of being ignored");
445
650
  }
446
651
 
447
652
  function testUpgradeInstallsRuntimeRequiredByLauncher() {
@@ -507,11 +712,279 @@ function testLedgerArchiveUpdatesExistingPeriodIndex() {
507
712
  assert(index.includes("(2 files)"), `archive index should report cumulative design count: ${index}`);
508
713
  }
509
714
 
715
+ function testManagedEngineeringSyncIsControlledAndIdempotent() {
716
+ const repo = tmpdir("managed-engineering");
717
+ run("node", [cli, "init"], { cwd: repo });
718
+ run("node", [cli, "sync", "--projects", repo]);
719
+
720
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
721
+ const initial = fs.readFileSync(engineering, "utf8");
722
+ const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=3\.0\.2 -->/;
723
+ const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
724
+ assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
725
+ assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
726
+
727
+ const customized = initial
728
+ .replace("workflow:\n", "# project-frontmatter-comment\nworkflow:\n")
729
+ .replace(startPattern, "project note before managed workflow\n<!-- auto-coding-skill:managed-workflow:start version=3.0.0 -->")
730
+ .replace(endMarker, `${endMarker}\nproject note after managed workflow`)
731
+ .replace("## Execution profiles", "## Stale managed workflow");
732
+ writeFile(engineering, customized);
733
+ const staleStart = customized.indexOf("<!-- auto-coding-skill:managed-workflow:start");
734
+ const staleEnd = customized.indexOf(endMarker) + endMarker.length;
735
+ const outsideBefore = customized.slice(0, staleStart);
736
+ const outsideAfter = customized.slice(staleEnd);
737
+
738
+ const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
739
+ const dryResult = JSON.parse(dryRun.stdout).results[0];
740
+ assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
741
+ assert(dryResult.managedWorkflow.version === "3.0.2", "dry-run should expose the target workflow version");
742
+ assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
743
+ assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
744
+
745
+ run("node", [cli, "sync", "--projects", repo]);
746
+ const updated = fs.readFileSync(engineering, "utf8");
747
+ const updatedStart = updated.indexOf("<!-- auto-coding-skill:managed-workflow:start");
748
+ const updatedEnd = updated.indexOf(endMarker) + endMarker.length;
749
+ assert(updated.slice(0, updatedStart) === outsideBefore, "sync must preserve frontmatter and content before the managed block byte-for-byte");
750
+ assert(updated.slice(updatedEnd) === outsideAfter, "sync must preserve content after the managed block byte-for-byte");
751
+ assert(updated.includes("version=3.0.2"), "sync should install the current managed workflow version");
752
+ assert(updated.includes("## Execution profiles"), "sync should refresh stale managed workflow content");
753
+
754
+ fillRequiredAccess(repo);
755
+ const status = run("node", [cli, "status", "--projects", repo, "--json"]);
756
+ const statusResult = JSON.parse(status.stdout).results[0];
757
+ assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
758
+ assert(statusResult.managedWorkflow.version === "3.0.2", "status should expose the installed managed workflow version");
759
+
760
+ const beforeSecondSync = fs.readFileSync(engineering, "utf8");
761
+ const second = run("node", [cli, "sync", "--projects", repo, "--json"]);
762
+ assert(!JSON.parse(second.stdout).results[0].actions.some(item => item.path === "docs/ENGINEERING.md"), "current managed workflow should be idempotent");
763
+ assert(fs.readFileSync(engineering, "utf8") === beforeSecondSync, "idempotent sync must not rewrite ENGINEERING.md");
764
+ }
765
+
766
+ function testLegacyEngineeringMigrationPreservesExistingBody() {
767
+ const repo = tmpdir("legacy-managed-engineering");
768
+ run("node", [cli, "init"], { cwd: repo });
769
+ run("node", [cli, "sync", "--projects", repo]);
770
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
771
+ const current = fs.readFileSync(engineering, "utf8");
772
+ const start = current.indexOf("<!-- auto-coding-skill:managed-workflow:start");
773
+ const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
774
+ const end = current.indexOf(endMarker) + endMarker.length;
775
+ const legacyNote = "\n## Legacy project-specific workflow\n\nKeep this project note exactly.\n";
776
+ const legacy = `${current.slice(0, start)}${legacyNote}${current.slice(end)}`;
777
+ writeFile(engineering, legacy);
778
+
779
+ const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
780
+ const dryResult = JSON.parse(dryRun.stdout).results[0];
781
+ assert(dryResult.managedWorkflow.state === "legacy-custom", "unknown unmarked documents should be reported as a custom legacy migration");
782
+ assert(dryResult.managedWorkflow.preservedCustom === true, "custom legacy migration should expose its preservation policy");
783
+ assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
784
+ run("node", [cli, "sync", "--projects", repo]);
785
+ const migrated = fs.readFileSync(engineering, "utf8");
786
+ assert(migrated.includes("version=3.0.2"), "legacy migration should insert the current managed workflow");
787
+ assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
788
+ const migratedStart = migrated.indexOf("<!-- auto-coding-skill:managed-workflow:start");
789
+ const migratedEnd = migrated.indexOf(endMarker) + endMarker.length;
790
+ assert(`${migrated.slice(0, migratedStart)}${migrated.slice(migratedEnd)}` === legacy, "removing the inserted managed block should recover custom legacy content byte-for-byte");
791
+
792
+ const stable = fs.readFileSync(engineering, "utf8");
793
+ run("node", [cli, "sync", "--projects", repo]);
794
+ assert(fs.readFileSync(engineering, "utf8") === stable, "legacy migration should converge after one sync");
795
+ }
796
+
797
+ function testOfficialLegacyEngineeringBodyIsReplacedWithoutDuplication() {
798
+ const repo = tmpdir("official-legacy-engineering");
799
+ run("node", [cli, "init"], { cwd: repo });
800
+ run("node", [cli, "sync", "--projects", repo]);
801
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
802
+ const current = fs.readFileSync(engineering, "utf8");
803
+ const frontmatter = current.match(/^---\r?\n[\s\S]*?\r?\n---(?:\r?\n|$)/)?.[0];
804
+ assert(frontmatter, "official legacy fixture requires frontmatter");
805
+ const customizedFrontmatter = frontmatter.replace("workflow:\n", "# keep-official-migration-config\nworkflow:\n");
806
+ writeFile(engineering, `${customizedFrontmatter}${officialV220EngineeringBody}`);
807
+
808
+ const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
809
+ const dryResult = JSON.parse(dryRun.stdout).results[0];
810
+ assert(dryResult.managedWorkflow.state === "legacy-official", `official body hash should select replacement migration: ${dryRun.stdout}`);
811
+ assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("official-legacy"), "official legacy action should identify replacement migration");
812
+ run("node", [cli, "sync", "--projects", repo]);
813
+ const migrated = fs.readFileSync(engineering, "utf8");
814
+ assert(migrated.startsWith(customizedFrontmatter), "official legacy migration must preserve YAML frontmatter byte-for-byte");
815
+ assert((migrated.match(/auto-coding-skill:managed-workflow:start/g) || []).length === 1, "official legacy migration should install exactly one managed workflow");
816
+ assert((migrated.match(/^## Execution profiles$/gm) || []).length === 1, "official legacy migration must replace rather than duplicate the old workflow body");
817
+
818
+ const stable = fs.readFileSync(engineering, "utf8");
819
+ run("node", [cli, "sync", "--projects", repo]);
820
+ assert(fs.readFileSync(engineering, "utf8") === stable, "official legacy migration should be idempotent");
821
+ }
822
+
823
+ function testMalformedManagedMarkersFailClosed() {
824
+ const cases = {
825
+ "single-start": "<!-- auto-coding-skill:managed-workflow:start version=3.0.0 -->\nold\n",
826
+ "single-end": "old\n<!-- auto-coding-skill:managed-workflow:end -->\n",
827
+ 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",
828
+ 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",
829
+ };
830
+ for (const [name, malformed] of Object.entries(cases)) {
831
+ const repo = tmpdir(`managed-marker-${name}`);
832
+ run("node", [cli, "init"], { cwd: repo });
833
+ run("node", [cli, "sync", "--projects", repo]);
834
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
835
+ const text = fs.readFileSync(engineering, "utf8");
836
+ const start = text.indexOf("<!-- auto-coding-skill:managed-workflow:start");
837
+ const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
838
+ const end = text.indexOf(endMarker) + endMarker.length;
839
+ writeFile(engineering, `${text.slice(0, start)}${malformed}${text.slice(end)}`);
840
+ const skill = path.join(repo, ".agents", "skills", "auto-coding-skill", "SKILL.md");
841
+ writeFile(skill, `user-sentinel-${name}\n`);
842
+ const before = fs.readFileSync(engineering, "utf8");
843
+
844
+ const result = run("node", [cli, "sync", "--projects", repo], { check: false });
845
+ assert(result.status !== 0 && result.stderr.includes("refusing"), `${name}: malformed markers should reject sync`);
846
+ assert(fs.readFileSync(engineering, "utf8") === before, `${name}: rejected sync must not touch ENGINEERING.md`);
847
+ assert(fs.readFileSync(skill, "utf8") === `user-sentinel-${name}\n`, `${name}: preflight must reject before writing the skill`);
848
+ }
849
+ }
850
+
851
+ function testSkillOnlySyncTouchesOnlySkill() {
852
+ const repo = tmpdir("skill-only-sync");
853
+ run("git", ["init", "-q"], { cwd: repo });
854
+ run("node", [cli, "init"], { cwd: repo });
855
+ run("node", [cli, "sync", "--projects", repo]);
856
+ const skill = path.join(repo, ".agents", "skills", "auto-coding-skill", "SKILL.md");
857
+ const agent = path.join(repo, ".agents", "agents", "explorer.toml");
858
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
859
+ const launcher = path.join(repo, "docs", "tools", "autopipeline", "ap.py");
860
+ writeFile(skill, "stale skill\n");
861
+ writeFile(agent, `${fs.readFileSync(agent, "utf8")}\n# user-agent-sentinel\n`);
862
+ writeFile(engineering, `${fs.readFileSync(engineering, "utf8")}\nproject-engineering-sentinel\n`);
863
+ writeFile(launcher, `${fs.readFileSync(launcher, "utf8")}\n# user-launcher-sentinel\n`);
864
+ const untouched = new Map([[agent, fs.readFileSync(agent)], [engineering, fs.readFileSync(engineering)], [launcher, fs.readFileSync(launcher)]]);
865
+
866
+ const dryRun = run("node", [cli, "sync", "--projects", repo, "--components", "skill", "--dry-run", "--json"]);
867
+ const dryResult = JSON.parse(dryRun.stdout).results[0];
868
+ assert(dryResult.components === "skill", "skill-only dry-run should expose its component scope");
869
+ assert(dryResult.actions.length === 1 && dryResult.actions[0].path === ".agents/skills/auto-coding-skill", "skill-only dry-run must plan only the skill directory");
870
+ assert(fs.readFileSync(skill, "utf8") === "stale skill\n", "skill-only dry-run must not write the skill");
871
+
872
+ run("node", [cli, "sync", "--projects", repo, "--components", "skill"]);
873
+ assert(fs.readFileSync(skill, "utf8").includes("# Auto Coding Skill"), "skill-only sync should refresh the managed skill");
874
+ for (const [file, content] of untouched) {
875
+ assert(fs.readFileSync(file).equals(content), `skill-only sync must not touch ${file}`);
876
+ }
877
+
878
+ const invalid = run("node", [cli, "sync", "--projects", repo, "--components", "docs"], { check: false });
879
+ assert(invalid.status !== 0 && invalid.stderr.includes("--components"), "sync should reject unknown component scopes");
880
+ const conflicting = run("node", [cli, "sync", "--projects", repo, "--components", "skill", "--reset-agent-models"], { check: false });
881
+ assert(conflicting.status !== 0, "skill-only sync should reject irrelevant agent reset options");
882
+
883
+ writeFile(skill, "legacy-task-sentinel\n");
884
+ writeFile(path.join(repo, ".git", "auto-coding-skill", "tasks", "T-LEGACY.json"), JSON.stringify({ schema: 1, task_id: "T-LEGACY" }));
885
+ const blocked = run("node", [cli, "sync", "--projects", repo, "--components", "skill"], { check: false });
886
+ assert(blocked.status !== 0 && blocked.stderr.includes("schema < 2"), "skill-only sync must block registered legacy tasks");
887
+ 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");
888
+ assert(fs.readFileSync(skill, "utf8") === "legacy-task-sentinel\n", "blocked skill-only sync must not write the skill");
889
+ }
890
+
891
+ function testLegacyTaskPreflightRejectsWholeBatchAtomically() {
892
+ const first = tmpdir("legacy-batch-first");
893
+ const second = tmpdir("legacy-batch-second");
894
+ for (const repo of [first, second]) {
895
+ run("git", ["init", "-q"], { cwd: repo });
896
+ run("node", [cli, "init"], { cwd: repo });
897
+ run("node", [cli, "sync", "--projects", repo]);
898
+ }
899
+ const firstSkill = path.join(first, ".agents", "skills", "auto-coding-skill", "SKILL.md");
900
+ const secondAgent = path.join(second, ".agents", "agents", "explorer.toml");
901
+ writeFile(firstSkill, "first-project-sentinel\n");
902
+ writeFile(secondAgent, `${fs.readFileSync(secondAgent, "utf8")}\n# second-project-sentinel\n`);
903
+ const secondAgentBefore = fs.readFileSync(secondAgent);
904
+ writeFile(path.join(second, ".git", "auto-coding-skill", "tasks", "T-V3.json"), JSON.stringify({ schema: 1, task_id: "T-V3" }));
905
+
906
+ const result = run("node", [cli, "sync", "--projects", `${first},${second}`], { check: false });
907
+ assert(result.status !== 0 && result.stderr.includes("entire sync batch"), "one legacy task should reject the complete multi-project batch");
908
+ assert(fs.readFileSync(firstSkill, "utf8") === "first-project-sentinel\n", "batch preflight must reject before writing an earlier clean project");
909
+ assert(fs.readFileSync(secondAgent).equals(secondAgentBefore), "batch preflight must not write the project containing the legacy task");
910
+ }
911
+
912
+ function testManagedAgentsMigrationPreservesCustomRules() {
913
+ const repo = tmpdir("managed-agents-document");
914
+ run("node", [cli, "init"], { cwd: repo });
915
+ run("node", [cli, "sync", "--projects", repo]);
916
+ const agents = path.join(repo, "AGENTS.md");
917
+ const initial = fs.readFileSync(agents, "utf8");
918
+ assert(initial.includes("managed-agents:start version=3.0.2"), "new projects should receive the versioned root AGENTS block");
919
+
920
+ const custom = [
921
+ "# Project rules",
922
+ "",
923
+ "- Preserve this repository-specific rule exactly.",
924
+ "- `high-risk` cannot be downgraded and must execute `commands.gate_full`; changed or standard fallbacks do not count. Use `PASS / FAIL / PARTIAL` only from the required executed evidence.",
925
+ "",
926
+ ].join("\n");
927
+ writeFile(agents, custom);
928
+ const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
929
+ const plan = JSON.parse(dryRun.stdout).results[0].managedAgentsDocument;
930
+ assert(plan.state === "legacy-custom", `unmarked custom AGENTS should be migrated: ${dryRun.stdout}`);
931
+ assert(plan.migrations.includes("agents-v22-govchain-full"), "known official full-gate rule should be selected by exact migration id");
932
+
933
+ run("node", [cli, "sync", "--projects", repo]);
934
+ const migrated = fs.readFileSync(agents, "utf8");
935
+ assert(migrated.includes("managed-agents:start version=3.0.2"), "AGENTS migration should install the current managed block");
936
+ assert(migrated.includes("Preserve this repository-specific rule exactly."), "AGENTS migration must preserve unrelated custom rules");
937
+ assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
938
+ const stable = fs.readFileSync(agents);
939
+ run("node", [cli, "sync", "--projects", repo]);
940
+ assert(fs.readFileSync(agents).equals(stable), "managed AGENTS sync should be idempotent");
941
+ }
942
+
943
+ function testUnknownWorkflowConflictFailsWholeBatchBeforeWrites() {
944
+ const first = tmpdir("workflow-conflict-first");
945
+ const second = tmpdir("workflow-conflict-second");
946
+ for (const repo of [first, second]) {
947
+ run("git", ["init", "-q"], { cwd: repo });
948
+ run("node", [cli, "init"], { cwd: repo });
949
+ run("node", [cli, "sync", "--projects", repo]);
950
+ }
951
+ const firstSkill = path.join(first, ".agents", "skills", "auto-coding-skill", "SKILL.md");
952
+ writeFile(firstSkill, "batch-sentinel\n");
953
+ const secondAgents = path.join(second, "AGENTS.md");
954
+ fs.appendFileSync(secondAgents, "\n- High-risk changes\n must run the real full gate before push.\n");
955
+
956
+ const status = run("node", [cli, "status", "--projects", second, "--json"], { check: false });
957
+ assert(status.status !== 0, "status must be non-ok for an unknown conflicting workflow rule");
958
+ const statusPlan = JSON.parse(status.stdout).results[0].managedAgentsDocument;
959
+ assert(statusPlan.state === "conflict", `status should expose the document conflict: ${status.stdout}`);
960
+ assert(statusPlan.conflicts[0].file === "AGENTS.md" && statusPlan.conflicts[0].line > 0, "status conflict should include file and line");
961
+
962
+ const sync = run("node", [cli, "sync", "--projects", `${first},${second}`], { check: false });
963
+ assert(sync.status !== 0 && sync.stderr.includes("entire sync batch before writes"), "one unknown conflict must reject the complete batch");
964
+ assert(fs.readFileSync(firstSkill, "utf8") === "batch-sentinel\n", "batch conflict preflight must run before an earlier project's skill write");
965
+ }
966
+
967
+ function testEngineeringMarkerBoundaryIsNormalized() {
968
+ const repo = tmpdir("engineering-marker-boundary");
969
+ run("node", [cli, "init"], { cwd: repo });
970
+ run("node", [cli, "sync", "--projects", repo]);
971
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
972
+ const marker = "<!-- auto-coding-skill:managed-workflow:end -->";
973
+ const current = fs.readFileSync(engineering, "utf8");
974
+ writeFile(engineering, current.replace(`${marker}\n`, `${marker}# Project-specific workflow\n`));
975
+ run("node", [cli, "sync", "--projects", repo]);
976
+ const normalized = fs.readFileSync(engineering, "utf8");
977
+ assert(normalized.includes(`${marker}\n# Project-specific workflow\n`), "sync should normalize a heading glued to the managed end marker");
978
+ }
979
+
510
980
  testPreflightAvoidsPartialInstall();
511
981
  testDestVariants();
512
982
  testLauncherFallsBackToGlobalRuntime();
513
983
  testMinimalSyncConvergesWithinBudget();
514
- testOrdinaryNodeTestIsNotPromotedToFullGate();
984
+ testStatusRejectsLegacyIsolation();
985
+ testStatusRejectsLegacyGateEscalation();
986
+ testOrdinaryNodeTestIsNotPromotedToAutomaticGate();
987
+ testAccessPasswordsAreRequiredButNeverPrintedByStatus();
515
988
  testManagedAgentModelsInheritAndOverridesSurvive();
516
989
  testForcePreservesCustomAgentsAndModelOverrides();
517
990
  testInvalidManagedAgentModelsFailStatusAndAreDroppedOnSync();
@@ -525,8 +998,19 @@ testTestingScaffoldMatchesCheckMatrixSchema();
525
998
  testReviewScaffoldLeavesBaselineGenerationToBaselineCommand();
526
999
  testUpgradePrefersModernProjectAssetsAndIgnoresRetiredTemplates();
527
1000
  testUpgradeInitializesNewEngineeringDefaults();
1001
+ testUpgradeMigratesLegacyAutomaticGateToFastDefault();
1002
+ testRemovedVerificationFlagsFailFast();
528
1003
  testUpgradeInstallsRuntimeRequiredByLauncher();
529
1004
  testLedgerArchiveRecognizesSettledStatuses();
530
1005
  testLedgerArchiveUpdatesExistingPeriodIndex();
1006
+ testManagedEngineeringSyncIsControlledAndIdempotent();
1007
+ testLegacyEngineeringMigrationPreservesExistingBody();
1008
+ testOfficialLegacyEngineeringBodyIsReplacedWithoutDuplication();
1009
+ testMalformedManagedMarkersFailClosed();
1010
+ testSkillOnlySyncTouchesOnlySkill();
1011
+ testLegacyTaskPreflightRejectsWholeBatchAtomically();
1012
+ testManagedAgentsMigrationPreservesCustomRules();
1013
+ testUnknownWorkflowConflictFailsWholeBatchBeforeWrites();
1014
+ testEngineeringMarkerBoundaryIsNormalized();
531
1015
 
532
1016
  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": "3.0.0",
4
- "description": "CLI installer for an isolated .agents engineering workflow with parallel Git worktrees, adaptive gates, safe integration, and verified closure.",
3
+ "version": "3.0.2",
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"
@@ -19,7 +19,7 @@
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 sync-assets && npm run check:assets && npm run test:src && npm run test && npm pack --dry-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": {