synapse-hub 2.2.2 → 2.2.3
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/author-integrity-guard.md +9 -10
- package/.cursorrules +7 -8
- package/.windsurfrules +7 -8
- package/AGENTS.md +3 -3
- package/CLAUDE.md +4 -5
- package/README.md +28 -26
- package/package.json +1 -1
- package/skills_manifest.json +2 -2
- package/tools/author_integrity.py +10 -4
- package/tools/browser_helpers.js +2 -2
- package/tools/cache_resolver.py +16 -5
- package/tools/cli.py +1 -1
- package/tools/distill_log.py +19 -10
- package/tools/infer_linter.py +45 -15
- package/tools/mcp_excel_server.ps1 +1 -1
- package/tools/mcp_server.py +1 -1
- package/tools/micro_mutator.py +78 -7
- package/tools/repo_map.py +90 -56
- package/tools/setup_project.py +43 -13
- package/tools/verify_all.py +55 -47
package/tools/verify_all.py
CHANGED
|
@@ -237,43 +237,42 @@ def gate_2_path_portability(repo_root, mode="AUTO"):
|
|
|
237
237
|
|
|
238
238
|
|
|
239
239
|
def gate_3_clean_pom(repo_root, mode="AUTO"):
|
|
240
|
-
print("\n[GATE 3] Checking Clean POM & Flat Architecture in Scripts
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
240
|
+
print("\n[GATE 3] Checking Clean POM & Flat Architecture in Test Scripts...")
|
|
241
|
+
effective_mode = detect_repo_mode(repo_root) if mode == "AUTO" else mode
|
|
242
|
+
if effective_mode == "HUB":
|
|
243
|
+
print("[PASS] Hub Mode: Repository contains QA Hub assets; Clean POM applies to target test suites.")
|
|
244
|
+
return True
|
|
245
|
+
|
|
246
|
+
test_dirs = ["Scripts", "tests", "test", "e2e", "specs", "cypress"]
|
|
247
|
+
test_files = []
|
|
248
|
+
for td in test_dirs:
|
|
249
|
+
d = os.path.join(repo_root, td)
|
|
250
|
+
if os.path.isdir(d):
|
|
251
|
+
for ext in ("*.groovy", "*.ts", "*.js", "*.py", "*.java"):
|
|
252
|
+
test_files.extend(glob.glob(os.path.join(d, "**", ext), recursive=True))
|
|
253
|
+
|
|
254
|
+
if not test_files:
|
|
255
|
+
print("[SKIP] No test scripts present in candidate directories (Scripts/, tests/, e2e/).")
|
|
256
|
+
return True
|
|
255
257
|
|
|
256
258
|
violations = []
|
|
257
|
-
for
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
violations.append((rel_path, line_no, "Raw XPath"))
|
|
272
|
-
except Exception:
|
|
273
|
-
pass
|
|
259
|
+
for full_path in sorted(set(test_files)):
|
|
260
|
+
rel_path = os.path.relpath(full_path, repo_root)
|
|
261
|
+
try:
|
|
262
|
+
with open(full_path, "r", encoding="utf-8", errors="ignore") as fp:
|
|
263
|
+
for line_no, line in enumerate(fp, 1):
|
|
264
|
+
stripped = line.strip()
|
|
265
|
+
if stripped.startswith("//") or stripped.startswith("/*") or stripped.startswith("#"):
|
|
266
|
+
continue
|
|
267
|
+
if "findTestObject" in line:
|
|
268
|
+
violations.append((rel_path, line_no, "Raw findTestObject"))
|
|
269
|
+
if "//" in line and ("//table" in line or "//input" in line or "//button" in line):
|
|
270
|
+
violations.append((rel_path, line_no, "Raw XPath"))
|
|
271
|
+
except Exception:
|
|
272
|
+
pass
|
|
274
273
|
|
|
275
274
|
if violations:
|
|
276
|
-
print(f"[FAIL] {len(violations)} Clean POM violations in
|
|
275
|
+
print(f"[FAIL] {len(violations)} Clean POM violations in test scripts:")
|
|
277
276
|
for rel_path, line_no, reason in violations:
|
|
278
277
|
print(f" - {rel_path}:{line_no} ({reason})")
|
|
279
278
|
return False
|
|
@@ -404,26 +403,35 @@ def gate_6_credential_security(repo_root, mode="AUTO"):
|
|
|
404
403
|
|
|
405
404
|
def gate_7_infer_linter(repo_root, mode="AUTO"):
|
|
406
405
|
print("\n[GATE 7] Running Meta Infer-Style Static Defect & Fake-Pass Sentinel...")
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
406
|
+
effective_mode = detect_repo_mode(repo_root) if mode == "AUTO" else mode
|
|
407
|
+
if effective_mode == "HUB":
|
|
408
|
+
print("[PASS] Hub Mode: Static Defect Sentinel active for target projects.")
|
|
409
|
+
return True
|
|
410
|
+
|
|
411
|
+
test_dirs = ["Scripts", "tests", "test", "e2e", "specs", "cypress"]
|
|
412
|
+
has_tests = False
|
|
413
|
+
target_scan_dir = None
|
|
414
|
+
for td in test_dirs:
|
|
415
|
+
d = os.path.join(repo_root, td)
|
|
416
|
+
if os.path.isdir(d):
|
|
417
|
+
for ext in ("*.groovy", "*.ts", "*.js", "*.py", "*.java"):
|
|
418
|
+
if glob.glob(os.path.join(d, "**", ext), recursive=True):
|
|
419
|
+
has_tests = True
|
|
420
|
+
target_scan_dir = d
|
|
421
|
+
break
|
|
422
|
+
if has_tests:
|
|
423
|
+
break
|
|
424
|
+
|
|
425
|
+
if not has_tests:
|
|
426
|
+
print("[SKIP] No test scripts (Groovy/TS/JS/Py) present in candidate test directories.")
|
|
427
|
+
return True
|
|
420
428
|
|
|
421
429
|
infer_script = os.path.join(SCRIPT_DIR, "infer_linter.py")
|
|
422
430
|
if not os.path.exists(infer_script):
|
|
423
431
|
infer_script = os.path.join(repo_root, "tools", "infer_linter.py")
|
|
424
432
|
|
|
425
433
|
if os.path.exists(infer_script):
|
|
426
|
-
res = subprocess.run([sys.executable, infer_script, "--dir",
|
|
434
|
+
res = subprocess.run([sys.executable, infer_script, "--dir", target_scan_dir], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
427
435
|
if res.returncode != 0:
|
|
428
436
|
print("[FAIL] Static Defect Sentinel detected critical issues in test scripts:")
|
|
429
437
|
print(res.stdout)
|