@elvis1513/auto-coding-skill 4.2.5 → 4.2.7

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.5", "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.7", "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");
@@ -373,6 +373,43 @@ function testStructureBlockWarningsDefaultsPreserveAndConverge() {
373
373
  );
374
374
  }
375
375
 
376
+ function testManagedPolicySummaryPreservesProjectConfiguration() {
377
+ const repo = tmpdir("managed-policy-summary");
378
+ run("node", [cli, "init"], { cwd: repo });
379
+ const engineering = path.join(repo, "docs", "ENGINEERING.md");
380
+ const current = fs.readFileSync(engineering, "utf8");
381
+ const neutralSummary = "- `structure` and `optimization`: project-selected enforcement and completion policy; frontmatter values are authoritative.";
382
+ const legacySummary = "- `structure` and `optimization`: advisory architecture and no-new-debt policy.";
383
+ const customized = current
384
+ .replace(/^ skill_version:.*$/m, " skill_version: 4.2.5")
385
+ .replace("managed-workflow:start version=4.2.7", "managed-workflow:start version=4.2.5")
386
+ .replace(neutralSummary, legacySummary)
387
+ .replace(/^ enforcement:.*$/m, " enforcement: blocking")
388
+ .replace(" block_warnings: false", " block_warnings: true")
389
+ .replace(" block: false", " block: true")
390
+ .replace(/^ completion_policy:.*$/m, " completion_policy: baseline-aware")
391
+ .replace(" require_baseline_for_global_review: false", " require_baseline_for_global_review: true")
392
+ .replace(" report_accepted_debt_as_findings: false", " report_accepted_debt_as_findings: true");
393
+ assert(customized !== current && customized.includes(legacySummary), "fixture must represent the 4.2.5 managed summary");
394
+ writeFile(engineering, customized);
395
+ const beforeUpgrade = readEngineeringConfig(engineering);
396
+ assert(beforeUpgrade.workflow?.skill_version === "4.2.5", "fixture must identify the previous workflow version");
397
+ assert(beforeUpgrade.structure?.enforcement === "blocking", "fixture must enable blocking structure enforcement");
398
+ assert(beforeUpgrade.optimization?.completion_policy === "baseline-aware", "fixture must enable baseline-aware completion");
399
+
400
+ run("node", [cli, "init"], { cwd: repo });
401
+ const upgraded = fs.readFileSync(engineering, "utf8");
402
+ const afterUpgrade = readEngineeringConfig(engineering);
403
+ assert(afterUpgrade.workflow?.skill_version === "4.2.7", "init must upgrade the workflow version");
404
+ assert(canonicalJson(afterUpgrade.structure) === canonicalJson(beforeUpgrade.structure), "init must preserve the complete project structure policy");
405
+ assert(canonicalJson(afterUpgrade.optimization) === canonicalJson(beforeUpgrade.optimization), "init must preserve the complete project optimization policy");
406
+ assert(upgraded.includes(neutralSummary), "upgraded managed text must defer to frontmatter policy");
407
+ assert(!upgraded.includes(legacySummary), "upgraded managed text must remove the hard-coded default policy description");
408
+
409
+ run("node", [cli, "init"], { cwd: repo });
410
+ assert(fs.readFileSync(engineering, "utf8") === upgraded, "repeated init must be byte-idempotent after the policy-summary upgrade");
411
+ }
412
+
376
413
  function testInitRejectsMissingPythonRuntimeBeforeWrites() {
377
414
  if (process.platform === "win32") return;
378
415
  const repo = tmpdir("missing-python-runtime");
@@ -437,10 +474,11 @@ function testMinimalInitConvergesWithinBudget() {
437
474
  const files = listProjectFiles(repo);
438
475
  const lines = files.reduce((total, file) => total + fs.readFileSync(file, "utf8").split(/\r?\n/).length, 0);
439
476
  assert(files.length <= 40, `minimal scaffold file budget exceeded: ${files.length}`);
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 <= 15120, `minimal scaffold line budget exceeded: ${lines}`);
477
+ // Integrity, staging, fail-closed classification, immutable Reviewer
478
+ // snapshots, contract helpers, and the language-aware structure scanner are
479
+ // executable support code, not prompt context. Keep a measured ceiling while
480
+ // leaving deterministic checks readable.
481
+ assert(lines <= 16000, `minimal scaffold line budget exceeded: ${lines}`);
444
482
  const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
445
483
  assert(engineering.includes("profile: auto"), "engineering should enable adaptive profiles");
446
484
  assert(engineering.includes("isolation: adaptive"), "engineering should default to adaptive clean-branch/worktree isolation");
@@ -979,7 +1017,7 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
979
1017
 
980
1018
  const engineering = path.join(repo, "docs", "ENGINEERING.md");
981
1019
  const initial = fs.readFileSync(engineering, "utf8");
982
- const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.5 -->/;
1020
+ const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.7 -->/;
983
1021
  const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
984
1022
  assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
985
1023
  assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
@@ -993,21 +1031,21 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
993
1031
  const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
994
1032
  const dryResult = JSON.parse(dryRun.stdout).results[0];
995
1033
  assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
996
- assert(dryResult.managedWorkflow.version === "4.2.5", "dry-run should expose the target workflow version");
1034
+ assert(dryResult.managedWorkflow.version === "4.2.7", "dry-run should expose the target workflow version");
997
1035
  assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
998
1036
  assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
999
1037
 
1000
1038
  run("node", [cli, "init"], { cwd: repo });
1001
1039
  const updated = fs.readFileSync(engineering, "utf8");
1002
1040
  assert(!updated.includes("project note before") && !updated.includes("project note after"), "init must remove text outside the canonical ENGINEERING body");
1003
- assert(updated.includes("version=4.2.5"), "init should install the current managed workflow version");
1041
+ assert(updated.includes("version=4.2.7"), "init should install the current managed workflow version");
1004
1042
  assert(updated.includes("The frontmatter contract is:"), "init should refresh stale managed workflow content");
1005
1043
 
1006
1044
  fillRequiredAccess(repo);
1007
1045
  const status = run("node", [cli, "status", "--projects", repo, "--json"]);
1008
1046
  const statusResult = JSON.parse(status.stdout).results[0];
1009
1047
  assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
1010
- assert(statusResult.managedWorkflow.version === "4.2.5", "status should expose the installed managed workflow version");
1048
+ assert(statusResult.managedWorkflow.version === "4.2.7", "status should expose the installed managed workflow version");
1011
1049
 
1012
1050
  const beforeSecondInit = fs.readFileSync(engineering, "utf8");
1013
1051
  run("node", [cli, "init"], { cwd: repo });
@@ -1034,7 +1072,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
1034
1072
  assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
1035
1073
  run("node", [cli, "sync", "--projects", repo]);
1036
1074
  const migrated = fs.readFileSync(engineering, "utf8");
1037
- assert(migrated.includes("version=4.2.5"), "legacy migration should insert the current managed workflow");
1075
+ assert(migrated.includes("version=4.2.7"), "legacy migration should insert the current managed workflow");
1038
1076
  assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
1039
1077
  const stable = fs.readFileSync(engineering, "utf8");
1040
1078
  run("node", [cli, "sync", "--projects", repo]);
@@ -1134,7 +1172,7 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
1134
1172
  run("node", [cli, "sync", "--projects", repo]);
1135
1173
  const agents = path.join(repo, "AGENTS.md");
1136
1174
  const initial = fs.readFileSync(agents, "utf8");
1137
- assert(initial.includes("managed-agents:start version=4.2.5"), "new projects should receive the versioned root AGENTS block");
1175
+ assert(initial.includes("managed-agents:start version=4.2.7"), "new projects should receive the versioned root AGENTS block");
1138
1176
 
1139
1177
  const custom = [
1140
1178
  "# Project rules",
@@ -1153,12 +1191,12 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
1153
1191
 
1154
1192
  run("node", [cli, "sync", "--projects", repo]);
1155
1193
  const migrated = fs.readFileSync(agents, "utf8");
1156
- assert(migrated.includes("managed-agents:start version=4.2.5"), "AGENTS migration should install the current managed block");
1194
+ assert(migrated.includes("managed-agents:start version=4.2.7"), "AGENTS migration should install the current managed block");
1157
1195
  assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
1158
1196
  assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
1159
1197
  const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
1160
1198
  assert(migrated === canonical, "root AGENTS must be byte-identical to the packaged canonical file");
1161
- const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.5.md");
1199
+ const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.7.md");
1162
1200
  assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
1163
1201
  const stable = fs.readFileSync(agents);
1164
1202
  run("node", [cli, "sync", "--projects", repo]);
@@ -1215,7 +1253,7 @@ function testEngineeringFrameworkRejectsAnyNonCanonicalWorkflowText() {
1215
1253
 
1216
1254
  run("node", [cli, "init"], { cwd: repo });
1217
1255
  assert(!fs.readFileSync(engineering, "utf8").includes("backend owns APIs"), "init must restore the canonical ENGINEERING body");
1218
- const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.5", "docs", "ENGINEERING.md");
1256
+ const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.7", "docs", "ENGINEERING.md");
1219
1257
  assert(fs.readFileSync(archived, "utf8").includes("backend owns APIs"), "removed project text should remain in non-authoritative history");
1220
1258
  }
1221
1259
 
@@ -1227,12 +1265,12 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
1227
1265
 
1228
1266
  const manifestPath = path.join(repo, ".agents", "managed-install.json");
1229
1267
  const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
1230
- assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.5", "installed manifest must identify the release");
1268
+ assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.7", "installed manifest must identify the release");
1231
1269
  assert(manifest.entries.length > 0, "installed manifest must list managed files");
1232
1270
  for (const entry of manifest.entries) {
1233
1271
  assert(typeof entry.path === "string" && !path.isAbsolute(entry.path) && !entry.path.includes(".."), "manifest paths must be safe relative paths");
1234
1272
  assert(/^[0-9a-f]{64}$/.test(entry.sha256), `${entry.path}: manifest hash must be sha256`);
1235
- assert(entry.version === "4.2.5" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
1273
+ assert(entry.version === "4.2.7" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
1236
1274
  }
1237
1275
  assert(!manifest.managed_namespaces.some(item => item.path === ".agents" || item.path === "docs"), "manifest must not mirror entire project-owned trees");
1238
1276
 
@@ -1302,14 +1340,14 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
1302
1340
  }
1303
1341
 
1304
1342
  function testReleaseVersionMarkersStayInSync() {
1305
- const expected = "4.2.5";
1343
+ const expected = "4.2.7";
1306
1344
  const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
1307
1345
  const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
1308
1346
  const policy = JSON.parse(fs.readFileSync(
1309
1347
  path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
1310
1348
  "utf8",
1311
1349
  ));
1312
- assert(pkg.version === expected, "package version must match the 4.2.5 release");
1350
+ assert(pkg.version === expected, "package version must match the 4.2.7 release");
1313
1351
  assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
1314
1352
  assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
1315
1353
  const manifest = JSON.parse(fs.readFileSync(path.join(repoRoot, "cli", "assets", "managed-install.json"), "utf8"));
@@ -1345,10 +1383,13 @@ function testProtocolResponsibilitiesStaySeparated() {
1345
1383
  assert(agents.includes("## Minimum mechanism budget") && agents.includes("## Bounded real validation"), "AGENTS must remain the behavioral protocol");
1346
1384
  assert(skill.includes("## Select the minimum mechanism set") && !skill.includes("## Authority"), "SKILL must remain invocation guidance");
1347
1385
  assert(engineering.includes("The frontmatter contract is:") && !engineering.includes("## Git and parallel work"), "ENGINEERING must remain project configuration/facts");
1386
+ assert(engineering.includes("frontmatter values are authoritative"), "ENGINEERING policy summary must defer to project frontmatter");
1387
+ assert(!engineering.includes("advisory architecture and no-new-debt policy"), "ENGINEERING policy summary must not hard-code template defaults");
1348
1388
  }
1349
1389
 
1350
1390
  testInitFullyConvergesExistingProject();
1351
1391
  testStructureBlockWarningsDefaultsPreserveAndConverge();
1392
+ testManagedPolicySummaryPreservesProjectConfiguration();
1352
1393
  testInitRejectsMissingPythonRuntimeBeforeWrites();
1353
1394
  testDestVariants();
1354
1395
  testLauncherFallsBackToGlobalRuntime();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvis1513/auto-coding-skill",
3
- "version": "4.2.5",
3
+ "version": "4.2.7",
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": {