AgPerry commited on
Commit
eefeb99
·
verified ·
1 Parent(s): a82c94c

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. tasks/capterra/solution/site/README.md +3 -0
  2. tasks/capterra/solution/site/implementation/backend/runtime.json +106 -0
  3. tasks/capterra/solution/site/implementation/clone/__init__.py +5 -0
  4. tasks/capterra/solution/site/implementation/clone/app.py +0 -0
  5. tasks/capterra/solution/site/implementation/clone/backend/README.md +22 -0
  6. tasks/capterra/solution/site/implementation/clone/backend/__init__.py +8 -0
  7. tasks/capterra/solution/site/implementation/clone/backend/categories.py +45 -0
  8. tasks/capterra/solution/site/implementation/clone/backend/category-index.json +1010 -0
  9. tasks/capterra/solution/site/implementation/clone/backend/db.py +1414 -0
  10. tasks/capterra/solution/site/implementation/clone/backend/product-catalog.json +0 -0
  11. tasks/capterra/solution/site/implementation/clone/backend/site_backend_integration.py +295 -0
  12. tasks/capterra/solution/site/implementation/clone/harbor_entry.py +184 -0
  13. tasks/capterra/solution/site/implementation/clone/static/app.js +381 -0
  14. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/019015be83aabeb3260cfdf6.png +3 -0
  15. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/01f2e93d6758e17f7805bebb.jpeg +3 -0
  16. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/02f072bd05705e7636a0cb70.jpeg +3 -0
  17. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/031118f8c1f3fe2ba6ce08aa.jpeg +3 -0
  18. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0376c4f8ee8895116f64eeeb.jpeg +3 -0
  19. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/03b83d8933a5bdff50c00a30.jpeg +3 -0
  20. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/03d1e96715943ce62e628871.jpeg +3 -0
  21. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/04a32dad79d157dbcf4da11c.jpeg +3 -0
  22. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/053321b3c04b958984c08542.png +3 -0
  23. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/05b6fb910fe93a33d9b4f5be.jpeg +3 -0
  24. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/063a3dba1a1411a7428ed394.png +3 -0
  25. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/071c7df0bf3230cfc0b188f6.png +3 -0
  26. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0857d6c85de5028728465eec.jpeg +3 -0
  27. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a0e152e3afa09314fbff154.png +3 -0
  28. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a1756b9076f2c2c3b0ffd94.png +3 -0
  29. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a1bb260f45f9b37ff867562.png +3 -0
  30. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a46333a4281109a960d9837.jpeg +3 -0
  31. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a9d62c2195881db8a99376a.png +3 -0
  32. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0aea046b95bbec87e6d42961.png +3 -0
  33. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0b92ddeec7ced9fe7d0ba32a.svg +3 -0
  34. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0c2fb810fccfe04e411cd61b.png +3 -0
  35. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0cde04057708ec1fbc673bda.jpeg +3 -0
  36. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0d865cc75de374bb4505c247.png +3 -0
  37. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0e26eba93d2cf5dd64a3c037.png +3 -0
  38. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0e2fce6471d05ae3041aed3f.png +3 -0
  39. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0ecbbabad6bc57ad4095c471.svg +3 -0
  40. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0f2e84576bc867161d224895.png +3 -0
  41. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0f56ef86e45a7602ea94eb66.jpeg +3 -0
  42. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10864cc6d9b2891038f703cc.jpeg +3 -0
  43. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10c7bbf034c9cddd31d9067b.css +0 -0
  44. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10caaf234a2d0521ed016d3f.jpeg +3 -0
  45. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10e11893dc50ce2be5c0bf14.png +3 -0
  46. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10fade6c113a55da7d4383e7.jpeg +3 -0
  47. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/112cbfbb160c2c0480c53777.jpeg +3 -0
  48. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/1262f2221a0bf7b0c6f01f92.jpeg +3 -0
  49. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/126e6b76a7f90ef8e6bbc8e4.png +3 -0
  50. tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/1293f3569f117fd231d36d8b.jpeg +3 -0
tasks/capterra/solution/site/README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Private oracle implementation
2
+
3
+ The implementation is a deterministic projection of the current material clone and is copied only into the privileged oracle solution.
tasks/capterra/solution/site/implementation/backend/runtime.json ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "database": {
3
+ "data_dir": "data",
4
+ "engine": "sqlite",
5
+ "filename": "websitebench-capterra.sqlite3",
6
+ "legacy_unbound_migration": false,
7
+ "migration_hook": "backend.db:apply_site_backend_migrations",
8
+ "seed_hook": "backend.db:seed_site_backend",
9
+ "volume_identity": "websitebench-capterra-data"
10
+ },
11
+ "deployment": {
12
+ "profiles": {
13
+ "cloudflare-review": {
14
+ "mail_adapter": "redis-resend",
15
+ "payment_adapter": "local-sandbox",
16
+ "persistence": "ephemeral-reset"
17
+ },
18
+ "docker-volume": {
19
+ "mail_adapter": "effects-gateway",
20
+ "payment_adapter": "local-sandbox",
21
+ "persistence": "persistent-volume"
22
+ },
23
+ "offline-harbor": {
24
+ "mail_adapter": "local-outbox",
25
+ "payment_adapter": "local-sandbox",
26
+ "persistence": "persistent"
27
+ }
28
+ }
29
+ },
30
+ "mail": {
31
+ "enabled": true,
32
+ "purposes": {
33
+ "password-reset": {
34
+ "body": "Your password reset code is ${code}.",
35
+ "expiry": "This code expires in ${minutes} minutes.",
36
+ "footer": "Ignore this message if you did not request a Capterra password reset.",
37
+ "lead": "A password reset was requested for your Capterra account.",
38
+ "required_variables": [
39
+ "code",
40
+ "minutes"
41
+ ],
42
+ "secret_variables": [
43
+ "code"
44
+ ],
45
+ "subject": "Reset your Capterra password",
46
+ "template_id": "capterra.password-reset.v1"
47
+ },
48
+ "registration": {
49
+ "body": "Your verification code is ${code}.",
50
+ "expiry": "This code expires in ${minutes} minutes.",
51
+ "footer": "This code is only for your Capterra account.",
52
+ "lead": "Finish creating your Capterra account.",
53
+ "required_variables": [
54
+ "code",
55
+ "minutes"
56
+ ],
57
+ "secret_variables": [
58
+ "code"
59
+ ],
60
+ "subject": "Verify your Capterra account",
61
+ "template_id": "capterra.registration.v1"
62
+ }
63
+ },
64
+ "sender": {
65
+ "address_env": "RESEND_FROM_EMAIL",
66
+ "display_name": "Capterra"
67
+ }
68
+ },
69
+ "payments": {
70
+ "currency": "USD",
71
+ "default_adapter": "local-sandbox",
72
+ "enabled": false,
73
+ "local_sandbox": {
74
+ "scenarios": [
75
+ {
76
+ "display_label": "Simulated approval",
77
+ "id": "sandbox-approved",
78
+ "outcome": "approved"
79
+ },
80
+ {
81
+ "display_label": "Simulated decline",
82
+ "id": "sandbox-declined",
83
+ "outcome": "declined"
84
+ },
85
+ {
86
+ "display_label": "Simulated retry",
87
+ "id": "sandbox-retry",
88
+ "outcome": "retryable"
89
+ }
90
+ ]
91
+ },
92
+ "stripe_test": null
93
+ },
94
+ "schema_version": "websitebench.site-backend-runtime.v1",
95
+ "session": {
96
+ "host_only": true,
97
+ "http_only": true,
98
+ "same_site": "Lax",
99
+ "secure": true
100
+ },
101
+ "site": {
102
+ "id": "capterra",
103
+ "label": "Capterra",
104
+ "public_origin": "https://capterra.offline.invalid"
105
+ }
106
+ }
tasks/capterra/solution/site/implementation/clone/__init__.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ """Capterra offline clone — R3 persistent backend.
2
+
3
+ Routes stay on the accepted R2 frontend surface; business state is owned
4
+ by the SQLite-backed clone/backend package.
5
+ """
tasks/capterra/solution/site/implementation/clone/app.py ADDED
The diff for this file is too large to render. See raw diff
 
tasks/capterra/solution/site/implementation/clone/backend/README.md ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Persistent backend (R3)
2
+
3
+ Human R2 acceptance authorized the persistent backend. This package owns:
4
+
5
+ - `db.py` — SQLite connection (WAL mode, foreign keys ON), the ordered
6
+ migration list recorded in `schema_migrations`, deterministic fixture
7
+ seeding, signed-cookie sessions, and the review draft / revision /
8
+ submission domain. Migration 4 enforces one review per
9
+ (reviewer, product) with a UNIQUE(account_id, product_id) index,
10
+ deduplicating any pre-existing pair duplicates deterministically
11
+ (lowest rowid kept) before the constraint applies.
12
+
13
+ The database file `capterra.sqlite3` lives in the data directory
14
+ (env `CLAWBENCH_DATA_DIR`, default `materials/capterra/data` — a sibling of
15
+ `clone/`, never inside it, so the reload watcher never sees DB churn).
16
+
17
+ Admin reset: `POST /__admin/reset` guarded by the `X-Clawbench-Admin-Token`
18
+ header (env `CLAWBENCH_ADMIN_TOKEN`, dev default `capterra-admin-dev-token`).
19
+ It is never linked from any UI template.
20
+
21
+ The receipt remains truthful: it reads the stored submission row but never
22
+ claims real publication on capterra.com.
tasks/capterra/solution/site/implementation/clone/backend/__init__.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ """Persistent backend package for the Capterra offline clone (R3).
2
+
3
+ Provides the SQLite connection, ordered migrations, deterministic fixture
4
+ seeding, signed-cookie sessions, and the review draft / revision /
5
+ submission domain used by ``clone/app.py``.
6
+ """
7
+
8
+ from __future__ import annotations
tasks/capterra/solution/site/implementation/clone/backend/categories.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Category slug index extracted from the frozen category-directory capture.
2
+
3
+ The public Capterra directory links 1001 ``/<slug>-software/`` routes. Every
4
+ listed slug renders a catalog-backed directory page: categories with a captured
5
+ directory page keep their captured listing order, and the rest are assembled
6
+ from the extracted product catalog with an explicit provenance disclosure
7
+ (see ``backend/product-catalog.json`` and ``tools/extract_product_catalog.py``).
8
+
9
+ The index itself is generated by ``tools/extract_category_index.py`` from
10
+ ``clone/static/public-replay/pages/categories-index.html``.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import json
16
+ from functools import lru_cache
17
+ from pathlib import Path
18
+ from typing import Mapping
19
+
20
+ INDEX_PATH = Path(__file__).resolve().parent / "category-index.json"
21
+
22
+ # The one category whose directory page is a real frozen capture rather than a
23
+ # generated landing page.
24
+ REPLAYED_CATEGORY_SLUGS = frozenset({"accounting"})
25
+
26
+
27
+ @lru_cache(maxsize=1)
28
+ def category_index() -> Mapping[str, str]:
29
+ payload = json.loads(INDEX_PATH.read_text(encoding="utf-8"))
30
+ categories = payload["categories"]
31
+ if not isinstance(categories, dict) or not categories:
32
+ raise ValueError("category index is empty or malformed")
33
+ return dict(categories)
34
+
35
+
36
+ def is_known_category(slug: str) -> bool:
37
+ """True when ``/<slug>-software/`` appears in the frozen directory."""
38
+
39
+ return slug in category_index()
40
+
41
+
42
+ def category_label(slug: str) -> str | None:
43
+ return category_index().get(slug)
44
+
45
+
tasks/capterra/solution/site/implementation/clone/backend/category-index.json ADDED
@@ -0,0 +1,1010 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "capterra.category-index.v1",
3
+ "source": "clone/static/public-replay/pages/categories-index.html",
4
+ "extractor": "tools/extract_category_index.py",
5
+ "note": "Slugs and labels are extracted verbatim from the frozen category directory capture. No category data is authored here.",
6
+ "count": 1001,
7
+ "categories": {
8
+ "360-degree-feedback": "360 Degree Feedback",
9
+ "3d-architecture": "3D Architecture",
10
+ "3d-cad": "3D CAD",
11
+ "3d-rendering": "3D Rendering",
12
+ "3pl": "Third Party Logistics (3PL)",
13
+ "ab-testing": "AB Testing",
14
+ "absence-management": "Absence Management",
15
+ "access-governance": "Access Governance",
16
+ "account-based-marketing": "Account Based Marketing",
17
+ "accounting": "Accounting",
18
+ "accounting-practice-management": "Accounting Practice Management",
19
+ "accounts-payable": "Accounts Payable",
20
+ "accounts-receivable": "Accounts Receivable",
21
+ "accreditation-management": "Accreditation Management",
22
+ "ad-server": "Ad Server",
23
+ "address-verification": "Address Verification",
24
+ "admissions": "Admissions",
25
+ "advertising-agency": "Advertising Agency",
26
+ "advocacy": "Advocacy",
27
+ "aerospace-manufacturing": "Aerospace Manufacturing",
28
+ "affiliate": "Affiliate",
29
+ "agentic-ai": "Agentic AI",
30
+ "agile-project-management-tools": "Agile Project Management",
31
+ "ai-agent-builder": "AI Agent Builder",
32
+ "ai-agents-for-customer-support": "AI Agents for Customer Support",
33
+ "ai-agents-for-hr": "AI Agents for HR",
34
+ "ai-app-builder": "AI App Builder",
35
+ "ai-code-generator": "AI Code Generator",
36
+ "ai-coding-assistants": "AI Coding Assistants",
37
+ "ai-content-generation-platforms": "AI Content Creation Platforms",
38
+ "ai-detection": "AI Detection",
39
+ "ai-governance-tools": "AI Governance Tools",
40
+ "ai-image-generator": "AI Image Generator",
41
+ "ai-interview-agent": "AI Interview Agent",
42
+ "ai-it-agents": "AI IT Agents",
43
+ "ai-legal-assistant": "AI Legal Assistant",
44
+ "ai-legal-workflow-automation": "AI Legal Workflow Automation",
45
+ "ai-marketing-tools": "AI Marketing Tools",
46
+ "ai-meeting-assistants": "AI Meeting Assistants",
47
+ "ai-presentation-tools": "AI Presentation Tools",
48
+ "ai-recruiting": "AI Recruiting",
49
+ "ai-sales-assistant": "AI Sales Assistant",
50
+ "ai-sales-development-representatives-sdrs": "AI Sales Development Representatives (SDRs)",
51
+ "ai-sales-roleplay-tools": "AI Sales Roleplay Tools",
52
+ "ai-search-visibility": "AI Search Visibility",
53
+ "ai-soc-agents": "AI SOC Agents",
54
+ "ai-video-generator": "AI Video Generator",
55
+ "ai-writing-assistant": "AI Writing Assistant",
56
+ "aiops-platforms": "AIOps Platforms",
57
+ "airline-reservation-system": "Airline Reservation System",
58
+ "all-in-one-marketing": "All-in-One Marketing Platform",
59
+ "alumni-management": "Alumni Management",
60
+ "aml": "AML",
61
+ "android-kiosk": "Android Kiosk",
62
+ "animal-shelter": "Animal Shelter",
63
+ "animation": "Animation",
64
+ "anti-spam": "Anti-spam",
65
+ "anti-virus": "AntiVirus",
66
+ "apartment-management": "Apartment Management Systems",
67
+ "api-management": "API Management",
68
+ "app-building": "App Building",
69
+ "app-design": "App Design",
70
+ "app-store-optimization-tools": "App Store Optimization Tools",
71
+ "apparel-management": "Apparel Management",
72
+ "applicant-tracking": "Applicant Tracking",
73
+ "application-development": "Application Development",
74
+ "application-lifecycle-management": "Application Lifecycle Management",
75
+ "application-performance-management": "Application Performance Management",
76
+ "applied-behavior-analysis": "Applied Behavior Analysis",
77
+ "appointment-reminder": "Appointment Reminder",
78
+ "appointment-scheduling": "Appointment Scheduling",
79
+ "aps": "Advanced Planning and Scheduling (APS)",
80
+ "arborist": "Arborist",
81
+ "architectural-cad": "Architectural CAD",
82
+ "architecture": "Architecture",
83
+ "archiving": "Archiving",
84
+ "art-gallery": "Art Gallery",
85
+ "artificial-intelligence": "Artificial Intelligence",
86
+ "assessment": "Assessment",
87
+ "asset-tracking": "Asset Tracking",
88
+ "assisted-living": "Assisted Living",
89
+ "association-management": "Association Management",
90
+ "attendance-tracking": "Attendance Tracking",
91
+ "auction": "Auction",
92
+ "audience-response": "Audience Response",
93
+ "audio-conferencing": "Audio Conferencing",
94
+ "audio-editing": "Audio Editing",
95
+ "audit": "Audit",
96
+ "augmented-reality": "Augmented Reality",
97
+ "authentication": "Authentication",
98
+ "auto-body": "Auto Body",
99
+ "auto-dealer": "Auto Dealer",
100
+ "auto-dealer-accounting": "Auto Dealer Accounting",
101
+ "auto-dialer": "Auto Dialer",
102
+ "auto-repair": "Auto Repair",
103
+ "automated-testing": "Automated Testing",
104
+ "aviation-maintenance": "Aviation Maintenance",
105
+ "b2b-ecommerce-platform": "B2B eCommerce Platform",
106
+ "background-check": "Background Check",
107
+ "backup": "Backup",
108
+ "bakery": "Bakery",
109
+ "banking-systems": "Banking Systems",
110
+ "bankruptcy": "Bankruptcy",
111
+ "bar-pos": "Bar POS",
112
+ "barbershop": "Barbershop",
113
+ "barcoding": "Barcoding",
114
+ "benefits-administration": "Benefits Administration",
115
+ "big-data": "Big Data",
116
+ "bill-of-materials": "Bill of Materials",
117
+ "billing-and-invoicing": "Billing and Invoicing",
118
+ "billing-and-provisioning": "Billing and Provisioning",
119
+ "bim": "BIM",
120
+ "blockchain-platforms": "Blockchain Platforms",
121
+ "blog": "Blog",
122
+ "board-management": "Board Management",
123
+ "bookkeeper": "Bookkeeper",
124
+ "bot-detection-and-mitigation": "Bot Detection and Mitigation",
125
+ "brand-management": "Brand Management",
126
+ "brand-protection": "Brand Protection",
127
+ "brewery": "Brewery",
128
+ "browser": "Browser",
129
+ "budgeting": "Budgeting",
130
+ "bug-tracking": "Bug Tracking",
131
+ "building-maintenance": "Building Maintenance",
132
+ "business-card": "Business Card",
133
+ "business-continuity": "Business Continuity",
134
+ "business-intelligence": "Business Intelligence",
135
+ "business-management": "Business Management",
136
+ "business-performance-management": "Business Performance Management",
137
+ "business-phone-systems": "Business Phone Systems",
138
+ "business-plan": "Business Plan",
139
+ "business-process-management": "Business Process Management",
140
+ "buyer-intent": "Buyer Intent",
141
+ "calendar": "Calendar",
142
+ "calibration-management": "Calibration Management",
143
+ "call-accounting": "Call Accounting",
144
+ "call-center": "Call Center",
145
+ "call-center-workforce-management": "Call Center Workforce Management",
146
+ "call-recording": "Call Recording",
147
+ "call-tracking": "Call Tracking",
148
+ "camp-management": "Camp Management",
149
+ "campaign-management": "Campaign Management",
150
+ "campground-management": "Campground Management",
151
+ "capacity-planning": "Capacity Planning",
152
+ "car-rental": "Car Rental",
153
+ "cardiology-emr": "Cardiology EMR",
154
+ "career-management": "Career Management",
155
+ "carpet-cleaning": "Carpet Cleaning",
156
+ "catalog-management": "Catalog Management",
157
+ "catering": "Catering",
158
+ "cemetery": "Cemetery",
159
+ "certification-tracking": "Certification Tracking",
160
+ "change-management": "Change Management",
161
+ "channel-management": "Channel Management",
162
+ "chargeback-management": "Chargeback Management",
163
+ "chatbot": "Chatbot",
164
+ "chemical": "Chemical",
165
+ "chemical-manufacturing": "Chemical Manufacturing",
166
+ "child-care": "Daycare",
167
+ "chiropractic": "Chiropractic",
168
+ "church-accounting": "Church Accounting",
169
+ "church-management": "Church Management",
170
+ "church-presentation": "Church Presentation",
171
+ "ciam": "Customer Identity and Access Management (CIAM)",
172
+ "claims-processing": "Claims Processing",
173
+ "class-registration": "Class Registration",
174
+ "classroom-management": "Classroom Management",
175
+ "click-fraud": "Click Fraud",
176
+ "client-onboarding": "Client Onboarding",
177
+ "clinical-trial-management": "Clinical Trial Management",
178
+ "closed-captioning": "Closed Captioning",
179
+ "cloud-access-security-broker-casb": "Cloud Access Security Broker (CASB)",
180
+ "cloud-communication-platform": "Cloud Communication Platform",
181
+ "cloud-management": "Cloud Management",
182
+ "cloud-pbx": "Cloud PBX",
183
+ "cloud-security": "Cloud Security",
184
+ "cloud-storage": "Cloud Storage",
185
+ "club-management": "Club Management",
186
+ "cmdb": "CMDB",
187
+ "cmms": "CMMS",
188
+ "coaching": "Coaching",
189
+ "code-enforcement": "Code Enforcement",
190
+ "collaboration": "Collaboration",
191
+ "commercial-insurance": "Commercial Insurance",
192
+ "commercial-loan": "Commercial Loan",
193
+ "commercial-property-management": "Commercial Property Management",
194
+ "commercial-real-estate": "Commercial Real Estate",
195
+ "commission": "Commission",
196
+ "community": "Community",
197
+ "company-secretarial": "Company Secretarial",
198
+ "compensation-management": "Compensation Management",
199
+ "competitive-intelligence": "Competitive Intelligence",
200
+ "competitor-price-monitoring": "Competitor Price Monitoring",
201
+ "complaint-management": "Complaint Management",
202
+ "compliance": "Compliance",
203
+ "computer-repair-shop": "Computer Repair Shop",
204
+ "computer-security": "Computer Security",
205
+ "computeraided-manufacturing-cam": "Computer-Aided Manufacturing (CAM)",
206
+ "conference": "Conference",
207
+ "configuration-tools": "Configuration Management Tools",
208
+ "conflict-checking": "Conflict Checking",
209
+ "consignment": "Consignment",
210
+ "construction-accounting": "Construction Accounting",
211
+ "construction-bid-management": "Construction Bid Management",
212
+ "construction-crm": "Construction CRM",
213
+ "construction-estimating": "Construction Estimating",
214
+ "construction-management": "Construction Management",
215
+ "construction-scheduling": "Construction Scheduling",
216
+ "contact-center": "Contact Center",
217
+ "contact-center-quality-assurance": "Contact Center Quality Assurance",
218
+ "contact-management": "Contact Management",
219
+ "container-security": "Container Security",
220
+ "content-collaboration": "Content Collaboration",
221
+ "content-delivery-network": "Content Delivery Network",
222
+ "content-management": "Content Management",
223
+ "content-marketing": "Content Marketing",
224
+ "contest": "Contest",
225
+ "continuous-integration": "Continuous Integration",
226
+ "contract-management": "Contract Management",
227
+ "contractor-management": "Contractor Management",
228
+ "convenience-store": "Convenience Store",
229
+ "conversation-intelligence": "Conversation Intelligence",
230
+ "conversational-ai-platform": "Conversational AI Platform",
231
+ "conversational-marketing-platform": "Conversational Marketing Platform",
232
+ "corporate-social-responsibility": "Corporate Social Responsibility (CSR)",
233
+ "corporate-tax": "Corporate Tax",
234
+ "corporate-wellness": "Corporate Wellness",
235
+ "corrective-and-preventive-action": "Corrective and Preventive Action",
236
+ "courier": "Courier",
237
+ "course-authoring": "Course Authoring",
238
+ "court-management": "Court Management",
239
+ "cpq": "CPQ",
240
+ "creative-management": "Creative Management",
241
+ "credentialing": "Credentialing",
242
+ "cryptocurrency-exchange": "Cryptocurrency Exchange",
243
+ "cryptocurrency-wallets": "Cryptocurrency Wallets",
244
+ "ctrm": "CTRM",
245
+ "currency-exchange": "Currency Exchange",
246
+ "customer-advocacy": "Customer Advocacy",
247
+ "customer-communications-management": "Customer Communications Management",
248
+ "customer-data-platform": "Customer Data Platform",
249
+ "customer-engagement": "Customer Engagement",
250
+ "customer-experience": "Customer Experience",
251
+ "customer-journey-mapping-tools": "Customer Journey Mapping Tools",
252
+ "customer-loyalty": "Customer Loyalty",
253
+ "customer-reference-management": "Customer Reference Management",
254
+ "customer-relationship-management": "CRM",
255
+ "customer-retention": "Customer Retention",
256
+ "customer-satisfaction": "Customer Satisfaction",
257
+ "customer-service": "Customer Service",
258
+ "customer-success": "Customer Success",
259
+ "customer-support": "Customer Support",
260
+ "customer-training": "Customer Training",
261
+ "cybersecurity": "Cybersecurity",
262
+ "daas": "Desktop as a Service (DaaS)",
263
+ "dance-studio": "Dance Studio",
264
+ "dashboard": "Dashboard",
265
+ "data-analysis": "Data Analysis",
266
+ "data-catalog": "Data Catalog",
267
+ "data-center-management": "Data Center Management",
268
+ "data-collection": "Data Collection",
269
+ "data-discovery": "Data Discovery",
270
+ "data-entry": "Data Entry",
271
+ "data-extraction": "Data Extraction",
272
+ "data-governance": "Data Governance",
273
+ "data-loss-prevention": "Data Loss Prevention",
274
+ "data-management": "Data Management",
275
+ "data-management-platforms": "Data Management Platforms",
276
+ "data-mining": "Data Mining",
277
+ "data-preparation": "Data Preparation",
278
+ "data-privacy": "Data Privacy",
279
+ "data-quality": "Data Quality",
280
+ "data-visualization": "Data Visualization",
281
+ "data-warehouse": "Data Warehouse",
282
+ "database-management": "Database",
283
+ "database-monitoring": "Database Monitoring",
284
+ "ddos-protection": "DDoS Protection",
285
+ "debt-collection": "Debt Collection",
286
+ "decision-support": "Decision Support",
287
+ "deep-learning": "Deep Learning",
288
+ "dei": "DEI (Diversity, Equity &amp; Inclusion)",
289
+ "delivery-management": "Delivery Management",
290
+ "demand-planning": "Demand Planning",
291
+ "demand-side-platform": "Demand Side Platform (DSP)",
292
+ "demo": "Demo",
293
+ "dental": "Dental",
294
+ "dental-charting": "Dental Charting",
295
+ "dental-imaging": "Dental Imaging",
296
+ "dermatology": "Dermatology",
297
+ "dermatology-emr": "Dermatology EMR",
298
+ "desk-booking": "Desk Booking",
299
+ "devops": "DevOps",
300
+ "diagram": "Diagram",
301
+ "digital-adoption-platform": "Digital Adoption Platform",
302
+ "digital-asset-management": "Digital Asset Management",
303
+ "digital-forensics": "Digital Forensics",
304
+ "digital-rights-management": "Digital Rights Management",
305
+ "digital-signage": "Digital Signage",
306
+ "digital-signature": "Digital Signature",
307
+ "digital-workplace": "Digital Workplace",
308
+ "direct-deposit-payroll": "Direct Deposit Payroll",
309
+ "direct-mail-automation": "Direct Mail Automation",
310
+ "directory": "Directory",
311
+ "disaster-recovery": "Disaster Recovery",
312
+ "disk-imaging": "Disk Imaging",
313
+ "display-advertising": "Display Advertising",
314
+ "distribution": "Distribution",
315
+ "distribution-accounting": "Distribution Accounting",
316
+ "dock-scheduling": "Dock Scheduling",
317
+ "docketing": "Docketing",
318
+ "document-control": "Document Control",
319
+ "document-generation": "Document Generation",
320
+ "document-management": "Document Management",
321
+ "document-version-control": "Document Version Control",
322
+ "donation-management": "Donation Management",
323
+ "driving-school": "Driving School",
324
+ "dropshipping": "Dropshipping",
325
+ "dry-cleaning": "Dry Cleaning",
326
+ "dxp": "Digital Experience Platforms (DXP)",
327
+ "eam": "EAM",
328
+ "earthwork-estimating-excavation": "Earthwork Estimating",
329
+ "ecommerce": "eCommerce",
330
+ "edi": "EDI",
331
+ "ehs-management": "EHS Management",
332
+ "elearning-authoring-tools": "eLearning Authoring Tools",
333
+ "electrical-contractor": "Electrical Contractor",
334
+ "electrical-design": "Electrical Design",
335
+ "electrical-estimating": "Electrical Estimating",
336
+ "electronic-data-capture": "Electronic Data Capture",
337
+ "electronic-discovery": "Electronic Discovery",
338
+ "electronic-lab-notebook": "Electronic Lab Notebook",
339
+ "electronic-medical-records": "Electronic Medical Records",
340
+ "email-archiving": "Email Archiving",
341
+ "email-management": "Email Management",
342
+ "email-marketing": "Email Marketing",
343
+ "email-security": "Email Security",
344
+ "email-signature": "Email Signature",
345
+ "email-tracking": "Email Tracking",
346
+ "email-verification-tools": "Email Verification Tools",
347
+ "emar": "eMAR",
348
+ "embedded-analytics": "Embedded Analytics",
349
+ "emergency-notification": "Emergency Notification",
350
+ "emissions-management": "Emissions Management",
351
+ "employee-advocacy": "Employee Advocacy",
352
+ "employee-communication-tools": "Employee Communication Tools",
353
+ "employee-engagement": "Employee Engagement",
354
+ "employee-monitoring": "Employee Monitoring",
355
+ "employee-recognition": "Employee Recognition",
356
+ "employee-scheduling": "Employee Scheduling",
357
+ "ems": "EMS",
358
+ "encryption": "Encryption",
359
+ "endpoint-detection-and-response": "Endpoint Detection and Response",
360
+ "endpoint-protection": "Endpoint Protection",
361
+ "energy-management": "Energy Management",
362
+ "engineering-accounting": "Engineering Accounting",
363
+ "engineering-cad": "Engineering CAD",
364
+ "enterprise-architecture": "Enterprise Architecture",
365
+ "enterprise-content-management": "Enterprise Content Management",
366
+ "enterprise-legal-management": "Enterprise Legal Management",
367
+ "enterprise-resource-planning": "Enterprise Resource Planning",
368
+ "enterprise-search": "Enterprise Search",
369
+ "entity-management": "Entity Management",
370
+ "environmental": "Environmental",
371
+ "eor-employer-of-record": "EOR (Employer of Record)",
372
+ "eprescribing": "e-Prescribing",
373
+ "equipment-maintenance": "Equipment Maintenance",
374
+ "equipment-rental": "Equipment Rental",
375
+ "equity-management": "Equity Management",
376
+ "erm": "ERM",
377
+ "esb": "Enterprise Service Bus (ESB)",
378
+ "esg": "ESG",
379
+ "etl": "ETL",
380
+ "event-booking": "Event Booking",
381
+ "event-check-in": "Event Check In",
382
+ "event-management": "Event Management",
383
+ "event-marketing": "Event Marketing",
384
+ "event-rental": "Event Rental",
385
+ "exam": "Exam",
386
+ "expense-report": "Expense Report",
387
+ "facial-recognition": "Facial Recognition",
388
+ "facilities-management-for-schools": "School Facilities Management",
389
+ "facility-management": "Facility Management",
390
+ "family-law": "Family Law",
391
+ "family-practice-electronic-medical-records-emr": "Family Practice Electronic Medical Records",
392
+ "farm-management": "Farm Management",
393
+ "fashion-design-and-production": "Fashion Design",
394
+ "fax-server": "Fax Server",
395
+ "festival-management": "Festival Management",
396
+ "field-sales": "Field Sales",
397
+ "field-service-management": "Field Service Management",
398
+ "file-sharing": "File Sharing",
399
+ "file-sync": "File Sync",
400
+ "financial-close": "Financial Close",
401
+ "financial-crm": "Financial CRM",
402
+ "financial-fraud-detection": "Financial Fraud Detection",
403
+ "financial-management": "Financial Management",
404
+ "financial-reporting": "Financial Reporting",
405
+ "financial-risk-management": "Financial Risk Management",
406
+ "financial-services": "Financial Services",
407
+ "fire-department": "Fire Department",
408
+ "firewall": "Firewall",
409
+ "fitness": "Fitness",
410
+ "fixed-asset-management": "Fixed Asset Management",
411
+ "fleet-maintenance": "Fleet Maintenance",
412
+ "fleet-management": "Fleet Management",
413
+ "floor-plan": "Floor Plan",
414
+ "florist": "Florist",
415
+ "flowchart": "Flowchart",
416
+ "food-beverage-manufacturing-erp": "Food Manufacturing",
417
+ "food-costing": "Food Costing",
418
+ "food-delivery": "Food Delivery",
419
+ "food-service-distribution": "Food Service Distribution",
420
+ "food-service-management": "Food Service Management",
421
+ "food-traceability": "Food Traceability",
422
+ "food-truck-pos-systems": "Food Truck POS Systems",
423
+ "forestry": "Forestry",
424
+ "form-builder": "Form Builder",
425
+ "forms-automation": "Forms Automation",
426
+ "franchise-management": "Franchise Management",
427
+ "freight": "Freight",
428
+ "fuel-management": "Fuel Management",
429
+ "fund-accounting": "Fund Accounting",
430
+ "fundraising": "Fundraising",
431
+ "funeral-home": "Funeral Home",
432
+ "game-development": "Game Development",
433
+ "gamification": "Gamification",
434
+ "gantt-chart": "Gantt Chart",
435
+ "garage-door": "Garage Door",
436
+ "garden-center": "Garden Center",
437
+ "gdpr-compliance": "GDPR Compliance",
438
+ "general-ledger": "General Ledger",
439
+ "generative-ai": "Generative AI",
440
+ "gis": "GIS",
441
+ "golf-course": "Golf Course",
442
+ "government": "Government",
443
+ "gps-tracking": "GPS Tracking",
444
+ "gradebook": "Gradebook",
445
+ "grant-management": "Grant Management",
446
+ "graphic-design": "Graphic Design",
447
+ "grc": "Governance, Risk and Compliance (GRC)",
448
+ "gym-management": "Gym Management",
449
+ "gymnastics": "Gymnastics",
450
+ "handyman": "Handyman",
451
+ "headless-cms-platform": "Headless CMS",
452
+ "headless-ecommerce-platform": "Headless eCommerce",
453
+ "healthcare-crm": "Healthcare CRM",
454
+ "healthcare-lms": "Healthcare LMS",
455
+ "heatmap": "Heatmap",
456
+ "hedge-fund": "Hedge Fund",
457
+ "help-desk": "Help Desk",
458
+ "higher-education": "Higher Education",
459
+ "hipaa-compliance": "HIPAA Compliance",
460
+ "hoa": "HOA",
461
+ "home-builder": "Home Builder",
462
+ "home-care": "Home Care",
463
+ "home-health-care": "Home Health Care",
464
+ "home-inspection": "Home Inspection",
465
+ "horse": "Horse",
466
+ "hospice": "Hospice",
467
+ "hospital-management": "Hospital Management",
468
+ "hospitality-lms": "Hospitality LMS",
469
+ "hospitality-property-management": "Hospitality Property Management",
470
+ "hostel-management": "Hostel Management",
471
+ "hotel-channel-management": "Hotel Channel Management",
472
+ "hr-analytics": "HR Analytics",
473
+ "human-resource": "Human Resources",
474
+ "human-services": "Human Services",
475
+ "hvac": "HVAC",
476
+ "hvac-estimating": "HVAC Estimating",
477
+ "hybrid-events": "Hybrid Events",
478
+ "ide": "Integrated Development Environment (IDE)",
479
+ "idea-management": "Idea Management",
480
+ "identity-management": "Identity Management",
481
+ "identity-threat-detection-and-response": "Identity Threat Detection and Response (ITDR)",
482
+ "identity-verification": "Identity Verification",
483
+ "image-recognition": "Image Recognition",
484
+ "incident-management": "Incident Management",
485
+ "influencer-marketing": "Influencer Marketing",
486
+ "infrastructure-as-a-service-solutions": "Infrastructure as a Service (IaaS)",
487
+ "innovation": "Innovation Management",
488
+ "inside-sales": "Inside Sales",
489
+ "insight-engines": "Insight Engines",
490
+ "inspection": "Inspection",
491
+ "insurance-agency": "Insurance",
492
+ "insurance-crm": "Insurance CRM",
493
+ "insurance-policy": "Insurance Policy",
494
+ "insurance-rating": "Insurance Rating",
495
+ "integrated-risk-management": "Integrated Risk Management",
496
+ "integration": "Integration",
497
+ "intellectual-property-management": "Intellectual Property Management",
498
+ "internal-communications": "Internal Communications",
499
+ "intranet": "Intranet",
500
+ "inventory-control": "Inventory Control",
501
+ "inventory-management": "Inventory Management",
502
+ "investigation-management": "Investigation Management",
503
+ "investment-management": "Investment Management",
504
+ "iot": "IoT",
505
+ "iot-analytics": "IoT Analytics",
506
+ "ipaas": "iPaaS",
507
+ "ipad-kiosk": "iPad Kiosk",
508
+ "ipad-pos": "iPad POS",
509
+ "issue-tracking": "Issue Tracking",
510
+ "it-asset-management": "IT Asset Management",
511
+ "it-documentation": "IT Documentation",
512
+ "it-management": "IT Management",
513
+ "it-project-management": "IT Project Management",
514
+ "it-service": "IT Service",
515
+ "it-ticketing-systems": "IT Ticketing Systems",
516
+ "itsm": "ITSM",
517
+ "ivr": "IVR",
518
+ "iwms": "IWMS",
519
+ "jail-management": "Jail Management",
520
+ "janitorial": "Janitorial",
521
+ "java-cms": "Java CMS",
522
+ "jewelry-store-management": "Jewelry Store Management",
523
+ "job-board": "Job Board",
524
+ "job-costing": "Job Costing",
525
+ "job-evaluation": "Job Evaluation",
526
+ "job-shop": "Job Shop",
527
+ "k-12": "K-12",
528
+ "kanban-tools": "Kanban Tools",
529
+ "kennel": "Kennel",
530
+ "key-management": "Key Management",
531
+ "kiosk": "Kiosk",
532
+ "knowledge-base": "Knowledge Base",
533
+ "knowledge-management": "Knowledge Management",
534
+ "kpi": "KPI",
535
+ "kyc": "KYC",
536
+ "label-printing": "Label Printing",
537
+ "laboratory-information-management-system": "Laboratory Information Management System",
538
+ "laboratory-information-system": "Laboratory Information Systems (LIS)",
539
+ "land-management": "Land Management",
540
+ "landing-page": "Landing Page",
541
+ "landscape": "Landscape",
542
+ "language-learning": "Language Learning",
543
+ "law-enforcement": "Law Enforcement",
544
+ "law-practice-management": "Law Practice Management",
545
+ "lawn-care": "Lawn Care",
546
+ "lead-capture": "Lead Capture",
547
+ "lead-generation": "Lead Generation",
548
+ "lead-management": "Lead Management",
549
+ "lead-nurturing": "Lead Nurturing",
550
+ "learning-experience-platform": "Learning Experience Platform",
551
+ "learning-management-system": "Learning Management System",
552
+ "lease-accounting": "Lease Accounting",
553
+ "lease-management": "Lease Management",
554
+ "leave-management-system": "Leave Management System",
555
+ "legal-accounting": "Legal Accounting",
556
+ "legal-billing": "Legal Billing",
557
+ "legal-calendar": "Legal Calendar",
558
+ "legal-case-management": "Legal Case Management",
559
+ "legal-document-management": "Legal Document Management",
560
+ "legal-research": "Legal Research",
561
+ "library-automation": "Library Automation",
562
+ "license-management": "License Management",
563
+ "link-management-tools": "Link Management Tools",
564
+ "liquor-store-pos": "Liquor Store POS",
565
+ "live-chat": "Live Chat",
566
+ "live-streaming": "Live Streaming",
567
+ "load-balancing": "Load Balancing",
568
+ "load-testing": "Load Testing",
569
+ "loan-origination": "Loan Origination",
570
+ "loan-servicing": "Loan Servicing",
571
+ "local-seo-tools": "Local SEO Tools",
572
+ "localization": "Localization",
573
+ "location-intelligence": "Location Intelligence",
574
+ "locksmith": "Locksmith",
575
+ "log-analysis": "Log Analysis",
576
+ "log-management": "Log Management",
577
+ "logbook": "Logbook",
578
+ "logistics": "Logistics",
579
+ "long-term-care": "Long Term Care",
580
+ "lost-and-found": "Lost and Found",
581
+ "low-code-development-platform": "Low Code Development Platform",
582
+ "mac-crm": "Mac CRM",
583
+ "machine-learning": "Machine Learning",
584
+ "maid-service": "Maid Service",
585
+ "mailroom-management": "Mailroom Management",
586
+ "maintenance-management": "Maintenance Management",
587
+ "manufacturing": "Manufacturing",
588
+ "manufacturing-execution": "Manufacturing Execution",
589
+ "manufacturing-inventory-management": "Manufacturing Inventory Management",
590
+ "marine": "Marine",
591
+ "market-research": "Market Research",
592
+ "marketing-analytics": "Marketing Analytics",
593
+ "marketing-attribution": "Marketing Attribution",
594
+ "marketing-automation": "Marketing Automation",
595
+ "marketing-planning": "Marketing Planning",
596
+ "marketplace": "Marketplace",
597
+ "martial-arts": "Martial Arts",
598
+ "massage-therapy": "Massage Therapy",
599
+ "master-data-management": "Master Data Management",
600
+ "medical-accounting": "Medical Accounting",
601
+ "medical-billing": "Medical Billing",
602
+ "medical-imaging": "Medical Imaging",
603
+ "medical-inventory": "Medical Inventory",
604
+ "medical-lab": "Medical Lab",
605
+ "medical-practice-management": "Medical Practice Management",
606
+ "medical-scheduling": "Medical Scheduling",
607
+ "medical-spa": "Medical Spa",
608
+ "medical-transcription": "Medical Transcription",
609
+ "meeting": "Meeting",
610
+ "meeting-room-booking-system": "Meeting Room Booking System",
611
+ "membership-management": "Membership Management",
612
+ "mental-health": "Mental Health",
613
+ "mental-health-ehr": "Mental Health EHR",
614
+ "mentoring": "Mentoring",
615
+ "metadata-management": "Metadata Management",
616
+ "metal-fabrication": "Metal Fabrication",
617
+ "microlearning": "Microlearning",
618
+ "mileage-tracking": "Mileage Tracking",
619
+ "mind-mapping": "Mind Mapping",
620
+ "mining": "Mining",
621
+ "mlm": "MLM",
622
+ "mobile-analytics": "Mobile Analytics",
623
+ "mobile-banking": "Mobile Banking",
624
+ "mobile-content-management-system": "Mobile Content Management System",
625
+ "mobile-credit-card-processing": "Mobile Credit Card Processing",
626
+ "mobile-device-management": "Mobile Device Management",
627
+ "mobile-event-apps": "Mobile Event Apps",
628
+ "mobile-home-park-management": "Mobile Home Park Management",
629
+ "mobile-learning": "Mobile Learning",
630
+ "mobile-marketing": "Mobile Marketing",
631
+ "mobility": "Mobility",
632
+ "mortgage-and-loans": "Mortgage",
633
+ "motel": "Motel",
634
+ "moving": "Moving",
635
+ "mrm": "MRM",
636
+ "mrp": "MRP",
637
+ "msp": "Managed Service Providers (MSP)",
638
+ "multi-channel-ecommerce": "Multi-Channel eCommerce",
639
+ "multi-factor-authentication": "Multi-Factor Authentication",
640
+ "multicountry-payroll": "Multi-Country Payroll",
641
+ "municipal": "Municipal",
642
+ "museum": "Museum",
643
+ "music-school": "Music School",
644
+ "natural-language-processing": "Natural Language Processing (NLP)",
645
+ "network-access-control": "Network Access Control (NAC)",
646
+ "network-management": "Network Management",
647
+ "network-mapping": "Network Mapping",
648
+ "network-monitoring": "Network Monitoring",
649
+ "network-security": "Network Security",
650
+ "network-troubleshooting": "Network Troubleshooting",
651
+ "neurology-emr": "Neurology EMR",
652
+ "nft-creation": "NFT Creation",
653
+ "no-code-platform": "No Code Platform",
654
+ "nonprofit": "Nonprofit",
655
+ "nonprofit-accounting": "Nonprofit Accounting",
656
+ "nonprofit-crm": "Nonprofit CRM",
657
+ "nosql-databases": "NoSQL Databases",
658
+ "note-taking": "Note-Taking",
659
+ "nps": "NPS",
660
+ "nurse-scheduling": "Nurse Scheduling",
661
+ "nursing-home": "Nursing Home",
662
+ "nutrition-analysis": "Nutrition Analysis",
663
+ "nutritionist": "Nutritionist",
664
+ "obgyn-emr": "OBGYN EMR",
665
+ "observability": "Observability",
666
+ "occupational-health": "Occupational Health",
667
+ "occupational-therapy": "Occupational Therapy",
668
+ "ocr": "OCR",
669
+ "oee": "OEE",
670
+ "oil-and-gas": "Oil and Gas",
671
+ "okr": "OKR",
672
+ "onboarding": "Onboarding",
673
+ "online-banking": "Online Banking",
674
+ "online-crm": "Online CRM",
675
+ "online-ordering": "Online Ordering",
676
+ "online-proofing": "Online Proofing",
677
+ "operating-systems": "Operating Systems",
678
+ "ophthalmology-emr": "Ophthalmology EMR",
679
+ "optometry": "Optometry",
680
+ "order-entry": "Order Entry",
681
+ "order-fulfillment": "Order Fulfillment",
682
+ "order-management": "Order Management",
683
+ "org-chart": "Org Chart",
684
+ "orthopedic-emr": "Orthopedic EMR",
685
+ "other-artificial-intelligence-ai": "Other Artificial Intelligence (AI) Software",
686
+ "other-business": "Other Business Software",
687
+ "other-construction": "Other Construction Software",
688
+ "other-education-learning": "Other Education &amp; Learning Software",
689
+ "other-finance-accounting": "Other Finance &amp; Accounting Software",
690
+ "other-health-medical": "Other Health &amp; Medical Software",
691
+ "other-hr": "Other HR Software",
692
+ "other-it-development-solutions": "Other IT &amp; Software Development Solutions",
693
+ "other-legal": "Other Legal Software",
694
+ "other-marketing": "Other Marketing Software",
695
+ "p-c-insurance": "P&amp;C Insurance",
696
+ "packaging": "Packaging",
697
+ "pacs": "PACS",
698
+ "pain-management-emr": "Pain Management EMR",
699
+ "parcel-audit": "Parcel Audit",
700
+ "parking-management": "Parking Management",
701
+ "parks-and-recreation": "Parks and Recreation",
702
+ "partner-management": "Partner Management",
703
+ "password-management": "Password Management",
704
+ "patch-management": "Patch Management",
705
+ "patient-case-management": "Patient Case Management",
706
+ "patient-engagement": "Patient Engagement",
707
+ "patient-management": "Patient Management",
708
+ "patient-portal": "Patient Portal",
709
+ "patient-scheduling": "Patient Scheduling",
710
+ "pawn-shop": "Pawn Shop",
711
+ "payment-processing": "Payment Processing",
712
+ "payroll": "Payroll",
713
+ "pci-compliance": "PCI Compliance",
714
+ "pdf": "PDF",
715
+ "pdf-editor": "PDF Editor",
716
+ "pediatric": "Pediatric",
717
+ "penetration-testing": "Penetration Testing",
718
+ "peo": "PEO",
719
+ "performance-appraisal": "Performance Management System",
720
+ "performance-testing": "Performance Testing",
721
+ "permit": "Permit",
722
+ "personal-trainer": "Personal Trainer",
723
+ "personalization": "Personalization",
724
+ "pest-control": "Pest Control",
725
+ "pet-grooming": "Pet Grooming",
726
+ "pet-sitting": "Pet Sitting",
727
+ "pharmacy": "Pharmacy",
728
+ "photo-editing": "Photo Editing",
729
+ "photography-studio": "Photography Studio",
730
+ "physical-security": "Physical Security",
731
+ "physical-therapy": "Physical Therapy",
732
+ "pilates-studio": "Pilates Studio",
733
+ "pim": "PIM",
734
+ "plagiarism-checker": "Plagiarism Checker",
735
+ "plastic-surgery": "Plastic Surgery",
736
+ "platform-as-a-service": "Platform as a Service (PaaS)",
737
+ "plumbing": "Plumbing",
738
+ "plumbing-estimating": "Plumbing Estimating",
739
+ "podcast-hosting": "Podcast Hosting",
740
+ "podiatry": "Podiatry",
741
+ "podiatry-emr": "Podiatry EMR",
742
+ "point-of-sale": "Point of Sale",
743
+ "policy-management": "Policy Management",
744
+ "political-campaign": "Political Campaign",
745
+ "polling": "Polling",
746
+ "pool-service": "Pool Service",
747
+ "portal": "Portal",
748
+ "ppc": "PPC",
749
+ "pre-employment-testing": "Pre-employment Testing",
750
+ "predictive-analytics": "Predictive Analytics",
751
+ "predictive-dialer": "Predictive Dialer",
752
+ "predictive-lead-scoring": "Predictive Lead Scoring",
753
+ "presentation": "Presentation",
754
+ "preventive-maintenance": "Preventive Maintenance",
755
+ "pricing-optimization": "Pricing Optimization",
756
+ "primary-care-ehr": "Primary Care EHR",
757
+ "print-estimating": "Print Estimating",
758
+ "print-management": "Print Management",
759
+ "privileged-access-management": "Privileged Access Management",
760
+ "proctoring": "Proctoring",
761
+ "procure-to-pay": "Procure to Pay",
762
+ "procurement": "Procurement",
763
+ "product-analytics": "Product Analytics",
764
+ "product-configurator": "Product Configurator",
765
+ "product-data-management": "Product Data Management",
766
+ "product-lifecycle-management": "Product Lifecycle Management",
767
+ "product-management": "Product Management",
768
+ "product-roadmap": "Product Roadmap",
769
+ "production-scheduling": "Production Scheduling",
770
+ "productivity": "Productivity",
771
+ "professional-services-automation": "Professional Services Automation",
772
+ "project-accounting": "Project Accounting",
773
+ "project-management": "Project Management",
774
+ "project-management-software-for-nonprofits": "Nonprofit Project Management",
775
+ "project-planning": "Project Planning",
776
+ "project-portfolio-management": "Project Portfolio Management",
777
+ "project-tracking": "Project Tracking",
778
+ "proofreading": "Proofreading",
779
+ "property-management-accounting": "Property Management Accounting",
780
+ "proposal-management": "Proposal Management",
781
+ "prototyping": "Prototyping",
782
+ "psychiatry-electronic-medical-records-emr": "Psychiatry Electronic Medical Records",
783
+ "public-relations": "Public Relations",
784
+ "public-transportation": "Public Transportation",
785
+ "public-works": "Public Works",
786
+ "publishing-and-subscriptions": "Publishing and Subscriptions",
787
+ "punch-list": "Punch List",
788
+ "purchasing": "Purchasing",
789
+ "push-notifications": "Push Notifications",
790
+ "qr-code-generator": "QR Code Generator",
791
+ "qualitative-data-analysis": "Qualitative Data Analysis",
792
+ "quality-management": "Quality Management",
793
+ "quoting": "Quoting",
794
+ "radiology": "Radiology",
795
+ "real-estate-accounting": "Real Estate Accounting",
796
+ "real-estate-agency": "Real Estate Agency",
797
+ "real-estate-cma": "Real Estate CMA",
798
+ "real-estate-crm": "Real Estate CRM",
799
+ "real-estate-property-management": "Real Estate Property Management",
800
+ "real-estate-transaction-management": "Real Estate Transaction Management",
801
+ "recruiting": "Recruiting",
802
+ "recruiting-agency": "Recruiting Agency",
803
+ "recruitment-marketing-platforms": "Recruitment Marketing Platforms",
804
+ "recurring-billing": "Recurring Billing",
805
+ "recycling": "Recycling",
806
+ "reference-check": "Reference Check",
807
+ "referral": "Referral",
808
+ "registration": "Registration",
809
+ "relocation": "Relocation",
810
+ "remodeling-estimating": "Remodeling Estimating",
811
+ "remote-desktop": "Remote Desktop",
812
+ "remote-monitoring-and-management": "Remote Monitoring and Management",
813
+ "remote-patient-monitoring": "Remote Patient Monitoring",
814
+ "remote-support": "Remote Support",
815
+ "remote-work": "Remote Work",
816
+ "rental": "Rental",
817
+ "rental-property-management": "Property Management",
818
+ "reporting": "Reporting",
819
+ "reputation-management": "Reputation Management",
820
+ "requirements-management": "Requirements Management",
821
+ "reservations": "Reservations",
822
+ "residential-construction-estimating": "Residential Construction Estimating",
823
+ "resource-management": "Resource Management",
824
+ "restaurant-management": "Restaurant Management",
825
+ "restaurant-pos": "Restaurant POS",
826
+ "retail-execution": "Retail Execution",
827
+ "retail-intelligence": "Retail Intelligence",
828
+ "retail-management-systems": "Retail Management Systems",
829
+ "retail-pos-system": "Retail POS System",
830
+ "returns-management": "Returns Management (RMS)",
831
+ "revenue-cycle-management": "Revenue Cycle Management",
832
+ "revenue-management": "Revenue Management",
833
+ "revenue-recognition": "Revenue Recognition",
834
+ "review-management": "Review Management",
835
+ "rfp": "RFP",
836
+ "risk-management": "Risk Management",
837
+ "robotic-process-automation": "Robotic Process Automation",
838
+ "roofing": "Roofing",
839
+ "route-planning": "Route Planning",
840
+ "saas-management": "SaaS Management",
841
+ "safety-management": "Safety Management",
842
+ "sales-coaching": "Sales Coaching",
843
+ "sales-content-management": "Sales Content Management",
844
+ "sales-enablement": "Sales Enablement",
845
+ "sales-engagement-platform": "Sales Engagement Platform",
846
+ "sales-force-automation": "Sales Force Automation",
847
+ "sales-forecasting": "Sales Forecasting",
848
+ "sales-intelligence": "Sales Intelligence",
849
+ "sales-performance-management": "Sales Performance Management",
850
+ "sales-tax": "Sales Tax",
851
+ "sales-tracking": "Sales Tracking",
852
+ "salon": "Salon",
853
+ "sast": "Static Application Security Testing (SAST)",
854
+ "scada": "SCADA",
855
+ "scheduling": "Scheduling",
856
+ "scholarship-management": "Scholarship Management",
857
+ "school-accounting": "School Accounting",
858
+ "school-administration": "School Management",
859
+ "school-bus-routing": "School Bus Routing",
860
+ "screen-recording": "Screen Recording",
861
+ "screen-sharing": "Screen Sharing",
862
+ "screenwriting": "Screenwriting",
863
+ "scrum": "Scrum",
864
+ "secure-email-gateway": "Secure Email Gateway",
865
+ "security-awareness-training": "Security Awareness Training",
866
+ "security-system-installer": "Security System Installer",
867
+ "self-service-password-reset": "Self-Service Password Reset (SSPR)",
868
+ "self-storage": "Self Storage",
869
+ "seo": "SEO",
870
+ "server-backup": "Server Backup",
871
+ "server-management": "Server Management",
872
+ "server-monitoring": "Server Monitoring",
873
+ "service-desk": "Service Desk",
874
+ "service-dispatch": "Service Dispatch",
875
+ "shipment-tracking": "Shipment Tracking",
876
+ "shipping": "Shipping",
877
+ "shopping-cart": "Shopping Cart",
878
+ "siem": "SIEM",
879
+ "simulation": "Simulation",
880
+ "single-sign-on": "Single Sign On",
881
+ "small-business-crm": "Small Business CRM",
882
+ "small-business-ecommerce": "Small Business eCommerce",
883
+ "sms-marketing": "SMS Marketing",
884
+ "sms-survey": "SMS Survey",
885
+ "soar": "SOAR",
886
+ "social-crm-tools": "Social CRM Tools",
887
+ "social-listening-tools": "Social Listening Tools",
888
+ "social-media-analytics-tools": "Social Media Analytics Tools",
889
+ "social-media-management": "Social Media Management",
890
+ "social-media-marketing": "Social Media Marketing",
891
+ "social-media-monitoring": "Social Media Monitoring",
892
+ "social-networking": "Social Networking",
893
+ "social-selling": "Social Selling",
894
+ "social-work-case-management": "Social Work Case Management",
895
+ "softphone": "Softphone",
896
+ "solar": "Solar",
897
+ "source-code-management": "Source Code Management",
898
+ "sourcing": "Sourcing",
899
+ "spa": "Spa",
900
+ "space-management": "Space Management",
901
+ "spc": "SPC",
902
+ "speech-analytics": "Speech Analytics",
903
+ "speech-recognition": "Speech Recognition",
904
+ "speech-therapy": "Speech Therapy",
905
+ "spend-management": "Spend Management",
906
+ "sports-league": "Sports League",
907
+ "spreadsheet": "Spreadsheet",
908
+ "staffing-agency": "Staffing Agency",
909
+ "statistical-analysis": "Statistical Analysis",
910
+ "stock-portfolio-management": "Stock Portfolio Management",
911
+ "store-locator": "Store Locator",
912
+ "strategic-planning": "Strategic Planning",
913
+ "student-engagement-platform": "Student Engagement Platform",
914
+ "student-information-system": "Student Information System",
915
+ "subcontractor": "Subcontractor",
916
+ "subscription-management": "Subscription Management",
917
+ "substance-abuse-emr": "Substance Abuse EMR",
918
+ "succession-planning": "Succession Planning",
919
+ "supply-chain-management": "Supply Chain Management",
920
+ "survey": "Survey",
921
+ "sustainability": "Sustainability",
922
+ "swim-school": "Swim School",
923
+ "takeoff": "Takeoff",
924
+ "talent-management": "Talent Management",
925
+ "task-management": "Task Management",
926
+ "tattoo-studio": "Tattoo Studio",
927
+ "tax-practice-management": "Tax Practice Management",
928
+ "tax-preparation": "Tax Preparation",
929
+ "team-communication": "Team Communication",
930
+ "team-management": "Team Management",
931
+ "telecom-expense-management": "Telecom Expense Management",
932
+ "telemarketing": "Telemarketing",
933
+ "telemedicine": "Telemedicine",
934
+ "telephony": "Telephony",
935
+ "test-management-tools": "Test Management Tools",
936
+ "text-mining": "Text Mining",
937
+ "text-to-speech": "Text-To-Speech",
938
+ "therapy": "Therapy",
939
+ "therapy-notes": "Therapy Notes",
940
+ "threat-intelligence": "Threat Intelligence",
941
+ "ticketing": "Ticketing",
942
+ "time-and-expense": "Time and Expense",
943
+ "time-clock": "Time Clock",
944
+ "time-tracking": "Time Tracking",
945
+ "timeshare": "Timeshare",
946
+ "tool-management": "Tool Management",
947
+ "tour-operator": "Tour Operator",
948
+ "towing": "Towing",
949
+ "trade-promotion-management": "Trade Promotion Management",
950
+ "training": "Training",
951
+ "transactional-email": "Transactional Email",
952
+ "transcription": "Transcription",
953
+ "translation-management": "Translation Management",
954
+ "transportation-dispatch": "Transportation Dispatch",
955
+ "transportation-management": "Transportation Management",
956
+ "travel-agency": "Travel Agency",
957
+ "travel-management": "Travel Management",
958
+ "treasury": "Treasury",
959
+ "trucking": "Trucking",
960
+ "trucking-accounting": "Trucking Accounting",
961
+ "trust-accounting": "Trust Accounting",
962
+ "tutoring": "Tutoring",
963
+ "ugc-platform": "UGC Platform",
964
+ "unified-communications": "Unified Communications",
965
+ "unified-endpoint-management": "Unified Endpoint Management (UEM)",
966
+ "urgent-care-emr": "Urgent Care EMR",
967
+ "url-shortener": "URL Shortener",
968
+ "urology-emr": "Urology EMR",
969
+ "user-testing": "User Testing",
970
+ "utility-billing": "Utility Billing",
971
+ "utility-management-systems": "Utility Management Systems",
972
+ "ux": "User Experience (UX)",
973
+ "vacation-rental": "Vacation Rental",
974
+ "vaccine-management": "Vaccine Management",
975
+ "vdi": "VDI",
976
+ "vector-graphics": "Vector Graphics",
977
+ "vendor-management": "Vendor Management",
978
+ "venue-management": "Venue Management",
979
+ "veterinary": "Veterinary",
980
+ "video-conferencing": "Video Conferencing",
981
+ "video-editing": "Video Editing",
982
+ "video-hosting": "Video Hosting",
983
+ "video-interviewing": "Video Interviewing",
984
+ "video-making": "Video Making",
985
+ "video-management": "Video Management",
986
+ "video-marketing": "Video Marketing",
987
+ "virtual-assistant": "Virtual Assistant",
988
+ "virtual-classroom": "Virtual Classroom",
989
+ "virtual-data-room": "Virtual Data Room",
990
+ "virtual-event": "Virtual Event",
991
+ "virtual-machine": "Virtual Machine",
992
+ "virtual-private-server": "Virtual Private Server",
993
+ "virtual-tour": "Virtual Tour",
994
+ "virtualization": "Virtualization",
995
+ "visitor-management": "Visitor Management",
996
+ "visual-search": "Visual Search",
997
+ "voip": "VoIP",
998
+ "volunteer-management": "Volunteer Management",
999
+ "voting": "Voting",
1000
+ "vpn": "VPN",
1001
+ "vr": "Virtual Reality (VR)",
1002
+ "vulnerability-management": "Vulnerability Management",
1003
+ "vulnerability-scanner": "Vulnerability Scanner",
1004
+ "waitlist": "Waitlist",
1005
+ "waiver": "Waiver",
1006
+ "warehouse-management": "Warehouse Management",
1007
+ "warranty-management": "Warranty Management",
1008
+ "workflow-management": "Workflow Management"
1009
+ }
1010
+ }
tasks/capterra/solution/site/implementation/clone/backend/db.py ADDED
@@ -0,0 +1,1414 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """SQLite persistence layer for the Capterra offline clone backend.
2
+
3
+ Owns the connection (WAL mode, foreign keys ON), the ordered migration
4
+ history recorded in ``schema_migrations``, deterministic fixture seeding,
5
+ and the review draft / revision / submission domain primitives. All state
6
+ lives in the data directory (env ``WEBSITEBENCH_DATA_DIR``, with a
7
+ compatibility fallback for older launchers; default the
8
+ ``data`` directory that is a SIBLING of ``clone/`` so the reload watcher
9
+ never sees database churn).
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ import hashlib
15
+ import hmac
16
+ import json
17
+ import os
18
+ import sqlite3
19
+ import threading
20
+ import uuid
21
+ from pathlib import Path
22
+ from typing import NamedTuple
23
+
24
+ SITE_ID = "capterra"
25
+ DB_FILENAME = "websitebench-capterra.sqlite3"
26
+ LEGACY_DB_FILENAME = "capterra.sqlite3"
27
+ FROZEN_CLOCK = "2026-07-25T12:00:00-04:00"
28
+
29
+ DATA_DIR_ENV = "CLAWBENCH_DATA_DIR"
30
+ WEBSITEBENCH_DATA_DIR_ENV = "WEBSITEBENCH_DATA_DIR"
31
+ ADMIN_TOKEN_ENV = "CLAWBENCH_ADMIN_TOKEN"
32
+ ADMIN_HOST_ENV = "CLAWBENCH_ADMIN_HOST"
33
+ WEBSITEBENCH_ADMIN_TOKEN_ENV = "WEBSITEBENCH_ADMIN_TOKEN"
34
+ WEBSITEBENCH_ADMIN_HOST_ENV = "WEBSITEBENCH_ADMIN_HOST"
35
+ TEST_FIXTURES_ENV = "CLAWBENCH_ENABLE_TEST_FIXTURES"
36
+ WEBSITEBENCH_TEST_FIXTURES_ENV = "WEBSITEBENCH_ENABLE_TEST_FIXTURES"
37
+ SESSION_SECRET_ENV = "CLAWBENCH_SESSION_SECRET"
38
+ WEBSITEBENCH_SESSION_SECRET_ENV = "WEBSITEBENCH_SESSION_SECRET"
39
+ SESSION_SECRET_DEFAULT = "capterra-session-secret-fixture"
40
+
41
+ PRODUCT_ID = "186596"
42
+ PRODUCT_NAME = "Notion"
43
+ PRODUCT_SLUG = "notion"
44
+ RECEIPT_CODE = "fixture-notion-474"
45
+ REVIEW_RATING = 4
46
+ REVIEW_TEXT = "Flexible workspace, steep learning curve."
47
+
48
+ PRIMARY_ACCOUNT = ("alex-green", "Alex Green", "alex.green@example.test")
49
+ SECONDARY_ACCOUNT = ("jordan-lee", "Jordan Lee", "jordan.lee@example.test")
50
+
51
+ CATALOG_PATH = Path(__file__).resolve().parent / "product-catalog.json"
52
+ _CATALOG_CACHE: dict | None = None
53
+
54
+
55
+ def load_product_catalog() -> dict:
56
+ """The extracted product catalog (see tools/extract_product_catalog.py)."""
57
+ global _CATALOG_CACHE
58
+ if _CATALOG_CACHE is None:
59
+ _CATALOG_CACHE = json.loads(CATALOG_PATH.read_text(encoding="utf-8"))
60
+ return _CATALOG_CACHE
61
+
62
+
63
+ class Migration(NamedTuple):
64
+ version: int
65
+ name: str
66
+ sql: str
67
+
68
+
69
+ MIGRATIONS: list[Migration] = [
70
+ Migration(
71
+ 1,
72
+ "core-products-and-accounts",
73
+ """
74
+ CREATE TABLE IF NOT EXISTS products (
75
+ id TEXT PRIMARY KEY,
76
+ name TEXT NOT NULL,
77
+ slug TEXT NOT NULL
78
+ );
79
+ CREATE TABLE IF NOT EXISTS accounts (
80
+ id INTEGER PRIMARY KEY,
81
+ slug TEXT NOT NULL UNIQUE,
82
+ display_name TEXT NOT NULL,
83
+ email TEXT NOT NULL
84
+ );
85
+ """,
86
+ ),
87
+ Migration(
88
+ 2,
89
+ "signed-cookie-sessions",
90
+ """
91
+ CREATE TABLE IF NOT EXISTS sessions (
92
+ id TEXT PRIMARY KEY,
93
+ account_id INTEGER NOT NULL
94
+ REFERENCES accounts(id) ON DELETE CASCADE,
95
+ created_at TEXT NOT NULL
96
+ );
97
+ """,
98
+ ),
99
+ Migration(
100
+ 3,
101
+ "review-draft-revision-submission",
102
+ """
103
+ CREATE TABLE IF NOT EXISTS review_drafts (
104
+ id TEXT PRIMARY KEY,
105
+ account_id INTEGER NOT NULL
106
+ REFERENCES accounts(id) ON DELETE CASCADE,
107
+ product_id TEXT NOT NULL REFERENCES products(id),
108
+ version INTEGER NOT NULL DEFAULT 1,
109
+ status TEXT NOT NULL DEFAULT 'open',
110
+ created_at TEXT NOT NULL,
111
+ updated_at TEXT NOT NULL
112
+ );
113
+ CREATE TABLE IF NOT EXISTS review_revisions (
114
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
115
+ draft_id TEXT NOT NULL
116
+ REFERENCES review_drafts(id) ON DELETE CASCADE,
117
+ version INTEGER NOT NULL,
118
+ rating_raw TEXT NOT NULL,
119
+ review_text TEXT NOT NULL,
120
+ created_at TEXT NOT NULL
121
+ );
122
+ CREATE TABLE IF NOT EXISTS review_submissions (
123
+ id TEXT PRIMARY KEY,
124
+ draft_id TEXT NOT NULL UNIQUE
125
+ REFERENCES review_drafts(id) ON DELETE CASCADE,
126
+ account_id INTEGER NOT NULL
127
+ REFERENCES accounts(id) ON DELETE CASCADE,
128
+ product_id TEXT NOT NULL REFERENCES products(id),
129
+ receipt_code TEXT NOT NULL,
130
+ rating INTEGER NOT NULL CHECK (rating BETWEEN 1 AND 5),
131
+ review_text TEXT NOT NULL,
132
+ created_at TEXT NOT NULL
133
+ );
134
+ """,
135
+ ),
136
+ Migration(
137
+ 4,
138
+ "one-review-per-reviewer-product",
139
+ """
140
+ DELETE FROM review_submissions
141
+ WHERE rowid NOT IN (
142
+ SELECT MIN(rowid) FROM review_submissions
143
+ GROUP BY account_id, product_id
144
+ );
145
+ CREATE UNIQUE INDEX IF NOT EXISTS
146
+ ux_review_submissions_account_product
147
+ ON review_submissions (account_id, product_id);
148
+ """,
149
+ ),
150
+ Migration(
151
+ 5,
152
+ "favorites-comparisons-and-idempotent-commands",
153
+ """
154
+ CREATE TABLE IF NOT EXISTS software_favorites (
155
+ account_id INTEGER NOT NULL
156
+ REFERENCES accounts(id) ON DELETE CASCADE,
157
+ product_id TEXT NOT NULL REFERENCES products(id),
158
+ present INTEGER NOT NULL CHECK (present IN (0, 1)),
159
+ version INTEGER NOT NULL CHECK (version >= 1),
160
+ created_at TEXT NOT NULL,
161
+ updated_at TEXT NOT NULL,
162
+ PRIMARY KEY (account_id, product_id)
163
+ );
164
+ CREATE TABLE IF NOT EXISTS comparison_sets (
165
+ account_id INTEGER PRIMARY KEY
166
+ REFERENCES accounts(id) ON DELETE CASCADE,
167
+ product_ids_json TEXT NOT NULL,
168
+ version INTEGER NOT NULL CHECK (version >= 1),
169
+ updated_at TEXT NOT NULL
170
+ );
171
+ CREATE TABLE IF NOT EXISTS business_commands (
172
+ idempotency_key TEXT PRIMARY KEY,
173
+ account_id INTEGER NOT NULL
174
+ REFERENCES accounts(id) ON DELETE CASCADE,
175
+ capability TEXT NOT NULL CHECK (
176
+ capability IN ('software-favorites', 'catalog-search-comparison')
177
+ ),
178
+ payload_sha256 TEXT NOT NULL,
179
+ response_json TEXT NOT NULL,
180
+ created_at TEXT NOT NULL
181
+ );
182
+ """,
183
+ ),
184
+ Migration(
185
+ 6,
186
+ "anonymous-session-comparisons",
187
+ """
188
+ CREATE TABLE IF NOT EXISTS anonymous_comparison_sets (
189
+ owner_session_id TEXT PRIMARY KEY,
190
+ product_ids_json TEXT NOT NULL,
191
+ version INTEGER NOT NULL CHECK (version >= 1),
192
+ updated_at TEXT NOT NULL
193
+ );
194
+ CREATE TABLE IF NOT EXISTS anonymous_comparison_commands (
195
+ owner_session_id TEXT NOT NULL,
196
+ idempotency_key TEXT NOT NULL,
197
+ payload_sha256 TEXT NOT NULL,
198
+ response_json TEXT NOT NULL,
199
+ created_at TEXT NOT NULL,
200
+ PRIMARY KEY (owner_session_id, idempotency_key)
201
+ );
202
+ """,
203
+ ),
204
+ Migration(
205
+ 7,
206
+ "server-issued-auth-transition-receipts",
207
+ """
208
+ CREATE TABLE IF NOT EXISTS auth_transition_receipts (
209
+ owner_session_id TEXT NOT NULL,
210
+ transition TEXT NOT NULL CHECK (
211
+ transition IN (
212
+ 'registration-verified',
213
+ 'password-reset-complete'
214
+ )
215
+ ),
216
+ created_at TEXT NOT NULL,
217
+ PRIMARY KEY (owner_session_id, transition)
218
+ );
219
+ """,
220
+ ),
221
+ Migration(
222
+ 8,
223
+ "extracted-product-catalog",
224
+ """
225
+ ALTER TABLE products ADD COLUMN url_slug TEXT;
226
+ ALTER TABLE products ADD COLUMN rating REAL;
227
+ ALTER TABLE products ADD COLUMN source_review_count INTEGER;
228
+ ALTER TABLE products ADD COLUMN local_review_count INTEGER;
229
+ ALTER TABLE products ADD COLUMN pricing TEXT;
230
+ ALTER TABLE products ADD COLUMN description TEXT;
231
+ ALTER TABLE products ADD COLUMN logo_asset TEXT;
232
+ ALTER TABLE products ADD COLUMN sub_ratings_json TEXT;
233
+ ALTER TABLE products ADD COLUMN features_json TEXT;
234
+ ALTER TABLE products ADD COLUMN provenance TEXT;
235
+ CREATE TABLE IF NOT EXISTS product_categories (
236
+ product_id TEXT NOT NULL REFERENCES products(id),
237
+ category_slug TEXT NOT NULL,
238
+ rank INTEGER NOT NULL,
239
+ provenance TEXT NOT NULL CHECK (provenance IN ('captured', 'derived')),
240
+ PRIMARY KEY (product_id, category_slug)
241
+ );
242
+ CREATE INDEX IF NOT EXISTS ix_product_categories_slug
243
+ ON product_categories (category_slug, rank);
244
+ """,
245
+ ),
246
+ ]
247
+
248
+ MIGRATION_HEAD = MIGRATIONS[-1].version
249
+
250
+
251
+ class DuplicateReviewError(Exception):
252
+ """A second distinct review for the same (reviewer, product) pair."""
253
+
254
+
255
+ class StaleVersionError(Exception):
256
+ """The submitted optimistic version is not the server-owned version."""
257
+
258
+
259
+ class IdempotencyConflict(Exception):
260
+ """An idempotency key was reused with a different canonical payload."""
261
+
262
+
263
+ # Deletion order respects foreign keys (children first).
264
+ BUSINESS_TABLES = (
265
+ "product_categories",
266
+ "auth_transition_receipts",
267
+ "anonymous_comparison_commands",
268
+ "anonymous_comparison_sets",
269
+ "business_commands",
270
+ "comparison_sets",
271
+ "software_favorites",
272
+ "review_submissions",
273
+ "review_revisions",
274
+ "review_drafts",
275
+ "sessions",
276
+ "accounts",
277
+ "products",
278
+ )
279
+
280
+
281
+ def resolve_data_dir(explicit: str | os.PathLike | None, clone_root: Path) -> Path:
282
+ """Explicit argument wins, then configured data dir, then site data."""
283
+ if explicit:
284
+ return Path(explicit).resolve()
285
+ for name in (WEBSITEBENCH_DATA_DIR_ENV, DATA_DIR_ENV):
286
+ env_value = os.environ.get(name, "").strip()
287
+ if env_value:
288
+ return Path(env_value).resolve()
289
+ return (clone_root.parent / "data").resolve()
290
+
291
+
292
+ def admin_token() -> str:
293
+ """Return injected verifier authority; public runtimes have no default."""
294
+
295
+ return (
296
+ os.environ.get(WEBSITEBENCH_ADMIN_TOKEN_ENV, "").strip()
297
+ or os.environ.get(ADMIN_TOKEN_ENV, "").strip()
298
+ )
299
+
300
+
301
+ def admin_host() -> str:
302
+ """Return the injected virtual host for the isolated admin control plane."""
303
+
304
+ return (
305
+ os.environ.get(WEBSITEBENCH_ADMIN_HOST_ENV, "").strip()
306
+ or os.environ.get(ADMIN_HOST_ENV, "").strip()
307
+ ).casefold()
308
+
309
+
310
+ def test_fixtures_enabled() -> bool:
311
+ """Compatibility fixtures exist only inside an explicit test boundary."""
312
+
313
+ return any(
314
+ os.environ.get(name, "").strip() == "1"
315
+ for name in (WEBSITEBENCH_TEST_FIXTURES_ENV, TEST_FIXTURES_ENV)
316
+ )
317
+
318
+
319
+ def session_secret() -> bytes:
320
+ raw = (
321
+ os.environ.get(WEBSITEBENCH_SESSION_SECRET_ENV, "").strip()
322
+ or os.environ.get(SESSION_SECRET_ENV, "").strip()
323
+ or SESSION_SECRET_DEFAULT
324
+ )
325
+ return raw.encode("utf-8")
326
+
327
+
328
+ def sign_session_id(session_id: str) -> str:
329
+ return hmac.new(
330
+ session_secret(), session_id.encode("utf-8"), hashlib.sha256
331
+ ).hexdigest()
332
+
333
+
334
+ def receipt_code_for(account_id: int, draft_id: str) -> str:
335
+ """Return a stable, account-and-submission-specific local receipt code."""
336
+
337
+ digest = hashlib.sha256(
338
+ f"{SITE_ID}:{account_id}:{draft_id}".encode("utf-8")
339
+ ).hexdigest()[:16]
340
+ return f"{RECEIPT_CODE}-{digest}"
341
+
342
+
343
+ def _execute_statements(
344
+ connection: sqlite3.Connection, script: str
345
+ ) -> None:
346
+ """Execute a migration script without taking over its transaction."""
347
+
348
+ statement = ""
349
+ for line in script.splitlines(keepends=True):
350
+ statement += line
351
+ if sqlite3.complete_statement(statement):
352
+ connection.execute(statement)
353
+ statement = ""
354
+ if statement.strip():
355
+ raise RuntimeError("business migration contains incomplete SQL")
356
+
357
+
358
+ def apply_site_backend_migrations(connection: sqlite3.Connection) -> None:
359
+ """Apply Capterra business migrations through the generated runtime."""
360
+
361
+ if not connection.in_transaction:
362
+ raise RuntimeError("site-backend migration hook requires a transaction")
363
+ connection.execute(
364
+ "CREATE TABLE IF NOT EXISTS schema_migrations ("
365
+ "version INTEGER PRIMARY KEY, "
366
+ "name TEXT NOT NULL, "
367
+ "applied_at TEXT NOT NULL)"
368
+ )
369
+ applied = {
370
+ int(row[0])
371
+ for row in connection.execute(
372
+ "SELECT version FROM schema_migrations"
373
+ ).fetchall()
374
+ }
375
+ for migration in MIGRATIONS:
376
+ if migration.version in applied:
377
+ continue
378
+ _execute_statements(connection, migration.sql)
379
+ connection.execute(
380
+ "INSERT INTO schema_migrations(version,name,applied_at) "
381
+ "VALUES (?,?,?)",
382
+ (migration.version, migration.name, FROZEN_CLOCK),
383
+ )
384
+
385
+
386
+ def seed_site_backend(connection: sqlite3.Connection) -> None:
387
+ """Seed deterministic Capterra reference data for a new database."""
388
+
389
+ if not connection.in_transaction:
390
+ raise RuntimeError("site-backend seed hook requires a transaction")
391
+ Database.seed_in_transaction(connection)
392
+
393
+
394
+ class Database:
395
+ """One SQLite database bound to a data directory."""
396
+
397
+ def __init__(self, data_dir: Path) -> None:
398
+ self.data_dir = Path(data_dir)
399
+ self.path = self.data_dir / DB_FILENAME
400
+ self._conn: sqlite3.Connection | None = None
401
+ self._lock = threading.RLock()
402
+
403
+ # -- connection & schema ------------------------------------------------
404
+
405
+ def connect(self) -> sqlite3.Connection:
406
+ with self._lock:
407
+ if self._conn is None:
408
+ self.data_dir.mkdir(parents=True, exist_ok=True)
409
+ conn = sqlite3.connect(
410
+ str(self.path), check_same_thread=False
411
+ )
412
+ conn.row_factory = sqlite3.Row
413
+ conn.execute("PRAGMA journal_mode=WAL")
414
+ conn.execute("PRAGMA foreign_keys=ON")
415
+ conn.execute("PRAGMA busy_timeout=5000")
416
+ self._conn = conn
417
+ return self._conn
418
+
419
+ def close(self) -> None:
420
+ with self._lock:
421
+ if self._conn is not None:
422
+ self._conn.close()
423
+ self._conn = None
424
+
425
+ def prepare(self) -> None:
426
+ """Startup hook: apply pending migrations, seed fixtures."""
427
+ with self._lock:
428
+ self.migrate()
429
+ self.seed()
430
+
431
+ def _ensure_migrations_table(self, conn: sqlite3.Connection) -> None:
432
+ conn.execute(
433
+ "CREATE TABLE IF NOT EXISTS schema_migrations ("
434
+ "version INTEGER PRIMARY KEY, "
435
+ "name TEXT NOT NULL, "
436
+ "applied_at TEXT NOT NULL)"
437
+ )
438
+
439
+ def migration_head(self) -> int:
440
+ with self._lock:
441
+ conn = self.connect()
442
+ self._ensure_migrations_table(conn)
443
+ row = conn.execute(
444
+ "SELECT COALESCE(MAX(version), 0) AS head FROM schema_migrations"
445
+ ).fetchone()
446
+ return int(row["head"])
447
+
448
+ def migrate(self) -> int:
449
+ with self._lock:
450
+ conn = self.connect()
451
+ self._ensure_migrations_table(conn)
452
+ head = self.migration_head()
453
+ for migration in MIGRATIONS:
454
+ if migration.version <= head:
455
+ continue
456
+ conn.executescript(migration.sql)
457
+ conn.execute(
458
+ "INSERT INTO schema_migrations (version, name, applied_at) "
459
+ "VALUES (?, ?, ?)",
460
+ (migration.version, migration.name, FROZEN_CLOCK),
461
+ )
462
+ head = migration.version
463
+ conn.commit()
464
+ return head
465
+
466
+ def seed(self) -> None:
467
+ with self._lock:
468
+ conn = self.connect()
469
+ self.seed_in_transaction(conn)
470
+ conn.commit()
471
+
472
+ @staticmethod
473
+ def seed_in_transaction(conn: sqlite3.Connection) -> None:
474
+ for product in (
475
+ (PRODUCT_ID, PRODUCT_NAME, PRODUCT_SLUG),
476
+ ("asana-101", "Asana", "asana"),
477
+ ("monday-102", "monday.com", "monday-com"),
478
+ ):
479
+ conn.execute(
480
+ "INSERT OR IGNORE INTO products (id, name, slug) "
481
+ "VALUES (?, ?, ?)",
482
+ product,
483
+ )
484
+ catalog = load_product_catalog()
485
+ conn.executemany(
486
+ "INSERT OR IGNORE INTO products (id, name, slug) VALUES (?, ?, ?)",
487
+ [(p["id"], p["name"], p["slug"]) for p in catalog["products"]],
488
+ )
489
+ conn.executemany(
490
+ """
491
+ UPDATE products SET name = ?, slug = ?, url_slug = ?, rating = ?,
492
+ source_review_count = ?, local_review_count = ?, pricing = ?,
493
+ description = ?, logo_asset = ?, sub_ratings_json = ?,
494
+ features_json = ?, provenance = ?
495
+ WHERE id = ?
496
+ """,
497
+ [
498
+ (
499
+ p["name"],
500
+ p["slug"],
501
+ p["url_slug"],
502
+ p["rating"],
503
+ p.get("source_review_count"),
504
+ p["local_review_count"],
505
+ p.get("pricing"),
506
+ p.get("description"),
507
+ p.get("logo_asset"),
508
+ json.dumps(p["sub_ratings"]) if p.get("sub_ratings") else None,
509
+ json.dumps(p["features"]) if p.get("features") else None,
510
+ p["provenance"],
511
+ p["id"],
512
+ )
513
+ for p in catalog["products"]
514
+ ],
515
+ )
516
+ conn.execute("DELETE FROM product_categories")
517
+ conn.executemany(
518
+ "INSERT INTO product_categories "
519
+ "(product_id, category_slug, rank, provenance) VALUES (?, ?, ?, ?)",
520
+ [
521
+ (product_id, slug, rank, listing["provenance"])
522
+ for slug, listing in catalog["categories"].items()
523
+ for rank, product_id in enumerate(listing["product_ids"], start=1)
524
+ ],
525
+ )
526
+ for slug, display_name, email in (PRIMARY_ACCOUNT, SECONDARY_ACCOUNT):
527
+ conn.execute(
528
+ "INSERT OR IGNORE INTO accounts (slug, display_name, email) "
529
+ "VALUES (?, ?, ?)",
530
+ (slug, display_name, email),
531
+ )
532
+
533
+ @classmethod
534
+ def reset_in_transaction(cls, conn: sqlite3.Connection) -> None:
535
+ """Reset all site-owned rows inside the caller's transaction."""
536
+
537
+ for table in BUSINESS_TABLES:
538
+ conn.execute(f"DELETE FROM {table}")
539
+ cls.seed_in_transaction(conn)
540
+
541
+ def reset(self) -> None:
542
+ """Wipe business tables and reseed deterministic fixtures."""
543
+ with self._lock:
544
+ conn = self.connect()
545
+ conn.execute("BEGIN IMMEDIATE")
546
+ try:
547
+ self.reset_in_transaction(conn)
548
+ conn.commit()
549
+ except BaseException:
550
+ conn.rollback()
551
+ raise
552
+
553
+ def table_count(self, table: str) -> int:
554
+ if table not in BUSINESS_TABLES:
555
+ raise ValueError(f"unknown business table: {table}")
556
+ with self._lock:
557
+ conn = self.connect()
558
+ row = conn.execute(f"SELECT COUNT(*) AS n FROM {table}").fetchone()
559
+ return int(row["n"])
560
+
561
+ # -- extracted product catalog reads --------------------------------
562
+
563
+ @staticmethod
564
+ def _product_dict(row: sqlite3.Row | None) -> dict | None:
565
+ if row is None:
566
+ return None
567
+ product = dict(row)
568
+ product["sub_ratings"] = (
569
+ json.loads(product["sub_ratings_json"])
570
+ if product.get("sub_ratings_json")
571
+ else {}
572
+ )
573
+ product["features"] = (
574
+ json.loads(product["features_json"])
575
+ if product.get("features_json")
576
+ else []
577
+ )
578
+ return product
579
+
580
+ def get_product(self, product_id: str) -> dict | None:
581
+ with self._lock:
582
+ conn = self.connect()
583
+ row = conn.execute(
584
+ "SELECT * FROM products WHERE id = ?", (product_id,)
585
+ ).fetchone()
586
+ return self._product_dict(row)
587
+
588
+ def get_product_by_slug(self, slug: str) -> dict | None:
589
+ with self._lock:
590
+ conn = self.connect()
591
+ row = conn.execute(
592
+ "SELECT * FROM products WHERE slug = ? ORDER BY id LIMIT 1",
593
+ (slug,),
594
+ ).fetchone()
595
+ return self._product_dict(row)
596
+
597
+ def products_for_category(self, category_slug: str) -> list[dict]:
598
+ """Catalog products for one category listing, in listing order."""
599
+ with self._lock:
600
+ conn = self.connect()
601
+ rows = conn.execute(
602
+ """
603
+ SELECT p.* FROM products AS p
604
+ JOIN product_categories AS pc ON pc.product_id = p.id
605
+ WHERE pc.category_slug = ?
606
+ ORDER BY pc.rank
607
+ """,
608
+ (category_slug,),
609
+ ).fetchall()
610
+ return [self._product_dict(row) for row in rows]
611
+
612
+ def category_listing_provenance(self, category_slug: str) -> str | None:
613
+ with self._lock:
614
+ conn = self.connect()
615
+ row = conn.execute(
616
+ "SELECT provenance FROM product_categories "
617
+ "WHERE category_slug = ? LIMIT 1",
618
+ (category_slug,),
619
+ ).fetchone()
620
+ return row["provenance"] if row else None
621
+
622
+ def search_products(self, query: str, limit: int = 25) -> list[dict]:
623
+ """Rank: exact name, name prefix, name contains, description contains."""
624
+ term = " ".join(query.split()).strip()
625
+ if not term:
626
+ return []
627
+ with self._lock:
628
+ conn = self.connect()
629
+ rows = conn.execute(
630
+ """
631
+ SELECT * FROM products
632
+ WHERE url_slug IS NOT NULL
633
+ AND (name LIKE '%' || :term || '%'
634
+ OR description LIKE '%' || :term || '%')
635
+ ORDER BY
636
+ CASE
637
+ WHEN LOWER(name) = LOWER(:term) THEN 0
638
+ WHEN name LIKE :term || '%' THEN 1
639
+ WHEN name LIKE '%' || :term || '%' THEN 2
640
+ ELSE 3
641
+ END,
642
+ rating DESC,
643
+ id
644
+ LIMIT :limit
645
+ """,
646
+ {"term": term, "limit": limit},
647
+ ).fetchall()
648
+ return [self._product_dict(row) for row in rows]
649
+
650
+ def top_products(self, limit: int = 20) -> list[dict]:
651
+ """Highest-rated catalog products, for empty-query search results."""
652
+ with self._lock:
653
+ conn = self.connect()
654
+ rows = conn.execute(
655
+ """
656
+ SELECT * FROM products
657
+ WHERE url_slug IS NOT NULL
658
+ ORDER BY (id = ?) DESC, rating DESC, local_review_count DESC, id
659
+ LIMIT ?
660
+ """,
661
+ (PRODUCT_ID, limit),
662
+ ).fetchall()
663
+ return [self._product_dict(row) for row in rows]
664
+
665
+ def alternatives_for(self, product_id: str, limit: int = 8) -> list[dict]:
666
+ """Other catalog products sharing a category, best-ranked first."""
667
+ with self._lock:
668
+ conn = self.connect()
669
+ rows = conn.execute(
670
+ """
671
+ SELECT p.*, MIN(pc.rank) AS best_rank FROM products AS p
672
+ JOIN product_categories AS pc ON pc.product_id = p.id
673
+ WHERE pc.category_slug IN (
674
+ SELECT category_slug FROM product_categories
675
+ WHERE product_id = :product_id
676
+ ORDER BY
677
+ CASE provenance WHEN 'captured' THEN 0 ELSE 1 END,
678
+ rank, category_slug
679
+ LIMIT 4
680
+ )
681
+ AND p.id != :product_id
682
+ AND p.url_slug IS NOT NULL
683
+ GROUP BY p.id
684
+ ORDER BY best_rank, p.rating DESC, p.id
685
+ LIMIT :limit
686
+ """,
687
+ {"product_id": product_id, "limit": limit},
688
+ ).fetchall()
689
+ return [self._product_dict(row) for row in rows]
690
+
691
+ def categories_for_product(self, product_id: str) -> list[str]:
692
+ with self._lock:
693
+ conn = self.connect()
694
+ rows = conn.execute(
695
+ "SELECT category_slug FROM product_categories "
696
+ "WHERE product_id = ? ORDER BY provenance, category_slug",
697
+ (product_id,),
698
+ ).fetchall()
699
+ return [row["category_slug"] for row in rows]
700
+
701
+ def list_favorite_products(self, account_id: int) -> list[dict]:
702
+ with self._lock:
703
+ conn = self.connect()
704
+ rows = conn.execute(
705
+ """
706
+ SELECT p.* FROM products AS p
707
+ JOIN software_favorites AS f ON f.product_id = p.id
708
+ WHERE f.account_id = ? AND f.present = 1
709
+ ORDER BY f.updated_at DESC, p.id
710
+ """,
711
+ (account_id,),
712
+ ).fetchall()
713
+ return [self._product_dict(row) for row in rows]
714
+
715
+ def count_favorites(self, account_id: int) -> int:
716
+ with self._lock:
717
+ conn = self.connect()
718
+ row = conn.execute(
719
+ "SELECT COUNT(*) AS n FROM software_favorites "
720
+ "WHERE account_id = ? AND present = 1",
721
+ (account_id,),
722
+ ).fetchone()
723
+ return int(row["n"])
724
+
725
+ def submissions_for_product(self, product_id: str) -> list[dict]:
726
+ """Member-submitted reviews for a product, newest first."""
727
+ with self._lock:
728
+ conn = self.connect()
729
+ rows = conn.execute(
730
+ """
731
+ SELECT s.rating, s.review_text, s.created_at,
732
+ a.display_name
733
+ FROM review_submissions AS s
734
+ JOIN accounts AS a ON a.id = s.account_id
735
+ WHERE s.product_id = ?
736
+ ORDER BY s.created_at DESC, s.id
737
+ """,
738
+ (product_id,),
739
+ ).fetchall()
740
+ return [dict(row) for row in rows]
741
+
742
+ def count_submissions(self, account_id: int) -> int:
743
+ with self._lock:
744
+ conn = self.connect()
745
+ row = conn.execute(
746
+ "SELECT COUNT(*) AS n FROM review_submissions "
747
+ "WHERE account_id = ?",
748
+ (account_id,),
749
+ ).fetchone()
750
+ return int(row["n"])
751
+
752
+ # -- server-issued auth transition receipts -----------------------------
753
+
754
+ @staticmethod
755
+ def _validate_owner_session_id(value: str) -> str:
756
+ normalized = str(value).strip().casefold()
757
+ if (
758
+ len(normalized) != 64
759
+ or any(character not in "0123456789abcdef" for character in normalized)
760
+ ):
761
+ raise ValueError("owner session id must be a server session digest")
762
+ return normalized
763
+
764
+ def record_auth_transition(
765
+ self, owner_session_id: str, transition: str
766
+ ) -> None:
767
+ owner = self._validate_owner_session_id(owner_session_id)
768
+ if transition not in {
769
+ "registration-verified",
770
+ "password-reset-complete",
771
+ }:
772
+ raise ValueError("unknown auth transition")
773
+ with self._lock:
774
+ conn = self.connect()
775
+ conn.execute(
776
+ "INSERT OR REPLACE INTO auth_transition_receipts("
777
+ "owner_session_id, transition, created_at) VALUES (?, ?, ?)",
778
+ (owner, transition, FROZEN_CLOCK),
779
+ )
780
+ conn.commit()
781
+
782
+ def has_auth_transition(
783
+ self, owner_session_id: str, transition: str
784
+ ) -> bool:
785
+ owner = self._validate_owner_session_id(owner_session_id)
786
+ with self._lock:
787
+ row = self.connect().execute(
788
+ "SELECT 1 FROM auth_transition_receipts "
789
+ "WHERE owner_session_id = ? AND transition = ?",
790
+ (owner, transition),
791
+ ).fetchone()
792
+ return row is not None
793
+
794
+ # -- accounts & sessions ------------------------------------------------
795
+
796
+ def account_by_slug(self, slug: str) -> sqlite3.Row | None:
797
+ with self._lock:
798
+ return self.connect().execute(
799
+ "SELECT * FROM accounts WHERE slug = ?", (slug,)
800
+ ).fetchone()
801
+
802
+ def create_account_subject(
803
+ self,
804
+ connection: sqlite3.Connection,
805
+ *,
806
+ account_id: str,
807
+ display_name: str,
808
+ email: str,
809
+ ) -> str:
810
+ """Create the business subject inside the auth registration transaction."""
811
+
812
+ slug = f"account-{hashlib.sha256(account_id.encode()).hexdigest()[:20]}"
813
+ connection.execute(
814
+ "INSERT INTO accounts (slug, display_name, email) VALUES (?, ?, ?)",
815
+ (slug, display_name, email),
816
+ )
817
+ return slug
818
+
819
+ def create_session(self, account_slug: str) -> str:
820
+ with self._lock:
821
+ account = self.account_by_slug(account_slug)
822
+ if account is None:
823
+ raise ValueError(f"unknown account: {account_slug}")
824
+ session_id = uuid.uuid4().hex
825
+ conn = self.connect()
826
+ conn.execute(
827
+ "INSERT INTO sessions (id, account_id, created_at) "
828
+ "VALUES (?, ?, ?)",
829
+ (session_id, account["id"], FROZEN_CLOCK),
830
+ )
831
+ conn.commit()
832
+ return session_id
833
+
834
+ def cookie_value(self, session_id: str) -> str:
835
+ return f"{session_id}.{sign_session_id(session_id)}"
836
+
837
+ def account_for_cookie(self, cookie_value: str | None) -> sqlite3.Row | None:
838
+ if not cookie_value or "." not in cookie_value:
839
+ return None
840
+ session_id, _, signature = cookie_value.partition(".")
841
+ if not session_id or not signature:
842
+ return None
843
+ if not hmac.compare_digest(signature, sign_session_id(session_id)):
844
+ return None
845
+ with self._lock:
846
+ return self.connect().execute(
847
+ "SELECT accounts.* FROM sessions "
848
+ "JOIN accounts ON accounts.id = sessions.account_id "
849
+ "WHERE sessions.id = ?",
850
+ (session_id,),
851
+ ).fetchone()
852
+
853
+ def delete_session_for_cookie(self, cookie_value: str | None) -> None:
854
+ if not cookie_value or "." not in cookie_value:
855
+ return
856
+ session_id = cookie_value.partition(".")[0]
857
+ with self._lock:
858
+ conn = self.connect()
859
+ conn.execute("DELETE FROM sessions WHERE id = ?", (session_id,))
860
+ conn.commit()
861
+
862
+ # -- favorites and comparisons ------------------------------------------
863
+
864
+ @staticmethod
865
+ def _canonical_payload(value: dict[str, object]) -> tuple[str, str]:
866
+ serialized = json.dumps(
867
+ value,
868
+ ensure_ascii=False,
869
+ separators=(",", ":"),
870
+ sort_keys=True,
871
+ )
872
+ return serialized, hashlib.sha256(serialized.encode("utf-8")).hexdigest()
873
+
874
+ def _replay_command(
875
+ self,
876
+ conn: sqlite3.Connection,
877
+ *,
878
+ idempotency_key: str,
879
+ account_id: int,
880
+ capability: str,
881
+ payload_sha256: str,
882
+ ) -> dict[str, object] | None:
883
+ row = conn.execute(
884
+ "SELECT account_id, capability, payload_sha256, response_json "
885
+ "FROM business_commands WHERE idempotency_key = ?",
886
+ (idempotency_key,),
887
+ ).fetchone()
888
+ if row is None:
889
+ return None
890
+ if (
891
+ int(row["account_id"]) != account_id
892
+ or row["capability"] != capability
893
+ or row["payload_sha256"] != payload_sha256
894
+ ):
895
+ raise IdempotencyConflict(
896
+ "idempotency key is already bound to another command"
897
+ )
898
+ return json.loads(str(row["response_json"]))
899
+
900
+ @staticmethod
901
+ def _validate_idempotency_key(value: str) -> str:
902
+ normalized = value.strip()
903
+ if not 12 <= len(normalized) <= 200:
904
+ raise ValueError("idempotency key must contain 12 to 200 characters")
905
+ return normalized
906
+
907
+ @staticmethod
908
+ def _validate_session_owner(value: str) -> str:
909
+ normalized = value.strip()
910
+ if len(normalized) != 64 or any(
911
+ character not in "0123456789abcdef" for character in normalized
912
+ ):
913
+ raise ValueError("comparison owner session is invalid")
914
+ return normalized
915
+
916
+ def favorite_state(
917
+ self, account_id: int, product_id: str = PRODUCT_ID
918
+ ) -> dict[str, object]:
919
+ with self._lock:
920
+ row = self.connect().execute(
921
+ "SELECT present, version FROM software_favorites "
922
+ "WHERE account_id = ? AND product_id = ?",
923
+ (account_id, product_id),
924
+ ).fetchone()
925
+ return {
926
+ "product_id": product_id,
927
+ "present": bool(row["present"]) if row is not None else False,
928
+ "version": int(row["version"]) if row is not None else 0,
929
+ }
930
+
931
+ def update_favorite(
932
+ self,
933
+ *,
934
+ account_id: int,
935
+ product_id: str,
936
+ present: bool,
937
+ expected_version: int,
938
+ idempotency_key: str,
939
+ ) -> dict[str, object]:
940
+ key = self._validate_idempotency_key(idempotency_key)
941
+ payload = {
942
+ "product_id": product_id,
943
+ "present": bool(present),
944
+ "expected_version": int(expected_version),
945
+ }
946
+ _, payload_sha256 = self._canonical_payload(payload)
947
+ with self._lock:
948
+ conn = self.connect()
949
+ conn.execute("BEGIN IMMEDIATE")
950
+ try:
951
+ replay = self._replay_command(
952
+ conn,
953
+ idempotency_key=key,
954
+ account_id=account_id,
955
+ capability="software-favorites",
956
+ payload_sha256=payload_sha256,
957
+ )
958
+ if replay is not None:
959
+ conn.commit()
960
+ return replay
961
+ if (
962
+ conn.execute(
963
+ "SELECT 1 FROM products WHERE id = ?", (product_id,)
964
+ ).fetchone()
965
+ is None
966
+ ):
967
+ raise ValueError("unknown product")
968
+ current = conn.execute(
969
+ "SELECT present, version FROM software_favorites "
970
+ "WHERE account_id = ? AND product_id = ?",
971
+ (account_id, product_id),
972
+ ).fetchone()
973
+ current_version = int(current["version"]) if current else 0
974
+ if int(expected_version) != current_version:
975
+ raise StaleVersionError(
976
+ f"expected version {expected_version}; "
977
+ f"current version is {current_version}"
978
+ )
979
+ next_version = current_version + 1
980
+ conn.execute(
981
+ "INSERT INTO software_favorites("
982
+ "account_id, product_id, present, version, created_at, updated_at"
983
+ ") VALUES (?, ?, ?, ?, ?, ?) "
984
+ "ON CONFLICT(account_id, product_id) DO UPDATE SET "
985
+ "present=excluded.present, version=excluded.version, "
986
+ "updated_at=excluded.updated_at",
987
+ (
988
+ account_id,
989
+ product_id,
990
+ 1 if present else 0,
991
+ next_version,
992
+ FROZEN_CLOCK,
993
+ FROZEN_CLOCK,
994
+ ),
995
+ )
996
+ result: dict[str, object] = {
997
+ "product_id": product_id,
998
+ "present": bool(present),
999
+ "version": next_version,
1000
+ }
1001
+ conn.execute(
1002
+ "INSERT INTO business_commands("
1003
+ "idempotency_key, account_id, capability, payload_sha256, "
1004
+ "response_json, created_at) VALUES (?, ?, ?, ?, ?, ?)",
1005
+ (
1006
+ key,
1007
+ account_id,
1008
+ "software-favorites",
1009
+ payload_sha256,
1010
+ json.dumps(result, sort_keys=True),
1011
+ FROZEN_CLOCK,
1012
+ ),
1013
+ )
1014
+ conn.commit()
1015
+ return result
1016
+ except BaseException:
1017
+ conn.rollback()
1018
+ raise
1019
+
1020
+ def comparison_state(self, account_id: int) -> dict[str, object]:
1021
+ with self._lock:
1022
+ row = self.connect().execute(
1023
+ "SELECT product_ids_json, version FROM comparison_sets "
1024
+ "WHERE account_id = ?",
1025
+ (account_id,),
1026
+ ).fetchone()
1027
+ return {
1028
+ "product_ids": (
1029
+ json.loads(str(row["product_ids_json"]))
1030
+ if row is not None
1031
+ else []
1032
+ ),
1033
+ "version": int(row["version"]) if row is not None else 0,
1034
+ }
1035
+
1036
+ def anonymous_comparison_state(
1037
+ self, owner_session_id: str
1038
+ ) -> dict[str, object]:
1039
+ owner = self._validate_session_owner(owner_session_id)
1040
+ with self._lock:
1041
+ row = self.connect().execute(
1042
+ "SELECT product_ids_json, version "
1043
+ "FROM anonymous_comparison_sets WHERE owner_session_id = ?",
1044
+ (owner,),
1045
+ ).fetchone()
1046
+ return {
1047
+ "product_ids": (
1048
+ json.loads(str(row["product_ids_json"]))
1049
+ if row is not None
1050
+ else []
1051
+ ),
1052
+ "version": int(row["version"]) if row is not None else 0,
1053
+ }
1054
+
1055
+ def update_anonymous_comparison(
1056
+ self,
1057
+ *,
1058
+ owner_session_id: str,
1059
+ product_ids: list[str],
1060
+ expected_version: int,
1061
+ idempotency_key: str,
1062
+ ) -> dict[str, object]:
1063
+ owner = self._validate_session_owner(owner_session_id)
1064
+ key = self._validate_idempotency_key(idempotency_key)
1065
+ normalized = [
1066
+ str(item).strip() for item in product_ids if str(item).strip()
1067
+ ]
1068
+ if len(normalized) not in {0, 2} or (
1069
+ len(set(normalized)) != len(normalized)
1070
+ ):
1071
+ raise ValueError("choose exactly two different products, or clear all")
1072
+ payload = {
1073
+ "product_ids": normalized,
1074
+ "expected_version": int(expected_version),
1075
+ }
1076
+ _, payload_sha256 = self._canonical_payload(payload)
1077
+ with self._lock:
1078
+ conn = self.connect()
1079
+ conn.execute("BEGIN IMMEDIATE")
1080
+ try:
1081
+ replay = conn.execute(
1082
+ "SELECT payload_sha256, response_json "
1083
+ "FROM anonymous_comparison_commands "
1084
+ "WHERE owner_session_id = ? AND idempotency_key = ?",
1085
+ (owner, key),
1086
+ ).fetchone()
1087
+ if replay is not None:
1088
+ if replay["payload_sha256"] != payload_sha256:
1089
+ raise IdempotencyConflict(
1090
+ "idempotency key is already bound to another command"
1091
+ )
1092
+ conn.commit()
1093
+ return json.loads(str(replay["response_json"]))
1094
+ known = {
1095
+ str(row["id"])
1096
+ for row in conn.execute(
1097
+ "SELECT id FROM products WHERE id IN ({})".format(
1098
+ ",".join("?" for _ in normalized) or "NULL"
1099
+ ),
1100
+ normalized,
1101
+ )
1102
+ }
1103
+ if known != set(normalized):
1104
+ raise ValueError("comparison contains an unknown product")
1105
+ current = conn.execute(
1106
+ "SELECT version FROM anonymous_comparison_sets "
1107
+ "WHERE owner_session_id = ?",
1108
+ (owner,),
1109
+ ).fetchone()
1110
+ current_version = int(current["version"]) if current else 0
1111
+ if int(expected_version) != current_version:
1112
+ raise StaleVersionError(
1113
+ f"expected version {expected_version}; "
1114
+ f"current version is {current_version}"
1115
+ )
1116
+ next_version = current_version + 1
1117
+ conn.execute(
1118
+ "INSERT INTO anonymous_comparison_sets("
1119
+ "owner_session_id, product_ids_json, version, updated_at"
1120
+ ") VALUES (?, ?, ?, ?) "
1121
+ "ON CONFLICT(owner_session_id) DO UPDATE SET "
1122
+ "product_ids_json=excluded.product_ids_json, "
1123
+ "version=excluded.version, updated_at=excluded.updated_at",
1124
+ (
1125
+ owner,
1126
+ json.dumps(normalized, separators=(",", ":")),
1127
+ next_version,
1128
+ FROZEN_CLOCK,
1129
+ ),
1130
+ )
1131
+ result: dict[str, object] = {
1132
+ "product_ids": normalized,
1133
+ "version": next_version,
1134
+ }
1135
+ conn.execute(
1136
+ "INSERT INTO anonymous_comparison_commands("
1137
+ "owner_session_id, idempotency_key, payload_sha256, "
1138
+ "response_json, created_at) VALUES (?, ?, ?, ?, ?)",
1139
+ (
1140
+ owner,
1141
+ key,
1142
+ payload_sha256,
1143
+ json.dumps(result, sort_keys=True),
1144
+ FROZEN_CLOCK,
1145
+ ),
1146
+ )
1147
+ conn.commit()
1148
+ return result
1149
+ except BaseException:
1150
+ conn.rollback()
1151
+ raise
1152
+
1153
+ def transfer_anonymous_comparison_in_transaction(
1154
+ self,
1155
+ conn: sqlite3.Connection,
1156
+ old_owner_session_id: str,
1157
+ new_owner_session_id: str,
1158
+ ) -> None:
1159
+ """Move comparison rows within the auth rotation transaction."""
1160
+
1161
+ old_owner = self._validate_session_owner(old_owner_session_id)
1162
+ new_owner = self._validate_session_owner(new_owner_session_id)
1163
+ if old_owner == new_owner:
1164
+ return
1165
+ if conn.execute(
1166
+ "SELECT 1 FROM anonymous_comparison_sets "
1167
+ "WHERE owner_session_id=?",
1168
+ (new_owner,),
1169
+ ).fetchone():
1170
+ raise IdempotencyConflict(
1171
+ "rotated session already owns a comparison state"
1172
+ )
1173
+ conn.execute(
1174
+ "UPDATE anonymous_comparison_sets SET owner_session_id=? "
1175
+ "WHERE owner_session_id=?",
1176
+ (new_owner, old_owner),
1177
+ )
1178
+ conn.execute(
1179
+ "UPDATE anonymous_comparison_commands SET owner_session_id=? "
1180
+ "WHERE owner_session_id=?",
1181
+ (new_owner, old_owner),
1182
+ )
1183
+
1184
+ def update_comparison(
1185
+ self,
1186
+ *,
1187
+ account_id: int,
1188
+ product_ids: list[str],
1189
+ expected_version: int,
1190
+ idempotency_key: str,
1191
+ ) -> dict[str, object]:
1192
+ key = self._validate_idempotency_key(idempotency_key)
1193
+ normalized = [str(item).strip() for item in product_ids if str(item).strip()]
1194
+ if len(normalized) not in {0, 2} or len(set(normalized)) != len(normalized):
1195
+ raise ValueError("choose exactly two different products, or clear all")
1196
+ payload = {
1197
+ "product_ids": normalized,
1198
+ "expected_version": int(expected_version),
1199
+ }
1200
+ _, payload_sha256 = self._canonical_payload(payload)
1201
+ with self._lock:
1202
+ conn = self.connect()
1203
+ conn.execute("BEGIN IMMEDIATE")
1204
+ try:
1205
+ replay = self._replay_command(
1206
+ conn,
1207
+ idempotency_key=key,
1208
+ account_id=account_id,
1209
+ capability="catalog-search-comparison",
1210
+ payload_sha256=payload_sha256,
1211
+ )
1212
+ if replay is not None:
1213
+ conn.commit()
1214
+ return replay
1215
+ known = {
1216
+ str(row["id"])
1217
+ for row in conn.execute(
1218
+ "SELECT id FROM products WHERE id IN ({})".format(
1219
+ ",".join("?" for _ in normalized) or "NULL"
1220
+ ),
1221
+ normalized,
1222
+ )
1223
+ }
1224
+ if known != set(normalized):
1225
+ raise ValueError("comparison contains an unknown product")
1226
+ current = conn.execute(
1227
+ "SELECT version FROM comparison_sets WHERE account_id = ?",
1228
+ (account_id,),
1229
+ ).fetchone()
1230
+ current_version = int(current["version"]) if current else 0
1231
+ if int(expected_version) != current_version:
1232
+ raise StaleVersionError(
1233
+ f"expected version {expected_version}; "
1234
+ f"current version is {current_version}"
1235
+ )
1236
+ next_version = current_version + 1
1237
+ conn.execute(
1238
+ "INSERT INTO comparison_sets("
1239
+ "account_id, product_ids_json, version, updated_at"
1240
+ ") VALUES (?, ?, ?, ?) "
1241
+ "ON CONFLICT(account_id) DO UPDATE SET "
1242
+ "product_ids_json=excluded.product_ids_json, "
1243
+ "version=excluded.version, updated_at=excluded.updated_at",
1244
+ (
1245
+ account_id,
1246
+ json.dumps(normalized, separators=(",", ":")),
1247
+ next_version,
1248
+ FROZEN_CLOCK,
1249
+ ),
1250
+ )
1251
+ result: dict[str, object] = {
1252
+ "product_ids": normalized,
1253
+ "version": next_version,
1254
+ }
1255
+ conn.execute(
1256
+ "INSERT INTO business_commands("
1257
+ "idempotency_key, account_id, capability, payload_sha256, "
1258
+ "response_json, created_at) VALUES (?, ?, ?, ?, ?, ?)",
1259
+ (
1260
+ key,
1261
+ account_id,
1262
+ "catalog-search-comparison",
1263
+ payload_sha256,
1264
+ json.dumps(result, sort_keys=True),
1265
+ FROZEN_CLOCK,
1266
+ ),
1267
+ )
1268
+ conn.commit()
1269
+ return result
1270
+ except BaseException:
1271
+ conn.rollback()
1272
+ raise
1273
+
1274
+ # -- drafts, revisions, submissions --------------------------------------
1275
+
1276
+ def get_draft(self, draft_id: str) -> sqlite3.Row | None:
1277
+ with self._lock:
1278
+ return self.connect().execute(
1279
+ "SELECT * FROM review_drafts WHERE id = ?", (draft_id,)
1280
+ ).fetchone()
1281
+
1282
+ def get_or_create_open_draft(
1283
+ self, account_id: int, product_id: str = PRODUCT_ID
1284
+ ) -> sqlite3.Row:
1285
+ with self._lock:
1286
+ conn = self.connect()
1287
+ row = conn.execute(
1288
+ "SELECT * FROM review_drafts "
1289
+ "WHERE account_id = ? AND product_id = ? AND status = 'open' "
1290
+ "ORDER BY created_at DESC, id DESC LIMIT 1",
1291
+ (account_id, product_id),
1292
+ ).fetchone()
1293
+ if row is not None:
1294
+ return row
1295
+ draft_id = f"draft-{uuid.uuid4().hex[:12]}"
1296
+ conn.execute(
1297
+ "INSERT INTO review_drafts "
1298
+ "(id, account_id, product_id, version, status, created_at, "
1299
+ "updated_at) VALUES (?, ?, ?, 1, 'open', ?, ?)",
1300
+ (draft_id, account_id, product_id, FROZEN_CLOCK, FROZEN_CLOCK),
1301
+ )
1302
+ conn.commit()
1303
+ return self.get_draft(draft_id)
1304
+
1305
+ def record_revision(
1306
+ self, draft_id: str, rating_raw: str, review_text: str
1307
+ ) -> int:
1308
+ """Record a revision at the draft's current version, bump the version."""
1309
+ with self._lock:
1310
+ conn = self.connect()
1311
+ draft = self.get_draft(draft_id)
1312
+ if draft is None:
1313
+ raise ValueError(f"unknown draft: {draft_id}")
1314
+ conn.execute(
1315
+ "INSERT INTO review_revisions "
1316
+ "(draft_id, version, rating_raw, review_text, created_at) "
1317
+ "VALUES (?, ?, ?, ?, ?)",
1318
+ (draft_id, draft["version"], rating_raw, review_text, FROZEN_CLOCK),
1319
+ )
1320
+ new_version = int(draft["version"]) + 1
1321
+ conn.execute(
1322
+ "UPDATE review_drafts SET version = ?, updated_at = ? "
1323
+ "WHERE id = ?",
1324
+ (new_version, FROZEN_CLOCK, draft_id),
1325
+ )
1326
+ conn.commit()
1327
+ return new_version
1328
+
1329
+ def submission_for_draft(self, draft_id: str) -> sqlite3.Row | None:
1330
+ with self._lock:
1331
+ return self.connect().execute(
1332
+ "SELECT * FROM review_submissions WHERE draft_id = ?",
1333
+ (draft_id,),
1334
+ ).fetchone()
1335
+
1336
+ def submission_for_pair(
1337
+ self, account_id: int, product_id: str
1338
+ ) -> sqlite3.Row | None:
1339
+ """The single review a (reviewer, product) pair may hold."""
1340
+ with self._lock:
1341
+ return self.connect().execute(
1342
+ "SELECT * FROM review_submissions "
1343
+ "WHERE account_id = ? AND product_id = ?",
1344
+ (account_id, product_id),
1345
+ ).fetchone()
1346
+
1347
+ def create_submission(
1348
+ self, draft: sqlite3.Row, rating: int, review_text: str
1349
+ ) -> sqlite3.Row:
1350
+ """Idempotent per draft: returns the existing row when present.
1351
+
1352
+ One review per (reviewer, product): a second DISTINCT review for
1353
+ the same pair raises DuplicateReviewError. The rule is enforced
1354
+ both here and by the UNIQUE index
1355
+ ux_review_submissions_account_product (migration 4).
1356
+ """
1357
+ with self._lock:
1358
+ existing = self.submission_for_draft(draft["id"])
1359
+ if existing is not None:
1360
+ return existing
1361
+ pair_existing = self.submission_for_pair(
1362
+ draft["account_id"], draft["product_id"]
1363
+ )
1364
+ if pair_existing is not None:
1365
+ raise DuplicateReviewError(
1366
+ "a review for this product already exists "
1367
+ "for this reviewer"
1368
+ )
1369
+ submission_id = f"sub-{draft['id']}"
1370
+ conn = self.connect()
1371
+ try:
1372
+ conn.execute(
1373
+ "INSERT INTO review_submissions "
1374
+ "(id, draft_id, account_id, product_id, receipt_code, "
1375
+ "rating, review_text, created_at) "
1376
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
1377
+ (
1378
+ submission_id,
1379
+ draft["id"],
1380
+ draft["account_id"],
1381
+ draft["product_id"],
1382
+ receipt_code_for(
1383
+ int(draft["account_id"]), str(draft["id"])
1384
+ ),
1385
+ rating,
1386
+ review_text,
1387
+ FROZEN_CLOCK,
1388
+ ),
1389
+ )
1390
+ except sqlite3.IntegrityError as exc:
1391
+ # DB-level UNIQUE(account_id, product_id) backstop.
1392
+ conn.rollback()
1393
+ raise DuplicateReviewError(
1394
+ "a review for this product already exists "
1395
+ "for this reviewer"
1396
+ ) from exc
1397
+ conn.execute(
1398
+ "UPDATE review_drafts SET status = 'submitted', updated_at = ? "
1399
+ "WHERE id = ?",
1400
+ (FROZEN_CLOCK, draft["id"]),
1401
+ )
1402
+ conn.commit()
1403
+ return self.submission_for_draft(draft["id"])
1404
+
1405
+ def submission_for_receipt(
1406
+ self, account_id: int, product_id: str, receipt_code: str
1407
+ ) -> sqlite3.Row | None:
1408
+ with self._lock:
1409
+ return self.connect().execute(
1410
+ "SELECT * FROM review_submissions "
1411
+ "WHERE account_id = ? AND product_id = ? AND receipt_code = ? "
1412
+ "ORDER BY created_at DESC, id DESC LIMIT 1",
1413
+ (account_id, product_id, receipt_code),
1414
+ ).fetchone()
tasks/capterra/solution/site/implementation/clone/backend/product-catalog.json ADDED
The diff for this file is too large to render. See raw diff
 
tasks/capterra/solution/site/implementation/clone/backend/site_backend_integration.py ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Generated, site-bound backend integration seam."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib
6
+ import json
7
+ import os
8
+ import sqlite3
9
+ import threading
10
+ from contextlib import closing
11
+ from pathlib import Path
12
+ from typing import Any, Callable
13
+
14
+ from websitebench.local_clone_auth import LocalAuthStore
15
+ from websitebench.site_backend import SiteBackend, SiteBindingError, load_runtime
16
+ from websitebench.site_backend.copy_cutover import (
17
+ CopyCutoverError,
18
+ publish_transformed_sqlite_copy,
19
+ )
20
+ from websitebench.site_backend.database import BASE_SCHEMA, utc_now
21
+
22
+
23
+ DEFAULT_RUNTIME_PATH = Path(__file__).resolve().parents[2] / "backend" / "runtime.json"
24
+ LEGACY_DATABASE_FILENAME = "capterra.sqlite3"
25
+ CANONICAL_DATABASE_FILENAME = "websitebench-capterra.sqlite3"
26
+ LEGACY_BACKUP_SUFFIX = ".capterra-unbound-legacy"
27
+
28
+
29
+ class CapterraAuthStore(LocalAuthStore):
30
+ """Keep OTP material process-local across in-process app restarts."""
31
+
32
+ _process_mail_secrets: dict[tuple[str, str, str], str] = {}
33
+ _process_mail_lock = threading.RLock()
34
+
35
+ def ensure_schema(self) -> None:
36
+ if not self._schema_ready and _auth_schema_is_current(
37
+ self.database_path, self.site_id
38
+ ):
39
+ self._schema_ready = True
40
+ super().ensure_schema()
41
+
42
+ def _process_key(self, purpose: str, flow_id: str) -> tuple[str, str, str]:
43
+ self._mail_secret_key(purpose, flow_id)
44
+ return str(self.database_path.resolve()), purpose, flow_id
45
+
46
+ def _remember_mail_code(self, purpose: str, flow_id: str, code: str) -> None:
47
+ super()._remember_mail_code(purpose, flow_id, code)
48
+ normalized = super()._mail_code(purpose, flow_id)
49
+ if normalized is None:
50
+ raise RuntimeError("mail code was not retained in process memory")
51
+ with self._process_mail_lock:
52
+ self._process_mail_secrets[self._process_key(purpose, flow_id)] = normalized
53
+
54
+ def _mail_code(self, purpose: str, flow_id: str) -> str | None:
55
+ current = super()._mail_code(purpose, flow_id)
56
+ if current is not None:
57
+ return current
58
+ with self._process_mail_lock:
59
+ return self._process_mail_secrets.get(self._process_key(purpose, flow_id))
60
+
61
+ def _clear_mail_secrets(self) -> None:
62
+ database_prefix = str(self.database_path.resolve())
63
+ with self._process_mail_lock:
64
+ for key in list(self._process_mail_secrets):
65
+ if key[0] == database_prefix:
66
+ del self._process_mail_secrets[key]
67
+ super()._clear_mail_secrets()
68
+
69
+ def reconcile_mail(self, *, worker_token: str | None = None) -> None:
70
+ super().reconcile_mail(worker_token=worker_token)
71
+ with self.connect() as connection, self._transaction(connection):
72
+ connection.execute(
73
+ "UPDATE local_auth_mail_outbox "
74
+ "SET last_error='startup claim replay' "
75
+ "WHERE last_error='startup-claim-replay'"
76
+ )
77
+
78
+
79
+ def _auth_schema_is_current(database_path: Path, site_id: str | None) -> bool:
80
+ """Recognize a bound v4 auth schema without mutating persisted rows."""
81
+
82
+ if not database_path.is_file():
83
+ return False
84
+ try:
85
+ with sqlite3.connect(database_path) as connection:
86
+ binding = connection.execute(
87
+ "SELECT site_id FROM websitebench_site_binding WHERE singleton=1"
88
+ ).fetchone()
89
+ versions = {
90
+ str(row[0])
91
+ for row in connection.execute(
92
+ "SELECT version FROM local_auth_schema_migrations"
93
+ ).fetchall()
94
+ }
95
+ except sqlite3.DatabaseError:
96
+ return False
97
+ binding_matches = (
98
+ binding is not None
99
+ and isinstance(binding[0], str)
100
+ and (site_id is None or binding[0] == site_id)
101
+ )
102
+ return binding_matches and versions.issuperset({"0001", "0002", "0003", "0004"})
103
+
104
+
105
+ def _declared_hook(
106
+ declaration: str | None,
107
+ ) -> Callable[[sqlite3.Connection], None] | None:
108
+ if declaration is None:
109
+ return None
110
+ module_name, function_name = declaration.split(":", 1)
111
+ module = importlib.import_module(module_name)
112
+ hook: Any = getattr(module, function_name, None)
113
+ if not callable(hook):
114
+ raise RuntimeError(f"declared backend hook is not callable: {declaration}")
115
+ actual = f"{hook.__module__}:{hook.__name__}"
116
+ if actual != declaration:
117
+ raise RuntimeError(
118
+ f"declared backend hook resolved as {actual!r}, expected {declaration!r}"
119
+ )
120
+ return hook
121
+
122
+
123
+ def _legacy_capterra_prefix_connection(
124
+ connection: sqlite3.Connection,
125
+ ) -> None:
126
+ """Verify the exact site-owned migration prefix before copy adoption."""
127
+
128
+ tables = {
129
+ str(row[0])
130
+ for row in connection.execute(
131
+ "SELECT name FROM sqlite_master WHERE type='table'"
132
+ )
133
+ }
134
+ if "websitebench_site_binding" in tables:
135
+ raise SiteBindingError("legacy Capterra source is already site-bound")
136
+ if "clawbench_site_binding" in tables:
137
+ raise SiteBindingError("Capterra database uses the other runtime namespace")
138
+ if not {"schema_migrations", "products", "accounts"}.issubset(tables):
139
+ raise SiteBindingError(
140
+ "unbound database does not match the Capterra business schema"
141
+ )
142
+ rows = connection.execute(
143
+ "SELECT version,name FROM schema_migrations ORDER BY version"
144
+ ).fetchall()
145
+ from backend.db import MIGRATIONS
146
+
147
+ expected = [(migration.version, migration.name) for migration in MIGRATIONS]
148
+ actual = [(int(row[0]), str(row[1])) for row in rows]
149
+ if not actual or actual != expected[: len(actual)]:
150
+ raise SiteBindingError(
151
+ "unbound database has an invalid Capterra migration prefix"
152
+ )
153
+
154
+
155
+ def _bind_legacy_capterra_copy(
156
+ source: Path,
157
+ canonical: Path,
158
+ *,
159
+ site_id: str,
160
+ migration_declaration: str | None,
161
+ migration_hook: Callable[[sqlite3.Connection], None] | None,
162
+ ) -> bool:
163
+ """Copy-upgrade one verified Capterra migration-prefix database."""
164
+
165
+ if not source.exists():
166
+ return False
167
+
168
+ def transform(database: Path) -> None:
169
+ with closing(sqlite3.connect(database, isolation_level=None)) as connection:
170
+ connection.execute("PRAGMA foreign_keys=ON")
171
+ connection.executescript(BASE_SCHEMA)
172
+ connection.execute("BEGIN IMMEDIATE")
173
+ try:
174
+ connection.execute(
175
+ "INSERT INTO websitebench_site_binding"
176
+ "(singleton,site_id,bound_at) VALUES (1,?,?)",
177
+ (site_id, utc_now()),
178
+ )
179
+ if migration_declaration is not None:
180
+ if migration_hook is None:
181
+ raise SiteBindingError("Capterra migration hook is unavailable")
182
+ migration_hook(connection)
183
+ connection.execute(
184
+ "INSERT INTO websitebench_backend_migrations"
185
+ "(migration_id,applied_at) VALUES (?,?)",
186
+ (f"site-migration:{migration_declaration}", utc_now()),
187
+ )
188
+ connection.execute(
189
+ "INSERT OR IGNORE INTO websitebench_backend_migrations"
190
+ "(migration_id,applied_at) VALUES ('site-backend-v1',?)",
191
+ (utc_now(),),
192
+ )
193
+ if connection.execute("PRAGMA foreign_key_check").fetchall():
194
+ raise SiteBindingError("Capterra copy has foreign-key violations")
195
+ connection.execute("COMMIT")
196
+ except BaseException:
197
+ if connection.in_transaction:
198
+ connection.execute("ROLLBACK")
199
+ raise
200
+
201
+ def validate_canonical(database: Path) -> None:
202
+ with closing(sqlite3.connect(database)) as connection:
203
+ binding = connection.execute(
204
+ "SELECT singleton,site_id FROM websitebench_site_binding"
205
+ ).fetchall()
206
+ integrity = connection.execute("PRAGMA integrity_check").fetchall()
207
+ foreign_keys = connection.execute("PRAGMA foreign_key_check").fetchall()
208
+ if binding != [(1, site_id)] or integrity != [("ok",)] or foreign_keys:
209
+ raise SiteBindingError("Capterra copy failed integrity validation")
210
+
211
+ try:
212
+ publish_transformed_sqlite_copy(
213
+ source,
214
+ canonical,
215
+ expected_source_name=LEGACY_DATABASE_FILENAME,
216
+ expected_canonical_name=CANONICAL_DATABASE_FILENAME,
217
+ transform=transform,
218
+ validate_source=_legacy_capterra_prefix_connection,
219
+ validate_canonical=validate_canonical,
220
+ reserved_paths=(source.with_name(source.name + LEGACY_BACKUP_SUFFIX),),
221
+ )
222
+ except CopyCutoverError as exc:
223
+ raise SiteBindingError(str(exc)) from exc
224
+ return True
225
+
226
+
227
+ def open_site_services(
228
+ *,
229
+ mail_mode: str = "LOCAL_ONLY",
230
+ mail_worker_token: str | None = None,
231
+ database_path: Path | None = None,
232
+ ) -> tuple[SiteBackend, LocalAuthStore]:
233
+ """Open one bound database; never omit the site id for permanent auth."""
234
+
235
+ runtime_path = Path(
236
+ os.environ.get(
237
+ "WEBSITEBENCH_SITE_BACKEND_RUNTIME",
238
+ str(DEFAULT_RUNTIME_PATH),
239
+ )
240
+ ).resolve()
241
+ runtime = load_runtime(runtime_path)
242
+ migration_hook = _declared_hook(runtime.migration_hook)
243
+ seed_hook = _declared_hook(runtime.seed_hook)
244
+ deployed_database = os.environ.get(
245
+ "WEBSITEBENCH_SITE_BACKEND_DATABASE",
246
+ )
247
+ selected_database = (
248
+ Path(deployed_database).resolve()
249
+ if deployed_database is not None
250
+ else database_path.resolve()
251
+ if database_path is not None
252
+ else None
253
+ )
254
+ if selected_database is not None:
255
+ if selected_database.name != runtime.database_filename:
256
+ raise RuntimeError(
257
+ "deployed database filename does not match runtime contract"
258
+ )
259
+ legacy_database = selected_database.with_name(LEGACY_DATABASE_FILENAME)
260
+ if not selected_database.exists() and legacy_database.exists():
261
+ _bind_legacy_capterra_copy(
262
+ legacy_database,
263
+ selected_database,
264
+ site_id=runtime.site_id,
265
+ migration_declaration=runtime.migration_hook,
266
+ migration_hook=migration_hook,
267
+ )
268
+ if selected_database is None:
269
+ backend = SiteBackend.open(
270
+ runtime_path,
271
+ migration_hook=migration_hook,
272
+ seed_hook=seed_hook,
273
+ )
274
+ else:
275
+ backend = SiteBackend.open(
276
+ json.loads(runtime_path.read_text(encoding="utf-8")),
277
+ data_root=selected_database.parent,
278
+ migration_hook=migration_hook,
279
+ seed_hook=seed_hook,
280
+ )
281
+ if backend.lifecycle.database_path != selected_database:
282
+ raise RuntimeError(
283
+ "deployed database path does not match backend preflight"
284
+ )
285
+ backend.lifecycle.initialize()
286
+ auth = CapterraAuthStore(
287
+ backend.lifecycle.database_path,
288
+ site_id=backend.config.site_id,
289
+ mail_mode=mail_mode,
290
+ mail_worker_token=mail_worker_token,
291
+ )
292
+ if _auth_schema_is_current(backend.lifecycle.database_path, backend.config.site_id):
293
+ auth._schema_ready = True
294
+ auth.ensure_schema()
295
+ return backend, auth
tasks/capterra/solution/site/implementation/clone/harbor_entry.py ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """WebsiteBench Harbor foreground entrypoint for the frozen clone."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import os
7
+ import re
8
+ import smtplib
9
+ import urllib.error
10
+ import urllib.parse
11
+ import urllib.request
12
+ from email.message import EmailMessage
13
+ from http.cookies import SimpleCookie
14
+ from pathlib import Path
15
+
16
+ import uvicorn
17
+
18
+
19
+ ROOT = Path(__file__).resolve().parent
20
+ SITE_ROOT = ROOT.parent
21
+ RUNTIME = json.loads((SITE_ROOT / "backend" / "runtime.json").read_text(encoding="utf-8"))
22
+ SITE_ID = str(RUNTIME["site"]["id"])
23
+ DATA_DIR = Path(os.environ["DATA_DIR"])
24
+ if not DATA_DIR.is_absolute():
25
+ raise RuntimeError("DATA_DIR must be absolute")
26
+ DATA_DIR = DATA_DIR.resolve()
27
+ DATA_DIR.mkdir(parents=True, exist_ok=True)
28
+ os.environ["WEBSITEBENCH_DATA_DIR"] = str(DATA_DIR)
29
+ os.environ["WEBSITEBENCH_SITE_BACKEND_RUNTIME"] = str(SITE_ROOT / "backend" / "runtime.json")
30
+ os.environ["WEBSITEBENCH_SITE_BACKEND_DATABASE"] = str(DATA_DIR / RUNTIME["database"]["filename"])
31
+ if os.environ.get("WEBSITEBENCH_MAILBOX_BOOTSTRAP_URL", "").strip():
32
+ os.environ["WEBSITEBENCH_DEPLOYMENT_PROFILE"] = "offline-harbor"
33
+ os.environ["WEBSITEBENCH_PAYMENT_PROFILE"] = "local-sandbox"
34
+ HARBOR_MAILBOX_HOSTS = frozenset(
35
+ {"127.0.0.1", "::1", "localhost", "mailbox-internal"}
36
+ )
37
+
38
+
39
+ class _NoRedirect(urllib.request.HTTPRedirectHandler):
40
+ def redirect_request(self, request, fp, code, msg, headers, newurl):
41
+ del request, fp, code, msg, headers, newurl
42
+ return None
43
+
44
+
45
+ def _harbor_mailbox_identity() -> dict[str, object] | None:
46
+ """Acquire the trial-local, write-only mailbox identity."""
47
+
48
+ bootstrap_url = os.environ.get("WEBSITEBENCH_MAILBOX_BOOTSTRAP_URL", "").strip()
49
+ bootstrap_token = os.environ.get(
50
+ "WEBSITEBENCH_MAILBOX_BOOTSTRAP_TOKEN", ""
51
+ ).strip()
52
+ if not bootstrap_url and not bootstrap_token:
53
+ return None
54
+ parsed = urllib.parse.urlsplit(bootstrap_url)
55
+ if (
56
+ parsed.scheme != "http"
57
+ or parsed.hostname not in HARBOR_MAILBOX_HOSTS
58
+ or parsed.username is not None
59
+ or parsed.password is not None
60
+ or len(bootstrap_token) < 32
61
+ ):
62
+ raise RuntimeError("Harbor mailbox bootstrap configuration is invalid")
63
+ request = urllib.request.Request(
64
+ bootstrap_url,
65
+ headers={
66
+ "Accept": "application/json",
67
+ "Authorization": f"Bearer {bootstrap_token}",
68
+ },
69
+ method="GET",
70
+ )
71
+ try:
72
+ with urllib.request.build_opener(_NoRedirect).open(
73
+ request, timeout=10
74
+ ) as response:
75
+ raw = response.read(64 * 1024 + 1)
76
+ except (OSError, urllib.error.URLError) as exc:
77
+ raise RuntimeError("Harbor mailbox bootstrap is unavailable") from exc
78
+ if len(raw) > 64 * 1024:
79
+ raise RuntimeError("Harbor mailbox bootstrap response is too large")
80
+ try:
81
+ identity = json.loads(raw.decode("utf-8"))
82
+ namespace = str(identity["namespace"])
83
+ capability = str(identity["capability"])
84
+ smtp_host = str(identity["smtp_host"])
85
+ smtp_port = int(identity["smtp_port"])
86
+ except (KeyError, TypeError, ValueError, UnicodeError, json.JSONDecodeError) as exc:
87
+ raise RuntimeError("Harbor mailbox bootstrap response is invalid") from exc
88
+ if (
89
+ re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9._-]*", namespace) is None
90
+ or len(namespace) > 128
91
+ or len(capability) < 32
92
+ or smtp_host not in HARBOR_MAILBOX_HOSTS
93
+ or not 1 <= smtp_port <= 65535
94
+ ):
95
+ raise RuntimeError("Harbor mailbox identity is invalid")
96
+ return {
97
+ "namespace": namespace,
98
+ "capability": capability,
99
+ "smtp_host": smtp_host,
100
+ "smtp_port": smtp_port,
101
+ }
102
+
103
+
104
+ MAILBOX_IDENTITY = _harbor_mailbox_identity()
105
+ DELIVERED_MAIL_IDS: set[int] = set()
106
+
107
+ import app as clone_module # noqa: E402
108
+
109
+ clone_app = clone_module.app
110
+
111
+
112
+ def _session_tokens(
113
+ scope: dict[str, object], response_headers: list[tuple[bytes, bytes]]
114
+ ) -> set[str]:
115
+ tokens: set[str] = set()
116
+ raw_cookies = [
117
+ value.decode("latin-1")
118
+ for name, value in scope.get("headers", [])
119
+ if name.lower() == b"cookie"
120
+ ]
121
+ raw_cookies.extend(
122
+ value.decode("latin-1")
123
+ for name, value in response_headers
124
+ if name.lower() == b"set-cookie"
125
+ )
126
+ for raw in raw_cookies:
127
+ parsed = SimpleCookie()
128
+ try:
129
+ parsed.load(raw)
130
+ except Exception:
131
+ continue
132
+ name = clone_module.AUTH_SESSION_COOKIE
133
+ if name in parsed and parsed[name].value:
134
+ tokens.add(parsed[name].value)
135
+ return tokens
136
+
137
+
138
+ def _deliver_harbor_mail(session_tokens: set[str]) -> None:
139
+ """Compatibility hook; the auth store delivers synchronously to Mailpit."""
140
+
141
+ return None
142
+
143
+ HEALTH_BODY = b'{"status":"ok"}'
144
+ # /healthz is the contract (ADR-0010); the private path stays mounted
145
+ # so bundles frozen before the migration keep answering.
146
+ HEALTH_PATHS = ("/healthz", "/__websitebench/health")
147
+
148
+
149
+ async def application(scope, receive, send):
150
+ if scope.get("type") == "http" and scope.get("path") in HEALTH_PATHS:
151
+ await send({
152
+ "type": "http.response.start",
153
+ "status": 200,
154
+ "headers": [
155
+ (b"content-type", b"application/json"),
156
+ (b"content-length", str(len(HEALTH_BODY)).encode("ascii")),
157
+ (b"cache-control", b"no-store"),
158
+ ],
159
+ })
160
+ await send({"type": "http.response.body", "body": HEALTH_BODY})
161
+ return
162
+ response_headers: list[tuple[bytes, bytes]] = []
163
+
164
+ async def deliver_before_final_body(message):
165
+ if message.get("type") == "http.response.start":
166
+ response_headers[:] = list(message.get("headers", []))
167
+ if (
168
+ message.get("type") == "http.response.body"
169
+ and not message.get("more_body", False)
170
+ ):
171
+ _deliver_harbor_mail(_session_tokens(scope, response_headers))
172
+ await send(message)
173
+
174
+ await clone_app(scope, receive, deliver_before_final_body)
175
+
176
+
177
+ if __name__ == "__main__":
178
+ uvicorn.run(
179
+ application,
180
+ host=os.environ["HOST"],
181
+ port=int(os.environ["PORT"]),
182
+ access_log=False,
183
+ timeout_graceful_shutdown=2,
184
+ )
tasks/capterra/solution/site/implementation/clone/static/app.js ADDED
@@ -0,0 +1,381 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Capterra offline study - authored behavior (frontend fixture stage).
2
+ Same-origin only; no remote requests, telemetry, or live chat.
3
+ Contract: help overlay closes with Escape and restores focus; navigation
4
+ uses ordinary local URLs and history (popstate) so refresh and
5
+ back/forward stay deterministic. */
6
+
7
+ (function () {
8
+ "use strict";
9
+
10
+ function ready(fn) {
11
+ if (document.readyState !== "loading") { fn(); return; }
12
+ document.addEventListener("DOMContentLoaded", fn);
13
+ }
14
+
15
+ ready(function () {
16
+ // Keep Enter equivalent to the visible Search button in every supported
17
+ // browser and automation environment.
18
+ document.querySelectorAll(".hero-search").forEach(function (form) {
19
+ form.addEventListener("keydown", function (event) {
20
+ if (event.key === "Enter" && event.target.matches("input")) {
21
+ event.preventDefault();
22
+ form.requestSubmit();
23
+ }
24
+ });
25
+ });
26
+
27
+ // Mobile navigation toggle.
28
+ var toggle = document.querySelector(".nav-toggle");
29
+ var nav = document.getElementById("main-nav");
30
+ if (toggle && nav) {
31
+ toggle.addEventListener("click", function () {
32
+ var expanded = toggle.getAttribute("aria-expanded") === "true";
33
+ toggle.setAttribute("aria-expanded", String(!expanded));
34
+ nav.classList.toggle("open", !expanded);
35
+ });
36
+ nav.addEventListener("click", function (event) {
37
+ if (event.target.closest("a")) {
38
+ toggle.setAttribute("aria-expanded", "false");
39
+ nav.classList.remove("open");
40
+ }
41
+ });
42
+ document.addEventListener("keydown", function (event) {
43
+ if (event.key === "Escape" && nav.classList.contains("open")) {
44
+ nav.classList.remove("open");
45
+ toggle.setAttribute("aria-expanded", "false");
46
+ toggle.focus();
47
+ }
48
+ });
49
+ }
50
+
51
+ // Help overlay: open via trigger, close via button or Escape,
52
+ // and restore focus to the opener on close.
53
+ var trigger = document.querySelector(".help-trigger");
54
+ var dialog = document.getElementById("help-dialog");
55
+ if (trigger && dialog) {
56
+ var close = dialog.querySelector(".help-close");
57
+ var lastFocus = null;
58
+ var openDialog = function () {
59
+ if (dialog.hidden) {
60
+ lastFocus = document.activeElement;
61
+ }
62
+ dialog.hidden = false;
63
+ document.body.classList.add("help-simulation-state");
64
+ (close || dialog).focus();
65
+ };
66
+ var closeDialog = function () {
67
+ dialog.hidden = true;
68
+ document.body.classList.remove("help-simulation-state");
69
+ if (lastFocus && lastFocus.focus) { lastFocus.focus(); }
70
+ };
71
+ trigger.addEventListener("click", openDialog);
72
+ if (close) { close.addEventListener("click", closeDialog); }
73
+ document.addEventListener("keydown", function (event) {
74
+ if (event.key === "Escape" && !dialog.hidden) { closeDialog(); }
75
+ if (event.key === "Tab" && !dialog.hidden) {
76
+ var focusable = Array.prototype.slice.call(
77
+ dialog.querySelectorAll(
78
+ 'a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])'
79
+ )
80
+ );
81
+ if (!focusable.length) {
82
+ event.preventDefault();
83
+ dialog.focus();
84
+ return;
85
+ }
86
+ var first = focusable[0];
87
+ var last = focusable[focusable.length - 1];
88
+ if (event.shiftKey && document.activeElement === first) {
89
+ event.preventDefault();
90
+ last.focus();
91
+ } else if (!event.shiftKey && document.activeElement === last) {
92
+ event.preventDefault();
93
+ first.focus();
94
+ }
95
+ }
96
+ });
97
+ var openFromFragment = function () {
98
+ if (window.location.hash === "#local-help") { openDialog(); }
99
+ };
100
+ window.addEventListener("hashchange", openFromFragment);
101
+ openFromFragment();
102
+ }
103
+
104
+ // History support: fixture states are plain local URLs, so browser
105
+ // back/forward (popstate) always lands on a deterministic server render.
106
+ window.addEventListener("popstate", function () {
107
+ // Server-rendered pages are the source of truth; nothing to hydrate.
108
+ // The listener documents deterministic back/forward support.
109
+ });
110
+
111
+ // Home category tabs: local, display-only selection.
112
+ var tabs = document.querySelectorAll(".category-tab");
113
+ tabs.forEach(function (tab) {
114
+ tab.addEventListener("click", function () {
115
+ tabs.forEach(function (other) {
116
+ other.classList.toggle("active", other === tab);
117
+ other.setAttribute("aria-selected", String(other === tab));
118
+ });
119
+ });
120
+ });
121
+
122
+ // Review-search page: industry and job function are two real steps.
123
+ var chips = document.querySelectorAll("[data-industry]");
124
+ var jobs = document.querySelectorAll("[data-job]");
125
+ var jobFunctions = document.querySelector("[data-job-functions]");
126
+ var showProducts = document.querySelector("[data-show-products]");
127
+ var jobHint = document.querySelector("[data-job-hint]");
128
+ var productInput = document.getElementById("review-product-query");
129
+ var productStatus = document.getElementById("review-product-status");
130
+ if (chips.length && showProducts) {
131
+ var isSupportedProduct = function () {
132
+ if (!productInput) { return true; }
133
+ var normalized = productInput.value.trim().toLowerCase();
134
+ // The captured offline product set contains Notion only. A blank
135
+ // field preserves the source-like mobile path where the input is
136
+ // visually replaced by its Search action.
137
+ return normalized === "" || normalized === "notion";
138
+ };
139
+ var selected = function (controls) {
140
+ return Array.prototype.some.call(controls, function (control) {
141
+ return control.getAttribute("aria-pressed") === "true";
142
+ });
143
+ };
144
+ var updateProductState = function (announceUnsupported) {
145
+ var supported = isSupportedProduct();
146
+ var readyToContinue = supported && selected(chips) && selected(jobs);
147
+ showProducts.disabled = !readyToContinue;
148
+ showProducts.setAttribute("aria-disabled", String(!readyToContinue));
149
+ if (productInput) {
150
+ productInput.setAttribute("aria-invalid", String(!supported));
151
+ }
152
+ if (productStatus) {
153
+ productStatus.hidden = supported || !announceUnsupported;
154
+ productStatus.textContent = supported
155
+ ? ""
156
+ : "That product isn’t available. Search for Notion to continue.";
157
+ }
158
+ };
159
+ var addEnterActivation = function (control) {
160
+ control.addEventListener("keydown", function (event) {
161
+ if (event.key === "Enter") {
162
+ event.preventDefault();
163
+ control.click();
164
+ }
165
+ });
166
+ };
167
+ chips.forEach(function (chip) {
168
+ chip.setAttribute("aria-pressed", "false");
169
+ addEnterActivation(chip);
170
+ chip.addEventListener("click", function () {
171
+ chips.forEach(function (other) {
172
+ other.setAttribute("aria-pressed", String(other === chip));
173
+ });
174
+ jobs.forEach(function (job) {
175
+ job.setAttribute("aria-pressed", "false");
176
+ });
177
+ if (jobFunctions) { jobFunctions.hidden = false; }
178
+ if (jobHint) {
179
+ jobHint.textContent =
180
+ "Now choose the job function that best matches your work.";
181
+ }
182
+ updateProductState(false);
183
+ });
184
+ });
185
+ jobs.forEach(function (job) {
186
+ job.setAttribute("aria-pressed", "false");
187
+ addEnterActivation(job);
188
+ job.addEventListener("click", function () {
189
+ jobs.forEach(function (other) {
190
+ other.setAttribute("aria-pressed", String(other === job));
191
+ });
192
+ if (jobHint) {
193
+ jobHint.textContent =
194
+ "Industry and job function selected. Show matching products.";
195
+ }
196
+ updateProductState(true);
197
+ });
198
+ });
199
+ if (productInput) {
200
+ productInput.addEventListener("input", function () {
201
+ updateProductState(productInput.value.trim() !== "");
202
+ });
203
+ }
204
+ showProducts.addEventListener("click", function () {
205
+ if (!isSupportedProduct()) {
206
+ updateProductState(true);
207
+ if (productInput) { productInput.focus(); }
208
+ } else if (!showProducts.disabled) {
209
+ window.location.assign("/reviews/notion/write");
210
+ }
211
+ });
212
+ updateProductState(false);
213
+ }
214
+
215
+ // Rating picker: selecting four stars visibly fills stars one through
216
+ // four. This avoids the misleading single-filled-star radio default.
217
+ var ratingInputs = document.querySelectorAll(
218
+ '.star-picker input[name="rating"]'
219
+ );
220
+ var ratingOutput = document.querySelector("[data-rating-output]");
221
+ if (ratingInputs.length) {
222
+ var paintRating = function (selected) {
223
+ ratingInputs.forEach(function (input) {
224
+ var option = input.closest(".star-option");
225
+ if (option) {
226
+ option.classList.toggle(
227
+ "is-filled", Number(input.value) <= selected
228
+ );
229
+ }
230
+ });
231
+ if (ratingOutput) {
232
+ ratingOutput.textContent = selected
233
+ ? selected + " of 5 stars selected"
234
+ : "No rating selected";
235
+ }
236
+ };
237
+ ratingInputs.forEach(function (input) {
238
+ input.addEventListener("change", function () {
239
+ paintRating(Number(input.value));
240
+ });
241
+ });
242
+ var checkedRating = document.querySelector(
243
+ '.star-picker input[name="rating"]:checked'
244
+ );
245
+ paintRating(checkedRating ? Number(checkedRating.value) : 0);
246
+
247
+ // A server-rendered missing-rating response returns keyboard and
248
+ // assistive-technology users to the first radio while retaining the
249
+ // submitted review text and keeping the alert available by reference.
250
+ var ratingError = document.querySelector(
251
+ '.rating-fieldset[data-focus-error="rating"]'
252
+ );
253
+ if (ratingError) {
254
+ var firstRating = ratingError.querySelector(
255
+ 'input[name="rating"]'
256
+ );
257
+ if (firstRating) { firstRating.focus(); }
258
+ }
259
+ }
260
+
261
+ // Every source-visible unavailable external action terminates in one
262
+ // honest local disclosure. Public controls expose only their stable
263
+ // product identity and a generic boundary kind; the scope assertion
264
+ // manifest remains server-side. The protected contract-audit surface may
265
+ // additionally provide an assertion payload for machine inspection.
266
+ var boundaryDialog = document.getElementById("effect-boundary-dialog");
267
+ var boundaryControls = document.querySelectorAll(
268
+ "[data-effect-boundary], [data-affordance-id][data-effect-payload]"
269
+ );
270
+ if (boundaryDialog && boundaryControls.length) {
271
+ var boundaryClose = boundaryDialog.querySelector(
272
+ ".effect-boundary-close"
273
+ );
274
+ var boundarySummary = boundaryDialog.querySelector(
275
+ ".effect-boundary-summary"
276
+ );
277
+ var boundaryEffects = boundaryDialog.querySelector(
278
+ ".effect-boundary-effects"
279
+ );
280
+ var boundaryLastFocus = null;
281
+ var closeBoundary = function () {
282
+ boundaryDialog.hidden = true;
283
+ if (boundaryLastFocus && boundaryLastFocus.focus) {
284
+ boundaryLastFocus.focus();
285
+ }
286
+ };
287
+ boundaryControls.forEach(function (control) {
288
+ control.addEventListener("click", function (event) {
289
+ if (control.hasAttribute("data-effect-boundary")) {
290
+ event.preventDefault();
291
+ }
292
+ var assertions = [];
293
+ try {
294
+ assertions = JSON.parse(
295
+ control.getAttribute("data-effect-payload") || "[]"
296
+ );
297
+ } catch (_error) {
298
+ assertions = [];
299
+ }
300
+ boundaryLastFocus = control;
301
+ boundarySummary.textContent =
302
+ control.getAttribute("data-boundary-message") ||
303
+ control.textContent.trim() + " isn’t available from this page.";
304
+ boundaryEffects.replaceChildren();
305
+ assertions.forEach(function (assertion) {
306
+ var item = document.createElement("li");
307
+ item.setAttribute("data-effect-id", assertion.id);
308
+ item.setAttribute(
309
+ "data-effect-coverage-id",
310
+ assertion.coverage_id
311
+ );
312
+ item.hidden = true;
313
+ boundaryEffects.appendChild(item);
314
+ });
315
+ boundaryDialog.hidden = false;
316
+ (boundaryClose || boundaryDialog).focus();
317
+ });
318
+ });
319
+ if (boundaryClose) {
320
+ boundaryClose.addEventListener("click", closeBoundary);
321
+ }
322
+ document.addEventListener("keydown", function (event) {
323
+ if (event.key === "Escape" && !boundaryDialog.hidden) {
324
+ closeBoundary();
325
+ }
326
+ });
327
+ }
328
+
329
+ // A genuine filter selection enters the frozen filter-display route
330
+ // through the public GET form; no query-only identity flip is required.
331
+ var reviewFilterForm = document.querySelector(
332
+ "form[data-review-filter-form]"
333
+ );
334
+ var reviewFilterControls = document.querySelectorAll(
335
+ "select[data-review-filter-control]"
336
+ );
337
+ if (reviewFilterForm && reviewFilterControls.length) {
338
+ reviewFilterControls.forEach(function (control) {
339
+ control.addEventListener("change", function () {
340
+ reviewFilterForm.requestSubmit();
341
+ });
342
+ });
343
+ }
344
+
345
+ var quickPollDismiss = document.querySelector(
346
+ "[data-quick-poll-dismiss]"
347
+ );
348
+ if (quickPollDismiss) {
349
+ quickPollDismiss.addEventListener("click", function () {
350
+ var poll = quickPollDismiss.closest(".reviews-quick-poll");
351
+ if (poll) { poll.hidden = true; }
352
+ });
353
+ }
354
+
355
+ // Source-visible "Show more" controls reveal local content in place and
356
+ // preserve a stable expanded state for accessibility tooling.
357
+ document.querySelectorAll(".reviews-show-more[aria-controls]").forEach(
358
+ function (control) {
359
+ var targetId = control.getAttribute("aria-controls");
360
+ var target = document.getElementById(targetId);
361
+ if (!target) { return; }
362
+ var collapsedLabel = control.innerHTML;
363
+ control.dataset.collapsedLabel = collapsedLabel;
364
+ control.addEventListener("click", function () {
365
+ var expand = target.hidden;
366
+ target.hidden = !expand;
367
+ document
368
+ .querySelectorAll(
369
+ '.reviews-show-more[aria-controls="' + targetId + '"]'
370
+ )
371
+ .forEach(function (peer) {
372
+ peer.setAttribute("aria-expanded", String(expand));
373
+ peer.innerHTML = expand
374
+ ? "Show less&nbsp; &minus;"
375
+ : peer.dataset.collapsedLabel;
376
+ });
377
+ });
378
+ }
379
+ );
380
+ });
381
+ })();
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/019015be83aabeb3260cfdf6.png ADDED

Git LFS Details

  • SHA256: 019015be83aabeb3260cfdf67df02db300fbad3cf4c39609fdcbf7aad456d618
  • Pointer size: 129 Bytes
  • Size of remote file: 3.76 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/01f2e93d6758e17f7805bebb.jpeg ADDED

Git LFS Details

  • SHA256: 01f2e93d6758e17f7805bebb6c14f8f393dd0716baa77268182b6cba08981963
  • Pointer size: 129 Bytes
  • Size of remote file: 4.06 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/02f072bd05705e7636a0cb70.jpeg ADDED

Git LFS Details

  • SHA256: 02f072bd05705e7636a0cb70747c6f8271ec837ddfe4390285c187b19c6bf8a5
  • Pointer size: 129 Bytes
  • Size of remote file: 4.15 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/031118f8c1f3fe2ba6ce08aa.jpeg ADDED

Git LFS Details

  • SHA256: 031118f8c1f3fe2ba6ce08aac996afae6d27e42ccf94fc78d365a97127398214
  • Pointer size: 130 Bytes
  • Size of remote file: 17.1 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0376c4f8ee8895116f64eeeb.jpeg ADDED

Git LFS Details

  • SHA256: 0376c4f8ee8895116f64eeeba2b994316dbadff6dc3901bc7bf8fe2e9928ebd2
  • Pointer size: 129 Bytes
  • Size of remote file: 9.57 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/03b83d8933a5bdff50c00a30.jpeg ADDED

Git LFS Details

  • SHA256: 03b83d8933a5bdff50c00a303d9aea42886b7f12bd01e3b67fdcd37ca870bd97
  • Pointer size: 130 Bytes
  • Size of remote file: 11.1 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/03d1e96715943ce62e628871.jpeg ADDED

Git LFS Details

  • SHA256: 03d1e96715943ce62e628871e340217db83d4924a27fb2cb5f4c17c914a760fb
  • Pointer size: 130 Bytes
  • Size of remote file: 29.5 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/04a32dad79d157dbcf4da11c.jpeg ADDED

Git LFS Details

  • SHA256: 04a32dad79d157dbcf4da11cddb6787b09a30e95fabbde21e6c65dae6fcefe9d
  • Pointer size: 131 Bytes
  • Size of remote file: 384 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/053321b3c04b958984c08542.png ADDED

Git LFS Details

  • SHA256: 053321b3c04b958984c08542c7bfd077c84d9617fc27fbb379e6b35b7d8c97bb
  • Pointer size: 130 Bytes
  • Size of remote file: 23.1 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/05b6fb910fe93a33d9b4f5be.jpeg ADDED

Git LFS Details

  • SHA256: 05b6fb910fe93a33d9b4f5bea78a84944e262b21a00065228b819492bdc3272e
  • Pointer size: 130 Bytes
  • Size of remote file: 19.6 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/063a3dba1a1411a7428ed394.png ADDED

Git LFS Details

  • SHA256: 063a3dba1a1411a7428ed394b3bc3cc9a7e1367b0a32c66252307f34e51f8327
  • Pointer size: 129 Bytes
  • Size of remote file: 8.27 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/071c7df0bf3230cfc0b188f6.png ADDED

Git LFS Details

  • SHA256: 071c7df0bf3230cfc0b188f6c8ef8e69439e5f85aedaf600a10b82944658c353
  • Pointer size: 130 Bytes
  • Size of remote file: 10.5 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0857d6c85de5028728465eec.jpeg ADDED

Git LFS Details

  • SHA256: 0857d6c85de5028728465eec254f15a7ed63e5edd08146921c7c295c34d3c455
  • Pointer size: 129 Bytes
  • Size of remote file: 4.33 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a0e152e3afa09314fbff154.png ADDED

Git LFS Details

  • SHA256: 0a0e152e3afa09314fbff1540511fdfefa7fd83fbae5ed1d3d15053ea60ae052
  • Pointer size: 129 Bytes
  • Size of remote file: 6.78 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a1756b9076f2c2c3b0ffd94.png ADDED

Git LFS Details

  • SHA256: 0a1756b9076f2c2c3b0ffd94a658f2b86a689eda347b2c64f622e11849437c14
  • Pointer size: 129 Bytes
  • Size of remote file: 4.51 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a1bb260f45f9b37ff867562.png ADDED

Git LFS Details

  • SHA256: 0a1bb260f45f9b37ff8675620f15e145d4176ad141e03ac577528052d6060b2f
  • Pointer size: 129 Bytes
  • Size of remote file: 6.05 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a46333a4281109a960d9837.jpeg ADDED

Git LFS Details

  • SHA256: 0a46333a4281109a960d98376d5fc3041adb622d2cfb29968567df2195f8e87d
  • Pointer size: 130 Bytes
  • Size of remote file: 12.4 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0a9d62c2195881db8a99376a.png ADDED

Git LFS Details

  • SHA256: 0a9d62c2195881db8a99376a0ef348a3c5095883af9e369d062ba5ab2fcf3f61
  • Pointer size: 130 Bytes
  • Size of remote file: 25.7 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0aea046b95bbec87e6d42961.png ADDED

Git LFS Details

  • SHA256: 0aea046b95bbec87e6d42961f2acffae159a09071f9b27d0620c3d9ea17d6c00
  • Pointer size: 130 Bytes
  • Size of remote file: 21.2 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0b92ddeec7ced9fe7d0ba32a.svg ADDED
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0c2fb810fccfe04e411cd61b.png ADDED

Git LFS Details

  • SHA256: 0c2fb810fccfe04e411cd61b02093168013749f042d035cd7539c0b35f8223eb
  • Pointer size: 129 Bytes
  • Size of remote file: 6.09 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0cde04057708ec1fbc673bda.jpeg ADDED

Git LFS Details

  • SHA256: 0cde04057708ec1fbc673bdaecf212e98e2da9149881e40cc50da68f18004c90
  • Pointer size: 129 Bytes
  • Size of remote file: 9.16 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0d865cc75de374bb4505c247.png ADDED

Git LFS Details

  • SHA256: 0d865cc75de374bb4505c2473796d13e01ef8d298bed95d4e35398d09c4e7853
  • Pointer size: 130 Bytes
  • Size of remote file: 18.7 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0e26eba93d2cf5dd64a3c037.png ADDED

Git LFS Details

  • SHA256: 0e26eba93d2cf5dd64a3c03775f1f12226ead6aee9fdef2ba8e35abcdf11d221
  • Pointer size: 129 Bytes
  • Size of remote file: 5.41 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0e2fce6471d05ae3041aed3f.png ADDED

Git LFS Details

  • SHA256: 0e2fce6471d05ae3041aed3fe1233a52ab4e4ebf86b79daf8c5a1aadcfe2d273
  • Pointer size: 130 Bytes
  • Size of remote file: 20.1 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0ecbbabad6bc57ad4095c471.svg ADDED
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0f2e84576bc867161d224895.png ADDED

Git LFS Details

  • SHA256: 0f2e84576bc867161d2248951561b62852a0442243c668195c07ac6a595c7647
  • Pointer size: 129 Bytes
  • Size of remote file: 2.79 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/0f56ef86e45a7602ea94eb66.jpeg ADDED

Git LFS Details

  • SHA256: 0f56ef86e45a7602ea94eb6676d360a6c5ab2f9dbb9c010a865e00d372acf3f9
  • Pointer size: 131 Bytes
  • Size of remote file: 366 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10864cc6d9b2891038f703cc.jpeg ADDED

Git LFS Details

  • SHA256: 10864cc6d9b2891038f703cc0240720683b82002f903e2a062554f69d1465cab
  • Pointer size: 130 Bytes
  • Size of remote file: 15.6 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10c7bbf034c9cddd31d9067b.css ADDED
The diff for this file is too large to render. See raw diff
 
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10caaf234a2d0521ed016d3f.jpeg ADDED

Git LFS Details

  • SHA256: 10caaf234a2d0521ed016d3f50c666697c5c8b6b731ec6e483752ef2d410eb8d
  • Pointer size: 129 Bytes
  • Size of remote file: 5.67 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10e11893dc50ce2be5c0bf14.png ADDED

Git LFS Details

  • SHA256: 10e11893dc50ce2be5c0bf144717213386eff19fd105275c0bd15e4ee7412ca3
  • Pointer size: 129 Bytes
  • Size of remote file: 4.08 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/10fade6c113a55da7d4383e7.jpeg ADDED

Git LFS Details

  • SHA256: 10fade6c113a55da7d4383e723e6155c0d73230105859a3e1b087a2ca6e15c1a
  • Pointer size: 129 Bytes
  • Size of remote file: 6 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/112cbfbb160c2c0480c53777.jpeg ADDED

Git LFS Details

  • SHA256: 112cbfbb160c2c0480c537772152f0d75e95d445b5d9c2535615c657d15b2662
  • Pointer size: 129 Bytes
  • Size of remote file: 9.39 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/1262f2221a0bf7b0c6f01f92.jpeg ADDED

Git LFS Details

  • SHA256: 1262f2221a0bf7b0c6f01f92fc614d0a1f95f159550e86bb5bf3c59b720bce0d
  • Pointer size: 129 Bytes
  • Size of remote file: 9.33 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/126e6b76a7f90ef8e6bbc8e4.png ADDED

Git LFS Details

  • SHA256: 126e6b76a7f90ef8e6bbc8e4c5b118bda77dce5f4dca5f398828854955905b22
  • Pointer size: 130 Bytes
  • Size of remote file: 50.8 kB
tasks/capterra/solution/site/implementation/clone/static/public-replay/assets/1293f3569f117fd231d36d8b.jpeg ADDED

Git LFS Details

  • SHA256: 1293f3569f117fd231d36d8bd6261c8d2a0857000e6836fafd5dca3439ad1bb5
  • Pointer size: 130 Bytes
  • Size of remote file: 11.1 kB