Skip to main content

tars-agent

TARS — a disciplined, multi-session coding agent loop

Why it exists

Named for TARS - the robot from Interstellar - whose worth lies not in cleverness but in discipline: it does what it said, reports honestly what it did, and asks before it touches anything. This tool tries to earn that name.

Install

pip install -e ".[dev]"

Requires Python >=3.10.

This project has no runtime dependencies.

How to run it

tars

Run TARS's disciplined agent loop.

tars
python -m tars.loop

Flags: --version, --yes, --root, --model, --web-url, --web-steps, --web-expect

declared in pyproject.toml

tars-browser

Efficient accessibility-tree-first web testing.

tars-browser
python -m tars.browser

declared in pyproject.toml

tars-memory

Read a session transcript and propose the memory entries it earned: domain-tagged, scored, and quoted from the turn they came from. Also reads back what earlier sessions kept.

tars-memory
python -m tars.memory

Flags: --write, --session, --max, --now, --domain, --kind, --limit, --root, --json, --no-color

declared in pyproject.toml

tars-readme

Write a README from what a repo actually contains: usage examples lifted from its own docstrings and tests, the commands it declares, and the checks it can run.

tars-readme
python -m tars.readme

Flags: -o/--output, --force, --check, --json, --include-unverified, --notes, --no-tests, --max-examples, --no-color

declared in pyproject.toml

tars-verify

Detect a repo's test runner, linter, type-checker and formatter, then run them uniformly.

tars-verify
python -m tars.verification

Flags: --only, --include, --list, --json, --fail-fast, --timeout, --output-lines, --max-output-chars, --allow-no-checks, --quiet/-q, --no-color

declared in pyproject.toml

python -m tars

Efficient accessibility-tree-first web testing.

python -m tars

declared in tars/__main__.py

Examples

Every snippet below was taken from the file named under it, and checked against the current source.

from tars.act import Edit, Hunk, LocalExecutor

executor = LocalExecutor(".")
result = executor.apply(Edit.replace("a.py", Hunk("x = 1", "x = 2")))
result.ok, result.diff, result.touched

tars/act/__init__.py:5

from tars.act import Command, LocalExecutor

LocalExecutor(".").run(Command(["pytest", "-q"])).reason

tars/act/__init__.py:24

from tars.act import Edit, Hunk, LocalExecutor

preview = LocalExecutor(".", dry_run=True)
preview.apply(Edit.replace("a.py", Hunk("x = 1", "x = 2"))).diff

tars/act/__init__.py:40

from tars.act import get_executor, known_executors

get_executor("local")
known_executors()

tars/act/__init__.py:48

from tars.memory import reflect_on

report = reflect_on("run/session.jsonl")
report.summary_line()
report.to_commit    # high-confidence, decision-shaped, domain-tagged
report.to_review    # what a human should see before anything believes it
report.dropped      # considered, scored too low, kept so you can see it

tars/memory/__init__.py:7

from tars.memory import reflect_on

reflect_on("run/session.jsonl").nothing_worth_remembering

tars/memory/__init__.py:22

How it's structured

  • tars/__init__.py — TARS — a disciplined, multi-session coding agent loop. (python -m tars)
    • tars/_cli_helpers.py — Shared CLI helpers: color and tty detection.
    • tars/act/__init__.py — TARS ACT — PHASE 4, isolated: the phase that actually touches the repo.
      • tars/act/base.py — The one interface every executor implements.
      • tars/act/local.py — The built-in executor: this machine, this repo, stdlib only.
      • tars/act/registry.py — Which executor does ACT's work, chosen by name rather than by import.
      • tars/act/types.py — What ACT was asked to do, and what came of it.
    • tars/browser/__init__.py — Efficient, accessibility-tree-first browser testing. (python -m tars.browser)
      • tars/browser/cli.pytars-browser: scriptable accessibility-tree web tests.
    • tars/loop/__init__.py — TARS loop orchestrator — the seven phases, driven. (python -m tars.loop)
      • tars/loop/_io.py — Small output helpers for the REPL.
      • tars/loop/cli.pytars — persistent REPL and one-shot loop commands.
      • tars/loop/engine.py — The seven-phase loop, composed from TARS's tested phase modules.
      • tars/loop/repl.py — The persistent slash-command interface over one live :class:Session.
      • tars/loop/session.py — What persists between commands.
      • tars/loop/session_store.py — Durable event log for REPL sessions.
      • tars/loop/tools.py — Model-facing ACT tools.
      • tars/loop/types.py — The loop's own vocabulary.
    • tars/memory/__init__.py — TARS memory writer — PHASE 6 (REFLECT), isolated. (python -m tars.memory)
      • tars/memory/cli.pytars-memory — the REFLECT phase as a command.
      • tars/memory/domains.py — Which partition does a fact belong to, and what said so.
      • tars/memory/propose.py — The REFLECT pass: read a transcript, propose what is worth remembering.
      • tars/memory/signals.py — Detectors for the sentence in core directive 4.
      • tars/memory/similarity.py — Small lexical similarity for memory retrieval without an embedding service.
  • …and 32 more modules

Tests live in tests/.

Verifying it

ruff check .
ruff format --check .
mypy tars tests
pytest

detected from this repo: format, lint, test, typecheck


Generated by tars-readme from the source of this repository: 6 examples extracted from the paths above. Sections with nothing to source were left out.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tars_agent-0.1.0.tar.gz (266.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tars_agent-0.1.0-py3-none-any.whl (185.3 kB view details)

Uploaded Python 3

File details

Details for the file tars_agent-0.1.0.tar.gz.

File metadata

  • Download URL: tars_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 266.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for tars_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2a86eb66cef205509364733541f2114f9ca57174a7110504c8aa793fa45984c3
MD5 07c75b399f2ac40e432ba30650738a1d
BLAKE2b-256 86d352904463cb37ae66b987a5cd779924387483f07a9fecd9c924491cb99fb8

See more details on using hashes here.

File details

Details for the file tars_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tars_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 185.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for tars_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6e8207f159f7ac587eb78e7e12b5bb85de4f6ce5eed7fb50450e9181e56676e
MD5 bfbd0123d8b61a29f34cee9a435a9e3d
BLAKE2b-256 5e65cf4cafecef3c1fb99831f9577d5f5c39eb97f4ceb3c07253e578a8c40b65

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

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