- Do not write design documents or implementation plans to disk (no
docs/plans/or similar). Discuss plans in conversation only.
- Always use the Ginkgo/Gomega testing frameworks
- Be careful adding anything to
Bucketsince that's the content addressing unit — changing it changes everything for the internal merkle/dedup layer. - Always use
makeoperations for development: usemake helpto understand the various operations available. - Every PR that adds or changes user-visible features or functionality MUST
add or update the corresponding documentation in
docs/in the same PR. Do not defer required documentation to a follow-up PR. The docs are flat Markdown with no build step: one page per file, each carryingtitleanddescriptionfrontmatter plus asidebar.order. A new page needs all three; links between pages are relative (./cli.md). - Run tests with
make test; the Dagger workflow provisions the Postgres service and passes its DSN to DB-backed suites. - Run
make formatto format and organize imports usinggoimportsandgolangci-lint - OpenAPI lives in
pkg/tapesoapi(there is no swaggo and no annotation comments). A route is registered and described in the same call, through theoasfiberwrapper — seeapi/openapi_routes.goandingest/openapi.go. There is nothing to regenerate: each server compiles its contract from those registrations and serves it atGET /openapi. No contract file is checked in, so changing a route or a payload changes the published document immediately and no document can be stale. Field prose comes from ordinary Go doc comments — do not put descriptions in struct tags. A running binary has no source tree, so the served document carries route and operation prose but not per-field prose;tapes dev openapi [api|ingest]compiles the fully documented version from a checkout when a consumer wants it. - Follow idiomatic Go and prefer using the
func NewExampleStruct() *ExampleStructparadigm seen throughout.
tapes is an agentic telemetry system for content-addressable LLM interactions.
Data flows in one direction: a transparent proxy intercepts LLM API calls and
appends them to an immutable raw_turns log; a pure, idempotent deriver
projects that log into the read model of sessions → traces → spans (re-derive
reproduces the projection and prunes anything no longer present). Derived IDs are
deterministic. The persisted merkle nodes table has been dropped; the
content-addressed merkle layer now lives only in memory (merkle.ProjectContent),
used at derive time for content identity and dedup. It is not persisted and not a
user-facing browsing surface.
The system is made up of:
- A transparent proxy for intercepting LLM API calls and appending them to the
immutable
raw_turnscapture log. - A derive worker (run via
tapes serve derive-worker) that projectsraw_turnsinto sessions/traces/spans. - An API server for querying and exporting over the derived surface
(
/v1/sessions,/v1/traces,/v1/stats,/v1/sessions/{id}/raw_turns). - A bundled CLI (
tapes) for running the proxy, API, and workers, and for the operator tooling around them.
CLI surface notes for agents:
tapesis the server;tapesctlis the client. This binary runs the services, owns the database, and carries the operator tooling. Capturing a session and reading one back belong totapesctl, a separate Rust CLI in its own repository.- The client commands that used to live here have moved to
tapesctl:tapes start→tapesctl start,tapes export→tapesctl export,tapes seed→tapesctl seed,tapes sessions→tapesctl sessions list,tapes search→tapesctl search,tapes skill→tapesctl skill. Do not re-add them here. tapes chathas been removed; tapes captures and derives, it does not host chat sessions.- Span search, skills, and export are cassettes — separate services core
proxies under
/v1/cassettes/<name>. Their routes, packages, and the embed worker have been removed from core; do not re-add them here. - The deck TUI has been removed with no CLI replacement — the console owns the ROI/session-browsing surface.
Language: Go 1.27+
Go Module: github.com/papercomputeco/tapes
api/- REST API server for interfacing withtapessystemcli/- Individual CLI targetsextproc/- The Envoy ext_proc adapter that captures LLM traffic at the AI Gateway and POSTs completed turns to ingest. It ships as its own image (Dockerfile.extproc,cli/tapes-extproc) rather than as atapes servesubcommand: it sits on the request path and must not depend on the API, the database or the derive worker being healthy. Same repository, so it sharespkg/capture's reducers and ingest's limits directly — which is the point, since two capture paths that reduce differently is the failure it exists to avoid.cmd/-spf13/cobracommands: these are built to be modular in order to be bundled in various CLIspkg/- Go packages. Use thego doccommand to get the documentation on the packages public API. Ex:go doc pkg/llminternal/- Packages private to this module (not importable by consumers).proxy/- Thetapestelemetry collector proxy.dagger/- Dagger CI/CD builds and utilities. Used throughmaketargets..github/- GitHub metadata and action workflows.flake.nix- The development Nix flake which bundles all necessary dependencies for development.
The project uses a Makefile for all build and dev operations. Utilize make help
to see all available commands.
Build artifacts land in the build/ directory.
See CONTRIBUTING.md for the required PR
title format and allowed labels. Squash-merge commits inherit the PR title,
so the PR title is the commit message that lands on main.