geo-scope 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. geo_scope-0.3.0/LICENSE +21 -0
  2. geo_scope-0.3.0/PKG-INFO +371 -0
  3. geo_scope-0.3.0/README.md +326 -0
  4. geo_scope-0.3.0/geo_scope/__init__.py +37 -0
  5. geo_scope-0.3.0/geo_scope/benchmark/__init__.py +53 -0
  6. geo_scope-0.3.0/geo_scope/benchmark/builder.py +253 -0
  7. geo_scope-0.3.0/geo_scope/benchmark/calculator.py +479 -0
  8. geo_scope-0.3.0/geo_scope/benchmark/dataset_validator.py +232 -0
  9. geo_scope-0.3.0/geo_scope/benchmark/hasher.py +120 -0
  10. geo_scope-0.3.0/geo_scope/benchmark/models.py +184 -0
  11. geo_scope-0.3.0/geo_scope/benchmark/profile.py +82 -0
  12. geo_scope-0.3.0/geo_scope/benchmark/reproducer.py +196 -0
  13. geo_scope-0.3.0/geo_scope/benchmark/runner.py +668 -0
  14. geo_scope-0.3.0/geo_scope/benchmark/schemas.py +157 -0
  15. geo_scope-0.3.0/geo_scope/benchmark/validator.py +237 -0
  16. geo_scope-0.3.0/geo_scope/cli.py +1193 -0
  17. geo_scope-0.3.0/geo_scope/data/benchmark_history.json +451 -0
  18. geo_scope-0.3.0/geo_scope/engine/__init__.py +0 -0
  19. geo_scope-0.3.0/geo_scope/engine/algo_analyzer.py +361 -0
  20. geo_scope-0.3.0/geo_scope/engine/execution_mode.py +35 -0
  21. geo_scope-0.3.0/geo_scope/engine/export_manager.py +94 -0
  22. geo_scope-0.3.0/geo_scope/engine/feature_extractor.py +318 -0
  23. geo_scope-0.3.0/geo_scope/engine/history_tracker.py +106 -0
  24. geo_scope-0.3.0/geo_scope/engine/model_runner.py +445 -0
  25. geo_scope-0.3.0/geo_scope/engine/persistence.py +114 -0
  26. geo_scope-0.3.0/geo_scope/engine/query_generator.py +333 -0
  27. geo_scope-0.3.0/geo_scope/engine/query_loader.py +186 -0
  28. geo_scope-0.3.0/geo_scope/engine/report_generator.py +352 -0
  29. geo_scope-0.3.0/geo_scope/engine/response_import.py +37 -0
  30. geo_scope-0.3.0/geo_scope/engine/strategy_builder.py +60 -0
  31. geo_scope-0.3.0/geo_scope/entities/__init__.py +8 -0
  32. geo_scope-0.3.0/geo_scope/entities/models.py +37 -0
  33. geo_scope-0.3.0/geo_scope/entities/registry.py +181 -0
  34. geo_scope-0.3.0/geo_scope/mavi/__init__.py +27 -0
  35. geo_scope-0.3.0/geo_scope/mavi/engine.py +274 -0
  36. geo_scope-0.3.0/geo_scope/mavi/geoscope_evaluator.py +170 -0
  37. geo_scope-0.3.0/geo_scope/mavi/models.py +195 -0
  38. geo_scope-0.3.0/geo_scope/mavi/sage_evaluator.py +322 -0
  39. geo_scope-0.3.0/geo_scope/mcp_server.py +294 -0
  40. geo_scope-0.3.0/geo_scope/measurement/__init__.py +8 -0
  41. geo_scope-0.3.0/geo_scope/measurement/engine.py +557 -0
  42. geo_scope-0.3.0/geo_scope/measurement/replay.py +376 -0
  43. geo_scope-0.3.0/geo_scope/parser/__init__.py +11 -0
  44. geo_scope-0.3.0/geo_scope/parser/evaluator.py +217 -0
  45. geo_scope-0.3.0/geo_scope/parser/observation_parser.py +547 -0
  46. geo_scope-0.3.0/geo_scope/providers/__init__.py +26 -0
  47. geo_scope-0.3.0/geo_scope/providers/base.py +241 -0
  48. geo_scope-0.3.0/geo_scope/providers/claude_provider.py +65 -0
  49. geo_scope-0.3.0/geo_scope/providers/gemini_provider.py +63 -0
  50. geo_scope-0.3.0/geo_scope/providers/hamzad_provider.py +251 -0
  51. geo_scope-0.3.0/geo_scope/providers/keyless_wrapper_provider.py +40 -0
  52. geo_scope-0.3.0/geo_scope/providers/models.py +234 -0
  53. geo_scope-0.3.0/geo_scope/providers/ollama_provider.py +47 -0
  54. geo_scope-0.3.0/geo_scope/providers/openai_provider.py +66 -0
  55. geo_scope-0.3.0/geo_scope/providers/openrouter_provider.py +40 -0
  56. geo_scope-0.3.0/geo_scope/providers/perplexity_provider.py +74 -0
  57. geo_scope-0.3.0/geo_scope/providers/public_research_provider.py +24 -0
  58. geo_scope-0.3.0/geo_scope/providers/registry.py +166 -0
  59. geo_scope-0.3.0/geo_scope/providers/simulated.py +232 -0
  60. geo_scope-0.3.0/geo_scope/questions/__init__.py +19 -0
  61. geo_scope-0.3.0/geo_scope/questions/answerpath_connector.py +294 -0
  62. geo_scope-0.3.0/geo_scope/questions/discovery.py +228 -0
  63. geo_scope-0.3.0/geo_scope/questions/models.py +122 -0
  64. geo_scope-0.3.0/geo_scope/release_gate.py +293 -0
  65. geo_scope-0.3.0/geo_scope/server.py +320 -0
  66. geo_scope-0.3.0/geo_scope/static/featured_image_geo.png +0 -0
  67. geo_scope-0.3.0/geo_scope/static/index.html +1433 -0
  68. geo_scope-0.3.0/geo_scope.egg-info/PKG-INFO +371 -0
  69. geo_scope-0.3.0/geo_scope.egg-info/SOURCES.txt +103 -0
  70. geo_scope-0.3.0/geo_scope.egg-info/dependency_links.txt +1 -0
  71. geo_scope-0.3.0/geo_scope.egg-info/entry_points.txt +2 -0
  72. geo_scope-0.3.0/geo_scope.egg-info/requires.txt +18 -0
  73. geo_scope-0.3.0/geo_scope.egg-info/top_level.txt +1 -0
  74. geo_scope-0.3.0/pyproject.toml +84 -0
  75. geo_scope-0.3.0/setup.cfg +4 -0
  76. geo_scope-0.3.0/tests/test_ai_visibility_benchmark.py +192 -0
  77. geo_scope-0.3.0/tests/test_algo_analyzer.py +108 -0
  78. geo_scope-0.3.0/tests/test_answerpath_integration.py +210 -0
  79. geo_scope-0.3.0/tests/test_api_server.py +43 -0
  80. geo_scope-0.3.0/tests/test_benchmark.py +210 -0
  81. geo_scope-0.3.0/tests/test_benchmark_dataset_validator.py +30 -0
  82. geo_scope-0.3.0/tests/test_benchmark_provenance.py +280 -0
  83. geo_scope-0.3.0/tests/test_cli_commands.py +102 -0
  84. geo_scope-0.3.0/tests/test_entities_and_parser.py +158 -0
  85. geo_scope-0.3.0/tests/test_execution_integrity.py +282 -0
  86. geo_scope-0.3.0/tests/test_feature_extractor.py +64 -0
  87. geo_scope-0.3.0/tests/test_golden_evaluator.py +103 -0
  88. geo_scope-0.3.0/tests/test_hamzad_provider.py +352 -0
  89. geo_scope-0.3.0/tests/test_history_tracker.py +35 -0
  90. geo_scope-0.3.0/tests/test_live_benchmark.py +166 -0
  91. geo_scope-0.3.0/tests/test_live_provider_integration.py +430 -0
  92. geo_scope-0.3.0/tests/test_mavi_engine.py +391 -0
  93. geo_scope-0.3.0/tests/test_mcp_server.py +35 -0
  94. geo_scope-0.3.0/tests/test_measurement_and_replay.py +144 -0
  95. geo_scope-0.3.0/tests/test_measurement_contract.py +221 -0
  96. geo_scope-0.3.0/tests/test_measurement_contract_v1.py +175 -0
  97. geo_scope-0.3.0/tests/test_provider_classification.py +104 -0
  98. geo_scope-0.3.0/tests/test_provider_governance.py +103 -0
  99. geo_scope-0.3.0/tests/test_provider_validator.py +202 -0
  100. geo_scope-0.3.0/tests/test_providers.py +37 -0
  101. geo_scope-0.3.0/tests/test_public_research_integrity.py +268 -0
  102. geo_scope-0.3.0/tests/test_query_generator.py +29 -0
  103. geo_scope-0.3.0/tests/test_query_loader.py +63 -0
  104. geo_scope-0.3.0/tests/test_release_gate.py +123 -0
  105. geo_scope-0.3.0/tests/test_report_generator.py +70 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Taqi Molavi (tmolavi)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,371 @@
1
+ Metadata-Version: 2.4
2
+ Name: geo-scope
3
+ Version: 0.3.0
4
+ Summary: Open-Source AI Visibility Measurement Engine & Provenance-Backed Benchmark Platform for Generative Engine Optimization (GEO)
5
+ Author-email: Taqi Molavi <taqimolavi@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://molavi.pro
8
+ Project-URL: Repository, https://github.com/tmolavi/geo-scope
9
+ Project-URL: Documentation, https://github.com/tmolavi/geo-scope#readme
10
+ Project-URL: Research, https://github.com/tmolavi/geo-scope/tree/main/docs
11
+ Project-URL: Issues, https://github.com/tmolavi/geo-scope/issues
12
+ Keywords: geo,generative-engine-optimization,ai-seo,llm-search,perplexity,chatgpt-search,gemini-grounding,claude-ai,share-of-model,citation-graph,rag-benchmarking,mcp-server,hoosh-masnooi,seo-farsi,yapay-zeka,yapay-zeka-seo,arama-motoru-optimizasyonu,empirical-measurement,taqi-molavi
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: fastapi>=0.110.0
28
+ Requires-Dist: uvicorn>=0.28.0
29
+ Requires-Dist: pydantic>=2.5.0
30
+ Requires-Dist: httpx>=0.26.0
31
+ Requires-Dist: requests>=2.31.0
32
+ Requires-Dist: numpy>=1.24.0
33
+ Requires-Dist: pandas>=2.0.0
34
+ Requires-Dist: scikit-learn>=1.3.0
35
+ Requires-Dist: pyyaml>=6.0
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
38
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
39
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
40
+ Requires-Dist: black>=24.0.0; extra == "dev"
41
+ Requires-Dist: flake8>=7.0.0; extra == "dev"
42
+ Requires-Dist: matplotlib>=3.8.0; extra == "dev"
43
+ Requires-Dist: seaborn>=0.13.0; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ <div align="center">
47
+
48
+ # ⟠ GEO-Scope
49
+
50
+ ### Empirical AI Answer Visibility Measurement Framework
51
+
52
+ **An open-source framework for empirical measurement of AI answer visibility, entity mentions, recommendations, and citations across generative AI systems.**
53
+
54
+ [![Language](https://img.shields.io/badge/Language-English-blue)](#)
55
+ [![فارسی](https://img.shields.io/badge/فارسی-README.fa.md-green)](README.fa.md)
56
+ [![TΓΌrkΓ§e](https://img.shields.io/badge/T%C3%BCrk%C3%A7e-README.tr.md-red)](README.tr.md)
57
+ [![AzΙ™rbaycan](https://img.shields.io/badge/Az%C9%99rbaycan-README.az.md-orange)](README.az.md)
58
+ [![Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©](https://img.shields.io/badge/%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9-README.ar.md-teal)](README.ar.md)
59
+
60
+ [![CI](https://github.com/tmolavi/geo-scope/actions/workflows/ci.yml/badge.svg)](https://github.com/tmolavi/geo-scope/actions)
61
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
62
+ [![Scientific Foundation](https://img.shields.io/badge/Scientific%20Foundation-v1.0%20Published-darkgreen)](docs/SCIENTIFIC_FOUNDATION_V1.md)
63
+ [![Measurement Contract](https://img.shields.io/badge/Measurement%20Contract-v1.0-informational)](docs/measurement-contract-v1.md)
64
+ [![Research Paper Outline](https://img.shields.io/badge/Research-Paper%20Outline-purple)](docs/RESEARCH_PAPER_OUTLINE.md)
65
+ [![Golden Parser](https://img.shields.io/badge/Golden%20Parser-v1%20Verified-blueviolet)](benchmark/golden_sets/v1/)
66
+ [![Security Audit](https://img.shields.io/badge/Security-Audit%20Passed-success)](docs/SECURITY_AUDIT.md)
67
+
68
+ [Introduction](#1-introduction) β€’ [What It Measures](#2-what-geo-scope-measures) β€’ [Scientific Foundation](#6-measurement-contract-v1--scientific-foundation) β€’ [Benchmarks](#7-published-benchmark-releases) β€’ [Reproducibility](#8-reproducibility--auditability) β€’ [Research](#9-research--documentation) β€’ [Quickstart](#10-installation--usage) β€’ [MCP](#11-model-context-protocol-mcp)
69
+
70
+ </div>
71
+
72
+ ---
73
+
74
+ ## 1. Introduction
75
+
76
+ Generative AI systems and search-grounded answer engines are rapidly becoming the primary discovery layer for users seeking products, vendors, services, and factual insights.
77
+
78
+ **GEO-Scope** is an evidence-first, open-source measurement framework designed to empirically quantify and preserve auditable evidence of how generative AI systems surface entities. It records, normalizes, and analyzes observable AI completions under documented, neutral prompt sets without relying on speculative ranking algorithms or ungrounded claims.
79
+
80
+ ### Core Observable Outputs Measured:
81
+ - **Entity Mentions**: Observable presence of brands, products, technologies, and public figures in generated text.
82
+ - **Recommendations**: Explicit linguistic endorsements and ordered top-position recommendations.
83
+ - **Citations**: Grounding source URLs and referenced web domains returned by search-augmented models.
84
+ - **Attribution**: Textual credit linking specific facts, statistics, or claims to source entities.
85
+ - **Provider Differences**: Distributional shifts between live search-grounded answer engines and parametric foundation LLMs.
86
+ - **Multilingual Behavior**: Cross-lingual response variations across 26+ evaluated languages.
87
+
88
+ ---
89
+
90
+ ## 2. What GEO-Scope Measures
91
+
92
+ GEO-Scope enforces a strict taxonomic separation between four independent visibility dimensions:
93
+
94
+ ```text
95
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
96
+ β”‚ AI RESPONSE VISIBILITY MATRIX β”‚
97
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
98
+ β”‚ Mention β”‚ Did the entity appear anywhere in the completion? β”‚
99
+ β”‚ Recommendation β”‚ Was the entity explicitly endorsed or recommended? β”‚
100
+ β”‚ Citation β”‚ Was a source URL or grounding domain link provided? β”‚
101
+ β”‚ Attribution β”‚ Was specific data/claim textually credited to it? β”‚
102
+ β”‚ Rank β”‚ Extracted ONLY when a valid ordered list exists. β”‚
103
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
104
+ ```
105
+
106
+ 1. **Mention (`mentioned: true/false`)**:
107
+ - Captures whether the target entity (or associated canonical aliases/founders) appeared in the generated completion.
108
+ - Evaluated via Unicode NFKC normalization, Arabic/Persian letter unification, Zero-Width Non-Joiner (ZWNJ) handling, and negative homonym collision filtering.
109
+ 2. **Recommendation (`recommended: true/false`)**:
110
+ - Strict rule: `mentioned != recommended`.
111
+ - Evaluated based on explicit linguistic recommendation markers (e.g., *"We recommend..."*, *"Top pick"*, *"Ϊ―Ψ²ΫŒΩ†Ω‡ ΩΎΫŒΨ΄Ω†Ω‡Ψ§Ψ―ΫŒ"*) or inclusion in an ordered list answering a recommendation query.
112
+ 3. **Citation (`cited: true/false`)**:
113
+ - Identifies presence of target entity web domains in grounding references, markdown hyperlinks, or structured provider citation chunks.
114
+ 4. **Attribution (`attributed: true/false`)**:
115
+ - Distinct from citation: detects explicit textual sourcing phrasing (e.g., *"According to [Entity]..."*, *"Ψ·Ψ¨Ω‚ Ϊ―Ψ²Ψ§Ψ±Ψ΄ [Ω…ΩˆΨ¬ΩˆΨ―ΫŒΨͺ]"*) even if an active URL link was omitted by the model.
116
+ 5. **Rank (`rank: 1..N | null`)**:
117
+ - Extracted strictly from numbered lists or ordinal items. If an informational question yields an unranked mention, rank is set to `null` to prevent artificial ranking bias.
118
+
119
+ ---
120
+
121
+ ## 3. What GEO-Scope Does NOT Measure
122
+
123
+ To maintain scientific integrity, GEO-Scope clearly outlines its epistemic boundaries:
124
+
125
+ - ❌ **It does NOT reverse-engineer internal ranking algorithms**: GEO-Scope observes external API completions; it cannot inspect internal model weights, attention matrices, or proprietary ranking formulas.
126
+ - ❌ **It does NOT inspect hidden training data**: Observed entity knowledge reflects generated outputs, not full visibility into private training corpora.
127
+ - ❌ **It does NOT claim causal ranking factors**: All reported metrics represent descriptive statistical associations under documented prompts, not causal guarantees.
128
+ - ❌ **It does NOT guarantee SEO or AI visibility improvements**: Measurements provide historical observation, not predictive visibility promises.
129
+ - ❌ **It does NOT treat simulation as live empirical data**: Simulation fixtures are strictly quarantined for testing and CI.
130
+
131
+ ---
132
+
133
+ ## 4. Architecture
134
+
135
+ GEO-Scope operates as a modular, six-stage evidence pipeline:
136
+
137
+ ```text
138
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
139
+ β”‚ Provider Layer β”‚
140
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
141
+ β”‚ β”‚ Search Answer Engines β”‚ β”‚ Parametric Base LLMs β”‚ β”‚
142
+ β”‚ β”‚ (Perplexity, Gemini...) β”‚ β”‚ (OpenAI, Claude...) β”‚ β”‚
143
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
144
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
145
+ β”‚
146
+ β–Ό
147
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
148
+ β”‚ Measurement Engine β”‚
149
+ β”‚ (Prompt Provenance Β· Zero Silent Fallback Β· Runs) β”‚
150
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
151
+ β”‚
152
+ β–Ό
153
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
154
+ β”‚ Raw Response Storage β”‚
155
+ β”‚ (Unparsed API Payloads Β· Latency Β· Token Usage) β”‚
156
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
157
+ β”‚
158
+ β–Ό
159
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
160
+ β”‚ Observation Parser β”‚
161
+ β”‚ (Multi-Lingual Normalizer Β· Homonyms Β· Citations) β”‚
162
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
163
+ β”‚
164
+ β–Ό
165
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
166
+ β”‚ Metrics Calculation β”‚
167
+ β”‚ (OMR Β· Rec Share Β· Citation Rate Β· Honest Denominators) β”‚
168
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
169
+ β”‚
170
+ β–Ό
171
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
172
+ β”‚ Reports + Replayable Bundle β”‚
173
+ β”‚ (JSONL Bundles Β· SHA-256 Checksums Β· Markdown Summaries) β”‚
174
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
175
+ ```
176
+
177
+ ---
178
+
179
+ ## 5. Execution Modes
180
+
181
+ GEO-Scope provides three mutually exclusive execution modes:
182
+
183
+ ### `demo` (Simulation Fixture)
184
+ - **Purpose**: Rapid offline testing, development fixtures, and CI validation.
185
+ - **Behavior**: Uses local mock completions with prefixed IDs (`simulated_*`) and a clear simulation banner.
186
+ - **Guarantee**: Simulation data is strictly rejected by the release quality gate and can **never** enter published empirical benchmarks.
187
+
188
+ ### `measure` (Live Empirical Execution)
189
+ - **Purpose**: Real-world observation runs against live generative AI endpoints.
190
+ - **Behavior**: Dispatches neutral prompt bundles to configured API providers with **zero silent fallback**.
191
+ - **Preservation**: Saves full unmodified payloads to `raw_responses.jsonl` with exact model governance metadata (`requested_provider`, `actual_provider`, `search_grounded`).
192
+
193
+ ### `replay` (Deterministic Offline Replay)
194
+ - **Purpose**: Independent auditability and benchmark verification without API calls or cost.
195
+ - **Behavior**: Reruns the observation parser and metric calculations directly against preserved `raw_responses.jsonl`.
196
+ - **Integrity**: Verifies that recomputed metrics match published results bit-for-bit.
197
+
198
+ ---
199
+
200
+ ## 6. Measurement Contract v1 & Scientific Foundation
201
+
202
+ GEO-Scope does not claim universal AI visibility truth. It measures empirical observations under declared, reproducible measurement configurations.
203
+
204
+ > [!IMPORTANT]
205
+ > **Fundamental Measurement Axiom**
206
+ > *"AI visibility is an observation under a declared measurement system, not a universal ground-truth ranking."*
207
+
208
+ - πŸ›οΈ **Scientific Foundation Release v1.0**: [`docs/SCIENTIFIC_FOUNDATION_V1.md`](docs/SCIENTIFIC_FOUNDATION_V1.md)
209
+ - πŸ“„ **Full Measurement Contract Specification**: [`docs/measurement-contract-v1.md`](docs/measurement-contract-v1.md)
210
+ - ❓ **Why Measurement Contract Exists**: [`docs/WHY_MEASUREMENT_CONTRACT_EXISTS.md`](docs/WHY_MEASUREMENT_CONTRACT_EXISTS.md)
211
+ - πŸ“ **Machine-Readable Schema**: [`schemas/measurement-contract-v1.json`](schemas/measurement-contract-v1.json)
212
+ - πŸ§ͺ **Validation Example Fixture**: [`examples/measurement-contract-v1-example.json`](examples/measurement-contract-v1-example.json)
213
+ - πŸ“Š **Releases & Milestones Timeline**: [`docs/RELEASES.md`](docs/RELEASES.md)
214
+
215
+ ### Core Measurement Principles
216
+ 1. **Mention Definition**: A response-level binary observation indicating whether the target entity appears at least once in the completion. Multiple mentions in a single answer do **not** artificially inflate response-level mention counts.
217
+ 2. **Citation Separation**: Strict 4-way separation between `entity_mentioned` in text, `target_domain_cited` (root domain), `target_url_cited` (deep link), and `third_party_source_cited` (external authority/review links). Mention and citation are never treated as equivalent.
218
+ 3. **Recommendation Semantics**: Evaluated as true only when the model semantically recommends, selects, or endorses the entity. Ambiguous detections are gated and marked `experimental`.
219
+ 4. **Comparability Rules**: Machine-readable comparability verification. Two studies are marked `comparable: true` only when prompt universe, market/language, provider/model family, measurement definitions, and observation windows match.
220
+ 5. **Raw Evidence Traceability**: Every public observation is linked to prompt ID, raw response or cryptographic SHA-256 hash (`response_hash_sha256`), extracted entities, citations, and execution configuration hash.
221
+
222
+ ---
223
+
224
+ ## 7. Published Benchmark Releases
225
+
226
+ GEO-Scope maintains immutable, peer-review-ready benchmark releases under `benchmark/releases/` (see complete [Releases & Milestones Timeline](docs/RELEASES.md)):
227
+
228
+ | Benchmark Release | Prompt Count | Observations | Providers | Cryptographic Status | Documentation |
229
+ |:---|:---|:---|:---|:---|:---|
230
+ | [`global-ai-answers-2026.2`](benchmark/releases/global-ai-answers-2026.2/) | 500 prompts (50 countries) | 45,698 obs | 4 models | SHA-256 Verified | [Paper Draft](docs/research/global-ai-answers-2026.2/global-ai-answers-paper.md) |
231
+ | [`global-ai-answers-2026.2-pilot`](benchmark/releases/global-ai-answers-2026.2-pilot/) | 100 prompts (10 countries) | 8,940 obs | 4 models | SHA-256 Verified | [Pilot Report](docs/GLOBAL_AI_ANSWERS_2026_2_PILOT_REPORT.md) |
232
+ | [`global-ai-answers-2026.1`](benchmark/releases/global-ai-answers-2026.1/) | 34 prompts (7 regions) | Baseline obs | 4 models | SHA-256 Verified | [Methodology](docs/global-ai-answers-methodology.md) |
233
+ | [`geo-seo-digital-agency-iran-2026.1`](benchmark/releases/geo-seo-digital-agency-iran-2026.1/) | 30 prompts (5 intent strata) | 120 completions | 4 models | SHA-256 Verified | [Agency Report](benchmarks/geo-seo-digital-agency-iran-2026.1/report.md) |
234
+
235
+ Every release bundle contains:
236
+ - `manifest.json`: Dataset metadata, provider matrix, and schema version (`measurement_contract_version: "1.0"`).
237
+ - `prompts.jsonl`: Neutral, categorized prompts.
238
+ - `raw_responses.jsonl`: Verbatim API completion payloads.
239
+ - `observations.jsonl`: Granular extracted observation records.
240
+ - `metrics.json`: Aggregated metrics with explicit failure denominators.
241
+ - `checksums.sha256`: SHA-256 hashes of all artifacts.
242
+
243
+ ---
244
+
245
+ ## 8. Reproducibility & Auditability
246
+
247
+ ### 1. Cryptographic SHA-256 Verification
248
+ Verify that dataset files have not been modified or corrupted:
249
+ ```bash
250
+ geo-scope benchmark verify --dataset benchmark/releases/global-ai-answers-2026.2
251
+ ```
252
+
253
+ ### 2. Zero-Network Replay Workflow
254
+ Replay metrics directly from preserved raw responses without executing live API calls:
255
+ ```bash
256
+ geo-scope replay \
257
+ --bundle benchmark/releases/global-ai-answers-2026.2 \
258
+ --out-dir output/replay_2026_2
259
+ ```
260
+
261
+ ### 3. Golden Parser Evaluation
262
+ Evaluate the deterministic multi-lingual parser against human-labeled ground truth:
263
+ ```bash
264
+ geo-scope parser evaluate --golden-set benchmark/golden_sets/v1
265
+ ```
266
+
267
+ **Golden Set Benchmark Results (`v1`, 220 examples across 5 languages)**:
268
+ - **Mention F1**: `99.75%` (Precision: 99.51%, Recall: 100.00%)
269
+ - **Recommendation F1**: `100.00%` (Precision: 100.00%, Recall: 100.00%)
270
+ - **Citation F1**: `100.00%` (Precision: 100.00%, Recall: 100.00%)
271
+ - **Attribution F1**: `91.56%` (Precision: 100.00%, Recall: 84.44%)
272
+ - **Wrong Entity (Homonym) F1**: `96.97%`
273
+ - **Rank Accuracy**: `100.00%`
274
+
275
+ ---
276
+
277
+ ## 9. Research & Documentation
278
+
279
+ - πŸ›οΈ **Scientific Foundation Release v1.0**: [`docs/SCIENTIFIC_FOUNDATION_V1.md`](docs/SCIENTIFIC_FOUNDATION_V1.md)
280
+ - πŸ“Š **Releases & Milestones Timeline**: [`docs/RELEASES.md`](docs/RELEASES.md)
281
+ - πŸ“„ **Measurement Contract v1 Specification**: [`docs/measurement-contract-v1.md`](docs/measurement-contract-v1.md)
282
+ - ❓ **Why Measurement Contract Exists**: [`docs/WHY_MEASUREMENT_CONTRACT_EXISTS.md`](docs/WHY_MEASUREMENT_CONTRACT_EXISTS.md)
283
+ - πŸ”¬ **Research Methods & Protocol**: [`docs/RESEARCH_METHODS.md`](docs/RESEARCH_METHODS.md)
284
+ - πŸ“„ **Research Paper Outline**: [`docs/RESEARCH_PAPER_OUTLINE.md`](docs/RESEARCH_PAPER_OUTLINE.md)
285
+ - πŸ”’ **Open Source Security Audit**: [`docs/SECURITY_AUDIT.md`](docs/SECURITY_AUDIT.md)
286
+ - πŸ“Š **Methodology Crosswalk (Public Practice Comparison)**: [`docs/METHODOLOGY_CROSSWALK.md`](docs/METHODOLOGY_CROSSWALK.md)
287
+ - πŸ”¬ **Scientific Benchmark Methodology**: [`docs/benchmark-methodology.md`](docs/benchmark-methodology.md)
288
+ - πŸ—ΊοΈ **Cross-Repository Evidence Map**: [`docs/EVIDENCE_MAP.md`](docs/EVIDENCE_MAP.md)
289
+ - πŸ“ **Mathematical Formulation & MAVI**: [`docs/MATHEMATICAL_MODEL.md`](docs/MATHEMATICAL_MODEL.md)
290
+ - πŸ”Œ **API Integration Guide**: [`docs/API_INTEGRATION.md`](docs/API_INTEGRATION.md)
291
+ - πŸ›‘οΈ **Release Gate Integrity Protocol**: [`docs/SCIENTIFIC_MEASUREMENT_GATE.md`](docs/SCIENTIFIC_MEASUREMENT_GATE.md)
292
+
293
+ ---
294
+
295
+ ## 10. Installation & Usage
296
+
297
+ ### Installation
298
+ ```bash
299
+ # Clone the repository
300
+ git clone https://github.com/tmolavi/geo-scope.git
301
+ cd geo-scope
302
+
303
+ # Install package in editable mode
304
+ pip install -e .
305
+ ```
306
+
307
+ ### Quick Commands
308
+ ```bash
309
+ # 1. Run local simulation fixture demo
310
+ geo-scope demo
311
+
312
+ # 2. Execute live empirical measurement (requires API credentials)
313
+ geo-scope measure \
314
+ --entities entities/iran-seo-agencies.json \
315
+ --prompts examples/research_run/prompts.jsonl \
316
+ --mode live \
317
+ --providers perplexity_sonar,gemini_grounding \
318
+ --out-dir output/live_run_01
319
+
320
+ # 3. Deterministic offline replay
321
+ geo-scope replay \
322
+ --bundle output/live_run_01 \
323
+ --out-dir output/replay_run_01
324
+
325
+ # 4. Launch interactive local research dashboard
326
+ geo-scope serve --host 127.0.0.1 --port 8000
327
+ ```
328
+
329
+ ---
330
+
331
+ ## 11. Model Context Protocol (MCP)
332
+
333
+ GEO-Scope includes a native **MCP Server** (`stdio`), enabling AI coding assistants and agents (Claude Desktop, Cursor, Antigravity) to query visibility benchmarks and inspect entity evidence chains directly:
334
+
335
+ ```json
336
+ {
337
+ "mcpServers": {
338
+ "geo-scope": {
339
+ "command": "/absolute/path/to/geo-scope/.venv/bin/geo-scope",
340
+ "args": ["mcp"]
341
+ }
342
+ }
343
+ }
344
+ ```
345
+
346
+ See the [Client Integrations Guide](docs/CLIENT_INTEGRATIONS.md) for full configuration details.
347
+
348
+ ---
349
+
350
+ ## Citation & Authorship
351
+
352
+ Developed by **[Taqi Molavi](https://molavi.pro)** (Senior SEO Strategist & GEO Systems Architect).
353
+ Part of the **[Molavi GEO Pyramid](https://molavi.pro/research/geo-pyramid)** research initiative.
354
+
355
+ ```bibtex
356
+ @software{molavi2026geoscope,
357
+ author = {Molavi, Taqi},
358
+ title = {GEO-Scope: Empirical AI Answer Visibility Measurement Framework},
359
+ year = {2026},
360
+ publisher = {GitHub},
361
+ journal = {GitHub repository},
362
+ howpublished = {\url{https://github.com/tmolavi/geo-scope}},
363
+ note = {Personal Homepage: https://molavi.pro/}
364
+ }
365
+ ```
366
+
367
+ ---
368
+
369
+ ## License
370
+
371
+ This project is licensed under the [MIT License](LICENSE) β€” Copyright (c) 2026 [ΨͺΩ‚ΫŒ Ω…ΩˆΩ„ΩˆΫŒ (Taqi Molavi)](https://molavi.pro/).