@elvis1513/auto-coding-skill 4.1.9 → 4.2.0
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 +25 -5
- package/cli/assets/managed-install.json +1 -1
- package/cli/assets/skill/SKILL.md +11 -3
- package/cli/assets/skill/data/policies/workflow-migrations-v1.json +2 -2
- package/cli/assets/skill/data/templates/ENGINEERING.md +2 -20
- package/cli/assets/skill/data/templates/bridges/AGENTS.md +9 -1
- package/cli/assets/skill/scripts/ap.py +567 -54
- package/cli/tests/ap_concurrency_test.py +311 -6
- package/cli/tests/ap_profiles_test.py +3 -3
- package/cli/tests/index.test.js +17 -17
- package/package.json +1 -1
|
@@ -360,6 +360,23 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
360
360
|
hook.chmod(0o755)
|
|
361
361
|
return hook
|
|
362
362
|
|
|
363
|
+
def update_config(self, repo: Path, update) -> None:
|
|
364
|
+
engineering = repo / "docs" / "ENGINEERING.md"
|
|
365
|
+
raw = engineering.read_text(encoding="utf-8")
|
|
366
|
+
_, frontmatter, body = raw.split("---", 2)
|
|
367
|
+
config = yaml.safe_load(frontmatter)
|
|
368
|
+
update(config)
|
|
369
|
+
engineering.write_text(
|
|
370
|
+
"---\n"
|
|
371
|
+
+ yaml.safe_dump(config, allow_unicode=True, sort_keys=False)
|
|
372
|
+
+ "---"
|
|
373
|
+
+ body,
|
|
374
|
+
encoding="utf-8",
|
|
375
|
+
)
|
|
376
|
+
git(repo, "add", "docs/ENGINEERING.md")
|
|
377
|
+
git(repo, "commit", "-qm", "update test workflow config")
|
|
378
|
+
git(repo, "push", "-q", "origin", "dev")
|
|
379
|
+
|
|
363
380
|
def test_task_start_creates_external_worktree_manifest_and_status(self) -> None:
|
|
364
381
|
_, repo, _ = self.make_repo()
|
|
365
382
|
worktree = self.start_task(repo, "START-1")
|
|
@@ -431,6 +448,294 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
431
448
|
self.assertEqual(before, git_output(repo, "rev-parse", "HEAD"))
|
|
432
449
|
self.assertFalse(self.registry_manifest_path(repo, "DIRECT-NOOP").exists())
|
|
433
450
|
|
|
451
|
+
def test_commit_push_accepts_already_staged_deletion(self) -> None:
|
|
452
|
+
_, repo, remote = self.make_repo()
|
|
453
|
+
worktree = self.start_task(repo, "STAGED-DELETE", "shared.txt")
|
|
454
|
+
(worktree / "shared.txt").unlink()
|
|
455
|
+
git(worktree, "add", "-A", "--", "shared.txt")
|
|
456
|
+
self.approve_task(worktree, "STAGED-DELETE")
|
|
457
|
+
|
|
458
|
+
result = self.ap(
|
|
459
|
+
worktree,
|
|
460
|
+
"commit-push",
|
|
461
|
+
"STAGED-DELETE",
|
|
462
|
+
"--msg",
|
|
463
|
+
"STAGED-DELETE: remove shared file",
|
|
464
|
+
)
|
|
465
|
+
|
|
466
|
+
self.assertIn("commit-push", result.stdout)
|
|
467
|
+
self.assertNotEqual(
|
|
468
|
+
0,
|
|
469
|
+
git(
|
|
470
|
+
remote,
|
|
471
|
+
"cat-file",
|
|
472
|
+
"-e",
|
|
473
|
+
"refs/heads/codex/STAGED-DELETE:shared.txt",
|
|
474
|
+
check=False,
|
|
475
|
+
).returncode,
|
|
476
|
+
)
|
|
477
|
+
self.assertEqual("", git_output(worktree, "status", "--short"))
|
|
478
|
+
|
|
479
|
+
def test_staged_rename_requires_ownership_of_both_paths(self) -> None:
|
|
480
|
+
_, repo, remote = self.make_repo()
|
|
481
|
+
worktree = self.start_task(repo, "RENAME-DENY", "renamed.txt")
|
|
482
|
+
git(worktree, "mv", "shared.txt", "renamed.txt")
|
|
483
|
+
status = json.loads(self.ap(worktree, "task-status", "RENAME-DENY", "--json").stdout)
|
|
484
|
+
fingerprint = status["tasks"][0]["current_diff_fingerprint"]
|
|
485
|
+
|
|
486
|
+
denied = self.ap(
|
|
487
|
+
worktree,
|
|
488
|
+
"task-review",
|
|
489
|
+
"RENAME-DENY",
|
|
490
|
+
"--verdict",
|
|
491
|
+
"approved",
|
|
492
|
+
"--diff-fingerprint",
|
|
493
|
+
fingerprint,
|
|
494
|
+
"--reviewer",
|
|
495
|
+
"test-reviewer",
|
|
496
|
+
check=False,
|
|
497
|
+
)
|
|
498
|
+
|
|
499
|
+
self.assertNotEqual(0, denied.returncode)
|
|
500
|
+
self.assertIn("shared.txt", denied.stdout + denied.stderr)
|
|
501
|
+
self.assert_remote_branch(remote, "codex/RENAME-DENY", False)
|
|
502
|
+
|
|
503
|
+
_, allowed_repo, allowed_remote = self.make_repo()
|
|
504
|
+
started = self.ap(
|
|
505
|
+
allowed_repo,
|
|
506
|
+
"task-start",
|
|
507
|
+
"RENAME-ALLOW",
|
|
508
|
+
"--base",
|
|
509
|
+
"origin/dev",
|
|
510
|
+
"--owned-path",
|
|
511
|
+
"shared.txt",
|
|
512
|
+
"--owned-path",
|
|
513
|
+
"renamed.txt",
|
|
514
|
+
"--isolated",
|
|
515
|
+
"--review-required",
|
|
516
|
+
)
|
|
517
|
+
self.assertIn("RENAME-ALLOW", started.stdout)
|
|
518
|
+
allowed_worktree = self.task_worktree(allowed_repo, "RENAME-ALLOW")
|
|
519
|
+
git(allowed_worktree, "mv", "shared.txt", "renamed.txt")
|
|
520
|
+
self.commit_push(allowed_worktree, "RENAME-ALLOW", "RENAME-ALLOW: rename shared file")
|
|
521
|
+
self.assertEqual(
|
|
522
|
+
"baseline",
|
|
523
|
+
git_output(allowed_remote, "show", "refs/heads/codex/RENAME-ALLOW:renamed.txt"),
|
|
524
|
+
)
|
|
525
|
+
self.assertNotEqual(
|
|
526
|
+
0,
|
|
527
|
+
git(
|
|
528
|
+
allowed_remote,
|
|
529
|
+
"cat-file",
|
|
530
|
+
"-e",
|
|
531
|
+
"refs/heads/codex/RENAME-ALLOW:shared.txt",
|
|
532
|
+
check=False,
|
|
533
|
+
).returncode,
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
def test_commit_push_stages_mixed_index_and_worktree_state(self) -> None:
|
|
537
|
+
_, repo, remote = self.make_repo()
|
|
538
|
+
worktree = self.start_task(repo, "MIXED-STAGE")
|
|
539
|
+
(worktree / "shared.txt").write_text("staged-v1\n", encoding="utf-8")
|
|
540
|
+
git(worktree, "add", "shared.txt")
|
|
541
|
+
(worktree / "shared.txt").write_text("worktree-v2\n", encoding="utf-8")
|
|
542
|
+
(worktree / "new-file.txt").write_text("new\n", encoding="utf-8")
|
|
543
|
+
|
|
544
|
+
self.commit_push(worktree, "MIXED-STAGE", "MIXED-STAGE: commit final task state")
|
|
545
|
+
|
|
546
|
+
ref = "refs/heads/codex/MIXED-STAGE"
|
|
547
|
+
self.assertEqual("worktree-v2", git_output(remote, "show", f"{ref}:shared.txt"))
|
|
548
|
+
self.assertEqual("new", git_output(remote, "show", f"{ref}:new-file.txt"))
|
|
549
|
+
|
|
550
|
+
def test_final_gate_receipt_reuses_manual_pass_and_commit_retry(self) -> None:
|
|
551
|
+
root, repo, remote = self.make_repo()
|
|
552
|
+
gate_count = root / "gate-count"
|
|
553
|
+
self.update_config(
|
|
554
|
+
repo,
|
|
555
|
+
lambda config: config["commands"].update(
|
|
556
|
+
{"gate_changed": f"printf x >> {gate_count}"}
|
|
557
|
+
),
|
|
558
|
+
)
|
|
559
|
+
worktree = self.start_task(repo, "GATE-REUSE", "shared.txt")
|
|
560
|
+
(worktree / "shared.txt").write_text("validated\n", encoding="utf-8")
|
|
561
|
+
self.ap(worktree, "light-gate", "--scope", "changed")
|
|
562
|
+
self.assertEqual("x", gate_count.read_text(encoding="utf-8"))
|
|
563
|
+
self.approve_task(worktree, "GATE-REUSE")
|
|
564
|
+
common_dir = Path(git_output(worktree, "rev-parse", "--git-common-dir"))
|
|
565
|
+
if not common_dir.is_absolute():
|
|
566
|
+
common_dir = (worktree / common_dir).resolve()
|
|
567
|
+
fail_once = common_dir / "precommit-failed-once"
|
|
568
|
+
self.install_hook(
|
|
569
|
+
repo,
|
|
570
|
+
"pre-commit",
|
|
571
|
+
f'if [ ! -f "{fail_once}" ]; then touch "{fail_once}"; exit 1; fi\n',
|
|
572
|
+
)
|
|
573
|
+
|
|
574
|
+
first = self.ap(
|
|
575
|
+
worktree,
|
|
576
|
+
"commit-push",
|
|
577
|
+
"GATE-REUSE",
|
|
578
|
+
"--msg",
|
|
579
|
+
"GATE-REUSE: validated change",
|
|
580
|
+
check=False,
|
|
581
|
+
)
|
|
582
|
+
self.assertNotEqual(0, first.returncode)
|
|
583
|
+
self.assertIn("REUSED", first.stdout + first.stderr)
|
|
584
|
+
second = self.ap(
|
|
585
|
+
worktree,
|
|
586
|
+
"commit-push",
|
|
587
|
+
"GATE-REUSE",
|
|
588
|
+
"--msg",
|
|
589
|
+
"GATE-REUSE: validated change",
|
|
590
|
+
)
|
|
591
|
+
self.assertIn("REUSED", second.stdout + second.stderr)
|
|
592
|
+
self.assertEqual("x", gate_count.read_text(encoding="utf-8"))
|
|
593
|
+
self.assertEqual(
|
|
594
|
+
"validated",
|
|
595
|
+
git_output(remote, "show", "refs/heads/codex/GATE-REUSE:shared.txt"),
|
|
596
|
+
)
|
|
597
|
+
|
|
598
|
+
def test_final_gate_receipt_invalidates_when_content_changes(self) -> None:
|
|
599
|
+
root, repo, _ = self.make_repo()
|
|
600
|
+
gate_count = root / "gate-count-invalidated"
|
|
601
|
+
self.update_config(
|
|
602
|
+
repo,
|
|
603
|
+
lambda config: config["commands"].update(
|
|
604
|
+
{"gate_changed": f"printf x >> {gate_count}"}
|
|
605
|
+
),
|
|
606
|
+
)
|
|
607
|
+
worktree = self.start_task(repo, "GATE-INVALIDATE", "shared.txt")
|
|
608
|
+
(worktree / "shared.txt").write_text("first\n", encoding="utf-8")
|
|
609
|
+
self.ap(worktree, "light-gate", "--scope", "changed")
|
|
610
|
+
(worktree / "shared.txt").write_text("second\n", encoding="utf-8")
|
|
611
|
+
self.approve_task(worktree, "GATE-INVALIDATE")
|
|
612
|
+
|
|
613
|
+
result = self.ap(
|
|
614
|
+
worktree,
|
|
615
|
+
"commit-push",
|
|
616
|
+
"GATE-INVALIDATE",
|
|
617
|
+
"--msg",
|
|
618
|
+
"GATE-INVALIDATE: use current content",
|
|
619
|
+
)
|
|
620
|
+
|
|
621
|
+
self.assertNotIn("REUSED", result.stdout + result.stderr)
|
|
622
|
+
self.assertEqual("xx", gate_count.read_text(encoding="utf-8"))
|
|
623
|
+
|
|
624
|
+
def test_task_scope_add_expands_direct_scope_idempotently(self) -> None:
|
|
625
|
+
_, repo, remote = self.make_repo("adaptive", require_review=False)
|
|
626
|
+
self.ap(
|
|
627
|
+
repo,
|
|
628
|
+
"task-start",
|
|
629
|
+
"SCOPE-DIRECT",
|
|
630
|
+
"--owned-path",
|
|
631
|
+
"shared.txt",
|
|
632
|
+
"--force-lifecycle",
|
|
633
|
+
)
|
|
634
|
+
expanded = self.ap(
|
|
635
|
+
repo,
|
|
636
|
+
"task-scope-add",
|
|
637
|
+
"SCOPE-DIRECT",
|
|
638
|
+
"--owned-path",
|
|
639
|
+
"future.txt",
|
|
640
|
+
"--json",
|
|
641
|
+
)
|
|
642
|
+
payload = json.loads(expanded.stdout)
|
|
643
|
+
self.assertEqual("expanded", payload["status"])
|
|
644
|
+
self.assertEqual(2, payload["scope_revision"])
|
|
645
|
+
noop = json.loads(
|
|
646
|
+
self.ap(
|
|
647
|
+
repo,
|
|
648
|
+
"task-scope-add",
|
|
649
|
+
"SCOPE-DIRECT",
|
|
650
|
+
"--owned-path",
|
|
651
|
+
"future.txt",
|
|
652
|
+
"--json",
|
|
653
|
+
).stdout
|
|
654
|
+
)
|
|
655
|
+
self.assertEqual("noop", noop["status"])
|
|
656
|
+
self.assertEqual(2, noop["scope_revision"])
|
|
657
|
+
|
|
658
|
+
(repo / "future.txt").write_text("future\n", encoding="utf-8")
|
|
659
|
+
self.ap(
|
|
660
|
+
repo,
|
|
661
|
+
"commit-push",
|
|
662
|
+
"SCOPE-DIRECT",
|
|
663
|
+
"--msg",
|
|
664
|
+
"SCOPE-DIRECT: add future file",
|
|
665
|
+
)
|
|
666
|
+
self.assertEqual("future", git_output(remote, "show", "refs/heads/dev:future.txt"))
|
|
667
|
+
|
|
668
|
+
def test_task_scope_add_invalidates_review_and_blocks_conflicts(self) -> None:
|
|
669
|
+
_, repo, _ = self.make_repo()
|
|
670
|
+
first = self.start_task(repo, "SCOPE-FIRST", "shared.txt")
|
|
671
|
+
self.start_task(repo, "SCOPE-SECOND", "second-owned.txt")
|
|
672
|
+
(first / "shared.txt").write_text("reviewed\n", encoding="utf-8")
|
|
673
|
+
old_fingerprint = self.approve_task(first, "SCOPE-FIRST")
|
|
674
|
+
|
|
675
|
+
expanded = json.loads(
|
|
676
|
+
self.ap(
|
|
677
|
+
first,
|
|
678
|
+
"task-scope-add",
|
|
679
|
+
"SCOPE-FIRST",
|
|
680
|
+
"--owned-path",
|
|
681
|
+
"future.txt",
|
|
682
|
+
"--json",
|
|
683
|
+
).stdout
|
|
684
|
+
)
|
|
685
|
+
self.assertEqual(2, expanded["scope_revision"])
|
|
686
|
+
status = json.loads(self.ap(first, "task-status", "SCOPE-FIRST", "--json").stdout)["tasks"][0]
|
|
687
|
+
self.assertEqual("pending", status["review"]["verdict"])
|
|
688
|
+
self.assertNotEqual(old_fingerprint, status["current_diff_fingerprint"])
|
|
689
|
+
stale = self.ap(
|
|
690
|
+
first,
|
|
691
|
+
"task-review",
|
|
692
|
+
"SCOPE-FIRST",
|
|
693
|
+
"--verdict",
|
|
694
|
+
"approved",
|
|
695
|
+
"--diff-fingerprint",
|
|
696
|
+
old_fingerprint,
|
|
697
|
+
"--reviewer",
|
|
698
|
+
"test-reviewer",
|
|
699
|
+
check=False,
|
|
700
|
+
)
|
|
701
|
+
self.assertNotEqual(0, stale.returncode)
|
|
702
|
+
|
|
703
|
+
conflict = self.ap(
|
|
704
|
+
first,
|
|
705
|
+
"task-scope-add",
|
|
706
|
+
"SCOPE-FIRST",
|
|
707
|
+
"--owned-path",
|
|
708
|
+
"second-owned.txt",
|
|
709
|
+
check=False,
|
|
710
|
+
)
|
|
711
|
+
self.assertNotEqual(0, conflict.returncode)
|
|
712
|
+
self.assertIn("SCOPE-SECOND", conflict.stdout + conflict.stderr)
|
|
713
|
+
|
|
714
|
+
def test_task_scope_add_escalates_risk_without_moving_worktrees(self) -> None:
|
|
715
|
+
_, repo, _ = self.make_repo("adaptive", require_review=False)
|
|
716
|
+
self.ap(
|
|
717
|
+
repo,
|
|
718
|
+
"task-start",
|
|
719
|
+
"SCOPE-RISK",
|
|
720
|
+
"--owned-path",
|
|
721
|
+
"shared.txt",
|
|
722
|
+
"--force-lifecycle",
|
|
723
|
+
)
|
|
724
|
+
before = git_output(repo, "worktree", "list", "--porcelain")
|
|
725
|
+
expanded = json.loads(
|
|
726
|
+
self.ap(
|
|
727
|
+
repo,
|
|
728
|
+
"task-scope-add",
|
|
729
|
+
"SCOPE-RISK",
|
|
730
|
+
"--owned-path",
|
|
731
|
+
"backend/auth/token.go",
|
|
732
|
+
"--json",
|
|
733
|
+
).stdout
|
|
734
|
+
)
|
|
735
|
+
self.assertEqual("high-risk", expanded["effective_profile"])
|
|
736
|
+
self.assertTrue(expanded["review_required"])
|
|
737
|
+
self.assertEqual(before, git_output(repo, "worktree", "list", "--porcelain"))
|
|
738
|
+
|
|
434
739
|
def test_unnecessary_lifecycle_rejects_before_access_or_fetch_checks(self) -> None:
|
|
435
740
|
_, repo, _ = self.make_repo("adaptive", require_review=False)
|
|
436
741
|
engineering = repo / "docs" / "ENGINEERING.md"
|
|
@@ -1782,13 +2087,13 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
1782
2087
|
|
|
1783
2088
|
def test_gate_mutation_aborts_before_staging_or_commit(self) -> None:
|
|
1784
2089
|
_, repo, remote = self.make_repo()
|
|
2090
|
+
self.update_config(
|
|
2091
|
+
repo,
|
|
2092
|
+
lambda config: config["commands"].update(
|
|
2093
|
+
{"gate_changed": "printf gate-change >> shared.txt"}
|
|
2094
|
+
),
|
|
2095
|
+
)
|
|
1785
2096
|
worktree = self.start_task(repo, "MUTATE-1")
|
|
1786
|
-
engineering = worktree / "docs" / "ENGINEERING.md"
|
|
1787
|
-
text = engineering.read_text(encoding="utf-8")
|
|
1788
|
-
text = text.replace("gate_changed: 'true'", "gate_changed: 'printf gate-change >> shared.txt'")
|
|
1789
|
-
engineering.write_text(text, encoding="utf-8")
|
|
1790
|
-
git(worktree, "add", "docs/ENGINEERING.md")
|
|
1791
|
-
git(worktree, "commit", "-qm", "configure mutating gate")
|
|
1792
2097
|
before = git_output(worktree, "rev-parse", "HEAD")
|
|
1793
2098
|
(worktree / "task.txt").write_text("task\n", encoding="utf-8")
|
|
1794
2099
|
self.approve_task(worktree, "MUTATE-1")
|
|
@@ -706,9 +706,9 @@ class AutoCodingProfileTests(unittest.TestCase):
|
|
|
706
706
|
def test_legacy_rule_commands_never_run_in_automatic_gate(self) -> None:
|
|
707
707
|
cfg = base_config()
|
|
708
708
|
repo, cfg = self.make_repo("src/sensitive/value.py", cfg)
|
|
709
|
-
quick_marker = repo / "quick-ran"
|
|
710
|
-
full_marker = repo / "full-ran"
|
|
711
|
-
build_marker = repo / "build-ran"
|
|
709
|
+
quick_marker = repo.parent / "quick-ran"
|
|
710
|
+
full_marker = repo.parent / "full-ran"
|
|
711
|
+
build_marker = repo.parent / "build-ran"
|
|
712
712
|
cfg["commands"] = {
|
|
713
713
|
"gate_changed": f"touch {quick_marker}",
|
|
714
714
|
"gate_full": f"touch {full_marker}",
|
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.
|
|
212
|
+
assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.0", "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,9 @@ 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 leaving
|
|
291
|
-
assert(lines <=
|
|
289
|
+
// Integrity, staging, and gate-receipt logic are executable support code, not
|
|
290
|
+
// prompt context. Keep a measured ceiling while leaving deterministic checks readable.
|
|
291
|
+
assert(lines <= 12700, `minimal scaffold line budget exceeded: ${lines}`);
|
|
292
292
|
const engineering = fs.readFileSync(path.join(repo, "docs", "ENGINEERING.md"), "utf8");
|
|
293
293
|
assert(engineering.includes("profile: auto"), "engineering should enable adaptive profiles");
|
|
294
294
|
assert(engineering.includes("isolation: adaptive"), "engineering should default to adaptive clean-branch/worktree isolation");
|
|
@@ -822,7 +822,7 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
|
|
|
822
822
|
|
|
823
823
|
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
824
824
|
const initial = fs.readFileSync(engineering, "utf8");
|
|
825
|
-
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.
|
|
825
|
+
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.2\.0 -->/;
|
|
826
826
|
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
827
827
|
assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
|
|
828
828
|
assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
|
|
@@ -836,21 +836,21 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
|
|
|
836
836
|
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
837
837
|
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
838
838
|
assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
|
|
839
|
-
assert(dryResult.managedWorkflow.version === "4.
|
|
839
|
+
assert(dryResult.managedWorkflow.version === "4.2.0", "dry-run should expose the target workflow version");
|
|
840
840
|
assert(dryResult.actions.some(item => item.action === "would-update" && item.path === "docs/ENGINEERING.md"), "dry-run should plan the managed body update");
|
|
841
841
|
assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
|
|
842
842
|
|
|
843
843
|
run("node", [cli, "init"], { cwd: repo });
|
|
844
844
|
const updated = fs.readFileSync(engineering, "utf8");
|
|
845
845
|
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.
|
|
846
|
+
assert(updated.includes("version=4.2.0"), "init should install the current managed workflow version");
|
|
847
847
|
assert(updated.includes("The frontmatter contract is:"), "init should refresh stale managed workflow content");
|
|
848
848
|
|
|
849
849
|
fillRequiredAccess(repo);
|
|
850
850
|
const status = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
851
851
|
const statusResult = JSON.parse(status.stdout).results[0];
|
|
852
852
|
assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
|
|
853
|
-
assert(statusResult.managedWorkflow.version === "4.
|
|
853
|
+
assert(statusResult.managedWorkflow.version === "4.2.0", "status should expose the installed managed workflow version");
|
|
854
854
|
|
|
855
855
|
const beforeSecondInit = fs.readFileSync(engineering, "utf8");
|
|
856
856
|
run("node", [cli, "init"], { cwd: repo });
|
|
@@ -877,7 +877,7 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
|
|
|
877
877
|
assert(dryResult.actions.find(item => item.path === "docs/ENGINEERING.md")?.detail.includes("preserved-custom"), "custom legacy action should be labeled preserved-custom");
|
|
878
878
|
run("node", [cli, "sync", "--projects", repo]);
|
|
879
879
|
const migrated = fs.readFileSync(engineering, "utf8");
|
|
880
|
-
assert(migrated.includes("version=4.
|
|
880
|
+
assert(migrated.includes("version=4.2.0"), "legacy migration should insert the current managed workflow");
|
|
881
881
|
assert(migrated.includes(legacyNote), "legacy migration must preserve the complete existing body");
|
|
882
882
|
const stable = fs.readFileSync(engineering, "utf8");
|
|
883
883
|
run("node", [cli, "sync", "--projects", repo]);
|
|
@@ -977,7 +977,7 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
|
977
977
|
run("node", [cli, "sync", "--projects", repo]);
|
|
978
978
|
const agents = path.join(repo, "AGENTS.md");
|
|
979
979
|
const initial = fs.readFileSync(agents, "utf8");
|
|
980
|
-
assert(initial.includes("managed-agents:start version=4.
|
|
980
|
+
assert(initial.includes("managed-agents:start version=4.2.0"), "new projects should receive the versioned root AGENTS block");
|
|
981
981
|
|
|
982
982
|
const custom = [
|
|
983
983
|
"# Project rules",
|
|
@@ -996,12 +996,12 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
|
996
996
|
|
|
997
997
|
run("node", [cli, "sync", "--projects", repo]);
|
|
998
998
|
const migrated = fs.readFileSync(agents, "utf8");
|
|
999
|
-
assert(migrated.includes("managed-agents:start version=4.
|
|
999
|
+
assert(migrated.includes("managed-agents:start version=4.2.0"), "AGENTS migration should install the current managed block");
|
|
1000
1000
|
assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
|
|
1001
1001
|
assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
|
|
1002
1002
|
const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
|
|
1003
1003
|
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.
|
|
1004
|
+
const archive = path.join(repo, "docs", "archive", "workflow", "AGENTS.pre-4.2.0.md");
|
|
1005
1005
|
assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
|
|
1006
1006
|
const stable = fs.readFileSync(agents);
|
|
1007
1007
|
run("node", [cli, "sync", "--projects", repo]);
|
|
@@ -1058,7 +1058,7 @@ function testEngineeringFrameworkRejectsAnyNonCanonicalWorkflowText() {
|
|
|
1058
1058
|
|
|
1059
1059
|
run("node", [cli, "init"], { cwd: repo });
|
|
1060
1060
|
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.
|
|
1061
|
+
const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.2.0", "docs", "ENGINEERING.md");
|
|
1062
1062
|
assert(fs.readFileSync(archived, "utf8").includes("backend owns APIs"), "removed project text should remain in non-authoritative history");
|
|
1063
1063
|
}
|
|
1064
1064
|
|
|
@@ -1070,12 +1070,12 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
|
|
|
1070
1070
|
|
|
1071
1071
|
const manifestPath = path.join(repo, ".agents", "managed-install.json");
|
|
1072
1072
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
1073
|
-
assert(manifest.schema_version === 1 && manifest.skill_version === "4.
|
|
1073
|
+
assert(manifest.schema_version === 1 && manifest.skill_version === "4.2.0", "installed manifest must identify the release");
|
|
1074
1074
|
assert(manifest.entries.length > 0, "installed manifest must list managed files");
|
|
1075
1075
|
for (const entry of manifest.entries) {
|
|
1076
1076
|
assert(typeof entry.path === "string" && !path.isAbsolute(entry.path) && !entry.path.includes(".."), "manifest paths must be safe relative paths");
|
|
1077
1077
|
assert(/^[0-9a-f]{64}$/.test(entry.sha256), `${entry.path}: manifest hash must be sha256`);
|
|
1078
|
-
assert(entry.version === "4.
|
|
1078
|
+
assert(entry.version === "4.2.0" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
|
|
1079
1079
|
}
|
|
1080
1080
|
assert(!manifest.managed_namespaces.some(item => item.path === ".agents" || item.path === "docs"), "manifest must not mirror entire project-owned trees");
|
|
1081
1081
|
|
|
@@ -1145,14 +1145,14 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
|
|
1147
1147
|
function testReleaseVersionMarkersStayInSync() {
|
|
1148
|
-
const expected = "4.
|
|
1148
|
+
const expected = "4.2.0";
|
|
1149
1149
|
const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
|
|
1150
1150
|
const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
|
|
1151
1151
|
const policy = JSON.parse(fs.readFileSync(
|
|
1152
1152
|
path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
|
|
1153
1153
|
"utf8",
|
|
1154
1154
|
));
|
|
1155
|
-
assert(pkg.version === expected, "package version must match the 4.
|
|
1155
|
+
assert(pkg.version === expected, "package version must match the 4.2.0 release");
|
|
1156
1156
|
assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
|
|
1157
1157
|
assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
|
|
1158
1158
|
const manifest = JSON.parse(fs.readFileSync(path.join(repoRoot, "cli", "assets", "managed-install.json"), "utf8"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvis1513/auto-coding-skill",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
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": {
|