@elvis1513/auto-coding-skill 4.0.0 → 4.1.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 +61 -14
- package/cli/assets/agents/reviewer.toml +3 -2
- package/cli/assets/skill/SKILL.md +38 -92
- package/cli/assets/skill/data/contracts/orchestration-v1.schema.json +16 -1
- package/cli/assets/skill/data/policies/workflow-migrations-v1.json +291 -5
- package/cli/assets/skill/data/templates/ENGINEERING.md +40 -134
- package/cli/assets/skill/data/templates/bridges/AGENTS.md +117 -27
- package/cli/assets/skill/scripts/__pycache__/core.cpython-314.pyc +0 -0
- package/cli/assets/skill/scripts/__pycache__/scaffold_templates.cpython-314.pyc +0 -0
- package/cli/assets/skill/scripts/ap.py +427 -57
- package/cli/assets/skill/scripts/core.py +21 -5
- package/cli/assets/skill/scripts/scaffold_templates.py +40 -5
- package/cli/src/index.js +192 -85
- package/cli/tests/ap_concurrency_test.py +77 -11
- package/cli/tests/ap_profiles_test.py +66 -23
- package/cli/tests/index.test.js +98 -66
- package/package.json +1 -1
- package/cli/assets/skill/data/templates/docs/tasks/closure-log.md +0 -17
- package/cli/assets/skill/data/templates/docs/tasks/taskbook.md +0 -30
package/cli/tests/index.test.js
CHANGED
|
@@ -137,7 +137,18 @@ function fillRequiredAccess(repo, password = "local-dev-password") {
|
|
|
137
137
|
` password: ${JSON.stringify(password)}`,
|
|
138
138
|
].join("\n");
|
|
139
139
|
const withAccess = text.replace(/^access:\r?\n[\s\S]*?(?=^concurrency:)/m, `${block}\n\n`);
|
|
140
|
-
const updated = withAccess
|
|
140
|
+
const updated = withAccess
|
|
141
|
+
.replace(' project_fast: ""', ' project_fast: "true"')
|
|
142
|
+
.replace(
|
|
143
|
+
" routes: []",
|
|
144
|
+
[
|
|
145
|
+
" routes:",
|
|
146
|
+
' - name: "project-code"',
|
|
147
|
+
' paths: ["**"]',
|
|
148
|
+
' exclude: ["*.md", "docs/**"]',
|
|
149
|
+
' commands: ["project_fast"]',
|
|
150
|
+
].join("\n"),
|
|
151
|
+
);
|
|
141
152
|
assert(updated !== text || text.includes(password), "required project values should be replaceable");
|
|
142
153
|
fs.writeFileSync(engineering, updated);
|
|
143
154
|
}
|
|
@@ -208,15 +219,19 @@ function testMinimalSyncConvergesWithinBudget() {
|
|
|
208
219
|
const files = listProjectFiles(repo);
|
|
209
220
|
const lines = files.reduce((total, file) => total + fs.readFileSync(file, "utf8").split(/\r?\n/).length, 0);
|
|
210
221
|
assert(files.length <= 23, `minimal scaffold file budget exceeded: ${files.length}`);
|
|
211
|
-
assert(lines <=
|
|
222
|
+
assert(lines <= 10800, `minimal scaffold line budget exceeded: ${lines}`);
|
|
212
223
|
const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
|
|
213
224
|
assert(engineering.includes("profile: \"auto\""), "engineering should enable adaptive profiles");
|
|
214
225
|
assert(engineering.includes("isolation: \"adaptive\""), "engineering should default to adaptive clean-branch/worktree isolation");
|
|
215
226
|
assert(engineering.includes('completion: "push"'), "engineering should complete normal development at push");
|
|
216
|
-
assert(engineering.includes('project_fast: ""'), "generic projects should
|
|
227
|
+
assert(engineering.includes('project_fast: ""'), "generic projects should expose an optional project-fast command");
|
|
228
|
+
assert(engineering.includes("max_command_seconds: 120"), "engineering should bound each final route command");
|
|
229
|
+
assert(engineering.includes("max_total_seconds: 180"), "engineering should bound the complete final gate");
|
|
217
230
|
assert(engineering.includes(`name: "${path.basename(repo)}"`), "project name should be initialized automatically");
|
|
218
|
-
assert(engineering.includes("## Design, review, and subagents"), "engineering
|
|
219
|
-
|
|
231
|
+
assert(!engineering.includes("## Design, review, and subagents"), "engineering must not duplicate the behavioral protocol");
|
|
232
|
+
const agentsProtocol = fs.readFileSync(path.join(repo, "AGENTS.md"), "utf8");
|
|
233
|
+
assert(agentsProtocol.includes("## Minimum mechanism budget"), "AGENTS should own the shared behavioral protocol");
|
|
234
|
+
assert(agentsProtocol.includes("One writer in a clean checkout works directly"), "AGENTS should enforce direct clean serial work");
|
|
220
235
|
const fixer = fs.readFileSync(path.join(repo, ".agents", "agents", "fixer.toml"), "utf8");
|
|
221
236
|
const reviewer = fs.readFileSync(path.join(repo, ".agents", "agents", "reviewer.toml"), "utf8");
|
|
222
237
|
const browserDebugger = fs.readFileSync(path.join(repo, ".agents", "agents", "browser-debugger.toml"), "utf8");
|
|
@@ -471,14 +486,14 @@ function testBridgeIsGeneric() {
|
|
|
471
486
|
run("python3", [assetAp, "--repo", repo, "install", "--bridges"]);
|
|
472
487
|
assert(exists(path.join(repo, "AGENTS.md")), "generic bridge should be created");
|
|
473
488
|
const bridge = fs.readFileSync(path.join(repo, "AGENTS.md"), "utf8");
|
|
474
|
-
assert(bridge.includes("
|
|
475
|
-
assert(bridge.includes("
|
|
489
|
+
assert(bridge.includes("Every writing agent owns a distinct task ID, worktree"), "bridge should expose writer isolation");
|
|
490
|
+
assert(bridge.includes("integrates in dependency order"), "bridge should expose dependency ordering");
|
|
476
491
|
for (const filename of [`CO${"DEX.md"}`, `CLA${"UDE.md"}`]) {
|
|
477
492
|
assert(!exists(path.join(repo, filename)), "client-named bridge should not be created");
|
|
478
493
|
}
|
|
479
494
|
}
|
|
480
495
|
|
|
481
|
-
function
|
|
496
|
+
function testUpgradeCleansAllManagedSkillExtras() {
|
|
482
497
|
const repo = tmpdir("upgrade-extra");
|
|
483
498
|
run("git", ["init", "-q"], { cwd: repo });
|
|
484
499
|
run("node", [cli, "init", "--force"], { cwd: repo });
|
|
@@ -487,7 +502,7 @@ function testUpgradeCleansManagedBridgeExtrasOnly() {
|
|
|
487
502
|
writeFile(path.join(repo, ".agents", "skills", "auto-coding-skill", "custom.txt"), "custom\n");
|
|
488
503
|
run("python3", [assetAp, "--repo", repo, "upgrade", "--write"]);
|
|
489
504
|
assert(!exists(path.join(repo, ".agents", "skills", "auto-coding-skill", "data", "templates", "bridges", "OLD.md")), "managed bridge extra should be removed");
|
|
490
|
-
assert(exists(path.join(repo, ".agents", "skills", "auto-coding-skill", "custom.txt")), "
|
|
505
|
+
assert(!exists(path.join(repo, ".agents", "skills", "auto-coding-skill", "custom.txt")), "fully managed Skill extras should be removed");
|
|
491
506
|
}
|
|
492
507
|
|
|
493
508
|
function testOptionalDocsAndLegacyToolsDoNotCauseDrift() {
|
|
@@ -718,7 +733,7 @@ function testManagedEngineeringSyncIsControlledAndIdempotent() {
|
|
|
718
733
|
|
|
719
734
|
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
720
735
|
const initial = fs.readFileSync(engineering, "utf8");
|
|
721
|
-
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.
|
|
736
|
+
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.1\.1 -->/;
|
|
722
737
|
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
723
738
|
assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
|
|
724
739
|
assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
|
|
@@ -727,7 +742,7 @@ function testManagedEngineeringSyncIsControlledAndIdempotent() {
|
|
|
727
742
|
.replace("workflow:\n", "# project-frontmatter-comment\nworkflow:\n")
|
|
728
743
|
.replace(startPattern, "project note before managed workflow\n<!-- auto-coding-skill:managed-workflow:start version=3.0.0 -->")
|
|
729
744
|
.replace(endMarker, `${endMarker}\nproject note after managed workflow`)
|
|
730
|
-
.replace("
|
|
745
|
+
.replace("The frontmatter contract is:", "Stale managed workflow contract:");
|
|
731
746
|
writeFile(engineering, customized);
|
|
732
747
|
const staleStart = customized.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
733
748
|
const staleEnd = customized.indexOf(endMarker) + endMarker.length;
|
|
@@ -737,7 +752,7 @@ function testManagedEngineeringSyncIsControlledAndIdempotent() {
|
|
|
737
752
|
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
738
753
|
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
739
754
|
assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
|
|
740
|
-
assert(dryResult.managedWorkflow.version === "4.
|
|
755
|
+
assert(dryResult.managedWorkflow.version === "4.1.1", "dry-run should expose the target workflow version");
|
|
741
756
|
assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
|
|
742
757
|
assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
|
|
743
758
|
|
|
@@ -747,14 +762,14 @@ function testManagedEngineeringSyncIsControlledAndIdempotent() {
|
|
|
747
762
|
const updatedEnd = updated.indexOf(endMarker) + endMarker.length;
|
|
748
763
|
assert(updated.slice(0, updatedStart) === outsideBefore, "sync must preserve frontmatter and content before the managed block byte-for-byte");
|
|
749
764
|
assert(updated.slice(updatedEnd) === outsideAfter, "sync must preserve content after the managed block byte-for-byte");
|
|
750
|
-
assert(updated.includes("version=4.
|
|
751
|
-
assert(updated.includes("
|
|
765
|
+
assert(updated.includes("version=4.1.1"), "sync should install the current managed workflow version");
|
|
766
|
+
assert(updated.includes("The frontmatter contract is:"), "sync should refresh stale managed workflow content");
|
|
752
767
|
|
|
753
768
|
fillRequiredAccess(repo);
|
|
754
769
|
const status = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
755
770
|
const statusResult = JSON.parse(status.stdout).results[0];
|
|
756
771
|
assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
|
|
757
|
-
assert(statusResult.managedWorkflow.version === "4.
|
|
772
|
+
assert(statusResult.managedWorkflow.version === "4.1.1", "status should expose the installed managed workflow version");
|
|
758
773
|
|
|
759
774
|
const beforeSecondSync = fs.readFileSync(engineering, "utf8");
|
|
760
775
|
const second = run("node", [cli, "sync", "--projects", repo, "--json"]);
|
|
@@ -771,7 +786,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
|
|
|
771
786
|
const start = current.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
772
787
|
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
773
788
|
const end = current.indexOf(endMarker) + endMarker.length;
|
|
774
|
-
const legacyNote = "\n## Legacy project
|
|
789
|
+
const legacyNote = "\n## Legacy project facts\n\nKeep this project note exactly.\n";
|
|
775
790
|
const legacy = `${current.slice(0, start)}${legacyNote}${current.slice(end)}`;
|
|
776
791
|
writeFile(engineering, legacy);
|
|
777
792
|
|
|
@@ -782,7 +797,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
|
|
|
782
797
|
assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
|
|
783
798
|
run("node", [cli, "sync", "--projects", repo]);
|
|
784
799
|
const migrated = fs.readFileSync(engineering, "utf8");
|
|
785
|
-
assert(migrated.includes("version=4.
|
|
800
|
+
assert(migrated.includes("version=4.1.1"), "legacy migration should insert the current managed workflow");
|
|
786
801
|
assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
|
|
787
802
|
const migratedStart = migrated.indexOf("<!-- auto-coding-skill:managed-workflow:start");
|
|
788
803
|
const migratedEnd = migrated.indexOf(endMarker) + endMarker.length;
|
|
@@ -812,7 +827,7 @@ function testOfficialLegacyEngineeringBodyIsReplacedWithoutDuplication() {
|
|
|
812
827
|
const migrated = fs.readFileSync(engineering, "utf8");
|
|
813
828
|
assert(migrated.startsWith(customizedFrontmatter), "official legacy migration must preserve YAML frontmatter byte-for-byte");
|
|
814
829
|
assert((migrated.match(/auto-coding-skill:managed-workflow:start/g) || []).length === 1, "official legacy migration should install exactly one managed workflow");
|
|
815
|
-
assert((migrated.match(/^## Delivery levels$/gm) || []).length ===
|
|
830
|
+
assert((migrated.match(/^## Delivery levels$/gm) || []).length === 0, "official legacy migration must remove the old duplicated workflow body");
|
|
816
831
|
|
|
817
832
|
const stable = fs.readFileSync(engineering, "utf8");
|
|
818
833
|
run("node", [cli, "sync", "--projects", repo]);
|
|
@@ -847,44 +862,16 @@ function testMalformedManagedMarkersFailClosed() {
|
|
|
847
862
|
}
|
|
848
863
|
}
|
|
849
864
|
|
|
850
|
-
function
|
|
851
|
-
const repo = tmpdir("skill-
|
|
865
|
+
function testPartialSkillSyncIsRejectedWithoutWrites() {
|
|
866
|
+
const repo = tmpdir("partial-skill-sync");
|
|
852
867
|
run("git", ["init", "-q"], { cwd: repo });
|
|
853
868
|
run("node", [cli, "init"], { cwd: repo });
|
|
854
869
|
run("node", [cli, "sync", "--projects", repo]);
|
|
855
870
|
const skill = path.join(repo, ".agents", "skills", "auto-coding-skill", "SKILL.md");
|
|
856
|
-
const agent = path.join(repo, ".agents", "agents", "explorer.toml");
|
|
857
|
-
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
858
|
-
const launcher = path.join(repo, "docs", "tools", "autopipeline", "ap.py");
|
|
859
871
|
writeFile(skill, "stale skill\n");
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
const untouched = new Map([[agent, fs.readFileSync(agent)], [engineering, fs.readFileSync(engineering)], [launcher, fs.readFileSync(launcher)]]);
|
|
864
|
-
|
|
865
|
-
const dryRun = run("node", [cli, "sync", "--projects", repo, "--components", "skill", "--dry-run", "--json"]);
|
|
866
|
-
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
867
|
-
assert(dryResult.components === "skill", "skill-only dry-run should expose its component scope");
|
|
868
|
-
assert(dryResult.actions.length === 1 && dryResult.actions[0].path === ".agents/skills/auto-coding-skill", "skill-only dry-run must plan only the skill directory");
|
|
869
|
-
assert(fs.readFileSync(skill, "utf8") === "stale skill\n", "skill-only dry-run must not write the skill");
|
|
870
|
-
|
|
871
|
-
run("node", [cli, "sync", "--projects", repo, "--components", "skill"]);
|
|
872
|
-
assert(fs.readFileSync(skill, "utf8").includes("# Auto Coding Skill"), "skill-only sync should refresh the managed skill");
|
|
873
|
-
for (const [file, content] of untouched) {
|
|
874
|
-
assert(fs.readFileSync(file).equals(content), `skill-only sync must not touch ${file}`);
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
const invalid = run("node", [cli, "sync", "--projects", repo, "--components", "docs"], { check: false });
|
|
878
|
-
assert(invalid.status !== 0 && invalid.stderr.includes("--components"), "sync should reject unknown component scopes");
|
|
879
|
-
const conflicting = run("node", [cli, "sync", "--projects", repo, "--components", "skill", "--reset-agent-models"], { check: false });
|
|
880
|
-
assert(conflicting.status !== 0, "skill-only sync should reject irrelevant agent reset options");
|
|
881
|
-
|
|
882
|
-
writeFile(skill, "legacy-task-sentinel\n");
|
|
883
|
-
writeFile(path.join(repo, ".git", "auto-coding-skill", "tasks", "T-LEGACY.json"), JSON.stringify({ schema: 1, task_id: "T-LEGACY" }));
|
|
884
|
-
const blocked = run("node", [cli, "sync", "--projects", repo, "--components", "skill"], { check: false });
|
|
885
|
-
assert(blocked.status !== 0 && blocked.stderr.includes("schema < 3"), "skill-only sync must block registered legacy tasks");
|
|
886
|
-
assert(blocked.stderr.includes("3.x runtime") && blocked.stderr.includes("lifecycle semantics"), "legacy task error should give safe completion guidance");
|
|
887
|
-
assert(fs.readFileSync(skill, "utf8") === "legacy-task-sentinel\n", "blocked skill-only sync must not write the skill");
|
|
872
|
+
const rejected = run("node", [cli, "sync", "--projects", repo, "--components", "skill"], { check: false });
|
|
873
|
+
assert(rejected.status !== 0 && rejected.stderr.includes("removed in 4.1"), "partial sync must explain whole-install convergence");
|
|
874
|
+
assert(fs.readFileSync(skill, "utf8") === "stale skill\n", "rejected partial sync must not write the skill");
|
|
888
875
|
}
|
|
889
876
|
|
|
890
877
|
function testLegacyTaskPreflightRejectsWholeBatchAtomically() {
|
|
@@ -900,7 +887,7 @@ function testLegacyTaskPreflightRejectsWholeBatchAtomically() {
|
|
|
900
887
|
writeFile(firstSkill, "first-project-sentinel\n");
|
|
901
888
|
writeFile(secondAgent, `${fs.readFileSync(secondAgent, "utf8")}\n# second-project-sentinel\n`);
|
|
902
889
|
const secondAgentBefore = fs.readFileSync(secondAgent);
|
|
903
|
-
writeFile(path.join(second, ".git", "auto-coding-skill", "tasks", "T-V3.json"), JSON.stringify({ schema:
|
|
890
|
+
writeFile(path.join(second, ".git", "auto-coding-skill", "tasks", "T-V3.json"), JSON.stringify({ schema: 3, task_id: "T-V3", state: "active" }));
|
|
904
891
|
|
|
905
892
|
const result = run("node", [cli, "sync", "--projects", `${first},${second}`], { check: false });
|
|
906
893
|
assert(result.status !== 0 && result.stderr.includes("entire sync batch"), "one legacy task should reject the complete multi-project batch");
|
|
@@ -908,13 +895,13 @@ function testLegacyTaskPreflightRejectsWholeBatchAtomically() {
|
|
|
908
895
|
assert(fs.readFileSync(secondAgent).equals(secondAgentBefore), "batch preflight must not write the project containing the legacy task");
|
|
909
896
|
}
|
|
910
897
|
|
|
911
|
-
function
|
|
898
|
+
function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
912
899
|
const repo = tmpdir("managed-agents-document");
|
|
913
900
|
run("node", [cli, "init"], { cwd: repo });
|
|
914
901
|
run("node", [cli, "sync", "--projects", repo]);
|
|
915
902
|
const agents = path.join(repo, "AGENTS.md");
|
|
916
903
|
const initial = fs.readFileSync(agents, "utf8");
|
|
917
|
-
assert(initial.includes("managed-agents:start version=4.
|
|
904
|
+
assert(initial.includes("managed-agents:start version=4.1.1"), "new projects should receive the versioned root AGENTS block");
|
|
918
905
|
|
|
919
906
|
const custom = [
|
|
920
907
|
"# Project rules",
|
|
@@ -927,13 +914,19 @@ function testManagedAgentsMigrationPreservesCustomRules() {
|
|
|
927
914
|
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
928
915
|
const plan = JSON.parse(dryRun.stdout).results[0].managedAgentsDocument;
|
|
929
916
|
assert(plan.state === "legacy-custom", `unmarked custom AGENTS should be migrated: ${dryRun.stdout}`);
|
|
930
|
-
assert(plan.migrations.includes("agents-
|
|
917
|
+
assert(plan.migrations.includes("agents-whole-file-replacement"), "AGENTS should use the whole-file convergence migration");
|
|
918
|
+
const dryActions = JSON.parse(dryRun.stdout).results[0].actions;
|
|
919
|
+
assert(dryActions.some(item => item.action === "would-archive"), "dry-run should expose the historical AGENTS archive");
|
|
931
920
|
|
|
932
921
|
run("node", [cli, "sync", "--projects", repo]);
|
|
933
922
|
const migrated = fs.readFileSync(agents, "utf8");
|
|
934
|
-
assert(migrated.includes("managed-agents:start version=4.
|
|
935
|
-
assert(migrated.includes("Preserve this repository-specific rule exactly."), "AGENTS
|
|
923
|
+
assert(migrated.includes("managed-agents:start version=4.1.1"), "AGENTS migration should install the current managed block");
|
|
924
|
+
assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
|
|
936
925
|
assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
|
|
926
|
+
const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
|
|
927
|
+
assert(migrated === canonical, "root AGENTS must be byte-identical to the packaged canonical file");
|
|
928
|
+
const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.1.1.md");
|
|
929
|
+
assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
|
|
937
930
|
const stable = fs.readFileSync(agents);
|
|
938
931
|
run("node", [cli, "sync", "--projects", repo]);
|
|
939
932
|
assert(fs.readFileSync(agents).equals(stable), "managed AGENTS sync should be idempotent");
|
|
@@ -949,14 +942,14 @@ function testUnknownWorkflowConflictFailsWholeBatchBeforeWrites() {
|
|
|
949
942
|
}
|
|
950
943
|
const firstSkill = path.join(first, ".agents", "skills", "auto-coding-skill", "SKILL.md");
|
|
951
944
|
writeFile(firstSkill, "batch-sentinel\n");
|
|
952
|
-
const
|
|
953
|
-
fs.appendFileSync(
|
|
945
|
+
const secondEngineering = path.join(second, "docs", "ENGINEERING.md");
|
|
946
|
+
fs.appendFileSync(secondEngineering, "\nHigh-risk changes must run the real full gate before push.\n");
|
|
954
947
|
|
|
955
948
|
const status = run("node", [cli, "status", "--projects", second, "--json"], { check: false });
|
|
956
949
|
assert(status.status !== 0, "status must be non-ok for an unknown conflicting workflow rule");
|
|
957
|
-
const statusPlan = JSON.parse(status.stdout).results[0].
|
|
950
|
+
const statusPlan = JSON.parse(status.stdout).results[0].managedWorkflow;
|
|
958
951
|
assert(statusPlan.state === "conflict", `status should expose the document conflict: ${status.stdout}`);
|
|
959
|
-
assert(statusPlan.conflicts[0].file === "
|
|
952
|
+
assert(statusPlan.conflicts[0].file === "docs/ENGINEERING.md" && statusPlan.conflicts[0].line > 0, "status conflict should include file and line");
|
|
960
953
|
|
|
961
954
|
const sync = run("node", [cli, "sync", "--projects", `${first},${second}`], { check: false });
|
|
962
955
|
assert(sync.status !== 0 && sync.stderr.includes("entire sync batch before writes"), "one unknown conflict must reject the complete batch");
|
|
@@ -976,15 +969,41 @@ function testEngineeringMarkerBoundaryIsNormalized() {
|
|
|
976
969
|
assert(normalized.includes(`${marker}\n# Project-specific workflow\n`), "sync should normalize a heading glued to the managed end marker");
|
|
977
970
|
}
|
|
978
971
|
|
|
972
|
+
function testEngineeringFrameworkAllowsProjectFactsButRejectsDuplicateWorkflow() {
|
|
973
|
+
const repo = tmpdir("engineering-framework");
|
|
974
|
+
run("node", [cli, "init"], { cwd: repo });
|
|
975
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
976
|
+
fillRequiredAccess(repo);
|
|
977
|
+
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
978
|
+
fs.appendFileSync(engineering, "\n# Project Facts\n\n## Repository boundaries\n\n- backend owns APIs.\n");
|
|
979
|
+
const projectFactsStatus = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
980
|
+
assert(JSON.parse(projectFactsStatus.stdout).results[0].managedWorkflow.state === "current", "project fact sections should remain outside the managed block");
|
|
981
|
+
|
|
982
|
+
fs.appendFileSync(engineering, "\n## Delivery flow\n\n1. Known obsolete workflow.\n");
|
|
983
|
+
const migration = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
984
|
+
const migrationResult = JSON.parse(migration.stdout).results[0];
|
|
985
|
+
assert(migrationResult.managedWorkflow.state === "stale", "known duplicate sections should use controlled migration");
|
|
986
|
+
assert(migrationResult.managedWorkflow.migrations.includes("engineering-section-delivery-flow"), "known section migration should be explicit");
|
|
987
|
+
assert(migrationResult.actions.some(item => item.action === "would-archive" && item.path.includes("ENGINEERING.pre-4.1.1")), "controlled section cleanup should archive the previous ENGINEERING file");
|
|
988
|
+
run("node", [cli, "sync", "--projects", repo]);
|
|
989
|
+
assert(!fs.readFileSync(engineering, "utf8").includes("Known obsolete workflow"), "known duplicate workflow section should be removed");
|
|
990
|
+
|
|
991
|
+
fs.appendFileSync(engineering, "\n## Team workflow\n\n1. Unknown competing workflow.\n");
|
|
992
|
+
const duplicateStatus = run("node", [cli, "status", "--projects", repo, "--json"], { check: false });
|
|
993
|
+
assert(duplicateStatus.status !== 0, "duplicate workflow sections must make status non-current");
|
|
994
|
+
const plan = JSON.parse(duplicateStatus.stdout).results[0].managedWorkflow;
|
|
995
|
+
assert(plan.state === "conflict" && plan.conflicts.some(item => item.ruleId === "duplicate-managed-workflow-section"), "duplicate workflow conflict should identify the docs framework rule");
|
|
996
|
+
}
|
|
997
|
+
|
|
979
998
|
function testReleaseVersionMarkersStayInSync() {
|
|
980
|
-
const expected = "4.
|
|
999
|
+
const expected = "4.1.1";
|
|
981
1000
|
const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
|
|
982
1001
|
const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
|
|
983
1002
|
const policy = JSON.parse(fs.readFileSync(
|
|
984
1003
|
path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
|
|
985
1004
|
"utf8",
|
|
986
1005
|
));
|
|
987
|
-
assert(pkg.version === expected, "package version must match the 4.
|
|
1006
|
+
assert(pkg.version === expected, "package version must match the 4.1.1 release");
|
|
988
1007
|
assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
|
|
989
1008
|
assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
|
|
990
1009
|
for (const rel of [
|
|
@@ -997,6 +1016,17 @@ function testReleaseVersionMarkersStayInSync() {
|
|
|
997
1016
|
}
|
|
998
1017
|
}
|
|
999
1018
|
|
|
1019
|
+
function testProtocolResponsibilitiesStaySeparated() {
|
|
1020
|
+
const skill = fs.readFileSync(path.join(repoRoot, "src", "auto-coding-skill", "SKILL.md"), "utf8");
|
|
1021
|
+
const agents = fs.readFileSync(path.join(repoRoot, "src", "auto-coding-skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
|
|
1022
|
+
const engineering = fs.readFileSync(path.join(repoRoot, "src", "auto-coding-skill", "data", "templates", "ENGINEERING.md"), "utf8");
|
|
1023
|
+
const totalLines = [skill, agents, engineering].reduce((sum, text) => sum + text.split(/\r?\n/).length, 0);
|
|
1024
|
+
assert(totalLines <= 350, `shared protocol context budget exceeded: ${totalLines} lines`);
|
|
1025
|
+
assert(agents.includes("## Minimum mechanism budget") && agents.includes("## Bounded real validation"), "AGENTS must remain the behavioral protocol");
|
|
1026
|
+
assert(skill.includes("## Select the minimum mechanism set") && !skill.includes("## Authority"), "SKILL must remain invocation guidance");
|
|
1027
|
+
assert(engineering.includes("The frontmatter contract is:") && !engineering.includes("## Git and parallel work"), "ENGINEERING must remain project configuration/facts");
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1000
1030
|
testPreflightAvoidsPartialInstall();
|
|
1001
1031
|
testDestVariants();
|
|
1002
1032
|
testLauncherFallsBackToGlobalRuntime();
|
|
@@ -1011,7 +1041,7 @@ testInvalidManagedAgentModelsFailStatusAndAreDroppedOnSync();
|
|
|
1011
1041
|
testModelTextInsideInstructionsIsNotPromotedToOverride();
|
|
1012
1042
|
testCommandSpecificArgumentsAreRejectedBeforeWrites();
|
|
1013
1043
|
testBridgeIsGeneric();
|
|
1014
|
-
|
|
1044
|
+
testUpgradeCleansAllManagedSkillExtras();
|
|
1015
1045
|
testOptionalDocsAndLegacyToolsDoNotCauseDrift();
|
|
1016
1046
|
testOptionalScaffoldIsOnDemandAndIdempotent();
|
|
1017
1047
|
testTestingScaffoldMatchesCheckMatrixSchema();
|
|
@@ -1027,11 +1057,13 @@ testManagedEngineeringSyncIsControlledAndIdempotent();
|
|
|
1027
1057
|
testLegacyEngineeringMigrationPreservesExistingBody();
|
|
1028
1058
|
testOfficialLegacyEngineeringBodyIsReplacedWithoutDuplication();
|
|
1029
1059
|
testMalformedManagedMarkersFailClosed();
|
|
1030
|
-
|
|
1060
|
+
testPartialSkillSyncIsRejectedWithoutWrites();
|
|
1031
1061
|
testLegacyTaskPreflightRejectsWholeBatchAtomically();
|
|
1032
|
-
|
|
1062
|
+
testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules();
|
|
1033
1063
|
testUnknownWorkflowConflictFailsWholeBatchBeforeWrites();
|
|
1034
1064
|
testEngineeringMarkerBoundaryIsNormalized();
|
|
1065
|
+
testEngineeringFrameworkAllowsProjectFactsButRejectsDuplicateWorkflow();
|
|
1035
1066
|
testReleaseVersionMarkersStayInSync();
|
|
1067
|
+
testProtocolResponsibilitiesStaySeparated();
|
|
1036
1068
|
|
|
1037
1069
|
console.log("cli-installer-regression-ok");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvis1513/auto-coding-skill",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.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": {
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Closure Log
|
|
2
|
-
|
|
3
|
-
Record one development closure per task. `DEV-CLOSED` means the fast local gate
|
|
4
|
-
passed and the code was pushed. Jenkins, deployment, and owner acceptance happen
|
|
5
|
-
later and do not change the coding closure.
|
|
6
|
-
|
|
7
|
-
## <TASK_ID> — <Title> — YYYY-MM-DD HH:MM
|
|
8
|
-
|
|
9
|
-
- Commit:
|
|
10
|
-
- Effective profile: micro | standard | high-risk
|
|
11
|
-
- Fast local gate:
|
|
12
|
-
- Target push:
|
|
13
|
-
- External build/deploy/acceptance: owner-managed
|
|
14
|
-
- Result: DEV-CLOSED
|
|
15
|
-
- Follow-up:
|
|
16
|
-
|
|
17
|
-
---
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Taskbook
|
|
2
|
-
|
|
3
|
-
Keep active tasks here. Archive closed history when the configured ledger budget
|
|
4
|
-
is reached. Add DD/ADR or other optional documents only when classification says
|
|
5
|
-
they are useful.
|
|
6
|
-
|
|
7
|
-
## Task T0001 — <Title>
|
|
8
|
-
|
|
9
|
-
- Status: Planned | Designing | Implementing | Checking | Pushed | Blocked
|
|
10
|
-
- Scope:
|
|
11
|
-
- Orchestrator:
|
|
12
|
-
- Owning fixer:
|
|
13
|
-
- Registered worktree / branch:
|
|
14
|
-
- Owned paths:
|
|
15
|
-
- Depends on integrated tasks:
|
|
16
|
-
- Reviewer / stable diff:
|
|
17
|
-
- Review verdict: pending | approved | changes-requested
|
|
18
|
-
- Non-goals:
|
|
19
|
-
- Effective profile: micro | standard | high-risk
|
|
20
|
-
- Classification reasons:
|
|
21
|
-
- Existing owner / reuse points:
|
|
22
|
-
- Minimal design:
|
|
23
|
-
- Development acceptance criteria:
|
|
24
|
-
- Fast local gate evidence:
|
|
25
|
-
- Commit / target push:
|
|
26
|
-
- Follow-up:
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
Append new active tasks below.
|