Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/charter/05-install-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ your-test-project/
├── .claude/{agents,skills}/ ← 16 agent + 32 skill(业务) + 3 元 skill
├── .github/workflows/test.yml
├── Jenkinsfile
├── CLAUDE.md ← AI Agent 行为指令(Claude Code 必读)
├── AGENTS.md ← Agent 目录(16 专家)
├── utils/ ← 79 个 .py + __init__
├── src/ ← 被测系统源码(cov 指向)
├── workspace/
Expand All @@ -265,7 +267,8 @@ your-test-project/
│ ├── skill-evolution/ ← darwin-skill results.tsv + 成果卡片
│ ├── 截图/ 报告/
├── conftest.py / pytest.ini / requirements.txt
├── .mcp.json / .env
├── .mcp.json / .env / quality_gates.yaml
├── templates/ ← tagent init 模板
```

---
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/部署说明.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,8 @@ git pull
TEMPLATE_DIR=$(pwd) ./docs/getting-started/deploy.sh /path/to/your-test-project
```

> 升级会**覆盖** `.claude/agents/`、`.claude/skills/`、`utils/`、`conftest.py`、`pytest.ini`、`requirements.txt`、`.mcp.json`、`.github/workflows/test.yml`、`Jenkinsfile`。
> **不会覆盖**:`.env`、`workspace/`、`src/`。
> 升级会**覆盖** `.claude/agents/`、`.claude/skills/`、`utils/`、`conftest.py`、`pytest.ini`、`requirements.txt`、`.mcp.json`、`.github/workflows/test.yml`、`Jenkinsfile`、`CLAUDE.md`、`AGENTS.md`、`templates/`
> **不会覆盖**:`.env`、`workspace/`、`src/`、`quality_gates.yaml`

### 回滚

Expand Down
17 changes: 15 additions & 2 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def _parse_args():

PRESERVE_FILES = [
".env",
"quality_gates.yaml",
os.path.join("workspace", "测试数据", "test_data.json"),
os.path.join("workspace", "测试报告", "baselines", "perf_baseline.json"),
"workspace/regression_modules.yaml",
Expand Down Expand Up @@ -341,12 +342,23 @@ def copy_config(template_dir, project_root):
"""拷贝配置文件。"""
print("→ 拷贝配置文件...")
config_dir = os.path.join(template_dir, "config")
files = ["conftest.py", "pytest.ini", ".mcp.json", "requirements.txt", "check_version.py"]
files = [
"conftest.py", "pytest.ini", ".mcp.json", "requirements.txt",
"check_version.py", "quality_gates.yaml",
]
for f in files:
src = os.path.join(config_dir, f)
if os.path.isfile(src):
shutil.copy2(src, project_root)

# 拷贝项目模板(STARTUP.md.tpl / .env.tpl / .tagent.yml.tpl / matrix.yaml 等)
tmpl_src = os.path.join(config_dir, "templates")
tmpl_dst = os.path.join(project_root, "templates")
if os.path.isdir(tmpl_src):
if os.path.exists(tmpl_dst):
shutil.rmtree(tmpl_dst)
shutil.copytree(tmpl_src, tmpl_dst)

# .env — 仅在不存在时创建
env_dst = os.path.join(project_root, ".env")
if not os.path.isfile(env_dst):
Expand Down Expand Up @@ -422,7 +434,8 @@ def copy_top_level_docs(template_dir, project_root):
docs = [
"LICENSE", "NOTICE.md", "SECURITY.md", "CONTRIBUTING.md",
"CODE_OF_CONDUCT.md", "ROADMAP.md", "README.md", "README.zh-CN.md",
"CHANGELOG.md", "VERSION", "FULL_GUIDE.md", "tagent.yml.example",
"CHANGELOG.md", "VERSION", "FULL_GUIDE.md", "AGENTS.md", "CLAUDE.md",
"tagent.yml.example",
]
for f in docs:
src = os.path.join(template_dir, f)
Expand Down
8 changes: 5 additions & 3 deletions utils/quality/quality_gate_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Replaces hardcoded GATES dict in ci_quality_gate.py with YAML-configurable
thresholds. Users edit the YAML, not the code.

默认配置文件: config/quality_gates.yaml
默认查找: ./quality_gates.yaml (部署) → ./config/quality_gates.yaml (源码)
可通过 QUALITY_GATE_CONFIG 环境变量覆盖路径。
"""

Expand All @@ -26,7 +26,9 @@

logger = logging.getLogger(__name__)

DEFAULT_CONFIG = Path(__file__).resolve().parent.parent / "config" / "quality_gates.yaml"
_cfg_deployed = Path(__file__).resolve().parent.parent.parent / "quality_gates.yaml"
_cfg_source = Path(__file__).resolve().parent.parent.parent / "config" / "quality_gates.yaml"
DEFAULT_CONFIG = _cfg_deployed if _cfg_deployed.exists() else _cfg_source


def _load_yaml_config(path: str | Path) -> dict[str, Any]:
Expand Down Expand Up @@ -236,7 +238,7 @@ def main() -> None:
logging.basicConfig(level=logging.INFO)

parser = argparse.ArgumentParser(description="Quality Gate Engine (YAML-driven)")
parser.add_argument("--config", help="YAML 配置文件路径 (默认: config/quality_gates.yaml)")
parser.add_argument("--config", help="YAML 配置文件路径 (默认: 项目根 quality_gates.yaml)")
parser.add_argument("--smoke-xml", help="冒烟 junit xml 路径")
parser.add_argument("--regression-xml", help="回归 junit xml 路径")
parser.add_argument("--coverage-xml", help="coverage.xml 路径")
Expand Down
Loading