@projectpac/core-intelligence
v0.6.0
Published
Part of PAC: @projectpac/core-intelligence.
Readme
@projectpac/core-intelligence
Claims ctx.intelligence. The node's intelligence, as a queue rather than a
call: a plugin starts a run, appends turns to it, and each turn's result
arrives later as a core/turn-settled event in the plugin's own context,
carrying the executor's text exactly as it was produced.
The kernel decides nothing about what a run means. A run carries a payload for its executor and metadata for its caller; the kernel stores both and reads neither. It composes no prompt, parses no output, enforces no budget. What an output means is the caller's business, and what a payload means is the executor's.
One store, one process. The daemon mounts this service; the worker never opens the store. A worker asks for work over the control api -- claim, renew, settle -- naming the executor rows it carries, and is handed the oldest pending turn for one of them. Every claim is also its sign of life.
One running turn per run. A run is a conversation and its turns have an order, so a turn is claimable only once every earlier turn of its run has settled. How many turns a node runs at once is the workers' business.
A turn is claimed exactly once. A holder renews a lease while it works; when the lease lapses the turn is failed as interrupted, never re-queued, because a model was spawned for it and nobody knows what it did. The caller retries by appending a new turn, and decides how many times.
A failed turn is not a failed run. Runs are open until their caller closes them. Closing drains the queue -- pending turns fail without an event -- and lets a running turn finish and report.
Each turn is announced once. The event goes to the plugin that started the run, and only to it. The turn is marked dispatched after the handler returns whether it resolved or threw; a throw is traced, not retried. Nothing is announced until the daemon says the plugins have mounted, so a turn that settled while the daemon was down is not told to an empty scope.
