Documentation
¶
Overview ¶
Package handexec implements dispatch-mode execution for the harness binary. Spawned as a fresh subprocess by the dispatcher; reads the dispatch request from stdin; invokes the configured provider; writes a DispatchResultPayload JSON envelope to stdout; exits.
Per hand-dispatch v0.1: workers are interchangeable subprocess slots drawn from a shared pool. Each worker boots loaded with the dispatching aspect's identity framing (NEXUS.md / SOUL.md / PRIMER from the aspect home). There are no per-aspect named hands and no per-hand config — the persona inherited from the dispatching aspect IS the slot's persona for the duration of one dispatch.
One-shot lifecycle by design — no reconnect loops, no persistent state. Any aspect-owned credentials live in the aspect home and are loaded per-invocation.
NOTE (§6.5): identity-bundle loading (NEXUS.md / SOUL.md / PRIMER → composed system prompt) lives behind the Frame harness work. v0.1 keeps the spawn machinery in place but currently invokes the provider with the dispatch payload directly; the identity-framing composition lands when the Frame harness ports identity loaders here.
The package directory name (`handexec`, parent `nexus/handqueue`) is legacy and kept per spec §9 amnesty — only identifiers and types inside have moved to the generic vocabulary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(ctx context.Context, aspectHome string, aspect schemas.AspectConfig, provider providers.Provider) error
Run reads a Request from stdin, executes a single dispatch turn against the aspect's configured provider, writes a DispatchResultPayload to stdout as JSON, returns.
On error, writes a minimal DispatchResultPayload with Error set, plus returns an error so the caller process can exit non-zero.
`aspectHome` is the on-disk home for the dispatching aspect — the identity-loading layer (§6.5) consumes this; for now we accept it but only forward the dispatch payload to the provider.
Types ¶
type Request ¶
type Request struct {
Aspect string `json:"aspect"`
Thread string `json:"thread,omitempty"`
DispatchID string `json:"dispatch_id,omitempty"`
Payload map[string]any `json:"payload"`
}
Request is the JSON shape the harness dispatch-mode reads from stdin. Mirrors the body fields of frames.DispatchPayload.