synapse-hub 3.0.0 → 3.0.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/.agents/rules/communication-style.md +4 -0
- package/.agents/rules/context-engineering.md +1 -0
- package/.agents/rules/git-push-protocol.md +17 -0
- package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
- package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
- package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
- package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
- package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
- package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +1 -1
- package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
- package/.agents/skills/persistent-planning-files/SKILL.md +1 -1
- package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
- package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
- package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
- package/.agents/skills/surgical-coding-principles/SKILL.md +1 -1
- package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
- package/.agents/skills/verification-before-completion/SKILL.md +2 -2
- package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +2 -2
- package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
- package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +61 -0
- package/AGENTS.md +6 -4
- package/CLAUDE.md +1 -0
- package/README.en.md +8 -8
- package/README.md +3 -3
- package/action.yml +1 -1
- package/bin/agent-qa.js +2 -2
- package/docs/ARCHITECTURE.en.md +192 -0
- package/docs/ARCHITECTURE.md +127 -126
- package/docs/CI_CD_INTEGRATION.en.md +96 -0
- package/docs/CI_CD_INTEGRATION.md +24 -22
- package/docs/CLI_REFERENCE.en.md +174 -0
- package/docs/CLI_REFERENCE.md +120 -115
- package/docs/CONTRIBUTING.en.md +49 -0
- package/docs/CONTRIBUTING.md +25 -67
- package/docs/QUALITY_GATES.en.md +115 -0
- package/docs/QUALITY_GATES.md +82 -80
- package/docs/research/agent_skill_training_analysis.md +1 -1
- package/package.json +1 -1
- package/skills_manifest.json +1 -1
- package/synapse.config.json +1 -1
- package/templates/ai_bridges/CLAUDE.md +1 -0
- package/tools/__init__.py +1 -1
- package/tools/auto_heal_reflexion.py +8 -0
- package/tools/browser_helpers.js +2 -2
- package/tools/bump_version.py +15 -14
- package/tools/check_version_sync.py +24 -7
- package/tools/cli.py +3 -3
- package/tools/contract_validator.py +141 -0
- package/tools/dashboard_generator.py +11 -11
- package/tools/db_sandbox.py +22 -9
- package/tools/generate_allure_report.py +1 -1
- package/tools/infer_linter.py +135 -21
- package/tools/mcp_excel_server.py +1 -1
- package/tools/mcp_server.py +7 -4
- package/tools/micro_mutator.py +21 -3
- package/tools/reversible_sandbox.py +2 -2
- package/tools/senior_code_review.py +2 -1
- package/tools/skill_vault.py +82 -3
- package/tools/skillspector.py +5 -1
- package/tools/sync_agent_rules.py +1 -0
- package/tools/test_impact.py +2 -1
- package/tools/update_sentinel.py +3 -3
- package/tools/verify_all.py +2 -2
- package/tools/visual_diff_canvas.py +3 -2
- package/tools/welcome_page.py +1 -1
package/docs/CONTRIBUTING.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# Hướng Dẫn Đóng Góp
|
|
1
|
+
# Hướng Dẫn Đóng Góp Vào Synapse-Hub
|
|
2
2
|
|
|
3
|
-
[🇻🇳 Tiếng Việt](
|
|
3
|
+
[🇻🇳 Tiếng Việt](CONTRIBUTING.md) | [🇬🇧 English Edition](CONTRIBUTING.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## 🇻🇳 Hướng Dẫn Đóng Góp (Tiếng Việt)
|
|
5
|
+
Chào mừng bạn tham gia đóng góp mở rộng kỹ năng (Skills), công cụ (Tools) và các quy tắc kiểm thử trong hệ sinh thái **Synapse Hub**. Mọi đóng góp đều cần tuân thủ 2 nguyên tắc then chốt: **Truth Anchor** (chống test pass ảo, trung thực kỹ thuật) và **Tiết Kiệm Token Tối Đa**.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
---
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
## 1. Quy Chuẩn Khi Viết Kỹ Năng Mới (Skill Standards)
|
|
12
10
|
|
|
13
|
-
Mỗi kỹ năng nằm trong thư mục `.agents/skills/<
|
|
11
|
+
Mỗi kỹ năng nằm trong thư mục riêng `.agents/skills/<ten-ky-nang>/` và cần đáp ứng các tiêu chí sau:
|
|
14
12
|
|
|
15
|
-
1. **Cấu trúc
|
|
13
|
+
1. **Cấu trúc file `SKILL.md`:**
|
|
16
14
|
- Bắt buộc có phần mở đầu YAML frontmatter chuẩn xác chứa `name` và `description`.
|
|
17
|
-
- `name` phải trùng khớp 100% với tên thư mục (dạng `kebab-case`).
|
|
18
|
-
- `description`
|
|
15
|
+
- `name` phải trùng khớp 100% với tên thư mục (định dạng `kebab-case`).
|
|
16
|
+
- `description` phải nêu rõ phạm vi và ngữ cảnh kích hoạt, phân biệt rõ ràng với các kỹ năng khác để AI không bao giờ gọi nhầm.
|
|
19
17
|
2. **Ngắn Gọn & Tiết Kiệm Token:**
|
|
20
|
-
-
|
|
21
|
-
- Áp dụng nguyên lý
|
|
22
|
-
3. **Không
|
|
23
|
-
-
|
|
24
|
-
- Luôn
|
|
18
|
+
- Nội dung chỉ dẫn kỹ thuật viết bằng tiếng Anh ngắn gọn, súc tích để tránh làm đầy ngữ cảnh của AI.
|
|
19
|
+
- Áp dụng nguyên lý tải thông tin lũy tiến (Progressive Disclosure): giữ file `SKILL.md` trong khoảng 40 đến 150 dòng; các đoạn code mẫu dài nên đưa vào thư mục `examples/` hoặc `references/`.
|
|
20
|
+
3. **Tuyệt Đối Không Phụ Thuộc Vào Dự Án Cụ Thể (Decoupled):**
|
|
21
|
+
- Không được hardcode tên dự án nội bộ, domain riêng tư, mật khẩu hay endpoint bí mật.
|
|
22
|
+
- Luôn dùng định danh mẫu: `https://staging.example.com`, `auto_user_123`.
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 2. Quy Trình Kiểm Thử Trước Khi Mở Pull Request
|
|
27
27
|
|
|
28
|
-
Trước khi
|
|
28
|
+
Trước khi mở PR hoặc đẩy code lên nhánh `develop`:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
# 1. Chạy toàn bộ
|
|
31
|
+
# 1. Chạy toàn bộ 260+ bài unit test
|
|
32
32
|
python3 -m unittest discover tests
|
|
33
33
|
|
|
34
34
|
# 2. Kiểm định toàn vẹn 10 Cổng Chất Lượng DoD (Gate 0–9)
|
|
@@ -38,54 +38,12 @@ python3 tools/verify_all.py
|
|
|
38
38
|
python3 tools/lint_ai_docs.py
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
### 3. Nguyên Tắc Phát Triển Công Cụ (Tools)
|
|
42
|
-
|
|
43
|
-
Mọi công cụ tiện ích trong `tools/` cần tuân thủ:
|
|
44
|
-
1. **Ưu Tiên Thư Viện Chuẩn Python (Standard Library):** Hạn chế tối đa thư viện bên ngoài để công cụ chạy được ngay trên máy sạch và CI mà không cần cài đặt phức tạp.
|
|
45
|
-
2. **Tốc Độ Xử Lý Siêu Tốc:** Các phép quét AST và regex phải hoàn tất dưới 500ms.
|
|
46
|
-
3. **Không Ghi Rác Vào Repo:** Khi viết test, bắt buộc sử dụng thư mục tạm `tempfile.TemporaryDirectory()`, không để lại file rác trong repo.
|
|
47
|
-
4. **Thông Báo Lỗi Thân Thiện:** Luôn cung cấp gợi ý sửa lỗi rõ ràng (`Fix Hint`) thay vì chỉ in ra stacktrace thô.
|
|
48
|
-
|
|
49
41
|
---
|
|
50
42
|
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
We welcome contributions to expand and refine skills, tools, and rules in the **Synapse-Hub** ecosystem. All contributions must adhere to our **Truth Anchor** (no fake passes) and **Token-Efficiency** standards.
|
|
54
|
-
|
|
55
|
-
### 1. Skill Authoring Standards
|
|
56
|
-
|
|
57
|
-
Every skill resides in `.agents/skills/<skill-name>/` and must satisfy:
|
|
58
|
-
|
|
59
|
-
1. **`SKILL.md` Structure:**
|
|
60
|
-
- Must contain valid YAML frontmatter with `name` and `description`.
|
|
61
|
-
- `name` must exactly match the directory name in kebab-case.
|
|
62
|
-
- `description` must clearly articulate the triggering scope and disambiguate itself from adjacent skills.
|
|
63
|
-
2. **Conciseness & Token Budget:**
|
|
64
|
-
- Write instructions in concise technical English to minimize LLM token consumption.
|
|
65
|
-
- Use progressive disclosure: keep `SKILL.md` between 40 and 150 lines, and offload deep code patterns to `references/` or `examples/`.
|
|
66
|
-
3. **Zero Project Coupling:**
|
|
67
|
-
- Never hardcode specific project names, proprietary URLs, test credentials, or internal namespaces.
|
|
68
|
-
- Always use generic placeholders: `<project_namespace>`, `https://app.example.com`, `APP_PASSWORD`.
|
|
69
|
-
|
|
70
|
-
### 2. Integrity Verification Workflow
|
|
71
|
-
|
|
72
|
-
Before submitting a pull request or committing changes:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
# 1. Run unit test suite (170+ tests)
|
|
76
|
-
python3 -m unittest discover tests
|
|
77
|
-
|
|
78
|
-
# 2. Verify all 9 DoD Quality Gates
|
|
79
|
-
python3 tools/verify_all.py
|
|
80
|
-
|
|
81
|
-
# 3. Test documentation and entity references integrity
|
|
82
|
-
python3 tools/lint_ai_docs.py
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### 3. Tool Development Guidelines
|
|
43
|
+
## 3. Nguyên Tắc Phát Triển Công Cụ Mới (Tools)
|
|
86
44
|
|
|
87
|
-
|
|
88
|
-
1.
|
|
89
|
-
2. **
|
|
90
|
-
3. **
|
|
91
|
-
4. **
|
|
45
|
+
Mọi công cụ tiện ích trong thư mục `tools/` cần tuân thủ:
|
|
46
|
+
1. **Ưu Tiên Thư Viện Chuẩn Python (Standard Library):** Hạn chế tối đa thư viện bên ngoài để công cụ chạy được ngay trên máy sạch và CI mà không cần `pip install` phức tạp.
|
|
47
|
+
2. **Tốc Độ Xử Lý Phải Nhanh:** Các phép quét AST và regex phải hoàn tất dưới 500ms.
|
|
48
|
+
3. **Không Làm Bẩn Repo:** Khi viết test cho công cụ, bắt buộc dùng thư mục tạm `tempfile.TemporaryDirectory()`, không được để lại bất kỳ file rác nào trong repo.
|
|
49
|
+
4. **Báo Lỗi Thân Thiện Kèm Cách Sửa:** Luôn cung cấp gợi ý khắc phục (`Fix Hint`) rõ ràng thay vì chỉ in ra stacktrace thô.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# 🛡️ 10 Quality Gates Definition of Done (DoD) Standard
|
|
2
|
+
|
|
3
|
+
[🇻🇳 Tiếng Việt](QUALITY_GATES.md) | [🇬🇧 English Edition](QUALITY_GATES.en.md)
|
|
4
|
+
|
|
5
|
+
> **Scope:** Enterprise automated verification sentinel enforcing 10 non-negotiable Quality Gates across Synapse Hub and target client projects.
|
|
6
|
+
> **Command:** `python3 tools/verify_all.py` or `npx synapse-hub verify`
|
|
7
|
+
> **Integrity Guard:** Synapse Hub created by **Thế Vị (@TeeVee998)** (<https://github.com/TeeVee998/Synapse-Hub>) under MIT License.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 📋 Quality Gates Matrix Overview
|
|
12
|
+
|
|
13
|
+
| Gate | Name | Target Scope | Engine / Tool | Exit Code | Passing Criteria (DoD) |
|
|
14
|
+
| :---: | :--- | :--- | :--- | :---: | :--- |
|
|
15
|
+
| **Gate 0** | **Author Attribution & MIT Integrity** | Repository-wide | `tools/author_integrity.py` | 0 | MIT License notice and author attribution intact across all source files. |
|
|
16
|
+
| **Gate 1** | **UTF-8 No BOM Encoding** | All source & config files | `tools/verify_all.py` | 0 | Zero Byte Order Mark (`0xEF, 0xBB, 0xBF`) bytes across any file. |
|
|
17
|
+
| **Gate 2** | **Path Portability** | All source & test files | `tools/verify_all.py` | 0 | Zero hardcoded personal/machine absolute paths (`/Users/...`, `C:\...`). |
|
|
18
|
+
| **Gate 3** | **Clean POM & Flat Architecture** | Test scripts (`tests/`, `Scripts/`) | `tools/verify_all.py` | 0 | Zero raw XPaths or CSS selectors in test scripts; 100% locators encapsulated in Page Classes. |
|
|
19
|
+
| **Gate 4** | **AI Documentation & Anti-Drift** | `PROJECT_AI_GUIDE.md` & AST | `tools/lint_ai_docs.py` | 0 | 0 hallucinated PageClasses; 100% documented methods exist in codebase AST. |
|
|
20
|
+
| **Gate 5** | **Temporary Files Blacklist** | Repository tree | `tools/verify_all.py` | 0 | Zero scratch files, heap dumps, or temporary artifacts (`*.tmp`, `.ruff_cache`, memory dumps). |
|
|
21
|
+
| **Gate 6** | **Credential & Secret Security** | All files & git index | `tools/verify_all.py` | 0 | Zero plaintext passwords, API keys, private tokens, or AWS/JWT credentials committed. |
|
|
22
|
+
| **Gate 7** | **Static Defect & Fake-Pass Sentinel** | Test scripts & tools | `tools/infer_linter.py` | 0 | Zero empty assertions (0 assert), zero swallowed exceptions (`pass`), zero hardcoded sleeps (>= 3000ms). |
|
|
23
|
+
| **Gate 8** | **Assertion Sensitivity (Mutation Score)** | Test assertions | `tools/micro_mutator.py` | 0 | Mutation kill score >= 80% (heuristic static mutant detection catches >= 80% syntactic modifications). |
|
|
24
|
+
| **Gate 9** | **Skill Routing & Collision Guard** | Skill descriptions | `tools/skill_collision_guard.py` | 0 | Zero overlapping trigger collisions (semantic cosine similarity < 0.75 across all skill pairs). |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 🔍 Detailed Gate Specifications
|
|
29
|
+
|
|
30
|
+
### Gate 0: Author Attribution & MIT License Integrity
|
|
31
|
+
- **Objective:** Protects open-source attribution provenance under MIT License.
|
|
32
|
+
- **Verification Rule:** Rejects any commit, pull request, or modification that attempts to strip copyright notices, false-claim authorship, or remove provenance headers referencing Thế Vị (@TeeVee998).
|
|
33
|
+
- **Remediation:** Restore license headers and canonical notice in `LICENSE` and `NOTICE`.
|
|
34
|
+
|
|
35
|
+
### Gate 1: UTF-8 No BOM Encoding Integrity
|
|
36
|
+
- **Objective:** Eliminates cross-platform file encoding corruption between Windows, macOS, and Linux CI/CD runners.
|
|
37
|
+
- **Verification Rule:** Inspects raw bytes of all text files. Any occurrence of BOM bytes (`0xEF, 0xBB, 0xBF`) causes immediate failure.
|
|
38
|
+
- **Remediation:** Run `python3 tools/verify_all.py --fix-bom` to strip BOM bytes automatically.
|
|
39
|
+
|
|
40
|
+
### Gate 2: Path Portability
|
|
41
|
+
- **Objective:** Guarantees test scripts and tooling execute seamlessly across team developer workstations, Docker containers, and CI pipelines.
|
|
42
|
+
- **Verification Rule:** Regex scans for machine-specific path roots (`/Users/`, `/home/`, `C:\`, `D:\`).
|
|
43
|
+
- **Remediation:** Replace absolute paths with dynamic workspace resolution (`Path(__file__).resolve().parent.parent` or `resolve_target_repo()`).
|
|
44
|
+
|
|
45
|
+
### Gate 3: Clean POM & Flat Architecture
|
|
46
|
+
- **Objective:** Enforces clean separation of concerns. Test scripts must contain solely business workflow actions, never DOM traversal.
|
|
47
|
+
- **Verification Rule:** Prohibits raw CSS selectors, XPaths, or `findTestObject` inside `tests/` or `Scripts/`. All UI operations must be delegated to methods on Page Classes extending `BasePage`.
|
|
48
|
+
- **Remediation:** Encapsulate locators and interaction logic inside dedicated Page Classes.
|
|
49
|
+
|
|
50
|
+
### Gate 4: AI Documentation & Anti-Drift Linter
|
|
51
|
+
- **Objective:** Prevents AI context drift where documentation refers to non-existent Page Classes or obsolete method signatures.
|
|
52
|
+
- **Verification Rule:** Extracts all documented Page Classes and methods from `PROJECT_AI_GUIDE.md` and verifies their physical AST existence in the codebase.
|
|
53
|
+
- **Remediation:** Run `python3 tools/lint_ai_docs.py` to identify drifts, then re-index via `python3 tools/repo_map.py`.
|
|
54
|
+
|
|
55
|
+
### Gate 5: Temporary Files Blacklist
|
|
56
|
+
- **Objective:** Maintains git hygiene and prevents polluting repositories with binary dumps or local IDE caches.
|
|
57
|
+
- **Verification Rule:** Scans for prohibited extensions: `*.tmp`, `*.dump`, `*.log`, `*.orig`, `*.bak`, `.ruff_cache/`, `.mypy_cache/`.
|
|
58
|
+
- **Remediation:** Add unignored patterns to `.gitignore` and delete temporary files.
|
|
59
|
+
|
|
60
|
+
### Gate 6: Credential Security Sentinel
|
|
61
|
+
- **Objective:** Prevents enterprise credential leaks (API tokens, database connection strings, private keys).
|
|
62
|
+
- **Verification Rule:** High-entropy regex scanner detecting AWS secret keys, Bearer tokens, private RSA keys, and hardcoded passwords.
|
|
63
|
+
- **Remediation:** Move credentials to environment variables or `.env` (ensuring `.env` is listed in `.gitignore`).
|
|
64
|
+
|
|
65
|
+
### Gate 7: Static Defect & Fake-Pass Sentinel
|
|
66
|
+
- **Objective:** Eliminates "fake passes" created by AI code generation (tests that pass trivially without asserting anything).
|
|
67
|
+
- **Verification Rule:**
|
|
68
|
+
- Flags tests containing 0 assertions.
|
|
69
|
+
- Flags empty catch blocks (`except Exception: pass`) swallowing failure exceptions.
|
|
70
|
+
- Flags hardcoded sleeps (`sleep(5000)`, `Thread.sleep(5000)`).
|
|
71
|
+
- Flags unawaited Playwright assertions (`expect(el).toBeVisible()` without `await`).
|
|
72
|
+
- **Remediation:** Add meaningful assertions; replace sleeps with smart waits (`waitForLoadState('networkidle')`, element visibility checks).
|
|
73
|
+
|
|
74
|
+
### Gate 8: Assertion Sensitivity & Syntactic Mutation Sentinel
|
|
75
|
+
- **Objective:** Guarantees assertions are sensitive enough to catch real defects, not tautological (always-true) expressions.
|
|
76
|
+
- **Verification Rule:** Injects syntactic mutations (reversing comparison operators `==` to `!=`, swapping boolean constants, altering return values). Requires Mutation Score >= 80%.
|
|
77
|
+
- **Remediation:** Run `python3 tools/micro_mutator.py --strict` to inspect surviving mutants and tighten test assertions.
|
|
78
|
+
|
|
79
|
+
### Gate 9: Tier-2 Skill Routing & Collision Guard
|
|
80
|
+
- **Objective:** Prevents AI agent prompt confusion caused by overlapping skill trigger descriptions.
|
|
81
|
+
- **Verification Rule:** Computes pairwise cosine similarity between all skill `SKILL.md` description fields. Similarity must remain strictly < 0.75.
|
|
82
|
+
- **Remediation:** Differentiate skill descriptions using the standardized formula `[Function] + Use when [context]` (<= 350 characters).
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🚀 Execution & CI/CD Integration
|
|
87
|
+
|
|
88
|
+
### Run Locally:
|
|
89
|
+
```bash
|
|
90
|
+
# Verify all 10 Gates on current repository
|
|
91
|
+
python3 tools/verify_all.py
|
|
92
|
+
|
|
93
|
+
# Verify target project from Hub
|
|
94
|
+
python3 tools/verify_all.py --target /path/to/project
|
|
95
|
+
|
|
96
|
+
# Output as JUnit XML for CI/CD reporting
|
|
97
|
+
python3 tools/verify_all.py --format junit --output reports/dod_gates.xml
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### GitHub Actions Pipeline (`.github/workflows/verify.yml`):
|
|
101
|
+
```yaml
|
|
102
|
+
name: Synapse Hub 10 DoD Quality Gates
|
|
103
|
+
on: [push, pull_request]
|
|
104
|
+
|
|
105
|
+
jobs:
|
|
106
|
+
quality-gates:
|
|
107
|
+
runs-on: ubuntu-latest
|
|
108
|
+
steps:
|
|
109
|
+
- uses: actions/checkout@v4
|
|
110
|
+
- uses: actions/setup-python@v5
|
|
111
|
+
with:
|
|
112
|
+
python-version: '3.11'
|
|
113
|
+
- name: Run 10 Quality Gates
|
|
114
|
+
run: python tools/verify_all.py --mode target
|
|
115
|
+
```
|
package/docs/QUALITY_GATES.md
CHANGED
|
@@ -1,101 +1,103 @@
|
|
|
1
|
-
# 🛡️ 10
|
|
1
|
+
# 🛡️ Tiêu Chuẩn 10 Cổng Chất Lượng DoD (Definition of Done)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
> **
|
|
3
|
+
[🇻🇳 Tiếng Việt](QUALITY_GATES.md) | [🇬🇧 English Edition](QUALITY_GATES.en.md)
|
|
4
|
+
|
|
5
|
+
> **Phạm vi:** Hệ thống chốt chặn tự động kiểm tra 10 Cổng Chất Lượng bắt buộc trên Synapse Hub và các dự án kiểm thử con.
|
|
6
|
+
> **Lệnh thực thi:** `python3 tools/verify_all.py` hoặc `npx synapse-hub verify`
|
|
7
|
+
> **Bảo toàn tác quyền:** Synapse Hub được sáng lập bởi **Thế Vị (@TeeVee998)** (<https://github.com/TeeVee998/Synapse-Hub>) theo giấy phép MIT.
|
|
6
8
|
|
|
7
9
|
---
|
|
8
10
|
|
|
9
|
-
## 📋
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
13
|
-
| **Gate 0** | **
|
|
14
|
-
| **Gate 1** | **UTF-8 No BOM
|
|
15
|
-
| **Gate 2** |
|
|
16
|
-
| **Gate 3** | **Clean POM
|
|
17
|
-
| **Gate 4** | **
|
|
18
|
-
| **Gate 5** | **
|
|
19
|
-
| **Gate 6** | **
|
|
20
|
-
| **Gate 7** | **
|
|
21
|
-
| **Gate 8** |
|
|
22
|
-
| **Gate 9** |
|
|
11
|
+
## 📋 Bảng Tổng Quan 10 Cổng Kiểm Định Chất Lượng
|
|
12
|
+
|
|
13
|
+
| Cổng | Tên Cổng | Phạm Vi Quét | Công Cụ Kiểm Tra | Mã Thoát | Tiêu Chuẩn Đạt (DoD) |
|
|
14
|
+
| :---: | :--- | :--- | :--- | :---: | :--- |
|
|
15
|
+
| **Gate 0** | **Bảo Toàn Tác Quyền & Giấy Phép MIT** | Toàn bộ repo | `tools/author_integrity.py` | 0 | Giữ nguyên thông báo bản quyền MIT và tác giả gốc Thế Vị (@TeeVee998). |
|
|
16
|
+
| **Gate 1** | **Chuẩn Mã Hóa UTF-8 No BOM** | Toàn bộ file code & config | `tools/verify_all.py` | 0 | 100% file không chứa ký tự BOM rác (`0xEF, 0xBB, 0xBF`). |
|
|
17
|
+
| **Gate 2** | **Đường Dẫn Linh Hoạt (Path Portability)** | Code test & script công cụ | `tools/verify_all.py` | 0 | Không hardcode đường dẫn tuyệt đối của máy cá nhân (`/Users/...`, `C:\...`). |
|
|
18
|
+
| **Gate 3** | **Kiến Trúc Clean POM Phẳng** | Thư mục test (`tests/`, `Scripts/`) | `tools/verify_all.py` | 0 | 100% locator nằm trong Page Class; không để XPath/CSS selector trong file test. |
|
|
19
|
+
| **Gate 4** | **Chống Bịa Đặt Tài Liệu AI (Anti-Drift)** | `PROJECT_AI_GUIDE.md` & AST code | `tools/lint_ai_docs.py` | 0 | 0 PageClass ảo; 100% hàm tài liệu hóa phải tồn tại thật trong AST codebase. |
|
|
20
|
+
| **Gate 5** | **Chặn File Rác Lọt Vào Git** | Toàn bộ cây thư mục | `tools/verify_all.py` | 0 | Không để file rác, file tạm lọt vào git (`*.tmp`, `.ruff_cache`, heap dump, log). |
|
|
21
|
+
| **Gate 6** | **Quét Mật Khẩu & Token Bí Mật** | Toàn bộ file & git index | `tools/verify_all.py` | 0 | Không commit mật khẩu dạng plaintext, API key, token JWT hoặc private key. |
|
|
22
|
+
| **Gate 7** | **Bắt Lỗi Tĩnh & Test Pass Ảo** | File test & công cụ | `tools/infer_linter.py` | 0 | Chặn đứng test 0 assert, try-catch nuốt lỗi (`pass`), dùng sleep cứng (>= 3000ms). |
|
|
23
|
+
| **Gate 8** | **Đo Độ Nhạy Của Assert (Mutation Score)** | Toàn bộ câu lệnh assert | `tools/micro_mutator.py` | 0 | Tỷ lệ diệt đột biến $\ge 80\%$ (bắt được ít nhất 80% đột biến cú pháp cố ý). |
|
|
24
|
+
| **Gate 9** | **Điều Phối Kỹ Năng Tránh Trùng Lặp** | File `SKILL.md` của các skill | `tools/skill_collision_guard.py` | 0 | Mô tả kích hoạt kỹ năng không được đè phạm vi của nhau (cosine similarity < 0.75). |
|
|
23
25
|
|
|
24
26
|
---
|
|
25
27
|
|
|
26
|
-
## 🔍
|
|
27
|
-
|
|
28
|
-
### Gate 0:
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
|
|
33
|
-
### Gate 1: UTF-8 No BOM
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
|
|
38
|
-
### Gate 2: Path Portability
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
42
|
-
|
|
43
|
-
### Gate 3: Clean POM
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
|
|
48
|
-
### Gate 4:
|
|
49
|
-
- **
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
52
|
-
|
|
53
|
-
### Gate 5:
|
|
54
|
-
- **
|
|
55
|
-
- **
|
|
56
|
-
- **
|
|
57
|
-
|
|
58
|
-
### Gate 6:
|
|
59
|
-
- **
|
|
60
|
-
- **
|
|
61
|
-
- **
|
|
62
|
-
|
|
63
|
-
### Gate 7:
|
|
64
|
-
- **
|
|
65
|
-
- **
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
- **
|
|
71
|
-
|
|
72
|
-
### Gate 8:
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
76
|
-
|
|
77
|
-
### Gate 9:
|
|
78
|
-
- **
|
|
79
|
-
- **
|
|
80
|
-
- **
|
|
28
|
+
## 🔍 Chi Tiết Tiêu Chuẩn Từng Cổng & Cách Khắc Phục
|
|
29
|
+
|
|
30
|
+
### Gate 0: Bảo Toàn Tác Quyền & Giấy Phép MIT
|
|
31
|
+
- **Mục tiêu:** Bảo vệ nguồn gốc xuất xứ và tuân thủ điều khoản Attribution bắt buộc của Giấy phép MIT.
|
|
32
|
+
- **Quy tắc kiểm tra:** Chặn đứng mọi hành vi xóa bỏ notice bản quyền, mạo nhận quyền tác giả hoặc gỡ tên tác giả Thế Vị (@TeeVee998).
|
|
33
|
+
- **Cách khắc phục:** Khôi phục lại header bản quyền và thông tin nguồn gốc trong `LICENSE` và `NOTICE`.
|
|
34
|
+
|
|
35
|
+
### Gate 1: Chuẩn Mã Hóa UTF-8 No BOM
|
|
36
|
+
- **Mục tiêu:** Tránh lỗi vỡ font hoặc xung đột đọc file giữa Windows, macOS và môi trường Linux CI/CD.
|
|
37
|
+
- **Quy tắc kiểm tra:** Quét raw bytes của tất cả file văn bản. Báo lỗi ngay nếu xuất hiện ký tự BOM (`0xEF, 0xBB, 0xBF`).
|
|
38
|
+
- **Cách khắc phục:** Chạy `python3 tools/verify_all.py --fix-bom` để công cụ tự động dọn sạch byte BOM.
|
|
39
|
+
|
|
40
|
+
### Gate 2: Đường Dẫn Linh Hoạt (Path Portability)
|
|
41
|
+
- **Mục tiêu:** Đảm bảo code test và script công cụ chạy được trên mọi máy dev, Docker container và CI runner.
|
|
42
|
+
- **Quy tắc kiểm tra:** Dùng regex quét tìm các path gắn cứng theo máy cục bộ (`/Users/`, `/home/`, `C:\`, `D:\`).
|
|
43
|
+
- **Cách khắc phục:** Dùng đường dẫn tương đối phân giải từ thư mục gốc (`Path(__file__).resolve().parent.parent` hoặc `resolve_target_repo()`).
|
|
44
|
+
|
|
45
|
+
### Gate 3: Kiến Trúc Clean POM Phẳng
|
|
46
|
+
- **Mục tiêu:** Phân định ranh giới rõ ràng: file test chỉ chứa các bước nghiệp vụ, tuyệt đối không chọc thẳng vào DOM.
|
|
47
|
+
- **Quy tắc kiểm tra:** Cấm selector thô (CSS selector, XPath, `findTestObject`) trong thư mục `tests/` hoặc `Scripts/`. Thao tác UI phải thông qua hàm của Page Class kế thừa `BasePage`.
|
|
48
|
+
- **Cách khắc phục:** Đưa locator và thao tác click/nhập liệu vào đúng Page Class tương ứng.
|
|
49
|
+
|
|
50
|
+
### Gate 4: Chống Bịa Đặt Tài Liệu AI (Anti-Drift Linter)
|
|
51
|
+
- **Mục tiêu:** Tránh hiện tượng AI bị "ảo giác" (hallucination), đọc tài liệu cũ rồi gọi các Page Class hoặc hàm không hề tồn tại trong code.
|
|
52
|
+
- **Quy tắc kiểm tra:** Quét toàn bộ Page Class và method được ghi trong `PROJECT_AI_GUIDE.md`, kiểm tra xem chúng có tồn tại thật trong AST codebase hay không.
|
|
53
|
+
- **Cách khắc phục:** Chạy `python3 tools/lint_ai_docs.py` để tìm dòng sai lệch, sau đó chạy `python3 tools/repo_map.py` để đồng bộ lại bản đồ code.
|
|
54
|
+
|
|
55
|
+
### Gate 5: Chặn File Rác Lọt Vào Git
|
|
56
|
+
- **Mục tiêu:** Giữ git index luôn sạch sẽ, không bị phình dung lượng bởi rác build hoặc cache IDE.
|
|
57
|
+
- **Quy tắc kiểm tra:** Quét các đuôi file cấm: `*.tmp`, `*.dump`, `*.log`, `*.orig`, `*.bak`, `.ruff_cache/`, `.mypy_cache/`.
|
|
58
|
+
- **Cách khắc phục:** Khai báo các mẫu file này vào `.gitignore` và xóa bỏ các file tạm hiện có trong repo.
|
|
59
|
+
|
|
60
|
+
### Gate 6: Quét Mật Khẩu & Token Bí Mật (Secret Sentinel)
|
|
61
|
+
- **Mục tiêu:** Chống rò rỉ thông tin nhạy cảm của dự án (API token, chuỗi kết nối DB, private key, mật khẩu).
|
|
62
|
+
- **Quy tắc kiểm tra:** Quét regex entropy cao để phát hiện chuỗi khóa bí mật AWS, Bearer token, RSA key và mật khẩu bị gán cứng.
|
|
63
|
+
- **Cách khắc phục:** Chuyển sang dùng biến môi trường hoặc file `.env` (nhớ thêm `.env` vào `.gitignore`).
|
|
64
|
+
|
|
65
|
+
### Gate 7: Bắt Lỗi Tĩnh & Test Pass Ảo
|
|
66
|
+
- **Mục tiêu:** Loại bỏ triệt để các bài test do AI viết chạy xanh nhưng thực chất là vô dụng:
|
|
67
|
+
- **Quy tắc kiểm tra:**
|
|
68
|
+
- Bắt các bài test có **0 câu lệnh assert**.
|
|
69
|
+
- Bắt các khối try-catch rỗng (`except Exception: pass`) nuốt mất lỗi khi test fail.
|
|
70
|
+
- Bắt các lệnh sleep cứng (`sleep(5000)`, `Thread.sleep(5000)`).
|
|
71
|
+
- Bắt assertion của Playwright bị quên `await` (`expect(el).toBeVisible()` thiếu `await`).
|
|
72
|
+
- **Cách khắc phục:** Bổ sung assert thực tế; thay toàn bộ `sleep` cố định bằng smart wait (`waitForLoadState('networkidle')`, kiểm tra element hiển thị).
|
|
73
|
+
|
|
74
|
+
### Gate 8: Đo Độ Nhạy Của Assert (Micro-Mutation Testing)
|
|
75
|
+
- **Mục tiêu:** Đảm bảo các câu lệnh assert có giá trị kiểm thử thật sự, không phải là biểu thức "luôn luôn đúng" (tautology).
|
|
76
|
+
- **Quy tắc kiểm tra:** Tự động tiêm các đột biến cú pháp (đổi `==` thành `!=`, đảo boolean `True` sang `False`, thay giá trị return). Yêu cầu test phải bắt trượt và diệt được ít nhất 80% đột biến (Mutation Score $\ge 80\%$).
|
|
77
|
+
- **Cách khắc phục:** Chạy `python3 tools/micro_mutator.py --strict` để xem mutant nào còn sống sót và siết chặt lại assertion.
|
|
78
|
+
|
|
79
|
+
### Gate 9: Điều Phối Kỹ Năng Tránh Trùng Lặp
|
|
80
|
+
- **Mục tiêu:** Tránh việc AI kích hoạt nhầm kỹ năng do mô tả trong các file `SKILL.md` bị chồng chéo nhau.
|
|
81
|
+
- **Quy tắc kiểm tra:** Tính độ tương đồng cosine giữa phần mô tả của từng cặp kỹ năng. Yêu cầu chỉ số tương đồng phải $< 0.75$.
|
|
82
|
+
- **Cách khắc phục:** Viết lại mô tả kỹ năng theo công thức chuẩn: `[Tính năng] + Dùng khi [ngữ cảnh cụ thể]` (tối đa 350 ký tự).
|
|
81
83
|
|
|
82
84
|
---
|
|
83
85
|
|
|
84
|
-
## 🚀
|
|
86
|
+
## 🚀 Cách Chạy & Tích Hợp Vào CI/CD
|
|
85
87
|
|
|
86
|
-
###
|
|
88
|
+
### Chạy Cục Bộ Trên Máy:
|
|
87
89
|
```bash
|
|
88
|
-
#
|
|
90
|
+
# Kiểm định toàn bộ 10 Cổng trên repo hiện tại
|
|
89
91
|
python3 tools/verify_all.py
|
|
90
92
|
|
|
91
|
-
#
|
|
92
|
-
python3 tools/verify_all.py --target /
|
|
93
|
+
# Kiểm định dự án test mục tiêu từ Hub
|
|
94
|
+
python3 tools/verify_all.py --target /duong-dan/toi/du-an-test
|
|
93
95
|
|
|
94
|
-
#
|
|
96
|
+
# Xuất kết quả ra file JUnit XML để CI/CD đọc
|
|
95
97
|
python3 tools/verify_all.py --format junit --output reports/dod_gates.xml
|
|
96
98
|
```
|
|
97
99
|
|
|
98
|
-
### GitHub Actions
|
|
100
|
+
### Đường Ống GitHub Actions (`.github/workflows/verify.yml`):
|
|
99
101
|
```yaml
|
|
100
102
|
name: Synapse Hub 10 DoD Quality Gates
|
|
101
103
|
on: [push, pull_request]
|
|
@@ -1311,7 +1311,7 @@ sequenceDiagram
|
|
|
1311
1311
|
- **Objective**: Deploy lifelong skill libraries, textual gradient optimization, and standardized benchmarks.
|
|
1312
1312
|
- **Deliverables**:
|
|
1313
1313
|
1. *SkillVault Lifelong POM Library*: Deploy `.synapse/skill_vault.db` and `tools/skill_vault.py` for indexing verified Page Class methods and interaction primitives.
|
|
1314
|
-
2. *TextGrad Mutation-Loss Optimizer*: Create `tools/
|
|
1314
|
+
2. *TextGrad Mutation-Loss Optimizer*: Create `tools/textgrad_mutation_optimizer.py` to optimize test generation prompts using surviving mutant loss reports.
|
|
1315
1315
|
3. *Synapse-QA-Bench (BFCL-Style Benchmark)*: Expand `tools/agent_canary.py` to benchmark all 90 tools on AST argument matching and irrelevance detection.
|
|
1316
1316
|
4. *Modern Skill Packaging*: Add `agentskills.io` metadata and multi-host adapters to support `npx skills add TeeVee998/Synapse-Hub`.
|
|
1317
1317
|
|
package/package.json
CHANGED
package/skills_manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"name": "Enterprise Agent Skills Hub",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.1",
|
|
5
5
|
"description": "Unified Catalog of 51 Specialized Skills for Autonomous AI Agents in Enterprise Software Quality Engineering, Performance, and Architecture.",
|
|
6
6
|
"totalSkills": 51,
|
|
7
7
|
"categories": {
|
package/synapse.config.json
CHANGED
|
@@ -46,6 +46,7 @@ In accordance with the MIT License, the original copyright notice crediting **Th
|
|
|
46
46
|
5. **Pragmatic Communication Protocol:**
|
|
47
47
|
- Conversational responses, explanation, and telemetry MUST be in Vietnamese.
|
|
48
48
|
- All codebase assets, test scripts, Page Classes, docstrings, and commits MUST remain strictly in English.
|
|
49
|
+
- English-First Document Ingestion: When reading bilingual docs (e.g. ARCHITECTURE.en.md vs ARCHITECTURE.md), always read the English version (*.en.md) to save 50–65% BPE tokens.
|
|
49
50
|
|
|
50
51
|
6. **Lean Senior Dev Protocol (The 7-Rung Ladder & YAGNI):**
|
|
51
52
|
- The best code is the code never written. Solve the whole problem with the least new code.
|
package/tools/__init__.py
CHANGED
|
@@ -67,6 +67,14 @@ class ClosedLoopHealer:
|
|
|
67
67
|
return "Reflection: DOM node re-rendered asynchronously after API call. Adjustment: Must wait for loader/backdrop detachment before re-querying element."
|
|
68
68
|
elif "intercepted" in err_lower or "click" in err_lower:
|
|
69
69
|
return "Reflection: Click intercepted by fading overlay/spinner animation. Adjustment: Use smart wait for overlay detachment or bypass via safe JS click."
|
|
70
|
+
elif "hydration" in err_lower or "did not match" in err_lower:
|
|
71
|
+
return "Reflection: React/Next.js hydration mismatch caused DOM element to re-render. Adjustment: Ensure DOM is interactive and wait for loadState('domcontentloaded') before query."
|
|
72
|
+
elif "shadow" in err_lower or "shadowroot" in err_lower:
|
|
73
|
+
return "Reflection: Target element encapsulated inside closed Shadow DOM boundary. Adjustment: Pierce Shadow DOM via locator piercing syntax or evaluate via CDP."
|
|
74
|
+
elif "iframe" in err_lower or "frame" in err_lower:
|
|
75
|
+
return "Reflection: Target element resides inside cross-origin iframe container. Adjustment: Switch context to frameLocator('iframe#...') before clicking."
|
|
76
|
+
elif any(auth_err in err_lower for auth_err in ("401", "403", "unauthorized", "forbidden", "token expired")):
|
|
77
|
+
return "Reflection: Session auth token or cookie expired mid-test. Adjustment: Refresh storageState or trigger silent token re-authentication via API fixture."
|
|
70
78
|
elif "timeout" in err_lower or "nosuchelement" in err_lower:
|
|
71
79
|
return "Reflection: Static selector did not appear within timeout window. Adjustment: Fallback to Accessibility role/label or dynamic data-testid attribute."
|
|
72
80
|
elif "assert" in err_lower:
|
package/tools/browser_helpers.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
(function () {
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
-
if (window.__qa && window.__qa.__version === '3.0.
|
|
16
|
+
if (window.__qa && window.__qa.__version === '3.0.1') {
|
|
17
17
|
return window.__qa;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const qa = {
|
|
50
|
-
__version: '3.0.
|
|
50
|
+
__version: '3.0.1',
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* 1. Smart Action Batching
|
package/tools/bump_version.py
CHANGED
|
@@ -195,25 +195,25 @@ def git_commit_and_tag(version: str, push: bool = False):
|
|
|
195
195
|
push: If True, pushes the commit and tag to git remote origin.
|
|
196
196
|
"""
|
|
197
197
|
print(f"\n📦 Creating Git commit and tag v{version}...")
|
|
198
|
-
subprocess.run(["git", "add", "-
|
|
199
|
-
subprocess.run(["git", "commit", "-m", f"chore(release): bump version to v{version}"], cwd=REPO_ROOT, check=True)
|
|
200
|
-
subprocess.run(["git", "tag", f"v{version}"], cwd=REPO_ROOT, check=True)
|
|
198
|
+
subprocess.run(["git", "add", "-u"], cwd=REPO_ROOT, check=True, timeout=30.0)
|
|
199
|
+
subprocess.run(["git", "commit", "-m", f"chore(release): bump version to v{version}"], cwd=REPO_ROOT, check=True, timeout=30.0)
|
|
200
|
+
subprocess.run(["git", "tag", f"v{version}"], cwd=REPO_ROOT, check=True, timeout=30.0)
|
|
201
201
|
print(f"✅ Git commit and tag v{version} created.")
|
|
202
202
|
|
|
203
203
|
if push:
|
|
204
204
|
print("🚀 Pushing commit and tags to remote origin...")
|
|
205
|
-
res = subprocess.run(["git", "branch", "--show-current"], cwd=REPO_ROOT, stdout=subprocess.PIPE, text=True)
|
|
205
|
+
res = subprocess.run(["git", "branch", "--show-current"], cwd=REPO_ROOT, stdout=subprocess.PIPE, text=True, timeout=30.0)
|
|
206
206
|
cur_branch = res.stdout.strip()
|
|
207
207
|
if cur_branch == "develop":
|
|
208
208
|
try:
|
|
209
|
-
subprocess.run(["git", "checkout", "main"], cwd=REPO_ROOT, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
210
|
-
subprocess.run(["git", "merge", "develop", "--ff-only"], cwd=REPO_ROOT, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
211
|
-
subprocess.run(["git", "checkout", "develop"], cwd=REPO_ROOT, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
212
|
-
subprocess.run(["git", "push", "origin", "develop", "main", "--tags"], cwd=REPO_ROOT, check=True)
|
|
209
|
+
subprocess.run(["git", "checkout", "main"], cwd=REPO_ROOT, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=30.0)
|
|
210
|
+
subprocess.run(["git", "merge", "develop", "--ff-only"], cwd=REPO_ROOT, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=30.0)
|
|
211
|
+
subprocess.run(["git", "checkout", "develop"], cwd=REPO_ROOT, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=30.0)
|
|
212
|
+
subprocess.run(["git", "push", "origin", "develop", "main", "--tags"], cwd=REPO_ROOT, check=True, timeout=60.0)
|
|
213
213
|
except Exception:
|
|
214
|
-
subprocess.run(["git", "push", "origin", "HEAD", "--tags"], cwd=REPO_ROOT, check=True)
|
|
214
|
+
subprocess.run(["git", "push", "origin", "HEAD", "--tags"], cwd=REPO_ROOT, check=True, timeout=60.0)
|
|
215
215
|
else:
|
|
216
|
-
subprocess.run(["git", "push", "origin", "HEAD", "--tags"], cwd=REPO_ROOT, check=True)
|
|
216
|
+
subprocess.run(["git", "push", "origin", "HEAD", "--tags"], cwd=REPO_ROOT, check=True, timeout=60.0)
|
|
217
217
|
print("✅ Remote origin synchronized.")
|
|
218
218
|
|
|
219
219
|
def main():
|
|
@@ -271,16 +271,17 @@ def main():
|
|
|
271
271
|
update_file("tools/mcp_excel_server.py", r'(SERVER_VERSION\s*=\s*")[^"]+(")', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
272
272
|
update_file("tools/mcp_excel_server.py", r'("serverInfo":\s*\{[^}]*"version":\s*")[^"]+(")', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
273
273
|
|
|
274
|
-
# 8. docs/ARCHITECTURE.md
|
|
274
|
+
# 8. docs/ARCHITECTURE.md & docs/ARCHITECTURE.en.md
|
|
275
275
|
update_file("docs/ARCHITECTURE.md", r'(>\s*\*\*Version:\*\*\s*`)[^`]+(`)', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
276
|
+
update_file("docs/ARCHITECTURE.en.md", r'(>\s*\*\*Version:\*\*\s*`)[^`]+(`)', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
276
277
|
|
|
277
278
|
# 9. README.md & README.en.md (Documentation headings and badges)
|
|
278
|
-
update_file("README.md", r'(Phiên bản Hub
|
|
279
|
-
update_file("README.md", r'(Hub Version:\*\*\s*`v)[^`]+(`)', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
279
|
+
update_file("README.md", r'(Phiên bản(?: Hub)?:\*\*\s*`v)[^`]+(`)', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
280
|
+
update_file("README.md", r'((?:Hub )?Version:\*\*\s*`v)[^`]+(`)', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
280
281
|
update_file("README.md", r'(Intelligence Core v)[^")\]]+', rf"\g<1>{new_ver}", args.dry_run)
|
|
281
282
|
update_file("README.md", r'(rev:\s*v)[0-9]+\.[0-9]+\.[0-9]+', rf"\g<1>{new_ver}", args.dry_run)
|
|
282
283
|
update_file("README.md", r'(Synapse Hub \(Core v)[0-9]+\.[0-9]+\.[0-9]+(\))', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
283
|
-
update_file("README.en.md", r'(Hub Version:\*\*\s*`v)[^`]+(`)', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
284
|
+
update_file("README.en.md", r'((?:Hub )?Version:\*\*\s*`v)[^`]+(`)', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
284
285
|
update_file("README.en.md", r'(Intelligence Core v)[^")\]]+', rf"\g<1>{new_ver}", args.dry_run)
|
|
285
286
|
update_file("README.en.md", r'(rev:\s*v)[0-9]+\.[0-9]+\.[0-9]+', rf"\g<1>{new_ver}", args.dry_run)
|
|
286
287
|
update_file("README.en.md", r'(Synapse Hub \(Core v)[0-9]+\.[0-9]+\.[0-9]+(\))', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|