basamento

module
v0.0.0-...-ecee8c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0

README

Basamento

A Go foundation for durable agent and flow orchestration. Flows are data, checked with CEL and run on a runtime-neutral durable contract. Models are addressed by capability (chat, embeddings, image, video, audio) and reached through generic HTTP API and CLI providers, in process or on workers that declare what they serve. Runs outlive client connections. It ships as one pure-Go binary that embeds everything for self-hosting, and swaps to cloud services for SaaS.

Status: foundation stage. Contracts, conventions, specs and the gate are in place; core identifiers, JSON Schema (core/schema, WP-L2-02) and the flow IR and compiler (flow/ir, flow/compile, WP-L4-01) are implemented. Everything else is specified and planned in docs/roadmap/.

How this repository works

Coding agents build Basamento, guided by executable specs:

  1. Requirements (EARS) and scenarios (Gherkin) live in specs/.
  2. A reviewer agent approves them and assigns a priority tier. People review later, P0 first. Approved text is locked in each capability's spec.lock.yaml.
  3. Implementers turn @planned scenarios green. make gate is the single definition of done.

Start with AGENTS.md, then specs/constitution.md and docs/architecture/overview.md.

Requirements

  • Go 1.26.11 or newer (repository minimum pin, ADR-0014, including the net/http advisory fix). make gate sets GOTOOLCHAIN to that patch from the root go.mod unless you already exported it; with an older toolchain, Go may still download the required patch.
  • Optional locally (required in CI): golangci-lint v2, buf, govulncheck, go-licenses; make tools installs them.

Commands

make gate                          # the full PR gate (skips missing optional tools locally)
make bdd                           # run scenarios
go tool gate wp               # every work package: done, in-progress, ready or blocked
go tool gate spec queue       # specs awaiting human review, P0 first
go tool gate spec trace       # requirement → scenario matrix
go tool gate nightly          # scheduled nightly ok, failed or stale (gh JSON on stdin)

Layout

Path Contents
core/ ids, clock, errors, JSON Schema (implemented); core/coretest test-only fakes
platform/, expr/, model/, prompt/, flow/, runtime/, stream/, agent/, tool/, auth/, api/ Ports and contracts per layer (see layering.yaml)
contracts/ Protobuf contracts (stream, invocation, browser runner), linted with buf
cmd/kit The product binary: serve and config validate
tools/gate, internal/gate The QA gate tool
internal/bdd godog suite and step library
specs/ Constitution, glossary, requirements, scenarios, approval ledgers
docs/ Architecture, ADRs, engineering conventions, roadmap

License

Apache License 2.0; see LICENSE and NOTICE.

Directories

Path Synopsis
Package agent implements the bounded tool loop used by `agent` flow nodes.
Package agent implements the bounded tool loop used by `agent` flow nodes.
conversation
Package conversation implements a conversation as one coordinator run that starts exactly one child run per turn (REQ-CONV-001, REQ-CONV-002; ADR-0007).
Package conversation implements a conversation as one coordinator run that starts exactly one child run per turn (REQ-CONV-001, REQ-CONV-002; ADR-0007).
Package api exposes connect-go services (runs, gates, flows, models), the run stream over SSE and WebSocket, an OpenAI-compatible model endpoint with scoped tokens for external services (the browser runner, product backends), an AG-UI stream adapter, the worker endpoint (ADR-0012) and the MCP server.
Package api exposes connect-go services (runs, gates, flows, models), the run stream over SSE and WebSocket, an OpenAI-compatible model endpoint with scoped tokens for external services (the browser runner, product backends), an AG-UI stream adapter, the worker endpoint (ADR-0012) and the MCP server.
Package auth provides authentication modes and in-app authorization.
Package auth provides authentication modes and in-app authorization.
authn
Package authn implements the authentication modes of ADR-0008.
Package authn implements the authentication modes of ADR-0008.
cmd
kit command
Command kit is the single binary.
Command kit is the single binary.
Package core holds the foundation every layer shares: identifiers, the clock, the error taxonomy and the tenant carried by a context.
Package core holds the foundation every layer shares: identifiers, the clock, the error taxonomy and the tenant carried by a context.
coretest
Package coretest holds deterministic fakes for core ports.
Package coretest holds deterministic fakes for core ports.
schema
Package schema generates JSON Schema from Go types, compiles and validates instances, and produces RFC 8785 canonical JSON for content-addressing.
Package schema generates JSON Schema from Go types, compiles and validates instances, and produces RFC 8785 canonical JSON for content-addressing.
Package expr hosts the CEL environment (cel.dev/cel-go) used for edge conditions, guards, gate acceptance, price formulas and authorization conditions, plus gojq for JSON-to-JSON mapping.
Package expr hosts the CEL environment (cel.dev/cel-go) used for edge conditions, guards, gate acceptance, price formulas and authorization conditions, plus gojq for JSON-to-JSON mapping.
Package flow defines flows as data (IR), a compiler that type-checks CEL against the state schema, and a pure interpreter state machine.
Package flow defines flows as data (IR), a compiler that type-checks CEL against the state schema, and a pure interpreter state machine.
builder
Package builder authors flow IR in Go with typed declarations.
Package builder authors flow IR in Go with typed declarations.
compile
Package compile turns a flow IR into its validated, canonical form: it checks the structural rules and limits of flow/ir, rejects a canonical definition above 1 MiB, and type-checks every CEL expression against the state schema through package expr (ADR-0003, ADR-0011).
Package compile turns a flow IR into its validated, canonical form: it checks the structural rules and limits of flow/ir, rejects a canonical definition above 1 MiB, and type-checks every CEL expression against the state schema through package expr (ADR-0003, ADR-0011).
host
Package host is the one durable entrypoint of the flow engine (runtime.FlowHost, ADR-0011).
Package host is the one durable entrypoint of the flow engine (runtime.FlowHost, ADR-0011).
ir
Package ir is the canonical form of a flow definition: decoding, RFC 8785 canonical JSON, the content hash runs pin, the compiler's size and guard limits (REQ-FLOW-045, REQ-FLOW-046), and the structural validation the compiler runs before it type-checks expressions.
Package ir is the canonical form of a flow definition: decoding, RFC 8785 canonical JSON, the content hash runs pin, the compiler's size and guard limits (REQ-FLOW-045, REQ-FLOW-046), and the structural validation the compiler runs before it type-checks expressions.
machine
Package machine is the pure flow interpreter of ADR-0003.
Package machine is the pure flow interpreter of ADR-0003.
internal
bdd
Package bdd is the godog harness for specs/; it wires scenarios to platform code.
Package bdd is the godog harness for specs/; it wires scenarios to platform code.
bdd/blobmatrix
Package blobmatrix derives stable scenario ids for blob S3 matrix verification.
Package blobmatrix derives stable scenario ids for blob S3 matrix verification.
bdd/bustest
Package bustest provides an in-process platform.Bus and platform.KV fake for the BDD gate.
Package bustest provides an in-process platform.Bus and platform.KV fake for the BDD gate.
bdd/codegen
Package codegen holds the codegen preset's deterministic test doubles: a scripted model, a simulated sandbox and a simulated git host.
Package codegen holds the codegen preset's deterministic test doubles: a scripted model, a simulated sandbox and a simulated git host.
bdd/modroot
Package modroot finds the repository root (directory containing go.mod).
Package modroot finds the repository root (directory containing go.mod).
bdd/natstest
Package natstest starts a loopback nats-server with JetStream for BDD.
Package natstest starts a loopback nats-server with JetStream for BDD.
bdd/s3sim
Package s3sim is an in-process S3-compatible endpoint for blob conformance and BDD tests.
Package s3sim is an in-process S3-compatible endpoint for blob conformance and BDD tests.
bdd/sqltest
Package sqltest holds the conformance sample repository and migrations for SQL BDD scenarios.
Package sqltest holds the conformance sample repository and migrations for SQL BDD scenarios.
bdd/steps
Step texts that more than one capability's scenarios use are registered once in this file.
Step texts that more than one capability's scenarios use are registered once in this file.
bdd/telemtest
Package telemtest is the deterministic OTLP collector used by the BDD telemetry scenarios.
Package telemtest is the deterministic OTLP collector used by the BDD telemetry scenarios.
config
Package config loads, validates and reports the configuration of the kit binary (specs/config, WP-L1-05).
Package config loads, validates and reports the configuration of the kit binary (specs/config, WP-L1-05).
gate
Package gate implements the repository's QA gate checks (spec lint, traceability, the approval lock, layering, red→green, review plans) and the coordination of agent sessions (identities, worktrees, hand-offs, work package states).
Package gate implements the repository's QA gate checks (spec lint, traceability, the approval lock, layering, red→green, review plans) and the coordination of agent sessions (identities, worktrees, hand-offs, work package states).
Package model is the capability-typed model layer.
Package model is the capability-typed model layer.
catalog
Package catalog holds the descriptors that a model id stands for and the price table that says what a call of it costs.
Package catalog holds the descriptors that a model id stands for and the price table that says what a call of it costs.
chat
Package chat adapts an eino chat model to the model.Invoker contract.
Package chat adapts an eino chat model to the model.Invoker contract.
middleware
Package middleware runs every chat call through one fixed chain:
Package middleware runs every chat call through one fixed chain:
node
Package node implements the `model` node handler (ADR-0011).
Package node implements the `model` node handler (ADR-0011).
providers
Package providers implements the manifest-driven model providers and the model router.
Package providers implements the manifest-driven model providers and the model router.
providers/sim
Package sim holds in-process simulators for the manifest-driven providers.
Package sim holds in-process simulators for the manifest-driven providers.
structured
Package structured shapes the output of a chat call into JSON that satisfies an output schema.
Package structured shapes the output of a chat call into JSON that satisfies an output schema.
worker
Package worker implements the platform side of ADR-0012 §1 to §11: pools, the descriptors their workers declare, the SQL queue with its classes, fairness and ageing, leases by free capacity, draining and pausing, the worker journal, restart-safe redelivery, worker_lost, spill-over, metrics and worker administration, and routing by labels.
Package worker implements the platform side of ADR-0012 §1 to §11: pools, the descriptors their workers declare, the SQL queue with its classes, fairness and ageing, leases by free capacity, draining and pausing, the worker journal, restart-safe redelivery, worker_lost, spill-over, metrics and worker administration, and routing by labels.
Package platform declares infrastructure ports.
Package platform declares infrastructure ports.
blob
Package blob is the content-addressed blob store (ADR-0004).
Package blob is the content-addressed blob store (ADR-0004).
blob/conformance
Package conformance runs blob BDD scenarios against the S3 simulator backend.
Package conformance runs blob BDD scenarios against the S3 simulator backend.
bus
Package bus implements platform.Bus and platform.KV on NATS JetStream.
Package bus implements platform.Bus and platform.KV on NATS JetStream.
credentials
Package credentials is the credential vault: named secrets per tenant, envelope-encrypted in SQL through the Secrets port and resolved inside a step at the moment of use.
Package credentials is the credential vault: named secrets per tenant, envelope-encrypted in SQL through the Secrets port and resolved inside a step at the moment of use.
secrets
Package secrets implements the secrets port and the payload codec (WP-L1-04).
Package secrets implements the secrets port and the payload codec (WP-L1-04).
sql
Package sql is the SQL port of platform: SQLite in the embedded profile and Postgres in the cloud profile, selected by URL (ADR-0004).
Package sql is the SQL port of platform: SQLite in the embedded profile and Postgres in the cloud profile, selected by URL (ADR-0004).
telemetry
Package telemetry is the telemetry setup of the platform: one constructor wires the slog logger, the OpenTelemetry tracer and the OpenTelemetry meter used by every layer (REQ-TELEM-001, ADR-0004).
Package telemetry is the telemetry setup of the platform: one constructor wires the slog logger, the OpenTelemetry tracer and the OpenTelemetry meter used by every layer (REQ-TELEM-001, ADR-0004).
workspace
Package workspace holds the one path rule the sandbox and the codegen preset share: a file key names a clean relative path inside a work directory, so two spellings of one file cannot reach a driver or a commit.
Package workspace holds the one path rule the sandbox and the codegen preset share: a file key names a clean relative path inside a work directory, so two spellings of one file cannot reach a driver or a commit.
Package prompt holds versioned prompt templates (id@version, declared inputs, strict {{var}} substitution), segment assembly with size budgets and cache hints (static, semi-static, dynamic, history, user), untrusted-input wrapping that neutralizes delimiter break-out, and assembled-prompt linting.
Package prompt holds versioned prompt templates (id@version, declared inputs, strict {{var}} substitution), segment assembly with size budgets and cache hints (static, semi-static, dynamic, history, user), untrusted-input wrapping that neutralizes delimiter break-out, and assembled-prompt linting.
Package runtime defines the runtime-neutral durable execution contract.
Package runtime defines the runtime-neutral durable execution contract.
local
Package local is the in-process Runtime: goroutines and an in-memory journal.
Package local is the in-process Runtime: goroutines and an in-memory journal.
temporal
Package temporal is the Temporal-backed durable runtime (WP-L5-02).
Package temporal is the Temporal-backed durable runtime (WP-L5-02).
Package stream is the live layer of a run: clients attach, detach and reattach with a cursor while the run keeps going (WP-L6-02).
Package stream is the live layer of a run: clients attach, detach and reattach with a cursor while the run keeps going (WP-L6-02).
eventlog
Package eventlog is the durable event log of a run (WP-L6-01).
Package eventlog is the durable event log of a run (WP-L6-01).
Package tool defines the tool port, per-caller allowlists, the call step, the MCP client adapter (github.com/modelcontextprotocol/go-sdk) and the sandbox port for generated code.
Package tool defines the tool port, per-caller allowlists, the call step, the MCP client adapter (github.com/modelcontextprotocol/go-sdk) and the sandbox port for generated code.
tools
gate command
Command gate runs the repository QA gate checks.
Command gate runs the repository QA gate checks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL