Skip to content

bide v0.11.0

Choose a tag to compare

@github-actions github-actions released this 04 Oct 01:54
· 22 commits to main since this release
3135a0f

The API under its new names.

v0.11.0 completes the API redesign's rename: the transitional names of v0.10.0 become the API, and the old API they stood beside is gone. One way to build an agent, one way to run it, one journal type, one tool interface. The protocols the formal models check are unchanged; what changes is the surface, a few refusals that turn silent mistakes into errors when the agent is built, and audit anchoring after every write.

  • One way to build and run. agent.New(model, journal, opts...) returns (*Agent, error) and checks every configuration problem up front. Run, Stream, Resume, RunTyped and Session.Send/SendOnce take a Message and run options and return a *Result; a saga is Run(..., WithSaga()).
  • One journal type. Every function that took a Durable takes a *agent.Journal (agent.NewJournal(store)), and the journal verbs are its methods: j.Step, j.Parallel, j.Signal, j.Enqueue, j.AnswerInterrupt. A store wrapper wraps the Store, and implements Unwrap() Store when it passes keys through.
  • One tool interface. A tool is Spec() ToolSpec and Call. A decorator that embeds a tool inherits its spec, approval gate and timeout included, and overrides in its own Spec.
  • Mistakes refused when the agent is built. A tool with a Safety(), Name(), Description() or ArgsSchema() method that disagrees with its Spec (an override written for the old interface, which nothing reads any more) is ErrConfig from New and from a plan flow, so a decorator's own side effect is never re-run on resume.
  • Audit anchoring after every write. audit.AuditedStore wraps a Store and anchors after every insert, a write that committed while reporting an error included; a write it cannot anchor (its context ended first, or the publish failed) is reported to OnError when one is set, and AuditedStore.Reanchor anchors that run later.

API changes:

  • Build is New(model, journal, opts...) (*Agent, error); the old New(model, store, tools...) and the builder methods (Use, UseTool, WithMaxTurns, SetMaxConcurrency, ...) are removed: pass the options to New, or derive a copy with With.
  • RunMessage, StreamMessage, ResumeRun, RunTypedMessage and Session.SendMessage/SendMessageOnce are Run, Stream, Resume, RunTyped and Session.Send/SendOnce. The string entry points (Run and Stream on a string, RunSaga, RunResult, RunSagaResult, StreamSaga, RunTypedNative, AgentStream.Final) are removed. AgentStream and AgentEvent are RunStream and RunEvent; audit.Record is audit.RecordStream.
  • The Durable interface and the stores' Do, History and Journal shims are removed; use *Journal. Step, Parallel, Signal, Enqueue (the channel Send) and AnswerInterrupt (Resume[T]) are *Journal methods.
  • PendingApproval, Interrupted, Awaiting, Sleeping and ResumeHalt are ApprovalPending, InterruptPending, SignalPending, TimerPending and OutcomeUnknown; ResolveHaltRef is ResolveHalt; ResolveStepHalt and ApproveAs are removed.
  • ContextWithIdentity, ContextWithWaker and ContextWithClock are removed: pass WithIdentity, WithWaker or WithClock as a run option. WithIdentity refuses an empty identity.
  • The Tool interface is Spec() and Call; Name, Description, ArgsSchema, Safety and SpecOf are gone. Func takes its safety as WithSafety; Func, CompensatedFunc, SubAgent and RetrievalTool return (Tool, error), with MustFunc, MustCompensatedFunc, MustSubAgent and MustRetrievalTool that panic instead.
  • New refuses a tool whose old-interface method disagrees with its Spec; plan flows refuse it too.
  • Package mcp is mcptools (github.com/bide-ai/bide/mcptools).
  • The scripted model and its turns are in agent/agenttest, with new helpers: MemJournal, MustJournal, MustNew, Must, Answer and IdentityContext.
  • plan's Register* functions are methods of *plan.Registry.
  • Run on a run journaled as a saga drives it as the saga, without WithSaga.
  • audit.AuditedStore wraps a Store, anchors after every insert but the header's, and gains Reanchor(ctx, runID); cmd/bide-audit refuses an export that does not start with a journal header.

The CHANGELOG has the details of each change.

Install:

go get github.com/bide-ai/bide@v0.11.0

Library modules, at the same version:

go get github.com/bide-ai/bide/store/sqlite@v0.11.0
go get github.com/bide-ai/bide/store/postgres@v0.11.0
go get github.com/bide-ai/bide/mcptools@v0.11.0
go get github.com/bide-ai/bide/trace@v0.11.0
go get github.com/bide-ai/bide/codec/gcf@v0.11.0
go get github.com/bide-ai/bide/govern@v0.11.0
go get github.com/bide-ai/bide/govern/sqlitelog@v0.11.0
go get github.com/bide-ai/bide/govern/redislog@v0.11.0
go get github.com/bide-ai/bide/govern/postgreslog@v0.11.0

Docs: https://bide-ai.com. Formal models: spec/tla and the formal verification overview.