Raw capture โ€” raw/state-system.md


url: https://github.com/dbmcco/state-system date_fetched: 2026-07-05 backfilled: true


State System is a generic state substrate for agents and humans operating across many source systems.

It solves a practical agent reliability problem: an agent is often asked, "what is the current state?" while the relevant evidence is scattered across docs, messages, tasks, CRM records, calendars, repositories, memory systems, and local runtime artifacts. Some sources are fresh, some are stale, some are unreachable, some are only declared, and some are governed by another instance. Without an explicit state layer, agents either over-trust whatever context they saw last or hide uncertainty in prose.

State System makes that boundary explicit. It records what appears to be true, why that view changed, which evidence supports it, which sources are fresh or stale, what remains uncertain, which routes/tools are allowed, and which actions require governance before execution.

State is not a note, a prompt, or a transient model context dump.

State is a durable, scoped record of:

The model interprets meaning and proposes state transitions. Code owns schemas, evidence references, source access status, freshness checks, persistence, audit, governance boundaries, and execution safety.

This repository is the product surface. It includes:

A deployed state root owns private runtime material: live state records, credentials, local paths, source-owned indexes, generated package exports, adapter evidence, and operational artifacts. Those do not belong in this repo.

Source integrations are first-class. To add one:

Detailed docs:

Agents should consume rendered artifacts, not scrape private runtime roots. Start with AGENTS.md and docs/agent-integration.md.

The short contract:

From a clean checkout:

python3 -m unittest discover -s tests
python3 -m state_system.cli --project-root . validate
python3 -m state_system.cli --project-root . report-suite-run --output-dir /tmp/state-system-report-suite

Open /tmp/state-system-report-suite/index.html to inspect the generated reports. The validation command checks shipped schemas and JSON examples; the test suite checks runtime, package, freshness, federation, source-module, and pressure-test contracts.

Run a trace:

python3 -m state_system.cli --project-root . trace-run examples/traces/linear-deal-won.trace.json --output-dir /tmp/state-system-traceBuild a North Star answer substrate from packages:

python3 -m state_system.cli --project-root . north-star-answer \
  --query "What is the current state?" \
  --package sample=examples/instance-agent-package/instance-agent-package-sample-personal-nova.json \
  --output-dir /tmp/state-system-north-star

Render the deterministic text view:

python3 -m state_system.cli --project-root . north-star-answer-render \
  /tmp/state-system-north-star/north-star-answer.json \
  --check \
  --output-path /tmp/state-system-north-star/north-star-answer.txt

The shipped fixtures use neutral example organizations and instances such as SampleCo, ResearchCo, PortfolioCo, and sample_personal. They are contract fixtures, not required deployment names. Real deployments should use their own instance refs, connector refs, source refs, package IDs, and freshness manifests.

Run these before publishing or merging:

python3 -m unittest discover -s tests
python3 -m state_system.cli --project-root . validate
python3 -m unittest tests.test_open_source_ecosystem_conformance -v
git diff --check