drift

agent
Security Audit
Fail
Health Warn
  • License — License: NOASSERTION
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Fail
  • rm -rf — Recursive force deletion command in .github/workflows/publish.yml
  • rm -rf — Recursive force deletion command in .github/workflows/verify.yml
  • network request — Outbound network request in .github/workflows/verify.yml
  • process.env — Environment variable access in bridges/drift.mjs
  • fs.rmSync — Destructive file system operation in bridges/drift_cli.mjs
  • process.env — Environment variable access in bridges/drift_cli.mjs
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Release gate that fails CI when an AI coding agent weakens, skips, or deletes a test — backed by owner-approved TOML contracts and an open MIT verifier.

README.md

DRIFT — Specification-Driven Proof Gate

DRIFT is a release gate that binds test evidence to owner-approved TOML behaviour contracts by digest.
Use it when AI agents or fast-moving teams write code and tests together and CI must fail if a test drops, weakens, skips, or silently edits an expected behaviour.
Skip it for throwaway prototypes or when passing unit tests are enough: DRIFT is not a test runner, and it only guards behaviour you declare.

Quick Start · Shadow Mode · Trust & Verifier · Guides · Bridges · CLI · Editions · 🇮🇹 Guida · Installa


Caught in the Act: Test Runner vs. DRIFT Gate

When an agent breaks GET /items/1 and "fixes" the failing build by weakening or deleting the test, ordinary runners still exit 0:

What Changed Standard Test Runner (node --test / pytest / mvn test) drift gate & verifier/drift_verify.py
Drops name assertion PASS (False Green) — status 200 passes; runner exits 0. FAIL — d.check throws no check for then.name; incomplete reads stay bound, never verified.
Edits then.status = 500 in contract PASS (False Green) — test reads 500 and passes. FAIL (DR-E601) — dr2b: behaviour digest changes; stale approval blocks the gate.
Deletes the failing test PASS (False Green) — remaining tests pass. FAIL (gone: 1, when coverage drops) — .meta.json inventory discards orphaned events and blocks the gate whenever remaining evidence no longer covers the requirement.
More anti-cheat guards (no-op/tautology callbacks, self-stubbed tests, and proof states)
  • Empty / tautology callbacks ((v) => {}, () => true, (v) => true, lambda v: None, lambda v: True) fail immediately with AssertionError.
  • Self-stubbed tests (d.buildOutput('found') fed back into assertions) never record then.* reads (bound only) and surface oracle.self_stubbed in review / gate --explain.
  • Strict proof states: missing (never green) → red (failed) → bound (passed without reading every then key) → verified (bridge recorded full then reads/checks against the approved dr2b: digest, independently re-judged when observations are attached) → killed (Enterprise: rejected synthetic mutations via drift mutants).
  • Full threat model and CI adversarial scenarios: GUARANTEES.md.

How It Works (One Slice, Four Steps)

Write one compact schema 0.3 contract per slice (CLI release 0.12.2), seal behaviour (dr2b:) and assurance (dr2a:) separately, bind tests to cases, and run the gate:

drift = "0.3"
id = "item-get"
intent = "Return a single catalog item by identifier or 404 when absent."

[use]
profile = "http-json@1"

[scope]
surface = "GET /items/{id}"
writes = []
reads = ["items"]
indirect = "none"

[bind]
code = ["src/main/java/example/items/**"]

[cases.found]
at = ["http"]
when.request = "GET /items/1"
then.status = 200
then.name = "lamp"
drift fmt .drift/contracts/item-get.toml            # 1. Canonical TOML layout
drift check .drift                                  # 2. Static validation in one pass
drift approve .drift/contracts/item-get.toml --by alice  # 3. Human owner seal (dr2b / dr2a)
drift run --gate -- pytest                          # 4. Export views, run tests & gate (or: drift gate .drift/contracts --events target/drift/events.jsonl)

Quick Start

Install the single static binary (Linux x86_64, macOS arm64/x86_64, Windows x86_64; verified via SHA256SUMS — see INSTALL.md / INSTALL.it.md):

./install.sh     # Linux / macOS (Windows: .\install.cmd from release archive)
drift version

Bootstrap a New Project Area

drift init alice .
drift approve .drift/config.toml --by alice
mkdir -p .drift/profiles
cp ~/.local/share/drift/example/.drift/profiles/[email protected] .drift/profiles/
drift new .drift/contracts/health-check.toml --profile http-json@1 --intent "Report service readiness."

Run drift doctor at any point to diagnose missing config, profiles, or events, and drift explain DR-E601 for exact fixes.

Try on an Existing Repo (Shadow Mode)

Evaluate DRIFT on any existing or read-only repository without committing a single file:

drift init alice /path/to/repo --state-dir ~/.drift-shadows/my-service
drift approve ~/.drift-shadows/my-service/.drift/config.toml --by alice
drift status /path/to/repo

Credit existing JUnit XML runs (capped at bound) with verifier/drift_shadow_junit.py and promote in-tree later with drift init --unshadow — see docs/adopt/existing-repo.md.


Trust Without Taking Our Word For It

  • Native V CLI + open MIT verification: The drift CLI engine is a compiled V binary (proprietary, zero runtime dependencies), while verifier/drift_verify.py (100% Python 3.11+ stdlib, MIT License) independently recomputes dr2b:/dr2a:/dr1: digests, validates .jsonl proof events, drift.observation/1 envelopes, and .meta.json inventories, and enforces the single-contract fail-closed gate verdict offline without invoking drift (CLI-only area-wide checks such as policy.sweep = "soundness" are surfaced explicitly as unevaluated).
  • Honest trust boundaries: Approval seals detect content edits; authenticating who approved belongs to Git signed commits + CODEOWNERS on .drift/** (and optional OpenSSH signatures verified against --trust-root). Proving tests genuinely ran requires a trusted CI runner. See GUARANTEES.md and Red-Team Benchmark.

Explore by Goal

Goal Start Here
Learn the core workflow (L0 → L3) GUIDE.md · Guida (IT)
Adopt on an existing repo without committing .drift/ Shadow Mode & Brownfield
Use with AI coding agents, hooks & drift-ask-ui AI Agents & Desktop Approval
Wire tests across 11 runtimes (Java, Scala, JS, Python, Rust, V, C++, C#, Godot, PHP, COBOL) Polyglot Test Bridges
Speed up CI (select, --base reuse, @recall, plan, mutants, sweep) Incremental & Wave Workflows
Carve out monoliths, WSDL/COBOL, DB migrations & cutover parity Legacy Cutover
Gate game/simulation determinism, tolerances & zero-alloc frame budgets Real-Time & Simulation
Gate formal proofs (CBMC/Kani/TLC/Gappa/QCEC), budgets, security & regulated controls Formal & Regulated
Verify UI interaction sequences (Playwright, Compose, Windows UIA) UI Sequences
Coordinate clean-room supplier grants, bilateral pacts & federated rollouts Multi-Repo Governance
Look up every CLI command, flag & exit code CLI Reference (generated)
Compare Free, Pro & Enterprise capabilities EDITIONS.md

Polyglot Test Bridges (11 Runtimes, Zero Lock-In)

Expected values live once in .toml. Every bridge is MIT-licensed and zero-dependency (Java/Scala use JUnit Platform):

// JavaScript / TypeScript (bridges/drift.mjs — node --test, Vitest, Jest)
import { test } from 'node:test';
import { runDriftCase } from './drift.mjs';

test('GET /items/1 returns existing item', async (t) => {
  await runDriftCase({ contract: 'item-get', t, cases: ['found'], level: 'http' }, async (d) => {
    const res = await send(d.when('found', 'request'));
    await d.check('found', { status: res.status, name: res.body.name });
  });
});
Runtimes CI Verification Tier Artifacts & Guide
Java 17–25 (JUnit 5), JS/TS, Python 3 Public CI E2E (live HTTP + CLI/verifier parity) drift-junit, drift.mjs, drift.py · Primary
Rust, C++20, C#/.NET, PHP 8.2+, COBOL 85 Public CI Smoke & cargo test + Private E2E bridges/rust, drift_cpp.hpp, Drift.cs, Drift.php, drift_cobol.py · Bridges
V, Scala 2.12–3.9, JUnit 4, Godot 4 Private CI / Shared JVM / Experimental drift_v, drift-junit, DriftJUnit4.java, drift.gd · Matrix

Editions & Licensing

Edition Focus Key Capabilities
DRIFT Free (drift) Core SDD loop & local assurance Contracts (0.3), dr2b/dr2a seals, Shadow Mode, drift run --gate, drift bridge certify, drift map & drift-map-ui, drift-ask-ui, drift hook, drift eval, all 11 bridges (drift.bridge-plan/2), local budget/security/formal/regulated/UI/grant/pact gating, MIT verifier/drift_verify.py
DRIFT Pro (drift-pro) Team velocity & multi-agent scale select --plan/--cmd/--build-graph, gate --base reuse, impact, recall, plan --pack/--active/--compile-edges/--verify-slice/--certificates, merge, review --base, OpenAPI/AsyncAPI/WSDL/COBOL scaffolding, export grant, drift pact
DRIFT Enterprise (drift-enterprise) Fleet soundness & cryptographic release mutants (proof = "killed"), sweep --flow --simplify --promote --pacts, review --base --explain-conflicts, gate --attest --ssh-sign --trust-root --allow-break-glass, gate --as junit, stats --churn-list
  • Dual-surface license (LICENSE): Bridges, verifier/, schemas/, hooks/, ui/, map-ui/, release/, skill/drift/, skills/drift/, example/, assets/, installers, and docs are MIT; CLI binaries are proprietary (complimentary DRIFT Enterprise grants are available for public OSI open-source repositories — see LICENSE Part III §2).
  • Support & Security: SUPPORT.md · SECURITY.md · CONTRIBUTING.md · CHANGELOG.md

Reviews (0)

No results found