omenai 0.1.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 (100) hide show
  1. omenai-0.1.0/LICENSE +19 -0
  2. omenai-0.1.0/NOTICE.md +24 -0
  3. omenai-0.1.0/PKG-INFO +234 -0
  4. omenai-0.1.0/README.md +200 -0
  5. omenai-0.1.0/pyproject.toml +65 -0
  6. omenai-0.1.0/setup.cfg +4 -0
  7. omenai-0.1.0/src/omen/__init__.py +4 -0
  8. omenai-0.1.0/src/omen/analysis/__init__.py +4 -0
  9. omenai-0.1.0/src/omen/analysis/actor/__init__.py +13 -0
  10. omenai-0.1.0/src/omen/analysis/actor/comparability.py +20 -0
  11. omenai-0.1.0/src/omen/analysis/actor/formation.py +54 -0
  12. omenai-0.1.0/src/omen/analysis/actor/insight.py +274 -0
  13. omenai-0.1.0/src/omen/analysis/actor/query.py +457 -0
  14. omenai-0.1.0/src/omen/analysis/actor/report_writer.py +60 -0
  15. omenai-0.1.0/src/omen/analysis/actor/strategy.py +95 -0
  16. omenai-0.1.0/src/omen/analysis/common/evidence.py +29 -0
  17. omenai-0.1.0/src/omen/analysis/common/identity_map.py +15 -0
  18. omenai-0.1.0/src/omen/cli/__init__.py +1 -0
  19. omenai-0.1.0/src/omen/cli/actor.py +377 -0
  20. omenai-0.1.0/src/omen/cli/case.py +454 -0
  21. omenai-0.1.0/src/omen/cli/main.py +903 -0
  22. omenai-0.1.0/src/omen/cli/situation.py +310 -0
  23. omenai-0.1.0/src/omen/explain/causal_trace.py +75 -0
  24. omenai-0.1.0/src/omen/explain/evidence_linker.py +50 -0
  25. omenai-0.1.0/src/omen/explain/precision_report.py +33 -0
  26. omenai-0.1.0/src/omen/explain/report.py +138 -0
  27. omenai-0.1.0/src/omen/explain/rule_trace.py +36 -0
  28. omenai-0.1.0/src/omen/ingest/__init__.py +21 -0
  29. omenai-0.1.0/src/omen/ingest/models.py +109 -0
  30. omenai-0.1.0/src/omen/ingest/processor/__init__.py +19 -0
  31. omenai-0.1.0/src/omen/ingest/processor/inventory.py +34 -0
  32. omenai-0.1.0/src/omen/ingest/processor/loader.py +55 -0
  33. omenai-0.1.0/src/omen/ingest/processor/pdf.py +47 -0
  34. omenai-0.1.0/src/omen/ingest/processor/text.py +92 -0
  35. omenai-0.1.0/src/omen/ingest/processor/url.py +119 -0
  36. omenai-0.1.0/src/omen/ingest/reportor/__init__.py +1 -0
  37. omenai-0.1.0/src/omen/ingest/reportor/situation_brief.py +91 -0
  38. omenai-0.1.0/src/omen/ingest/synthesizer/__init__.py +7 -0
  39. omenai-0.1.0/src/omen/ingest/synthesizer/assembler.py +86 -0
  40. omenai-0.1.0/src/omen/ingest/synthesizer/builders/__init__.py +0 -0
  41. omenai-0.1.0/src/omen/ingest/synthesizer/builders/actor.py +747 -0
  42. omenai-0.1.0/src/omen/ingest/synthesizer/builders/assertion.py +61 -0
  43. omenai-0.1.0/src/omen/ingest/synthesizer/builders/candidate.py +42 -0
  44. omenai-0.1.0/src/omen/ingest/synthesizer/builders/event.py +101 -0
  45. omenai-0.1.0/src/omen/ingest/synthesizer/builders/mapper.py +21 -0
  46. omenai-0.1.0/src/omen/ingest/synthesizer/builders/situation.py +179 -0
  47. omenai-0.1.0/src/omen/ingest/synthesizer/cache.py +43 -0
  48. omenai-0.1.0/src/omen/ingest/synthesizer/clients.py +70 -0
  49. omenai-0.1.0/src/omen/ingest/synthesizer/config.py +112 -0
  50. omenai-0.1.0/src/omen/ingest/synthesizer/generator.py +51 -0
  51. omenai-0.1.0/src/omen/ingest/synthesizer/healthcheck.py +101 -0
  52. omenai-0.1.0/src/omen/ingest/synthesizer/prompts/__init__.py +78 -0
  53. omenai-0.1.0/src/omen/ingest/synthesizer/prompts/loader.py +86 -0
  54. omenai-0.1.0/src/omen/ingest/synthesizer/prompts/registry.py +84 -0
  55. omenai-0.1.0/src/omen/ingest/synthesizer/schema/__init__.py +11 -0
  56. omenai-0.1.0/src/omen/ingest/synthesizer/schema/actor.py +53 -0
  57. omenai-0.1.0/src/omen/ingest/synthesizer/services/__init__.py +9 -0
  58. omenai-0.1.0/src/omen/ingest/synthesizer/services/actor.py +71 -0
  59. omenai-0.1.0/src/omen/ingest/synthesizer/services/situation.py +492 -0
  60. omenai-0.1.0/src/omen/ingest/synthesizer/services/strategy.py +98 -0
  61. omenai-0.1.0/src/omen/scenario/__init__.py +1 -0
  62. omenai-0.1.0/src/omen/scenario/case_replay_loader.py +283 -0
  63. omenai-0.1.0/src/omen/scenario/contract_loader.py +23 -0
  64. omenai-0.1.0/src/omen/scenario/ingest_validator.py +55 -0
  65. omenai-0.1.0/src/omen/scenario/loader.py +145 -0
  66. omenai-0.1.0/src/omen/scenario/ontology_loader.py +139 -0
  67. omenai-0.1.0/src/omen/scenario/ontology_models.py +254 -0
  68. omenai-0.1.0/src/omen/scenario/ontology_validator.py +1037 -0
  69. omenai-0.1.0/src/omen/scenario/ontology_vocab.py +23 -0
  70. omenai-0.1.0/src/omen/scenario/pack_compiler.py +228 -0
  71. omenai-0.1.0/src/omen/scenario/splitter.py +174 -0
  72. omenai-0.1.0/src/omen/scenario/validator.py +306 -0
  73. omenai-0.1.0/src/omen/simulation/__init__.py +1 -0
  74. omenai-0.1.0/src/omen/simulation/case_replay.py +48 -0
  75. omenai-0.1.0/src/omen/simulation/condition_types.py +45 -0
  76. omenai-0.1.0/src/omen/simulation/control_mapper.py +19 -0
  77. omenai-0.1.0/src/omen/simulation/engine.py +141 -0
  78. omenai-0.1.0/src/omen/simulation/precision_gate.py +63 -0
  79. omenai-0.1.0/src/omen/simulation/precision_metrics.py +127 -0
  80. omenai-0.1.0/src/omen/simulation/replay.py +185 -0
  81. omenai-0.1.0/src/omen/simulation/state.py +29 -0
  82. omenai-0.1.0/src/omen/simulation/step.py +114 -0
  83. omenai-0.1.0/src/omen/types.py +115 -0
  84. omenai-0.1.0/src/omen/ui/__init__.py +1 -0
  85. omenai-0.1.0/src/omen/ui/actor_graph.py +144 -0
  86. omenai-0.1.0/src/omen/ui/artifacts.py +41 -0
  87. omenai-0.1.0/src/omen/ui/baseline_graph.py +200 -0
  88. omenai-0.1.0/src/omen/ui/case_catalog.py +73 -0
  89. omenai-0.1.0/src/omen/ui/causal_trace.py +66 -0
  90. omenai-0.1.0/src/omen/ui/editable_controls.py +59 -0
  91. omenai-0.1.0/src/omen/ui/generation_panel.py +21 -0
  92. omenai-0.1.0/src/omen/ui/ontology_graph.py +264 -0
  93. omenai-0.1.0/src/omen/ui/view_model.py +475 -0
  94. omenai-0.1.0/src/omenai.egg-info/PKG-INFO +234 -0
  95. omenai-0.1.0/src/omenai.egg-info/SOURCES.txt +98 -0
  96. omenai-0.1.0/src/omenai.egg-info/dependency_links.txt +1 -0
  97. omenai-0.1.0/src/omenai.egg-info/entry_points.txt +2 -0
  98. omenai-0.1.0/src/omenai.egg-info/requires.txt +20 -0
  99. omenai-0.1.0/src/omenai.egg-info/top_level.txt +1 -0
  100. omenai-0.1.0/tests/test_smoke.py +58 -0
omenai-0.1.0/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
+
4
+ Copyright (C) 2026 StrategyLogic
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Affero General Public License as
8
+ published by the Free Software Foundation, either version 3 of the
9
+ License, or (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Affero General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Affero General Public License
17
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
18
+
19
+ SPDX-License-Identifier: AGPL-3.0-or-later
omenai-0.1.0/NOTICE.md ADDED
@@ -0,0 +1,24 @@
1
+ # NOTICE
2
+
3
+ ## Project Ownership
4
+
5
+ Omen is developed and maintained by **[StrategyLogic](https://www.strategylogic.ai)**.
6
+ The official repository is [StrategyLogic/omen](https://github.com/StrategyLogic/omen),
7
+ and the organization profile is [github.com/StrategyLogic](https://github.com/StrategyLogic).
8
+
9
+ Copyright © 2026 StrategyLogic.
10
+
11
+ ## Trademark Notice
12
+
13
+ **StrategyLogic** is a registered trademark of StrategyLogic.
14
+
15
+ The open-source license for this repository grants rights to use, modify,
16
+ and distribute code under AGPL-3.0-or-later, but it does **not** grant rights
17
+ to use StrategyLogic trademarks, logos, or brand identity except as required
18
+ for truthful attribution.
19
+
20
+ ## Open Source Scope Reminder
21
+
22
+ This repository contains the open-source Omen project materials and code.
23
+ Commercial service assets, private delivery methods, and internal business
24
+ playbooks are outside this repository scope.
omenai-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,234 @@
1
+ Metadata-Version: 2.4
2
+ Name: omenai
3
+ Version: 0.1.0
4
+ Summary: The open-source strategic reasoning engine for technological evolution.
5
+ Author: StrategyLogic
6
+ License-Expression: AGPL-3.0-or-later
7
+ Project-URL: Homepage, https://github.com/StrategyLogic/omen
8
+ Project-URL: Repository, https://github.com/StrategyLogic/omen
9
+ Project-URL: Issues, https://github.com/StrategyLogic/omen/issues
10
+ Requires-Python: <3.13,>=3.12
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ License-File: NOTICE.md
14
+ Requires-Dist: pydantic>=2.8.0
15
+ Requires-Dist: jsonschema>=4.23.0
16
+ Requires-Dist: pypdf>=4.2.0
17
+ Requires-Dist: PyYAML>=6.0
18
+ Requires-Dist: langchain>=0.3.0
19
+ Requires-Dist: langchain-openai>=0.2.0
20
+ Requires-Dist: voyageai>=0.3.2
21
+ Requires-Dist: streamlit>=1.37.0
22
+ Requires-Dist: plotly>=5.23.0
23
+ Requires-Dist: networkx>=3.3
24
+ Requires-Dist: scipy>=1.17.1
25
+ Requires-Dist: python-dotenv>=1.0.1
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=8.2; extra == "dev"
28
+ Requires-Dist: ruff>=0.6.0; extra == "dev"
29
+ Requires-Dist: mypy>=1.10; extra == "dev"
30
+ Requires-Dist: pylint>=3.2.0; extra == "dev"
31
+ Requires-Dist: build>=1.2.2; extra == "dev"
32
+ Requires-Dist: twine>=6.1.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # Omen
36
+
37
+ **The Strategic Reasoning Engine.**
38
+
39
+ [![Pylint](https://github.com/StrategyLogic/omen/actions/workflows/pylint.yml/badge.svg)](https://github.com/StrategyLogic/omen/actions/workflows/pylint.yml) [![Package](https://github.com/StrategyLogic/omen/actions/workflows/python-package.yml/badge.svg)](https://github.com/StrategyLogic/omen/actions/workflows/python-package.yml)
40
+
41
+ > **Simulate the Signs. Reveal the Chaos.**
42
+
43
+ [**Omen**](https://github.com/StrategyLogic/omen) (Chinese: 爻) is an open-source engine built for strategic reasoning in technological evolution. Leveraging **multi-agent game theory**, **capability space modeling**, and **counterfactual analysis**, it calculates how technological evolution reconstructs market landscapes.
44
+
45
+ [中文版](README.zh.md) | [Official Repo](https://github.com/StrategyLogic/omen) | [Concepts](docs/concepts.md) | [Quick Start](docs/quick-start.md) | [Case Templates](docs/case-template.md) | [Roadmap](docs/roadmap.md)
46
+
47
+ ## 💡 Why Omen?
48
+
49
+ Technological competition has never been linear. Real-world technological evolution is a complex system driven by multiple forces:
50
+ * **Drivers**: Capability enhancement, cost curves, migration friction, organizational inertia, capital flow, ecosystem lock-in, standard promotion, developer behavior.
51
+ * **Impacts**: Markets often do not change smoothly; instead, they undergo **accelerated substitution**, **structural reorganization**, or fall into a stalemate of **long-term coexistence** near certain thresholds.
52
+
53
+ Omen attempts to upgrade this process from *opinion discussion* to **conditional reasoning**:
54
+ 1. Map technological competition into a **Capability Space**
55
+ 2. Instantiate market entities as **Strategic Actors**
56
+ 3. Quantify external shocks as **Injectable Events**
57
+ 4. Present results as **Multi-path Evolution** and **Counterfactual Explanations**
58
+
59
+ ### What Omen Does
60
+
61
+ Unlike traditional predictive models, Omen does not promise to *predict a certain future*. Instead, it generates **interpretable, replayable, and comparable future branching paths**. Its core responsibility is to reveal faint omens, critical branching points, and evolutionary trajectories within complex systems, empowering founders, product strategists, technology leaders, and investment analysts to understand:
62
+
63
+ * 🔄 **Substitution Logic**: Which technology will replace another under what critical conditions?
64
+ * 🛡️ **Capability Evolution**: Which core capabilities will be enhanced first, and which will coexist long-term?
65
+ * 🏆 **Strategy Wins**: Which strategy combinations are more likely to win the market, capital, and developer ecosystem?
66
+ * ⏳ **Time Windows**: When is the optimal timing for in-house development, alliances, M&A, or contraction?
67
+
68
+ ## 📜 Philosophy & Design Principles
69
+
70
+ > 💡 **Core Mantra**: *The machine simulates the "Situation"; the human decides the "Destiny".*
71
+
72
+ Just as **Yao** in the *I Ching* represents change and interaction, Omen is designed only to present the evolution of the **Situation (Xiang)**. Interpreting the deeper meaning behind the situation and making decisions is the exclusive privilege of human wisdom.
73
+
74
+ Accordingly, Omen is architected as a **human-decision-first** AI simulator, with a clear division of labor between machine simulation and human sovereignty:
75
+
76
+ #### 🤖 The Machine’s Domain (Simulation & Causality)
77
+ * **Role**: To compute complexity, map multi-path evolutions, and reveal conditional causal chains.
78
+ * **Output**: Interpretable scenarios, probability distributions, and "What-if" branching maps.
79
+ * **Constraint**: It strictly avoids deterministic fate pronouncements or claims of "guaranteed accuracy".
80
+
81
+ #### 🧠 The Human’s Domain (Interpretation & Sovereignty)
82
+ * **Role**: To interpret the "Situation" (Xiang), apply ethical judgment, and make the final strategic call.
83
+ * **Privilege**: Deciding *which* path to take based on values, risk appetite, and vision remains the exclusive privilege of human leaders.
84
+ * **Synergy**: Omen expands the horizon of visible possibilities; humans provide the compass for navigation.
85
+
86
+ 📜 See [Omen Project Protocol](PROTOCOL.md) to get detailed guidelines.
87
+
88
+ ## ⚙️ Core Features
89
+
90
+ | Feature Module | Description |
91
+ | :--- | :--- |
92
+ | 🧬 **Technology Capability Modeling** | Deconstructs complex tech stacks into quantifiable, comparable capability dimensions (e.g., latency, throughput, ease of use, ecosystem richness). |
93
+ | 🤖 **Strategic Agent Simulation** | Defines different types of market participants (startups, giants, open-source communities, regulators), endowing them with goals, resources, and constraints. |
94
+ | 📈 **Market Evolution Reasoning** | Simulates dynamic changes in adoption rates, market share, cost structures, cash flow, and ecosystems. |
95
+ | ⚡ **Critical Point Identification** | Automatically discovers key thresholds for "when substitution occurs" and "why it happens at this moment." |
96
+ | 🔮 **Counterfactual Analysis** | Answers "What would have happened if event X had not occurred, or if strategy Y had been adopted?" |
97
+ | 📖 **Result Explanation Engine** | Outputs key turning points, causal chain deductions, and strategic implications, rejecting black-box conclusions. |
98
+
99
+ ### 📊 Typical Outputs
100
+
101
+ A complete reasoning session typically answers the following questions:
102
+ * **Substitution?** Will the new technology completely replace the old one, or form a complement?
103
+ * **Time Window?** When is the specific time window for substitution or turning points?
104
+ * **Key Drivers?** Which variables (e.g., cost reduction speed, API compatibility) are the decisive factors?
105
+ * **Winners and Losers?** Which entities suffer first, and which benefit unexpectedly?
106
+ * **Strategy Effectiveness?** Under what circumstances is an "open ecosystem" superior to "vertical integration"?
107
+ * **Endgame Form?** Does it move towards monopoly, oligarchic balance, or fragmented coexistence?
108
+
109
+ ## 🛠️ How It Works
110
+
111
+ Omen adopts a layered architecture to ensure the transparency and intervenability of reasoning:
112
+
113
+ ```mermaid
114
+ graph TD
115
+ A[Signal Layer] -->|Tech/Market/Capital/Standard Signals | B(Tech Space Layer)
116
+ B -->|Capability Dimensions/Substitution Relations/Risk Factors | C(Strategic Actor Layer)
117
+ C -->|Goals/Resources/Action Space | D(Simulation Kernel)
118
+ D -->|Rules+Math Models+LLM Decisions | E(Explanation Layer)
119
+ E -->|Branching Paths/Counterfactuals/Causal Chains | F[User Insights]
120
+
121
+ style A fill:#f9f,stroke:#333,stroke-width:2px
122
+ style D fill:#bbf,stroke:#333,stroke-width:2px
123
+ style E fill:#bfb,stroke:#333,stroke-width:2px
124
+ ```
125
+
126
+ * **Signal Layer**: Accesses multi-dimensional macro and micro signals.
127
+ * **Tech Space Layer**: Transforms signals into structured technical objects and relationship graphs.
128
+ * **Strategic Actor Layer**: Defines clear Action Spaces for various entities, rather than free-form chatting.
129
+ * **Simulation Kernel**: Combines hard constraint rules, economic/diffusion models, and LLM decision logic to advance multi-round evolution.
130
+ * **Explanation Layer**: Extracts key branching points and generates human-readable reasoning reports.
131
+
132
+ ## 🎬 Show Cases
133
+
134
+ We have built-in classic reasoning:
135
+ * [🗺️ Ontology Games: Database vs AI Memory](cases/ontology.md)
136
+ * [⚔️ Vector Database vs AI Memory](cases/vector-memory.md)
137
+
138
+ More scenarios are under development (contributions welcome):
139
+ * `Agent Infrastructure` vs `Workflow Platforms`
140
+ * `Vertical AI` vs `General AI Stack`
141
+ * `Open Source Models` vs `Closed Commercial APIs`
142
+ * `Data Governance` vs `AI-Native Knowledge Systems`
143
+
144
+ ## 🚀 Quick Start
145
+
146
+ ### Installation
147
+
148
+ Environment requirements: Python 3.12+ with `pip` package manager.
149
+
150
+ ```bash
151
+ pip install omenai
152
+ ```
153
+
154
+ From source:
155
+
156
+ ```bash
157
+ git clone https://github.com/StrategyLogic/omen.git
158
+ cd omen
159
+ pip install --upgrade pip setuptools wheel
160
+ pip install -e .
161
+ ```
162
+
163
+ ### Run Example
164
+ ```bash
165
+ # run simulate
166
+ omen simulate --scenario data/scenarios/ontology.json
167
+
168
+ # run simulate with stable seed (reproducible)
169
+ omen simulate --scenario data/scenarios/ontology.json --seed 42
170
+
171
+ # explain results
172
+ omen explain --input output/result.json
173
+
174
+ # compare scenarios with generic overrides
175
+ omen compare --scenario data/scenarios/ontology.json --overrides '{"user_overlap_threshold": 0.9}'
176
+
177
+ # compare with business parameter entrypoint (budget shock)
178
+ omen compare --scenario data/scenarios/ontology.json --budget-actor ai-memory --budget-delta 200
179
+
180
+ # keep historical outputs
181
+ omen compare --scenario data/scenarios/ontology.json --budget-actor ai-memory --budget-delta 200 --incremental
182
+ ```
183
+
184
+ ### View Results
185
+
186
+ **Local File Protection**: Output files are written to the root-level `output/` directory, which is excluded in `.gitignore` to avoid being tracked or accidentally uploaded, protecting your data from leakage.
187
+
188
+ Example: `output/result.json`, `output/explanation.json`, `output/comparison.json`
189
+
190
+ By default, each run of the simulation will overwrite the previous results; you can add the `--incremental` to generate new files with a timestamp suffix, which applies to all `omen CLI` commands.
191
+
192
+ ```bash
193
+ # This will not overwrite the previous output (output file will automatically have a timestamp suffix)
194
+ omen simulate --scenario data/scenarios/ontology.json --incremental
195
+ ```
196
+
197
+ By default, `simulate` use random seed to generate non-deterministic results; you can set a fixed `--seed` for reproducibility, it is recommended to compare different scenarios with the same seed to see the pure impact of parameter changes without random noise.
198
+
199
+ ```bash
200
+ # Run simulate with a fixed seed (results will be reproducible)
201
+ omen compare --scenario data/scenarios/ontology.json --budget-actor ai-memory --budget-delta 200 --seed 42
202
+ # Run another scenario with the same seed to compare results
203
+ omen compare --scenario data/scenarios/ontology.json --budget-actor ai-memory --budget-delta 300 --seed 42
204
+ ```
205
+
206
+ Want to learn more? Read the [precision evaluation](docs/precision.md) document.
207
+
208
+ ## 👥 Target Audience
209
+
210
+ Omen is built for the following roles:
211
+ * Technology Strategy Teams
212
+ * Product & Platform Leads
213
+ * AI Infrastructure Researchers
214
+ * Open Source Ecosystem Observers
215
+ * Investors & Industry Analysts
216
+
217
+ ## 📦 License
218
+
219
+ Omen is under [AGPL-3.0-or-later](LICENSE), the project is developed and maintained by **[StrategyLogic®](https://www.strategylogic.ai)**.
220
+
221
+ *Note: If you wish to use Omen in a closed-source environment or provide it as a SaaS service without open-sourcing your code, please contact us for a commercial license.*
222
+
223
+
224
+ ## 🔮 Vision
225
+
226
+ Omen aims to become an **open strategic reasoning workstation**:
227
+ > It does not output a single answer, but helps people systematically understand **how the future branches**;
228
+ > Understand **which conditions shape the outcome**;
229
+ > Understand **which actions can change the path**.
230
+
231
+ If you are interested in technological evolution, market substitution, strategic modeling, or multi-agent reasoning, welcome to join us in interpreting the **omens** of this chaotic world together.
232
+
233
+ ---
234
+ *Simulate the Signs. Reveal the Chaos.*
omenai-0.1.0/README.md ADDED
@@ -0,0 +1,200 @@
1
+ # Omen
2
+
3
+ **The Strategic Reasoning Engine.**
4
+
5
+ [![Pylint](https://github.com/StrategyLogic/omen/actions/workflows/pylint.yml/badge.svg)](https://github.com/StrategyLogic/omen/actions/workflows/pylint.yml) [![Package](https://github.com/StrategyLogic/omen/actions/workflows/python-package.yml/badge.svg)](https://github.com/StrategyLogic/omen/actions/workflows/python-package.yml)
6
+
7
+ > **Simulate the Signs. Reveal the Chaos.**
8
+
9
+ [**Omen**](https://github.com/StrategyLogic/omen) (Chinese: 爻) is an open-source engine built for strategic reasoning in technological evolution. Leveraging **multi-agent game theory**, **capability space modeling**, and **counterfactual analysis**, it calculates how technological evolution reconstructs market landscapes.
10
+
11
+ [中文版](README.zh.md) | [Official Repo](https://github.com/StrategyLogic/omen) | [Concepts](docs/concepts.md) | [Quick Start](docs/quick-start.md) | [Case Templates](docs/case-template.md) | [Roadmap](docs/roadmap.md)
12
+
13
+ ## 💡 Why Omen?
14
+
15
+ Technological competition has never been linear. Real-world technological evolution is a complex system driven by multiple forces:
16
+ * **Drivers**: Capability enhancement, cost curves, migration friction, organizational inertia, capital flow, ecosystem lock-in, standard promotion, developer behavior.
17
+ * **Impacts**: Markets often do not change smoothly; instead, they undergo **accelerated substitution**, **structural reorganization**, or fall into a stalemate of **long-term coexistence** near certain thresholds.
18
+
19
+ Omen attempts to upgrade this process from *opinion discussion* to **conditional reasoning**:
20
+ 1. Map technological competition into a **Capability Space**
21
+ 2. Instantiate market entities as **Strategic Actors**
22
+ 3. Quantify external shocks as **Injectable Events**
23
+ 4. Present results as **Multi-path Evolution** and **Counterfactual Explanations**
24
+
25
+ ### What Omen Does
26
+
27
+ Unlike traditional predictive models, Omen does not promise to *predict a certain future*. Instead, it generates **interpretable, replayable, and comparable future branching paths**. Its core responsibility is to reveal faint omens, critical branching points, and evolutionary trajectories within complex systems, empowering founders, product strategists, technology leaders, and investment analysts to understand:
28
+
29
+ * 🔄 **Substitution Logic**: Which technology will replace another under what critical conditions?
30
+ * 🛡️ **Capability Evolution**: Which core capabilities will be enhanced first, and which will coexist long-term?
31
+ * 🏆 **Strategy Wins**: Which strategy combinations are more likely to win the market, capital, and developer ecosystem?
32
+ * ⏳ **Time Windows**: When is the optimal timing for in-house development, alliances, M&A, or contraction?
33
+
34
+ ## 📜 Philosophy & Design Principles
35
+
36
+ > 💡 **Core Mantra**: *The machine simulates the "Situation"; the human decides the "Destiny".*
37
+
38
+ Just as **Yao** in the *I Ching* represents change and interaction, Omen is designed only to present the evolution of the **Situation (Xiang)**. Interpreting the deeper meaning behind the situation and making decisions is the exclusive privilege of human wisdom.
39
+
40
+ Accordingly, Omen is architected as a **human-decision-first** AI simulator, with a clear division of labor between machine simulation and human sovereignty:
41
+
42
+ #### 🤖 The Machine’s Domain (Simulation & Causality)
43
+ * **Role**: To compute complexity, map multi-path evolutions, and reveal conditional causal chains.
44
+ * **Output**: Interpretable scenarios, probability distributions, and "What-if" branching maps.
45
+ * **Constraint**: It strictly avoids deterministic fate pronouncements or claims of "guaranteed accuracy".
46
+
47
+ #### 🧠 The Human’s Domain (Interpretation & Sovereignty)
48
+ * **Role**: To interpret the "Situation" (Xiang), apply ethical judgment, and make the final strategic call.
49
+ * **Privilege**: Deciding *which* path to take based on values, risk appetite, and vision remains the exclusive privilege of human leaders.
50
+ * **Synergy**: Omen expands the horizon of visible possibilities; humans provide the compass for navigation.
51
+
52
+ 📜 See [Omen Project Protocol](PROTOCOL.md) to get detailed guidelines.
53
+
54
+ ## ⚙️ Core Features
55
+
56
+ | Feature Module | Description |
57
+ | :--- | :--- |
58
+ | 🧬 **Technology Capability Modeling** | Deconstructs complex tech stacks into quantifiable, comparable capability dimensions (e.g., latency, throughput, ease of use, ecosystem richness). |
59
+ | 🤖 **Strategic Agent Simulation** | Defines different types of market participants (startups, giants, open-source communities, regulators), endowing them with goals, resources, and constraints. |
60
+ | 📈 **Market Evolution Reasoning** | Simulates dynamic changes in adoption rates, market share, cost structures, cash flow, and ecosystems. |
61
+ | ⚡ **Critical Point Identification** | Automatically discovers key thresholds for "when substitution occurs" and "why it happens at this moment." |
62
+ | 🔮 **Counterfactual Analysis** | Answers "What would have happened if event X had not occurred, or if strategy Y had been adopted?" |
63
+ | 📖 **Result Explanation Engine** | Outputs key turning points, causal chain deductions, and strategic implications, rejecting black-box conclusions. |
64
+
65
+ ### 📊 Typical Outputs
66
+
67
+ A complete reasoning session typically answers the following questions:
68
+ * **Substitution?** Will the new technology completely replace the old one, or form a complement?
69
+ * **Time Window?** When is the specific time window for substitution or turning points?
70
+ * **Key Drivers?** Which variables (e.g., cost reduction speed, API compatibility) are the decisive factors?
71
+ * **Winners and Losers?** Which entities suffer first, and which benefit unexpectedly?
72
+ * **Strategy Effectiveness?** Under what circumstances is an "open ecosystem" superior to "vertical integration"?
73
+ * **Endgame Form?** Does it move towards monopoly, oligarchic balance, or fragmented coexistence?
74
+
75
+ ## 🛠️ How It Works
76
+
77
+ Omen adopts a layered architecture to ensure the transparency and intervenability of reasoning:
78
+
79
+ ```mermaid
80
+ graph TD
81
+ A[Signal Layer] -->|Tech/Market/Capital/Standard Signals | B(Tech Space Layer)
82
+ B -->|Capability Dimensions/Substitution Relations/Risk Factors | C(Strategic Actor Layer)
83
+ C -->|Goals/Resources/Action Space | D(Simulation Kernel)
84
+ D -->|Rules+Math Models+LLM Decisions | E(Explanation Layer)
85
+ E -->|Branching Paths/Counterfactuals/Causal Chains | F[User Insights]
86
+
87
+ style A fill:#f9f,stroke:#333,stroke-width:2px
88
+ style D fill:#bbf,stroke:#333,stroke-width:2px
89
+ style E fill:#bfb,stroke:#333,stroke-width:2px
90
+ ```
91
+
92
+ * **Signal Layer**: Accesses multi-dimensional macro and micro signals.
93
+ * **Tech Space Layer**: Transforms signals into structured technical objects and relationship graphs.
94
+ * **Strategic Actor Layer**: Defines clear Action Spaces for various entities, rather than free-form chatting.
95
+ * **Simulation Kernel**: Combines hard constraint rules, economic/diffusion models, and LLM decision logic to advance multi-round evolution.
96
+ * **Explanation Layer**: Extracts key branching points and generates human-readable reasoning reports.
97
+
98
+ ## 🎬 Show Cases
99
+
100
+ We have built-in classic reasoning:
101
+ * [🗺️ Ontology Games: Database vs AI Memory](cases/ontology.md)
102
+ * [⚔️ Vector Database vs AI Memory](cases/vector-memory.md)
103
+
104
+ More scenarios are under development (contributions welcome):
105
+ * `Agent Infrastructure` vs `Workflow Platforms`
106
+ * `Vertical AI` vs `General AI Stack`
107
+ * `Open Source Models` vs `Closed Commercial APIs`
108
+ * `Data Governance` vs `AI-Native Knowledge Systems`
109
+
110
+ ## 🚀 Quick Start
111
+
112
+ ### Installation
113
+
114
+ Environment requirements: Python 3.12+ with `pip` package manager.
115
+
116
+ ```bash
117
+ pip install omenai
118
+ ```
119
+
120
+ From source:
121
+
122
+ ```bash
123
+ git clone https://github.com/StrategyLogic/omen.git
124
+ cd omen
125
+ pip install --upgrade pip setuptools wheel
126
+ pip install -e .
127
+ ```
128
+
129
+ ### Run Example
130
+ ```bash
131
+ # run simulate
132
+ omen simulate --scenario data/scenarios/ontology.json
133
+
134
+ # run simulate with stable seed (reproducible)
135
+ omen simulate --scenario data/scenarios/ontology.json --seed 42
136
+
137
+ # explain results
138
+ omen explain --input output/result.json
139
+
140
+ # compare scenarios with generic overrides
141
+ omen compare --scenario data/scenarios/ontology.json --overrides '{"user_overlap_threshold": 0.9}'
142
+
143
+ # compare with business parameter entrypoint (budget shock)
144
+ omen compare --scenario data/scenarios/ontology.json --budget-actor ai-memory --budget-delta 200
145
+
146
+ # keep historical outputs
147
+ omen compare --scenario data/scenarios/ontology.json --budget-actor ai-memory --budget-delta 200 --incremental
148
+ ```
149
+
150
+ ### View Results
151
+
152
+ **Local File Protection**: Output files are written to the root-level `output/` directory, which is excluded in `.gitignore` to avoid being tracked or accidentally uploaded, protecting your data from leakage.
153
+
154
+ Example: `output/result.json`, `output/explanation.json`, `output/comparison.json`
155
+
156
+ By default, each run of the simulation will overwrite the previous results; you can add the `--incremental` to generate new files with a timestamp suffix, which applies to all `omen CLI` commands.
157
+
158
+ ```bash
159
+ # This will not overwrite the previous output (output file will automatically have a timestamp suffix)
160
+ omen simulate --scenario data/scenarios/ontology.json --incremental
161
+ ```
162
+
163
+ By default, `simulate` use random seed to generate non-deterministic results; you can set a fixed `--seed` for reproducibility, it is recommended to compare different scenarios with the same seed to see the pure impact of parameter changes without random noise.
164
+
165
+ ```bash
166
+ # Run simulate with a fixed seed (results will be reproducible)
167
+ omen compare --scenario data/scenarios/ontology.json --budget-actor ai-memory --budget-delta 200 --seed 42
168
+ # Run another scenario with the same seed to compare results
169
+ omen compare --scenario data/scenarios/ontology.json --budget-actor ai-memory --budget-delta 300 --seed 42
170
+ ```
171
+
172
+ Want to learn more? Read the [precision evaluation](docs/precision.md) document.
173
+
174
+ ## 👥 Target Audience
175
+
176
+ Omen is built for the following roles:
177
+ * Technology Strategy Teams
178
+ * Product & Platform Leads
179
+ * AI Infrastructure Researchers
180
+ * Open Source Ecosystem Observers
181
+ * Investors & Industry Analysts
182
+
183
+ ## 📦 License
184
+
185
+ Omen is under [AGPL-3.0-or-later](LICENSE), the project is developed and maintained by **[StrategyLogic®](https://www.strategylogic.ai)**.
186
+
187
+ *Note: If you wish to use Omen in a closed-source environment or provide it as a SaaS service without open-sourcing your code, please contact us for a commercial license.*
188
+
189
+
190
+ ## 🔮 Vision
191
+
192
+ Omen aims to become an **open strategic reasoning workstation**:
193
+ > It does not output a single answer, but helps people systematically understand **how the future branches**;
194
+ > Understand **which conditions shape the outcome**;
195
+ > Understand **which actions can change the path**.
196
+
197
+ If you are interested in technological evolution, market substitution, strategic modeling, or multi-agent reasoning, welcome to join us in interpreting the **omens** of this chaotic world together.
198
+
199
+ ---
200
+ *Simulate the Signs. Reveal the Chaos.*
@@ -0,0 +1,65 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "omenai"
7
+ version = "0.1.0"
8
+ description = "The open-source strategic reasoning engine for technological evolution."
9
+ readme = "README.md"
10
+ requires-python = ">=3.12,<3.13"
11
+ authors = [{ name = "StrategyLogic" }]
12
+ license = "AGPL-3.0-or-later"
13
+ license-files = ["LICENSE", "NOTICE.md"]
14
+ dependencies = [
15
+ "pydantic>=2.8.0",
16
+ "jsonschema>=4.23.0",
17
+ "pypdf>=4.2.0",
18
+ "PyYAML>=6.0",
19
+ "langchain>=0.3.0",
20
+ "langchain-openai>=0.2.0",
21
+ "voyageai>=0.3.2",
22
+ "streamlit>=1.37.0",
23
+ "plotly>=5.23.0",
24
+ "networkx>=3.3",
25
+ "scipy>=1.17.1",
26
+ "python-dotenv>=1.0.1",
27
+ ]
28
+
29
+ [project.scripts]
30
+ omen = "omen.cli.main:main"
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/StrategyLogic/omen"
34
+ Repository = "https://github.com/StrategyLogic/omen"
35
+ Issues = "https://github.com/StrategyLogic/omen/issues"
36
+
37
+ [project.optional-dependencies]
38
+ dev = [
39
+ "pytest>=8.2",
40
+ "ruff>=0.6.0",
41
+ "mypy>=1.10",
42
+ "pylint>=3.2.0",
43
+ "build>=1.2.2",
44
+ "twine>=6.1.0",
45
+ ]
46
+
47
+ [tool.setuptools]
48
+ package-dir = {"" = "src"}
49
+
50
+ [tool.setuptools.packages.find]
51
+ where = ["src"]
52
+
53
+ [tool.pytest.ini_options]
54
+ testpaths = ["tests"]
55
+ pythonpath = ["src"]
56
+
57
+ [tool.ruff]
58
+ line-length = 100
59
+ target-version = "py312"
60
+
61
+ [tool.mypy]
62
+ python_version = "3.12"
63
+ warn_return_any = true
64
+ warn_unused_configs = true
65
+ strict_optional = true
omenai-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ """Omen strategic simulation package."""
2
+
3
+ __all__ = ["__version__"]
4
+ __version__ = "0.1.0"
@@ -0,0 +1,4 @@
1
+ """Analysis domain for retrospective and attribution workflows."""
2
+
3
+ from __future__ import annotations
4
+
@@ -0,0 +1,13 @@
1
+ """Actor analysis capabilities."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .insight import generate_persona_insight
6
+ from .query import build_events_snapshot, build_status_snapshot, snapshot_by_year
7
+
8
+ __all__ = [
9
+ "build_events_snapshot",
10
+ "build_status_snapshot",
11
+ "generate_persona_insight",
12
+ "snapshot_by_year",
13
+ ]
@@ -0,0 +1,20 @@
1
+ """Comparability helpers for deterministic strategic actor runs."""
2
+
3
+ from __future__ import annotations
4
+
5
+
6
+ def build_comparability_metadata(
7
+ *,
8
+ actor_profile_version: str,
9
+ scenario_pack_version: str,
10
+ calculation_policy_version: str,
11
+ blocking_reasons: list[str] | None = None,
12
+ ) -> dict:
13
+ reasons = list(blocking_reasons or [])
14
+ return {
15
+ "comparable": len(reasons) == 0,
16
+ "blocking_reasons": reasons,
17
+ "actor_profile_version": actor_profile_version,
18
+ "scenario_pack_version": scenario_pack_version,
19
+ "calculation_policy_version": calculation_policy_version,
20
+ }
@@ -0,0 +1,54 @@
1
+ """Scenario result assembly helpers for deterministic strategic actor simulation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+
8
+ def assemble_capability_dilemma_fit(
9
+ *,
10
+ scenario_key: str,
11
+ capability_scores: dict[str, float],
12
+ ) -> dict[str, Any]:
13
+ if not capability_scores:
14
+ fit = "medium"
15
+ else:
16
+ avg = sum(capability_scores.values()) / max(len(capability_scores), 1)
17
+ fit = "high" if avg >= 0.7 else "low" if avg <= 0.4 else "medium"
18
+
19
+ return {
20
+ "scenario_key": scenario_key,
21
+ "fit": fit,
22
+ "capability_scores": capability_scores,
23
+ }
24
+
25
+
26
+ def project_scenario_selected_dimensions(
27
+ *,
28
+ scenario_key: str,
29
+ capability_scores: dict[str, float],
30
+ ) -> dict[str, Any]:
31
+ ranked = sorted(capability_scores.items(), key=lambda item: item[1], reverse=True)
32
+ selected = [key for key, _ in ranked[:2]] if ranked else []
33
+
34
+ if scenario_key == "A":
35
+ rationale = [
36
+ "Prioritize internal platform continuity dimensions for high-control path",
37
+ "Select strongest capability dimensions to reduce execution stall risk",
38
+ ]
39
+ elif scenario_key == "B":
40
+ rationale = [
41
+ "Prioritize ecosystem-adaptation dimensions for open-alliance path",
42
+ "Select dimensions balancing scale gain and differentiation preservation",
43
+ ]
44
+ else:
45
+ rationale = [
46
+ "Prioritize alliance-efficiency dimensions for external-platform path",
47
+ "Select dimensions supporting short-term stability under dependency risk",
48
+ ]
49
+
50
+ return {
51
+ "scenario_key": scenario_key,
52
+ "selected_dimension_keys": selected,
53
+ "selection_rationale": rationale,
54
+ }