Skip to content

Commit d2a009b

Browse files
hyperpolymathclaude
andcommitted
Evaluator: real agent runtime + Session type checking (L9)
Evaluator (major upgrade from stubs to working runtime): - Loop: real iteration with break/continue/return signals, 10K safety limit - Spawn: creates AgentInstance with handlers, state, inbox from registered decls - Send/SendFinal: delivers messages to target agent's inbox via Handle - Receive: pops from current agent's inbox (non-blocking) - Exchange: send + synchronous handler execution + reply collection - Method calls: String (length/to_upper/to_lower), List (length/get/push), Record (keys), Handle (id) - Agent handler execution: run_agent_handler() dispatches to matching handler - register_agents(program) pre-registers AgentDecls for spawn lookup - Break/Continue AST variants added to ControlStmt Type checker — Session types (Kategoria L9): - ProtocolTypeInfo: registered during Pass 1 with extracted roles - project_protocol(): global protocol → local view per role (Message steps become Send/Receive based on sender/receiver matching) - check_agent_protocol_compliance(): agents declaring `implements Protocol.Role` verified to have handlers for all projected Receive steps - SessionProtocolViolation error kind for missing handlers - LocalStep enum: Send, Receive, Branch, Loop, Rec Tests: 160 total (was 141) — 15 new eval tests + 4 new session type tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7193b99 commit d2a009b

6 files changed

Lines changed: 1567 additions & 50 deletions

File tree

crates/oo7-core/src/ast.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ pub enum ControlStmt {
130130
},
131131
/// `return [expr]`
132132
Return(Option<ControlExpr>),
133+
/// `break [expr]` — exit the enclosing loop, optionally with a value
134+
Break(Option<ControlExpr>),
135+
/// `continue` — skip to the next iteration of the enclosing loop
136+
Continue,
133137
/// `reversible { ... }` — marks a block as reversible
134138
Reversible(Vec<ControlStmt>),
135139
/// `irreversible { ... }` — marks a block as irreversible

0 commit comments

Comments
 (0)