Skip to main content

triad-base

Primitives for building thinker / doer / checker agent triads with Claude (or any LLM).

Source is maintained in a private monorepo. Releases are built and published by GitHub Actions through a PyPI Trusted Publisher; provenance attestations are visible on the PyPI file listing.

What's in the box

Module What it gives you
triad_base.types AgentType / PlanStatus enums; Plan, AgentMetadata, ExecutionResult dataclasses; parse_agent_metadata() parser
triad_base.state.schema Pydantic v2 models for agent state JSON (ThinkerState / DoerState / CheckerState / Heartbeat / ExecutionRecord / interventions) + load_state / save_state / validate_state_file
triad_base.state.validation validate_file / validate_directory / migrate_file / migrate_directory / check_schema_compatibility
triad_base.preflight HealthChecker (disk space · state-dir writable · stale locks · optional config valid · Claude CLI present) + create_checkpoint / restore_checkpoint / clear_checkpoint (git-stash rollback)
triad_base.orchestrator TriadContext + build_thinker_prompt / build_doer_prompt / build_checker_prompt + format_prior_suggestions
triad_base.verdict Typed gate/judge verdict contract (schema v1) — Verdict / Finding / ReviewerError / ReviewerResult + to_json_schema(); pool-pure, pydantic-only

Design

Pure plumbing, no transport. The library assembles prompts and parses output; it does not call Claude. Consumers wire the prompts to their own transport (CLI subprocess, Anthropic SDK, direct API). Transport is intentionally out of scope so different consumers can diverge in dispatch (CLI vs SDK vs API) without dragging shared transport glue along.

Narrow surface. Five small modules. No CLI, no __main__, no opinionated workflow. You compose the parts you need.

Install

pip install triad-base

Usage sketch

from pathlib import Path
from triad_base.types import AgentType, Plan, PlanStatus
from triad_base.orchestrator import TriadContext, build_thinker_prompt
from triad_base.preflight import HealthChecker

# Preflight before kicking off
report = HealthChecker(
    portfolio_root=Path("/repo"),
    state_dir=Path("/repo/.state"),
).run_all_checks()
if not report.ok:
    raise RuntimeError(report.summary())

# Build a thinker prompt
plan = Plan(id="ex-001", target_project="myproject", status=PlanStatus.READY, ...)
ctx = TriadContext(
    plan=plan,
    state_dir=Path("/repo/.state"),
    working_dir=Path("/repo"),
    prior_suggestions=None,
    test_output="",
    thinking_context="",
    execution_context_tail="",  # add your own logging / state-persistence block
)
prompt = build_thinker_prompt(ctx)

# Hand `prompt` to your Claude transport of choice; you own that part.

Versioning

Semantic versioning. 0.x.y series — interface may change between minor versions during early use; pin in your consumer's requirements.txt or pyproject.toml accordingly.

Dependencies

  • pydantic>=2.0
  • pyyaml>=6.0

License

MIT

Metadata

Release files for triad-base 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for triad-base 0.2.2
File Size Uploaded Provenance Actions
triad_base-0.2.2.tar.gz 35.1 kB With provenance Details for triad_base-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for triad-base 0.2.2
File Interpreter ABI Platform Actions
triad_base-0.2.2-py3-none-any.whl Python 3 none any Details for triad_base-0.2.2-py3-none-any.whl

Total release size: 60.8 kB

Release files / triad_base-0.2.2.tar.gz

Download URL triad_base-0.2.2.tar.gz
Size 35.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a0eb0e1987617a7c29a70775b4edc4648e0626391b359ae2fd4952fb49e81c5c
BLAKE2b-256 checksum
How to use checksums
f241e19ecaaf49acd54bf414b12239b61f077c6246dc39435bcc5d215b321dee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Release files / triad_base-0.2.2-py3-none-any.whl

Download URL triad_base-0.2.2-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3211639772dd8c27c29819899cefbf74d32a32adcd343bd10b73977c6fc134c
BLAKE2b-256 checksum
How to use checksums
a89ec56d0daa9370ff44e372722157432c2ac2a9b5efb0c4f4f1dd94f39bd1b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Security for triad-base 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for triad_base-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page