@teevee98/synapse-hub 4.1.4 → 4.2.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/git-push-protocol.md +2 -2
- package/.agents/skills/01-web-automation/auth-session-and-cookie-manager/SKILL.md +52 -3
- package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +55 -5
- package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +62 -67
- package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +54 -4
- package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +62 -12
- package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +55 -8
- package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +60 -12
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/BaseScreen.java +2 -2
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/LoginScreen.java +2 -2
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/TC_MobileLogin.java +2 -2
- package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +54 -91
- package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +59 -11
- package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +50 -4
- package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +55 -9
- package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +55 -9
- package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +55 -8
- package/.agents/skills/02-test-design/review-spec/SKILL.md +50 -6
- package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +50 -4
- package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +56 -5
- package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +53 -7
- package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +86 -36
- package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +54 -6
- package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +50 -6
- package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +50 -3
- package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +63 -14
- package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +51 -5
- package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +54 -4
- package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +51 -5
- package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +53 -6
- package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +54 -8
- package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +60 -24
- package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +52 -6
- package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +56 -10
- package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +58 -12
- package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +58 -12
- package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +53 -5
- package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +56 -5
- package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +53 -4
- package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +58 -5
- package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +57 -11
- package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +83 -34
- package/.agents/skills/08-code-quality/graphify-impact-analyzer/examples/dependency_blast_radius.json +3 -4
- package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +55 -10
- package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +49 -6
- package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +52 -7
- package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +55 -10
- package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +51 -5
- package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +54 -17
- package/.agents/skills/09-ci-and-devops/github-actions-templates/examples/matrix_test_pipeline.yml +2 -1
- package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +50 -4
- package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +53 -7
- package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +50 -4
- package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +58 -13
- package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +51 -5
- package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +57 -10
- package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +50 -4
- package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +50 -4
- package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +55 -9
- package/.cursor/rules/synapse-qa.mdc +20 -7
- package/.cursorrules +19 -5
- package/.windsurfrules +18 -3
- package/AGENTS.md +51 -59
- package/CLAUDE.md +38 -24
- package/LICENSE +5 -5
- package/NOTICE +1 -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 +11 -2
- package/docs/CLIENT_SUPPORT_MATRIX.md +44 -0
- package/docs/CLI_REFERENCE.en.md +6 -4
- package/docs/CLI_REFERENCE.md +1 -1
- package/docs/CONTRIBUTING.en.md +1 -1
- package/docs/CONTRIBUTING.md +2 -2
- package/docs/SIDE_EFFECTING_TOOLS_INVENTORY.md +233 -0
- package/docs/TOOL_CATALOG.md +6 -2
- package/docs/research/agent_skill_training_analysis.md +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills_manifest.json +320 -55
- package/synapse.config.json +1 -1
- package/templates/ai_bridges/CLAUDE.md +29 -26
- package/templates/ai_bridges/copilot-instructions.md +14 -5
- package/templates/ai_bridges/cursor_synapse_qa.mdc +16 -7
- package/templates/ai_bridges/windsurfrules +14 -3
- package/templates/ui/index.html +2 -2
- package/tools/TOOLS_RUNBOOK.md +1 -1
- package/tools/TOOL_CATALOG.json +63 -3
- package/tools/__init__.py +1 -1
- package/tools/api_fuzzer.py +447 -132
- package/tools/author_integrity.py +121 -11
- package/tools/benchmark_swarm_context.py +130 -22
- package/tools/break_ui_generator.py +233 -0
- package/tools/browser_helpers.js +2 -2
- package/tools/check_version_sync.py +18 -50
- package/tools/cli.py +110 -19
- package/tools/core/bm25_retriever.py +218 -0
- package/tools/core/i18n.py +5 -5
- package/tools/core/provider_usage_adapter.py +383 -0
- package/tools/core/token_estimator.py +81 -15
- package/tools/count_tokens.py +7 -2
- package/tools/coverage_reporter.py +245 -0
- package/tools/dashboard_generator.py +8 -8
- package/tools/db_sandbox.py +290 -9
- package/tools/distill_log.py +1 -1
- package/tools/distill_skill.py +206 -0
- package/tools/git_pre_commit_guard.py +202 -1
- package/tools/humanize_linter.py +3 -0
- package/tools/mcp_docx_server.py +1 -1
- package/tools/mcp_excel_server.py +1 -1
- package/tools/mcp_server.py +104 -16
- package/tools/micro_mutator.py +114 -15
- package/tools/pentest_scope_guard.py +674 -58
- package/tools/perf/benchmark_perf_runner.py +42 -0
- package/tools/project_state.py +29 -5
- package/tools/reversible_sandbox.py +58 -13
- package/tools/rules_router.py +473 -60
- package/tools/security_scanner.py +80 -0
- package/tools/senior_code_review.py +14 -0
- package/tools/skill_canonical_digest.py +302 -0
- package/tools/skill_profiles.py +77 -7
- package/tools/slide_deck_exporter.py +477 -0
- package/tools/sync_agent_rules.py +187 -61
- package/tools/sync_skills_manifest.py +166 -0
- package/tools/task_memory_manager.py +275 -0
- package/tools/ui_server.py +3 -1
- package/tools/update_sentinel.py +3 -3
- package/tools/validate_host_interop.py +485 -0
- package/tools/validate_skills_schema.py +575 -0
- package/tools/verify_all.py +668 -44
- package/tools/welcome_page.py +2 -2
|
@@ -1,23 +1,53 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verification-before-completion
|
|
3
3
|
description: "Require fresh verification evidence — a command run in the current session with its real output — before any claim that work is complete, fixed, or passing. Use when about to report success, commit, open a PR, or close a task."
|
|
4
|
+
category: verification_and_resilience
|
|
5
|
+
version: "1.0.0"
|
|
6
|
+
policies:
|
|
7
|
+
network: none
|
|
8
|
+
shell: read-only
|
|
9
|
+
filesystem: read-only
|
|
4
10
|
---
|
|
5
|
-
|
|
6
11
|
# Verification Before Completion — Enterprise Evidence Protocol
|
|
7
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Require fresh verification evidence — a command run in the current session with its real output — before any claim that work is complete, fixed, or passing. Use when about to report success, commit, open a PR, or close a task.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `06-healing-and-resilience` involving `verification-before-completion`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT declare any task complete without running fresh verification commands.
|
|
28
|
+
- Do NOT accept claims of correctness without terminal execution output and exit code 0.
|
|
29
|
+
- Do NOT relax assertions or disable test cases to achieve passing status.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- antigravity-test-sentinel enforces gate locks; verification-before-completion establishes the evidence-based Claim -> Evidence verification matrix.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
8
37
|
Specialized skill for the evidence discipline behind every success claim in the hub: no completion statement exists without fresh verification output. This is the operational form of the Truth Anchor (No Fake Pass) rule in `AGENTS.md` Section 3.
|
|
9
38
|
|
|
10
39
|
---
|
|
11
40
|
|
|
12
|
-
|
|
41
|
+
### The Iron Law
|
|
13
42
|
|
|
14
|
-
|
|
43
|
+
<!-- classification: illustrative -->
|
|
44
|
+
```text
|
|
15
45
|
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
16
46
|
```
|
|
17
47
|
|
|
18
48
|
If the verification command was not run in the current message turn, the claim cannot be made. "Evidence before claims, always."
|
|
19
49
|
|
|
20
|
-
|
|
50
|
+
### The Gate Function
|
|
21
51
|
|
|
22
52
|
Run before claiming ANY status or expressing satisfaction:
|
|
23
53
|
|
|
@@ -29,7 +59,7 @@ Run before claiming ANY status or expressing satisfaction:
|
|
|
29
59
|
|
|
30
60
|
Skipping any step is lying, not verifying.
|
|
31
61
|
|
|
32
|
-
|
|
62
|
+
### Claim → Required Evidence Matrix
|
|
33
63
|
|
|
34
64
|
| Claim | Requires | Not Sufficient |
|
|
35
65
|
|---|---|---|
|
|
@@ -42,7 +72,7 @@ Skipping any step is lying, not verifying.
|
|
|
42
72
|
| Subagent finished | Its diff inspected + its claims re-verified independently | Agent reports "success" |
|
|
43
73
|
| Requirements met | Line-by-line checklist against the original request | Tests passing |
|
|
44
74
|
|
|
45
|
-
|
|
75
|
+
### Red Flags — STOP
|
|
46
76
|
|
|
47
77
|
- Using "should", "probably", "seems to", "definitely works"
|
|
48
78
|
- Expressing satisfaction before verification ("Perfect!", "Done!")
|
|
@@ -51,7 +81,7 @@ Skipping any step is lying, not verifying.
|
|
|
51
81
|
- Relying on a partial check (linter passed, therefore build must pass)
|
|
52
82
|
- Thinking "just this once"
|
|
53
83
|
|
|
54
|
-
|
|
84
|
+
### Rationalization Prevention
|
|
55
85
|
|
|
56
86
|
| Excuse | Reality |
|
|
57
87
|
|---|---|
|
|
@@ -63,7 +93,7 @@ Skipping any step is lying, not verifying.
|
|
|
63
93
|
| "Partial check is enough" | Partial proves nothing about the whole. |
|
|
64
94
|
| "Different words, so the rule doesn't apply" | Spirit over letter — paraphrases and implications of success are covered. |
|
|
65
95
|
|
|
66
|
-
|
|
96
|
+
### Key Patterns
|
|
67
97
|
|
|
68
98
|
**Tests:** run command, quote `N/N pass`, then claim "all tests pass". Never "looks correct".
|
|
69
99
|
|
|
@@ -75,13 +105,13 @@ Skipping any step is lying, not verifying.
|
|
|
75
105
|
|
|
76
106
|
**Requirements:** re-read the original request, build the checklist, verify each item, report gaps or completion — "tests pass, phase complete" without the checklist is insufficient.
|
|
77
107
|
|
|
78
|
-
|
|
108
|
+
### When To Apply
|
|
79
109
|
|
|
80
110
|
Always before: ANY success or completion claim, ANY positive statement about work state, committing or PR creation, task closure, moving to the next task, delegating to subagents.
|
|
81
111
|
|
|
82
112
|
Applies to exact phrases, paraphrases, synonyms, and any communication implying completion or correctness.
|
|
83
113
|
|
|
84
|
-
|
|
114
|
+
### Boundary vs Sibling Skills (Do Not Confuse)
|
|
85
115
|
|
|
86
116
|
| Sibling | Owns | Hand-off |
|
|
87
117
|
|---|---|---|
|
|
@@ -89,12 +119,28 @@ Applies to exact phrases, paraphrases, synonyms, and any communication implying
|
|
|
89
119
|
| `test-driven-development` | RED-GREEN-REFACTOR cycle | GREEN verification output feeds the evidence quoted here |
|
|
90
120
|
| `systematic-debugging` | Root-cause investigation | Phase 4 fix verification uses this protocol for its "fixed" claim |
|
|
91
121
|
|
|
92
|
-
|
|
122
|
+
### Reference Documentation
|
|
93
123
|
|
|
94
124
|
- `python3 tools/verify_all.py --mode hub` — the 10-gate acceptance command for hub work.
|
|
95
125
|
- `python3 tools/infer_linter.py` — fake-pass scan required before any "tests are honest" claim.
|
|
96
126
|
- [Evidence log example (`evidence_log_example.md`)](examples/evidence_log_example.md): claim/evidence pairing for a swarm task closure.
|
|
97
127
|
|
|
98
|
-
|
|
128
|
+
### Attribution
|
|
99
129
|
|
|
100
130
|
Adapted from **superpowers** skill `verification-before-completion` (https://github.com/obra/superpowers) — MIT License, Copyright (c) 2025 Jesse Vincent. The Iron Law, gate function, claim-evidence matrix, and rationalization table are re-scoped for enterprise QA automation in Synapse Hub; wording, structure, and hub tooling modified.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 4. Verification Points & DoD
|
|
135
|
+
|
|
136
|
+
1. Fresh execution evidence collected for every code modification.
|
|
137
|
+
2. Test runners execute to completion with 0 failures.
|
|
138
|
+
3. Working tree verified clean of unintended side-effects or temporary files.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 5. Handoff Protocol
|
|
143
|
+
|
|
144
|
+
- **Deliverables:** Verification command output logs, evidence matrix, and Definition of Done sign-off.
|
|
145
|
+
- **Next Subagent:** quality-gatekeeper
|
|
146
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: visual-regression-sentinel
|
|
3
3
|
description: "Run pixel and layout shift visual regression checks with anti-flake masking. Use when comparing screenshots for visual regressions with anti-flake masking."
|
|
4
|
+
category: verification_and_resilience
|
|
5
|
+
version: "2.0.0"
|
|
6
|
+
policies:
|
|
7
|
+
network: localhost-only
|
|
8
|
+
shell: workspace-sandbox
|
|
9
|
+
filesystem: workspace-sandbox
|
|
4
10
|
---
|
|
5
|
-
|
|
6
11
|
# Visual Regression Sentinel Skill
|
|
7
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Run pixel and layout shift visual regression checks with anti-flake masking. Use when comparing screenshots for visual regressions with anti-flake masking.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `06-healing-and-resilience` involving `visual-regression-sentinel`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT capture visual baselines with dynamic animated content unpaused or dynamic timestamps visible.
|
|
28
|
+
- Do NOT use arbitrary pixel threshold tolerances without masking expected variable regions.
|
|
29
|
+
- Do NOT overwrite visual golden baselines without explicit human review and approval.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- wcag-audit-patterns tests accessibility; visual-regression-sentinel detects unexpected pixel drift and visual layout regressions.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
8
37
|
> **Target:** Catch unintended UI rendering defects, CSS breakages, alignment shifts, and missing visual assets across viewports without manual visual inspection.
|
|
9
38
|
|
|
10
39
|
---
|
|
11
40
|
|
|
12
|
-
|
|
41
|
+
### Core Principles
|
|
13
42
|
|
|
14
43
|
1. **Anti-Flakiness Masking:**
|
|
15
44
|
- Always mask dynamic elements (timers, timestamps, random avatars, ads, blinking carets) before capturing baselines.
|
|
@@ -20,9 +49,10 @@ description: "Run pixel and layout shift visual regression checks with anti-flak
|
|
|
20
49
|
|
|
21
50
|
---
|
|
22
51
|
|
|
23
|
-
|
|
52
|
+
### Standard Playwright Visual Assertion Patterns
|
|
24
53
|
|
|
25
54
|
### Pattern A: Full-Page Screenshot with Dynamic Masking
|
|
55
|
+
<!-- classification: illustrative -->
|
|
26
56
|
```typescript
|
|
27
57
|
await expect(page).toHaveScreenshot('landing-page.png', {
|
|
28
58
|
fullPage: true,
|
|
@@ -37,6 +67,7 @@ await expect(page).toHaveScreenshot('landing-page.png', {
|
|
|
37
67
|
```
|
|
38
68
|
|
|
39
69
|
### Pattern B: Component-Level Snapshot
|
|
70
|
+
<!-- classification: illustrative -->
|
|
40
71
|
```typescript
|
|
41
72
|
// Isolate critical component to avoid cascade failures from header/footer changes
|
|
42
73
|
const dataTable = page.locator('.custom-data-table');
|
|
@@ -46,6 +77,7 @@ await expect(dataTable).toHaveScreenshot('table-component-default.png', {
|
|
|
46
77
|
```
|
|
47
78
|
|
|
48
79
|
### Pattern C: Color Mode / Responsive Variations
|
|
80
|
+
<!-- classification: illustrative -->
|
|
49
81
|
```typescript
|
|
50
82
|
// Test Dark Mode
|
|
51
83
|
await page.emulateMedia({ colorScheme: 'dark' });
|
|
@@ -54,7 +86,7 @@ await expect(page).toHaveScreenshot('dashboard-dark.png');
|
|
|
54
86
|
|
|
55
87
|
---
|
|
56
88
|
|
|
57
|
-
|
|
89
|
+
### Visual Failure Autopsy Protocol
|
|
58
90
|
When visual regression fails:
|
|
59
91
|
1. Review generated diff image: `*-diff.png`.
|
|
60
92
|
2. Determine if it is a **Real Regression** (CSS bug, broken layout) or **Intentional Redesign**.
|
|
@@ -63,7 +95,7 @@ When visual regression fails:
|
|
|
63
95
|
|
|
64
96
|
---
|
|
65
97
|
|
|
66
|
-
|
|
98
|
+
### Assert on Extracted Data, Not on the Model's Claim
|
|
67
99
|
|
|
68
100
|
> *Borrowed and adapted from the Midscene.js prompting model (MIT license, web-infra-dev/midscene).*
|
|
69
101
|
|
|
@@ -80,3 +112,19 @@ When an AI/vision agent reports a step as "done", that claim is **not evidence**
|
|
|
80
112
|
what is rendered.
|
|
81
113
|
4. **Only then run the visual diff** — feed the §3 autopsy protocol; a green
|
|
82
114
|
extraction plus a clean diff is proven, everything else is owed.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 4. Verification Points & DoD
|
|
119
|
+
|
|
120
|
+
1. Dynamic elements (spinners, timestamps, animations) masked before screenshot capture.
|
|
121
|
+
2. Visual diff score stays within acceptable tolerance thresholds ($\le 0.1\%$).
|
|
122
|
+
3. Visual failure autopsy highlights exact pixel drift bounding box.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 5. Handoff Protocol
|
|
127
|
+
|
|
128
|
+
- **Deliverables:** Visual snapshot baselines, diff highlight images, and visual regression autopsy report.
|
|
129
|
+
- **Next Subagent:** quality-gatekeeper
|
|
130
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: db-state-verifier-and-seeder
|
|
3
3
|
description: "Seed isolated test fixtures and assert database mutations across SQL and NoSQL. Use when seeding, verifying, or cleaning database state around tests."
|
|
4
|
+
category: verification_and_resilience
|
|
5
|
+
version: "2.0.0"
|
|
6
|
+
policies:
|
|
7
|
+
network: localhost-only
|
|
8
|
+
shell: workspace-sandbox
|
|
9
|
+
filesystem: workspace-sandbox
|
|
4
10
|
---
|
|
5
|
-
|
|
6
11
|
# Database State Verifier & Seeder Skill
|
|
7
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Seed isolated test fixtures and assert database mutations across SQL and NoSQL. Use when seeding, verifying, or cleaning database state around tests.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `07-data-and-state` involving `db-state-verifier-and-seeder`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT execute destructive DB mutations (DROP, PURGE, TRUNCATE) without explicit granular consent grants.
|
|
28
|
+
- Do NOT use static hardcoded primary keys that cause database unique constraint collisions.
|
|
29
|
+
- Do NOT leave residual test data in databases; pair seeding with automated teardown cleanup.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- synthetic-test-data-generator generates data payloads; db-state-verifier-and-seeder seeds and validates database state across SQL/NoSQL stores.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
8
37
|
> **Target:** Eliminate shallow UI-only validations by asserting exact backend database mutations (PostgreSQL, MySQL, Oracle, MongoDB, Redis) and providing isolated, idempotent fixture seeding.
|
|
9
38
|
|
|
10
39
|
---
|
|
11
40
|
|
|
12
|
-
|
|
41
|
+
### Core Principles
|
|
13
42
|
|
|
14
43
|
1. **Dual-Layer Assertion (UI + DB):**
|
|
15
44
|
- Asserting a green UI toast is insufficient for transactional operations. Test suites must query the persistence layer to ensure records are properly inserted with correct foreign keys and audit fields (`created_at`, `created_by`).
|
|
@@ -20,9 +49,10 @@ description: "Seed isolated test fixtures and assert database mutations across S
|
|
|
20
49
|
|
|
21
50
|
---
|
|
22
51
|
|
|
23
|
-
|
|
52
|
+
### Standard SQL Query & State Assertion Patterns
|
|
24
53
|
|
|
25
54
|
### Pattern A: PostgreSQL / MySQL Record Persistence Assertion
|
|
55
|
+
<!-- classification: illustrative -->
|
|
26
56
|
```python
|
|
27
57
|
import os
|
|
28
58
|
import psycopg2
|
|
@@ -47,6 +77,7 @@ def assert_record_created(unique_code: str, expected_status: str = "ACTIVE"):
|
|
|
47
77
|
```
|
|
48
78
|
|
|
49
79
|
### Pattern B: Idempotent SQL Teardown Cleanup
|
|
80
|
+
<!-- classification: illustrative -->
|
|
50
81
|
```python
|
|
51
82
|
def teardown_test_entity(unique_code: str):
|
|
52
83
|
conn = psycopg2.connect(...)
|
|
@@ -58,9 +89,10 @@ def teardown_test_entity(unique_code: str):
|
|
|
58
89
|
|
|
59
90
|
---
|
|
60
91
|
|
|
61
|
-
|
|
92
|
+
### Standard NoSQL Patterns (MongoDB & Redis)
|
|
62
93
|
|
|
63
94
|
### Pattern C: MongoDB Document Mutation & JSON Schema Assertion
|
|
95
|
+
<!-- classification: illustrative -->
|
|
64
96
|
```python
|
|
65
97
|
import os
|
|
66
98
|
from pymongo import MongoClient
|
|
@@ -82,6 +114,7 @@ def assert_mongo_document_persisted(order_id: str, expected_item_count: int):
|
|
|
82
114
|
```
|
|
83
115
|
|
|
84
116
|
### Pattern D: Redis Cache Expiry & Invalidation Verification
|
|
117
|
+
<!-- classification: illustrative -->
|
|
85
118
|
```python
|
|
86
119
|
import os
|
|
87
120
|
import redis
|
|
@@ -95,12 +128,13 @@ def assert_cache_invalidated(cache_key: str):
|
|
|
95
128
|
|
|
96
129
|
---
|
|
97
130
|
|
|
98
|
-
|
|
131
|
+
### Zero-Pollution DB Sandbox & Ephemeral Teardown (`tools/db_sandbox.py`)
|
|
99
132
|
|
|
100
133
|
To eliminate cascading flakiness and orphan test junk in parallel CI runs, agents utilize deterministic DB Sandbox operations:
|
|
101
134
|
|
|
102
135
|
### 1. Transaction Savepoint Rollback Context
|
|
103
136
|
Wrap E2E test data creation inside transactional savepoints:
|
|
137
|
+
<!-- classification: illustrative -->
|
|
104
138
|
```bash
|
|
105
139
|
python tools/db_sandbox.py rollback-test --db-path "path/to/db.sqlite"
|
|
106
140
|
```
|
|
@@ -108,6 +142,7 @@ python tools/db_sandbox.py rollback-test --db-path "path/to/db.sqlite"
|
|
|
108
142
|
|
|
109
143
|
### 2. Ephemeral Snapshot & Instant Restore (< 0.5s) [DESTRUCTIVE]
|
|
110
144
|
> ⚠️ **Warning [DESTRUCTIVE]:** Database restore drops existing tables/objects and repopulates from snapshot (e.g. `pg_restore --clean --if-exists`). Zero-pollution guarantee is conditional upon isolated sandbox containers and valid snapshots; never execute against staging or production databases. Requires explicit `--confirm` (or setting `SYNAPSE_FORCE_RESTORE=1`).
|
|
145
|
+
<!-- classification: illustrative -->
|
|
111
146
|
```bash
|
|
112
147
|
# Before test suite runs: capture pristine database baseline
|
|
113
148
|
python tools/db_sandbox.py snapshot --id pristine_baseline
|
|
@@ -118,6 +153,7 @@ python tools/db_sandbox.py restore --id pristine_baseline --confirm
|
|
|
118
153
|
|
|
119
154
|
### 3. Taint Pollution Audit & Cascading Purge
|
|
120
155
|
Scan all tables for orphan records carrying test prefixes (`AUTO_`, `TEST_`). By default, `audit` runs in **safe dry-run preview** mode:
|
|
156
|
+
<!-- classification: illustrative -->
|
|
121
157
|
```bash
|
|
122
158
|
# Preview orphan records without deleting (safe default):
|
|
123
159
|
python tools/db_sandbox.py audit
|
|
@@ -126,3 +162,18 @@ python tools/db_sandbox.py audit
|
|
|
126
162
|
python tools/db_sandbox.py audit --apply
|
|
127
163
|
```
|
|
128
164
|
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 4. Verification Points & DoD
|
|
168
|
+
|
|
169
|
+
1. Database seed data uses dynamic unique identifiers to eliminate collisions.
|
|
170
|
+
2. State assertions verify record existence, column values, and relational integrity.
|
|
171
|
+
3. Teardown routines remove test-generated records cleanly upon completion.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 5. Handoff Protocol
|
|
176
|
+
|
|
177
|
+
- **Deliverables:** Database seeding scripts, state assertion queries, and teardown cleanup hooks.
|
|
178
|
+
- **Next Subagent:** api-engineer / test-runner
|
|
179
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: file-and-report-validator
|
|
3
3
|
description: "Validate downloaded and uploaded files (Excel, CSV, PDF) schemas and tabular integrity. Use when validating exported files or reports against a schema."
|
|
4
|
+
category: verification_and_resilience
|
|
5
|
+
version: "2.0.0"
|
|
6
|
+
policies:
|
|
7
|
+
network: none
|
|
8
|
+
shell: read-only
|
|
9
|
+
filesystem: read-only
|
|
4
10
|
---
|
|
5
|
-
|
|
6
11
|
# File & Report Validator Skill
|
|
7
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Validate downloaded and uploaded files (Excel, CSV, PDF) schemas and tabular integrity. Use when validating exported files or reports against a schema.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `07-data-and-state` involving `file-and-report-validator`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT assert only file download existence; validate internal content structure and data integrity.
|
|
28
|
+
- Do NOT store downloaded test files in uncontrolled directories; use isolated temporary sandboxes.
|
|
29
|
+
- Do NOT parse large PDF/Excel files without proper error handling and resource cleanup.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- db-state-verifier validates databases; file-and-report-validator validates downloaded report files (PDF, XLSX, CSV, JSON).
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
8
37
|
> **Target:** Eliminate superficial testing of file exports and imports by inspecting and asserting exact file contents, schemas, formulas, and values across Excel, CSV, and PDF formats.
|
|
9
38
|
|
|
10
39
|
---
|
|
11
40
|
|
|
12
|
-
|
|
41
|
+
### Core Principles
|
|
13
42
|
|
|
14
43
|
1. **Verify Binary Contents, Not Just Download Events:**
|
|
15
44
|
- Catching the browser `download` event is insufficient. The downloaded file must be opened, parsed, and its tabular records cross-referenced against expected database or UI table states.
|
|
@@ -20,8 +49,9 @@ description: "Validate downloaded and uploaded files (Excel, CSV, PDF) schemas a
|
|
|
20
49
|
|
|
21
50
|
---
|
|
22
51
|
|
|
23
|
-
|
|
52
|
+
### Standard Playwright Download Handling
|
|
24
53
|
|
|
54
|
+
<!-- classification: illustrative -->
|
|
25
55
|
```typescript
|
|
26
56
|
import { test, expect } from '@playwright/test';
|
|
27
57
|
import path from 'path';
|
|
@@ -40,9 +70,10 @@ test('export and verify financial report', async ({ page }) => {
|
|
|
40
70
|
|
|
41
71
|
---
|
|
42
72
|
|
|
43
|
-
|
|
73
|
+
### Deep Content Inspection Recipes (Python)
|
|
44
74
|
|
|
45
75
|
### Pattern A: Excel (.xlsx / .xls) Schema & Data Assertion
|
|
76
|
+
<!-- classification: illustrative -->
|
|
46
77
|
```python
|
|
47
78
|
import pandas as pd
|
|
48
79
|
|
|
@@ -60,6 +91,7 @@ def validate_excel_report(file_path: str, expected_min_rows: int = 1):
|
|
|
60
91
|
```
|
|
61
92
|
|
|
62
93
|
### Pattern B: CSV Chunk Streaming (For Big Data Exports > 100k Rows)
|
|
94
|
+
<!-- classification: illustrative -->
|
|
63
95
|
```python
|
|
64
96
|
import csv
|
|
65
97
|
|
|
@@ -76,6 +108,7 @@ def validate_large_csv_stream(file_path: str, expected_header: list):
|
|
|
76
108
|
```
|
|
77
109
|
|
|
78
110
|
### Pattern C: PDF Document Text & Metadata Extraction
|
|
111
|
+
<!-- classification: illustrative -->
|
|
79
112
|
```python
|
|
80
113
|
import pypdf
|
|
81
114
|
|
|
@@ -88,3 +121,19 @@ def assert_pdf_contains_text(pdf_path: str, expected_keywords: list):
|
|
|
88
121
|
assert kw in full_text, f"PDF assertion failed: Keyword '{kw}' missing in {pdf_path}"
|
|
89
122
|
print(f"[PASS] Verified keywords {expected_keywords} across {len(reader.pages)} PDF pages.")
|
|
90
123
|
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 4. Verification Points & DoD
|
|
128
|
+
|
|
129
|
+
1. Downloaded file format, MIME type, and byte size verified.
|
|
130
|
+
2. Deep content inspection validates specific text strings, cell coordinates, and row counts.
|
|
131
|
+
3. Downloaded test files cleaned up from temporary sandbox upon test completion.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 5. Handoff Protocol
|
|
136
|
+
|
|
137
|
+
- **Deliverables:** File validation test scripts, parsing helpers, and download integrity reports.
|
|
138
|
+
- **Next Subagent:** quality-gatekeeper
|
|
139
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: synthetic-test-data-generator
|
|
3
3
|
description: "Generate idempotent, boundary-value synthetic test data with unique runtime timestamps. Use when generating idempotent, unique test data for creation tests."
|
|
4
|
+
category: verification_and_resilience
|
|
5
|
+
version: "2.0.0"
|
|
6
|
+
policies:
|
|
7
|
+
network: none
|
|
8
|
+
shell: none
|
|
9
|
+
filesystem: workspace-sandbox
|
|
4
10
|
---
|
|
5
|
-
|
|
6
11
|
# Synthetic Test Data Generator & Edge-Case Fuzzing Skill
|
|
7
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **Thế Vị (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Generate idempotent, boundary-value synthetic test data with unique runtime timestamps. Use when generating idempotent, unique test data for creation tests.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `07-data-and-state` involving `synthetic-test-data-generator`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT use real customer PII or production credentials for test data.
|
|
28
|
+
- Do NOT generate static repetitive values that hide edge-case bugs.
|
|
29
|
+
- Do NOT generate unconstrained fuzzer payloads without containment and boundary checks.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- db-state-verifier-and-seeder seeds databases; synthetic-test-data-generator synthesizes realistic, dynamic, and fuzz test payloads.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
8
37
|
> **Target:** Eliminate database collisions, race conditions in parallel testing, and stale fixture dependencies by dynamically generating valid, boundary-value, and edge-case fuzzing datasets.
|
|
9
38
|
|
|
10
39
|
---
|
|
11
40
|
|
|
12
|
-
|
|
41
|
+
### Core Principles
|
|
13
42
|
|
|
14
43
|
1. **Idempotence & Unique Prefixing:**
|
|
15
44
|
- Every generated string or identifier must contain an execution timestamp or UUID prefix (`AUTO_1719500000_...`) to allow parallel test executions without unique-key database collisions.
|
|
@@ -24,9 +53,10 @@ description: "Generate idempotent, boundary-value synthetic test data with uniqu
|
|
|
24
53
|
|
|
25
54
|
---
|
|
26
55
|
|
|
27
|
-
|
|
56
|
+
### Standard Generation Recipes
|
|
28
57
|
|
|
29
58
|
### Recipe A: Dynamic Unique Entity Names
|
|
59
|
+
<!-- classification: illustrative -->
|
|
30
60
|
```typescript
|
|
31
61
|
export class TestDataFactory {
|
|
32
62
|
static uniqueName(prefix: string = 'AUTO'): string {
|
|
@@ -42,6 +72,7 @@ export class TestDataFactory {
|
|
|
42
72
|
```
|
|
43
73
|
|
|
44
74
|
### Recipe B: Boundary Value String Suite
|
|
75
|
+
<!-- classification: illustrative -->
|
|
45
76
|
```json
|
|
46
77
|
{
|
|
47
78
|
"boundaryStrings": [
|
|
@@ -60,6 +91,7 @@ export class TestDataFactory {
|
|
|
60
91
|
```
|
|
61
92
|
|
|
62
93
|
### Recipe C: GeoJSON / GIS Valid Non-Overlapping Polygons
|
|
94
|
+
<!-- classification: illustrative -->
|
|
63
95
|
```typescript
|
|
64
96
|
export function generateValidPolygon(centerLat = 21.0285, centerLng = 105.8542, offset = 0.005) {
|
|
65
97
|
// Generates closed 5-point polygon bounding box
|
|
@@ -75,10 +107,11 @@ export function generateValidPolygon(centerLat = 21.0285, centerLng = 105.8542,
|
|
|
75
107
|
|
|
76
108
|
---
|
|
77
109
|
|
|
78
|
-
|
|
110
|
+
### Edge-Case Fuzzing & Input Sanitization Suite (`tools/fuzz_payloads.py`)
|
|
79
111
|
|
|
80
112
|
Transform functional tests into input sanitization and robustness validation by executing edge-case fuzzing vectors:
|
|
81
113
|
|
|
114
|
+
<!-- classification: illustrative -->
|
|
82
115
|
```bash
|
|
83
116
|
# Query CLI catalog for specific field vectors
|
|
84
117
|
python tools/fuzz_payloads.py --field username --type string
|
|
@@ -86,6 +119,7 @@ python tools/fuzz_payloads.py --category sqli --json
|
|
|
86
119
|
```
|
|
87
120
|
|
|
88
121
|
### Recipe D: Harmless SQLi Polyglot Sanity
|
|
122
|
+
<!-- classification: illustrative -->
|
|
89
123
|
```typescript
|
|
90
124
|
export const SQLI_FUZZ_PROBES = [
|
|
91
125
|
"' OR '1'='1' -- ",
|
|
@@ -98,6 +132,7 @@ export const SQLI_FUZZ_PROBES = [
|
|
|
98
132
|
```
|
|
99
133
|
|
|
100
134
|
### Recipe E: Unicode BiDi & RTL Trojan Source Vectors
|
|
135
|
+
<!-- classification: illustrative -->
|
|
101
136
|
```typescript
|
|
102
137
|
export const BIDI_FUZZ_PROBES = [
|
|
103
138
|
"\u202E\u0041\u0042\u0043_AUTO_TX", // Right-to-Left Override (RLO)
|
|
@@ -109,6 +144,7 @@ export const BIDI_FUZZ_PROBES = [
|
|
|
109
144
|
```
|
|
110
145
|
|
|
111
146
|
### Recipe F: Multi-Byte Emoji Surrogate Pairs & ZWJ Sequences
|
|
147
|
+
<!-- classification: illustrative -->
|
|
112
148
|
```typescript
|
|
113
149
|
export const EMOJI_FUZZ_PROBES = [
|
|
114
150
|
"👨👩👧👦_QA_RECORD", // Complex Zero-Width Joiner family sequence
|
|
@@ -120,6 +156,7 @@ export const EMOJI_FUZZ_PROBES = [
|
|
|
120
156
|
```
|
|
121
157
|
|
|
122
158
|
### Recipe G: Extreme Length Buffer Stress ($10^4$ Characters)
|
|
159
|
+
<!-- classification: illustrative -->
|
|
123
160
|
```typescript
|
|
124
161
|
export const BUFFER_STRESS_PAYLOADS = [
|
|
125
162
|
"A".repeat(10000), // 10,000 chars text block
|
|
@@ -131,5 +168,21 @@ export const BUFFER_STRESS_PAYLOADS = [
|
|
|
131
168
|
|
|
132
169
|
---
|
|
133
170
|
|
|
134
|
-
|
|
171
|
+
### Teardown & Lifecycle Integration
|
|
135
172
|
- Every test generating persistent records with `synthetic-test-data-generator` **MUST** register the generated ID into a teardown queue to clean up after test execution completes.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 4. Verification Points & DoD
|
|
177
|
+
|
|
178
|
+
1. Generated data includes realistic edge cases (Unicode, boundary lengths, special characters).
|
|
179
|
+
2. Entity codes use dynamic timestamped prefixes (`BasePage.uniqueCode()`).
|
|
180
|
+
3. Zero PII or real credentials generated in test datasets.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 5. Handoff Protocol
|
|
185
|
+
|
|
186
|
+
- **Deliverables:** Synthetic data factories, fuzz payload dictionaries, and test data fixture files.
|
|
187
|
+
- **Next Subagent:** pom-crafter / api-engineer
|
|
188
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|