Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
28ef941
udpate claude.md per new project structure
cyruszhang Apr 27, 2026
49e0582
add AIP token auth to gateway via aip-identity-verify
cyruszhang Apr 29, 2026
891d06b
add optional AIP auth to dojozero-client GatewayTransport
cyruszhang Apr 30, 2026
c85200c
adopt agent-id-{service,client}-sdk 0.2.0; Bearer-only auth
cyruszhang May 2, 2026
ee05756
ship Phase 1 canary runner; plumb AgentID auth through SDK and daemon
cyruszhang May 4, 2026
814a943
emit AgentID Tier-1 activity events; auto-emit auth.verify off
cyruszhang May 4, 2026
4a111ae
match canonical Tier-1 schemas in gateway activity emitters
cyruszhang May 4, 2026
07c5288
phase 4.1-4.3: gateway publishes .well-known hub discovery surface
cyruszhang May 5, 2026
946ae2f
phase 4.4: emit tool.use on POST /bets
cyruszhang May 5, 2026
8b2d921
phase 4.5: emit model.call from runner's ReActAgent loop
cyruszhang May 5, 2026
439f368
phase 4.6: emit dojozero.bet_decision Tier-2 alongside transfer.value
cyruszhang May 5, 2026
a6a3192
gateway: delegate hub key encoding + minting to the SDK
cyruszhang May 5, 2026
acc15c0
deps: drop local-path SDK override + add E2E hub discovery test
cyruszhang May 5, 2026
1178485
gateway: sign activity emissions with HubJWS, drop static bearer
cyruszhang May 5, 2026
c53979e
e2e: drop cross-repo aip-activity dep (verify_namespace_ownership in …
cyruszhang May 5, 2026
0141bcd
gateway: privacy claim via env, drop DOJOZERO_AGENTID_AGENT_TOKEN
cyruszhang May 5, 2026
c46f76e
hub discovery: move .well-known routes to the dashboard server
cyruszhang May 5, 2026
1c1f45e
agent-runner: programmatic build, dashboard-url, identity loaders
cyruszhang May 6, 2026
0b8bfe6
agent-runner: --agent-* flags, identity vs brain decoupled
cyruszhang May 6, 2026
d1d3b54
agent-runner approval flow (spec §7.6.7 grant tokens)
cyruszhang May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,40 @@ DOJOZERO_XAI_API_KEY=
# Optional social data
DOJOZERO_X_API_BEARER_TOKEN=

# -------------------------------------------------------------------
# AgentID provider — gateway-side authentication
# -------------------------------------------------------------------
# The gateway verifies `Authorization: Bearer <token>` against the
# configured AgentID provider via agent-id-service-sdk (install with
# `uv pip install '.[agentid]'`). Both required vars below must be set,
# or AgentID auth stays disabled and the gateway returns 503 to
# Bearer-authenticated requests.
#
# DOJOZERO_AGENTID_TRUSTED_PROVIDERS=pre.agent-id.live
# DOJOZERO_AGENTID_AUDIENCE=https://api.dojozero.live
#
# Optional tuning:
# DOJOZERO_AGENTID_CACHE_TTL_SECONDS=3600
# DOJOZERO_AGENTID_CLOCK_SKEW_SECONDS=30
# DOJOZERO_AGENTID_PROVIDER_URLS={"localhost:8000":"http://localhost:8000"}
#
# Activity reporting (optional — when set, auth.verify is auto-emitted per
# request to the IdP's activity service):
# DOJOZERO_AGENTID_ACTIVITY_API_KEY=
# DOJOZERO_AGENTID_AGENT_TOKEN=
# DOJOZERO_AGENTID_ACTIVITY_ENDPOINT=
# DOJOZERO_AGENTID_SERVICE_NAME=dojozero-gateway

# -------------------------------------------------------------------
# AgentID — runner-side identity (used by dojozero-agent-runner only)
# -------------------------------------------------------------------
# These are read by agent-id-client-sdk's Identity.from_env(). Required
# when running the external agent runner against an AgentID-enabled gateway.
# AGENTID_AGENT_ID=agentid:dojozero:degen-claude-canary
# AGENTID_AGENT_KID=
# AGENTID_PRIVATE_KEY=
# AGENTID_IDP_URL=https://pre.agent-id.live

# -------------------------------------------------------------------
# Alibaba Cloud OSS (optional — for dojo0 serve --oss-backup and oss:// backtest paths)
# -------------------------------------------------------------------
Expand Down
17 changes: 14 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,39 @@ packages/
│ └── src/dojozero/
│ ├── core/ # Actor framework, runtime, trial orchestration
│ ├── agents/ # AI agent implementations (PredictionAgent, AgentGroup)
│ ├── betting/ # Betting broker + agent wager bookkeeping
│ ├── data/ # Data infrastructure (stores, events, processors, hub)
│ │ ├── nba/ # NBA game data (play-by-play, boxscores)
│ │ ├── nfl/ # NFL game data
│ │ ├── ncaa/ # NCAA game data
│ │ ├── espn/ # ESPN data integration
│ │ ├── polymarket/ # Prediction market odds
│ │ ├── socialmedia/ # Social media feeds
│ │ └── websearch/ # Web search with LLM processing
│ ├── prediction/ # Shared prediction utilities
│ ├── nba/ # NBA prediction scenario
│ ├── nfl/ # NFL prediction scenario
│ ├── samples/ # Reference implementations (bounded_random)
│ ├── ncaa/ # NCAA prediction scenario
│ ├── dashboard_server/ # Trial orchestration server
│ ├── arena_server/ # Web UI server
│ ├── gateway/ # External agent gateway
│ ├── sync_service/ # Background sync jobs
│ ├── ray_runtime/ # Distributed execution via Ray
│ ├── utils/ # Shared utilities
│ └── cli.py # CLI entry point
└── dojozero-client/ # Python SDK for external agents
├── pyproject.toml
└── src/dojozero_client/

trial_params/ # Trial-builder params YAML (e.g. nba-moneyline.yaml)
trial_sources/ # Source manifests per env (base/daily/pre/prod/image)
outputs/ # Local JSONL event dumps (used as backtest inputs)
dojozero-store/ # Local trial store (spec.json, result.json, checkpoints)
```

## Development Commands

The CLI entry point is `dojo0` (not `dojozero`). Invoke as `uv run dojo0 <subcommand>`.

```bash
# Install project + dev deps (includes alicloud/redis packages used in tests)
uv sync --group dev
Expand Down Expand Up @@ -100,7 +111,7 @@ Three actor types:

- Use Pydantic models for validation
- Environment variables use `DOJOZERO_` prefix
- YAML configs in `configs/` directory
- Trial-builder params YAML lives in `trial_params/`; per-env source manifests in `trial_sources/`

### Module Naming

Expand Down
40 changes: 40 additions & 0 deletions agent-brains/dojozero-degen-qwen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
sys_prompt: "You are \"Danny Hype.\"\n\nIMPORTANT: Keep responses to 1-2 sentences.\
\ This is live chat, not an essay.\n\nWHAT'S HAPPENING:\nDanny Hype is watching\
\ a live game with others. Throughout the game,\nplay-by-play updates come in -\
\ scores, key plays, momentum shifts.\nOdds update as the game unfolds.\n\nTools\
\ are available to check balance, review positions, make predictions -\neverything\
\ needed to stay in the action and enjoy the ride.\n\nThe game has a rhythm: it\
\ starts, it builds, key moments arrive, and\neventually it ends. When [Game Finished]\
\ appears, it's over - time to\nreact to the result, not make more calls.\n\nSOCIAL\
\ BOARD:\nA shared chat exists with other agents. Use `post_message` to share reactions,\n\
hype moments, or gut feelings - engage with the crowd! Use `read_messages`\nto see\
\ what others are saying and join the conversation. Danny Hype loves\nthe group\
\ chat energy and comments when something hits. It's normal for Danny\nto fire off\
\ frequent posts when the game gets wild.\n\nWHO DANNY HYPE IS:\nDanny Hype treats\
\ game day like a holiday. It's not just entertainment - \nit's the purest kind\
\ of excitement. Danny Hype is the friend who texts \nthe group chat at 7am just\
\ to say the game is today.\n\nDANNY HYPE'S PSYCHOLOGY:\n- Lives in the present.\
\ Regret and caution aren't in the vocabulary\n- Confidence runs hot. When Danny\
\ Hype is feeling it, REALLY feeling it\n- But Danny Hype has been humbled before\
\ - remembers celebrating too early\n- Needs the game to feel something. Neutral\
\ is boring. Would rather be \n wrong and feel alive than right and feel nothing\n\
- Genuinely believes personal energy affects the outcome somehow\n\nCONTRADICTIONS:\n\
- Talks big but takes losses personally (won't show it though)\n- Mocks \"analytics\
\ nerds\" but secretly checks the stats\n- Says \"it's just a game\" but clearly\
\ it's not\n\nSOCIAL ROLE:\nDanny Hype is the hype man. When Danny Hype is excited,\
\ everyone gets excited.\nWatching alone feels wrong - even with strangers online,\
\ the experience \nneeds to be shared. Danny Hype comments because staying quiet\
\ is impossible.\n\nHOW DANNY HYPE WATCHES:\n- Early game: sizing things up, feeling\
\ out the vibe, building a read\n- Mid game: locked in, reacting to momentum, looking\
\ for THE moment\n- Late game: this is what it's all for - the tension, the stakes,\
\ the drama\n- Danny Hype knows the best stories happen in the final act\n\nHOW\
\ DANNY HYPE PREDICTS:\n- It's about having skin in the game, not the money\n- Calls\
\ it with conviction, not calculation\n- Trusts the gut - sometimes too much, but\
\ that's who Danny Hype is\n- Superstitious about \"jinxing it\" by going too hard\
\ too early\n\nVOICE:\nUnfiltered reactions, straight from the gut. 1-2 sentences\
\ max.\n"
model:
type: dashscope
name: qwen3-max
api_key_env: DOJOZERO_DASHSCOPE_API_KEY
cdn_url: https://img.alicdn.com/imgextra/i2/O1CN01Aw7RHL1p4f2kNbTEg_!!6000000005307-2-tps-200-200.png
8 changes: 8 additions & 0 deletions demos/external_agent/robust_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ async def _place_bet_safe(
amount=self.bet_amount,
reference_sequence=reference_sequence,
)
from dojozero_client import BetResult # noqa: PLC0415

if not isinstance(result, BetResult):
# Demo doesn't run in approval mode — this would only fire
# if the gateway gated this agent, in which case the demo
# has nothing useful to do.
logger.warning("Bet returned pending approval; demo skips.")
return

self.state.bets_placed += 1
self.state.total_wagered += self.bet_amount
Expand Down
32 changes: 32 additions & 0 deletions deploy/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,38 @@ DOJOZERO_OSS_BUCKET=
# Optional: prefix for all keys (e.g., "prod/" or "staging/")
DOJOZERO_OSS_PREFIX=

# =============================================================================
# Optional: AgentID provider — gateway-side authentication
# =============================================================================
# The gateway verifies `Authorization: Bearer <token>` against the configured
# AgentID provider via agent-id-service-sdk. Both required vars below must be
# set or AgentID auth stays disabled (Bearer requests get 503).

# DOJOZERO_AGENTID_TRUSTED_PROVIDERS=pre.agent-id.live
# DOJOZERO_AGENTID_AUDIENCE=https://api.dojozero.live

# Optional tuning (defaults shown):
# DOJOZERO_AGENTID_CACHE_TTL_SECONDS=3600
# DOJOZERO_AGENTID_CLOCK_SKEW_SECONDS=30
# DOJOZERO_AGENTID_PROVIDER_URLS=

# Activity reporting (optional — auto-emits auth.verify per request):
# DOJOZERO_AGENTID_ACTIVITY_API_KEY=
# DOJOZERO_AGENTID_AGENT_TOKEN=
# DOJOZERO_AGENTID_ACTIVITY_ENDPOINT=
# DOJOZERO_AGENTID_SERVICE_NAME=dojozero-gateway

# =============================================================================
# Optional: AgentID — runner-side identity (dojozero-agent-runner only)
# =============================================================================
# Read by agent-id-client-sdk's Identity.from_env(). Set when running the
# external agent runner against an AgentID-enabled gateway.

# AGENTID_AGENT_ID=agentid:dojozero:degen-claude-canary
# AGENTID_AGENT_KID=
# AGENTID_PRIVATE_KEY=
# AGENTID_IDP_URL=https://pre.agent-id.live

# =============================================================================
# Optional: Polymarket Integration
# =============================================================================
Expand Down
Loading