@elvis1513/auto-coding-skill 4.1.4 → 4.1.6
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 +16 -3
- package/cli/assets/skill/data/policies/workflow-migrations-v1.json +2 -2
- package/cli/assets/skill/data/templates/ENGINEERING.md +2 -2
- package/cli/assets/skill/data/templates/bridges/AGENTS.md +1 -1
- package/cli/assets/skill/requirements.txt +1 -2
- package/cli/assets/skill/scripts/ap.py +9 -18
- package/cli/assets/skill/scripts/core.py +35 -18
- package/cli/src/index.js +23 -1
- package/cli/tests/ap_concurrency_test.py +7 -2
- package/cli/tests/index.test.js +33 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,8 +9,11 @@ The Skill is a selectable guardrail, not a command sequence that must run for
|
|
|
9
9
|
every task. The model skips machinery whose expected benefit does not exceed its
|
|
10
10
|
cost; read-only work and obvious small clean-checkout changes normally stay direct.
|
|
11
11
|
|
|
12
|
-
Version 4.1.
|
|
13
|
-
|
|
12
|
+
Version 4.1.6 makes the Python runtime check, release verification, and tag
|
|
13
|
+
publication environment reproducible while removing the unnecessary `requests`
|
|
14
|
+
dependency. Version 4.1.4
|
|
15
|
+
made direct continuation provably pre-write, closed self-review and
|
|
16
|
+
risk-classification gaps, validated Agent contracts, and made tag publication
|
|
14
17
|
idempotent. Version 4.1.3 closed classification bypasses. Version 4.1.2 made mechanisms required,
|
|
15
18
|
model-selectable when beneficial, or forbidden for the current task. Version
|
|
16
19
|
4.1.1 consolidated the 4.x delivery-first workflow into one canonical
|
|
@@ -23,9 +26,9 @@ affected-scope checks are enabled only when concurrency or risk justifies them.
|
|
|
23
26
|
|
|
24
27
|
```bash
|
|
25
28
|
npm install -g @elvis1513/auto-coding-skill
|
|
29
|
+
python3 -m pip install PyYAML==6.0.3
|
|
26
30
|
autocoding init
|
|
27
31
|
autocoding sync --projects .
|
|
28
|
-
pip install pyyaml requests
|
|
29
32
|
```
|
|
30
33
|
|
|
31
34
|
The project install contains:
|
|
@@ -210,6 +213,16 @@ project-specific facts outside the managed ENGINEERING block. Root `AGENTS.md` i
|
|
|
210
213
|
replaced as a whole; its previous content is archived under
|
|
211
214
|
`docs/archive/workflow/` as historical, non-authoritative context.
|
|
212
215
|
|
|
216
|
+
## What changed in 4.1.6
|
|
217
|
+
|
|
218
|
+
- Made tag publication reproducible with explicit Node 24, Python 3.12, and pinned
|
|
219
|
+
PyYAML setup before package verification.
|
|
220
|
+
- Made `autocoding init` fail before writes with one interpreter-specific recovery
|
|
221
|
+
command when its Python runtime cannot import PyYAML.
|
|
222
|
+
- Removed the `requests` runtime dependency by using Python's standard HTTP library.
|
|
223
|
+
- Made concurrency tests self-contained instead of borrowing local thread and Git
|
|
224
|
+
identity configuration.
|
|
225
|
+
|
|
213
226
|
## What changed in 4.1.4
|
|
214
227
|
|
|
215
228
|
- Added clean pre-write direct claims so broad paths cannot adopt unknown existing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
workflow:
|
|
3
|
-
skill_version: "4.1.
|
|
3
|
+
skill_version: "4.1.6"
|
|
4
4
|
mode: "dev"
|
|
5
5
|
profile: "auto"
|
|
6
6
|
completion: "push"
|
|
@@ -94,7 +94,7 @@ docs:
|
|
|
94
94
|
|
|
95
95
|
# Engineering Configuration and Project Facts
|
|
96
96
|
|
|
97
|
-
<!-- auto-coding-skill:managed-workflow:start version=4.1.
|
|
97
|
+
<!-- auto-coding-skill:managed-workflow:start version=4.1.6 -->
|
|
98
98
|
|
|
99
99
|
Root `AGENTS.md` is the single shared behavioral protocol. The installed
|
|
100
100
|
`SKILL.md` contains invocation guidance. This file is the single source for the
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
requests>=2.31.0
|
|
1
|
+
PyYAML==6.0.3
|
|
@@ -24,12 +24,7 @@ import uuid
|
|
|
24
24
|
from pathlib import Path
|
|
25
25
|
from typing import Iterator, Optional, List
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
import yaml # type: ignore
|
|
29
|
-
except Exception:
|
|
30
|
-
yaml = None
|
|
31
|
-
|
|
32
|
-
from core import APError, ensure_git_repo, copy_tree, run, load_yaml, find_config, run_shell, http_get_status
|
|
27
|
+
from core import APError, ensure_git_repo, copy_tree, run, load_yaml, find_config, run_shell, http_get_status, require_yaml
|
|
33
28
|
from scaffold_templates import scaffold_groups, templates_for
|
|
34
29
|
|
|
35
30
|
|
|
@@ -51,7 +46,7 @@ _RECOMMENDED_FINAL_TOTAL_SECONDS = 180.0
|
|
|
51
46
|
_WORKFLOW_MIGRATION_POLICY = Path("data/policies/workflow-migrations-v1.json")
|
|
52
47
|
_FALLBACK_WORKFLOW_MIGRATION_POLICY = {
|
|
53
48
|
"schema_version": 1,
|
|
54
|
-
"managed_versions": {"agents": "4.1.
|
|
49
|
+
"managed_versions": {"agents": "4.1.6", "engineering": "4.1.6"},
|
|
55
50
|
"known_official_engineering_body_sha256": [
|
|
56
51
|
"d1306cc626e8baf8c83c953b760fd771066de2bf125168eca3a7b7d6ff2b87a2",
|
|
57
52
|
"305931c6edef770033a4f1970b00e5fb1c1728351856a173dbfa497daf563021",
|
|
@@ -638,8 +633,8 @@ def _migrate_fast_development_defaults(cfg: dict, repo: Path) -> list[str]:
|
|
|
638
633
|
if _text(workflow_cfg.get("completion")).lower() != "push":
|
|
639
634
|
workflow_cfg["completion"] = "push"
|
|
640
635
|
changed.append("workflow.completion")
|
|
641
|
-
if _text(workflow_cfg.get("skill_version")) != "4.1.
|
|
642
|
-
workflow_cfg["skill_version"] = "4.1.
|
|
636
|
+
if _text(workflow_cfg.get("skill_version")) != "4.1.6":
|
|
637
|
+
workflow_cfg["skill_version"] = "4.1.6"
|
|
643
638
|
changed.append("workflow.skill_version")
|
|
644
639
|
|
|
645
640
|
commands_cfg = cfg.setdefault("commands", {})
|
|
@@ -952,16 +947,16 @@ def cmd_upgrade(args: argparse.Namespace) -> None:
|
|
|
952
947
|
if current_agents:
|
|
953
948
|
archive_dir = repo / "docs" / "archive" / "workflow"
|
|
954
949
|
archive_header = (
|
|
955
|
-
"# Archived AGENTS.md before auto-coding-skill 4.1.
|
|
950
|
+
"# Archived AGENTS.md before auto-coding-skill 4.1.6\n\n"
|
|
956
951
|
"This file is historical and non-authoritative. The root AGENTS.md is fully managed.\n"
|
|
957
952
|
"Move any still-current project facts into docs/ENGINEERING.md or docs/project/,\n"
|
|
958
953
|
"without copying workflow rules back into the root AGENTS.md.\n\n---\n\n"
|
|
959
954
|
)
|
|
960
955
|
archive_content = archive_header + current_agents
|
|
961
|
-
archive = archive_dir / "AGENTS.pre-4.1.
|
|
956
|
+
archive = archive_dir / "AGENTS.pre-4.1.6.md"
|
|
962
957
|
if archive.exists() and archive.read_text(encoding="utf-8") != archive_content:
|
|
963
958
|
digest = hashlib.sha256(current_agents.encode("utf-8")).hexdigest()[:12]
|
|
964
|
-
archive = archive_dir / f"AGENTS.pre-4.1.
|
|
959
|
+
archive = archive_dir / f"AGENTS.pre-4.1.6-{digest}.md"
|
|
965
960
|
if not archive.exists():
|
|
966
961
|
add_action("policy", archive, "archive", "historical and non-authoritative")
|
|
967
962
|
if write:
|
|
@@ -1606,9 +1601,7 @@ def _parse_frontmatter_markdown_text(text: str, path: Path) -> tuple[dict, str]:
|
|
|
1606
1601
|
m = re.match(r"^---\s*\n(.*?)\n---\s*(\n|$)(.*)$", text, flags=re.DOTALL)
|
|
1607
1602
|
if not m:
|
|
1608
1603
|
raise APError(f"Markdown frontmatter not found: {path}")
|
|
1609
|
-
|
|
1610
|
-
raise APError("PyYAML not installed. Install dependencies with: pip install pyyaml requests")
|
|
1611
|
-
data = yaml.safe_load(m.group(1)) or {}
|
|
1604
|
+
data = require_yaml().safe_load(m.group(1)) or {}
|
|
1612
1605
|
return data, m.group(3)
|
|
1613
1606
|
|
|
1614
1607
|
|
|
@@ -1619,9 +1612,7 @@ def _read_frontmatter_markdown(path: Path) -> tuple[dict, str]:
|
|
|
1619
1612
|
|
|
1620
1613
|
|
|
1621
1614
|
def _write_frontmatter_markdown(path: Path, data: dict, body: str) -> None:
|
|
1622
|
-
|
|
1623
|
-
raise APError("PyYAML not installed. Install dependencies with: pip install pyyaml requests")
|
|
1624
|
-
dumped = yaml.safe_dump(data, allow_unicode=True, sort_keys=False).strip()
|
|
1615
|
+
dumped = require_yaml().safe_dump(data, allow_unicode=True, sort_keys=False).strip()
|
|
1625
1616
|
path.write_text(f"---\n{dumped}\n---\n{body}", encoding="utf-8")
|
|
1626
1617
|
|
|
1627
1618
|
|
|
@@ -7,8 +7,12 @@ from __future__ import annotations
|
|
|
7
7
|
import os
|
|
8
8
|
import re
|
|
9
9
|
import signal
|
|
10
|
+
import shlex
|
|
10
11
|
import shutil
|
|
11
12
|
import subprocess
|
|
13
|
+
import sys
|
|
14
|
+
import urllib.error
|
|
15
|
+
import urllib.request
|
|
12
16
|
from pathlib import Path
|
|
13
17
|
from typing import Iterable, Optional, Dict, Any
|
|
14
18
|
|
|
@@ -17,16 +21,32 @@ try:
|
|
|
17
21
|
except Exception:
|
|
18
22
|
yaml = None
|
|
19
23
|
|
|
20
|
-
try:
|
|
21
|
-
import requests # type: ignore
|
|
22
|
-
except Exception:
|
|
23
|
-
requests = None
|
|
24
|
-
|
|
25
|
-
|
|
26
24
|
class APError(RuntimeError):
|
|
27
25
|
pass
|
|
28
26
|
|
|
29
27
|
|
|
28
|
+
def runtime_requirements_path() -> Path:
|
|
29
|
+
return Path(__file__).resolve().parents[1] / "requirements.txt"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def require_yaml() -> Any:
|
|
33
|
+
if yaml is None:
|
|
34
|
+
install = shlex.join(
|
|
35
|
+
[
|
|
36
|
+
sys.executable,
|
|
37
|
+
"-m",
|
|
38
|
+
"pip",
|
|
39
|
+
"install",
|
|
40
|
+
"--requirement",
|
|
41
|
+
str(runtime_requirements_path()),
|
|
42
|
+
]
|
|
43
|
+
)
|
|
44
|
+
raise APError(
|
|
45
|
+
f"PyYAML is missing from {sys.executable}. Run: {install}"
|
|
46
|
+
)
|
|
47
|
+
return yaml
|
|
48
|
+
|
|
49
|
+
|
|
30
50
|
def run(cmd: Iterable[str], cwd: Optional[Path] = None, check: bool = True) -> subprocess.CompletedProcess:
|
|
31
51
|
p = subprocess.run(list(cmd), cwd=str(cwd) if cwd else None, text=True, capture_output=True)
|
|
32
52
|
if check and p.returncode != 0:
|
|
@@ -46,10 +66,7 @@ def ensure_git_repo(repo: Path) -> None:
|
|
|
46
66
|
def load_yaml(path: Path) -> Dict[str, Any]:
|
|
47
67
|
if not path.exists():
|
|
48
68
|
raise APError(f"YAML not found: {path}")
|
|
49
|
-
|
|
50
|
-
raise APError(
|
|
51
|
-
"PyYAML not installed. Install dependencies with: pip install pyyaml requests"
|
|
52
|
-
)
|
|
69
|
+
yaml_module = require_yaml()
|
|
53
70
|
if path.suffix.lower() in {".md", ".markdown"}:
|
|
54
71
|
text = path.read_text(encoding="utf-8")
|
|
55
72
|
m = re.match(r"^---\s*\n(.*?)\n---\s*(\n|$)", text, flags=re.DOTALL)
|
|
@@ -58,10 +75,10 @@ def load_yaml(path: Path) -> Dict[str, Any]:
|
|
|
58
75
|
f"Config markdown frontmatter not found: {path}\n"
|
|
59
76
|
"Expected YAML frontmatter wrapped by '---' at top of file."
|
|
60
77
|
)
|
|
61
|
-
data =
|
|
78
|
+
data = yaml_module.safe_load(m.group(1))
|
|
62
79
|
else:
|
|
63
80
|
with path.open("r", encoding="utf-8") as f:
|
|
64
|
-
data =
|
|
81
|
+
data = yaml_module.safe_load(f)
|
|
65
82
|
return data or {}
|
|
66
83
|
|
|
67
84
|
|
|
@@ -87,12 +104,12 @@ def copy_tree(src: Path, dst: Path) -> None:
|
|
|
87
104
|
|
|
88
105
|
|
|
89
106
|
def http_get_status(url: str, timeout_s: int = 5) -> int:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
107
|
+
request = urllib.request.Request(url, method="GET")
|
|
108
|
+
try:
|
|
109
|
+
with urllib.request.urlopen(request, timeout=timeout_s) as response:
|
|
110
|
+
return int(response.status)
|
|
111
|
+
except urllib.error.HTTPError as exc:
|
|
112
|
+
return int(exc.code)
|
|
96
113
|
|
|
97
114
|
|
|
98
115
|
def find_config(repo: Path) -> Path:
|
package/cli/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import crypto from "node:crypto";
|
|
6
|
-
import { execFileSync } from "node:child_process";
|
|
6
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
|
|
9
9
|
function die(msg){
|
|
@@ -118,6 +118,26 @@ function validateCommandArgs(args){
|
|
|
118
118
|
|
|
119
119
|
function exists(p){ try { fs.accessSync(p); return true; } catch { return false; } }
|
|
120
120
|
function rmrf(p){ fs.rmSync(p, { recursive: true, force: true }); }
|
|
121
|
+
function quoted(value){ return JSON.stringify(String(value)); }
|
|
122
|
+
|
|
123
|
+
function requireRuntimeDependencies(assetSkill){
|
|
124
|
+
const defaultPython = process.platform === "win32" ? "python" : "python3";
|
|
125
|
+
const python = String(process.env.AUTOCODING_PYTHON || defaultPython).trim() || defaultPython;
|
|
126
|
+
const requirements = path.join(assetSkill, "requirements.txt");
|
|
127
|
+
if (!exists(requirements)) die(`missing runtime dependency definition: ${requirements}`);
|
|
128
|
+
const check = spawnSync(
|
|
129
|
+
python,
|
|
130
|
+
["-c", "import yaml"],
|
|
131
|
+
{ encoding: "utf8", stdio: "pipe" },
|
|
132
|
+
);
|
|
133
|
+
if (check.status === 0) return;
|
|
134
|
+
const detail = String(check.stderr || check.error?.message || "PyYAML import failed").trim().split(/\r?\n/).slice(-1)[0];
|
|
135
|
+
const install = `${quoted(python)} -m pip install --requirement ${quoted(requirements)}`;
|
|
136
|
+
die(
|
|
137
|
+
`Python runtime dependency check failed${detail ? `: ${detail}` : ""}\n`
|
|
138
|
+
+ `Run: ${install}\nThen rerun autocoding init.`,
|
|
139
|
+
);
|
|
140
|
+
}
|
|
121
141
|
function shouldSkip(name){
|
|
122
142
|
return name === "__pycache__" || name === ".DS_Store" || name.endsWith(".pyc");
|
|
123
143
|
}
|
|
@@ -1470,6 +1490,8 @@ Compatibility:
|
|
|
1470
1490
|
|
|
1471
1491
|
if (args.ai) console.warn("[autocoding] --ai is deprecated and ignored; installing generic .agents.");
|
|
1472
1492
|
|
|
1493
|
+
requireRuntimeDependencies(assetSkill);
|
|
1494
|
+
|
|
1473
1495
|
const { skillDir, agentsDir } = resolveInstallDirs(args.mode, args.dest);
|
|
1474
1496
|
const existingTargets = [skillDir, agentsDir].filter(target => exists(target));
|
|
1475
1497
|
if (existingTargets.length && !args.force) {
|
|
@@ -16,6 +16,7 @@ import yaml
|
|
|
16
16
|
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
17
17
|
AP_SCRIPT = REPO_ROOT / "src" / "auto-coding-skill" / "scripts" / "ap.py"
|
|
18
18
|
_MISSING = object()
|
|
19
|
+
_TEST_OWNER = os.environ.get("CODEX_THREAD_ID") or "concurrency-test-owner"
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
def command(
|
|
@@ -25,7 +26,7 @@ def command(
|
|
|
25
26
|
input_text: str | None = None,
|
|
26
27
|
) -> subprocess.CompletedProcess[str]:
|
|
27
28
|
env = os.environ.copy()
|
|
28
|
-
env.setdefault("CODEX_THREAD_ID",
|
|
29
|
+
env.setdefault("CODEX_THREAD_ID", _TEST_OWNER)
|
|
29
30
|
result = subprocess.run(
|
|
30
31
|
list(args),
|
|
31
32
|
cwd=cwd,
|
|
@@ -655,7 +656,7 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
655
656
|
|
|
656
657
|
def test_writer_lease_requires_match_and_owner_handoff_uses_generation_cas(self) -> None:
|
|
657
658
|
_, repo, _ = self.make_repo()
|
|
658
|
-
owner =
|
|
659
|
+
owner = _TEST_OWNER
|
|
659
660
|
self.ap(
|
|
660
661
|
repo,
|
|
661
662
|
"task-start",
|
|
@@ -1337,6 +1338,8 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
1337
1338
|
git(task_module, "update-ref", "-d", "refs/heads/extra-check", extra_tip)
|
|
1338
1339
|
|
|
1339
1340
|
git(task_module, "checkout", "-qb", "hidden")
|
|
1341
|
+
git(task_module, "config", "user.email", "test@example.com")
|
|
1342
|
+
git(task_module, "config", "user.name", "Auto Coding Test")
|
|
1340
1343
|
(task_module / "hidden.txt").write_text("local-only history\n", encoding="utf-8")
|
|
1341
1344
|
git(task_module, "add", "hidden.txt")
|
|
1342
1345
|
git(task_module, "commit", "-qm", "hidden local commit")
|
|
@@ -1683,6 +1686,8 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
1683
1686
|
|
|
1684
1687
|
module_b = worktree / "vendor" / "b"
|
|
1685
1688
|
baseline = git_output(module_b, "rev-parse", "HEAD")
|
|
1689
|
+
git(module_b, "config", "user.email", "test@example.com")
|
|
1690
|
+
git(module_b, "config", "user.name", "Auto Coding Test")
|
|
1686
1691
|
git(module_b, "checkout", "-qb", "hidden")
|
|
1687
1692
|
(module_b / "hidden.txt").write_text("local-only residual history\n", encoding="utf-8")
|
|
1688
1693
|
git(module_b, "add", "hidden.txt")
|
package/cli/tests/index.test.js
CHANGED
|
@@ -169,6 +169,23 @@ function testPreflightAvoidsPartialInstall() {
|
|
|
169
169
|
assert(exists(path.join(repo, ".agents", "agents", "custom.toml")), "existing custom agent should remain");
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
function testInitRejectsMissingPythonRuntimeBeforeWrites() {
|
|
173
|
+
if (process.platform === "win32") return;
|
|
174
|
+
const repo = tmpdir("missing-python-runtime");
|
|
175
|
+
const fakePython = path.join(repo, "python-without-yaml");
|
|
176
|
+
writeFile(fakePython, "#!/bin/sh\necho 'No module named yaml' >&2\nexit 1\n");
|
|
177
|
+
fs.chmodSync(fakePython, 0o755);
|
|
178
|
+
const result = run("node", [cli, "init"], {
|
|
179
|
+
cwd: repo,
|
|
180
|
+
check: false,
|
|
181
|
+
env: { AUTOCODING_PYTHON: fakePython },
|
|
182
|
+
});
|
|
183
|
+
assert(result.status !== 0, "init should fail when its Python runtime cannot import PyYAML");
|
|
184
|
+
assert(result.stderr.includes("Python runtime dependency check failed"), "init should identify the runtime dependency failure");
|
|
185
|
+
assert(result.stderr.includes("requirements.txt") && result.stderr.includes("Then rerun autocoding init"), "init should print one deterministic recovery command");
|
|
186
|
+
assert(!exists(path.join(repo, ".agents")), "runtime preflight must fail before writing .agents");
|
|
187
|
+
}
|
|
188
|
+
|
|
172
189
|
function testDestVariants() {
|
|
173
190
|
const variants = [
|
|
174
191
|
{ name: "repo-root", dest(root) { return root; } },
|
|
@@ -735,7 +752,7 @@ function testManagedEngineeringSyncIsControlledAndIdempotent() {
|
|
|
735
752
|
|
|
736
753
|
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
737
754
|
const initial = fs.readFileSync(engineering, "utf8");
|
|
738
|
-
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.1\.
|
|
755
|
+
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.1\.6 -->/;
|
|
739
756
|
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
740
757
|
assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
|
|
741
758
|
assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
|
|
@@ -754,7 +771,7 @@ function testManagedEngineeringSyncIsControlledAndIdempotent() {
|
|
|
754
771
|
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
755
772
|
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
756
773
|
assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
|
|
757
|
-
assert(dryResult.managedWorkflow.version === "4.1.
|
|
774
|
+
assert(dryResult.managedWorkflow.version === "4.1.6", "dry-run should expose the target workflow version");
|
|
758
775
|
assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
|
|
759
776
|
assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
|
|
760
777
|
|
|
@@ -764,14 +781,14 @@ function testManagedEngineeringSyncIsControlledAndIdempotent() {
|
|
|
764
781
|
const updatedEnd = updated.indexOf(endMarker) + endMarker.length;
|
|
765
782
|
assert(updated.slice(0, updatedStart) === outsideBefore, "sync must preserve frontmatter and content before the managed block byte-for-byte");
|
|
766
783
|
assert(updated.slice(updatedEnd) === outsideAfter, "sync must preserve content after the managed block byte-for-byte");
|
|
767
|
-
assert(updated.includes("version=4.1.
|
|
784
|
+
assert(updated.includes("version=4.1.6"), "sync should install the current managed workflow version");
|
|
768
785
|
assert(updated.includes("The frontmatter contract is:"), "sync should refresh stale managed workflow content");
|
|
769
786
|
|
|
770
787
|
fillRequiredAccess(repo);
|
|
771
788
|
const status = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
772
789
|
const statusResult = JSON.parse(status.stdout).results[0];
|
|
773
790
|
assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
|
|
774
|
-
assert(statusResult.managedWorkflow.version === "4.1.
|
|
791
|
+
assert(statusResult.managedWorkflow.version === "4.1.6", "status should expose the installed managed workflow version");
|
|
775
792
|
|
|
776
793
|
const beforeSecondSync = fs.readFileSync(engineering, "utf8");
|
|
777
794
|
const second = run("node", [cli, "sync", "--projects", repo, "--json"]);
|
|
@@ -799,7 +816,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
|
|
|
799
816
|
assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
|
|
800
817
|
run("node", [cli, "sync", "--projects", repo]);
|
|
801
818
|
const migrated = fs.readFileSync(engineering, "utf8");
|
|
802
|
-
assert(migrated.includes("version=4.1.
|
|
819
|
+
assert(migrated.includes("version=4.1.6"), "legacy migration should insert the current managed workflow");
|
|
803
820
|
assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
|
|
804
821
|
const migratedStart = migrated.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
805
822
|
const migratedEnd = migrated.indexOf(endMarker) + endMarker.length;
|
|
@@ -903,7 +920,7 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
|
903
920
|
run("node", [cli, "sync", "--projects", repo]);
|
|
904
921
|
const agents = path.join(repo, "AGENTS.md");
|
|
905
922
|
const initial = fs.readFileSync(agents, "utf8");
|
|
906
|
-
assert(initial.includes("managed-agents:start version=4.1.
|
|
923
|
+
assert(initial.includes("managed-agents:start version=4.1.6"), "new projects should receive the versioned root AGENTS block");
|
|
907
924
|
|
|
908
925
|
const custom = [
|
|
909
926
|
"# Project rules",
|
|
@@ -922,12 +939,12 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
|
922
939
|
|
|
923
940
|
run("node", [cli, "sync", "--projects", repo]);
|
|
924
941
|
const migrated = fs.readFileSync(agents, "utf8");
|
|
925
|
-
assert(migrated.includes("managed-agents:start version=4.1.
|
|
942
|
+
assert(migrated.includes("managed-agents:start version=4.1.6"), "AGENTS migration should install the current managed block");
|
|
926
943
|
assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
|
|
927
944
|
assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
|
|
928
945
|
const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
|
|
929
946
|
assert(migrated === canonical, "root AGENTS must be byte-identical to the packaged canonical file");
|
|
930
|
-
const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.1.
|
|
947
|
+
const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.1.6.md");
|
|
931
948
|
assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
|
|
932
949
|
const stable = fs.readFileSync(agents);
|
|
933
950
|
run("node", [cli, "sync", "--projects", repo]);
|
|
@@ -986,7 +1003,7 @@ function testEngineeringFrameworkAllowsProjectFactsButRejectsDuplicateWorkflow()
|
|
|
986
1003
|
const migrationResult = JSON.parse(migration.stdout).results[0];
|
|
987
1004
|
assert(migrationResult.managedWorkflow.state === "stale", "known duplicate sections should use controlled migration");
|
|
988
1005
|
assert(migrationResult.managedWorkflow.migrations.includes("engineering-section-delivery-flow"), "known section migration should be explicit");
|
|
989
|
-
assert(migrationResult.actions.some(item => item.action === "would-archive" && item.path.includes("ENGINEERING.pre-4.1.
|
|
1006
|
+
assert(migrationResult.actions.some(item => item.action === "would-archive" && item.path.includes("ENGINEERING.pre-4.1.6")), "controlled section cleanup should archive the previous ENGINEERING file");
|
|
990
1007
|
run("node", [cli, "sync", "--projects", repo]);
|
|
991
1008
|
assert(!fs.readFileSync(engineering, "utf8").includes("Known obsolete workflow"), "known duplicate workflow section should be removed");
|
|
992
1009
|
|
|
@@ -998,18 +1015,22 @@ function testEngineeringFrameworkAllowsProjectFactsButRejectsDuplicateWorkflow()
|
|
|
998
1015
|
}
|
|
999
1016
|
|
|
1000
1017
|
function testReleaseVersionMarkersStayInSync() {
|
|
1001
|
-
const expected = "4.1.
|
|
1018
|
+
const expected = "4.1.6";
|
|
1002
1019
|
const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
|
|
1003
1020
|
const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
|
|
1004
1021
|
const policy = JSON.parse(fs.readFileSync(
|
|
1005
1022
|
path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
|
|
1006
1023
|
"utf8",
|
|
1007
1024
|
));
|
|
1008
|
-
assert(pkg.version === expected, "package version must match the 4.1.
|
|
1025
|
+
assert(pkg.version === expected, "package version must match the 4.1.6 release");
|
|
1009
1026
|
assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
|
|
1010
1027
|
assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
|
|
1011
1028
|
const publishWorkflow = fs.readFileSync(path.join(repoRoot, ".github", "workflows", "npm-publish.yml"), "utf8");
|
|
1029
|
+
const runtimeRequirements = fs.readFileSync(path.join(repoRoot, "src", "auto-coding-skill", "requirements.txt"), "utf8");
|
|
1012
1030
|
assert(publishWorkflow.includes("tags:\n - \"v*\""), "npm publish must run from version tag pushes");
|
|
1031
|
+
assert(publishWorkflow.includes("actions/setup-python@v6") && publishWorkflow.includes("src/auto-coding-skill/requirements.txt"), "npm publish must install the pinned Python runtime before verification");
|
|
1032
|
+
assert(runtimeRequirements.trim() === "PyYAML==6.0.3", "the runtime must have one pinned third-party dependency");
|
|
1033
|
+
assert(!runtimeRequirements.toLowerCase().includes("requests"), "HTTP checks must stay on the Python standard library");
|
|
1013
1034
|
assert(publishWorkflow.includes("Verify release identity"), "npm publish must bind the tag to package version");
|
|
1014
1035
|
assert(publishWorkflow.includes("Check npm registry") && publishWorkflow.includes("Verify npm publication"), "npm publish must be idempotent and registry-verified");
|
|
1015
1036
|
for (const rel of [
|
|
@@ -1034,6 +1055,7 @@ function testProtocolResponsibilitiesStaySeparated() {
|
|
|
1034
1055
|
}
|
|
1035
1056
|
|
|
1036
1057
|
testPreflightAvoidsPartialInstall();
|
|
1058
|
+
testInitRejectsMissingPythonRuntimeBeforeWrites();
|
|
1037
1059
|
testDestVariants();
|
|
1038
1060
|
testLauncherFallsBackToGlobalRuntime();
|
|
1039
1061
|
testMinimalSyncConvergesWithinBudget();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvis1513/auto-coding-skill",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.6",
|
|
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": {
|