fractal package#
Subpackages#
- fractal.cli package
- Subpackages
- fractal.cli.cmd package
- Submodules
- fractal.cli.cmd.channel module
- fractal.cli.cmd.config module
- fractal.cli.cmd.cost module
- fractal.cli.cmd.db module
- fractal.cli.cmd.event module
- fractal.cli.cmd.fractal module
- fractal.cli.cmd.node module
- fractal.cli.cmd.plan module
- fractal.cli.cmd.radio module
- fractal.cli.cmd.time module
- Module contents
- fractal.cli.cmd package
- Submodules
- fractal.cli.main module
- fractal.cli.utils module
- Module contents
- Subpackages
- fractal.core package
- Submodules
- fractal.core.agent module
command_base()resolve()register()supported()InvocationStreamEventStreamResultStreamParserAgentAgent.nameAgent.config_fileAgent.can_forkAgent.mints_sessionAgent.needs_pricingAgent.cost_scopeAgent.enforces_budgetAgent.results_per_stepAgent.providersAgent.partsAgent.config_dirAgent.err_pathAgent.providerAgent.loggerAgent.log()Agent.invocation()Agent.spawn()Agent.parser()Agent.stream()Agent.record_session()Agent.record_cost()Agent.tracks_cost()Agent.config_model()Agent.transcript()Agent.preflight()Agent.seed()Agent.on_call()Agent.on_call_success()Agent.on_call_failure()Agent.on_spawn()Agent.on_action()Agent.on_session()Agent.on_record_session()Agent.on_record_cost()Agent.on_budget()Agent.on_error()Agent.on_preflight()
seed_agents()AgentCallEventAgentCallSuccessEventAgentCallFailureEventAgentSpawnEventAgentActionEventAgentSessionEventAgentCostEventAgentBudgetEventAgentErrorEventAgentPreflightEvent
- fractal.core.commit module
- fractal.core.config module
- fractal.core.cost module
- fractal.core.db module
- fractal.core.event module
- fractal.core.files module
- fractal.core.loop module
- fractal.core.node module
NodeNode.is_userNode.dbNode.radioNode.configNode.costNode.filesNode.plansNode.recordNode.sessionsNode.timeNode.loggerNode.log()Node.branchNode.worktreeNode.repo_dirNode.node_dirNode.project_pathNode.parentNode.tmux_sessionNode.resolve_caller()Node.resolve_user()Node.exists()Node.init()Node.start()Node.attach()Node.finish()Node.finish_cancel()Node.stop()Node.kill()Node.pause()Node.resume()Node.pause_latched()Node.merge()Node.delete()Node.deregister()Node.reconcile()Node.retire()Node.unretire()Node.destroy()Node.reset()Node.status()Node.status_display()Node.status_set()Node.title_set()Node.list()Node.child_add()Node.child_update()Node.child_retune()Node.child_list()Node.child_approve()Node.child_pending()Node.commit()Node.agent()Node.chat()Node.chat_command()Node.render_template()Node.build_prompt()Node.agent_effective()Node.provider_effective()
node_dir()tmux_session_name()
- fractal.core.plan module
- fractal.core.pricing module
- fractal.core.radio module
RadioRadio.nodeRadio.dbRadio.init()Radio.send()Radio.unsend()Radio.messages()Radio.sent()Radio.feed()Radio.read()Radio.thread()Radio.reply()Radio.react()Radio.save()Radio.unsave()Radio.saved()Radio.channel()Radio.channel_delete()Radio.channels()Radio.subscribe()Radio.unsubscribe()Radio.subs()
- fractal.core.record module
RecordRecord.nodeRecord.dbRecord.resolve_context()Record.close_open()Record.run_start()Record.run_end()Record.run_open()Record.run_latest()Record.run_branches()Record.iter_start()Record.iter_end()Record.step_start()Record.step_cost()Record.step_session()Record.step_end()Record.step_pending()Record.step_approve()Record.step_approved()Record.event_start()Record.event_end()Record.signal_get()Record.signal_set()Record.signal_clear()Record.runs()Record.iters()Record.steps()Record.events()Record.signals()Record.activity()
- fractal.core.render module
- fractal.core.session module
- fractal.core.time module
- fractal.core.worktree module
- Module contents
- fractal.impl package
- fractal.util package
Submodules#
fractal.constants module#
Constants for fractal.
- fractal.constants.FRACTAL_FOLDER = '.fractal'#
fractal data directory at the repo root
- fractal.constants.WORKTREES_FOLDER = '.worktrees'#
directory holding the per-node git worktrees
- fractal.constants.PROJECT_FOLDER = '.project'#
immutable project-layout cache under the worktrees directory
- fractal.constants.CONFIG_FILE = 'config.json'#
per-node configuration file in the node’s data directory
- fractal.constants.DB_FILE = '.db'#
central SQLite database file in the root node’s data directory
- fractal.constants.LOCK_FILE = '.lock'#
lock filename, standalone or as a suffix, serializing concurrent access
- fractal.constants.PAUSE_ABORT_FILE = '.pause_abort'#
marker signaling the running loop to abort into a pause
- fractal.constants.PAUSED_FILE = '.paused'#
tree-wide pause marker beside the central database
- fractal.constants.PGID_FILE = '.pgid'#
process group id of the running loop
- fractal.constants.SESSION_FILE = '.session'#
agent session records for the node
- fractal.constants.SOCKET_FILE = '.socket'#
tmux server socket path of the session running the loop
- fractal.constants.STATUS_FILE = '.status'#
the node’s current lifecycle status
- fractal.constants.STEP_PGID_FILE = '.step_pgid'#
process group id of the running step
- fractal.constants.STATUSES = ('active', 'paused', 'idle', 'completed', 'stopped', 'exited', 'killed', 'failed', 'retired')#
lifecycle status set shared by the node status file and the record rows
- fractal.constants.EVENTS = ('init', 'spawn', 'commit', 'approve', 'merge', 'delete', 'orphan', 'start', 'finish', 'finish_cancel', 'stop', 'kill', 'pause', 'resume', 'retire', 'unretire')#
point-in-time event kinds recorded on the node record
- fractal.constants.PRIORITY_MIN = 0#
lowest radio message priority
- fractal.constants.PRIORITY_MAX = 10#
highest radio message priority
fractal.exceptions module#
Exceptions for fractal.
- exception fractal.exceptions.AbstractMethodError(class_or_instance, /, methodtype='method')[source]#
Bases:
NotImplementedErrorSubclass of
NotImplementedErrorfor abstract methods.To be used when not using the
abcmodule. (adapted frompandas.errors).- Parameters:
self (
AbstractMethodError)class_or_instance (
type|object)methodtype (
str)
Initialize
AbstractMethodError, validatingmethodtype.- Parameters:
self (
AbstractMethodError)class_or_instance (
type|object)methodtype (
str)
- exception fractal.exceptions.AgentStreamError[source]#
Bases:
RuntimeErrorRaised when an agent reports a failure on its own JSON stream.
Distinct from a fractal-side stream-consumer failure: the agent drained cleanly (exit 0) but its events named an error, so the loop books the step as an agent error, not a
stream error.
fractal.typing module#
Type hints for fractal.
- fractal.typing.PathLike = str | os.PathLike#
filesystem path accepted at boundaries
- fractal.typing.Row#
database row (a sqlite3.Row surfaced as a plain dict)
alias of
dict[str,Any]
Module contents#
The fractal package.
Hierarchical agent loops with recursive self-organization.