@elvis1513/auto-coding-skill 4.2.2 → 4.2.4

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.
@@ -314,7 +314,7 @@ function testInitFullyConvergesExistingProject() {
314
314
  }
315
315
  assert(exists(path.join(repo, ".agents", "agents", "custom.toml")), "project-owned custom agents must survive init");
316
316
  assert(!exists(path.join(repo, ".agents", "skills", "auto-coding-skill", "obsolete.txt")), "extra Skill files must be removed");
317
- assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.2", "docs", "legacy", "old-taskbook.md")), "removed docs must be archived outside active docs");
317
+ assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.4", "docs", "legacy", "old-taskbook.md")), "removed docs must be archived outside active docs");
318
318
  assert(fs.readFileSync(structureStandard, "utf8") === customStructureStandard, "init must preserve a project-owned structure standard");
319
319
  assert(fs.readFileSync(path.join(repo, "docs", "architecture", "adr", "0042-project-choice.md"), "utf8").includes("Keep me"), "numbered ADR artifacts must survive init");
320
320
  assert(fs.readFileSync(path.join(repo, "docs", "architecture", "system-context.md"), "utf8").includes("Keep me"), "architecture artifacts must survive init");
@@ -329,6 +329,50 @@ function testInitFullyConvergesExistingProject() {
329
329
  assert(JSON.stringify(secondDocs) === JSON.stringify(expectedInstalledDocs), "repeated init must stay idempotent");
330
330
  }
331
331
 
332
+ function testStructureBlockWarningsDefaultsPreserveAndConverge() {
333
+ const repo = tmpdir("structure-block-warnings");
334
+ run("node", [cli, "init"], { cwd: repo });
335
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
336
+ const initialized = fs.readFileSync(engineering, "utf8");
337
+ const initializedConfig = readEngineeringConfig(engineering);
338
+ assert(
339
+ initializedConfig.structure?.block_warnings === false,
340
+ "new projects must default structure.block_warnings to false",
341
+ );
342
+
343
+ const customized = initialized.replace(
344
+ /^ block_warnings: false$/m,
345
+ " block_warnings: true",
346
+ );
347
+ assert(customized !== initialized, "block_warnings must be present in canonical frontmatter");
348
+ writeFile(engineering, customized);
349
+
350
+ run("node", [cli, "init"], { cwd: repo });
351
+ const converged = fs.readFileSync(engineering, "utf8");
352
+ assert(
353
+ readEngineeringConfig(engineering).structure?.block_warnings === true,
354
+ "init must preserve an explicit true structure.block_warnings value",
355
+ );
356
+ run("node", [cli, "init"], { cwd: repo });
357
+ assert(
358
+ fs.readFileSync(engineering, "utf8") === converged,
359
+ "repeated init must be byte-idempotent with block_warnings=true",
360
+ );
361
+
362
+ run("node", [cli, "sync", "--projects", repo]);
363
+ const synced = fs.readFileSync(engineering, "utf8");
364
+ assert(
365
+ readEngineeringConfig(engineering).structure?.block_warnings === true,
366
+ "sync must preserve an explicit true structure.block_warnings value",
367
+ );
368
+ assert(synced === converged, "sync must not rewrite a converged block_warnings=true config");
369
+ run("node", [cli, "sync", "--projects", repo]);
370
+ assert(
371
+ fs.readFileSync(engineering, "utf8") === synced,
372
+ "repeated sync must be byte-idempotent with block_warnings=true",
373
+ );
374
+ }
375
+
332
376
  function testInitRejectsMissingPythonRuntimeBeforeWrites() {
333
377
  if (process.platform === "win32") return;
334
378
  const repo = tmpdir("missing-python-runtime");
@@ -393,10 +437,10 @@ function testMinimalInitConvergesWithinBudget() {
393
437
  const files = listProjectFiles(repo);
394
438
  const lines = files.reduce((total, file) => total + fs.readFileSync(file, "utf8").split(/\r?\n/).length, 0);
395
439
  assert(files.length <= 40, `minimal scaffold file budget exceeded: ${files.length}`);
396
- // Integrity, staging, fail-closed classification, and contract helpers are
397
- // executable support code, not prompt context. Keep a measured ceiling while
398
- // leaving deterministic checks readable.
399
- assert(lines <= 14300, `minimal scaffold line budget exceeded: ${lines}`);
440
+ // Integrity, staging, fail-closed classification, contract helpers, and the
441
+ // language-aware structure scanner are executable support code, not prompt
442
+ // context. Keep a measured ceiling while leaving deterministic checks readable.
443
+ assert(lines <= 14990, `minimal scaffold line budget exceeded: ${lines}`);
400
444
  const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
401
445
  assert(engineering.includes("profile: auto"), "engineering should enable adaptive profiles");
402
446
  assert(engineering.includes("isolation: adaptive"), "engineering should default to adaptive clean-branch/worktree isolation");
@@ -935,7 +979,7 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
935
979
 
936
980
  const engineering = path.join(repo, "docs", "ENGINEERING.md");
937
981
  const initial = fs.readFileSync(engineering, "utf8");
938
- const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.2 -->/;
982
+ const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.4 -->/;
939
983
  const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
940
984
  assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
941
985
  assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
@@ -949,21 +993,21 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
949
993
  const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
950
994
  const dryResult = JSON.parse(dryRun.stdout).results[0];
951
995
  assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
952
- assert(dryResult.managedWorkflow.version === "4.2.2", "dry-run should expose the target workflow version");
996
+ assert(dryResult.managedWorkflow.version === "4.2.4", "dry-run should expose the target workflow version");
953
997
  assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
954
998
  assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
955
999
 
956
1000
  run("node", [cli, "init"], { cwd: repo });
957
1001
  const updated = fs.readFileSync(engineering, "utf8");
958
1002
  assert(!updated.includes("project note before") && !updated.includes("project note after"), "init must remove text outside the canonical ENGINEERING body");
959
- assert(updated.includes("version=4.2.2"), "init should install the current managed workflow version");
1003
+ assert(updated.includes("version=4.2.4"), "init should install the current managed workflow version");
960
1004
  assert(updated.includes("The frontmatter contract is:"), "init should refresh stale managed workflow content");
961
1005
 
962
1006
  fillRequiredAccess(repo);
963
1007
  const status = run("node", [cli, "status", "--projects", repo, "--json"]);
964
1008
  const statusResult = JSON.parse(status.stdout).results[0];
965
1009
  assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
966
- assert(statusResult.managedWorkflow.version === "4.2.2", "status should expose the installed managed workflow version");
1010
+ assert(statusResult.managedWorkflow.version === "4.2.4", "status should expose the installed managed workflow version");
967
1011
 
968
1012
  const beforeSecondInit = fs.readFileSync(engineering, "utf8");
969
1013
  run("node", [cli, "init"], { cwd: repo });
@@ -990,7 +1034,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
990
1034
  assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
991
1035
  run("node", [cli, "sync", "--projects", repo]);
992
1036
  const migrated = fs.readFileSync(engineering, "utf8");
993
- assert(migrated.includes("version=4.2.2"), "legacy migration should insert the current managed workflow");
1037
+ assert(migrated.includes("version=4.2.4"), "legacy migration should insert the current managed workflow");
994
1038
  assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
995
1039
  const stable = fs.readFileSync(engineering, "utf8");
996
1040
  run("node", [cli, "sync", "--projects", repo]);
@@ -1090,7 +1134,7 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
1090
1134
  run("node", [cli, "sync", "--projects", repo]);
1091
1135
  const agents = path.join(repo, "AGENTS.md");
1092
1136
  const initial = fs.readFileSync(agents, "utf8");
1093
- assert(initial.includes("managed-agents:start version=4.2.2"), "new projects should receive the versioned root AGENTS block");
1137
+ assert(initial.includes("managed-agents:start version=4.2.4"), "new projects should receive the versioned root AGENTS block");
1094
1138
 
1095
1139
  const custom = [
1096
1140
  "# Project rules",
@@ -1109,12 +1153,12 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
1109
1153
 
1110
1154
  run("node", [cli, "sync", "--projects", repo]);
1111
1155
  const migrated = fs.readFileSync(agents, "utf8");
1112
- assert(migrated.includes("managed-agents:start version=4.2.2"), "AGENTS migration should install the current managed block");
1156
+ assert(migrated.includes("managed-agents:start version=4.2.4"), "AGENTS migration should install the current managed block");
1113
1157
  assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
1114
1158
  assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
1115
1159
  const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
1116
1160
  assert(migrated === canonical, "root AGENTS must be byte-identical to the packaged canonical file");
1117
- const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.2.md");
1161
+ const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.4.md");
1118
1162
  assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
1119
1163
  const stable = fs.readFileSync(agents);
1120
1164
  run("node", [cli, "sync", "--projects", repo]);
@@ -1171,7 +1215,7 @@ function testEngineeringFrameworkRejectsAnyNonCanonicalWorkflowText() {
1171
1215
 
1172
1216
  run("node", [cli, "init"], { cwd: repo });
1173
1217
  assert(!fs.readFileSync(engineering, "utf8").includes("backend owns APIs"), "init must restore the canonical ENGINEERING body");
1174
- const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.2", "docs", "ENGINEERING.md");
1218
+ const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.4", "docs", "ENGINEERING.md");
1175
1219
  assert(fs.readFileSync(archived, "utf8").includes("backend owns APIs"), "removed project text should remain in non-authoritative history");
1176
1220
  }
1177
1221
 
@@ -1183,12 +1227,12 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
1183
1227
 
1184
1228
  const manifestPath = path.join(repo, ".agents", "managed-install.json");
1185
1229
  const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
1186
- assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.2", "installed manifest must identify the release");
1230
+ assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.4", "installed manifest must identify the release");
1187
1231
  assert(manifest.entries.length > 0, "installed manifest must list managed files");
1188
1232
  for (const entry of manifest.entries) {
1189
1233
  assert(typeof entry.path === "string" && !path.isAbsolute(entry.path) && !entry.path.includes(".."), "manifest paths must be safe relative paths");
1190
1234
  assert(/^[0-9a-f]{64}$/.test(entry.sha256), `${entry.path}: manifest hash must be sha256`);
1191
- assert(entry.version === "4.2.2" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
1235
+ assert(entry.version === "4.2.4" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
1192
1236
  }
1193
1237
  assert(!manifest.managed_namespaces.some(item => item.path === ".agents" || item.path === "docs"), "manifest must not mirror entire project-owned trees");
1194
1238
 
@@ -1258,14 +1302,14 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
1258
1302
  }
1259
1303
 
1260
1304
  function testReleaseVersionMarkersStayInSync() {
1261
- const expected = "4.2.2";
1305
+ const expected = "4.2.4";
1262
1306
  const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
1263
1307
  const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
1264
1308
  const policy = JSON.parse(fs.readFileSync(
1265
1309
  path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
1266
1310
  "utf8",
1267
1311
  ));
1268
- assert(pkg.version === expected, "package version must match the 4.2.2 release");
1312
+ assert(pkg.version === expected, "package version must match the 4.2.4 release");
1269
1313
  assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
1270
1314
  assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
1271
1315
  const manifest = JSON.parse(fs.readFileSync(path.join(repoRoot, "cli", "assets", "managed-install.json"), "utf8"));
@@ -1304,6 +1348,7 @@ function testProtocolResponsibilitiesStaySeparated() {
1304
1348
  }
1305
1349
 
1306
1350
  testInitFullyConvergesExistingProject();
1351
+ testStructureBlockWarningsDefaultsPreserveAndConverge();
1307
1352
  testInitRejectsMissingPythonRuntimeBeforeWrites();
1308
1353
  testDestVariants();
1309
1354
  testLauncherFallsBackToGlobalRuntime();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvis1513/auto-coding-skill",
3
- "version": "4.2.2",
3
+ "version": "4.2.4",
4
4
  "description": "CLI installer for a delivery-first .agents workflow with adaptive Git isolation, routed changed-scope validation, risk-based review, push completion, and safe cleanup.",
5
5
  "type": "module",
6
6
  "bin": {