@teevee98/synapse-hub 4.1.0 → 4.1.2
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/systematic-debugging.md +1 -0
- package/AGENTS.md +2 -1
- package/README.en.md +4 -4
- package/README.md +4 -4
- package/agentskills.json +1 -1
- package/docs/ARCHITECTURE.en.md +2 -2
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/CONTRIBUTING.en.md +1 -1
- package/docs/CONTRIBUTING.md +1 -1
- package/docs/TOOL_CATALOG.md +14 -4
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills_manifest.json +1 -1
- package/synapse.config.json +1 -1
- package/tools/.infer_baseline.json +773 -5
- package/tools/TOOL_CATALOG.json +156 -6
- package/tools/__init__.py +1 -1
- package/tools/benchmark_swarm_context.py +6 -3
- package/tools/browser_helpers.js +2 -2
- package/tools/check_version_sync.py +1 -1
- package/tools/cli.py +3 -3
- package/tools/core/file_lock.py +1 -1
- package/tools/core/token_estimator.py +120 -6
- package/tools/dashboard_generator.py +6 -6
- package/tools/distill_log.py +74 -23
- package/tools/infer_linter.py +6 -5
- package/tools/mcp_docx_server.py +1 -1
- package/tools/mcp_excel_server.py +1 -1
- package/tools/mcp_server.py +1 -1
- package/tools/pentest_scope_guard.py +1 -1
- package/tools/perf/benchmark_perf_runner.py +4 -5
- package/tools/rules_router.py +67 -25
- package/tools/token_telemetry.py +1 -1
- package/tools/ui_server.py +1 -1
- package/tools/update_sentinel.py +3 -3
- package/tools/welcome_page.py +1 -1
package/tools/TOOL_CATALOG.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "1.0.0",
|
|
3
|
-
"updated_at": "2026-11-
|
|
4
|
-
"total_tools":
|
|
5
|
-
"stable_count":
|
|
3
|
+
"updated_at": "2026-11-13T16:17:55.180336+00:00",
|
|
4
|
+
"total_tools": 121,
|
|
5
|
+
"stable_count": 121,
|
|
6
6
|
"experimental_count": 0,
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -100,6 +100,21 @@
|
|
|
100
100
|
],
|
|
101
101
|
"description": "Enterprise Autonomous API Fuzzing & Chaos Breaker"
|
|
102
102
|
},
|
|
103
|
+
{
|
|
104
|
+
"file": "tools/ast_cache.py",
|
|
105
|
+
"command": "python tools/ast_cache.py",
|
|
106
|
+
"category": "Auxiliary Utilities",
|
|
107
|
+
"owner_role": "orchestrator",
|
|
108
|
+
"status": "stable",
|
|
109
|
+
"risk_level": "read_only",
|
|
110
|
+
"inputs": [
|
|
111
|
+
"CLI options"
|
|
112
|
+
],
|
|
113
|
+
"outputs": [
|
|
114
|
+
"Artifacts / Telemetry"
|
|
115
|
+
],
|
|
116
|
+
"description": "tools/ast_cache.py — AST Dataflow Pre-Validation Cache (Boost B3)"
|
|
117
|
+
},
|
|
103
118
|
{
|
|
104
119
|
"file": "tools/author_integrity.py",
|
|
105
120
|
"command": "python tools/author_integrity.py",
|
|
@@ -113,7 +128,7 @@
|
|
|
113
128
|
"outputs": [
|
|
114
129
|
"Artifacts / Telemetry"
|
|
115
130
|
],
|
|
116
|
-
"description": "tools/author_integrity.py — Author Attribution &
|
|
131
|
+
"description": "tools/author_integrity.py — Author Attribution & Repository Provenance Guard"
|
|
117
132
|
},
|
|
118
133
|
{
|
|
119
134
|
"file": "tools/auto_heal.py",
|
|
@@ -210,6 +225,21 @@
|
|
|
210
225
|
],
|
|
211
226
|
"description": "Auto-Bug Reporter & Root Cause Analysis (RCA) Ticket Generator"
|
|
212
227
|
},
|
|
228
|
+
{
|
|
229
|
+
"file": "tools/build_consolidated_report.py",
|
|
230
|
+
"command": "python tools/build_consolidated_report.py",
|
|
231
|
+
"category": "Auxiliary Utilities",
|
|
232
|
+
"owner_role": "orchestrator",
|
|
233
|
+
"status": "stable",
|
|
234
|
+
"risk_level": "read_only",
|
|
235
|
+
"inputs": [
|
|
236
|
+
"CLI options"
|
|
237
|
+
],
|
|
238
|
+
"outputs": [
|
|
239
|
+
"Artifacts / Telemetry"
|
|
240
|
+
],
|
|
241
|
+
"description": "tools/build_consolidated_report.py — Generate Unified Top 20 Skills & Agents Evaluation Report"
|
|
242
|
+
},
|
|
213
243
|
{
|
|
214
244
|
"file": "tools/bump_version.py",
|
|
215
245
|
"command": "python tools/bump_version.py",
|
|
@@ -405,6 +435,21 @@
|
|
|
405
435
|
],
|
|
406
436
|
"description": "tools/debt_harvester.py — Technical Debt & Shortcut Harvester"
|
|
407
437
|
},
|
|
438
|
+
{
|
|
439
|
+
"file": "tools/diagram_architect.py",
|
|
440
|
+
"command": "python tools/diagram_architect.py",
|
|
441
|
+
"category": "Auxiliary Utilities",
|
|
442
|
+
"owner_role": "orchestrator",
|
|
443
|
+
"status": "stable",
|
|
444
|
+
"risk_level": "read_only",
|
|
445
|
+
"inputs": [
|
|
446
|
+
"CLI options"
|
|
447
|
+
],
|
|
448
|
+
"outputs": [
|
|
449
|
+
"Artifacts / Telemetry"
|
|
450
|
+
],
|
|
451
|
+
"description": "tools/diagram_architect.py — Standalone Self-Contained SVG & HTML Diagram Builder"
|
|
452
|
+
},
|
|
408
453
|
{
|
|
409
454
|
"file": "tools/distill_log.py",
|
|
410
455
|
"command": "python tools/distill_log.py",
|
|
@@ -418,7 +463,7 @@
|
|
|
418
463
|
"outputs": [
|
|
419
464
|
"Artifacts / Telemetry"
|
|
420
465
|
],
|
|
421
|
-
"description": "tools/distill_log.py —
|
|
466
|
+
"description": "tools/distill_log.py — Enterprise Multi-Framework Log Distiller (Token & Failure Sentinel)"
|
|
422
467
|
},
|
|
423
468
|
{
|
|
424
469
|
"file": "tools/dspy_qa_signatures.py",
|
|
@@ -678,6 +723,21 @@
|
|
|
678
723
|
],
|
|
679
724
|
"description": "Enterprise Git Pre-Commit Architecture & Discipline Guard"
|
|
680
725
|
},
|
|
726
|
+
{
|
|
727
|
+
"file": "tools/git_worktree_manager.py",
|
|
728
|
+
"command": "python tools/git_worktree_manager.py",
|
|
729
|
+
"category": "Auxiliary Utilities",
|
|
730
|
+
"owner_role": "orchestrator",
|
|
731
|
+
"status": "stable",
|
|
732
|
+
"risk_level": "read_only",
|
|
733
|
+
"inputs": [
|
|
734
|
+
"CLI options"
|
|
735
|
+
],
|
|
736
|
+
"outputs": [
|
|
737
|
+
"Artifacts / Telemetry"
|
|
738
|
+
],
|
|
739
|
+
"description": "tools/git_worktree_manager.py — Ephemeral Git Worktree Manager for Subagents"
|
|
740
|
+
},
|
|
681
741
|
{
|
|
682
742
|
"file": "tools/goldfish_review.py",
|
|
683
743
|
"command": "python tools/goldfish_review.py",
|
|
@@ -964,6 +1024,21 @@
|
|
|
964
1024
|
],
|
|
965
1025
|
"description": "Markdown to Excel (.xlsx) Enterprise Converter"
|
|
966
1026
|
},
|
|
1027
|
+
{
|
|
1028
|
+
"file": "tools/mechanical_ui_gate.py",
|
|
1029
|
+
"command": "python tools/mechanical_ui_gate.py",
|
|
1030
|
+
"category": "Auxiliary Utilities",
|
|
1031
|
+
"owner_role": "orchestrator",
|
|
1032
|
+
"status": "stable",
|
|
1033
|
+
"risk_level": "read_only",
|
|
1034
|
+
"inputs": [
|
|
1035
|
+
"CLI options"
|
|
1036
|
+
],
|
|
1037
|
+
"outputs": [
|
|
1038
|
+
"Artifacts / Telemetry"
|
|
1039
|
+
],
|
|
1040
|
+
"description": "tools/mechanical_ui_gate.py — Headless Chrome Mechanical Layout & Contrast Gate"
|
|
1041
|
+
},
|
|
967
1042
|
{
|
|
968
1043
|
"file": "tools/micro_mutator.py",
|
|
969
1044
|
"command": "python tools/micro_mutator.py",
|
|
@@ -1120,7 +1195,7 @@
|
|
|
1120
1195
|
"category": "CI/CD & Packaging",
|
|
1121
1196
|
"owner_role": "orchestrator",
|
|
1122
1197
|
"status": "stable",
|
|
1123
|
-
"risk_level": "
|
|
1198
|
+
"risk_level": "read_only",
|
|
1124
1199
|
"inputs": [
|
|
1125
1200
|
"--output-dir",
|
|
1126
1201
|
"--format zip|tar.gz|both",
|
|
@@ -1132,6 +1207,36 @@
|
|
|
1132
1207
|
],
|
|
1133
1208
|
"description": "Enterprise release packager preserving .github/workflows and generating SHA-256 provenance."
|
|
1134
1209
|
},
|
|
1210
|
+
{
|
|
1211
|
+
"file": "tools/pairwise_generator.py",
|
|
1212
|
+
"command": "python tools/pairwise_generator.py",
|
|
1213
|
+
"category": "Auxiliary Utilities",
|
|
1214
|
+
"owner_role": "orchestrator",
|
|
1215
|
+
"status": "stable",
|
|
1216
|
+
"risk_level": "read_only",
|
|
1217
|
+
"inputs": [
|
|
1218
|
+
"CLI options"
|
|
1219
|
+
],
|
|
1220
|
+
"outputs": [
|
|
1221
|
+
"Artifacts / Telemetry"
|
|
1222
|
+
],
|
|
1223
|
+
"description": "tools/pairwise_generator.py — Pairwise (2-Way) Combinatorial Test Case Generator"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
"file": "tools/pentest_scope_guard.py",
|
|
1227
|
+
"command": "python tools/pentest_scope_guard.py",
|
|
1228
|
+
"category": "Testing & Utilities",
|
|
1229
|
+
"owner_role": "orchestrator",
|
|
1230
|
+
"status": "stable",
|
|
1231
|
+
"risk_level": "read_only",
|
|
1232
|
+
"inputs": [
|
|
1233
|
+
"CLI options"
|
|
1234
|
+
],
|
|
1235
|
+
"outputs": [
|
|
1236
|
+
"Artifacts / Telemetry"
|
|
1237
|
+
],
|
|
1238
|
+
"description": "tools/pentest_scope_guard.py — Enterprise Pentest Scope & DAST Runtime Guard"
|
|
1239
|
+
},
|
|
1135
1240
|
{
|
|
1136
1241
|
"file": "tools/pinpoint_failure.py",
|
|
1137
1242
|
"command": "python tools/pinpoint_failure.py",
|
|
@@ -1209,6 +1314,36 @@
|
|
|
1209
1314
|
],
|
|
1210
1315
|
"description": "Reversible Execution Sandbox & Automated Teardown Engine (GoEx Pattern)"
|
|
1211
1316
|
},
|
|
1317
|
+
{
|
|
1318
|
+
"file": "tools/rules_router.py",
|
|
1319
|
+
"command": "python tools/rules_router.py",
|
|
1320
|
+
"category": "Auxiliary Utilities",
|
|
1321
|
+
"owner_role": "orchestrator",
|
|
1322
|
+
"status": "stable",
|
|
1323
|
+
"risk_level": "read_only",
|
|
1324
|
+
"inputs": [
|
|
1325
|
+
"CLI options"
|
|
1326
|
+
],
|
|
1327
|
+
"outputs": [
|
|
1328
|
+
"Artifacts / Telemetry"
|
|
1329
|
+
],
|
|
1330
|
+
"description": "tools/rules_router.py — Progressive Rules Router & Context Optimizer (Boost B2)"
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
"file": "tools/runaway_stopper.py",
|
|
1334
|
+
"command": "python tools/runaway_stopper.py",
|
|
1335
|
+
"category": "Auxiliary Utilities",
|
|
1336
|
+
"owner_role": "orchestrator",
|
|
1337
|
+
"status": "stable",
|
|
1338
|
+
"risk_level": "read_only",
|
|
1339
|
+
"inputs": [
|
|
1340
|
+
"CLI options"
|
|
1341
|
+
],
|
|
1342
|
+
"outputs": [
|
|
1343
|
+
"Artifacts / Telemetry"
|
|
1344
|
+
],
|
|
1345
|
+
"description": "tools/runaway_stopper.py — Agent Runaway & Token Loop Sentinel"
|
|
1346
|
+
},
|
|
1212
1347
|
{
|
|
1213
1348
|
"file": "tools/safety_firewall.py",
|
|
1214
1349
|
"command": "python tools/safety_firewall.py",
|
|
@@ -1546,6 +1681,21 @@
|
|
|
1546
1681
|
],
|
|
1547
1682
|
"description": "Enterprise ALM & TMS Sync Bridge (Jira / Xray / Zephyr / TestRail)"
|
|
1548
1683
|
},
|
|
1684
|
+
{
|
|
1685
|
+
"file": "tools/token_telemetry.py",
|
|
1686
|
+
"command": "python tools/token_telemetry.py",
|
|
1687
|
+
"category": "Auxiliary Utilities",
|
|
1688
|
+
"owner_role": "orchestrator",
|
|
1689
|
+
"status": "stable",
|
|
1690
|
+
"risk_level": "read_only",
|
|
1691
|
+
"inputs": [
|
|
1692
|
+
"CLI options"
|
|
1693
|
+
],
|
|
1694
|
+
"outputs": [
|
|
1695
|
+
"Artifacts / Telemetry"
|
|
1696
|
+
],
|
|
1697
|
+
"description": "tools/token_telemetry.py — Live LLM Token & MTTR Telemetry Engine"
|
|
1698
|
+
},
|
|
1549
1699
|
{
|
|
1550
1700
|
"file": "tools/tot_exploratory_tester.py",
|
|
1551
1701
|
"command": "python tools/tot_exploratory_tester.py",
|
package/tools/__init__.py
CHANGED
|
@@ -36,10 +36,10 @@ REPO_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
|
|
36
36
|
|
|
37
37
|
# Import core token estimator
|
|
38
38
|
try:
|
|
39
|
-
from tools.core.token_estimator import count_tokens
|
|
39
|
+
from tools.core.token_estimator import count_tokens
|
|
40
40
|
except ImportError:
|
|
41
41
|
try:
|
|
42
|
-
from core.token_estimator import count_tokens
|
|
42
|
+
from core.token_estimator import count_tokens
|
|
43
43
|
except ImportError:
|
|
44
44
|
def count_tokens(text: str, model_hint: str = "cl100k") -> int:
|
|
45
45
|
if not text:
|
|
@@ -414,7 +414,10 @@ def format_markdown_report(bench: Dict[str, Any]) -> str:
|
|
|
414
414
|
"",
|
|
415
415
|
"## Track 2: Empirical Reference Suites Benchmark (Real Projects)",
|
|
416
416
|
"",
|
|
417
|
-
"
|
|
417
|
+
"> *Methodology: Dynamically enumerates all 13 rules and 53 skills in repository without static per-skill multiplier assumptions.*",
|
|
418
|
+
"> *Disclosure: 'Avoided Disk Read' measures disk file bytes not read from storage, distinguished from prompt context tokens.*",
|
|
419
|
+
"",
|
|
420
|
+
"| Reference Project | Detected Stack | Confidence | Catalog Summary Saved | Full Hydration Saved | Avoided Disk Read (I/O) |",
|
|
418
421
|
"|---|---|:---:|:---:|:---:|:---:|",
|
|
419
422
|
])
|
|
420
423
|
for p in emp["results"]:
|
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 === '4.1.
|
|
16
|
+
if (window.__qa && window.__qa.__version === '4.1.2') {
|
|
17
17
|
return window.__qa;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const qa = {
|
|
50
|
-
__version: '4.1.
|
|
50
|
+
__version: '4.1.2',
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* 1. Smart Action Batching
|
|
@@ -263,7 +263,7 @@ def validate_lockfile_integrity(repo_root: str) -> Tuple[bool, str]:
|
|
|
263
263
|
except Exception as e:
|
|
264
264
|
return False, f"Failed to sync .skill-lock.json: {e}"
|
|
265
265
|
|
|
266
|
-
return True,
|
|
266
|
+
return True, "53/53 skills verified with valid paths & SHA-256 hashes (auto-synced .skill-lock.json)"
|
|
267
267
|
|
|
268
268
|
|
|
269
269
|
def main() -> int:
|
package/tools/cli.py
CHANGED
|
@@ -99,7 +99,7 @@ def cmd_set_lang(args):
|
|
|
99
99
|
def cmd_version(args):
|
|
100
100
|
"""Displays the current hub version, skill catalog count, and license information."""
|
|
101
101
|
manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
|
|
102
|
-
version = "4.1.
|
|
102
|
+
version = "4.1.2"
|
|
103
103
|
if os.path.exists(manifest_path):
|
|
104
104
|
try:
|
|
105
105
|
import json
|
|
@@ -686,14 +686,14 @@ def cmd_trend(args):
|
|
|
686
686
|
|
|
687
687
|
def _hub_version():
|
|
688
688
|
manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
|
|
689
|
-
version = "4.1.
|
|
689
|
+
version = "4.1.2"
|
|
690
690
|
if os.path.exists(manifest_path):
|
|
691
691
|
try:
|
|
692
692
|
import json
|
|
693
693
|
with open(manifest_path, "r", encoding="utf-8") as f:
|
|
694
694
|
version = json.load(f).get("version", version)
|
|
695
695
|
except (OSError, json.JSONDecodeError):
|
|
696
|
-
version = "4.1.
|
|
696
|
+
version = "4.1.2"
|
|
697
697
|
return version
|
|
698
698
|
|
|
699
699
|
|
package/tools/core/file_lock.py
CHANGED
|
@@ -219,7 +219,7 @@ class FileLock:
|
|
|
219
219
|
_ = err
|
|
220
220
|
os.lseek(self._fd, 0, os.SEEK_SET)
|
|
221
221
|
_win32_lock(self._fd, shared=self.shared)
|
|
222
|
-
|
|
222
|
+
|
|
223
223
|
# Write PID into lock file metadata for stale lock tracking if exclusive
|
|
224
224
|
if not self.shared and self._fd is not None:
|
|
225
225
|
try:
|
|
@@ -16,13 +16,15 @@ Key Capabilities:
|
|
|
16
16
|
- Non-ASCII / Vietnamese diacritics / Unicode: ~1.8 characters/token.
|
|
17
17
|
2. Optional native BPE tokenization if tiktoken is available in runtime.
|
|
18
18
|
3. Structured token breakdown (Rules, Catalog Metadata, Full Skill Bodies, System Prefix).
|
|
19
|
+
4. Real dynamic baseline calculation enumerating 100% of skills & rules without static estimates.
|
|
19
20
|
"""
|
|
20
21
|
|
|
21
22
|
from __future__ import annotations
|
|
22
23
|
|
|
24
|
+
import glob
|
|
25
|
+
import json
|
|
23
26
|
import os
|
|
24
27
|
import re
|
|
25
|
-
import sys
|
|
26
28
|
from typing import Any, Dict, List, Optional
|
|
27
29
|
|
|
28
30
|
# Attempt native BPE import if available
|
|
@@ -37,6 +39,21 @@ try:
|
|
|
37
39
|
except ImportError:
|
|
38
40
|
_TIKTOKEN_ENCODER = None
|
|
39
41
|
|
|
42
|
+
_SKILLS_MANIFEST_CACHE: Optional[Dict[str, Dict[str, Any]]] = None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def get_estimator_info() -> Dict[str, Any]:
|
|
46
|
+
"""Returns active tokenizer engine metadata, exactness status, and model hint."""
|
|
47
|
+
return {
|
|
48
|
+
"engine": "cl100k_base" if _TIKTOKEN_ENCODER is not None else "heuristic_polyglot",
|
|
49
|
+
"is_exact": _TIKTOKEN_ENCODER is not None,
|
|
50
|
+
"encoding": "cl100k_base",
|
|
51
|
+
"calibrated_ratios": {
|
|
52
|
+
"ascii_chars_per_token": 3.85,
|
|
53
|
+
"non_ascii_chars_per_token": 1.80,
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
40
57
|
|
|
41
58
|
def count_tokens(text: str, model_hint: str = "cl100k") -> int:
|
|
42
59
|
"""
|
|
@@ -82,6 +99,38 @@ def count_file_tokens(file_path: str) -> int:
|
|
|
82
99
|
return 0
|
|
83
100
|
|
|
84
101
|
|
|
102
|
+
def _get_skills_manifest(repo_root: str) -> Dict[str, Dict[str, Any]]:
|
|
103
|
+
"""Loads and caches skills_manifest.json mapping skill_id to metadata."""
|
|
104
|
+
global _SKILLS_MANIFEST_CACHE
|
|
105
|
+
if _SKILLS_MANIFEST_CACHE is not None:
|
|
106
|
+
return _SKILLS_MANIFEST_CACHE
|
|
107
|
+
|
|
108
|
+
manifest_path = os.path.join(repo_root, "skills_manifest.json")
|
|
109
|
+
_SKILLS_MANIFEST_CACHE = {}
|
|
110
|
+
if os.path.isfile(manifest_path):
|
|
111
|
+
try:
|
|
112
|
+
with open(manifest_path, "r", encoding="utf-8") as f:
|
|
113
|
+
data = json.load(f)
|
|
114
|
+
for s in data.get("skills", []):
|
|
115
|
+
sid = s.get("id")
|
|
116
|
+
if sid:
|
|
117
|
+
_SKILLS_MANIFEST_CACHE[sid] = s
|
|
118
|
+
except (OSError, json.JSONDecodeError) as err:
|
|
119
|
+
_ = err
|
|
120
|
+
return _SKILLS_MANIFEST_CACHE
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def serialize_skill_summary(skill_name: str, meta: Optional[Dict[str, Any]] = None) -> str:
|
|
124
|
+
"""Formats a concise catalog summary line for a skill."""
|
|
125
|
+
if meta:
|
|
126
|
+
name = meta.get("name", skill_name)
|
|
127
|
+
domain = meta.get("domain", "")
|
|
128
|
+
desc = meta.get("description") or meta.get("summary", "")
|
|
129
|
+
domain_str = f" [{domain}]" if domain else ""
|
|
130
|
+
return f"- {name} ({skill_name}){domain_str}: {desc}"
|
|
131
|
+
return f"- {skill_name}: Enterprise QA Automation Skill"
|
|
132
|
+
|
|
133
|
+
|
|
85
134
|
def calculate_hydration_payload(
|
|
86
135
|
repo_root: str,
|
|
87
136
|
rules: List[str],
|
|
@@ -89,11 +138,12 @@ def calculate_hydration_payload(
|
|
|
89
138
|
) -> Dict[str, Any]:
|
|
90
139
|
"""
|
|
91
140
|
Computes precise dual-tier token metrics for a set of selected rules and skills:
|
|
92
|
-
1. summary: Catalog metadata only (name +
|
|
141
|
+
1. summary: Catalog metadata only (serialized name + domain + description).
|
|
93
142
|
2. full: Complete SKILL.md body hydrated into context.
|
|
94
143
|
"""
|
|
95
144
|
rules_dir = os.path.join(repo_root, ".agents", "rules")
|
|
96
145
|
skills_root = os.path.join(repo_root, ".agents", "skills")
|
|
146
|
+
manifest = _get_skills_manifest(repo_root)
|
|
97
147
|
|
|
98
148
|
rule_tokens = 0
|
|
99
149
|
rule_bytes = 0
|
|
@@ -106,12 +156,15 @@ def calculate_hydration_payload(
|
|
|
106
156
|
rule_tokens += 500 # Default estimate for virtual rule
|
|
107
157
|
rule_bytes += 2000
|
|
108
158
|
|
|
109
|
-
|
|
159
|
+
catalog_lines = []
|
|
110
160
|
full_skill_tokens = 0
|
|
111
161
|
full_skill_bytes = 0
|
|
112
162
|
|
|
113
163
|
# Locate each skill directory in .agents/skills
|
|
114
164
|
for skill_name in skills:
|
|
165
|
+
meta = manifest.get(skill_name)
|
|
166
|
+
catalog_lines.append(serialize_skill_summary(skill_name, meta))
|
|
167
|
+
|
|
115
168
|
skill_file = _find_skill_file(skills_root, skill_name)
|
|
116
169
|
if skill_file and os.path.isfile(skill_file):
|
|
117
170
|
tokens = count_file_tokens(skill_file)
|
|
@@ -119,9 +172,11 @@ def calculate_hydration_payload(
|
|
|
119
172
|
full_skill_tokens += tokens
|
|
120
173
|
full_skill_bytes += size
|
|
121
174
|
else:
|
|
122
|
-
# Fallback average skill size
|
|
123
|
-
full_skill_tokens +=
|
|
124
|
-
full_skill_bytes +=
|
|
175
|
+
# Fallback average skill size if file missing
|
|
176
|
+
full_skill_tokens += 1200
|
|
177
|
+
full_skill_bytes += 4500
|
|
178
|
+
|
|
179
|
+
catalog_skill_tokens = count_tokens("\n".join(catalog_lines)) if catalog_lines else 0
|
|
125
180
|
|
|
126
181
|
return {
|
|
127
182
|
"rule_tokens": rule_tokens,
|
|
@@ -135,6 +190,65 @@ def calculate_hydration_payload(
|
|
|
135
190
|
}
|
|
136
191
|
|
|
137
192
|
|
|
193
|
+
def get_full_unrouted_baseline(repo_root: str) -> Dict[str, Any]:
|
|
194
|
+
"""
|
|
195
|
+
Enumerates and calculates actual token and byte counts for 100% of all rules in .agents/rules
|
|
196
|
+
and 100% of all skills in .agents/skills.
|
|
197
|
+
Guarantees zero static assumptions (replaces 53 * 1800 and 53 * 120 with exact file token counts).
|
|
198
|
+
"""
|
|
199
|
+
rules_dir = os.path.join(repo_root, ".agents", "rules")
|
|
200
|
+
skills_root = os.path.join(repo_root, ".agents", "skills")
|
|
201
|
+
manifest = _get_skills_manifest(repo_root)
|
|
202
|
+
|
|
203
|
+
# 1. Enumerate all rule files
|
|
204
|
+
all_rule_files: List[str] = []
|
|
205
|
+
if os.path.isdir(rules_dir):
|
|
206
|
+
all_rule_files = sorted([f for f in os.listdir(rules_dir) if f.endswith(".md")])
|
|
207
|
+
|
|
208
|
+
total_rule_tokens = 0
|
|
209
|
+
total_rule_bytes = 0
|
|
210
|
+
for rf in all_rule_files:
|
|
211
|
+
p = os.path.join(rules_dir, rf)
|
|
212
|
+
total_rule_tokens += count_file_tokens(p)
|
|
213
|
+
total_rule_bytes += os.path.getsize(p)
|
|
214
|
+
|
|
215
|
+
# 2. Enumerate all 53 SKILL.md files
|
|
216
|
+
skill_files = sorted(glob.glob(os.path.join(skills_root, "*", "*", "SKILL.md")))
|
|
217
|
+
total_skill_tokens = 0
|
|
218
|
+
total_skill_bytes = 0
|
|
219
|
+
all_skill_ids: List[str] = []
|
|
220
|
+
|
|
221
|
+
for sf in skill_files:
|
|
222
|
+
total_skill_tokens += count_file_tokens(sf)
|
|
223
|
+
total_skill_bytes += os.path.getsize(sf)
|
|
224
|
+
skill_id = os.path.basename(os.path.dirname(sf))
|
|
225
|
+
all_skill_ids.append(skill_id)
|
|
226
|
+
|
|
227
|
+
# 3. Dynamic Catalog Summary tokens across all skills
|
|
228
|
+
catalog_lines = []
|
|
229
|
+
for sid in all_skill_ids:
|
|
230
|
+
meta = manifest.get(sid)
|
|
231
|
+
catalog_lines.append(serialize_skill_summary(sid, meta))
|
|
232
|
+
|
|
233
|
+
total_cat_tokens = count_tokens("\n".join(catalog_lines)) if catalog_lines else 0
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
"rule_count": len(all_rule_files),
|
|
237
|
+
"rule_tokens": total_rule_tokens,
|
|
238
|
+
"rule_bytes": total_rule_bytes,
|
|
239
|
+
"skill_count": len(skill_files),
|
|
240
|
+
"skill_full_body_tokens": total_skill_tokens,
|
|
241
|
+
"skill_full_bytes": total_skill_bytes,
|
|
242
|
+
"skill_catalog_tokens": total_cat_tokens,
|
|
243
|
+
"total_summary_baseline": total_rule_tokens + total_cat_tokens,
|
|
244
|
+
"total_full_baseline": total_rule_tokens + total_skill_tokens,
|
|
245
|
+
"total_full_bytes": total_rule_bytes + total_skill_bytes,
|
|
246
|
+
"all_rules": all_rule_files,
|
|
247
|
+
"all_skills": all_skill_ids,
|
|
248
|
+
"estimator_info": get_estimator_info(),
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
|
|
138
252
|
def _find_skill_file(skills_root: str, skill_name: str) -> Optional[str]:
|
|
139
253
|
"""Finds SKILL.md for a given skill name across tiered category folders."""
|
|
140
254
|
if not os.path.isdir(skills_root):
|
|
@@ -1348,7 +1348,7 @@ def _build_target_translations(
|
|
|
1348
1348
|
"th_step_status": "Trạng Thái",
|
|
1349
1349
|
"th_step_details": "Chi Tiết Kỹ Thuật (OTel & AST)",
|
|
1350
1350
|
|
|
1351
|
-
"footer_text": "Báo cáo được khởi tạo tự động bởi Synapse-Hub v4.1.
|
|
1351
|
+
"footer_text": "Báo cáo được khởi tạo tự động bởi Synapse-Hub v4.1.2 • Bản quyền © Thế Vị (@TeeVee98) • Chuẩn Clean POM & Kiểm Thử Tự Chủ",
|
|
1352
1352
|
}
|
|
1353
1353
|
|
|
1354
1354
|
translations_en = {
|
|
@@ -1426,7 +1426,7 @@ def _build_target_translations(
|
|
|
1426
1426
|
"th_step_status": "Status",
|
|
1427
1427
|
"th_step_details": "Technical Details (OTel & AST)",
|
|
1428
1428
|
|
|
1429
|
-
"footer_text": "Generated automatically by Synapse-Hub v4.1.
|
|
1429
|
+
"footer_text": "Generated automatically by Synapse-Hub v4.1.2 • Copyright © Thế Vị (@TeeVee98) • Clean POM & Autonomous Testing",
|
|
1430
1430
|
}
|
|
1431
1431
|
|
|
1432
1432
|
_inject_gate_translations(translations_vi, translations_en, gates)
|
|
@@ -1915,7 +1915,7 @@ def _build_hub_translations(
|
|
|
1915
1915
|
"""Builds bilingual dictionaries for Hub Dashboard."""
|
|
1916
1916
|
translations_vi = {
|
|
1917
1917
|
"header_title": "Bảng Điều Hành Chất Lượng Doanh Nghiệp",
|
|
1918
|
-
"header_subtitle": "Synapse-Hub v4.1.
|
|
1918
|
+
"header_subtitle": "Synapse-Hub v4.1.2 • Hệ Sinh Thái Kiểm Thử AI Agent Tự Chủ",
|
|
1919
1919
|
"nav_welcome": "Giới Thiệu",
|
|
1920
1920
|
"meta_mode": "🏷️ Chế độ: <strong>HỆ SINH THÁI QA HUB</strong>",
|
|
1921
1921
|
"meta_gen": f"🕒 Khởi tạo: <strong>{now_str}</strong>",
|
|
@@ -1985,12 +1985,12 @@ def _build_hub_translations(
|
|
|
1985
1985
|
"th_sk_ver": "Phiên Bản",
|
|
1986
1986
|
"th_sk_cap": "Khả Năng Nghiệp Vụ Cốt Lõi",
|
|
1987
1987
|
|
|
1988
|
-
"footer_text": "Bảng Điều Hành Chất Lượng Doanh Nghiệp • Synapse-Hub v4.1.
|
|
1988
|
+
"footer_text": "Bảng Điều Hành Chất Lượng Doanh Nghiệp • Synapse-Hub v4.1.2 • Bản quyền © Thế Vị (@TeeVee98) • Hệ Thống Kiểm Thử AI Agent Tự Chủ",
|
|
1989
1989
|
}
|
|
1990
1990
|
|
|
1991
1991
|
translations_en = {
|
|
1992
1992
|
"header_title": "Enterprise QA Executive Dashboard",
|
|
1993
|
-
"header_subtitle": "Synapse-Hub v4.1.
|
|
1993
|
+
"header_subtitle": "Synapse-Hub v4.1.2 • Autonomous AI Agent Testing Ecosystem",
|
|
1994
1994
|
"nav_welcome": "Welcome",
|
|
1995
1995
|
"meta_mode": "🏷️ Mode: <strong>QA HUB ECOSYSTEM</strong>",
|
|
1996
1996
|
"meta_gen": f"🕒 Generated: <strong>{now_str}</strong>",
|
|
@@ -2060,7 +2060,7 @@ def _build_hub_translations(
|
|
|
2060
2060
|
"th_sk_ver": "Version",
|
|
2061
2061
|
"th_sk_cap": "Core Capabilities",
|
|
2062
2062
|
|
|
2063
|
-
"footer_text": "Enterprise QA Executive Dashboard • Synapse-Hub v4.1.
|
|
2063
|
+
"footer_text": "Enterprise QA Executive Dashboard • Synapse-Hub v4.1.2 • Copyright © Thế Vị (@TeeVee98) • Autonomous AI Agent Testing Ecosystem",
|
|
2064
2064
|
}
|
|
2065
2065
|
|
|
2066
2066
|
_inject_gate_translations(translations_vi, translations_en, gates)
|