Merge branch 'main' into rename

Keep pouch naming and .pouch/ack project state, and bring in ACK
regression mode, deployer test-environment binding, and manage-release
updates from main.
This commit is contained in:
2026-08-25 15:23:48 +08:00
40 changed files with 1968 additions and 224 deletions
+29 -2
View File
@@ -1313,9 +1313,10 @@ def cmd_init(args: argparse.Namespace) -> None:
tasks_file = destination / "tasks.yaml"
knowledge_file = destination / "knowledge.yaml"
delivery_file = destination / "delivery.yaml"
regression_file = destination / "regression.yaml"
managed_targets = [project_file, tasks_file]
if args.name == "ack":
managed_targets.extend((knowledge_file, delivery_file))
managed_targets.extend((knowledge_file, delivery_file, regression_file))
existing = [path for path in managed_targets if path.exists() or path.is_symlink()]
if existing:
paths = ", ".join(str(path.relative_to(project)) for path in existing)
@@ -1332,6 +1333,10 @@ def cmd_init(args: argparse.Namespace) -> None:
(
(skill_source / "templates" / "knowledge.template.yaml", knowledge_file),
(skill_source / "templates" / "delivery.template.yaml", delivery_file),
(
skill_source / "templates" / "regression.template.yaml",
regression_file,
),
)
)
missing = [path for path, _ in template_targets if not path.is_file()]
@@ -1341,10 +1346,16 @@ def cmd_init(args: argparse.Namespace) -> None:
validator = skill_source / "scripts" / "validate_tasks.py"
knowledge_validator = skill_source / "scripts" / "validate_knowledge.py"
delivery_validator = skill_source / "scripts" / "validate_delivery.py"
regression_validator = skill_source / "scripts" / "validate_regression.py"
if args.name == "ack":
missing_validators = [
path
for path in (validator, knowledge_validator, delivery_validator)
for path in (
validator,
knowledge_validator,
delivery_validator,
regression_validator,
)
if not path.is_file()
]
if missing_validators:
@@ -1417,6 +1428,21 @@ def cmd_init(args: argparse.Namespace) -> None:
raise SystemExit(
f"初始化交付契约校验失败(exit {completed.returncode}"
)
if args.name == "ack" and regression_validator.is_file():
completed = subprocess.run(
[
sys.executable,
str(regression_validator),
str(staged_files[regression_file]),
"--tasks",
str(staged_files[tasks_file]),
],
check=False,
)
if completed.returncode != 0:
raise SystemExit(
f"初始化回归目录校验失败(exit {completed.returncode}"
)
for target, staged in staged_files.items():
if staged.read_text(encoding="utf-8") != rendered_files[target]:
@@ -1645,6 +1671,7 @@ def cmd_init(args: argparse.Namespace) -> None:
if args.name == "ack":
_print(f" 知识库: {knowledge_file}")
_print(f" 交付契约: {delivery_file}(默认关闭)")
_print(f" 回归目录: {regression_file}")
_print("下一步: 填写 project.md 中的项目命令、路径权限和 Base URL")