activegraph 1.0.0rc2__py3-none-any.whl
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.
- activegraph/__init__.py +222 -0
- activegraph/__main__.py +5 -0
- activegraph/behaviors/__init__.py +1 -0
- activegraph/behaviors/base.py +153 -0
- activegraph/behaviors/decorators.py +218 -0
- activegraph/cli/__init__.py +17 -0
- activegraph/cli/main.py +793 -0
- activegraph/cli/quickstart.py +556 -0
- activegraph/core/__init__.py +1 -0
- activegraph/core/clock.py +46 -0
- activegraph/core/event.py +33 -0
- activegraph/core/graph.py +846 -0
- activegraph/core/ids.py +135 -0
- activegraph/core/patch.py +47 -0
- activegraph/core/view.py +59 -0
- activegraph/errors.py +342 -0
- activegraph/frame.py +15 -0
- activegraph/llm/__init__.py +51 -0
- activegraph/llm/anthropic.py +339 -0
- activegraph/llm/cache.py +180 -0
- activegraph/llm/errors.py +257 -0
- activegraph/llm/prompt.py +420 -0
- activegraph/llm/provider.py +66 -0
- activegraph/llm/recorded.py +270 -0
- activegraph/llm/types.py +130 -0
- activegraph/observability/__init__.py +61 -0
- activegraph/observability/logging.py +205 -0
- activegraph/observability/metrics.py +219 -0
- activegraph/observability/migration.py +404 -0
- activegraph/observability/prometheus.py +101 -0
- activegraph/observability/status.py +83 -0
- activegraph/packs/__init__.py +999 -0
- activegraph/packs/diligence/__init__.py +86 -0
- activegraph/packs/diligence/behaviors.py +447 -0
- activegraph/packs/diligence/fixtures/__init__.py +364 -0
- activegraph/packs/diligence/fixtures/companies.py +511 -0
- activegraph/packs/diligence/object_types.py +163 -0
- activegraph/packs/diligence/settings.py +60 -0
- activegraph/packs/diligence/tools.py +124 -0
- activegraph/packs/loader.py +709 -0
- activegraph/packs/scaffold.py +317 -0
- activegraph/policy.py +20 -0
- activegraph/runtime/__init__.py +1 -0
- activegraph/runtime/behavior_graph.py +151 -0
- activegraph/runtime/budget.py +120 -0
- activegraph/runtime/config_errors.py +124 -0
- activegraph/runtime/diff.py +145 -0
- activegraph/runtime/errors.py +216 -0
- activegraph/runtime/exec_errors.py +232 -0
- activegraph/runtime/patterns.py +946 -0
- activegraph/runtime/queue.py +27 -0
- activegraph/runtime/registration_errors.py +291 -0
- activegraph/runtime/registry.py +111 -0
- activegraph/runtime/runtime.py +2441 -0
- activegraph/runtime/scheduler.py +206 -0
- activegraph/runtime/view_builder.py +65 -0
- activegraph/store/__init__.py +41 -0
- activegraph/store/base.py +66 -0
- activegraph/store/conformance.py +161 -0
- activegraph/store/errors.py +84 -0
- activegraph/store/memory.py +118 -0
- activegraph/store/postgres.py +609 -0
- activegraph/store/serde.py +202 -0
- activegraph/store/sqlite.py +446 -0
- activegraph/store/url.py +230 -0
- activegraph/tools/__init__.py +64 -0
- activegraph/tools/base.py +57 -0
- activegraph/tools/cache.py +157 -0
- activegraph/tools/context.py +48 -0
- activegraph/tools/decorators.py +70 -0
- activegraph/tools/errors.py +320 -0
- activegraph/tools/graph_query.py +94 -0
- activegraph/tools/recorded.py +205 -0
- activegraph/tools/web_fetch.py +80 -0
- activegraph/trace/__init__.py +1 -0
- activegraph/trace/causal.py +123 -0
- activegraph/trace/printer.py +495 -0
- activegraph-1.0.0rc2.dist-info/METADATA +228 -0
- activegraph-1.0.0rc2.dist-info/RECORD +82 -0
- activegraph-1.0.0rc2.dist-info/WHEEL +5 -0
- activegraph-1.0.0rc2.dist-info/entry_points.txt +5 -0
- activegraph-1.0.0rc2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
"""Three companies' worth of recorded diligence fixtures.
|
|
2
|
+
|
|
3
|
+
CONTRACT v0.9 #18: fixtures ship with the pack. Three companies. Each
|
|
4
|
+
gets:
|
|
5
|
+
- a set of documents (returned by fetch_company_docs)
|
|
6
|
+
- per-URL summaries (returned by summarize_document)
|
|
7
|
+
- a question list (returned by question_generator)
|
|
8
|
+
- per-(company, question) research findings with claims
|
|
9
|
+
- a risk list
|
|
10
|
+
- a final memo body
|
|
11
|
+
|
|
12
|
+
The three companies are fictional. They are designed to exercise the
|
|
13
|
+
pack: company B has a contradiction (two researchers report opposing
|
|
14
|
+
revenue trajectories from different sources), company A is clean, and
|
|
15
|
+
company C has a high-severity risk.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
THREE_COMPANIES = [
|
|
22
|
+
{
|
|
23
|
+
"name": "Northwind Robotics",
|
|
24
|
+
"ticker": "NWR",
|
|
25
|
+
"sector": "Industrial Automation",
|
|
26
|
+
"description": "Builds collaborative robots for SMB manufacturers.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "Stellar Logistics",
|
|
30
|
+
"ticker": "STLG",
|
|
31
|
+
"sector": "Supply Chain",
|
|
32
|
+
"description": "Last-mile delivery network across the US Northeast.",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "Pinecone Bio",
|
|
36
|
+
"ticker": "PCB",
|
|
37
|
+
"sector": "Therapeutics",
|
|
38
|
+
"description": "Pre-clinical-stage biotech developing oncology assets.",
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def company_goal(company: dict) -> str:
|
|
44
|
+
return f"Diligence: {company['name']}"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# ---------------------------------------------------- documents per company
|
|
48
|
+
|
|
49
|
+
DOCS_BY_COMPANY = {
|
|
50
|
+
"northwind robotics": [
|
|
51
|
+
{
|
|
52
|
+
"title": "Q3 Operating Update",
|
|
53
|
+
"url": "https://fixtures.activegraph.local/northwind/q3-update",
|
|
54
|
+
"summary": "Q3 revenue up 28% YoY; gross margin steady at 41%.",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"title": "Customer Concentration Disclosure",
|
|
58
|
+
"url": "https://fixtures.activegraph.local/northwind/customer-concentration",
|
|
59
|
+
"summary": "Top three customers represent 52% of annual revenue.",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"title": "Product Roadmap Brief",
|
|
63
|
+
"url": "https://fixtures.activegraph.local/northwind/roadmap",
|
|
64
|
+
"summary": "New cobot SKU launching Q1; targets food-and-beverage segment.",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
"stellar logistics": [
|
|
68
|
+
{
|
|
69
|
+
"title": "Annual Report Excerpts",
|
|
70
|
+
"url": "https://fixtures.activegraph.local/stellar/annual",
|
|
71
|
+
"summary": "Network expanded to 14 metros; revenue +18% YoY.",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"title": "Carrier Survey",
|
|
75
|
+
"url": "https://fixtures.activegraph.local/stellar/carrier-survey",
|
|
76
|
+
"summary": "Independent driver survey suggests revenue per route declined in Q3 — divergent from filing.",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"title": "Investor Day Transcript",
|
|
80
|
+
"url": "https://fixtures.activegraph.local/stellar/investor-day",
|
|
81
|
+
"summary": "Management reiterates 20% YoY growth target through next year.",
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
"pinecone bio": [
|
|
85
|
+
{
|
|
86
|
+
"title": "Pre-clinical Program Update",
|
|
87
|
+
"url": "https://fixtures.activegraph.local/pinecone/preclinical",
|
|
88
|
+
"summary": "PCB-101 advances toward IND filing; PCB-202 deprioritized.",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"title": "FDA Pre-IND Correspondence",
|
|
92
|
+
"url": "https://fixtures.activegraph.local/pinecone/fda-meeting",
|
|
93
|
+
"summary": "FDA flagged manufacturing controls; resolution required before IND.",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"title": "Cash Runway Note",
|
|
97
|
+
"url": "https://fixtures.activegraph.local/pinecone/runway",
|
|
98
|
+
"summary": "Cash runway estimated through Q2 next year at current burn.",
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
FILINGS_BY_COMPANY = {
|
|
105
|
+
name: [{"title": d["title"], "url": d["url"], "summary": d["summary"]} for d in docs]
|
|
106
|
+
for name, docs in DOCS_BY_COMPANY.items()
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
# ---------------------------------------------------- URL → summary + facts
|
|
111
|
+
|
|
112
|
+
SUMMARIES_BY_URL = {
|
|
113
|
+
"https://fixtures.activegraph.local/northwind/q3-update": {
|
|
114
|
+
"summary": "Northwind Robotics reported Q3 revenue of $42M, up 28% YoY. Gross margin held at 41%. Operating loss narrowed to $3M.",
|
|
115
|
+
"facts": [
|
|
116
|
+
"Q3 revenue: $42M, +28% YoY",
|
|
117
|
+
"Gross margin: 41%",
|
|
118
|
+
"Operating loss: $3M",
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
"https://fixtures.activegraph.local/northwind/customer-concentration": {
|
|
122
|
+
"summary": "Top three customers represent 52% of annual revenue; the largest single customer is 26%.",
|
|
123
|
+
"facts": [
|
|
124
|
+
"Top 3 customers: 52% of revenue",
|
|
125
|
+
"Largest customer: 26%",
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
"https://fixtures.activegraph.local/northwind/roadmap": {
|
|
129
|
+
"summary": "New cobot SKU 'NW-7' launches Q1 next year, targeting food-and-beverage SMB operators.",
|
|
130
|
+
"facts": [
|
|
131
|
+
"NW-7 cobot launches Q1",
|
|
132
|
+
"Targets food-and-beverage SMB",
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
"https://fixtures.activegraph.local/stellar/annual": {
|
|
136
|
+
"summary": "Stellar Logistics reports 18% YoY revenue growth, expanded to 14 metros, with positive unit economics in 9 of 14.",
|
|
137
|
+
"facts": [
|
|
138
|
+
"Revenue +18% YoY",
|
|
139
|
+
"14 metros covered",
|
|
140
|
+
"Positive unit economics in 9 of 14",
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
"https://fixtures.activegraph.local/stellar/carrier-survey": {
|
|
144
|
+
"summary": "Independent survey of 200 drivers suggests revenue per route declined in Q3, contradicting filings.",
|
|
145
|
+
"facts": [
|
|
146
|
+
"Driver-reported revenue per route: -7% Q3",
|
|
147
|
+
"200 driver responses",
|
|
148
|
+
"Diverges from filed +18% growth claim",
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
"https://fixtures.activegraph.local/stellar/investor-day": {
|
|
152
|
+
"summary": "Management reiterates 20% YoY growth target through next year and announces 4 new metro launches.",
|
|
153
|
+
"facts": [
|
|
154
|
+
"Management 20% growth target",
|
|
155
|
+
"4 new metro launches planned",
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
"https://fixtures.activegraph.local/pinecone/preclinical": {
|
|
159
|
+
"summary": "PCB-101 advances toward IND filing in H2; PCB-202 program deprioritized to focus resources.",
|
|
160
|
+
"facts": [
|
|
161
|
+
"PCB-101 IND target H2",
|
|
162
|
+
"PCB-202 deprioritized",
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
"https://fixtures.activegraph.local/pinecone/fda-meeting": {
|
|
166
|
+
"summary": "FDA pre-IND correspondence flagged manufacturing controls as requiring resolution before IND.",
|
|
167
|
+
"facts": [
|
|
168
|
+
"FDA flagged manufacturing controls",
|
|
169
|
+
"Resolution required pre-IND",
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
"https://fixtures.activegraph.local/pinecone/runway": {
|
|
173
|
+
"summary": "Cash runway estimated through Q2 next year at current burn; raise likely required.",
|
|
174
|
+
"facts": [
|
|
175
|
+
"Runway: through Q2 next year",
|
|
176
|
+
"Raise likely required",
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
# ---------------------------------------------------- questions per company
|
|
183
|
+
|
|
184
|
+
QUESTIONS_BY_COMPANY = {
|
|
185
|
+
"northwind robotics": [
|
|
186
|
+
"What is the company's Q3 revenue trajectory?",
|
|
187
|
+
"How concentrated is the customer base?",
|
|
188
|
+
"What is the gross margin profile?",
|
|
189
|
+
"What new products are launching in the next twelve months?",
|
|
190
|
+
"What is the operating cash burn?",
|
|
191
|
+
"Who are the main competitors?",
|
|
192
|
+
"What is the addressable market for cobots in SMB manufacturing?",
|
|
193
|
+
"What regulatory exposures exist?",
|
|
194
|
+
],
|
|
195
|
+
"stellar logistics": [
|
|
196
|
+
"What is the revenue growth rate?",
|
|
197
|
+
"How many metros does the network cover?",
|
|
198
|
+
"What is the unit economics picture per metro?",
|
|
199
|
+
"Is there any divergence between filed numbers and independent data?",
|
|
200
|
+
"What is the carrier (driver) retention rate?",
|
|
201
|
+
"What is management's growth guidance?",
|
|
202
|
+
"Who are the main competitors?",
|
|
203
|
+
"What is the regulatory exposure?",
|
|
204
|
+
],
|
|
205
|
+
"pinecone bio": [
|
|
206
|
+
"What is the lead program's regulatory status?",
|
|
207
|
+
"What is the cash runway?",
|
|
208
|
+
"What did the FDA pre-IND meeting reveal?",
|
|
209
|
+
"What are the secondary programs?",
|
|
210
|
+
"What is the burn rate?",
|
|
211
|
+
"Who is on the leadership team?",
|
|
212
|
+
"What is the competitive landscape for the lead asset?",
|
|
213
|
+
"What is the manufacturing strategy?",
|
|
214
|
+
],
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
# ---------------------------------------------------- per-question findings
|
|
219
|
+
#
|
|
220
|
+
# Keyed by (company_name_lower, question_text). When a question doesn't
|
|
221
|
+
# appear here, the recorded provider returns a generic low-confidence
|
|
222
|
+
# placeholder.
|
|
223
|
+
|
|
224
|
+
RESEARCH_FINDINGS_BY_QUESTION = {
|
|
225
|
+
("northwind robotics", "What is the company's Q3 revenue trajectory?"): {
|
|
226
|
+
"document_url": "https://fixtures.activegraph.local/northwind/q3-update",
|
|
227
|
+
"summary": "Q3 revenue +28% YoY at $42M.",
|
|
228
|
+
"claims": [
|
|
229
|
+
{
|
|
230
|
+
"text": "Northwind Q3 revenue grew 28% YoY to $42M.",
|
|
231
|
+
"confidence": 0.92,
|
|
232
|
+
"source_document_url": "https://fixtures.activegraph.local/northwind/q3-update",
|
|
233
|
+
"evidence_quote": "Q3 revenue: $42M, +28% YoY",
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
("northwind robotics", "How concentrated is the customer base?"): {
|
|
238
|
+
"document_url": "https://fixtures.activegraph.local/northwind/customer-concentration",
|
|
239
|
+
"summary": "Top three customers = 52% of revenue; largest single = 26%.",
|
|
240
|
+
"claims": [
|
|
241
|
+
{
|
|
242
|
+
"text": "Northwind's top three customers represent 52% of annual revenue.",
|
|
243
|
+
"confidence": 0.95,
|
|
244
|
+
"source_document_url": "https://fixtures.activegraph.local/northwind/customer-concentration",
|
|
245
|
+
"evidence_quote": "Top 3 customers: 52% of revenue",
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"text": "Northwind's single largest customer represents 26% of revenue.",
|
|
249
|
+
"confidence": 0.95,
|
|
250
|
+
"source_document_url": "https://fixtures.activegraph.local/northwind/customer-concentration",
|
|
251
|
+
"evidence_quote": "Largest customer: 26%",
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
},
|
|
255
|
+
("northwind robotics", "What is the gross margin profile?"): {
|
|
256
|
+
"document_url": "https://fixtures.activegraph.local/northwind/q3-update",
|
|
257
|
+
"summary": "Gross margin held at 41% in Q3.",
|
|
258
|
+
"claims": [
|
|
259
|
+
{
|
|
260
|
+
"text": "Northwind's Q3 gross margin was 41%, flat sequentially.",
|
|
261
|
+
"confidence": 0.9,
|
|
262
|
+
"source_document_url": "https://fixtures.activegraph.local/northwind/q3-update",
|
|
263
|
+
"evidence_quote": "Gross margin: 41%",
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
("northwind robotics", "What new products are launching in the next twelve months?"): {
|
|
268
|
+
"document_url": "https://fixtures.activegraph.local/northwind/roadmap",
|
|
269
|
+
"summary": "New cobot SKU NW-7 launches Q1, targets F&B SMB.",
|
|
270
|
+
"claims": [
|
|
271
|
+
{
|
|
272
|
+
"text": "Northwind plans to launch the NW-7 cobot in Q1, targeting food-and-beverage SMB.",
|
|
273
|
+
"confidence": 0.85,
|
|
274
|
+
"source_document_url": "https://fixtures.activegraph.local/northwind/roadmap",
|
|
275
|
+
"evidence_quote": "NW-7 cobot launches Q1",
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
},
|
|
279
|
+
("stellar logistics", "What is the revenue growth rate?"): {
|
|
280
|
+
"document_url": "https://fixtures.activegraph.local/stellar/annual",
|
|
281
|
+
"summary": "Stellar reports 18% YoY revenue growth in annual filings.",
|
|
282
|
+
"claims": [
|
|
283
|
+
{
|
|
284
|
+
"text": "Stellar Logistics revenue grew 18% YoY per the annual filing.",
|
|
285
|
+
"confidence": 0.9,
|
|
286
|
+
"source_document_url": "https://fixtures.activegraph.local/stellar/annual",
|
|
287
|
+
"evidence_quote": "Revenue +18% YoY",
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
},
|
|
291
|
+
("stellar logistics", "Is there any divergence between filed numbers and independent data?"): {
|
|
292
|
+
"document_url": "https://fixtures.activegraph.local/stellar/carrier-survey",
|
|
293
|
+
"summary": "Carrier survey suggests revenue per route declined Q3, diverging from filings.",
|
|
294
|
+
"claims": [
|
|
295
|
+
{
|
|
296
|
+
"text": "Independent carrier survey suggests Stellar revenue per route declined 7% in Q3.",
|
|
297
|
+
"confidence": 0.78,
|
|
298
|
+
"source_document_url": "https://fixtures.activegraph.local/stellar/carrier-survey",
|
|
299
|
+
"evidence_quote": "Driver-reported revenue per route: -7% Q3",
|
|
300
|
+
# This contradicts the +18% claim above.
|
|
301
|
+
"contradicts_claim_text": "Stellar Logistics revenue grew 18% YoY per the annual filing.",
|
|
302
|
+
},
|
|
303
|
+
],
|
|
304
|
+
},
|
|
305
|
+
("stellar logistics", "How many metros does the network cover?"): {
|
|
306
|
+
"document_url": "https://fixtures.activegraph.local/stellar/annual",
|
|
307
|
+
"summary": "Network covers 14 metros as of latest annual.",
|
|
308
|
+
"claims": [
|
|
309
|
+
{
|
|
310
|
+
"text": "Stellar's network covers 14 metros, with positive unit economics in 9 of them.",
|
|
311
|
+
"confidence": 0.88,
|
|
312
|
+
"source_document_url": "https://fixtures.activegraph.local/stellar/annual",
|
|
313
|
+
"evidence_quote": "14 metros covered",
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
},
|
|
317
|
+
("stellar logistics", "What is management's growth guidance?"): {
|
|
318
|
+
"document_url": "https://fixtures.activegraph.local/stellar/investor-day",
|
|
319
|
+
"summary": "Investor Day: 20% growth target through next year.",
|
|
320
|
+
"claims": [
|
|
321
|
+
{
|
|
322
|
+
"text": "Management guides for 20% YoY revenue growth through next year.",
|
|
323
|
+
"confidence": 0.8,
|
|
324
|
+
"source_document_url": "https://fixtures.activegraph.local/stellar/investor-day",
|
|
325
|
+
"evidence_quote": "Management 20% growth target",
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
},
|
|
329
|
+
("pinecone bio", "What is the lead program's regulatory status?"): {
|
|
330
|
+
"document_url": "https://fixtures.activegraph.local/pinecone/preclinical",
|
|
331
|
+
"summary": "PCB-101 targets IND filing in H2.",
|
|
332
|
+
"claims": [
|
|
333
|
+
{
|
|
334
|
+
"text": "PCB-101 is targeted for IND filing in H2 of next year.",
|
|
335
|
+
"confidence": 0.82,
|
|
336
|
+
"source_document_url": "https://fixtures.activegraph.local/pinecone/preclinical",
|
|
337
|
+
"evidence_quote": "PCB-101 IND target H2",
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
},
|
|
341
|
+
("pinecone bio", "What did the FDA pre-IND meeting reveal?"): {
|
|
342
|
+
"document_url": "https://fixtures.activegraph.local/pinecone/fda-meeting",
|
|
343
|
+
"summary": "FDA flagged manufacturing controls requiring resolution pre-IND.",
|
|
344
|
+
"claims": [
|
|
345
|
+
{
|
|
346
|
+
"text": "FDA pre-IND correspondence flagged Pinecone's manufacturing controls as requiring resolution before IND filing.",
|
|
347
|
+
"confidence": 0.9,
|
|
348
|
+
"source_document_url": "https://fixtures.activegraph.local/pinecone/fda-meeting",
|
|
349
|
+
"evidence_quote": "FDA flagged manufacturing controls",
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
},
|
|
353
|
+
("pinecone bio", "What is the cash runway?"): {
|
|
354
|
+
"document_url": "https://fixtures.activegraph.local/pinecone/runway",
|
|
355
|
+
"summary": "Runway through Q2 at current burn; raise likely needed.",
|
|
356
|
+
"claims": [
|
|
357
|
+
{
|
|
358
|
+
"text": "Pinecone Bio's cash runway extends through Q2 of next year at current burn; a financing round is likely required to reach IND filing.",
|
|
359
|
+
"confidence": 0.85,
|
|
360
|
+
"source_document_url": "https://fixtures.activegraph.local/pinecone/runway",
|
|
361
|
+
"evidence_quote": "Runway: through Q2 next year",
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
},
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
# ---------------------------------------------------- risks per company
|
|
369
|
+
|
|
370
|
+
RISKS_BY_COMPANY = {
|
|
371
|
+
"northwind robotics": [
|
|
372
|
+
{
|
|
373
|
+
"title": "customer concentration",
|
|
374
|
+
"description": (
|
|
375
|
+
"Top three customers represent over half of annual revenue; loss of "
|
|
376
|
+
"the largest customer (26%) would materially impair financials."
|
|
377
|
+
),
|
|
378
|
+
"severity": "high",
|
|
379
|
+
"related_claim_texts": [
|
|
380
|
+
"Northwind's top three customers represent 52% of annual revenue.",
|
|
381
|
+
"Northwind's single largest customer represents 26% of revenue.",
|
|
382
|
+
],
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
"stellar logistics": [
|
|
386
|
+
{
|
|
387
|
+
"title": "filing vs. independent-data divergence",
|
|
388
|
+
"description": (
|
|
389
|
+
"Filed +18% revenue growth conflicts with a carrier survey suggesting "
|
|
390
|
+
"revenue per route declined 7% in Q3. The reconciliation is unresolved "
|
|
391
|
+
"and is itself a material diligence risk."
|
|
392
|
+
),
|
|
393
|
+
"severity": "high",
|
|
394
|
+
"related_claim_texts": [
|
|
395
|
+
"Stellar Logistics revenue grew 18% YoY per the annual filing.",
|
|
396
|
+
"Independent carrier survey suggests Stellar revenue per route declined 7% in Q3.",
|
|
397
|
+
],
|
|
398
|
+
},
|
|
399
|
+
],
|
|
400
|
+
"pinecone bio": [
|
|
401
|
+
{
|
|
402
|
+
"title": "FDA manufacturing controls gating IND",
|
|
403
|
+
"description": (
|
|
404
|
+
"FDA has flagged manufacturing controls as requiring resolution before "
|
|
405
|
+
"the lead program (PCB-101) can file IND. Combined with the limited cash "
|
|
406
|
+
"runway, this materially raises execution risk."
|
|
407
|
+
),
|
|
408
|
+
"severity": "high",
|
|
409
|
+
"related_claim_texts": [
|
|
410
|
+
"FDA pre-IND correspondence flagged Pinecone's manufacturing controls as requiring resolution before IND filing.",
|
|
411
|
+
"Pinecone Bio's cash runway extends through Q2 of next year at current burn; a financing round is likely required to reach IND filing.",
|
|
412
|
+
],
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
# ---------------------------------------------------- memo bodies
|
|
419
|
+
#
|
|
420
|
+
# These are the final canned memos returned by the recorded provider
|
|
421
|
+
# when memo_synthesizer fires. The handler resolves text references
|
|
422
|
+
# back to live object ids via the graph; the structure here matches
|
|
423
|
+
# what the test asserts. The handler also fills evidence_ids /
|
|
424
|
+
# claim_ids from the live graph after-the-fact (NOT in v0.9 — for
|
|
425
|
+
# simplicity we just have the LLM "produce" plausible structure that
|
|
426
|
+
# the post-write integration test verifies against the live graph
|
|
427
|
+
# via separate predicates).
|
|
428
|
+
|
|
429
|
+
MEMO_BODIES_BY_COMPANY = {
|
|
430
|
+
"northwind robotics": {
|
|
431
|
+
"summary": (
|
|
432
|
+
"Northwind Robotics shows healthy +28% YoY top-line growth with stable "
|
|
433
|
+
"41% gross margin. The picture is bottlenecked by single-customer "
|
|
434
|
+
"concentration (26% from the largest account, 52% from the top three). "
|
|
435
|
+
"Product roadmap (NW-7 cobot in food-and-beverage) is incremental and "
|
|
436
|
+
"credible. Recommendation: pass unless concentration risk can be diligenced "
|
|
437
|
+
"to the satisfaction of the IC."
|
|
438
|
+
),
|
|
439
|
+
"thesis_questions_addressed": [
|
|
440
|
+
{"question": "Q3 revenue trajectory", "status": "answered", "claim_ids": ["@claim:Q3 revenue"]},
|
|
441
|
+
{"question": "Customer concentration", "status": "answered", "claim_ids": ["@claim:top three", "@claim:largest customer"]},
|
|
442
|
+
{"question": "Gross margin", "status": "answered", "claim_ids": ["@claim:Q3 gross margin"]},
|
|
443
|
+
{"question": "Roadmap", "status": "answered", "claim_ids": ["@claim:NW-7 launch"]},
|
|
444
|
+
],
|
|
445
|
+
"key_claims": [
|
|
446
|
+
{"claim_id": "@claim:Q3 revenue", "text": "Northwind Q3 revenue grew 28% YoY to $42M.", "evidence_ids": ["@evidence:Q3 revenue quote"]},
|
|
447
|
+
{"claim_id": "@claim:top three", "text": "Top three customers represent 52% of revenue.", "evidence_ids": ["@evidence:top three quote"]},
|
|
448
|
+
{"claim_id": "@claim:largest customer", "text": "Single largest customer represents 26% of revenue.", "evidence_ids": ["@evidence:largest customer quote"]},
|
|
449
|
+
{"claim_id": "@claim:Q3 gross margin", "text": "Q3 gross margin was 41%.", "evidence_ids": ["@evidence:gross margin quote"]},
|
|
450
|
+
],
|
|
451
|
+
"open_contradictions": [],
|
|
452
|
+
"contradictions_note": "no contradictions found",
|
|
453
|
+
"risks": [
|
|
454
|
+
{"risk_id": "@risk:concentration", "title": "customer concentration", "severity": "high",
|
|
455
|
+
"description": "Loss of the largest customer (26%) would materially impair financials."},
|
|
456
|
+
],
|
|
457
|
+
},
|
|
458
|
+
"stellar logistics": {
|
|
459
|
+
"summary": (
|
|
460
|
+
"Stellar Logistics filings report +18% YoY revenue growth and 14-metro "
|
|
461
|
+
"coverage; an independent carrier survey suggests revenue per route declined "
|
|
462
|
+
"7% in Q3 — a material contradiction that requires reconciliation before "
|
|
463
|
+
"any investment decision."
|
|
464
|
+
),
|
|
465
|
+
"thesis_questions_addressed": [
|
|
466
|
+
{"question": "Revenue growth rate", "status": "answered", "claim_ids": ["@claim:filing growth", "@claim:survey decline"]},
|
|
467
|
+
{"question": "Metro coverage", "status": "answered", "claim_ids": ["@claim:14 metros"]},
|
|
468
|
+
{"question": "Filing vs. independent data divergence", "status": "answered", "claim_ids": ["@claim:filing growth", "@claim:survey decline"]},
|
|
469
|
+
{"question": "Management guidance", "status": "answered", "claim_ids": ["@claim:management guidance"]},
|
|
470
|
+
],
|
|
471
|
+
"key_claims": [
|
|
472
|
+
{"claim_id": "@claim:filing growth", "text": "Stellar Logistics revenue grew 18% YoY per the annual filing.", "evidence_ids": ["@evidence:filing quote"]},
|
|
473
|
+
{"claim_id": "@claim:survey decline", "text": "Independent carrier survey suggests Stellar revenue per route declined 7% in Q3.", "evidence_ids": ["@evidence:survey quote"]},
|
|
474
|
+
{"claim_id": "@claim:14 metros", "text": "Stellar's network covers 14 metros, with positive unit economics in 9 of them.", "evidence_ids": ["@evidence:metros quote"]},
|
|
475
|
+
{"claim_id": "@claim:management guidance", "text": "Management guides for 20% YoY revenue growth through next year.", "evidence_ids": ["@evidence:guidance quote"]},
|
|
476
|
+
],
|
|
477
|
+
"open_contradictions": [
|
|
478
|
+
{"contradiction_id": "@contradiction:growth", "claim_a_text": "Stellar Logistics revenue grew 18% YoY per the annual filing.", "claim_b_text": "Independent carrier survey suggests Stellar revenue per route declined 7% in Q3."},
|
|
479
|
+
],
|
|
480
|
+
"contradictions_note": "",
|
|
481
|
+
"risks": [
|
|
482
|
+
{"risk_id": "@risk:divergence", "title": "filing vs. independent-data divergence", "severity": "high",
|
|
483
|
+
"description": "Filed growth conflicts with carrier-survey data. Unresolved and itself a material risk."},
|
|
484
|
+
],
|
|
485
|
+
},
|
|
486
|
+
"pinecone bio": {
|
|
487
|
+
"summary": (
|
|
488
|
+
"Pinecone Bio's lead asset PCB-101 is on a credible IND trajectory but "
|
|
489
|
+
"blocked by FDA-flagged manufacturing controls. Cash runway through Q2 "
|
|
490
|
+
"next year is materially tight; a financing round is likely required "
|
|
491
|
+
"before the IND filing. Recommendation: monitor; revisit after CMC "
|
|
492
|
+
"resolution and pre-IND financing event."
|
|
493
|
+
),
|
|
494
|
+
"thesis_questions_addressed": [
|
|
495
|
+
{"question": "Lead program regulatory status", "status": "answered", "claim_ids": ["@claim:PCB-101 IND"]},
|
|
496
|
+
{"question": "FDA pre-IND meeting", "status": "answered", "claim_ids": ["@claim:FDA CMC flag"]},
|
|
497
|
+
{"question": "Cash runway", "status": "answered", "claim_ids": ["@claim:runway"]},
|
|
498
|
+
],
|
|
499
|
+
"key_claims": [
|
|
500
|
+
{"claim_id": "@claim:PCB-101 IND", "text": "PCB-101 is targeted for IND filing in H2 of next year.", "evidence_ids": ["@evidence:PCB-101 quote"]},
|
|
501
|
+
{"claim_id": "@claim:FDA CMC flag", "text": "FDA pre-IND correspondence flagged Pinecone's manufacturing controls as requiring resolution before IND filing.", "evidence_ids": ["@evidence:FDA quote"]},
|
|
502
|
+
{"claim_id": "@claim:runway", "text": "Pinecone Bio's cash runway extends through Q2 of next year at current burn; a financing round is likely required to reach IND filing.", "evidence_ids": ["@evidence:runway quote"]},
|
|
503
|
+
],
|
|
504
|
+
"open_contradictions": [],
|
|
505
|
+
"contradictions_note": "no contradictions found",
|
|
506
|
+
"risks": [
|
|
507
|
+
{"risk_id": "@risk:CMC", "title": "FDA manufacturing controls gating IND", "severity": "high",
|
|
508
|
+
"description": "FDA-flagged CMC issues combine with tight cash runway. Material execution risk."},
|
|
509
|
+
],
|
|
510
|
+
},
|
|
511
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"""Diligence pack object and relation types. CONTRACT v0.9 #15.
|
|
2
|
+
|
|
3
|
+
Eight object types, six relation types. The schemas are intentionally
|
|
4
|
+
small and concrete — packs that try to be everything tend to be
|
|
5
|
+
nothing. Future fields land here when there's a real consumer.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from typing import Optional
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel, Field
|
|
13
|
+
|
|
14
|
+
from activegraph.packs import ObjectType, RelationType
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# ---------------------------------------------------- Pydantic schemas
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Company(BaseModel):
|
|
21
|
+
"""The target of a diligence run."""
|
|
22
|
+
|
|
23
|
+
name: str
|
|
24
|
+
ticker: Optional[str] = None
|
|
25
|
+
sector: Optional[str] = None
|
|
26
|
+
description: str = ""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Document(BaseModel):
|
|
30
|
+
"""A source document the researcher pulled in."""
|
|
31
|
+
|
|
32
|
+
title: str
|
|
33
|
+
url: str
|
|
34
|
+
company_id: str
|
|
35
|
+
summary: str = ""
|
|
36
|
+
published_at: Optional[str] = None # ISO date string
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Question(BaseModel):
|
|
40
|
+
"""A research question generated from the thesis."""
|
|
41
|
+
|
|
42
|
+
text: str
|
|
43
|
+
company_id: str
|
|
44
|
+
company_name: str = ""
|
|
45
|
+
status: str = Field(default="open", pattern=r"^(open|answered|skipped)$")
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class Claim(BaseModel):
|
|
49
|
+
"""A factual statement about the company, derived from a document."""
|
|
50
|
+
|
|
51
|
+
text: str
|
|
52
|
+
confidence: float = Field(ge=0.0, le=1.0)
|
|
53
|
+
company_id: str
|
|
54
|
+
source_document_id: Optional[str] = None
|
|
55
|
+
status: str = Field(default="open", pattern=r"^(open|reviewed|retracted)$")
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class Evidence(BaseModel):
|
|
59
|
+
"""A verbatim quote (or excerpt) supporting a claim."""
|
|
60
|
+
|
|
61
|
+
text: str
|
|
62
|
+
document_id: str
|
|
63
|
+
claim_id: str
|
|
64
|
+
location: str = "" # page number, section, anchor — free-text
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class Contradiction(BaseModel):
|
|
68
|
+
"""A detected conflict between two claims.
|
|
69
|
+
|
|
70
|
+
Created by the contradiction_detector pattern subscription. The
|
|
71
|
+
pack does not auto-resolve in v0.9 (CONTRACT v0.9 #17); the memo
|
|
72
|
+
synthesizer surfaces these as open questions.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
claim_a_id: str
|
|
76
|
+
claim_b_id: str
|
|
77
|
+
rationale: str = ""
|
|
78
|
+
status: str = Field(default="open", pattern=r"^(open|resolved)$")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class Risk(BaseModel):
|
|
82
|
+
"""A material risk identified during diligence."""
|
|
83
|
+
|
|
84
|
+
title: str
|
|
85
|
+
description: str
|
|
86
|
+
severity: str = Field(default="medium", pattern=r"^(low|medium|high)$")
|
|
87
|
+
company_id: str
|
|
88
|
+
related_claim_ids: list[str] = []
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class Memo(BaseModel):
|
|
92
|
+
"""The final diligence memo for a company.
|
|
93
|
+
|
|
94
|
+
Structure is contracted (CONTRACT v0.9 #19): every memo has the
|
|
95
|
+
same five sections and the test asserts the shape. Content quality
|
|
96
|
+
is bounded by the fixtures / model; the structure is testable.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
company_id: str
|
|
100
|
+
summary: str
|
|
101
|
+
thesis_questions_addressed: list[dict] # [{question, status, claim_ids}]
|
|
102
|
+
key_claims: list[dict] # [{claim_id, text, evidence_ids}]
|
|
103
|
+
open_contradictions: list[dict]
|
|
104
|
+
contradictions_note: str = "" # "no contradictions found" when empty
|
|
105
|
+
risks: list[dict]
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# ---------------------------------------------------- ObjectType list
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
OBJECT_TYPES = [
|
|
112
|
+
ObjectType(name="company", schema=Company, description="A target company."),
|
|
113
|
+
ObjectType(name="document", schema=Document, description="A source document."),
|
|
114
|
+
ObjectType(name="question", schema=Question, description="A research question."),
|
|
115
|
+
ObjectType(name="claim", schema=Claim, description="A claim about the company."),
|
|
116
|
+
ObjectType(name="evidence", schema=Evidence, description="A quote supporting a claim."),
|
|
117
|
+
ObjectType(name="contradiction", schema=Contradiction, description="A detected conflict."),
|
|
118
|
+
ObjectType(name="risk", schema=Risk, description="An identified material risk."),
|
|
119
|
+
ObjectType(name="memo", schema=Memo, description="The final diligence memo."),
|
|
120
|
+
]
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
# ---------------------------------------------------- RelationType list
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
RELATION_TYPES = [
|
|
127
|
+
RelationType(
|
|
128
|
+
name="addresses",
|
|
129
|
+
source_types=("claim",),
|
|
130
|
+
target_types=("question",),
|
|
131
|
+
description="A claim addresses a research question.",
|
|
132
|
+
),
|
|
133
|
+
RelationType(
|
|
134
|
+
name="supports",
|
|
135
|
+
source_types=("evidence",),
|
|
136
|
+
target_types=("claim",),
|
|
137
|
+
description="Evidence supports a claim.",
|
|
138
|
+
),
|
|
139
|
+
RelationType(
|
|
140
|
+
name="contradicts",
|
|
141
|
+
source_types=("claim",),
|
|
142
|
+
target_types=("claim",),
|
|
143
|
+
description="Two claims are in conflict.",
|
|
144
|
+
),
|
|
145
|
+
RelationType(
|
|
146
|
+
name="references",
|
|
147
|
+
source_types=("claim", "memo"),
|
|
148
|
+
target_types=("document",),
|
|
149
|
+
description="A claim or memo references a source document.",
|
|
150
|
+
),
|
|
151
|
+
RelationType(
|
|
152
|
+
name="derived_from",
|
|
153
|
+
source_types=("claim", "evidence"),
|
|
154
|
+
target_types=("document",),
|
|
155
|
+
description="A claim or evidence was derived from a source document.",
|
|
156
|
+
),
|
|
157
|
+
RelationType(
|
|
158
|
+
name="mitigates",
|
|
159
|
+
source_types=("evidence", "claim"),
|
|
160
|
+
target_types=("risk",),
|
|
161
|
+
description="Evidence or a claim mitigates a risk.",
|
|
162
|
+
),
|
|
163
|
+
]
|