Repository navigation
RootSign v0.2.0 — Zero-dependency onboarding
pip install rootsign now reaches a verified hash chain in under a minute — no Docker, no PostgreSQL, no plumbing. Two changes get there: a JSONL local backend that is the new default (ADR-011) and a three-call facade (ADR-012).
Existing Postgres users: set ROOTSIGN_BACKEND=postgres — see Migrating below.
Highlights
📄 JSONL is the default backend (ADR-011)
The default transport is now an append-only JSONL writer under ~/.rootsign — zero dependencies, no database, no network. pip install rootsign resolves no database packages at all (asserted by a required CI gate).
$ rootsign verify --local ~/.rootsign/sessions/f758a636-….jsonl
VALID ✓ — 2 records, chain intactSame frozen canonical hash formula as the Postgres path (ADR-001) — a cross-backend contract test drives one scripted session through both clients and asserts both chains verify. Client-side chaining holds an in-memory per-session tail under an asyncio.Lock; fsync policy is configurable via ROOTSIGN_JSONL_FSYNC (chain default / always / never).
Tamper detection is per-record: change any field of any line and verify --local flips to TAMPERED naming the sequence. Exit code 0/1 makes it a CI or cron check.
✨ rootsign.init() — three calls, no plumbing (ADR-012)
import rootsign
rootsign.init(agent="invoice-agent", risk_tier="high")
async with rootsign.session(objective="process invoice batch"):
tools = rootsign.wrap_tools([send_invoice, search_web]) # no ctx, no clientinit()is synchronous and does no I/O, so it's safe at module scope and inside a running event loop (notebooks, FastAPI startup). The agent record is get-or-created lazily on the firstsession()entry.- Agent identity is
(name, environment)— the same name can exist independently indevelopmentandproduction. Re-running a script never re-registers; changing an attribute logs a WARNING and keeps the stored value. rootsign.init()with zero arguments works: entrypoint script name,development, risk tiermedium, JSONL backend.- The ambient session lives in a
contextvars.ContextVar, so parallel LangGraph branches inherit the right context while two concurrent sessions in one process stay isolated. - Explicit
ctx=/client=always win.wrap_tools,@trace, both framework tracers,MCPProxyTracer, andctx.record_decision()all resolve explicit → ambient →RootSignNotInitializedError(a new error whose message carries the two-line fix). Resolution happens at invocation, not at decoration — tools are usually built at import time.
The five calls init / session / wrap_tools / trace / verify are now the frozen cross-SDK surface the Phase 2 TypeScript SDK will mirror. See docs/framework-support.md.
📦 Packaging split — DB-free core
The SQLAlchemy / asyncpg / alembic stack moved to an optional extra: pip install 'rootsign[postgres]'. import rootsign no longer touches the DB stack. Selecting the Postgres backend without the extra raises RootSignPostgresExtraRequired naming the install command, instead of a ModuleNotFoundError deep in the import graph.
Migrating from v0.1.x
If you use PostgreSQL/TimescaleDB, two steps:
-
Install the extra and pin the backend. The default flipped from Postgres to JSONL, so an unconfigured install now writes to
~/.rootsigninstead of your database:pip install 'rootsign[postgres]' export ROOTSIGN_BACKEND=postgres
ROOTSIGN_BACKEND=localstill works as a deprecated alias forpostgresand emits aDeprecationWarning. -
Apply the migration.
rootsign-admin initapplies0005_agents_name_env_unique, which replacesUNIQUE(name)onagentswithUNIQUE(name, environment). No backfill and no downtime —nameis globally unique today, so every existing row already satisfies the composite key. This is the release's only schema change.
If you import rootsign.database, rootsign.crud, or rootsign.models directly, those now live behind the postgres extra. Add it to your dependencies; no code changes.
No application code changes are required. Existing explicit call sites (rootsign.session(agent_id=..., client=...), wrap_tools(tools, ctx=..., client=...), @rootsign.trace(ingest_client=..., session_context=...)) are unchanged and fully supported.
Install
pip install rootsign # core — JSONL backend, no DB
pip install 'rootsign[postgres]' # + PostgreSQL/TimescaleDB
pip install 'rootsign[langgraph]' # or [crewai], or [mcp]Notes
- New settings:
ROOTSIGN_DATA_DIR(default~/.rootsign),ROOTSIGN_JSONL_FSYNC. - New required CI gate:
No-extras install (DB-free core)— a contract test asserts nosqlalchemy/asyncpg/alembicimport at module level anywhere inrootsign/sdk/orrootsign/mcp/. - HiTL on the JSONL backend is an inline TTY prompt. A headless run with
require_approval=TrueraisesHiTLUnsupportedBackendErroron the tool's first invocation, before any work happens. Cross-processrootsign approvestill requires the Postgres backend. init()never wraps the transport inBufferedIngestClientimplicitly — micro-batching stays an explicit opt-in viaROOTSIGN_BUFFERED(ADR-009 changes response semantics).- Cross-backend hashes are not literally equal for the same logical run: each backend mints its own
action_id. Parity means the same formula over the same field assembly, which the contract test pins. - JSONL→cloud replay,
rootsign exportevidence bundles, and theHttpIngestClientimplementation remain Phase 2. The JSONL writer is deliberately the spool format the cloud transport will replay from.
Full Changelog: v0.1.5...v0.2.0