veristack 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +143 -2
- package/bin/vstack.mjs +11 -0
- package/dist/cli.mjs +11894 -0
- package/lint/oxlint-explicit-state-machine.mjs +244 -0
- package/lint/oxlint-no-comments.mjs +103 -0
- package/package.json +63 -4
- package/skill/SKILL.md +108 -0
- package/skill/agents/openai.yaml +3 -0
- package/skill/references/01-test-and-verification-index.md +103 -0
- package/skill/references/02-linter-and-antislop-stack.md +112 -0
- package/skill/references/03-pushdown-protocol-and-budgets.md +128 -0
- package/skill/references/04-source-patterns-digest.md +21 -0
- package/skill/references/05-formal-verification.md +54 -0
- package/skill/references/06-system1-circuits.md +66 -0
- package/skill/references/07-zero-defect-cross-discipline.md +63 -0
- package/skill/references/languages/csharp.md +86 -0
- package/skill/references/languages/python.md +77 -0
- package/skill/references/languages/rust.md +82 -0
- package/skill/references/languages/typescript.md +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 a1ter-nate
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,144 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Veristack (`vstack`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Replace test theater, slop asymmetry, and silent regressions with deterministic verification gates.**
|
|
4
|
+
Warning, veristack is "slop" :)
|
|
5
|
+
|
|
6
|
+
Veristack is a deterministic **9-rung verification ladder (`R0 → R8`)**, cross-language static and invariant analyzer (`vstack`), native linter/analyzer kit, runnable formal proof suite (**Bend 2**), anti-slop PR review briefer, and portable agent skill for **TypeScript/JS, C#/.NET, Rust, Python, Go, SQL, and Shell**.
|
|
7
|
+
|
|
8
|
+
> **Core rule:** Push every check as far down the ladder toward `R0` as possible while preserving the real failure mechanism, prefer subtraction over additive workarounds, and reserve human review for the highest-stakes decisions.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Why Veristack Exists
|
|
13
|
+
|
|
14
|
+
Inspired in part by [The No AI Slop Manifesto](https://gist.github.com/dexhorthy/4cc96f01be5b1208519e75dad250a948) (*AIE Code Summit 2026* — Dex Horthy, Lauren Tan / `@poteto`, et al.), Veristack targets four compounding failure modes in AI-assisted engineering:
|
|
15
|
+
|
|
16
|
+
1. **Test theater:** heavily mocked unit tests and slow E2E suites that mirror buggy code and mask failures behind `retries: 3`, `|| true`, or `continue-on-error: true`.
|
|
17
|
+
2. **Defects by omission:** boolean flag soup admitting impossible states, wall-clock duration math, release-stripped production assertions, unchecked slices, and swallowed catches.
|
|
18
|
+
3. **Silent invariant loss:** an agent fixes one issue while quietly deleting an earlier null guard, bounds check, `try/finally` cleanup, or comparison clause.
|
|
19
|
+
4. **Slop asymmetry & compounding context rot:** thousand-line additive PRs, ten-page doc dumps, layered workarounds, and stale `AGENTS.md` pointers that shift review burden onto humans and teach the next agent bad habits.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
Runs on **Node.js `>= 18`** or **[Bun](https://bun.sh) `>= 1.2.0`** via npm, pnpm, or Bun. Optional native toolchains (`dotnet`, `cargo`, `uv`, `go`, `bend`) verify their matching reference suites.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Run immediately with npx or bunx
|
|
29
|
+
npx veristack scan .
|
|
30
|
+
bunx veristack scan .
|
|
31
|
+
|
|
32
|
+
# Or install as a dev dependency
|
|
33
|
+
npm install -D veristack # or: pnpm add -D veristack / bun add -d veristack
|
|
34
|
+
npx vstack scan . --json # Full ladder + anti-slop + agent-doc report
|
|
35
|
+
npx vstack diff-cheats . --base origin/main --fail
|
|
36
|
+
npx vstack review-brief . --base origin/main --md
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Run `npx vstack --help` for the complete command and flag reference. From a local clone, run `bun run check` to self-verify Veristack.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## The 9-Rung Verification Ladder
|
|
44
|
+
|
|
45
|
+
Every check belongs on the lowest rung that still catches the defect:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
R0 Static Locks, Anti-Slop & Agent-Doc Hygiene (< 2 s | 100% files)
|
|
49
|
+
R1 Types, Explicit State Machines & Structure (1–10 s | 100% files)
|
|
50
|
+
R2 Pure Logic, Data Tables, MC/DC & PBT (10ms–2s | 15–40 specs)
|
|
51
|
+
R3 Stateful MBT, Cross-Coverage, Host & Twins (0.2–5 s | 5–15 suites)
|
|
52
|
+
R4 Real Engines, Migrations, 1..N Faults & DST (2–30 s | 3–8 slices)
|
|
53
|
+
R5 Formal Proofs (Bend 2 / Quint / Stateright) (30s–15m | diff/nightly)
|
|
54
|
+
R6 Empirical Big-O, SPC Drift, RTY & Load (2–30 m | 1–2 / svc)
|
|
55
|
+
R7 Thin Golden-Path E2E & Hardware Proof (2–15 m | 5–15 MAX)
|
|
56
|
+
R8 Live Production Verification & Boot BIST (Always | 3–10 probes)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Core Capabilities
|
|
62
|
+
|
|
63
|
+
### 1. Invariant Detection & Mechanical Proofs
|
|
64
|
+
- **Diff Invariant-Loss & AST Predicate Weakening (`vstack diff-cheats`):** catches dropped null/bounds/error/cleanup/lock/timeout/auth guards (`diff-invariant-guard-dropped`) and weakened `if`/`&&`/`||`/bound predicates (`diff-predicate-weakened`) when a diff drops protection without matching test assertions. On a 320-pair historical OSS bug-fix replay corpus (`vstack bench --replay`), this catches **58.1% (`186/320`)** combined (**312/320** regression-free).
|
|
65
|
+
- **Repo-Wide Statistical Belief Mining (`vstack scan`):** infers the codebase's own invariants (`>= 75%` adherence, `N >= 4`) to flag outlier omitted null checks, missing `finally`/`defer`/`with` cleanups, and unprotected sibling routes.
|
|
66
|
+
- **Bend 2 Universal Laws (`vstack laws --verify`):** pairs CODEOWNERS-locked [LAWS.bend](templates/bend2-reference/LAWS.bend) with [PROOF.bend](templates/bend2-reference/PROOF.bend) over [Model.bend](templates/bend2-reference/Model.bend), verified by `bend --check-only` alongside [.verification/laws/universal-laws.laws.json](.verification/laws/universal-laws.laws.json) across all 6 toolchains.
|
|
67
|
+
- **Daikon-Style Dynamic Invariants (`vstack invariants`):** infers runtime bounds, non-null, enum-domain, sorted-array, and relational invariants from JSON traces and fails CI when a locked `.verification/invariants.json` invariant breaks.
|
|
68
|
+
|
|
69
|
+
### 2. Anti-Slop Review & Knowledge-Base Hygiene
|
|
70
|
+
- **Stakes-Ranked Human Review Brief (`vstack review-brief`):** measures PR slop-asymmetry (non-lockfile lines added, shotgun-surgery directory spread, doc-dump volume, additive-only deletion ratio, newly added `HACK`/`WORKAROUND` or fallback-swallow catches, and `diff-cheats` hits), sorts changed files into a **Must Review First** queue, explicitly lists where automated checks are blind, and outputs a paste-ready `--md` ownership & AI-disclosure checklist.
|
|
71
|
+
- **Agent Instruction Hygiene (`vstack scan`):** audits `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `REVIEW.md`, `.cursorrules`, and `copilot-instructions.md` for context bloat (`agent-doc-bloat`), dead repo file references (`agent-doc-stale-path`), and mechanical rules stuck in prose (`agent-doc-unpromoted-rules`).
|
|
72
|
+
- **Anti-Cheat, Supply-Chain & Brownfield Locks:** blocks `continue-on-error: true`, `|| true`, `--no-verify`, test skips/retries, unpinned third-party GitHub Actions, missing `persist-credentials: false` on OIDC workflows, stealth `.vstack.json`/`.verification/invariants.json` weakening, and supports auto-shrinking `--ratchet` baselines, `.verification/chokepoints.json`, `vstack formal-sync`, `red-before-fix`, `mcdc`, `spc`, `big-o`, and 90/10 BYO System 1 circuits (`vstack circuit list`).
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Per-Repo Configuration (`.vstack.json`)
|
|
77
|
+
|
|
78
|
+
Adjust rule severities or ignore directories via `.vstack.json` (or `.verification/vstack.json`) at the repo root:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"rules": {
|
|
83
|
+
"no-comments": "off",
|
|
84
|
+
"max-file-lines": "off",
|
|
85
|
+
"rust-prod-unwrap-or-expect": "warn"
|
|
86
|
+
},
|
|
87
|
+
"ignore": ["spikes/**"]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Once committed, `vstack diff-cheats` watches `.vstack.json`, `.vstackignore`, and `.verification/invariants.json` so future PRs cannot quietly relax gates without human review.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Multi-Language Coverage (7 Benchmarked Languages)
|
|
96
|
+
|
|
97
|
+
Every language is verified by a living `caught/` vs `clean/` precision benchmark under [examples/](examples/README.md) (`vstack bench . --fail`: **196/196 recall, 0 clean FPs, 0 adversarial comment/string-wrapped FPs**):
|
|
98
|
+
|
|
99
|
+
| Language | Static & Native Enforcement (`R0`–`R1`) | Runnable Reference & Formal Proof (`R2`–`R5`) | Guide |
|
|
100
|
+
| :--- | :--- | :--- | :--- |
|
|
101
|
+
| **TypeScript / JS** | `oxc-parser` AST, cross-file import graph, [oxlint-no-comments.mjs](lint/oxlint-no-comments.mjs), [oxlint-explicit-state-machine.mjs](lint/oxlint-explicit-state-machine.mjs) | `src/` + `tests/` ([formal-verification.test.ts](tests/formal-verification.test.ts)) | [typescript.md](skill/references/languages/typescript.md) |
|
|
102
|
+
| **C# / .NET 10** | Roslyn [VStack.Analyzers](lint/csharp/VStack.Analyzers/) (`VSTACK001`–`VSTACK004`), `TreatWarningsAsErrors` | [templates/csharp-reference/](templates/csharp-reference/) (BFS proof, Dafny, `FsCheck`, `Stryker.NET`) | [csharp.md](skill/references/languages/csharp.md) |
|
|
103
|
+
| **Rust (2024)** | `unsafe_code = "forbid"`, Clippy `unwrap_used`/`expect_used`/`wildcard_enum_match_arm = "deny"` | [templates/rust-reference/](templates/rust-reference/) (`stateright`, Kani, `proptest`, `cargo-mutants`) | [rust.md](skill/references/languages/rust.md) |
|
|
104
|
+
| **Python (3.12+)** | `ruff` strict + `S101` prod assert ban, `mypy --strict`, `assert_never` | [templates/python-reference/](templates/python-reference/) (`hypothesis` PBT/MBT, BFS proof, `mutmut`) | [python.md](skill/references/languages/python.md) |
|
|
105
|
+
| **Go (1.23+)** | Concurrency/channel/UTF-8/path guards + [.golangci.yml](templates/go-reference/.golangci.yml) | [templates/go-reference/](templates/go-reference/order.go) (table, `testing/quick` PBT + stateful MBT, `-race`) | [examples/go/](examples/go/manifest.json) |
|
|
106
|
+
| **SQL & Shell** | Lock-timeout, RLS fail-open, `LIMIT` without `ORDER BY`, `= NULL`, `pkill -f`, argv secret & `PATH` guards | [examples/sql/](examples/sql/manifest.json), [examples/shell/](examples/shell/manifest.json) | [examples/README.md](examples/README.md) |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Portable Agent Skill
|
|
111
|
+
|
|
112
|
+
Install [skill/](skill/) into `~/.agents/skills/veristack` or `~/.claude/skills/veristack` so coding agents run `vstack scan . --json` before designing checks and `vstack review-brief` before opening PRs:
|
|
113
|
+
|
|
114
|
+
- [skill/SKILL.md](skill/SKILL.md) — 9-rung ladder, leading vocabulary, and 4-phase workflow
|
|
115
|
+
- [skill/references/](skill/references/) — progressively disclosed playbooks (`01`–`07`) and per-language guides
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Local Verification Across All Toolchains
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
bun run check # TS/JS/Bun test suite, no-comments, state-machines & self-scan
|
|
123
|
+
bun run test:laws # Bend 2 proofs + Go + Rust + Python + C# + TS law witnesses
|
|
124
|
+
bun run test:go # go vet + go test -race
|
|
125
|
+
bun run test:rust # rustfmt + clippy -D warnings + proptest + stateright
|
|
126
|
+
bun run test:python # ruff + mypy --strict + pytest + hypothesis
|
|
127
|
+
bun run test:csharp # Roslyn VStack.Analyzers + .NET 10 reference solution
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Inspiration & Clean-Room Attribution
|
|
133
|
+
|
|
134
|
+
Veristack is an original, from-scratch MIT implementation synthesizing ideas from anti-slop engineering, open-source tooling, and reliability literature:
|
|
135
|
+
|
|
136
|
+
- **Anti-slop & human-judgment inspiration:** [The No AI Slop Manifesto](https://gist.github.com/dexhorthy/4cc96f01be5b1208519e75dad250a948) (*AIE Code Summit 2026* — Dex Horthy, Lauren Tan / `@poteto`, et al.) and [*Why Software Factories Fail*](https://github.com/humanlayer/advanced-context-engineering-for-coding-agents/blob/main/wsff.md).
|
|
137
|
+
- **Open-source tooling inspiration:** [`deterministic-machines/deslop-please`](https://github.com/deterministic-machines/deslop-please), [`dmmulroy/anti-slop`](https://github.com/dmmulroy/anti-slop), [`@interfere/landmines`](https://github.com/interfere-inc/landmines), [`mattpocock/skills`](https://github.com/mattpocock/skills) (including `writing-for-agents`), [`cursor/plugins` (`pstack`)](https://github.com/cursor/plugins/tree/main/pstack), [`bendlang/bend`](https://github.com/bendlang/bend), [`antithesishq/bombadil`](https://github.com/antithesishq/bombadil), and [`tigerbeetle/tigerbeetle`](https://github.com/tigerbeetle/tigerbeetle) (`TIGER_STYLE.md`).
|
|
138
|
+
- **Research & literature:** Dawson Engler et al. (*Bugs as Deviant Behavior*, SOSP 2001), Michael Ernst et al. (*Daikon Dynamic Invariant Detection*), Matteo Vaccari (*Tests as Data*), John Ousterhout (*A Philosophy of Software Design*), Meta Engineering (*Just-in-Time Catching Test Generation*, `arXiv:2601.22832`), TypeSafe AI (JEV), Shopify Packwerk, Shigeo Shingo (*Poka-Yoke*), Toyota (*Jidoka* / *A3*), Shewhart (*SPC*), NASA JPL (*Power of 10*), DO-178C (*MC/DC*), SQLite (*TH3*), and seL4.
|
|
139
|
+
|
|
140
|
+
See [skill/references/04-source-patterns-digest.md](skill/references/04-source-patterns-digest.md) for the full traceability map.
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
[MIT](LICENSE) © 2026 [a1ter-nate](https://github.com/a1ter-nate)
|
package/bin/vstack.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
+
|
|
6
|
+
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const distCli = path.join(rootDir, "dist", "cli.mjs");
|
|
8
|
+
const srcCli = path.join(rootDir, "src", "cli.ts");
|
|
9
|
+
const entry = fs.existsSync(distCli) ? distCli : srcCli;
|
|
10
|
+
|
|
11
|
+
await import(pathToFileURL(entry).href);
|