Graph and state#
The agent topology: nodes wired by edges, entered at a hub. See Customize agents and tools for the narrative version.
adda.Graph
dataclass
#
Agent graph passed to :class:~agent_runtime.AgenticRun.
Declares which agents exist, which directed delegation edges connect them, and which agent starts the run. Loops are permitted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes
|
dict[str, Agent]
|
Maps unique agent names to :class: |
required |
edges
|
sequence of Edge
|
Directed delegation edges. An agent with no outgoing edges
receives no |
()
|
entry
|
str
|
Name of the agent that receives the initial briefing. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If any edge endpoint names an undeclared node, or if entry is not declared. |
Source code in src/adda/_src/backends/base.py
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | |
nodes: dict
instance-attribute
#
edges: tuple = ()
class-attribute
instance-attribute
#
entry: str = None
class-attribute
instance-attribute
#
_MERMAID_COLOURS = {'StrategizerAgent': ('#1d4ed8', '#1e3a8a'), 'LiteratureReviewAgent': ('#6d28d9', '#4c1d95'), 'DataGeneratorAgent': ('#b45309', '#7c2d12'), 'F3dasmImplementerAgent': ('#15803d', '#14532d'), 'AdversarialCritiqueAgent': ('#b91c1c', '#7f1d1d'), 'DebuggerAgent': ('#475569', '#1e293b')}
class-attribute
instance-attribute
#
_MERMAID_FALLBACK = [('#0f766e', '#134e4a'), ('#a16207', '#713f12'), ('#be185d', '#831843'), ('#4338ca', '#312e81')]
class-attribute
instance-attribute
#
with_node(name: str, agent: Agent) -> Graph
#
Return a new Graph with agent under name.
If name already exists, the new agent replaces it and its edges
are kept. The original graph is not changed. Add the delegation
edges for a new node with :meth:with_edge.
Source code in src/adda/_src/backends/base.py
662 663 664 665 666 667 668 669 670 | |
with_edge(source: str, target: str, preamble: str = '', handoff: bool = False) -> Graph
#
Return a new Graph where source may delegate (or, with
handoff=True, hand its job) to target.
Both nodes must already exist. An existing edge of the same mode between them is replaced, so its preamble can be changed. The original graph is not changed.
Source code in src/adda/_src/backends/base.py
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 | |
outgoing(name: str) -> list[str]
#
Return the names name may delegate to (handoff edges excluded).
Source code in src/adda/_src/backends/base.py
688 689 690 691 | |
incoming(name: str) -> list[str]
#
Return the names that may delegate to name.
Source code in src/adda/_src/backends/base.py
693 694 695 696 | |
handoff_targets(name: str) -> list[str]
#
Return the names name may hand its job to.
Source code in src/adda/_src/backends/base.py
698 699 700 | |
edge(source: str, target: str, handoff: bool = False) -> Edge | None
#
Return the Edge of that mode from source to target, or None.
Source code in src/adda/_src/backends/base.py
702 703 704 705 706 707 708 | |
to_mermaid() -> str
#
Return a styled Mermaid flowchart for this graph.
Generated from the live spec: node labels carry each agent's class, role, and a short description; nodes are coloured by agent class. Edges are drawn by kind, as in the viewer: a Delegate edge is a solid arrow, a handoff edge a dashed arrow labelled "handoff" (followed by the edge's preamble, if any). Paste at https://mermaid.live or any Mermaid-aware renderer (GitHub markdown, Jupyter, VS Code).
Source code in src/adda/_src/backends/base.py
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 | |
adda.Edge
dataclass
#
A directed edge between two named agents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Name of the agent that may use the edge. |
required |
target
|
str
|
Name of the agent that receives the task or the job. |
required |
preamble
|
str
|
Text prepended to the task message when this edge is traversed. |
''
|
handoff
|
bool
|
False (default): |
False
|
Source code in src/adda/_src/backends/base.py
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | |
adda.Agent
#
Base class for all agentic nodes in a Graph.
Configure a node either by subclassing and overriding the class-level
attributes (system_prompt, tools, etc.), or inline with the
keyword constructor::
Agent(system_prompt="...", tools={"Read", "Bash"}, role="analyst",
description="...", model="...")
A keyword that is passed overrides the class attribute on that instance; one that is left out keeps the class attribute.
Tool system — three categories:
tools: frozenset[str] declares tools from two categories:
-
Native backend tools — names from :data:
NATIVE_TOOL_NAMES("Bash","Read","Write", etc.). The runtime passes these to the backend session's native tool executor. -
Protocol closure tools — names from :data:
PROTOCOL_CLOSURE_NAMES("Done","WriteNote","ReadNote"). The runtime builds Python callables for these and passes them asclosure_toolsto the session factory. -
Topology-injected tools —
"Delegate","Parallel","Debate","Retry"(outgoing edges),"Ask"(entry node), and"SendMessage"(every node, regardless of edges). Never declare these inAgent.tools. The runtime injects them automatically from the graph topology; any declaration here is ignored. -
External MCP server tools — names declared in
extra_allowed_tools(e.g."arxiv_search_papers"). The runtime passes these to the backend together withmcp_servers, a dict of{server_name: McpStdioServerConfig}that declares which external MCP servers to start.
Default is frozenset() — no tools (opt-in, conservative).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str or None
|
Model identifier. |
None
|
system_prompt
|
str or None
|
This node's system prompt. |
None
|
tools
|
iterable of str or None
|
Tool names (stored as a |
None
|
role
|
str or None
|
Deprecated and ignored; the node name identifies a node. |
None
|
description
|
str or None
|
One-line description shown to nodes that may delegate to it. |
None
|
Source code in src/adda/_src/backends/base.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 | |
system_prompt: str = ''
class-attribute
instance-attribute
#
tools: frozenset[str] = frozenset()
class-attribute
instance-attribute
#
custom_tools: dict = {}
class-attribute
instance-attribute
#
reset_on_checkpoint: bool = True
class-attribute
instance-attribute
#
description: str = ''
class-attribute
instance-attribute
#
model: str | None = None
class-attribute
instance-attribute
#
backend: str | None = None
class-attribute
instance-attribute
#
base_url: str | None = None
class-attribute
instance-attribute
#
base_prompt: str | None = None
class-attribute
instance-attribute
#
mcp_servers: dict = {}
class-attribute
instance-attribute
#
extra_allowed_tools: frozenset[str] = frozenset()
class-attribute
instance-attribute
#
max_history_pairs: int = 5
class-attribute
instance-attribute
#
derivation: bool = False
class-attribute
instance-attribute
#
ledgered_evaluations: bool = False
class-attribute
instance-attribute
#
handbook_audience: tuple[str, ...] = ()
class-attribute
instance-attribute
#
subscribes: dict = {}
class-attribute
instance-attribute
#
report_sections: tuple[str, ...] = ('### Actions taken', '### Conclusions', '### Numbers')
class-attribute
instance-attribute
#
forward() -> None
#
ADAS hook — override for inspectable Python orchestration.
Source code in src/adda/_src/backends/base.py
516 517 | |
runtime_closures(study_dir: Path, **kwargs) -> dict
#
Every Python tool this agent's adapter receives: the closures of
:meth:build_closure_tools and the plain functions listed in
tools. The runtime, the run diagram and the viewer all read this
one method, so a custom tool reaches all three the same way.
Source code in src/adda/_src/backends/base.py
519 520 521 522 523 524 525 | |
build_closure_tools(study_dir: Path, delegation_id: str | None = None, lit_reviewer_notes_dir: Path | None = None) -> dict
#
Return runtime closure tools for this agent.
Called by the runtime when constructing the worker adapter so agents can inject Python callables (e.g. corpus management tools) without declaring them in Agent.tools.
The default gives EVERY agent read-only lookup against the study's persistent literature corpus (ConsultLiterature) — the corpus is shared, queryable infrastructure (see LiteratureCorpus), the same way QueryStore lets every node read the canonical evaluation ledger without delegating to the data generator. ACQUIRING a new paper (CorpusAdd, external search) stays literature_reviewer-only: finding and vetting a new paper needs judgment a raw tool call can't supply, so it stays gated behind an actual delegation — see LiteratureReviewAgent.build_closure_tools, which overrides this method entirely (the same ConsultLiterature plus CorpusAdd) and does not call super().
Override in a subclass to replace this default entirely.
Source code in src/adda/_src/backends/base.py
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 | |
adda.Node
#
One node in the agent graph.
inspect.getsource(Node._orchestrate) reads the routing logic every
node runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adapter
|
Any
|
The LLM adapter this node speaks through. |
required |
name
|
str
|
The node's name in the graph. This is what distinguishes one agent from another — there is no per-agent node class. |
'node'
|
outgoing
|
list[str] | tuple[str, ...]
|
Names of the nodes this one may delegate to. Empty means |
()
|
spec
|
Any
|
The whole :class: |
None
|
report_sections
|
tuple[str, ...] | None
|
This agent's own declared report contract and toolset. |
None
|
agent_tools
|
tuple[str, ...] | None
|
This agent's own declared report contract and toolset. |
None
|
Source code in src/adda/_src/nodes/node.py
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 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | |
_current_run_dir
property
#
This run's root, derived from the notes dir the graph state sets.
run_dir arrives on the state, not on the node, and only
_current_notes_dir (<run>/debug/strategizer_notes) is kept
from it — so the run root is that path's grandparent. None
before the first invoke, which callers must tolerate.
LEDGER_WRITES = ('HypothesisPropose', 'HypothesisUpdate', 'MilestoneSet')
class-attribute
instance-attribute
#
_milestone_ack: set
property
writable
#
_awake_slots = None
class-attribute
instance-attribute
#
_topology = None
class-attribute
instance-attribute
#
adapter = adapter
instance-attribute
#
_name = name
instance-attribute
#
_outgoing = list(outgoing)
instance-attribute
#
_spec = spec
instance-attribute
#
_silent = is_plain_default(spec.nodes.get(name) if spec is not None else None)
instance-attribute
#
_wind_down_entry() -> Any | None
#
Source code in src/adda/_src/nodes/wind_down.py
121 122 123 124 | |
_wind_down_active() -> bool
#
Source code in src/adda/_src/nodes/wind_down.py
126 127 | |
_wind_down_record(**fields: Any) -> None
#
Merge fields into debug/wind_down.json (atomic).
Source code in src/adda/_src/nodes/wind_down.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
_wind_down_begin(prog: _rules.Progress) -> None
#
Entry node, once: freeze, tell every node, arm the interrupt.
Source code in src/adda/_src/nodes/wind_down.py
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 | |
_wind_down_interrupt_timer() -> None
#
Source code in src/adda/_src/nodes/wind_down.py
197 198 199 200 201 202 203 204 | |
_wind_down_interrupt(why: str) -> list[dict]
#
SIGINT the work in flight that each node owns. Recorded, never silent; the nodes continue with "save results".
Source code in src/adda/_src/nodes/wind_down.py
206 207 208 209 210 211 212 213 214 215 216 217 | |
_wind_down_read() -> dict
#
Source code in src/adda/_src/nodes/wind_down.py
219 220 221 222 223 224 225 226 227 | |
_wind_down_route(state: Any, ai_msg: Any) -> Any | None
#
The entry node's turn ended during the wind-down: say which step
comes next, at most wind_down_turns times per step. Returns a
Command that re-prompts, or None when the turn is to be routed as
usual (the close was accepted).
Source code in src/adda/_src/nodes/wind_down.py
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 | |
_wind_down_finish() -> None
#
At the close: the facts run_status.json reports.
Source code in src/adda/_src/nodes/wind_down.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | |
_time_entry() -> Any | None
#
The node that holds the run clock, from any node.
Source code in src/adda/_src/nodes/time_rules.py
31 32 33 34 35 36 | |
_time_rules_ensure() -> Any | None
#
The rules for this node's clock, built once from the settings.
Source code in src/adda/_src/nodes/time_rules.py
38 39 40 41 42 43 44 45 | |
_time_progress(entry: Any) -> _rules.Progress
#
How far each budget that is set has run: wall seconds since the run start, output tokens generated by every node, and evaluations in the canonical store.
Source code in src/adda/_src/nodes/time_rules.py
47 48 49 50 51 52 53 54 55 | |
_time_rules_start() -> None
#
Entry node, once per run: read the rules and arm what each budget needs: one timer per threshold on the wall budget, a listener on the token count, a poll of the store on the evaluation count.
Source code in src/adda/_src/nodes/time_rules.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
_time_wall_arm() -> None
#
One timer per wall threshold not fired yet, on the working clock.
Source code in src/adda/_src/nodes/time_rules.py
78 79 80 81 82 83 84 85 86 | |
_time_wall_rearm() -> None
#
Source code in src/adda/_src/nodes/time_rules.py
88 89 90 91 92 93 94 95 96 97 | |
_time_timer_start(delay: float, fn: Any) -> None
#
Source code in src/adda/_src/nodes/time_rules.py
99 100 101 102 103 104 105 | |
_time_poll_arm() -> None
#
Source code in src/adda/_src/nodes/time_rules.py
107 108 | |
_time_poll() -> None
#
Read the evaluation count and tick; look again until the wind-down has begun.
Source code in src/adda/_src/nodes/time_rules.py
110 111 112 113 114 115 116 117 | |
_time_tokens_changed() -> None
#
A model call ended on some thread: if it crossed a threshold, fire it on its own thread so that thread's model call is not held up.
Source code in src/adda/_src/nodes/time_rules.py
119 120 121 122 123 124 125 126 127 128 129 130 | |
_time_timer_fire() -> None
#
Source code in src/adda/_src/nodes/time_rules.py
132 133 134 135 136 | |
_time_rules_cancel() -> None
#
The run is over: no timer may act on a later run in this process.
Source code in src/adda/_src/nodes/time_rules.py
138 139 140 141 142 143 144 145 146 | |
_owner_node() -> Any
#
The live node that owns the job (this one when it cannot tell): the run clock lives on the entry node, its notices go to the owner.
Source code in src/adda/_src/nodes/time_rules.py
148 149 150 151 152 153 154 155 | |
_time_elapsed() -> _rules.Progress | None
#
Source code in src/adda/_src/nodes/time_rules.py
157 158 159 160 161 | |
_time_rules_tick() -> None
#
Fire every threshold the clock has passed, once. Idempotent.
When several are due at once (a late checkpoint, a resume) only the latest fires: its notice states the rule that holds now.
Source code in src/adda/_src/nodes/time_rules.py
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 | |
_time_fire(phase: str, prog: _rules.Progress) -> None
#
Source code in src/adda/_src/nodes/time_rules.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
_eval_notify(prog: _rules.Progress) -> None
#
The evaluation budget's notice (the same steps as the others).
Source code in src/adda/_src/nodes/time_rules.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
_time_broadcast(phase: str, prog: _rules.Progress) -> None
#
The notice to the job's owner and to every running delegation.
Source code in src/adda/_src/nodes/time_rules.py
230 231 232 233 234 235 236 | |
_time_post(entry_text: str, worker_text: str) -> None
#
Source code in src/adda/_src/nodes/time_rules.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
_time_cutoff_refusal() -> str | None
#
The Delegate refusal once the cutoff has passed, on any node.
Always enforced when a budget is declared; budget_notes only
decides whether the earlier notices are sent.
Source code in src/adda/_src/nodes/time_rules.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
_stop_tick() -> str
#
Raw notice text for the entry node, "" when there is nothing new (the caller marks it as an adda notice).
Idempotent and cheap: one small file read until a request is seen. Only the node that runs a turn (the one holding the run's start time) acts; a worker node's checkpoints leave the request alone.
Source code in src/adda/_src/nodes/stop.py
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 | |
_stop_nodes() -> list[Any]
#
This node and its peers, each once: _peers holds every live
node, this one included.
Source code in src/adda/_src/nodes/stop.py
151 152 153 154 155 156 157 158 | |
_stop_wind_down() -> list[str]
#
Tell every live delegation to report now. Returns their ids.
Source code in src/adda/_src/nodes/stop.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
_stop_cancel_stragglers(why: str | None = None) -> list[str]
#
Detach what has not reported, and say so. why replaces the
grace wording in the delegation record (a wind-down uses it).
No placeholder retrospective is written for a straggler — it never gave one, and the record must say that rather than invent it.
Source code in src/adda/_src/nodes/stop.py
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 | |
_stop_refusal() -> str | None
#
The Delegate refusal while a stop is active, else None.
Source code in src/adda/_src/nodes/stop.py
217 218 219 220 221 222 223 224 | |
_stop_consume() -> None
#
Source code in src/adda/_src/nodes/stop.py
226 227 228 229 | |
_request_wind_down(*, reason: str, termination: str, run_dir: Any = None, grace_s: float = DEFAULT_GRACE_S) -> bool
#
A backstop asks for the graceful path instead of halting. False when it cannot (no run directory, or the file cannot be written), in which case the caller halts as it always did.
Source code in src/adda/_src/nodes/stop.py
231 232 233 234 235 236 237 238 239 240 241 242 243 | |
_wind_down_overdue() -> bool
#
The grace for the workers plus an equal one for the entry node's own retrospective round has passed: the hard halt may fire.
Source code in src/adda/_src/nodes/stop.py
245 246 247 248 249 | |
_stop_termination() -> str
#
Source code in src/adda/_src/nodes/stop.py
251 252 | |
_recorded_retrospective_ids() -> set[str]
#
Source code in src/adda/_src/nodes/stop.py
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
_missing_retrospectives() -> list[str]
#
Delegations that ended without a recorded retrospective.
Source code in src/adda/_src/nodes/stop.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
_log_lost_workers() -> None
#
A resume after a crash: delegations the delegation log last saw RUNNING died with the process. They are named, never given invented retrospective text.
Source code in src/adda/_src/nodes/stop.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
_log_missing_retrospectives(why: str) -> None
#
Source code in src/adda/_src/nodes/stop.py
306 307 308 309 310 311 | |
_init_orchestration(*, name: str, outgoing: list[str], spec: Any, study_dir: Any = None, interactive: bool = False, max_ask: int = 1, worker_adapters: dict | None = None, notes_dir: Any = None, workspace_dir: Any = None, delegation_log: DelegationLog | None = None) -> None
#
Set up the delegation registry, the ledgers and the routing tools.
Runs for every node (Node.__init__ no longer branches on
outgoing). The registry/routing state below is inert when
outgoing is empty — Delegate() just has no valid target — so
there is no harm running it unconditionally. Epistemic OWNERSHIP is
the one thing that must stay gated on having outgoing edges (see
_owns_epistemics below): notes_dir is passed identically to
every node by graph_builder.py, and a node with nobody to
delegate to must never acquire the hypothesis/milestone ledgers just
because it was handed a path.
study_dir/workspace_dir/delegation_log are already set by
:meth:Node._init_capabilities, which runs first for every node —
not re-set here.
Source code in src/adda/_src/nodes/orchestration.py
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 | |
_install_epistemics() -> None
#
Build (or rebuild at a new path) everything notes_dir owns.
THE one construction site for the hypothesis ledger, the milestone
ledger, the science monitor and telemetry. There used to be two: the
constructor built the ledger, and _absorb_state — which runs at the
start of every turn — rebuilt it with if self._ledger is None,
knowing nothing about why the constructor had left it None. Three
consequences, all of them silent:
graph_builderused to handnotes_dirto the entry node alone, so it alone owned the ledgers; any other orchestrating node re-acquired one on its first turn, undoing that decision. (It now hands the realnotes_dirto every orchestrating node, so this particular inconsistency no longer applies — kept here as the historical reason_install_epistemicsexists as one site.)- Only the ledger was re-pointed when the run's notes dir differed from the constructor's; the milestone ledger and telemetry kept writing to the stale path.
- The science monitor, built once in the constructor, was never rebuilt at all — so a node whose ledger was resurrected ran with the ledger ON and the monitor OFF.
Ownership is fixed at construction (_owns_epistemics); this only
ever rebuilds at a corrected path, never grants ownership.
Source code in src/adda/_src/nodes/orchestration.py
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 | |
_log_status(delegation_id: str) -> tuple[str | None, str]
#
Return (status, deliverable) for delegation_id from the persistent log, or (None, "") if the log has no such delegation.
Source code in src/adda/_src/nodes/orchestration.py
322 323 324 325 326 327 328 329 330 | |
_pending_delegations() -> list[str]
#
In-flight delegations, reconciled against the authoritative log.
A delegation the log shows terminal (DONE/FAILED) is never reported pending, even if the in-memory cache still says "Working". That stale state is what made Done()'s liveness gate refuse forever and kill run4 by watchdog after it had already found the optimum (audit BF-0/BF-2).
Source code in src/adda/_src/nodes/orchestration.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |
_open_reviews() -> list[str]
#
This node's delegations whose report waits for its approval: OpenForReview, or Revising (a question already sent, unresolved).
Source code in src/adda/_src/nodes/orchestration.py
353 354 355 356 357 358 359 | |
_reconcile_lost_delegations() -> list[str]
#
First turn of a process: close the log rows its predecessor left RUNNING.
A delegation runs on a thread of the process that dispatched it. When that process ends, the thread ends, and its log row stays RUNNING for good. A resumed process holds no registry entry for such a row, so nothing in it can finish the row, and the agent would wait for a result that cannot come. Each orphan becomes a terminal FAILED row and the agent is told, once, which delegations died.
Source code in src/adda/_src/nodes/orchestration.py
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 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
_restore_open_reviews() -> None
#
First turn of a process: reports its predecessor left open for review stay reviewable.
An OPEN_FOR_REVIEW row is a finished report nobody has approved. A resumed process holds no registry entry and no worker session for it, so SendMessage(id, approve=True) was refused and the work could not be cited until it was redone. Each such row of this node gets its entry back, unread (a Wait hands the report over again) and approvable; its session ended with the old process, so it cannot be revised.
Source code in src/adda/_src/nodes/orchestration.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |
_quiet_delegation_notice(parent: str) -> str
#
Raw notice for parent about its delegations that went quiet.
Activity is a new mtime on the delegation's transcript or on any file
under its workspace folder. A Working delegation with none for
runtime.quiet_delegation_min minutes (default 60) is named once;
new activity re-arms it. A notice only: nothing is stopped.
Source code in src/adda/_src/nodes/orchestration.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | |
_latest_activity(did: str) -> float | None
#
Newest mtime of the delegation's transcript or workspace files.
Source code in src/adda/_src/nodes/orchestration.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |
_canonical_source_registered() -> bool
#
True if a canonical ground-truth source is resolvable.
Reads run_config.json: an evaluator entrypoint OR a lookup pool counts as a registered source. Best-effort — on any read failure, assume not registered (the nudge is soft, so a false 'no' just costs one notice).
Source code in src/adda/_src/nodes/orchestration.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |
_drain_operator_notes() -> str
#
Operator notes queued by a human in the viewer, marked as coming from the operator; "" when none. Notes addressed to a RUNNING delegation are routed to that worker instead. Claims the queue destructively, so whatever calls this owns delivery.
Source code in src/adda/_src/nodes/orchestration.py
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | |
_drain_entry_notices() -> str
#
Notices a campaign process queued for the entry node (the oracle was edited, say); "" for any other node or when none. The entry node holds no delegation id, so the backends' post-tool hook never reaches its queue; its next tool call does.
Source code in src/adda/_src/nodes/orchestration.py
587 588 589 590 591 592 593 594 595 596 597 598 | |
_publish_escalation(offenders: list) -> None
#
Fire monitor_escalation (handoff spec P3b): the monitor's
escalation rule fired on offenders. Its record is the
MONITOR_ESCALATION row; subscribers are woken.
Source code in src/adda/_src/nodes/orchestration.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | |
_drain_notifications() -> str
#
Return and clear any pending push notifications, or empty string.
Source code in src/adda/_src/nodes/orchestration.py
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 | |
_delegation_entry(delegation_id: str) -> tuple[Any, dict] | None
#
(owning node, registry entry) of a delegation, or None.
The entry lives in the registry of the node that DELEGATED (its delegator), not of the node running the work; the tools a worker calls are bound to the worker's own node, so a worker looking up its own delegation must search across the graph's nodes. Delegation ids come from one graph-wide log, so at most one node owns an id.
Source code in src/adda/_src/nodes/orchestration.py
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 | |
_get_delegator_cond(identity: str) -> threading.Condition
#
The one Condition a given delegator identity waits on and is
woken through (SendMessage, spec 12). identity is a
delegation_id or "entry" — see __init__'s comment on
_delegator_conds. Lazily created, race-free.
Source code in src/adda/_src/nodes/orchestration.py
672 673 674 675 676 677 678 679 680 681 682 | |
_truncate_for_notice(text: str, n: int = 100) -> str
staticmethod
#
Source code in src/adda/_src/nodes/orchestration.py
684 685 686 687 | |
_pending_for_you(identity: str) -> str
#
What identity (a delegator: "entry" or a delegation id
of a node that is ITSELF delegating further) currently owes,
computed FRESH on every call -- never a drained queue, since
"nothing pending" must read as silence indefinitely, not just
until the first drain (spec 12 design item 10(a): "at minimum,
every agent must always KNOW what it currently owes ... or
nothing (in which case: silence, not a notice for its own
sake)").
Two kinds, both as a DELEGATOR (entry.get("parent") ==
identity -- never a sibling's or a nested child's): a report open
for review (OpenForReview), and a finished delegation
(Done/Errored) not yet collected via Wait. A SendMessage
is not listed here: messages travel on one path, the recipient's
pending notices, which every tool call drains (see
infra/pending_notices.post_message). Returns "" when none
apply -- the common case, deliberately silent.
Source code in src/adda/_src/nodes/orchestration.py
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 | |
_build_routing_closures() -> dict
#
Source code in src/adda/_src/nodes/orchestration.py
735 736 737 | |
_wrap_closure(fn: Any, node_name: str) -> Any
#
Return a version of fn that records ERROR returns and exceptions.
Uses functools.wraps so inspect.signature() follows wrapped to the original function — _infer_schema_from_callable must see the real parameter names, not (args, *kwargs).
Also coerces string-typed arguments to int/float/bool when the function annotation requests it (handles Ollama passing "5" for an int parameter).
And it is where pending notices reach the agent: whatever
_drain_notifications holds is APPENDED to the tool's result — after
it, so a result's leading word stays what callers dispatch on ("Done",
"Working", "ERROR:", an id like "H3"). That
used to be hand-copied into 18 tool bodies and missing from the rest —
the store tools never delivered a notice — so whether the agent heard
about a finished delegation depended on which tool it happened to
call. A tool that places notices itself (the status poll keeps its
status word first; Wait drains while it blocks; Done composes its own
reply) still does, and finds the queue already empty here. A
worker's closures pass through here too, and are never drained into.
Source code in src/adda/_src/nodes/orchestration.py
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 | |
_orchestrate(state: AgenticState) -> Any
#
One orchestration turn, in the order it happens.
Absorb the run state onto the node, work out what the agent must be
TOLD this turn, invoke it once, then route on what it did. Every step
is a method below, named for its step; a turn ends in exactly one of
three ways, which :meth:_route_turn states.
Source code in src/adda/_src/nodes/orchestration.py
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 | |
_register_entry_manifest() -> None
#
Register the oracle manifest an entry node wrote for its own work.
An entry node that runs evaluations itself (it holds an
entry_work stamp) has no datagenerator report to carry its
oracle. A registration.json it writes under
debug/delegations/<entry_work id>/generators/ is registered here,
at the end of its turn, through the same path a datagenerator report
uses. A manifest is processed again only when it changes.
Source code in src/adda/_src/nodes/orchestration.py
945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 | |
_absorb_state(state: AgenticState) -> None
#
Copy the run state the node's TOOLS read onto the node itself.
The closures reach their context through node.…, not through
AgenticState, so anything a tool needs has to land here first.
Source code in src/adda/_src/nodes/orchestration.py
980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 | |
_ledgered_eval_total(floor: int) -> int
#
The run's eval count, preferring the ledger over an accumulator.
The canonical ledger is the source of truth: a killed/cancelled
delegation flushes rows the state accumulator never sees, so the
accumulator undercounts. Summed across the canonical store AND every
design namespace — namespace evals were invisible to the run total and
to the soft budget. floor keeps the accumulator for lookup-direct
studies with no instrumented store.
Source code in src/adda/_src/nodes/orchestration.py
1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 | |
_budget_warnings(state: AgenticState) -> list[dict]
#
Advisory budget messages for this turn.
The budget rules (notices at budget_warn_from, the cutoff, the
wind-down; wall, tokens and evaluations alike) are in
nodes/time_rules.py and nodes/wind_down.py and reach the model as notifications.
Source code in src/adda/_src/nodes/orchestration.py
1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 | |
_reset_for_turn() -> list[str]
#
A1/A2: clear per-turn state; return the notifications to deliver.
Working entries are preserved so loopbacks don't orphan live delegations whose background threads are still running, and so are reports open for review (or being revised): finished work nobody has approved yet must stay approvable across a turn boundary.
Source code in src/adda/_src/nodes/orchestration.py
1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 | |
_compose_messages(state: AgenticState, budget_warnings: list[dict], pending_notifs: list[str]) -> list[dict]
#
The conversation plus everything injected in-band this turn.
Everything after the conversation itself is adda speaking to the agent — a budget warning, the no-source nudge, the milestone backlog, a pushed notification — arriving in the SAME role ("user") the human's own task arrives in. Marked, for the same reason tool-result notices are (nodes/notices.py): unmarked, neither the agent nor a reader can tell the runtime's nudge from the human's brief, and the viewer cannot style it as anything else.
Source code in src/adda/_src/nodes/orchestration.py
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 | |
_constraint_refresh() -> list[dict]
#
This turn's constraint snapshot, recomputed NOW.
The entry node used to be the one call site that did not re-snapshot.
agent_runtime rendered a snapshot once at run start and
concatenated it onto the problem statement, and that string is the
standing first user turn — re-sent verbatim on every later turn, so
the numbers inside it could never advance. Observed on run
20260917T141603: four consecutive strategizer turns spanning 23.5
minutes all read "2.7min/60.0min used (5%)", while the true figure at
turn 4 was 26.2min (44%).
The orchestrator was not blind -- every delegation report carries a
fresh snapshot (_append_budget_report) -- which made this a
CONTRADICTION rather than an absence: a frozen block and live blocks
in one context. Worse, the frozen copy lived in the first user turn,
which the context trim pins and never evicts, so it was the one
guaranteed to survive while the fresh ones aged out.
Recomputing per turn is what constraint_snapshot.py already asks
of every caller: "call this at every delegation boundary rather than
caching a value from earlier ... its entire purpose depends on being
current". The orchestrator is the node that decides how much more to
attempt, so it is the node that most needs the live clock.
Source code in src/adda/_src/nodes/orchestration.py
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 | |
_no_source_nudge() -> list[dict]
#
Recommend registering a canonical source (soft, ≤3×).
Whenever no source is registered, whatever the graph: any agent can author and register one (a delegation's generators/registration.json, or the entry node's own), so the reminder does not depend on a role being present. Without a registered source every evaluation lands off-ledger and nothing is reproducible from the canonical store. Soft and capped — never blocks; the strategizer may ignore it for a genuinely source-free study.
Source code in src/adda/_src/nodes/orchestration.py
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 | |
_backlog_announcement() -> list[dict]
#
Announce the process backlog ONCE, at the start of the run.
As a conversation message, so the agent cannot claim it didn't know these gate the implementer. Injected the first time this node runs.
Source code in src/adda/_src/nodes/orchestration.py
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 | |
_invoke_turn(messages: list[dict]) -> Any
#
Run one model turn and account for what it spent.
Source code in src/adda/_src/nodes/orchestration.py
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 | |
_thread_turn_block(messages: list[dict], trace: list, text: str) -> None
#
Append this graph-node turn to the node's thread (D1 rule 4): what arrived since its last reply, its calls and results, its reply.
Source code in src/adda/_src/nodes/orchestration.py
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 | |
_route_turn(state: AgenticState, ai_msg: Any) -> Any
#
A turn ends in exactly one of three ways.
- Work is still in flight → re-prompt, free (no attempt spent)
- It stopped without closing → re-prompt, bounded (3 attempts)
- Otherwise → the run ends
Reproduction is owned entirely by the Done() gate (it runs the controlled gate before any close and declares a FAILED run after a bounded number of sighted attempts — see RunNotebook(gate=True)), so there is no separate post-accept repro check here; this handles only deliverable presence and un-accepted termination.
Source code in src/adda/_src/nodes/orchestration.py
1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 | |
_reprompt_while_working(ai_msg: Any, accepted: bool, missing: list) -> Any | None
#
Delegations still running: re-prompt WITHOUT spending an attempt.
A healthy delegation still in flight is WORK IN PROGRESS, not a failed finish: the deliverables usually depend on its result, and it WILL report. Spending a bounded finish-attempt on it means a slow-but-healthy delegation (run-4: D004 at ~2.5 evals/s, ~100s from done, with wall budget to spare) burns 3 "finish attempts" across turns and force- terminates the run UNGATED. At the time budget the wind-down (nodes/wind_down.py) takes over and handles a delegation that truly hangs.
Source code in src/adda/_src/nodes/orchestration.py
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 | |
_reprompt_unfinished(ai_msg: Any, accepted: bool, missing: list) -> Any | None
#
Bounded re-prompt when the turn ended without an accepted close.
Source code in src/adda/_src/nodes/orchestration.py
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 | |
_is_entry_thread() -> bool
#
The entry node's conversation is messages; see graph_state.
Source code in src/adda/_src/nodes/orchestration.py
1450 1451 1452 1453 | |
_my_messages(state: AgenticState) -> list
#
This node's own conversation in the run state.
Source code in src/adda/_src/nodes/orchestration.py
1455 1456 1457 1458 1459 | |
_thread_update(msgs: list) -> dict
#
A state update that appends msgs to this node's conversation.
Source code in src/adda/_src/nodes/orchestration.py
1461 1462 1463 1464 1465 | |
_job_owner() -> str | None
#
The node that owns the job now (the entry until a handoff).
Source code in src/adda/_src/nodes/orchestration.py
1467 1468 1469 | |
_handoff_body(target: str, message: str) -> str
#
What the receiver reads after the handoff line. A node that holds Done receives work to accept or hand back: the message as the proposed conclusion, the job packet and the review rules, and during the wind-down what each answer does. Any other node reads the message.
Source code in src/adda/_src/nodes/orchestration.py
1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 | |
_can_own_job() -> bool
#
Whether the job can reach this node: it is the entry or a handoff target.
Source code in src/adda/_src/nodes/orchestration.py
1490 1491 1492 1493 1494 1495 1496 1497 1498 | |
_hand_off(ai_msg: Any) -> Any
#
End this turn by passing the job to the Handoff target.
Source code in src/adda/_src/nodes/orchestration.py
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | |
_actionable(notices: str) -> str
#
Only the notice lines this node can act on: a line that asks for a ledger write reaches only a node holding that write tool. Which events fire, and their text, are the monitor's; this is delivery.
Source code in src/adda/_src/nodes/orchestration.py
1546 1547 1548 1549 1550 1551 1552 1553 1554 | |
_holds(tool: str) -> bool
#
Whether this node was handed the adda tool tool.
Every text adda writes to a node names only tools the node holds.
Source code in src/adda/_src/nodes/orchestration.py
1556 1557 1558 1559 1560 1561 | |
_working_delegations() -> list[str]
#
Delegation ids still in flight right now.
Source code in src/adda/_src/nodes/orchestration.py
1563 1564 1565 1566 1567 1568 1569 | |
_terminate_run(state: AgenticState, ai_msg: Any, accepted: bool, missing: list, termination: str | None = None) -> Any
#
Close the run: final counts, banner, ghost flush, terminal Command.
Source code in src/adda/_src/nodes/orchestration.py
1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 | |
_banner(summary: str, accepted: bool, missing: list, stopped: str | None = None) -> str
#
Prepend the UNGATED banner when the run ends without an accepted Done().
A FAILED-reproduction close carries its own ⛔ banner in the route summary and IS accepted=done, so it is not re-banner'd here.
Source code in src/adda/_src/nodes/orchestration.py
1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 | |
_flush_ghost_delegations() -> None
#
Close out delegations whose threads die with the interpreter.
Daemon threads still alive when the run closes are killed at process exit — their run() never reaches the DONE/FAILED record write, leaving orphan RUNNING entries in the log. Write an INTERRUPTED terminal record for each so query_all() (last-wins) collapses to a closed state instead of RUNNING.
Source code in src/adda/_src/nodes/orchestration.py
1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 | |
_missing_deliverables(state: AgenticState) -> list[str]
#
Return required deliverable paths not present at study_dir yet.
Source code in src/adda/_src/nodes/reproduction_gate.py
54 55 56 | |
_deliverable_status(state: AgenticState) -> tuple[list[str], list[str]]
#
(present, missing): the required deliverables at study_dir.
The single deliverable (pipeline.ipynb) is required, authored before Done() is accepted, UNLESS the study turns off pipeline_deliverable — it is the human-readable recipe AND the reproduction in one notebook: the runtime executes it lazily (see _reproduction_gate) to verify the headline re-derives from the ledger with zero new evals, which makes no sense for a study with no ledger at all. Requiring it unconditionally (BACKLOG #30) meant a pure-derivation study's strategizer could never satisfy Done() regardless of what its own tools/prompt said — this was the third of three places that assumption was baked in (the other two, the deliverable [[include]] blocks and the notebook-authoring tools themselves, are already gated the same way). Additional paths can still be declared in state['required_deliverables'] regardless of this flag.
Source code in src/adda/_src/nodes/reproduction_gate.py
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 | |
_graph_authors(tools: frozenset) -> bool
#
True when some node in the graph holds one of tools (a node
with no declared toolset counts). Without a graph, this node.
Source code in src/adda/_src/nodes/reproduction_gate.py
104 105 106 107 108 109 110 111 112 113 114 | |
_reproduction_gate(state: AgenticState | None = None) -> str | None
#
Before Done() can close a run — and on every RunNotebook(gate=True) dry run — pipeline.ipynb must satisfy every one of these, checked in order. This is a MECHANICAL check this exact function executes every time, not a judgement call, and nothing narrative or intent-based can satisfy it in a check's place.
- The canonical store must already hold at least one oracle row. Zero rows means no campaign has been evaluated yet, so there is nothing for the notebook to reproduce FROM — the gate refuses outright, before even running the notebook.
- The notebook must finish cleanly within a time ceiling (no heavy from-scratch computation — a reproduction is lazy, not a re-run).
- It must add ZERO new oracle rows: it may only LOAD the ledger
(
ExperimentData.from_file) and reach the oracle throughget_evaluator(), which skips every already-FINISHED row. - It must NOT modify or delete any existing ledger row — no faking a zero-delta by delete-then-re-add or by rewriting a value.
- The notebook prints a freshly-computed
REPRODUCED: <value>and theCLAIMED_HEADLINE: <value>its write-up states. The gate fails the notebook when the two differ. It does not fail a notebook for a missing print.
Passing (0)-(4) means the deliverable is a faithful, lightweight, lazy reproduction of a real, already-evaluated campaign — not a script doing something unrelated to validating the pipeline.
Source code in src/adda/_src/nodes/reproduction_gate.py
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 | |
_halt_resumable(state: Any, *, reason: str, termination: str, status: str = 'halted', extra_update: dict | None = None)
#
Checkpoint-and-halt cleanly on an unrecoverable condition.
Instead of crashing, write debug/run_status.json (so tooling and
the human can see the run is resumable) and return a Command to
END whose last_report is prefixed with a HALTED banner. The
durable SqliteSaver checkpoint + the persisted thread_id are what
make the run resumable via AgenticRun(resume_from=...) — no new
serialized state is introduced here.
termination names WHICH unrecoverable condition fired. It is
carried on the state so the close path records it verbatim instead of
inferring an outcome from the HALTED banner — which matched none of the
old banner patterns and so read as GATED, logging every backstop kill
as a validated success.
Source code in src/adda/_src/nodes/lifecycle.py
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 | |
_reviewed_so_far() -> bool
#
Whether a node that was handed the job has reviewed it in this run (a review round, on any node). A close that ends the run without an acceptance (a halt, a stop, a failed reproduction) still records a review that took place.
Source code in src/adda/_src/nodes/lifecycle.py
104 105 106 107 108 109 110 | |
_halt_tallies(state: Any) -> dict
#
Source code in src/adda/_src/nodes/lifecycle.py
112 113 114 115 116 117 118 119 | |
_close_after_wind_down_error(state: Any, exc: Exception)
#
The turn that was to close a wind-down raised. The run closes anyway, with the halt's own termination, and says which retrospectives it lacks.
Source code in src/adda/_src/nodes/lifecycle.py
121 122 123 124 125 126 127 128 129 | |
_trip(state: Any, *, drift: dict, reason: str, termination: str, tallies: dict) -> Command | None
#
A backstop condition holds. Ask the run to wind down — every agent
gives its retrospective, the run closes with termination — instead of
jumping to END with none. While the wind-down is in progress this
returns None (the condition keeps holding; that is expected). Only a
wind-down that overruns its grace, or one that cannot be asked for,
falls through to the hard halt, so a halt is always bounded.
Source code in src/adda/_src/nodes/lifecycle.py
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 | |
_check_unrecoverable(state: Any, budget: float | None, start: float | None) -> Command | None
#
Return a halt Command if an unrecoverable condition is met, else None. Extracted verbatim from call (USD ceiling → repeated errors).
Source code in src/adda/_src/nodes/lifecycle.py
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 | |
_persist_review(text: str) -> str | None
#
Record one review round by the node that closes the run: its Done
summary (accepting) or its Handoff message (handing back), as the
next critic_reviews/call_NNN.md. Returns the file name.
Source code in src/adda/_src/nodes/review_records.py
68 69 70 71 72 73 74 75 76 77 78 79 | |
_cited_delegation_brief(evidence: dict | None) -> str | None
#
A short brief on the cited delegation — what it was asked to do and
whether it was flagged a falsification attempt — so the judge can weigh
§2 attempt-adequacy. The numeric result the verdict rests on is carried
separately in evidence['numbers']. None if no delegation is cited or
the record is absent.
Source code in src/adda/_src/nodes/review_records.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
_persist_critic_brief(n: int, brief: str) -> dict | None
#
Write the critic's full brief; return {file, sha256} or None.
Source code in src/adda/_src/nodes/review_records.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
_persist_critic_review(n: int, critique_text: str) -> str | None
#
Write the critic's full review to debug/critic_reviews/ so the review is auditable whether it accepted or handed back. Best-effort. Returns the file name written (the caller's delegation row records it), or None when nothing was written.
Source code in src/adda/_src/nodes/review_records.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
_record_usage(usage: dict, *, model: str | None, phase: str | None, delegation_id: str | None, node: str | None = None) -> None
#
Accumulate token totals (decision path) AND emit one telemetry row
(additive, off the decision path). Telemetry failures are swallowed
inside record_call so they can never break a run.
Source code in src/adda/_src/nodes/recording.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
_run_nodes() -> list
#
This node and every other live node of the run, each once.
Source code in src/adda/_src/nodes/recording.py
88 89 90 91 | |
_run_telemetry() -> Any
#
The run's telemetry sink. Only the node that owns the run's notes directory has one, but a worker's usage is recorded at ITS delegator, which is any node that delegates (a sub-delegator owns none).
Source code in src/adda/_src/nodes/recording.py
93 94 95 96 97 98 99 100 | |
_run_token_totals() -> dict
#
Token totals of the whole run: every node records the usage of its own delegations, so the run's total is their sum, not one node's.
Source code in src/adda/_src/nodes/recording.py
102 103 104 105 106 107 108 109 110 | |
_run_spend_usd() -> tuple[float, bool]
#
(spend, observed) over the whole run: the SDK's cost plus the
list-price estimate for calls it sent none for, and whether any node
saw a cost at all.
Source code in src/adda/_src/nodes/recording.py
112 113 114 115 116 117 118 119 120 121 | |
_accumulate_usage(usage: dict, model: str | None = None) -> None
#
Thread-safe accumulation of token counts from adapter.last_usage.
Source code in src/adda/_src/nodes/recording.py
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 | |
_record_tool_error(node_name: str, tool_name: str, error_type: str, message: str, tb: str | None = None, args: dict | None = None, fault: str | None = None) -> None
#
Increment error counter and append to diagnostics.jsonl (thread-safe).
fault overrides the classification (the caller knows the agent
passed an argument of the wrong type).
args are the call's arguments; each value is capped at 2,000 chars.
Source code in src/adda/_src/nodes/recording.py
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 | |
_record_llm_retry(attempt: int, max_attempts: int, exc: BaseException, delay: float, resumed: bool | None = None) -> None
#
One diagnostics.jsonl row per transient-error retry of an LLM call.
Not an error (no _error_counts bump): the call is retried and may
succeed. The row exists so a retry is visible -- how often, which
exception, how long the backoff -- instead of silent. resumed
(backends that retry a whole session): True when the retry continues
the failed session, False when it starts again from the brief.
Source code in src/adda/_src/nodes/recording.py
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 | |
_record_retrospective(node: str, source_id: str, report_text: str, deliverable_version: int | None = None) -> None
#
Capture a node's end-of-life ### Retrospective.
Every node has a 'my job is done' moment — workers at delegation completion, the strategizer (and any future orchestrator) at Done(). Parse the section, persist to retrospectives.jsonl, and surface a diagnostic + strategizer notification the instant it flags contradictory system instructions (the cheapest, highest-value failure mode to catch). Best-effort; never raises.
A Done() call that ACTUALLY ARRIVED with non-empty text is always
recorded here, even when _extract_report_section fails to find
a ### Retrospective heading in it — never silently dropped. Only
genuinely empty text (nothing submitted at all) returns without
writing anything. This matters because write_fallback_retrospective
(infra/watchdog_cleanup.py) trusts "no entry for this node in
retrospectives.jsonl" to mean "the retrospective never arrived" and
synthesizes a claim saying so; if a real, substantive reply arrived
but merely failed to parse (run 20260926T124841's regex bug, now
fixed — see _extract_report_section), silently dropping it here made
that downstream claim FALSE — the run's own record said a retrospective
"never arrived" when one, in fact, had. Recording a parse-failure
entry (with the raw text preserved) keeps that claim honest without
needing write_fallback_retrospective itself to know the difference.
Source code in src/adda/_src/nodes/recording.py
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 | |
_record_intervention(kind: str, target: str, message: str, *, fault: str = 'nudge', **extra) -> None
#
Log a scientific-correction event (a nudge/bounce firing) to
diagnostics.jsonl — direct evidence the self-healing layer acted,
and, when extra carries before/after state, whether it worked.
Neutral classification: fault='nudge' — a nudge is a correction, not
an agent error, so this must NOT bump the error/escalation counters
(unlike _record_tool_error). fault='observation' is for a row that
only records what was seen (adda said nothing to the agent); it also
bumps no counter. Best-effort; never raises.
Source code in src/adda/_src/nodes/recording.py
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 | |
_record_science_drift(payload: dict) -> None
#
Append a SCIENCE_DRIFT record to diagnostics.jsonl.
Source code in src/adda/_src/nodes/recording.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | |
_raise_if_abandoned() -> None
#
End the calling thread once the run has stopped waiting for it.
Source code in src/adda/_src/nodes/node.py
187 188 189 | |
_init_recording() -> None
#
Establish the state RecordingMixin writes to, on EVERY node.
Recording is a property of a node — any node's tools can return an
ERROR, and any node's adapter reports token usage — so its substrate
belongs here rather than in one behaviour's setup. It used to be
created only by the orchestration setup, which was invisible while
leaves were a separate class that did not carry RecordingMixin at all:
the moment a leaf reached any recording call it raised AttributeError
on _registry_lock. The orchestration setup still assigns these
itself, to the same values, so an orchestrating node is unchanged.
Source code in src/adda/_src/nodes/node.py
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 | |
_init_capabilities(*, study_dir: Any = None, workspace_dir: Any = None, delegation_log: DelegationLog | None = None, report_sections: tuple[str, ...] | None = None, agent_tools: frozenset[str] | None = None) -> None
#
Wire this node's sandboxed Write and its declared read-only tools.
Runs for EVERY node, not only one reachable as a standalone entry
point — see the module docstring: whichever node ends up as someone
else's Delegate() target is dispatched through a copy of THIS adapter
(adapter.copy() carries the closure_tools set here), so this is where a
dispatched specialist's baseline capabilities actually come from,
before WorkerSession.install_worker_tools/_sandbox_worker_writes
layer the per-delegation overrides (ReportEvals's own record callback,
a delegation-scoped Write) on top.
Source code in src/adda/_src/nodes/node.py
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 | |
unit_folder(unit_id: str) -> Path | None
#
debug/delegations/<unit_id>/: the folder of one unit of work
(a delegation D###, a tenure X###, a wake W###), created here.
Source code in src/adda/_src/nodes/node.py
301 302 303 304 305 306 307 308 | |
scope_write_to(adapter: Any, unit_id: str) -> None
#
Confine adapter's Write to this unit's folder, as a delegated
worker's is: one rule for every unit of work. No-op when the node
has no sandboxed Write.
Source code in src/adda/_src/nodes/node.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | |
_setup_sandboxed_write() -> None
#
Replace native Write with a workspace-sandboxed closure.
Removes 'Write' from native_tools so the SDK doesn't expose it,
then installs the same builder a dispatched worker gets
(:func:build_sandboxed_write), scoped to this node's whole
workspace instead of one delegation's subfolder — a node reached via
real graph routing (the module docstring) has no delegation_id of
its own to scope tighter than that.
Bash is kept native but cwd is already set to study_dir by the adapter; the prompt further constrains it to the workspace.
Source code in src/adda/_src/nodes/node.py
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 | |
_build_eval_closures() -> dict
#
Source code in src/adda/_src/nodes/node.py
374 375 376 377 378 379 380 381 382 | |
_commit_workspace(message: str) -> str | None
#
Commit the run workspace and return the sha (spec 11).
On Node rather than on WorkerSession because a delegation is recorded
from several places, not one: a worker finishing (ok or error), a
tenure closing (routing/handoff.py), and the close-time
reconciliation of a delegation still running when the run ended. Every
one of them appends a row to the delegation log, so every one of them
owes that row a sha — otherwise workspace_sha: null means both
"this delegation changed nothing" and "nobody looked", which is the
ambiguity --allow-empty exists to prevent.
The interrupted case is the one with teeth: a delegation killed mid-flight never reaches _finish_ok/_finish_error, so its partial file writes stay uncommitted and are swept into whichever delegation commits NEXT — attributing one delegation's work to another. Silence would be better than that; a commit is better still.
Never raises — see infra/workspace_vcs.
Source code in src/adda/_src/nodes/node.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | |
_resolve_run_dir() -> Path | None
#
Best-effort run_dir, valid on any node.
Every node's _current_notes_dir is set at construction (from
notes_dir, passed to every node — see graph_builder.py) and
re-pointed each turn by _absorb_state if the run's real notes dir
differs. It can still be None (e.g. a bare Node() built
without one, as in unit tests) — every node DOES hold the shared
delegation log at run_dir/debug/delegation_log.jsonl, so derive
run_dir from that when the notes dir is unavailable.
Source code in src/adda/_src/nodes/node.py
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | |
_read_ledger() -> HypothesisLedger | None
#
The hypothesis ledger for READ access, resolved on any node.
Returns the node's own bound ledger when it has one (the entry node); otherwise resolves a read-only view from the run's strategizer_notes when hypotheses.json exists. HypothesisLedger.init performs no I/O, and only READ callers use this, so there is no write race with the entry node that owns the file.
Source code in src/adda/_src/nodes/node.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | |
adda.build_graph(spec: Graph, make_adapter: Callable[[str, Agent], Any], checkpointer: Any = None, study_dir: Any = None, interactive: bool = False, max_ask: int = 1, notes_dir: Any = None, workspace_dir: Any = None, delegation_log: DelegationLog | None = None, node_registry: dict[str, Any] | None = None, topology: Any = None, *, check: bool = True) -> Any
#
Build and compile a LangGraph StateGraph from a Graph spec.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
Graph
|
Agent graph specification (nodes, edges, entry). |
required |
make_adapter
|
callable
|
|
required |
checkpointer
|
any
|
LangGraph checkpointer. Defaults to an in-memory :class: |
None
|
delegation_log
|
DelegationLog
|
Graph-wide delegation log for episodic memory (RecallHistory tool). |
None
|
node_registry
|
dict
|
If given, populated in place with |
None
|
topology
|
Topology
|
The run's runtime topology ( |
None
|
check
|
bool
|
Run :func: |
True
|
Returns:
| Type | Description |
|---|---|
CompiledGraph
|
A compiled LangGraph graph ready to invoke. |
Source code in src/adda/_src/runtime/graph_builder.py
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 | |
Run state#
The types that move through the graph while it runs. You rarely construct these yourself; they are what you see in a transcript or a checkpoint.
adda.AgenticState
#
LangGraph state for one agentic run.
Inherits messages: Annotated[list[AnyMessage], add_messages]
from :class:~langgraph.graph.MessagesState.
Source code in src/adda/_src/runtime/graph_state.py
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 | |
study_dir: str
instance-attribute
#
done: bool
instance-attribute
#
last_report: str | None
instance-attribute
#
total_delegations: int
instance-attribute
#
budget_seconds: float | None
instance-attribute
#
budget_usd: float | None
instance-attribute
#
run_dir: str | None
instance-attribute
#
eval_budget: int | None
instance-attribute
#
evals_used: int
instance-attribute
#
start_time: float | None
instance-attribute
#
required_deliverables: list | None
instance-attribute
#
token_totals: dict | None
instance-attribute
#
error_counts: dict | None
instance-attribute
#
experiment_data_dir: str | None
instance-attribute
#
outcome: str | None
instance-attribute
#
termination: str | None
instance-attribute
#
reviewed: bool | None
instance-attribute
#
threads: Annotated[dict, merge_threads]
instance-attribute
#
owner: str | None
instance-attribute
#
adda.StudyConfig
dataclass
#
Lightweight config loaded from the study directory.
Source code in src/adda/_src/runtime/graph_state.py
96 97 98 99 100 101 102 | |
adda.Task
dataclass
#
A unit of work delegated from one agent to another.
Source code in src/adda/_src/runtime/graph_state.py
66 67 68 69 70 71 72 | |
adda.Report
dataclass
#
The result returned by an implementer agent.
Source code in src/adda/_src/runtime/graph_state.py
75 76 77 78 79 80 | |
adda.Delegation
dataclass
#
A delegation request parsed from an agent's response.
Source code in src/adda/_src/runtime/graph_state.py
83 84 85 86 87 88 89 90 91 92 93 | |