@elvis1513/auto-coding-skill 4.1.9 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -4
- package/cli/assets/agents/reviewer.toml +35 -13
- package/cli/assets/managed-install.json +1 -1
- package/cli/assets/skill/SKILL.md +31 -18
- package/cli/assets/skill/data/policies/workflow-migrations-v1.json +2 -2
- package/cli/assets/skill/data/templates/ENGINEERING.md +3 -21
- package/cli/assets/skill/data/templates/bridges/AGENTS.md +24 -13
- package/cli/assets/skill/scripts/ap.py +994 -126
- package/cli/assets/skill/scripts/core.py +2 -2
- package/cli/tests/ap_concurrency_test.py +311 -6
- package/cli/tests/ap_profiles_test.py +485 -3
- package/cli/tests/core_shell_test.py +84 -0
- package/cli/tests/index.test.js +21 -18
- package/package.json +2 -2
package/cli/tests/index.test.js
CHANGED
|
@@ -209,7 +209,7 @@ function testInitFullyConvergesExistingProject() {
|
|
|
209
209
|
assert(!converged.includes("legacy_extra") && !converged.includes("Run a full build every time"), "unknown fields and legacy workflow text must be removed");
|
|
210
210
|
assert(exists(path.join(repo, ".agents", "agents", "custom.toml")), "project-owned custom agents must survive init");
|
|
211
211
|
assert(!exists(path.join(repo, ".agents", "skills", "auto-coding-skill", "obsolete.txt")), "extra Skill files must be removed");
|
|
212
|
-
assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.1
|
|
212
|
+
assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.1", "docs", "legacy", "old-taskbook.md")), "removed docs must be archived outside active docs");
|
|
213
213
|
assert(fs.readFileSync(path.join(repo, "docs", "architecture", "structure-standard.md"), "utf8").startsWith("# Project Structure Standard"), "managed templates must be replaced");
|
|
214
214
|
assert(fs.readFileSync(path.join(repo, "docs", "architecture", "adr", "0042-project-choice.md"), "utf8").includes("Keep me"), "numbered ADR artifacts must survive init");
|
|
215
215
|
assert(fs.readFileSync(path.join(repo, "docs", "architecture", "system-context.md"), "utf8").includes("Keep me"), "architecture artifacts must survive init");
|
|
@@ -286,9 +286,10 @@ function testMinimalInitConvergesWithinBudget() {
|
|
|
286
286
|
const files = listProjectFiles(repo);
|
|
287
287
|
const lines = files.reduce((total, file) => total + fs.readFileSync(file, "utf8").split(/\r?\n/).length, 0);
|
|
288
288
|
assert(files.length <= 40, `minimal scaffold file budget exceeded: ${files.length}`);
|
|
289
|
-
//
|
|
290
|
-
// Keep a measured ceiling while
|
|
291
|
-
|
|
289
|
+
// Integrity, staging, fail-closed classification, and contract helpers are
|
|
290
|
+
// executable support code, not prompt context. Keep a measured ceiling while
|
|
291
|
+
// leaving deterministic checks readable.
|
|
292
|
+
assert(lines <= 13100, `minimal scaffold line budget exceeded: ${lines}`);
|
|
292
293
|
const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
|
|
293
294
|
assert(engineering.includes("profile: auto"), "engineering should enable adaptive profiles");
|
|
294
295
|
assert(engineering.includes("isolation: adaptive"), "engineering should default to adaptive clean-branch/worktree isolation");
|
|
@@ -307,6 +308,8 @@ function testMinimalInitConvergesWithinBudget() {
|
|
|
307
308
|
assert(fixer.includes("owned_paths"), "fixer should receive explicit path ownership");
|
|
308
309
|
assert(fixer.includes("不提交、不推送、不集成"), "fixer should leave Git lifecycle to the main agent");
|
|
309
310
|
assert(reviewer.includes("diff_fingerprint"), "reviewer verdict should bind to a stable diff");
|
|
311
|
+
assert(reviewer.includes("agent-result-template"), "reviewer should use the complete result skeleton");
|
|
312
|
+
assert(reviewer.includes("90 秒"), "reviewer should enforce the focused review budget");
|
|
310
313
|
assert(browserDebugger.includes('sandbox_mode = "read-only"'), "browser discovery should be read-only");
|
|
311
314
|
|
|
312
315
|
const incomplete = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
|
|
@@ -822,7 +825,7 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
|
|
|
822
825
|
|
|
823
826
|
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
824
827
|
const initial = fs.readFileSync(engineering, "utf8");
|
|
825
|
-
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.1
|
|
828
|
+
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.1 -->/;
|
|
826
829
|
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
827
830
|
assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
|
|
828
831
|
assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
|
|
@@ -836,21 +839,21 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
|
|
|
836
839
|
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
837
840
|
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
838
841
|
assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
|
|
839
|
-
assert(dryResult.managedWorkflow.version === "4.1
|
|
842
|
+
assert(dryResult.managedWorkflow.version === "4.2.1", "dry-run should expose the target workflow version");
|
|
840
843
|
assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
|
|
841
844
|
assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
|
|
842
845
|
|
|
843
846
|
run("node", [cli, "init"], { cwd: repo });
|
|
844
847
|
const updated = fs.readFileSync(engineering, "utf8");
|
|
845
848
|
assert(!updated.includes("project note before") && !updated.includes("project note after"), "init must remove text outside the canonical ENGINEERING body");
|
|
846
|
-
assert(updated.includes("version=4.1
|
|
849
|
+
assert(updated.includes("version=4.2.1"), "init should install the current managed workflow version");
|
|
847
850
|
assert(updated.includes("The frontmatter contract is:"), "init should refresh stale managed workflow content");
|
|
848
851
|
|
|
849
852
|
fillRequiredAccess(repo);
|
|
850
853
|
const status = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
851
854
|
const statusResult = JSON.parse(status.stdout).results[0];
|
|
852
855
|
assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
|
|
853
|
-
assert(statusResult.managedWorkflow.version === "4.1
|
|
856
|
+
assert(statusResult.managedWorkflow.version === "4.2.1", "status should expose the installed managed workflow version");
|
|
854
857
|
|
|
855
858
|
const beforeSecondInit = fs.readFileSync(engineering, "utf8");
|
|
856
859
|
run("node", [cli, "init"], { cwd: repo });
|
|
@@ -877,7 +880,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
|
|
|
877
880
|
assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
|
|
878
881
|
run("node", [cli, "sync", "--projects", repo]);
|
|
879
882
|
const migrated = fs.readFileSync(engineering, "utf8");
|
|
880
|
-
assert(migrated.includes("version=4.1
|
|
883
|
+
assert(migrated.includes("version=4.2.1"), "legacy migration should insert the current managed workflow");
|
|
881
884
|
assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
|
|
882
885
|
const stable = fs.readFileSync(engineering, "utf8");
|
|
883
886
|
run("node", [cli, "sync", "--projects", repo]);
|
|
@@ -977,7 +980,7 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
|
977
980
|
run("node", [cli, "sync", "--projects", repo]);
|
|
978
981
|
const agents = path.join(repo, "AGENTS.md");
|
|
979
982
|
const initial = fs.readFileSync(agents, "utf8");
|
|
980
|
-
assert(initial.includes("managed-agents:start version=4.1
|
|
983
|
+
assert(initial.includes("managed-agents:start version=4.2.1"), "new projects should receive the versioned root AGENTS block");
|
|
981
984
|
|
|
982
985
|
const custom = [
|
|
983
986
|
"# Project rules",
|
|
@@ -996,12 +999,12 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
|
996
999
|
|
|
997
1000
|
run("node", [cli, "sync", "--projects", repo]);
|
|
998
1001
|
const migrated = fs.readFileSync(agents, "utf8");
|
|
999
|
-
assert(migrated.includes("managed-agents:start version=4.1
|
|
1002
|
+
assert(migrated.includes("managed-agents:start version=4.2.1"), "AGENTS migration should install the current managed block");
|
|
1000
1003
|
assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
|
|
1001
1004
|
assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
|
|
1002
1005
|
const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
|
|
1003
1006
|
assert(migrated === canonical, "root AGENTS must be byte-identical to the packaged canonical file");
|
|
1004
|
-
const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.1.
|
|
1007
|
+
const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.1.md");
|
|
1005
1008
|
assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
|
|
1006
1009
|
const stable = fs.readFileSync(agents);
|
|
1007
1010
|
run("node", [cli, "sync", "--projects", repo]);
|
|
@@ -1058,7 +1061,7 @@ function testEngineeringFrameworkRejectsAnyNonCanonicalWorkflowText() {
|
|
|
1058
1061
|
|
|
1059
1062
|
run("node", [cli, "init"], { cwd: repo });
|
|
1060
1063
|
assert(!fs.readFileSync(engineering, "utf8").includes("backend owns APIs"), "init must restore the canonical ENGINEERING body");
|
|
1061
|
-
const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.1
|
|
1064
|
+
const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.1", "docs", "ENGINEERING.md");
|
|
1062
1065
|
assert(fs.readFileSync(archived, "utf8").includes("backend owns APIs"), "removed project text should remain in non-authoritative history");
|
|
1063
1066
|
}
|
|
1064
1067
|
|
|
@@ -1070,12 +1073,12 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
|
|
|
1070
1073
|
|
|
1071
1074
|
const manifestPath = path.join(repo, ".agents", "managed-install.json");
|
|
1072
1075
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
1073
|
-
assert(manifest.schema_version === 1 && manifest.skill_version === "4.1
|
|
1076
|
+
assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.1", "installed manifest must identify the release");
|
|
1074
1077
|
assert(manifest.entries.length > 0, "installed manifest must list managed files");
|
|
1075
1078
|
for (const entry of manifest.entries) {
|
|
1076
1079
|
assert(typeof entry.path === "string" && !path.isAbsolute(entry.path) && !entry.path.includes(".."), "manifest paths must be safe relative paths");
|
|
1077
1080
|
assert(/^[0-9a-f]{64}$/.test(entry.sha256), `${entry.path}: manifest hash must be sha256`);
|
|
1078
|
-
assert(entry.version === "4.1
|
|
1081
|
+
assert(entry.version === "4.2.1" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
|
|
1079
1082
|
}
|
|
1080
1083
|
assert(!manifest.managed_namespaces.some(item => item.path === ".agents" || item.path === "docs"), "manifest must not mirror entire project-owned trees");
|
|
1081
1084
|
|
|
@@ -1145,14 +1148,14 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
|
|
|
1145
1148
|
}
|
|
1146
1149
|
|
|
1147
1150
|
function testReleaseVersionMarkersStayInSync() {
|
|
1148
|
-
const expected = "4.1
|
|
1151
|
+
const expected = "4.2.1";
|
|
1149
1152
|
const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
|
|
1150
1153
|
const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
|
|
1151
1154
|
const policy = JSON.parse(fs.readFileSync(
|
|
1152
1155
|
path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
|
|
1153
1156
|
"utf8",
|
|
1154
1157
|
));
|
|
1155
|
-
assert(pkg.version === expected, "package version must match the 4.1
|
|
1158
|
+
assert(pkg.version === expected, "package version must match the 4.2.1 release");
|
|
1156
1159
|
assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
|
|
1157
1160
|
assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
|
|
1158
1161
|
const manifest = JSON.parse(fs.readFileSync(path.join(repoRoot, "cli", "assets", "managed-install.json"), "utf8"));
|
|
@@ -1182,7 +1185,7 @@ function testProtocolResponsibilitiesStaySeparated() {
|
|
|
1182
1185
|
const agents = fs.readFileSync(path.join(repoRoot, "src", "auto-coding-skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
|
|
1183
1186
|
const engineering = fs.readFileSync(path.join(repoRoot, "src", "auto-coding-skill", "data", "templates", "ENGINEERING.md"), "utf8");
|
|
1184
1187
|
const totalLines = [skill, agents, engineering].reduce((sum, text) => sum + text.split(/\r?\n/).length, 0);
|
|
1185
|
-
assert(totalLines <=
|
|
1188
|
+
assert(totalLines <= 360, `shared protocol context budget exceeded: ${totalLines} lines`);
|
|
1186
1189
|
assert(agents.includes("## Minimum mechanism budget") && agents.includes("## Bounded real validation"), "AGENTS must remain the behavioral protocol");
|
|
1187
1190
|
assert(skill.includes("## Select the minimum mechanism set") && !skill.includes("## Authority"), "SKILL must remain invocation guidance");
|
|
1188
1191
|
assert(engineering.includes("The frontmatter contract is:") && !engineering.includes("## Git and parallel work"), "ENGINEERING must remain project configuration/facts");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvis1513/auto-coding-skill",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
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": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"clean:cache": "find cli src -type d -name '__pycache__' -prune -exec rm -rf {} +",
|
|
20
20
|
"prepack": "npm run clean:cache",
|
|
21
21
|
"check:package": "npm run clean:cache && node cli/src/check-package.js",
|
|
22
|
-
"test": "node -c cli/src/index.js && node -c cli/src/sync-assets.js && node -c cli/tests/index.test.js && node cli/tests/index.test.js && python3 -c \"import ast, pathlib; files = ['cli/assets/skill/scripts/ap.py', 'cli/assets/skill/scripts/core.py', 'cli/assets/skill/scripts/http_checks.py', 'cli/assets/skill/scripts/install_integrity.py', 'cli/assets/skill/scripts/scaffold_templates.py']; [ast.parse(pathlib.Path(rel).read_text(encoding='utf-8'), filename=rel, feature_version=(3, 11)) for rel in files]; print('python311-asset-grammar-ok')\" && python3 -m py_compile cli/assets/skill/scripts/ap.py cli/assets/skill/scripts/core.py cli/assets/skill/scripts/http_checks.py cli/assets/skill/scripts/install_integrity.py cli/assets/skill/scripts/scaffold_templates.py && python3 cli/tests/ap_profiles_test.py && python3 cli/tests/ap_concurrency_test.py && python3 -c \"import pathlib, tomllib; files = sorted(pathlib.Path('cli/assets/agents').glob('*.toml')); [tomllib.loads(path.read_text(encoding='utf-8')) for path in files]; print('asset-agent-toml-ok')\" && find cli -type d -name '__pycache__' -prune -exec rm -rf {} +",
|
|
22
|
+
"test": "node -c cli/src/index.js && node -c cli/src/sync-assets.js && node -c cli/tests/index.test.js && node cli/tests/index.test.js && python3 -c \"import ast, pathlib; files = ['cli/assets/skill/scripts/ap.py', 'cli/assets/skill/scripts/core.py', 'cli/assets/skill/scripts/http_checks.py', 'cli/assets/skill/scripts/install_integrity.py', 'cli/assets/skill/scripts/scaffold_templates.py']; [ast.parse(pathlib.Path(rel).read_text(encoding='utf-8'), filename=rel, feature_version=(3, 11)) for rel in files]; print('python311-asset-grammar-ok')\" && python3 -m py_compile cli/assets/skill/scripts/ap.py cli/assets/skill/scripts/core.py cli/assets/skill/scripts/http_checks.py cli/assets/skill/scripts/install_integrity.py cli/assets/skill/scripts/scaffold_templates.py && python3 cli/tests/core_shell_test.py && python3 cli/tests/ap_profiles_test.py && python3 cli/tests/ap_concurrency_test.py && python3 -c \"import pathlib, tomllib; files = sorted(pathlib.Path('cli/assets/agents').glob('*.toml')); [tomllib.loads(path.read_text(encoding='utf-8')) for path in files]; print('asset-agent-toml-ok')\" && find cli -type d -name '__pycache__' -prune -exec rm -rf {} +",
|
|
23
23
|
"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/install_integrity.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/install_integrity.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 {} +",
|
|
24
24
|
"check:assets": "node cli/src/sync-assets.js --check",
|
|
25
25
|
"sync-assets": "node cli/src/sync-assets.js",
|