Skip to content
smolboonPublic

About

Single-file, zero-dependency operating system for autonomous, gated multi-agent coding — Git-native verification, signed Git Notes attestation, polyglot code indexing, and scheduled approval slots.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smort

smort CI Release Dependencies Artifacts Suites

Single-file, zero-dependency operating system for autonomous, gated multi-agent software engineering — built to give developers their lives back.

smort compiles an entire Git-native engineering control plane into one portable Markdown file (smort.md). Hand it to any coding agent (Claude Code, Codex, Cursor, Windsurf, Gemini CLI, Antigravity) to stop babysitting "Should I proceed?" loops without sacrificing code quality, security, or control over main: low-risk work builds, verifies, and stages autonomously on smort/dev, while sensitive or architectural changes queue for 1-line batch approval at your scheduled daily timeslots.

Footprint Context Efficiency Zero-Trust Verification Speed & Cross-Platform CI
1 file → 38 artifacts
12 templates · 23 scripts/lib · 3 configs
0 external deps · 0 daemons · 0 telemetry
24.5 KB Turn-1 (4.1% · 95.9% skipped)
21.0 KB Day-1 Hot Set (~5.4K tok)
51.9% Week-2 headroom (31.5 / 65.5 KB)
Env-scrubbed detached-worktree verifier
Out-of-band refs/notes/smort-verify + optional OpenSSH signing
4-lang formal proof anti-cheat · base-auth policies
O(1) polyglot code-index v4 (~0.5 s / 500 Go or Java files)
Parallel gate & conflict-matrix
23/23 suites (ubuntu-latest + macos-latest)

Quickstart

Option 1 — Hand smort.md to Any Coding Agent (Zero-Question Install)

Copy smort.md into your repository root and prompt your agent with:

Follow smort.md for this repository.

What happens automatically (zero Turn-1 questionnaire, main stays untouched):

  1. The agent stops reading at <!-- SMORT-STOP-READING-HERE --> (reading only §0–§6 = 24.5 KB, skipping 95.9% of the file).
  2. It runs the §4.1 extractor to materialize all 38 files + verify/smort-manifest.json onto smort/install, checks health with smort-doctor, drafts or reverse-engineers PRD.md, PROJECT-MAP.md, and ARCHITECTURE-TDD.md, and queues D-001 for your first timeslot.
  3. It immediately branches protected staging smort/dev and begins claiming, building, verifying, and staging ready work via 1-command CLIs.

Option 2 — Self-Extract Locally (< 0.2 s)

# 1. Fetch smort.md into your repo root
curl -fsSLO https://raw.githubusercontent.com/smolboon/smort/main/smort.md

# 2. Extract all 38 files (CRLF-safe, never overwrites existing files, seeds verify/smort-manifest.json)
SMORT_FILE="${SMORT_FILE:-smort.md}" python3 - <<'PY'
import hashlib, json, os, re
from pathlib import Path
src = Path(os.environ["SMORT_FILE"]).read_text(encoding="utf-8").replace("\r\n", "\n")
for d in ("tasks/archive", "changes", "docs/decisions", "handoffs", "verify/conflicts", "verify/logs", "verify/lessons", "scripts/verify"):
    Path(d).mkdir(parents=True, exist_ok=True)
ver_m = re.search(r"Repo template version:\s*`?([0-9A-Za-z._-]+)`?", src)
tpl_ver = ver_m.group(1).rstrip(".") if ver_m else ""
fence = chr(126) * 4
pat = re.compile(rf"^### [78]\.\d+ `([^`]+)`[^\n]*\n\n{fence}[a-z]*\n(.*?)\n{fence}", re.M | re.S)
count, manifest = 0, {}
for m in pat.finditer(src):
    rel, body = m.group(1), m.group(2) + "\n"
    target = Path(rel)
    existed = target.exists()
    out = target if not existed else Path(f"{target}.smort-new")
    out.parent.mkdir(parents=True, exist_ok=True)
    out.write_text(body, encoding="utf-8")
    if rel.startswith("scripts/verify/") and rel != "scripts/verify/_smort_lib.py":
        out.chmod(0o755)
    if not existed and (not rel.startswith("scripts/verify/") or rel == "scripts/verify/project-checks.sh"):
        manifest[rel] = hashlib.sha256(body.encode("utf-8")).hexdigest()
    count += 1
    print(f"wrote {out}")
assert count == 38, f"expected 38 blocks, wrote {count}"
mf = Path("verify/smort-manifest.json")
if manifest and not mf.exists():
    mf.write_text(json.dumps({"version": tpl_ver, "files": dict(sorted(manifest.items()))}, indent=2) + "\n", encoding="utf-8")
print(f"OK: extracted {count} smort v13 files.")
PY

# 3. Verify immediately (must exit 0)
scripts/verify/ci-guard --self-test \
  && scripts/verify/claim-check --self-test \
  && scripts/verify/smort-doctor

# 4. Optional: install hardened mechanical Git hooks (pre-commit secret/tamper + pre-push main/notes guard)
scripts/verify/install-hooks

Add local ephemeral caches to .gitignore:

verify/logs/
verify/code-index*.json

Upgrading an existing smort repository (v3–v16 → v17) in 1 command:

scripts/verify/smort-upgrade --from smort.md --dry-run
scripts/verify/smort-upgrade --from smort.md --execute --bump-version
# Review any *.smort-new created for customized owner files, then clean up:
scripts/verify/smort-upgrade --cleanup-new --execute && scripts/verify/smort-doctor --strict

(Prerequisites: Python 3.10+ stdlib, POSIX bash 3.2+, git 2.38+. Optional: OpenSSH ssh-keygen for signed attestations, gh for PR integration, gitleaks for external deep-gate secret scanning.)

Optional: Always-On Assistant Rules Snippet & Tool Allowlist (CLAUDE.md, .cursor/rules, .gemini/GEMINI.md)

Paste into your agent's persistent rules or session-start hook to prevent chat-confirmation relapses and ensure 1-call post-compaction recovery:

## smort orientation & autonomous-first law (always-on)
- Start every session and post-compaction resume with 1 call: `scripts/verify/smort-resume --lane <lane> --compact`.
- Use 1-command lifecycle tools: `smort-claim`, `smort-verify`, `smort-handoff`, `smort-integrate`, `smort-upgrade`, `slot-apply`.
- Autonomous-first: NEVER stop in chat to ask settings questions or *"Should I proceed?"*. Stage verified `A0` work on `smort/dev` (`main` untouched), pre-build and verify `A1` PRs into `awaiting-slot`, and interrupt only for `A2` emergencies.
- Before raw grepping docs or code, run `scripts/verify/project-map --section "<heading>"`, `scripts/verify/code-index query "<question>" --compact`, or `scripts/verify/code-index affected <file-or-symbol> --compact`.
- Anti-circularity: never cite maps, indexes, handoffs, or lessons as verification proof for changed code — inspect live files and run `scripts/verify/gate` / `smort-verify`.
- Fact precedence: live code & tests > `PROJECT-MAP.md` > `ARCHITECTURE-TDD.md` > `PRD.md` > `HANDOFF.md` > `verify/LESSONS.md`.

Optional harness shell allowlist (eliminates routine popups while keeping git push origin main, --force, gh pr merge, and deploys gated):

  • scripts/verify/*, python3 scripts/verify/*
  • git status*, git diff*, git log*, git fetch*, git branch*, git rev-parse*, git cat-file*, git merge-tree*, git notes*, gh pr list*, gh pr view*, gh pr checks*
  • git checkout -b smort/*, git switch -c smort/*, git add*, git commit*, git push -u origin smort/*, git push origin smort/*, gh pr create*

Explainer Video (04:31 · 1080p)

Watch the smort Narrated Explainer Video

Watch assets/smort_explainer.mp4 · Direct Download (17.67 MiB, 1080p H.264 + AAC) · Subtitles (SRT)

The video introduces the core smort architecture (v5 26-artifact layout). smort v13 (2026-12-03.v17) builds on the same mental model with 38 artifacts, a 24.5 KB Turn-1 manual, env-scrubbed smort-verify + concurrent out-of-band Git Notes & optional OpenSSH signing, O(1) polyglot code-index v4, formal proof anti-cheat, tightening debt ratchets, and a 23-suite cross-platform CI harness.

Video Chapter Index (10 Chapters)
Timestamp Chapter Topic
00:00 01 · Overview Stop Babysitting Your Coding Agents
00:17 02 · The Problem Babysitting Trap vs. Unchecked Autonomy Collapse
00:41 03 · What It Offers One Portable File → Zero-Dependency Repo Control Plane
01:05 04 · Architecture 4-Layer Git-Native Control Plane, Precedence & Anti-Circularity
01:34 05 · Autonomy & Slots A0 / A1 / A2 Routing, Scheduled Owner Slots & 1-Line Replies
02:07 06 · Code & Map Index Unified PROJECT-MAP + Native Zero-Dep code-index, Hub Bypass & not_shown
02:38 07 · Verification Gates Red→Green, Mechanical Shields, Provenance Split & Clean-Checkout Verifier
03:10 08 · Grading & Memory 8-Domain T0–T3 + k/n Grading & Bi-Temporal Self-Healing Memory
03:41 09 · Scale & Sanity Hot-Set & Perf Budgets, Linked Worktrees, conflict-matrix & Counted ROI
04:07 10 · Get Started One-Prompt Setup, < 0.2 s Self-Extractor & github.com/smolboon/smort

Why smort?

Teams adopting coding agents typically hit one of two walls: constant babysitting (answering "Continue?" all day, untangling agent merge conflicts, re-explaining rules after compaction) or unchecked autonomy collapse (self-approved PRs, silently weakened tests/linters, leaked secrets in commit history, bloated instruction files, and unverified slop).

Failure Mode How smort Eliminates It Mechanically
Interrupt fatigue ("Proceed?") Risk-based A0 / A1 / A2 routing + scheduled daily owner timeslots. A0 work flows onto protected smort/dev continuously (main untouched); A1 pre-builds into awaiting-slot for 1-line batch approval via slot-apply; A2 interrupts only for real incidents.
Honor-system self-approval & tampering Independent smort-verify pre-blocks control-plane/symlink tampering, scrubs sensitive env vars, runs verifier-owned SCRIPT_DIR/gate in a detached worktree, and writes out-of-band Git Notes (refs/notes/smort-verify, optionally OpenSSH-signed via verify/allowed_signers) enforced fail-closed by smort-integrate & slot-apply.
Green test theater, proof cheats & slop Strict BASE..HEAD Red→Green SHAs + detached-worktree --verify-red-cmd, single-pass formal proof anti-cheat (Dafny, Lean 4, Coq, Verus, Kani), LF-only nonce-framed diff & commit-history secret scanning, protected suppression guards, tightening max_debt ratchets, and claim-check / ci-guard.
Context cliffs & startup token burn 24.5 KB Turn-1 STOP-READING manual (95.9% skipped), Dual Hot/Cold split (AGENTS.md 14.6 KB gated ≤ 20 KB + PROGRAM.md 4.2 KB gated ≤ 5 KB + Cold docs/PLAYBOOK.md & docs/OPERATIONS.md), 51.9% permanent Week-2 headroom, and 1-call smort-resume.
Blind grepping & scaling cliffs PROJECT-MAP.md + code-index v4: incremental (mtime_ns, size) polyglot code graph across 9+ languages with O(1) Go/Java resolution, zero-copy Rust/C++ lexing, query, scoped affected, runtime-only multi-hop hub bypass, and strict 9-col verify-docs.
Arbitrary line caps & multi-agent races Cohesive single-scope tickets (no 400-line cap) paired with Risk-Sliced Review Maps and exact 40-char head_sha TOCTOU pinning; atomic Git CAS claiming (smort-claim), base:tasks/ authority, parallel conflict-matrix, and sharded ≤ 4 KB smort-handoff / lessons-reflect.

How It Works

Continuous A0 / A1 / A2 Delivery & Timeslot Flow

flowchart LR
    T["smort-resume -> smort-claim (CAS)"] --> C{"Approval Class?"}

    C -->|"A0: In-spec, non-sensitive, 0 new deps"| B0["Build Red->Green on smort/T-nnn + smort-handoff"]
    B0 --> V0["gate --fast -> smort-verify (Env-Scrubbed Worktree + Git Notes)"]
    V0 --> P0{"Fail-Closed smort-integrate"}
    P0 -->|"stage-smort-dev (Day-0 default)"| D0["Stage on smort/dev -> batched M0 at slot"]
    P0 -->|"auto-merge-main (per D-001)"| M0A["Merge to main + TASKS.md"]

    C -->|"A1: Auth/Billing/Schema/Infra/CI/API/UX/New Dep"| B1["Pre-build & smort-verify -> awaiting-slot"]
    B1 --> S1["T-45 conflict-matrix -> T-15 freeze -> T-10 gate-brief (SHA-pinned)"]
    D0 --> S1
    S1 --> R1["Owner Slot: 1-Line Batch Reply"]
    R1 --> M1["slot-apply --execute --push (M0+A1 guards, Git Notes, D-nnn ADRs)"]

    C -->|"A2: Outage / Security / Spend Breach"| ESC["Immediate Owner Escalation"]
Loading

4-Layer Git-Native Architecture

flowchart TD
    subgraph OWNER["1. Owner Layer (Scheduled Timeslots + A2 Only)"]
        O1["PRD.md (Owner-Owned Spec)"]
        O2["PROGRAM.md (Hot 4.2 KB) + docs/OPERATIONS.md (Cold)"]
        O3["gate-brief (M0 + Risk-Sliced A1) -> slot-apply --execute --push"]
    end

    subgraph INDEX["2. Unified Map & Polyglot Code Graph Layer"]
        I1["PROJECT-MAP.md (Features, Constituents, TOC, Epistemic Edges)"]
        I2["ARCHITECTURE-TDD.md + docs/PLAYBOOK.md (Cold On-Demand)"]
        I3["code-index v4 (O(1) Go/Java, 9+ Langs, Bypass, Verify-Docs)"]
        I4["TASKS.md + tasks/T-*.md (DAG + Touch-Sets + Approval Class)"]
    end

    subgraph EXEC["3. Execution & Concurrency Lanes"]
        E0["1-Cmd CLIs: smort-resume · smort-doctor · smort-claim · smort-handoff"]
        E1["Builder Lanes (Parallel smort/T-nnn, Sharded handoffs/ & lessons/)"]
        E2["Trusted Verifier (smort-verify -> refs/notes/smort-verify + SSH Sig)"]
        E3["Serialized Integration Lane (smort-integrate · smort-upgrade · Audits)"]
    end

    subgraph GATES["4. Mechanical Gates, Hooks & Self-Healing Memory"]
        G0["_smort_lib.py (Shared Core, Atomic I/O, Nonce Diff, Notes/SSH)"]
        G1["gate (Single-Pass Parallel Static, Red->Green Proof, Final smort-done)"]
        G2["Guards: fake-work-scan · touch-set-check · ratchet-check · ci-guard · claim-check · install-hooks"]
        G3["conflict-matrix (Parallel Merge-Tree + Semantic Risk) & lessons-reflect (<= 8 KB)"]
    end

    O1 --> I1
    O2 --> E3
    I1 <--> I3
    I2 --> I4
    E0 --> E1
    I4 --> E1
    I3 --> E1
    G0 --> G1
    G0 --> G2
    G0 --> G3
    E1 --> G1
    G1 --> G2
    E1 --> E2
    E2 --> E3
    E3 --> G3
    G3 --> E0
    E3 --> O3
    O3 --> E3
Loading

The 6-Step Lifecycle

  1. Zero-Question Install (smort/install → smort/dev): Agents read §0–§6 only, apply ASSUMPTION: defaults, extract all 38 files + verify/smort-manifest.json, map specs/code, queue async D-001, and immediately branch green-only smort/dev (main untouched).
  2. 1-Call Resume & Atomic Claim: Every session runs smort-resume --lane <lane> --compact (live @health, @progress, @dnt, hot docs, and ready queue in one parallel call), then claims off authoritative base:tasks/ via smort-claim (create-only Git CAS push + automatic rollback/retry).
  3. Orient & Build Red→Green: Builders orient with code-index query/affected and project-map --section, commit failing checks first (Red SHA strictly inside BASE..HEAD), build cohesively inside base-authoritative touch_set (no 400-line cap), run a SINE subtraction pass, and log discoveries via lessons-reflect log.
  4. Parallel Gate & Env-Scrubbed Verification: gate --fast --emit-pow aborts immediately on immutable tampering, runs static checks concurrently with inline failure snippets, executes trusted $SCRIPT_DIR/project-checks.sh, and ends with smort-done. An independent verifier runs smort-verify T-nnn --verifier <id> --execute --push in an env-scrubbed detached worktree, pushing concurrent retry-merged refs/notes/smort-verify before updating the branch.
  5. Continuous A0 Promotion & Scheduled Owner Timeslots: Attested A0 tasks promote via smort-integrate onto smort/dev (or main --allow-main per D-001); A1 PRs wait in awaiting-slot. Before each timeslot, Integration reconciles (conflict-matrix + smort-handoff --rollup) and emits a 1-screen gate-brief (M0 + up to 5 Risk-Sliced A1 PRs + D1.. decisions + pinned 40-char head_sha). You reply once:
    approve M0 M1 M2; hold M3 M4 (needs load test); D1 A; D2 defer
    
    slot-apply --manifest verify/logs/slot.json --reply "<reply>" --execute --push enforces M0 + A1 security guards, Git Notes / SSH signature & head_sha pins, merges exact pinned_sha, writes sequential D-nnn ADRs and TASKS.md updates on main before push, and logs a receipt.
  6. Nightly Deep Audit & Completion Mode: A timeboxed nightly pass runs gate --full --lane integration, updates 8-domain AUDIT.md + AUDIT-LOG.md, compacts verify/LESSONS.md (≤ 8 KB), rolls up HANDOFF.md, and switches automatically to quiet maintenance mode once all Must features and target tiers pass.

Core Pillars

1. Tiered Context Budgets & Precedence

Startup context tax compounds on every turn and compaction. smort gates hot-set files mechanically via ratchet-check --verify-config --budgets verify/budgets.json --check-hot-set:

Tier Loaded When Files / Commands Measured Budget (smort v13)
Tier 0: Turn-1 Guard Initial read of smort.md only Top-of-file directive + <!-- SMORT-STOP-READING-HERE --> 25,076 B (24.5 KB, ~6.3K tok, 4.1%) — 579,868 B (566.3 KB, 95.9%) skipped
Tier 1: Hot Set Every session start / resume (smort-resume --compact) AGENTS.md (14,931 B, gated ≤ 20 KB), PROGRAM.md (4,293 B, gated ≤ 5 KB), HANDOFF.md (2,327 B, gated ≤ 4 KB / 60 L) + handoffs/*.md, verify/LESSONS.md (≤ 8 KB), AUDIT.md §1, latest AUDIT-LOG.md Day-1: 21,551 B (~5,388 tok)
Week-2 max: 31,512 / 65,536 B (51.9% permanent headroom; 45.7% with a full 4 KB shard)
Tier 2: Cold Manuals & Specs On demand per task / event project-map --section "<heading>" (supports docs/PLAYBOOK.md::§3.4, CommonMark §4.5 live redacted read + not_shown) Keeps docs/PLAYBOOK.md (21.0 KB), docs/OPERATIONS.md (19.2 KB), PRD.md, ARCHITECTURE-TDD.md, and tasks/archive/ out of startup context
Tier 3: Native Code Graph Before grepping or editing code-index query & code-index affected --compact Incremental (mtime_ns, size) single-pass git ls-files -z graph across 9+ languages
  • Rule Precedence: Owner Hard Rules (AGENTS.md §1.0) > AGENTS.md §1 > smort.md > task prompt
  • Fact Precedence: live code & tests > PROJECT-MAP.md > ARCHITECTURE-TDD.md > PRD.md > HANDOFF.md > verify/LESSONS.md
  • Anti-Circularity: Indexes, maps, handoffs, and lessons accelerate navigation only — never verification proof for freshly edited code or gates.

2. Zero-Trust Verification, Security & Anti-Slop

  • Out-of-Band Cryptographic Attestation: smort-verify blocks tampering & symlink/gitlink escapes before worktree creation, scrubs sensitive env vars (SMORT_SIGN_KEY, SSH_AUTH_SOCK, GH_TOKEN, AWS_*, GIT_*), enforces base-authoritative anti-self-verification, and writes SHA-256 verified_code_hash notes to refs/notes/smort-verify (concurrent retry-merge push; optional ssh-keygen -Y sign verified automatically against base:verify/allowed_signers with * wildcards banned).
  • base-Authoritative Policies & Unconditional M0 Guards: touch-set-check, smort-verify, smort-integrate, and slot-apply read touch_set, approval, DO_NOT_TOUCH, additive A1_SENSITIVE_PATHS (acronym/digit/camelCase-aware), and PROGRAM.md freezes from the base ref — blocking branch A1 → A0 downgrades, touch_set widening, and unauthorized M0 control-plane edits.
  • Anti-Bypass Diff & Formal Proof Defense: LF-only nonce-framed iter_unified_diff defeats commit-msg spoofing, \r/\u2028 desync, spaced paths, diff.noprefix, and .gitattributes -diff; -m/%B/.env/entropy scans catch buried secrets; single-pass lexers catch formal proof cheats (assume/sorry/admit/{:verify false}/decreases *) across Dafny, Lean 4, Coq, Verus, and Kani.
  • Immutable Control Plane & Zero-Pollution Hygiene: Locks scripts/verify/*, .githooks/*, verify/*.json, verify/allowed_signers, verify/lessons/human.jsonl, .gitattributes, .gitmodules, 160000 gitlinks, 120000 symlinks, and build-runner configs (conftest.py, Makefile, setup.py, build.rs, .npmrc, vite.config.*, CMakeLists.txt). All 21 Python files set sys.dont_write_bytecode = True and use atomic writes.

3. Polyglot Code Graph (code-index v4), Grading & Memory

  • Incremental Polyglot Graph: Indexes Python (ast), TypeScript/JavaScript (.ts/.tsx/.js/.jsx/.mjs/.cjs/.mts/.cts), Rust, Go, Java/Kotlin, C/C++, C#, Terraform/HCL, and SQL plus nested manifests (depth 3) and tsconfig.json paths/"extends"/barrels.
  • Fast & Sound Analysis: Single-pass git ls-files -z + os.stat(), O(1) Go/Java import resolution (~0.5 s / 500 files), zero-copy Rust/C++ lexers, JS ${...} templates & TSX </div>/++ handling, Python decorators/default-args, iterative cycle DFS, exact affected, multi-hop runtime-only hub bypass, and strict 9-col verify-docs.
  • Objective 8-Domain Grading (AUDIT.md): Binary T0–T3 tiers + k/n ratios across Correctness, Architecture, Security, Performance, Code Quality, Verifiability, Operational Readiness, and Delivery — paired with tightening max_debt ratchets and boundary-matched D-nnn ADR overrides.
  • Bi-Temporal Self-Healing Memory (lessons-reflect): Sharded O_APPEND logging, isolated immutable verify/lessons/human.jsonl 3× overrides, SHA-256 dedup & file-fingerprint staleness retirement, ref-day=YYYY-MM-DD immunity to midnight 00:00 UTC CI drift, O(log K) 8 KB auto-compaction, and batched --as-of time travel.

Day-to-Day CLI Reference

# 1. Start session, check health & claim next ready task atomically
scripts/verify/smort-resume --lane backend --agent codex --compact
scripts/verify/smort-doctor --strict
scripts/verify/smort-claim --lane backend --agent codex --compact

# 2. Orient in code & cold manuals before grepping
scripts/verify/code-index query "verify_token" --compact
scripts/verify/code-index affected src/auth/guard.py --compact
scripts/verify/project-map --section "docs/PLAYBOOK.md::§3.4"          # live cold read

# 3. Run parallel gate, write bounded handoff & verify in env-scrubbed detached worktree
scripts/verify/gate --fast --red-sha <red-sha> --verify-red-cmd "pytest tests/test_auth.py" --emit-pow
scripts/verify/smort-handoff --agent codex --state "in-review" --next "verifier check" --compact
scripts/verify/smort-verify T-014 --verifier reviewer-2 --execute --push --compact
# With optional OpenSSH signing (enforced automatically when base:verify/allowed_signers exists):
scripts/verify/smort-verify T-014 --verifier reviewer-2 --sign-key ~/.ssh/smort_ed25519 --execute --push --compact

# 4. Promote attested A0 work, check architecture/budgets & record experiential memory
scripts/verify/smort-integrate T-014 --execute --push --delete-source --compact
scripts/verify/code-index --check-map --cycles && scripts/verify/code-index verify-docs --strict
scripts/verify/code-index bypass src/auth/guard.py --pattern "jwt\.decode"
scripts/verify/ratchet-check --verify-config --budgets verify/budgets.json --check-hot-set
scripts/verify/lessons-reflect log --task T-014 --topic auth.guard --outcome useful --note "Check authz before existence" --files src/auth/guard.py
scripts/verify/lessons-reflect build --if-stale --max-bytes 8192

# 5. Pre-slot reconciliation, brief & deterministic owner-reply execution
scripts/verify/conflict-matrix --worktree isolated
scripts/verify/smort-handoff --rollup --prune-hours 24 --compact
scripts/verify/gate-brief --slot "Evening 18:30" --max-prs 5 --json-out verify/logs/slot.json
scripts/verify/slot-apply --manifest verify/logs/slot.json --reply "approve M0 M1; hold M2 (load test); D1 A" --dry-run --push
scripts/verify/slot-apply --manifest verify/logs/slot.json --reply "approve M0 M1; hold M2 (load test); D1 A" --execute --push

Owner Settings & Exit-Code Contract

Setting (PROGRAM.md §0 / AGENTS.md §0) Default (ASSUMPTION: until first slot) Purpose
{{AVAILABILITY_SLOTS}} Morning 08:30–08:45, Evening 18:30–18:45 Scheduled review windows; zero non-A2 pings between slots
{{A0_FLOW}} stage-smort-dev (optional auto-merge-main per D-001) Stages verified A0 work on green-only smort/dev (main untouched)
{{A1_SENSITIVE_PATHS}} auth,oauth,rbac,billing,payment,migration,schema,infra,terraform,.github,security,crypto,secret Strictly additive patterns forced to A1 by touch-set-check & smort-integrate
{{MATURITY_TARGET}} production (mvp / production / hardened) Target tier (T1 / T2 / T3) across all 8 domains in AUDIT.md
{{MAX_OPEN_PRS}} / {{MAX_SLOT_PRS}} 5 concurrent A1 PRs / 5 per slot (always admits ≥ 1) Anti-rubber-stamp slot pacing; no per-ticket line cap + Risk-Sliced Maps (≥ 300 L)
{{USAGE_CAP}} 70% Scales back to morning slot and pauses nightly audit near plan limits
Exit Meaning
0 Pass / clean / succeeded (including idempotent already-merged no-ops)
1 Gate, security, scope, attestation/signature, TOCTOU HEAD MOVED, tamper, conflict, or health failure
2 Usage/flag error, invalid --base/--agent/MAX_PR_LINES, forbidden lane/base, missing --sign-key, or UNVERIFIABLE (unwired project-checks.sh / missing external scanner in --full)
3 Ambiguous match (project-map --section, code-index)
4 Not found, empty queue, release freeze / maintenance pause, or NEEDS_DECISION confirmation / shrink-guard

Detailed Reference & Release Notes

All 38 Self-Extracted Artifacts & Script Flags Reference (12 Templates · 23 Scripts/Lib · 3 Configs)

Templates (12)

Path Tier Purpose
AGENTS.md Hot (14.6 KB, ≤ 20 KB) Project facts, stale-prior table, hard rules 1.0–1.14, active budgets, daily commands, security boundaries (verify/allowed_signers format), cold manual pointers, starter Known Mistakes (M1–M3)
PROGRAM.md Hot (4.2 KB, ≤ 5 KB) §0 availability slots, A0 flow, roster/solo fast-path, freezes, caps, trusted authors + §1 compact A0/A1/A2 matrix
HANDOFF.md Hot (2.3 KB, ≤ 4 KB / 60 L) Crash-safe resume rollup written/pruned by smort-handoff alongside per-agent handoffs/<slug>.md
docs/PLAYBOOK.md Cold (21.0 KB) Stack presets, Reference-Coding + License Wall, SINE discipline, smort-verify & refs/notes/smort-verify protocol, 7-Question Benchmark Check, QA bar, slop list, DoD, PR checklist
docs/OPERATIONS.md Cold (19.2 KB) Loop diagram, daily/nightly rhythm, reconciliation, A0 promotion, rollback, A2 hotfix, completion mode, 3-Outcome Triage, slot brief & slot-apply syntax
DEVELOPMENT-WORKFLOW.md Cold (4.5 KB) One-page canonical map of artifacts and flow from idea to completion
PRD.md Cold (3.4 KB) Owner-owned requirements, personas, JTBD, metrics, FR/NFR, MoSCoW, non-goals, compliance
PROJECT-MAP.md Cold (9.2 KB) Feature Index (F-nnn), Constituents (S*.C*), generated TOC, Epistemic Dependencies, External Deps/Licenses, generated Build Order & Critical Path
ARCHITECTURE-TDD.md Cold (8.0 KB) Topology, durable vs. invocation state, API contracts (verify-docs), Auth/Hub Bypass boundaries, STRIDE + abuse modeling, ADRs, task derivation
TASKS.md Cold (16.8 KB) Task YAML schema, atomic smort-claim protocol, §5 delegation algorithm, 5 task-creation triggers, shrink-guarded generated index
AUDIT.md §1 Hot (12.4 KB) Completion dashboard, 8-domain scorecard (T0–T3 + k/n), open findings, binary tier checklists
AUDIT-LOG.md Latest Hot (1.5 KB) Append-only nightly audit history

Shared Core & Executable Scripts (23)

Path Key Flags / Subcommands Role
scripts/verify/_smort_lib.py --gate-meta, --resolve-base, --resolve-main, --a1-sensitive, --code-hash, --check-immutable, --code-lines Shared zero-dep core (non-exec, dont_write_bytecode = True): 1-call for-each-ref base resolution, atomic writes, LF-only nonce-framed iter_unified_diff, history secret scan, vendor+entropy redactor, deadlock-free batch_git_cat_bytes, load_tasks_from_ref, symlink/gitlink check, additive policies, regex matches_glob, CommonMark §4.5 step_fence, concurrent retry-merged Git Notes + OpenSSH ssh-keygen -Y helpers
scripts/verify/smort-resume --lane, --agent, --topic, --max-chars, --compact, --json, --offline 1-call parallel startup packet (@health, @progress, @dnt, 512-byte code-index peek, base:PROGRAM.md, verifier hard rules, <untrusted_source> PR framing, not_shown)
scripts/verify/smort-claim [T-nnn], --lane, --approval, --agent, --base, --retries 3, --ignore-lifecycle, --dry-run, --offline, --compact, --json Atomic task claimer reading base:tasks/ + tasks/archive/, enforcing ready/deps/freeze/DO_NOT_TOUCH, create-only CAS push, --claim-check, and reset --hard rollback + retry
scripts/verify/smort-verify <T-nnn>, --verifier, --mode, --sign-key, --notes-only, --red-sha, --verify-red-cmd, --full, --dry-run, --execute, --push, --compact, --json Zero-trust clean-checkout verifier: upfront --sign-key fail-fast, pre-worktree tamper/symlink block, sensitive env scrubbing, verifier-owned SCRIPT_DIR/gate, base-auth anti-self-verify, concurrent retry-merged refs/notes/smort-verify pushed before branch, solo checkout FF
scripts/verify/smort-handoff --agent, --rollup, --task, --state, --next, --blocker, --note, --prune-hours, --dry-run, --compact, --json Crash-safe, whole-block PEM/secret-redacted, budget-enforced (≤ 4096 B / 60 L) shard writer & HANDOFF.md rollup (Updated: header pruning, local-only fallback)
scripts/verify/smort-integrate <T-nnn>, --branch, --target, --dry-run, --execute, --push, --delete-source, --allow-main, --allow-unverified, --offline, --ignore-freeze, --compact, --json Serialized A0 promoter: fetches origin --prune, base-auth approval == A0, fail-closed Git Notes (+ OpenSSH sig; accepts --notes-only), pre-flight scope/sensitive/immutable/symlink/history scan, git merge-tree conflict check, diverged-target & rollback guards, atomic status + TASKS.md commit
scripts/verify/smort-upgrade --from, --dry-run, --execute, --bump-version, --cleanup-new, --compact, --json CRLF-safe, path-safe in-place upgrader: atomically upgrades 22 engine scripts & SHA-256-tracked unmodified templates, preserves project-checks.sh & customized owner files (*.smort-new), syncs .gitignore, bumps Template version
scripts/verify/smort-doctor --strict, --compact, --json Read-only health diagnostic: toolchain, 23 scripts + 3 configs, manifest integrity, pycache_hygiene, leftover *.smort-new, .gitignore, project-checks.sh stub check, .githooks, hot-set budgets, Template version parity, code-index freshness
scripts/verify/gate -h|--help, --fast, --full, --dry-run, --fail-fast, --sequential, --task, --no-task, --red-sha, --verify-red-cmd, --require-gitleaks, --max-lines, --allow-large, --emit-pow, --base Single-pass --gate-meta SCRIPT_DIR-pinned parallel static gate: immediate immutable abort, 15-line inline failure snippets, trusted $SCRIPT_DIR/project-checks.sh, unconditional smort/T-nnn auto-task, strict MAX_PR_LINES, red→green proof, allowlisted SECRET_SCANNER_CMD, Provenance Split PoW & final-line smort-done
scripts/verify/touch-set-check <T-nnn>, --base, --do-not-touch, --sensitive --no-renames -z, symlink 120000 & gitlink 160000 guard, base-auth touch_set/approval, additive DO_NOT_TOUCH & acronym/digit/camelCase A1_SENSITIVE_PATHS, regex matches_glob
scripts/verify/fake-work-scan --staged, --base, --lane, --task, --no-history, --redact LF-only nonce-framed diff + -m/%B history secret scan, .env/.gitmodules/160000/immutable/build-runner guards, single-pass 4-lang formal proof anti-cheat, blanket/protected suppressions, except:+comment+pass, slop, TS any, whole/partial test deletions, --redact
scripts/verify/ratchet-check --verify-config, --budgets, --check-hot-set, --debt k=N, --tighten, --measure k=v, --baseline, --update, --allow-lower --decision D-nnn, --json Atomic config/schema validation, monotonic quality ratchets, tightening max_debt ceilings, hot-set budgets (AGENTS.md ≤ 20 KB, PROGRAM.md ≤ 5 KB, handoffs, lessons), perf + sanity floors, boundary-matched ADR --allow-lower
scripts/verify/tasks-index --live, --next, --lane, --approval, --do-not-touch, --ignore-lifecycle, --claim-check, --validate, --check, --compact, --json, --force Authoritative base:tasks/ loader, DAG validation, --no-merged parallel live branch overlay (local-only fallback, malformed-YAML isolation), sound overlap check, full §5 ranking, shrink-guarded index
scripts/verify/project-map --check, --dry-run, --impact, --section, --file, --max-chars, --compact, --force Table validation (no bare INFERRED/0.5), natural sorting, atomic TOC/build order with shrink-guard, CommonMark §4.5 live redacted --section reader (docs/PLAYBOOK.md::§3.4, preserves ## 1. C#)
scripts/verify/code-index build, query, affected, hubs, bypass, verify-docs, --check-map, --cycles, --worktree, --no-rebuild, --max-age-days, --compact, --json Schema v4 single-pass git ls-files -z stat-cached polyglot/monorepo code graph (O(1) Go/Java, zero-copy Rust/C++, JS ${...}/TSX, Python decorators, multiline TS class/enum, nested tsconfig, iterative DFS, multi-hop runtime-only bypass, 9-col verify-docs)
scripts/verify/conflict-matrix --base, --branches, --worktree, --all-pairs, --report-only, --fail-on-semantic Parallel --no-merged disjoint-filtered git merge-tree textual + constituent/edge/hub semantic conflict matrix (local-only fallback, atomic reports)
scripts/verify/gate-brief --slot, --base, --max-prs 5, --max-lines 0, --slice-lines 300, --json, --json-out Secret-redacted 1-screen plain-prose owner brief from base:tasks/ with M0, Risk-Sliced A1 PRs, --notes-only support, SHA-pinned JSON manifest & counted ROI
scripts/verify/slot-apply --manifest, --reply, --dry-run, --execute, --push, --allow-unverified, --allow-head-moved, --allow-immutable, --merge-mode, --receipt, --compact, --json Deterministic TOCTOU-pinned reply executor: fetches origin --prune, unconditional M0+A1 security guards, fail-closed Git Notes (+ OpenSSH sig), mixed gh+M0 mode, sequential D-nnn ADRs & status updates committed on main before --push, receipt logging
scripts/verify/install-hooks --protected, --check, --uninstall, --remove-files Opt-in .githooks/pre-commit (HEAD-diff scanner tamper + SMORT_LANE=integration block) & .githooks/pre-push (main/master, smort/dev, refs/notes/smort-verify protection) + SHA-256 --check
scripts/verify/lessons-reflect log (--human --files --ts), build (--now --as-of --if-stale --max-bytes 8192 --json), --check, --worktree Bi-temporal memory with O_APPEND logging, immutable human.jsonl 3× overrides, ref-day midnight-safe --check, --if-stale, O(log K) compaction, batched --as-of
scripts/verify/ci-guard --max-timeout, --allow-expr-timeout, --require-workflows, --self-test GitHub Actions job-level timeout-minutes linter (2/4-space, pre-jobs: block scalars, YAML 1.2 apostrophe-safe quotes, duplicate-key & multi-jobs: checks)
scripts/verify/claim-check [files...], --rules, --self-test, --json Precompiled-regex CommonMark §4.5 step_fence & HTML-comment-aware doc-claim linter
scripts/verify/project-checks.sh --fast, --full Project-specific lint/type/unit/integration/build hook (invoked via trusted $SCRIPT_DIR/project-checks.sh; preserved across smort-upgrade)

Starter Configs (3)

Path Role
verify/ratchet.json Monotonic quality floors (test_count, coverage_pct, mutation_pct) & tightening max_debt ceilings
verify/claims.json Declarative doc-truth lint rules (SMORT-NO-LOCAL-EVIDENCE, SMORT-NO-FALSE-CI-GREEN)
verify/budgets.json Hot-set ceilings (AGENTS.md ≤ 20 KB, PROGRAM.md ≤ 5 KB, HANDOFF ≤ 4 KB / 60 L, LESSONS ≤ 8 KB, combined ≤ 64 KB) & perf regression ceilings
Install Paths (New Repo, Spike, Existing Repo, Upgrade) & Inside smort.md
  • Path A — New Project (smort.md §4.3): Auto-detects §3 defaults, extracts all 38 files + verify/smort-manifest.json onto smort/install, runs smort-doctor, fills PRD.md/PROJECT-MAP.md/ARCHITECTURE-TDD.md, derives initial tasks (project-checks.sh + smoke.sh + contracts as A0; CI as A1 into awaiting-slot), opens smort/install + queues D-001, and immediately branches smort/dev to start building.
  • Spike Escape Hatch (spike/<slug>): Timeboxed, strictly non-mergeable branch exempt from PROJECT-MAP.md and ratchets for validating high-uncertainty product/technical feasibility, then deleted cleanly before Path A.
  • Path B — Existing Codebase (smort.md §4.4, non-destructive): Preserves all existing files verbatim (collisions write to *.smort-new), runs code-index build && code-index hubs --cycles to map real dependencies with zero LLM tokens, reverse-engineers PROJECT-MAP.md and ARCHITECTURE-TDD.md read-only, opens smort/install, and immediately branches smort/dev.
  • Inside smort.md: §0 Turn-1 Token Guard & Execution Law · §1 Resume Protocol · §2 Core Invariants Map · §3 Owner Settings & Thresholds · §4 Install, Upgrade & Spikes · §5 Execution Loop & Solo Fast-Path · §6 8-Domain Grading · <!-- SMORT-STOP-READING-HERE --> · §7 12 Repo Templates (~~~~) · §8 23 Scripts/Lib & 3 Configs (~~~~).
What's New in smort v13 (2026-12-03.v17) & Measured Benchmarks
  • Day-1 Reliability Fixes: YAML 1.2 apostrophe-safe ci-guard; ref-day-pinned lessons-reflect (immune to midnight 00:00 UTC CI drift) + atomic O_APPEND logging; concurrent retry-merged refs/notes/smort-verify, solo checkout FF, --notes-only integration support, upfront --sign-key fail-fast, wildcard * signer ban, and .githooks/pre-push notes protection; slot-apply unconditional M0 + A1 security guards (--allow-immutable opt-in), fixed gh + M0 bookkeeping, and sequential D-nnn ADRs; authoritative base:tasks/ loading, offline/local-only fallback, CRLF smort.md normalization, and Updated: header-timestamp pruning.
  • Zero-Trust & Ergonomics: LF-only random-nonce-framed iter_unified_diff; single-pass 4-lang formal proof anti-cheat; smort-verify env scrubbing + trusted $SCRIPT_DIR/project-checks.sh + immediate gate immutable abort + 15-line inline failure snippets + --help; .gitmodules, 160000 gitlinks, build-runner configs, HEAD-diff pre-commit, allowlisted SECRET_SCANNER_CMD; acronym/digit A1_SENSITIVE_PATHS (RBACPolicy.ts, AUTHService.ts, oauth2.py); project-map --section docs/PLAYBOOK.md::§3.4; smort-resume --compact @dnt & freeze-safe --lane integration.
  • code-index v4 Scaling & Lexer + SINE Subtraction: O(1) Go/Java resolution, zero-copy Rust/C++ lexers, single git ls-files -z + os.stat(), iterative cycle DFS, JS ${...} template stack & TSX </div>/++ regex fix, Python decorators/default-arg calls, multiline TS class/enum, nested tsconfig "extends", multi-hop barrel bypass, 9-col verify-docs; DRY lifts into _smort_lib.py (0 new scripts) and max_agents_bytes: 20480.

Measured on Linux 6.18.57 x86_64, Python 3.12.16, git 2.56.1 (idle CPU):

Metric smort v12 smort v13 Delta / Speedup
Turn-1 §0–§6 Manual (smort.md) 28,932 B (5.1%) 25,076 B (4.1% · 95.9% skipped) -13.3%
Hot AGENTS.md (max_agents_bytes: 20480) 16,938 B (154 L) 14,931 B (138 L) -11.8%
Day-1 Hot Set (AGENTS + PROGRAM + HANDOFF) 23,558 B (~5,890 tok) 21,551 B (~5,388 tok) -8.5%
Week-2 Hot-Set Headroom (of 65,536 B) 49.2% (33,300 B) 51.9% (31,512 B) +2.7 pp
code-index build (500-file Go stdlib-miss) 27,607.2 ms 597.2 ms 46.23× faster
code-index build (500-file Java stdlib-miss) 40,160.0 ms 524.1 ms 76.62× faster
code-index Rust 200 KB lexer 283.3 ms 189.6 ms 1.49× faster
smort-resume --offline --compact (200-file repo) 408.3 ms 398.7 ms 1.02× faster
gate --fast / smort-verify --dry-run (200-file repo) 1,043.4 / 1,369.3 ms 1,052.1 / 1,453.0 ms Parity (+env-scrub, symlink/gitlink & proof guards)

Verification, Fit & Repository Contents

Running the Verification Suite Locally

This repository ships a zero-dependency 23-suite end-to-end & adversarial harness (tests/verify_smort.py) that extracts all 38 artifacts into isolated temporary Git repos and exercises every script, negative control, context budget, OpenSSH-signed Git Note, concurrent push-merge, env-scrub, parser edge case, and security PoC:

python3 tests/verify_smort.py

The same suite — plus dogfooding extracted ci-guard on .github/workflows/ci.yml and claim-check on this README.md — runs automatically on ubuntu-latest and macos-latest.

When NOT to Use smort

smort is built for real software repositories evolving across days, weeks, or months. Skip it for one-off throwaway scripts or single-commit hotfixes on repos you don't maintain (inside an existing smort repo, use a non-mergeable spike/<slug> branch for quick experiments).

Repository Contents

About

Single-file, zero-dependency operating system for autonomous, gated multi-agent coding — Git-native verification, signed Git Notes attestation, polyglot code indexing, and scheduled approval slots.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages