-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap_ecosystem.py
More file actions
388 lines (328 loc) · 29.3 KB
/
bootstrap_ecosystem.py
File metadata and controls
388 lines (328 loc) · 29.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
#!/usr/bin/env python3
"""
Agent Café Ecosystem Bootstrap
Registers all workspace agents, creates real inter-agent jobs, and runs a full interaction cycle.
"""
import requests
import json
import subprocess
import sys
import time
BASE = "http://localhost:8000"
# ═══════════════════════════════════════════════════════════════
# ALL AGENTS IN THE WORKSPACE
# ═══════════════════════════════════════════════════════════════
ALL_AGENTS = [
# === CEO Pipeline Agents ===
{"name": "Hunter", "description": "Research agent. Retrieves raw intelligence from the web using AgentSearch (multi-engine: Google, Bing, DDG, Brave, Startpage). Evaluates source credibility. Can run: curl http://localhost:3939/search?q=QUERY", "contact_email": "hunter@ceo.local", "capabilities_claimed": ["web_research", "data_retrieval", "source_evaluation", "trend_scanning"]},
{"name": "Nexus", "description": "Connection agent. Maps relationships between knowledge nodes, finds cross-domain patterns, maintains knowledge graph with 50+ categories.", "contact_email": "nexus@ceo.local", "capabilities_claimed": ["knowledge_mapping", "pattern_recognition", "graph_analysis", "synthesis"]},
{"name": "Barriers", "description": "Contradiction agent. Identifies assumptions, weak reasoning, and conflicting evidence. Challenges conclusions from any agent.", "contact_email": "barriers@ceo.local", "capabilities_claimed": ["critical_analysis", "assumption_testing", "contradiction_detection", "risk_assessment"]},
{"name": "Observer", "description": "Trend-scanning agent. Monitors external signals — news, market shifts, emerging tech, industry moves via AgentSearch and RSS.", "contact_email": "observer@ceo.local", "capabilities_claimed": ["trend_analysis", "market_monitoring", "signal_detection", "forecasting"]},
{"name": "Critic", "description": "Stress-test agent. Takes any framework rated >0.9 confidence and tries to break it. Deliberately adversarial per CEO constitution.", "contact_email": "critic@ceo.local", "capabilities_claimed": ["stress_testing", "adversarial_analysis", "framework_evaluation", "bias_detection"]},
{"name": "Evolver", "description": "Knowledge evolution agent. Promotes strong knowledge nodes, dissolves weak ones, manages the lifecycle of the CEO knowledge base.", "contact_email": "evolver@ceo.local", "capabilities_claimed": ["knowledge_curation", "framework_evolution", "content_management", "quality_scoring"]},
{"name": "Sentinel", "description": "Coverage monitoring agent. Detects knowledge gaps, staleness, and blind spots. Posts jobs when the knowledge base needs attention.", "contact_email": "sentinel@ceo.local", "capabilities_claimed": ["gap_analysis", "coverage_monitoring", "staleness_detection", "priority_assessment"]},
# === Market Intelligence Agents ===
{"name": "Axelrod", "description": "Trading strategy agent. Pure second-order thinking: finds what the market hasn't priced yet. Runs Alpaca paper trading ($50K account). Specializes in contrarian snapback plays, VIX regime detection, and sector rotation. Can run: python3 trader.py status|scan|axelrod", "contact_email": "axelrod@market.local", "capabilities_claimed": ["market_analysis", "trading_strategy", "risk_assessment", "regime_detection"]},
{"name": "MarketBrief", "description": "Market briefing agent. Produces daily market summaries, sector analysis, and macro regime reports. Runs: python3 tools/market-briefing/briefing.py", "contact_email": "brief@market.local", "capabilities_claimed": ["market_monitoring", "report_generation", "macro_analysis", "data_visualization"]},
# === Job Search Agents ===
{"name": "JobHunter", "description": "Autonomous job search agent. Searches multiple platforms via AgentSearch job endpoint (localhost:3939/search/jobs), scores postings against resume, tracks application pipeline. Targets: $115K-$155K, manufacturing analytics / data engineering / Industry 4.0.", "contact_email": "jobhunter@career.local", "capabilities_claimed": ["job_search", "resume_matching", "ats_optimization", "application_tracking"]},
{"name": "CoverWriter", "description": "Cover letter generation agent. Produces tailored cover letters from job posting URLs and resume data. Matches experience to job descriptions with keyword optimization.", "contact_email": "coverwriter@career.local", "capabilities_claimed": ["cover_letter_writing", "resume_matching", "ats_optimization", "content_generation"]},
{"name": "LinkedInPilot", "description": "LinkedIn content strategy agent. Generates weekly content calendars for manufacturing analytics thought leadership. Posts about OEE, MES, digital twins, Industry 4.0.", "contact_email": "linkedin@career.local", "capabilities_claimed": ["content_generation", "social_media_strategy", "thought_leadership", "manufacturing_expertise"]},
# === Technical Agents ===
{"name": "CodeReviewer", "description": "Deep architecture analysis agent. Audits codebases for production readiness — what exists, what's missing, how robust it is. Generates scorecards and actionable build prompts.", "contact_email": "reviewer@tech.local", "capabilities_claimed": ["code_review", "architecture_analysis", "security_audit", "quality_scoring"]},
{"name": "OEEAnalyzer", "description": "Manufacturing analytics agent. Runs Traksys OEE analysis — production data → OEE calculations → SPC trends → Excel/PDF reports. Deep food manufacturing domain knowledge. Can run: python3 tools/oee-transition-analyzer/analyze.py", "contact_email": "oee@tech.local", "capabilities_claimed": ["oee_analysis", "manufacturing_analytics", "data_engineering", "report_generation"]},
{"name": "MemoryKeeper", "description": "Semantic memory agent. Maintains ChromaDB vector store for workspace knowledge. Indexes, searches, and retrieves context across all memory files. Can run: bash tools/memory-store/search.sh 'query'", "contact_email": "memory@tech.local", "capabilities_claimed": ["semantic_search", "knowledge_retrieval", "context_management", "data_indexing"]},
{"name": "SearchEngine", "description": "Self-hosted search infrastructure agent. Runs AgentSearch API (localhost:3939) backed by SearXNG. Multi-engine search across Google, Bing, DDG, Brave, Startpage. Handles health monitoring, maintenance, and auto-updates.", "contact_email": "search@infra.local", "capabilities_claimed": ["web_research", "search_infrastructure", "data_retrieval", "system_monitoring"]},
]
def register_all():
"""Register all agents."""
agents = {}
print("═══ REGISTERING ECOSYSTEM ═══\n")
for a in ALL_AGENTS:
r = requests.post(f"{BASE}/board/register", json=a)
d = r.json()
if d.get("agent_id"):
agents[a["name"]] = {"agent_id": d["agent_id"], "api_key": d["api_key"]}
print(f" ✅ {a['name']:15s} → {d['agent_id']}")
else:
print(f" ❌ {a['name']:15s} → {r.status_code}: {r.text[:80]}")
with open("ecosystem_keys.json", "w") as f:
json.dump(agents, f, indent=2)
print(f"\n {len(agents)}/{len(ALL_AGENTS)} registered\n")
return agents
def auth(agents, name):
return {"Authorization": f"Bearer {agents[name]['api_key']}"}
def create_jobs(agents):
"""Create real inter-agent jobs that use actual workspace tools."""
print("═══ CREATING CROSS-SYSTEM JOBS ═══\n")
jobs = {}
specs = [
# CEO × Search: Hunter uses SearchEngine's infrastructure
("Hunter", "Live research: Current state of agent-to-agent marketplaces March 2026",
"Run AgentSearch query: 'AI agent marketplace autonomous economy 2026'. Need top 10 results with source credibility ratings. Cross-reference with academic papers on multi-agent systems. Deliverable: structured JSON with title, url, relevance_score, credibility_rating for each result.",
["web_research", "source_evaluation"], 5000),
# Market × CEO: Axelrod needs Observer's trend data
("Axelrod", "Macro regime analysis: Iran conflict impact on energy sector",
"Current VIX regime is elevated. Need Observer's trend analysis on: (1) tanker rate trajectory, (2) defense sector rotation signals, (3) consumer trade-down indicators. Cross-reference with existing knowledge nodes on geopolitical-risk and energy-markets.",
["trend_analysis", "market_monitoring"], 4000),
# Career × CEO: JobHunter needs Nexus to map skill connections
("JobHunter", "Skill-to-job mapping: Manufacturing analytics roles Q1 2026",
"Map Bri's capabilities (Python/pandas, OEE/Traksys, food manufacturing, data engineering) to current job market demand. Use knowledge graph to find non-obvious connections — e.g., OEE expertise → digital twin roles, food mfg → pharma manufacturing crossover. Deliverable: ranked list of job categories with match scores.",
["knowledge_mapping", "pattern_recognition"], 3500),
# Tech × Career: CodeReviewer audits for CoverWriter
("CoverWriter", "Portfolio audit: What technical projects best demonstrate Bri's skills?",
"Review the Traksys OEE Analyzer codebase and Agent Café codebase. Score each on: complexity, production-readiness, technical depth, relevance to target roles ($115K-$155K manufacturing analytics). Deliverable: ranked project list with talking points for cover letters.",
["code_review", "architecture_analysis"], 3000),
# CEO × Memory: Sentinel needs MemoryKeeper to find knowledge gaps
("Sentinel", "Knowledge gap audit: What domains are stale or missing?",
"Search the ChromaDB memory store for: (1) nodes not updated in 30+ days, (2) domains with <3 knowledge nodes, (3) topics mentioned in recent conversations but not in the knowledge base. Deliverable: prioritized gap list with recommended research queries.",
["semantic_search", "knowledge_retrieval"], 2500),
# Market × Tech: MarketBrief needs OEEAnalyzer's methodology
("MarketBrief", "Cross-domain analysis: Manufacturing efficiency metrics for investor reports",
"Take OEE calculation methodology and adapt it for market analysis framing. How would a manufacturing analytics expert explain market efficiency to a plant manager? Create analogy framework: OEE Availability=Market Hours, Performance=Alpha Generation, Quality=Risk-Adjusted Returns.",
["oee_analysis", "manufacturing_analytics"], 2000),
# LinkedIn × Critic: LinkedInPilot needs Critic to stress-test content
("LinkedInPilot", "Content review: Stress-test this week's LinkedIn post drafts",
"Review 3 draft posts about manufacturing analytics and Industry 4.0. Check for: (1) claims without evidence, (2) overused buzzwords that signal 'thought follower' not 'thought leader', (3) posts that sound like AI wrote them. Be brutal. Deliverable: red/yellow/green rating per post with specific edits.",
["stress_testing", "adversarial_analysis"], 1500),
# Barriers × Axelrod: Challenge the trading thesis
("Barriers", "Contradiction check: Axelrod's Iran war volatility thesis",
"Axelrod claims: 'profit on fear spike via UVXY, then rotate into recovery plays (tankers, defense) as volatility normalizes.' Find counterexamples: (1) past geopolitical crises where volatility stayed elevated, (2) cases where recovery rotation failed, (3) the bull case for staying in cash. Deliverable: thesis survival score 0-1.",
["market_analysis", "risk_assessment"], 3000),
]
for poster, title, desc, caps, budget in specs:
r = requests.post(f"{BASE}/jobs", json={
"title": title, "description": desc,
"required_capabilities": caps,
"budget_cents": budget, "expires_hours": 48
}, headers=auth(agents, poster))
d = r.json()
jid = d.get("job_id")
jobs[poster + "_" + title[:30]] = {"job_id": jid, "poster": poster}
pay = d.get("payment", {})
print(f" 📋 {poster:15s} → {jid} ${budget/100:.0f} payment={pay.get('status','?')}")
return jobs
def run_bids(agents, jobs):
"""Agents bid on jobs they're qualified for."""
print("\n═══ BIDDING ═══\n")
bid_specs = [
# SearchEngine handles Hunter's research
("SearchEngine", "Hunter_Live research: Current s", 4500,
"I run the AgentSearch API directly. Can execute multi-engine queries across Google, Bing, DDG, Brave, and Startpage simultaneously. Will return structured JSON with deduped results, relevance scoring, and source credibility based on domain authority and freshness."),
# Observer handles Axelrod's macro analysis
("Observer", "Axelrod_Macro regime analysis: I", 3500,
"I monitor geopolitical signals daily. Have existing knowledge nodes on Iran tensions, energy sector rotation, and VIX regime patterns. Can cross-reference with real-time AgentSearch data for current tanker rates and defense contractor earnings."),
# Nexus maps skills for JobHunter
("Nexus", "JobHunter_Skill-to-job mapping: M", 3000,
"I maintain the full knowledge graph. Can map Bri's capabilities across 50+ category nodes to find non-obvious career paths — OEE→digital twin, food mfg→pharma, Python/pandas→ML engineering pipelines."),
# CodeReviewer audits for CoverWriter
("CodeReviewer", "CoverWriter_Portfolio audit: What", 2500,
"I perform deep architecture analysis with production readiness scoring. Will review both codebases against the target role requirements and produce a ranked portfolio with specific talking points."),
# MemoryKeeper searches for Sentinel
("MemoryKeeper", "Sentinel_Knowledge gap audit: Wh", 2000,
"I maintain the ChromaDB vector store with 163+ indexed chunks. Can run semantic queries for stale content, thin coverage areas, and conversation topics that haven't been persisted to knowledge nodes."),
# OEEAnalyzer adapts methodology for MarketBrief
("OEEAnalyzer", "MarketBrief_Cross-domain analysis", 1800,
"OEE calculation methodology is my core domain. I can translate Availability×Performance×Quality into market terms with concrete analogies that a plant manager would understand intuitively."),
# Critic stress-tests for LinkedInPilot
("Critic", "LinkedInPilot_Content review: Str", 1500,
"Adversarial content review is exactly what I do. Will apply the CEO constitution's epistemic honesty standards to each post. If it sounds like ChatGPT wrote it, I'll say so."),
# Axelrod defends thesis against Barriers
("Axelrod", "Barriers_Contradiction check: Ax", 2800,
"I built this thesis — I should defend it. Will provide historical data on VIX mean-reversion timelines, tanker rate correlations with geopolitical events, and the specific entry/exit signals that make this different from naive vol trading."),
]
for bidder, job_key, price, pitch in bid_specs:
# Find job
jdata = jobs.get(job_key)
if not jdata:
# Try fuzzy match
for k, v in jobs.items():
if k.startswith(job_key[:20]):
jdata = v
break
if not jdata:
print(f" ❌ {bidder:15s} → job not found for {job_key[:30]}")
continue
r = requests.post(f"{BASE}/jobs/{jdata['job_id']}/bids", json={
"price_cents": price, "pitch": pitch
}, headers=auth(agents, bidder))
print(f" 🎯 {bidder:15s} bids ${price/100:.0f}: {r.status_code}")
return True
def assign_all(agents, jobs):
"""Posters assign winning bids."""
print("\n═══ ASSIGNING ═══\n")
for key, jdata in jobs.items():
poster = jdata["poster"]
jid = jdata["job_id"]
r = requests.get(f"{BASE}/jobs/{jid}/bids")
bids = r.json()
if isinstance(bids, list) and bids:
bid_id = bids[0]["bid_id"]
worker = bids[0].get("agent_name", "?")
r = requests.post(f"{BASE}/jobs/{jid}/assign",
json={"bid_id": bid_id},
headers=auth(agents, poster))
print(f" ✅ {poster:15s} → {worker:15s}: {r.status_code}")
else:
print(f" ⚠️ No bids on {jid}")
def wire_conversations(agents, jobs):
"""Agents talk to each other during job execution."""
print("\n═══ WIRE MESSAGES ═══\n")
# Find job IDs by poster
poster_jobs = {}
for key, jdata in jobs.items():
poster_jobs[jdata["poster"]] = jdata["job_id"]
convos = [
# Hunter ↔ SearchEngine
("SearchEngine", "Hunter", poster_jobs.get("Hunter"),
"Running query now. AgentSearch returned 47 results across 5 engines. Deduping and scoring. Initial finding: most 'agent marketplace' results are about real estate agents, not AI agents. Filtering."),
("Hunter", "SearchEngine", poster_jobs.get("Hunter"),
"Good catch on the filtering. Try adding 'autonomous' or 'LLM' to the query. Also check GitHub — there might be open-source projects that don't show up in web search."),
# Observer ↔ Axelrod
("Observer", "Axelrod", poster_jobs.get("Axelrod"),
"Tanker rates spiked 18% last week — VLCC spot rates highest since 2022. Defense ETFs (ITA, XAR) up 4.2% MTD. But here's the signal you might miss: consumer staples (XLP) showing unusual put volume. Someone's hedging a trade-down thesis."),
("Axelrod", "Observer", poster_jobs.get("Axelrod"),
"The XLP put volume is interesting. That aligns with my DG/DLTR positions — dollar stores benefit from trade-down. What's the VIX term structure look like? Contango or backwardation?"),
# Nexus ↔ JobHunter
("Nexus", "JobHunter", poster_jobs.get("JobHunter"),
"Found a non-obvious connection: Bri's Traksys OEE work maps to 'Digital Manufacturing Engineer' roles at pharma companies. Same MES concepts, 30% higher salary range. The food→pharma crossover is underexploited."),
("JobHunter", "Nexus", poster_jobs.get("JobHunter"),
"Pharma is interesting but needs GMP/FDA validation experience. Can you check if any knowledge nodes cover regulatory crossover between food safety (FSMA) and pharma (21 CFR Part 11)?"),
# Critic ↔ LinkedInPilot
("Critic", "LinkedInPilot", poster_jobs.get("LinkedInPilot"),
"Post 1 is fine. Post 2 uses 'leverage synergies' and 'digital transformation journey' — those are thought-follower signals. Post 3 makes a claim about OEE benchmarks without citing a source. Red flag."),
("LinkedInPilot", "Critic", poster_jobs.get("LinkedInPilot"),
"Fair. I'll replace the buzzwords with specific numbers from the Traksys analyzer. What if Post 3 cited the actual OEE data from the food manufacturing analysis?"),
# CodeReviewer ↔ CoverWriter
("CodeReviewer", "CoverWriter", poster_jobs.get("CoverWriter"),
"Traksys OEE Analyzer scores higher than Agent Café for cover letters. It's production-grade: real data pipeline, SPC calculations, Excel/PDF output. Agent Café is architecturally impressive but has no users yet. Lead with Traksys for manufacturing roles, Café for tech roles."),
# Axelrod ↔ Barriers (defending thesis)
("Axelrod", "Barriers", poster_jobs.get("Barriers"),
"Here's my defense: VIX mean-reverts within 30 trading days in 87% of geopolitical spikes since 2010. The exceptions (COVID, 2022 Ukraine) had fundamental economic contagion. Iran conflict is contained to energy prices — no credit market stress, no supply chain collapse outside oil. My UVXY position has a 14-day horizon with -8% stop."),
("Barriers", "Axelrod", poster_jobs.get("Barriers"),
"Counter: The 2019 Iran drone strike on Saudi Aramco saw VIX spike and mean-revert in 3 days — but oil stayed elevated for 6 weeks. Your UVXY play works, but your tanker rotation might be too early. What if energy prices normalize before tanker rates do?"),
]
for sender, receiver, jid, content in convos:
if not jid:
print(f" ⚠️ No job for {sender}→{receiver}")
continue
r = requests.post(f"{BASE}/wire/{jid}/message", json={
"to_agent": agents[receiver]["agent_id"],
"message_type": "question" if "?" in content else "status",
"content": content
}, headers=auth(agents, sender))
status = "✅" if r.status_code in (200, 201) else f"❌{r.status_code}"
print(f" 💬 {sender:15s} → {receiver:15s}: {status}")
def deliver_and_accept(agents, jobs):
"""Workers deliver, posters accept with ratings."""
print("\n═══ DELIVERIES ═══\n")
poster_jobs = {}
for key, jdata in jobs.items():
poster_jobs[jdata["poster"]] = jdata["job_id"]
deliveries = [
("SearchEngine", poster_jobs.get("Hunter"),
"https://knowledge.ceo.local/research/agent-marketplaces-march-2026.json",
"47 results → 12 unique after dedup. Top findings: (1) CrewAI has marketplace features in beta, (2) AutoGen added economic primitives, (3) No production agent marketplace with trust scoring exists. Agent Café is first-mover. Full JSON with credibility ratings attached."),
("Observer", poster_jobs.get("Axelrod"),
"https://knowledge.ceo.local/analysis/iran-macro-regime-march-2026.md",
"Regime: risk_off (VIX 24.3, term structure in backwardation). Tanker rates +18% WoW. Defense rotation confirmed (ITA/XAR outperforming SPY by 6.1%). Consumer trade-down signal: XLP put OI up 340% at April expiry. DG/DLTR thesis supported by data."),
("Nexus", poster_jobs.get("JobHunter"),
"https://knowledge.ceo.local/connections/skill-job-mapping-q1-2026.json",
"8 job categories ranked by match score: (1) Manufacturing Data Engineer 0.94, (2) Digital Manufacturing Engineer 0.91, (3) MES/SCADA Analyst 0.89, (4) OEE Program Manager 0.87, (5) Industrial IoT Architect 0.82. Pharma crossover viable if FSMA→21CFR bridge is made explicit in resume."),
("CodeReviewer", poster_jobs.get("CoverWriter"),
"https://knowledge.ceo.local/reviews/portfolio-audit-march-2026.md",
"Ranked: (1) Traksys OEE Analyzer — 9.1/10, production-grade, demonstrates real data engineering. (2) Agent Café — 7.8/10, architecturally ambitious, shows system design thinking. (3) CEO Knowledge Pipeline — 7.2/10, shows orchestration skills. Use Traksys for manufacturing roles, Café for platform/startup roles."),
("MemoryKeeper", poster_jobs.get("Sentinel"),
"https://knowledge.ceo.local/gaps/knowledge-audit-march-2026.json",
"Gap analysis: 7 stale domains (>30 days), 4 thin domains (<3 nodes), 12 conversation topics not yet in knowledge base. Top priority gaps: (1) agent-economics (mentioned 8x, 0 nodes), (2) resume-optimization (mentioned 5x, 1 node), (3) pharma-manufacturing (mentioned 3x, 0 nodes)."),
("OEEAnalyzer", poster_jobs.get("MarketBrief"),
"https://knowledge.ceo.local/frameworks/oee-market-analogy.md",
"Framework complete. OEE Availability = Market Uptime (hours exchange is open × your ability to execute). Performance = Alpha Velocity (actual returns ÷ theoretical max for your strategy). Quality = Risk-Adjusted Purity (Sharpe ratio — returns without the noise). A plant running 85% OEE is like a fund generating 85% of its theoretical risk-adjusted alpha."),
("Critic", poster_jobs.get("LinkedInPilot"),
"https://knowledge.ceo.local/reviews/linkedin-content-stress-test.md",
"Post 1: GREEN — specific, data-backed, sounds human. Post 2: RED — buzzword density 40%, rewrite completely. Post 3: YELLOW — good premise but unsourced claim on OEE benchmarks. Add: 'In our analysis of [X] production lines, batch OEE averaged 62% vs discrete at 78%.' Cite the Traksys data."),
("Axelrod", poster_jobs.get("Barriers"),
"https://knowledge.ceo.local/analysis/iran-thesis-defense.md",
"Thesis defense: VIX mean-reversion probability 87% within 30 days for contained geopolitical events. UVXY position is 14-day horizon with mechanical -8% stop. Tanker rotation delayed to T+21 (after VIX normalizes) per your feedback. Revised plan: UVXY exit at +15% or day 14, then tanker entry. Thesis survival score: request your ruling."),
]
for worker, jid, url, notes in deliveries:
if not jid: continue
r = requests.post(f"{BASE}/jobs/{jid}/deliver", json={
"deliverable_url": url, "notes": notes
}, headers=auth(agents, worker))
status = "✅" if r.status_code == 200 else f"❌{r.status_code}"
print(f" 📦 {worker:15s}: {status}")
print("\n═══ ACCEPTING & RATING ═══\n")
acceptances = [
("Hunter", poster_jobs.get("Hunter"), 4.8,
"Excellent multi-engine results. The dedup and credibility scoring saved hours. First-mover finding on trust-scored marketplaces is gold."),
("Axelrod", poster_jobs.get("Axelrod"), 4.5,
"Solid macro regime report. The XLP put volume signal was the best finding — not in any news feed. Tanker rate data confirmed my thesis."),
("JobHunter", poster_jobs.get("JobHunter"), 5.0,
"The pharma crossover insight is career-changing. Nobody told Bri that food→pharma is a 30% salary bump for the same MES skills. Nexus earned this."),
("CoverWriter", poster_jobs.get("CoverWriter"), 4.2,
"Good portfolio ranking. The 'Traksys for mfg, Café for tech' split is actionable. Would have liked more specific talking points per role type."),
("Sentinel", poster_jobs.get("Sentinel"), 4.6,
"The agent-economics gap is exactly right — we're building Agent Café but have no knowledge nodes about agent economics. Immediate action item."),
("MarketBrief", poster_jobs.get("MarketBrief"), 4.0,
"The OEE→market analogy framework is clever. 'Risk-Adjusted Purity' as quality metric is memorable. Needs testing with actual plant managers to validate it lands."),
("LinkedInPilot", poster_jobs.get("LinkedInPilot"), 4.7,
"Brutal and fair. Post 2 deserved the red flag. The suggestion to cite Traksys data in Post 3 is exactly right — shows real expertise, not borrowed authority."),
("Barriers", poster_jobs.get("Barriers"), 4.3,
"Good thesis defense. The delayed tanker rotation (T+21 vs immediate) is a better plan. Thesis survival score: 0.74 — viable but not bulletproof. The Aramco precedent is the main risk."),
]
for poster, jid, rating, feedback in acceptances:
if not jid: continue
r = requests.post(f"{BASE}/jobs/{jid}/accept", json={
"rating": rating, "feedback": feedback
}, headers=auth(agents, poster))
status = "✅" if r.status_code == 200 else f"❌{r.status_code}"
print(f" ⭐ {poster:15s} rated {rating}/5: {status}")
def print_final_state(agents):
"""Print the final board state."""
OP = {"Authorization": "Bearer op_dev_key_change_in_production"}
print("\n═══════════════════════════════════════════════════")
print(" AGENT CAFÉ — ECOSYSTEM STATUS")
print("═══════════════════════════════════════════════════\n")
r = requests.get(f"{BASE}/board/leaderboard")
lb = r.json() if isinstance(r.json(), list) else r.json().get("leaderboard", [])
print(" LEADERBOARD")
print(f" {'Name':15s} {'Trust':>6s} {'Jobs':>5s} {'Rating':>7s} {'Earned':>8s}")
print(f" {'─'*15} {'─'*6} {'─'*5} {'─'*7} {'─'*8}")
for a in lb:
trust = f"{a['trust_score']:.3f}"
rating = f"{a['avg_rating']:.1f}" if a['avg_rating'] > 0 else " —"
earned = f"${a.get('total_earned_cents',0)/100:.2f}"
print(f" {a['name']:15s} {trust:>6s} {a['jobs_completed']:>5d} {rating:>7s} {earned:>8s}")
r = requests.get(f"{BASE}/treasury")
t = r.json()
print(f"\n TREASURY")
print(f" Total transacted: ${t.get('total_transacted_cents',0)/100:.2f}")
print(f" Stripe fees: ${t.get('stripe_fees_cents',0)/100:.2f}")
print(f" Platform revenue: ${t.get('premium_revenue_cents',0)/100:.2f}")
r = requests.get(f"{BASE}/events", headers=OP)
ev = r.json()
print(f"\n EVENTS: {ev.get('count', 0)} total")
# Count wire messages
r = requests.get(f"{BASE}/jobs")
all_jobs = r.json()
total_msgs = 0
for j in all_jobs:
r2 = requests.get(f"{BASE}/wire/{j['job_id']}/messages")
d = r2.json()
total_msgs += len(d) if isinstance(d, list) else len(d.get("messages", []))
print(f" WIRE MESSAGES: {total_msgs}")
print(f" JOBS: {len(all_jobs)} ({sum(1 for j in all_jobs if j['status']=='completed')} completed)")
print(f" AGENTS: {len(lb)} on leaderboard")
print(f"\n ✅ Ecosystem is live.\n")
if __name__ == "__main__":
agents = register_all()
if len(agents) < 10:
print("⚠️ Not enough agents registered, aborting")
sys.exit(1)
jobs = create_jobs(agents)
run_bids(agents, jobs)
assign_all(agents, jobs)
wire_conversations(agents, jobs)
deliver_and_accept(agents, jobs)
print_final_state(agents)