vibecode-anything 0.3.0 → 0.4.0

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.
Files changed (160) hide show
  1. package/README.md +239 -67
  2. package/dist/cli.js +2140 -73
  3. package/dist/core/adapters.d.ts +26 -3
  4. package/dist/core/adapters.js +411 -25
  5. package/dist/core/agent-adapter.d.ts +67 -0
  6. package/dist/core/agent-adapter.js +312 -0
  7. package/dist/core/anti-cheat.d.ts +6 -0
  8. package/dist/core/anti-cheat.js +372 -0
  9. package/dist/core/badge.d.ts +18 -0
  10. package/dist/core/badge.js +360 -0
  11. package/dist/core/cache.d.ts +47 -0
  12. package/dist/core/cache.js +403 -0
  13. package/dist/core/ci-export.d.ts +35 -0
  14. package/dist/core/ci-export.js +796 -0
  15. package/dist/core/ci-formats.d.ts +21 -0
  16. package/dist/core/ci-formats.js +388 -0
  17. package/dist/core/client-codegen.d.ts +36 -0
  18. package/dist/core/client-codegen.js +2538 -0
  19. package/dist/core/compose.d.ts +71 -0
  20. package/dist/core/compose.js +1088 -0
  21. package/dist/core/docs-export.d.ts +37 -0
  22. package/dist/core/docs-export.js +2706 -0
  23. package/dist/core/doctor.d.ts +21 -1
  24. package/dist/core/doctor.js +234 -21
  25. package/dist/core/exec.d.ts +26 -2
  26. package/dist/core/exec.js +235 -8
  27. package/dist/core/fixtures.d.ts +153 -0
  28. package/dist/core/fixtures.js +2245 -0
  29. package/dist/core/format.d.ts +77 -0
  30. package/dist/core/format.js +632 -0
  31. package/dist/core/fs-snapshot.d.ts +37 -0
  32. package/dist/core/fs-snapshot.js +216 -0
  33. package/dist/core/graphql-export.d.ts +34 -0
  34. package/dist/core/graphql-export.js +2482 -0
  35. package/dist/core/har-export.d.ts +29 -0
  36. package/dist/core/har-export.js +988 -0
  37. package/dist/core/html-report.d.ts +27 -0
  38. package/dist/core/html-report.js +1535 -0
  39. package/dist/core/http-export.d.ts +31 -0
  40. package/dist/core/http-export.js +726 -0
  41. package/dist/core/impact.d.ts +80 -0
  42. package/dist/core/impact.js +1412 -0
  43. package/dist/core/lint.d.ts +38 -0
  44. package/dist/core/lint.js +1111 -0
  45. package/dist/core/load-export.d.ts +37 -0
  46. package/dist/core/load-export.js +1813 -0
  47. package/dist/core/mcp-export.d.ts +35 -0
  48. package/dist/core/mcp-export.js +1736 -0
  49. package/dist/core/mock-server.d.ts +47 -0
  50. package/dist/core/mock-server.js +1722 -0
  51. package/dist/core/openapi-export.d.ts +44 -0
  52. package/dist/core/openapi-export.js +1074 -0
  53. package/dist/core/parity.d.ts +6 -1
  54. package/dist/core/parity.js +36 -1
  55. package/dist/core/playwright-exporter.d.ts +23 -0
  56. package/dist/core/playwright-exporter.js +1343 -0
  57. package/dist/core/png.js +45 -9
  58. package/dist/core/regression.d.ts +54 -0
  59. package/dist/core/regression.js +529 -0
  60. package/dist/core/responsive.d.ts +86 -0
  61. package/dist/core/responsive.js +606 -0
  62. package/dist/core/run.d.ts +74 -0
  63. package/dist/core/run.js +696 -0
  64. package/dist/core/scheduler.d.ts +24 -0
  65. package/dist/core/scheduler.js +162 -0
  66. package/dist/core/schema-export.d.ts +29 -0
  67. package/dist/core/schema-export.js +2215 -0
  68. package/dist/core/schema.d.ts +3 -2
  69. package/dist/core/schema.js +460 -17
  70. package/dist/core/security.d.ts +233 -0
  71. package/dist/core/security.js +1839 -0
  72. package/dist/core/server-export.d.ts +38 -0
  73. package/dist/core/server-export.js +3198 -0
  74. package/dist/core/spec-writer.d.ts +9 -0
  75. package/dist/core/spec-writer.js +1202 -0
  76. package/dist/core/store.d.ts +11 -2
  77. package/dist/core/store.js +128 -8
  78. package/dist/core/target-map.d.ts +34 -0
  79. package/dist/core/target-map.js +262 -0
  80. package/dist/core/test-exporter.d.ts +25 -0
  81. package/dist/core/test-exporter.js +1918 -0
  82. package/dist/core/types.d.ts +182 -14
  83. package/dist/core/visual-semantic.d.ts +67 -0
  84. package/dist/core/visual-semantic.js +673 -0
  85. package/dist/core/visual.js +65 -16
  86. package/dist/core/watch.d.ts +28 -3
  87. package/dist/core/watch.js +222 -12
  88. package/dist/core/yaml.d.ts +5 -0
  89. package/dist/core/yaml.js +1009 -0
  90. package/dist/diagnostics/diagnose.d.ts +53 -0
  91. package/dist/diagnostics/diagnose.js +1083 -0
  92. package/dist/diagnostics/flake.d.ts +71 -0
  93. package/dist/diagnostics/flake.js +608 -0
  94. package/dist/diagnostics/mutation-audit.d.ts +69 -0
  95. package/dist/diagnostics/mutation-audit.js +769 -0
  96. package/dist/diagnostics/spatial.d.ts +42 -0
  97. package/dist/diagnostics/spatial.js +346 -0
  98. package/dist/diagnostics/trends.d.ts +122 -0
  99. package/dist/diagnostics/trends.js +1190 -0
  100. package/dist/discovery/discover.d.ts +111 -0
  101. package/dist/discovery/discover.js +2017 -0
  102. package/dist/discovery/lock.d.ts +116 -0
  103. package/dist/discovery/lock.js +1505 -0
  104. package/dist/discovery/routes.d.ts +36 -0
  105. package/dist/discovery/routes.js +1494 -0
  106. package/dist/discovery/test-importer.d.ts +92 -0
  107. package/dist/discovery/test-importer.js +4952 -0
  108. package/dist/index.d.ts +123 -0
  109. package/dist/index.js +99 -0
  110. package/dist/ingestors/api-collections.d.ts +28 -0
  111. package/dist/ingestors/api-collections.js +2335 -0
  112. package/dist/ingestors/api-repo.d.ts +2 -1
  113. package/dist/ingestors/api-repo.js +483 -85
  114. package/dist/ingestors/asyncapi.d.ts +26 -0
  115. package/dist/ingestors/asyncapi.js +2105 -0
  116. package/dist/ingestors/bridges.d.ts +2 -0
  117. package/dist/ingestors/bridges.js +702 -0
  118. package/dist/ingestors/cli.d.ts +2 -1
  119. package/dist/ingestors/cli.js +234 -46
  120. package/dist/ingestors/curl.d.ts +14 -0
  121. package/dist/ingestors/curl.js +1024 -0
  122. package/dist/ingestors/graphql.d.ts +56 -0
  123. package/dist/ingestors/graphql.js +1852 -0
  124. package/dist/ingestors/http-file.d.ts +20 -0
  125. package/dist/ingestors/http-file.js +923 -0
  126. package/dist/ingestors/index.js +486 -6
  127. package/dist/ingestors/openrpc.d.ts +29 -0
  128. package/dist/ingestors/openrpc.js +1807 -0
  129. package/dist/ingestors/proto.d.ts +47 -0
  130. package/dist/ingestors/proto.js +2690 -0
  131. package/dist/ingestors/trace.d.ts +10 -0
  132. package/dist/ingestors/trace.js +599 -0
  133. package/dist/ingestors/video.d.ts +4 -1
  134. package/dist/ingestors/video.js +86 -36
  135. package/dist/ingestors/web.d.ts +16 -1
  136. package/dist/ingestors/web.js +474 -32
  137. package/dist/mcp/server.js +3532 -67
  138. package/dist/oracles/api-repo.js +102 -30
  139. package/dist/oracles/cli.js +65 -17
  140. package/dist/oracles/http-workflow.d.ts +68 -0
  141. package/dist/oracles/http-workflow.js +828 -0
  142. package/dist/oracles/image.js +178 -28
  143. package/dist/oracles/index.d.ts +3 -1
  144. package/dist/oracles/index.js +243 -14
  145. package/dist/oracles/perf-budget.d.ts +90 -0
  146. package/dist/oracles/perf-budget.js +1329 -0
  147. package/dist/oracles/stream.d.ts +94 -0
  148. package/dist/oracles/stream.js +1268 -0
  149. package/dist/oracles/ui-states.d.ts +49 -0
  150. package/dist/oracles/ui-states.js +894 -0
  151. package/dist/oracles/video.d.ts +1 -1
  152. package/dist/oracles/video.js +232 -16
  153. package/dist/oracles/web.js +464 -73
  154. package/dist/plugins/builtins.d.ts +12 -0
  155. package/dist/plugins/builtins.js +1052 -0
  156. package/dist/plugins/registry.d.ts +86 -0
  157. package/dist/plugins/registry.js +554 -0
  158. package/dist/setup/index.js +145 -33
  159. package/package.json +56 -47
  160. package/skills/vibecode-anything/SKILL.md +75 -52
package/README.md CHANGED
@@ -1,35 +1,113 @@
1
1
  <div align="center">
2
2
 
3
+ <img src="assets/logo.png" width="92" alt="vibecode-anything logo" />
4
+
3
5
  # vibecode-anything
4
6
 
5
- ### Vibecode any app from a URL, CLI, repo, API, image, or video — verified against an automated oracle at every step.
7
+ ### Stop letting AI coding agents grade their own homework.
6
8
 
7
- **See an app or behavior you want to rebuild. Capture executable golden traces. Iterate until the differential oracle passes.**
9
+ **Open-source, local-first CLI & MCP differential verification engine — turn any live CLI, API, Web UI, media flow, or Git repo into executable golden traces + isolated `~/.vibecode-vault/` holdouts, and verify every rebuild hits 100% parity.**
8
10
 
11
+ [![CI](https://img.shields.io/github/actions/workflow/status/nguyenthanhthe/vibecode-anything/ci.yml?branch=master&style=flat-square&logo=github)](https://github.com/nguyenthanhthe/vibecode-anything/actions/workflows/ci.yml)
12
+ [![Live Showcase](https://img.shields.io/badge/live%20showcase-GitHub%20Pages-0ea5e9?style=flat-square)](https://nguyenthanhthe.github.io/vibecode-anything/)
9
13
  [![GitHub stars](https://img.shields.io/github/stars/nguyenthanhthe/vibecode-anything?style=flat-square&logo=github)](https://github.com/nguyenthanhthe/vibecode-anything/stargazers)
10
14
  [![License: MIT](https://img.shields.io/badge/license-MIT-f4c430?style=flat-square)](LICENSE)
11
15
  [![TypeScript](https://img.shields.io/badge/TypeScript-100%25-3178C6?style=flat-square&logo=typescript&logoColor=white)](tsconfig.json)
12
16
  [![Node.js](https://img.shields.io/badge/node-%3E%3D20-339933?style=flat-square&logo=node.js&logoColor=white)](package.json)
13
17
  [![Runtime Dependencies](https://img.shields.io/badge/dependencies-0%20runtime-111111?style=flat-square)](package.json)
14
- [![Subtle Bugs Caught](https://img.shields.io/badge/oracle%20accuracy-23%2F23%20(100%25)-16a34a?style=flat-square)](#benchmarks)
18
+ [![Oracle Accuracy](https://img.shields.io/badge/oracle%20accuracy-100%25%20(128%2F128)-16a34a?style=flat-square)](#benchmarks)
15
19
 
16
- [Quick Start](#quick-start) · [How It Works](#how-it-works) · [What You Can Verify](#what-you-can-verify) · [Examples](#examples) · [Benchmarks](#benchmarks) · [CLI Reference](#cli-reference) · [FAQ](#faq)
20
+ [Caught the AI Cheating](#caught-the-ai-cheating-ab-proof) · [Interactive Showcase](https://nguyenthanhthe.github.io/vibecode-anything/) · [Live Proof Demo](https://nguyenthanhthe.github.io/vibecode-anything/demo/) · [Why It Exists](#why-vibecode-anything) · [Quick Start](#quick-start) · [Examples](#examples) · [Benchmarks](#benchmarks) · [CLI Reference](#cli-reference) · [FAQ](#faq)
17
21
 
18
22
  <code>npx vibecode-anything setup</code>
19
23
 
24
+ <br/><br/>
25
+
26
+ <img src="assets/demo.gif" width="840" alt="vibecode-anything agent session differential verification demo" />
27
+
20
28
  </div>
21
29
 
22
- > [!IMPORTANT]
23
- > **Local-first & sandbox-safe:** All probing, rendering, and differential checks run locally on your machine using Node built-ins. CLI ingest probes run inside an isolated temporary sandbox so reference commands never mutate your working directory.
30
+ > [!NOTE]
31
+ > **Looking for the open-source developer CLI/MCP oracle?** You are in the right place. `vibecode-anything` is an MIT-licensed, 100% local-first differential verification engine for **Claude Code, Cursor, Antigravity, Codex, OpenCode, Windsurf, and Cline** — not the commercial mobile/hosted app builders at `vibecodeapp.com` or `anything.com`.
24
32
 
25
- > [!TIP]
26
- > **Coding agents:** Point your agent at [`skills/vibecode-anything/SKILL.md`](skills/vibecode-anything/SKILL.md) or connect over stdio MCP with `vibecode-anything mcp` for the full ingest → slice-verify → diff → pass loop.
33
+ > [!IMPORTANT]
34
+ > **Two tracks, one zero-dependency engine:**
35
+ > - **AI Coding Agent Power Users:** Seal hidden holdout probes outside the repo in `~/.vibecode-vault/`, drive fresh-context Goldfish rebuilds (`run` / `vibecode-anything mcp` + [`SKILL.md`](skills/vibecode-anything/SKILL.md)), and reject constant stubs, visible-only overfitting, and contract tampering automatically.
36
+ > - **API & CI Engineers:** Auto-ingest OpenAPI, AsyncAPI, Protobuf `.proto`, OpenRPC, GraphQL, Postman, Bruno `.bru`, Insomnia v4, Copy-as-cURL, `.http`, and HAR 1.2 into strict PR parity gates (`nguyenthanhthe/vibecode-anything@v0.4.0`), contract mocks, and zero-dep test/client/schema/load/docs/CI/server exporters.
27
37
 
28
38
  ---
29
39
 
30
- Coding agents can already write code fast. What they lack is **an automated Oracle** that knows whether what they vibecoded actually matches the reference behavior — especially when a broken build still returns HTTP `200`, exits `0` with valid JSON, or matches image dimensions at `360×240`.
40
+ ## Why `vibecode-anything`?
41
+
42
+ Coding agents already generate code fast. What they lack is **an automated differential oracle** that proves a rebuild actually matches the reference — especially when a broken build still returns HTTP `200`, exits `0` with valid JSON keys, or renders the exact right `360×240` pixel dimensions while dropping half the layout.
43
+
44
+ In 30 seconds, `vibecode-anything` turns any live reference into a machine-checkable `.vibecode/contract.json`, a deterministic `.vibecode/SPEC.md`, and isolated external holdouts — then drives your agent slice by slice until hard + soft parity hits **100%**.
45
+
46
+ | Capability | Raw Prompt | Single-Domain Tools | `vibecode-anything` v0.4.0 |
47
+ | :--- | :--- | :--- | :--- |
48
+ | **Multi-domain coverage** | Prose & screenshots only | 1 domain (Playwright *or* snapshot *or* OpenAPI) | **6 domains** (`cli`, `web`, `api`, `repo`, `image`, `video`) + **HAR & command trace** ingest |
49
+ | **Hidden holdouts & anti-cheat** | None (agent grades its own tests) | Tests live inside the repo where agents can edit them | **Isolated `~/.vibecode-vault/` holdouts** + anti-cheat gate (`STUB_CONSTANT_OUTPUT`, overfit & SHA-256 tamper detection) |
50
+ | **Zero-Assumption Spec** | Agent invents missing behavior | Manual markdown docs that drift | Auto-compiled deterministic **`.vibecode/SPEC.md`** (`vibecode://spec`) |
51
+ | **Autonomous build loop** | Single giant context window degrades | External wrapper scripts | **Goldfish fresh-context `run` loop** (`claude`, `codex`, `agy`, `opencode`, `mock:`) with plateau & quota guards |
52
+ | **Incremental speed** | Re-runs everything from scratch | Full suite re-execution | Dependency-ordered **`--slice`** tracking, **`watch`** mode, and **SHA-256 `--cache`** replay |
53
+ | **Visual & behavioral proof** | *"Looks good to me!"* | Raw terminal logs | **Self-contained `.vibecode/report.html`** (Before/After split, diff heatmap, convergence chart, unified diff) |
54
+ | **Install footprint** | Fragile ad-hoc scripts | Heavy dependency trees | **0 runtime dependencies** (pure Node.js `>=20` built-ins; optional adapters degrade cleanly) |
55
+
56
+ ## Caught the AI Cheating (A/B Proof)
57
+
58
+ When tests live inside the workspace, coding agents routinely hardcode visible fixtures, emit constant stubs, or edit test assertions to force a false green. [`examples/14-caught-ai-cheating/`](examples/14-caught-ai-cheating/README.md) runs four candidate builds of `rate-cli` (`11` visible invariants + `8` external `~/.vibecode-vault/` holdouts = `19` total) against both a naive smoke suite and `vibecode-anything`:
59
+
60
+ <p align="center">
61
+ <img src="assets/caught-cheating-ab.png" width="900" alt="Caught the AI Cheating — Naive 4/4 tests vs vibecode-anything differential oracle catching STUB_CONSTANT_OUTPUT, HOLDOUT_OVERFIT_SUSPECTED, and CONTRACT_TAMPERED while passing honest-cli 19/19" />
62
+ </p>
63
+
64
+ | Candidate Build | Naive Smoke Suite | `vibecode-anything` Oracle Verdict | Exit |
65
+ | :--- | :---: | :--- | :---: |
66
+ | `1. Constant Stub` (`cheat-stub.ts`) | `4/4 PASS` (fooled) | **CAUGHT:** `STUB_CONSTANT_OUTPUT` (`0/19`, `antiCheat=suspected`) | `1` |
67
+ | `2. Visible Overfit` (`cheat-overfit.ts`) | `4/4 PASS` (fooled) | **CAUGHT:** `HOLDOUT_OVERFIT_SUSPECTED` (`11/11` visible, `0/8` redacted vault) | `1` |
68
+ | `3. Contract Tamper` (`tamper-agent.mjs`) | `4/4 PASS` (fooled) | **STOPPED:** `CONTRACT_TAMPERED` (`.vibecode/contract.json` SHA-256 mismatch) | `1` |
69
+ | `4. Honest Rebuild` (`honest-cli.ts`) | `4/4 PASS` | **CLEAN PASS:** `19/19` (`11/11` visible + `8/8` live vault holdouts, `antiCheat=clean`) | `0` |
70
+
71
+ Reproduce the full A/B proof offline in seconds:
72
+
73
+ ```bash
74
+ node examples/14-caught-ai-cheating/run.ts --pretty
75
+ ```
76
+
77
+ ## 3-Step Showcase
78
+
79
+ ### 1. Ingest any reference into a contract, spec, and vault holdouts
80
+
81
+ ```bash
82
+ vibecode-anything ingest --domain cli --source "node ./ref-cli.ts" --force
83
+ ```
84
+
85
+ Generates `.vibecode/contract.json`, deterministic `.vibecode/SPEC.md`, and hidden holdout probes stored safely outside your workspace in `~/.vibecode-vault/`.
86
+
87
+ ### 2. Build autonomously with fresh context (or via MCP)
88
+
89
+ ```bash
90
+ # Autonomous Goldfish loop: spawns a fresh agent session per iteration until parity passes
91
+ vibecode-anything run --target "node ./new-cli.ts" --agent claude --max-iterations 5 --cache --strict
92
+
93
+ # Or connect your IDE/CLI agent over stdio MCP
94
+ vibecode-anything setup --clients auto --scope project
95
+ ```
31
96
 
32
- `vibecode-anything` captures executable behavior into a machine-checkable `.vibecode/contract.json`, lets your agent build incrementally slice by slice, and scores every change with an objective **Parity Gate** and exact diffs.
97
+ ### 3. Inspect objective proof in `.vibecode/report.html`
98
+
99
+ ```bash
100
+ vibecode-anything verify --target "node ./new-cli.ts" --strict
101
+ vibecode-anything report --out .vibecode/report.html
102
+ ```
103
+
104
+ ## Visual Proof Report (`.vibecode/report.html`)
105
+
106
+ Every `verify` and `run` automatically writes a **100% offline, zero-external-asset `.vibecode/report.html`** (also readable via MCP resource `vibecode://report`) with interactive Before/After PNG split comparison, pixel-diff heatmap toggle, Goldfish iteration convergence sparkline, unified diffs, automatic secret/vault redaction, and strict XSS escaping. **[Open live interactive visual proof demo](https://nguyenthanhthe.github.io/vibecode-anything/demo/)** (reproducible via `node examples/06-visual-html-demo/generate.ts`):
107
+
108
+ <p align="center">
109
+ <img src="assets/report-preview.svg" width="900" alt="vibecode-anything self-contained visual proof report preview showing Gate PASS 100%, Before/After visual split with Pixel-Diff overlay, Iteration Convergence sparkline, Holdout Vault Shield, and Unified Diff snippet" />
110
+ </p>
33
111
 
34
112
  ## Quick Start
35
113
 
@@ -42,7 +120,7 @@ Ingest the reference into .vibecode/contract.json and iterate slice by slice unt
42
120
 
43
121
  ### Connect your agent (MCP + Skill)
44
122
 
45
- Install globally and register MCP + `SKILL.md` for Claude Code, Cursor, or Antigravity:
123
+ Install globally and register MCP + `SKILL.md` for Claude Code, Cursor, Antigravity, Codex, OpenCode, Windsurf, or Cline:
46
124
 
47
125
  ```bash
48
126
  npm install -g vibecode-anything
@@ -54,97 +132,165 @@ vibecode-anything doctor --strict # promote optional adapter/MCP warnings to
54
132
 
55
133
  `vibecode-anything mcp` speaks **newline-delimited JSON-RPC 2.0 over stdio** (zero stdout log noise):
56
134
 
57
- - **Tools:** `vibecode_ingest`, `vibecode_verify`, `vibecode_status`, `vibecode_diff`, `vibecode_doctor`
58
- - **Resources:** `vibecode://contract`, `vibecode://last-report`
59
- - **Incremental slices:** `vibecode_verify` accepts `sliceIds`, and `vibecode_status` includes a per-slice progress summary from `.vibecode/contract.json`.
135
+ - **Tools:** `vibecode_discover`, `vibecode_lock`, `vibecode_ingest`, `vibecode_verify`, `vibecode_diagnose`, `vibecode_flake`, `vibecode_report`, `vibecode_status`, `vibecode_diff`, `vibecode_doctor`
136
+ - **Resources:** `vibecode://contract`, `vibecode://spec`, `vibecode://last-report`, `vibecode://report`
137
+ - **Prompts:** `vibecode_rebuild_slice`, `vibecode_fix_failures` (`prompts/list`, `prompts/get`)
138
+ - **Incremental slices, semantic modes, parallel verification, diff-driven impact, fixtures, strength auditing & trends:** `vibecode_ingest` and `vibecode_lock` support `asyncapi`, `proto`, and `openrpc` alongside `insomnia`, `bruno`, `openapi`, `graphql`, `postman`, `curl`, and `http-file`, and `vibecode_ingest` accepts workspace-confined `fromTests` (plus optional `target`) to statically import `node:test`, Jest, Vitest, Supertest, or `pytest` suites without executing user code; `vibecode_verify` accepts `affected` (git-diff impact selection with fail-closed full fallback), `mode` (`exact`, `structural`, `functional`, `reskin`), `concurrency` (`1-8`, deterministic ordering), `sliceIds`, `useCache`, `noReport`, `skipFixtures`, `targets` (per-domain map such as `{ "web": "http://localhost:3000", "cli": "node ./bin/app.mjs" }`, making `target` optional), and `vars` (runtime secrets for `{{vars.NAME}}` templates, never cached and redacted from all MCP text), and records `.vibecode/trends.ndjson` unless `noReport` is set (built-in `plugin_svg_a11y` and `plugin_state_file` run automatically; custom local `--plugin` execution and fixture `--allow-fixture-commands` hooks are CLI-only); `vibecode_flake` accepts `targets` (making `target` optional), `vars`, `skipFixtures`, `runs`, `invariantIds`, `sliceIds`, `strict`, `headers`, and `storageState` (while keeping `revealHoldouts` and `allowFixtureCommands` CLI-only); `vibecode_diagnose` accepts `includeStrength` to attach static oracle strength & stub-bypass mutation audit scores; `vibecode_status` includes a per-slice progress summary and accepts `includeTrends` / `trendWindow` to surface verification trends, sparklines, latency drift, and flaky hotspots; `vibecode://spec` serves `.vibecode/SPEC.md`; `vibecode://report` serves `.vibecode/report.html`; and isolated holdouts stay hidden from MCP reads.
60
139
 
61
140
  ### Use from the terminal (CLI)
62
141
 
63
142
  ```bash
64
- # 1. Ingest a reference into a v0.3 contract (.vibecode/contract.json)
143
+ # 0. Inspect a project or lock working behavior before a refactor
144
+ vibecode-anything discover --pretty
145
+ vibecode-anything lock --pretty
146
+ vibecode-anything lock --check --pretty
147
+
148
+ # 1. Ingest a reference into .vibecode/contract.json + .vibecode/SPEC.md (+ hidden holdouts)
65
149
  vibecode-anything ingest --domain cli --source "node ./ref-cli.ts" --force
66
- vibecode-anything ingest --domain web --source "http://localhost:3000" --route / --route /tasks --force
150
+ vibecode-anything ingest --domain web --source "http://localhost:3000" --route / --crawl-depth 2 --holdout-route /admin --force
67
151
  vibecode-anything ingest --domain image --source ./mockup.png --force
68
152
  vibecode-anything ingest --domain video --source ./frames/ --force
69
153
 
70
- # 2. Run the differential oracle against your new build
154
+ # 2. Run the differential oracle against your new build (auto-generates .vibecode/report.html)
71
155
  vibecode-anything verify --target "node ./new-cli.ts"
72
- vibecode-anything verify --target "node ./new-cli.ts" --strict # soft mismatches fail too
156
+ vibecode-anything verify --target "node ./new-cli.ts" --strict --cache # soft fail + SHA-256 replay cache
73
157
  vibecode-anything verify --target "node ./new-cli.ts" --slice cli-core # verify one incremental slice
74
158
 
75
- # 3. Re-verify automatically when source files change
159
+ # 3. Or run a closed-loop fresh-context agent build until 100% parity
160
+ vibecode-anything run --target "node ./new-cli.ts" --agent claude --max-iterations 5
161
+
162
+ # 4. Re-verify automatically on edit or regenerate the HTML visual proof report
76
163
  vibecode-anything watch --target "node ./new-cli.ts" --watch-path ./src --debounce 250
164
+ vibecode-anything report --out .vibecode/report.html
77
165
 
78
- # 4. Inspect contract status or one invariant diff
166
+ # 5. Inspect contract status, root-cause diagnosis, flake stability, or one invariant diff
79
167
  vibecode-anything status
80
168
  vibecode-anything diff --invariant inv-cli-help
169
+ vibecode-anything diagnose --brief
170
+ vibecode-anything flake --target "node ./new-cli.ts" --runs 3 --pretty
81
171
  ```
82
172
 
83
- ## How It Works
173
+ ### Drop-in GitHub Action (CI Gate)
84
174
 
85
- ```mermaid
86
- flowchart LR
87
- Ref["Reference<br/>CLI · Web · API · Repo · Image · Video"] -->|"ingest"| Contract[".vibecode/contract.json<br/>Hard & Soft Invariants + Slices"]
88
- Contract --> Agent["Coding Agent<br/>Builds Slice by Slice"]
89
- Agent -->|"verify / watch"| Oracle["Differential Oracle<br/>Hard 100% · Soft / --strict"]
90
- Oracle -->|"fail -> diff"| Agent
91
- Oracle -->|"pass"| Gate["Parity Gate Exit 0"]
175
+ Enforce behavioral + visual parity on every pull request with `action.yml`, automatically posting `.vibecode/pr-summary.md` to the job summary and emitting a flat-square SVG badge:
176
+
177
+ ```yaml
178
+ - uses: nguyenthanhthe/vibecode-anything@v0.4.0
179
+ with:
180
+ target: "node ./dist/server.js"
181
+ strict: "true"
182
+ cache: "true"
183
+ badge: ".vibecode/parity.svg"
184
+ baseline: ".vibecode/baseline-report.json" # optional PR regression gate
92
185
  ```
93
186
 
94
- **What counts as done.** Behavior, not vibes. `ingest` records executable golden traces, DOM landmarks, API schemas, exported symbols, visual layout regions, and video keyframes into `.vibecode/contract.json`. Your rebuild is done only when the differential oracle verifies parity against the contract.
187
+ ### Programmatic TypeScript SDK
95
188
 
96
- **Why not just prompt a coding agent?**
189
+ Embed ingestion, differential verification, YAML parsing, interactive HTML reports, and badge generation directly in Node.js `>=20` / TypeScript via `vibecode-anything`:
97
190
 
98
- | Dimension | Raw Prompt + Ad-hoc Checks | `vibecode-anything` |
99
- | :--- | :--- | :--- |
100
- | **Input understanding** | Guesses layout/behavior from prose or screenshots | Captures **executable golden traces** in `.vibecode/contract.json` |
101
- | **Definition of "Done"** | Agent self-grades (*"Looks good!"*) | **Differential Oracle** reports `14/15 checks pass · exact diff` |
102
- | **Multi-tool chaos** | Fragmented scripts fighting over context | **1 shared contract**, thin adapters, zero context bloat |
191
+ ```ts
192
+ import { ingest, verifyContract, readContract, writeHtmlReport, renderParityBadgeSvg } from "vibecode-anything";
193
+
194
+ await ingest({ source: "./petstore.yaml", cwd: process.cwd(), force: true });
195
+ const report = await verifyContract(readContract(process.cwd()), { target: "http://127.0.0.1:3000", cwd: process.cwd() });
196
+ writeHtmlReport({ contract: readContract(process.cwd()), report, workspaceDir: process.cwd() });
197
+ const svg = renderParityBadgeSvg(report);
198
+ ```
103
199
 
104
- **Two-tier parity gate.** Hard invariants (exit codes, golden stdout/stderr, JSON schemas, DOM landmarks, image dimensions, monotonic video state order) must pass 100% (`exit 1` on failure). Soft perceptual invariants (SSIM, pixel diff ratio, color palette, XY-cut region IoU, motion IoU) emit warnings by default (`exit 0`) and become hard gate failures under `--strict` (`exit 1`). If every evaluated invariant is skipped (`ADAPTER_MISSING`), the gate returns `incomplete` (`exit 2`).
200
+ ## How It Works
201
+
202
+ <p align="center">
203
+ <img src="assets/architecture-v04.svg" width="900" alt="vibecode-anything v0.4.0 closed-loop architecture" />
204
+ </p>
105
205
 
106
- **Incremental slices & watch mode.** Multi-invariant contracts group checks into deterministic dependency-ordered slices. Use `--slice <id>` to focus verification on one unit at a time while tracking slice completion in `.vibecode/contract.json`, or run `vibecode-anything watch` to debounce file edits and surface `newlyFixed` / `newlyBroken` transitions live.
206
+ ```mermaid
207
+ flowchart LR
208
+ Ref["Reference<br/>CLI · Web · API · Repo · Image · Video · HAR"] -->|"ingest"| Contract[".vibecode/contract.json<br/>SPEC.md + Vault Holdouts"]
209
+ Contract --> Agent["Coding Agent<br/>Goldfish Fresh-Context Loop"]
210
+ Agent -->|"verify / watch / run"| Oracle["Differential Oracle<br/>Hard 100% · Soft / --strict · Anti-Cheat"]
211
+ Oracle -->|"fail -> exact diff"| Agent
212
+ Oracle -->|"pass"| Gate["Parity Gate Exit 0<br/>.vibecode/report.html"]
213
+ ```
107
214
 
108
- **Zero runtime dependencies.** Core CLI, pure-Node PNG codec, SSIM/YIQ/dHash/XY-cut layout engine, monotone video DP aligner, file watcher, doctor diagnostics, and JSON-RPC 2.0 MCP server run on Node.js built-ins alone. Optional adapters (`Playwright`, `sharp`, `ffmpeg`/`ffprobe`) plug in automatically and degrade cleanly with `ADAPTER_MISSING` hints when absent.
215
+ - **Two-tier parity gate:** Hard invariants (exit codes, golden stdout/stderr, JSON schemas, DOM landmarks, image dimensions, monotonic video state order, filesystem side-effects) must pass **100%** (`exit 1` on failure). Soft perceptual invariants (SSIM, pixel diff ratio, color palette, XY-cut region IoU, motion IoU) emit warnings by default (`exit 0`) and become hard gate failures under `--strict` (`exit 1`). If every evaluated invariant is skipped (`ADAPTER_MISSING`), the gate returns `incomplete` (`exit 2`).
216
+ - **Zero-Assumption Spec & isolated holdout vault:** Unless `--no-spec` is passed, `ingest` compiles a deterministic `.vibecode/SPEC.md` capturing every visible invariant, schema, and layout rule while redacting secrets and hiding vault paths. Negative/boundary probes, `--holdout-route` paths, and 20% trace partitions live in `~/.vibecode-vault/<sha256-16>/holdouts.json`, excluded from `.vibecode/contract.json` and MCP reads, with failures redacted by default (inspectable locally only via CLI `--reveal-holdouts`).
217
+ - **Goldfish fresh-context `run` loop & anti-cheat:** Each iteration feeds a fresh agent context only `.vibecode/SPEC.md` and the compact failing diffs, verifies SHA-256 contract/vault hashes to reject tampering (`CONTRACT_TAMPERED`), flags constant stubs or holdout overfitting, and stops safely on convergence, plateau, or quota limits.
218
+ - **Zero runtime dependencies:** Core CLI, pure-Node PNG codec, SSIM/YIQ/dHash/XY-cut layout engine, monotone video DP aligner, SHA-256 replay cache, file watcher, doctor diagnostics, HTML report generator, and JSON-RPC 2.0 MCP server run on Node.js `>=20` built-ins alone. Optional adapters (`Playwright`, `sharp`, `ffmpeg`/`ffprobe`) plug in automatically and degrade cleanly with `ADAPTER_MISSING` hints when absent.
109
219
 
110
220
  ## What You Can Verify
111
221
 
112
222
  | Domain | Status | Ingestor | Differential Oracle | Optional Adapter / Fallback |
113
223
  | :--- | :---: | :--- | :--- | :--- |
114
- | `cli` / `script` | Verified | `--help` tree, subcommands, flags, negative probe, JSON schema capture | Exit code, stdout/stderr, JSON schema, `jsonPaths`, golden line diff | None (Node built-in) |
115
- | `web` / `url` | Verified | Routes + HTML landmarks + optional recorded flow & network trace | `web_route`, `web_flow`, `web_network` | `Playwright` optional (native `fetch` fallback) |
116
- | `api` | Verified | OpenAPI 3.x / Swagger 2.0 & REST endpoints | Status, JSON subset, JSON schema | None (native `fetch`) |
224
+ | `cli` / `script` | Verified | `--help` tree, subcommands, flags, negative probes, `--fs-diff`, `--from-commands` | Exit code, stdout/stderr, JSON schema, `jsonPaths`, fs side-effects, golden diff, live `perf_budget` latency & output byte budgets | None (Node built-in) |
225
+ | `web` / `url` | Verified | Routes (`--crawl-depth`), HTML & interactive landmarks, `--from-har`, `--header`, `--storage-state` | `web_route` (incl. multi-viewport `responsiveViewports` audits), `web_flow`, `web_network`, `web_ui_states` (hover/focus, keyboard Tab order & focus traps, disabled/empty/error states, local/session storage), `pageerror` / HTTP `>= 500` checks | `Playwright` optional (native `fetch` + HTML responsive fallback) |
226
+ | `api` | Verified | OpenAPI 3.x / Swagger 2.0 (`.json`, `.yaml`, `.yml`), AsyncAPI 2.x/3.x (`.yaml`/`.json`), Protobuf (`.proto`), OpenRPC 1.x JSON-RPC 2.0 (`.json`/`.yaml`), GraphQL SDL/Introspection (`.graphql`, `.gql`, `__schema`), REST Client (`.http`/`.rest`), Insomnia v4 (`.json`/`.yaml`), Bruno (`.bru` & `bruno.json`), Postman v2.x, Copy-as-cURL & `.har` traces (plus reverse `export-openapi` YAML/JSON) | Status, JSON subset, JSON schema (Draft 2020-12 / OpenAPI 3.0), headers, stateful `http_workflow` chains, `http_stream` (SSE/NDJSON), RFC 6455 `ws_protocol`, and live `perf_budget` p50/p95/p99 latency & payload byte budgets | None (native `fetch` + built-in YAML/GraphQL/Bruno/AsyncAPI/Protobuf/OpenRPC parsers) |
117
227
  | `repo` | Verified | Exported symbol scan | `repo_exports` | None (Node built-in) |
118
- | `image` | Verified | Dimensions, palette, XY-cut layout regions | Hard dimensions/non-blank; soft SSIM, pixel diff PNG, palette, region IoU | `sharp` optional (pure-Node PNG built-in) |
119
- | `video` | Verified | Scene keyframes or ordered PNG frame dir + `.srt`/`.vtt` | Monotone state-order DP + soft keyframe SSIM/motion IoU | `ffmpeg`/`ffprobe` optional (frame dir works) |
120
- | `rea` / `cli-anything` | Verified | Thin JSON contract importers | Reuses the same multi-modal oracles | None (JSON bridge) |
228
+ | `image` | Verified | Dimensions, palette, XY-cut layout regions | Hard dimensions/non-blank; soft SSIM, pixel diff PNG, palette, region IoU; `--mode reskin` / `wcagLevel` WCAG 2.1 contrast & design-token audit | `sharp` optional (pure-Node PNG built-in) |
229
+ | `video` | Verified | Scene + periodic keyframes (`--crop`) or PNG frame dir + `.srt`/`.vtt` | Monotone state-order DP + soft keyframe SSIM/motion IoU + live URL scroll capture | `ffmpeg`/`ffprobe` optional (frame dir works) |
230
+ | `rea` / `cli-anything` / `postman` / `curl` / `graphql` / `http-file` / `insomnia` / `bruno` / `asyncapi` / `proto` / `openrpc` | Verified | Thin JSON contract, Postman v2.x, Copy-as-cURL, GraphQL, `.http`/`.rest`, Insomnia v4, Bruno `.bru`, AsyncAPI 2.x/3.x, `.proto` & OpenRPC 1.x JSON-RPC importers | Reuses the same multi-modal oracles | None (JSON / cURL / GraphQL / HTTP-file / Bruno / AsyncAPI / Protobuf / OpenRPC bridge) |
121
231
 
122
232
  ## Examples
123
233
 
124
234
  Self-contained, offline, zero-dependency walkthroughs live in [`examples/`](examples/README.md). Each runner executes inside an isolated `os.tmpdir()` workspace and cleans up on exit so `.vibecode/` is never left in the repository:
125
235
 
126
236
  ```bash
127
- node examples/01-cli-rebuild/run.ts # CLI ingest -> broken build fails (exit 1) -> diff -> fixed passes (exit 0)
128
- node examples/02-web-image-rebuild/run.ts # Web HTTP fallback + pure-Node PNG soft-warn vs --strict + diff PNG
237
+ node examples/01-cli-rebuild/run.ts # CLI ingest -> broken build fails (exit 1) -> diff -> fixed passes (exit 0)
238
+ node examples/02-web-image-rebuild/run.ts # Web HTTP fallback + pure-Node PNG soft-warn vs --strict + diff PNG
239
+ node examples/03-gron-cli-rebuild/run.ts # Real-world gron CLI rebuild -> external holdout redaction -> deterministic SPEC.md
240
+ node examples/04-autonomous-run-loop/run.ts # Closed-loop Goldfish run (mock agent): Iter 1 fail -> Iter 2 fix -> 100% + report.html
241
+ node examples/05-openapi-yaml-rebuild/run.ts # OpenAPI 3.0.3 YAML auto-ingest -> HTTP verify --pretty -> badge SVG + PR Markdown
242
+ node examples/07-curl-postman-rebuild/run.ts # Copy-as-cURL & Postman v2.1 auto-ingest -> pretty DX -> SARIF/JUnit/badge/MD
243
+ node examples/08-graphql-api-rebuild/run.ts # GraphQL SDL auto-ingest -> HTTP 200 errors/non-null drift -> doctor --pretty
244
+ node examples/09-http-file-regression/run.ts # .http file auto-ingest -> secret redaction -> diff --baseline REGRESSION/IMPROVED
245
+ node examples/10-export-tests-bruno-merge/run.ts # Bruno .bru & Insomnia YAML ingest -> merge -> lint -> standalone export-tests
246
+ node examples/11-openapi-playwright-export/run.ts # cURL ingest -> export-openapi YAML roundtrip -> export-tests --format playwright
247
+ node examples/12-mock-server-http-export/run.ts # OpenAPI + web_route -> live mock self-verify -> export-http roundtrip
248
+ node examples/13-client-codegen-har-replay/run.ts # export-client (TS/Py/Go + live TS client) -> export-har HAR 1.2 roundtrip
249
+ node examples/14-caught-ai-cheating/run.ts # A/B proof catching stub, overfit & tamper vs honest vault pass
250
+ node examples/15-graphql-mcp-export/run.ts # ingest + merge -> export-graphql lossless roundtrip -> live export-mcp JSON-RPC 2.0
251
+ node examples/16-schema-load-export/run.ts # ingest + merge -> export-schema (Zod/JSON Schema/TS guards) -> live export-load
252
+ node examples/17-docs-asyncapi-export/run.ts # ingest asyncapi.yaml + cli-tool.mjs & merge -> live webhook verify -> export-docs
253
+ node examples/18-proto-ci-export/run.ts # ingest orders.proto + cli-tool.mjs & merge -> gRPC-JSON verify -> export-ci
129
254
  ```
130
255
 
131
256
  | Walkthrough | Domains | What It Proves |
132
257
  | :--- | :--- | :--- |
133
258
  | [Example 01 — CLI Rebuild (`invoice-cli`)](examples/01-cli-rebuild/README.md) | `cli` | Catches a dropped `qty` multiplier that still exits `0` with valid JSON keys, inspects the exact diff, and verifies the fixed rebuild (`100%` hard parity). |
134
259
  | [Example 02 — Web & Image Rebuild (`StatusPulse`)](examples/02-web-image-rebuild/README.md) | `web`, `image` | Catches missing `<nav>` / `<table>` / `<title>` on HTTP `200` routes via `fetch` fallback, then compares default soft-warn (`exit 0`) vs `--strict` (`exit 1`) + pixel-diff PNG. |
260
+ | [Example 03 — Real-World `gron` CLI Rebuild (`gron-cli`)](examples/03-gron-cli-rebuild/README.md) | `cli` | Rebuilds `gron` + `--ungron` against isolated external holdout probes, verifies byte-for-byte deterministic `.vibecode/SPEC.md`, redacts failing holdouts, and proves `100%` strict parity. |
261
+ | [Example 04 — Autonomous Goldfish `run` Loop](examples/04-autonomous-run-loop/README.md) | `cli` | Drives `vibecode-anything run` end-to-end with a deterministic fresh-context mock agent from failing build to `100%` parity and writes `.vibecode/report.html`. |
262
+ | [Example 05 — OpenAPI 3.0.3 YAML API Rebuild (`petstore`)](examples/05-openapi-yaml-rebuild/README.md) | `api` | Auto-ingests OpenAPI 3.0.3 YAML (`$ref` + `allOf`) without `--domain`, catches schema/filter/404 bugs on HTTP `200`, passes `--pretty`, and emits `.vibecode/report.html`, parity SVG badge, and PR Markdown summary. |
263
+ | [Example 07 — Copy-as-cURL & Postman v2.1 Rebuild](examples/07-curl-postman-rebuild/README.md) | `api` | Zero-flag Copy-as-cURL & Postman v2.1 auto-ingest with secret stripping, `--pretty` (`verify`, `status`, `diff`), and HTML/SVG/Markdown/SARIF 2.1.0/JUnit XML exports. |
264
+ | [Example 08 — GraphQL SDL API Rebuild](examples/08-graphql-api-rebuild/README.md) | `api` | Zero-flag GraphQL SDL auto-ingest with secret stripping & mutation skipping, HTTP 200 `errors`/non-null drift detection, `verify --pretty`, and `doctor --pretty`. |
265
+ | [Example 09 — `.http` File & `diff --baseline` Regression](examples/09-http-file-regression/README.md) | `api` | Zero-flag `.http` auto-ingest with secret `@var`/query stripping and CI-ready `diff --baseline --pretty` catching `[REGRESSION]` (`exit 1`) and `[IMPROVED]` (`exit 0`). |
266
+ | [Example 10 — Standalone `export-tests`, Bruno & Insomnia Merge](examples/10-export-tests-bruno-merge/README.md) | `api` | Zero-flag Bruno `.bru` & Insomnia v4 YAML auto-ingest with secret stripping, `merge --with`, `lint --pretty`, and zero-dep runnable `export-tests --format node-test`. |
267
+ | [Example 11 — OpenAPI 3.0.3 Export & Playwright Codegen](examples/11-openapi-playwright-export/README.md) | `api` | Zero-flag Copy-as-cURL ingest with secret stripping, `export-openapi --format yaml` lossless roundtrip verification, and `export-tests --format playwright` live HTTP verification. |
268
+ | [Example 12 — Contract Mock Server & HTTP Collection Export](examples/12-mock-server-http-export/README.md) | `api`, `web` | Offline multi-domain workflow proving `mock --port 0 --dry-run --pretty`, live self-parity `verify`, `404` unknown-route safety, and lossless `export-http` (`http-file`/`curl`/`postman`) roundtrips. |
269
+ | [Example 13 — Typed Client Codegen & W3C HAR 1.2 Replay](examples/13-client-codegen-har-replay/README.md) | `api`, `web` | Offline workflow compiling `export-client` (`ts-fetch`, `python`, `go`), executing live `ts-fetch` calls against the mock server, and verifying lossless `export-har` HAR 1.2 roundtrips. |
270
+ | [Example 14 — Caught the AI Cheating (A/B Proof)](examples/14-caught-ai-cheating/README.md) | `cli` | Side-by-side proof where naive `4/4` suites false-pass `STUB_CONSTANT_OUTPUT`, `HOLDOUT_OVERFIT_SUSPECTED`, and `CONTRACT_TAMPERED` while clean rebuilds pass external vault holdouts. |
271
+ | [Example 15 — GraphQL & Standalone MCP Server Export](examples/15-graphql-mcp-export/README.md) | `api`, `cli` | Offline workflow ingesting OpenAPI + CLI specs into a merged contract, compiling lossless `export-graphql` (`sdl`/`introspection`) roundtrips, and running live spawned `export-mcp` stdio JSON-RPC 2.0 tools. |
272
+ | [Example 16 — Schema Codegen & Live Load Benchmarks](examples/16-schema-load-export/README.md) | `api`, `cli` | Offline workflow ingesting OpenAPI + CLI specs into `export-schema` (`zod`/`json-schema`/live `is<Name>()` TypeScript guards) and `export-load` (`k6`/`artillery`/live `node-bench` mock pass vs drift failure). |
273
+ | [Example 17 — AsyncAPI Webhooks & Docs/`llms.txt` Portal](examples/17-docs-asyncapi-export/README.md) | `api`, `cli` | Offline walkthrough ingesting AsyncAPI 2.6 webhooks + CLI probes, verifying live ephemeral webhook servers, and exporting Markdown, zero-CDN HTML portals, and `llms-txt`. |
274
+ | [Example 18 — Protobuf `.proto` & CI/CD Pipeline Export](examples/18-proto-ci-export/README.md) | `api`, `cli` | Offline workflow ingesting `.proto` services (`google.api.http` + ConnectRPC) + CLI probes, verifying live gRPC-JSON endpoints, and exporting `github-actions`, `gitlab-ci`, and TAB-indented `makefile` pipelines. |
135
275
 
136
276
  ## Benchmarks
137
277
 
138
- Run the self-contained differential mutation & coverage suite (`node benchmarks/run.ts`) across all 5 domains (`cli`, `web`, `image`, `video`, `api`):
278
+ Run the self-contained differential mutation, anti-cheat, holdout, and replay-cache benchmark suite (`node benchmarks/run.ts`) across all **6 domains** (`cli`, `web`, `image`, `video`, `api`, `repo`) plus **Anti-Cheat**, **Vault Holdouts**, and **Sandbox** isolation:
139
279
 
140
- | Domain | Tasks / Mutants | Naive Baseline Caught | `vibecode-anything` Oracle Caught |
280
+ | Domain / Category | Tasks / Mutants | Naive Baseline Caught | `vibecode-anything` Oracle Caught |
141
281
  | :--- | :---: | :---: | :---: |
142
- | `cli` | 5 | 0 / 5 (0.0%) | **5 / 5 (100.0%)** |
143
- | `web` | 5 | 0 / 5 (0.0%) | **5 / 5 (100.0%)** |
282
+ | `cli` | 15 | 0 / 15 (0.0%) | **15 / 15 (100.0%)** |
283
+ | `web` | 12 | 0 / 12 (0.0%) | **12 / 12 (100.0%)** |
144
284
  | `image` | 5 | 0 / 5 (0.0%) | **5 / 5 (100.0%)** |
145
285
  | `video` | 5 | 0 / 5 (0.0%) | **5 / 5 (100.0%)** |
146
- | `api` | 3 | 0 / 3 (0.0%) | **3 / 3 (100.0%)** |
147
- | **Total** | **23** | **0 / 23 (0.0%)** | **23 / 23 (100.0%)** |
286
+ | `api` | 58 | 0 / 58 (0.0%) | **58 / 58 (100.0%)** |
287
+ | `repo` | 5 | 0 / 5 (0.0%) | **5 / 5 (100.0%)** |
288
+ | `anticheat` (`STUB_CONSTANT_OUTPUT`, overfit, contract tamper/lint, injection) | 19 | 0 / 19 (0.0%) | **19 / 19 (100.0%)** |
289
+ | `holdout` (External `~/.vibecode-vault` edge/boundary checks) | 6 | 0 / 6 (0.0%) | **6 / 6 (100.0%)** |
290
+ | `sandbox` (`--fs-diff` silent mutations & env drift) | 3 | 0 / 3 (0.0%) | **3 / 3 (100.0%)** |
291
+ | **Total** | **128** | **0 / 128 (0.0%)** | **128 / 128 (100.0%)** |
292
+
293
+ Warm `--cache` replay verification on `01-cli-csv-tool` caches `13 / 17` visible invariants (`4` external vault holdouts always re-run live) for a verified **2.20x** local speedup (`14,729 ms -> 6,706 ms`, saving `8,023 ms` / `-54.5%` wall-clock latency).
148
294
 
149
295
  ```bash
150
296
  node benchmarks/run.ts # print Markdown coverage & subtle-bug tables
@@ -163,18 +309,39 @@ node benchmarks/runner.ts --results <dir> # aggregate runs -> benchmarks/s
163
309
 
164
310
  | Command | Purpose | Flags & Options |
165
311
  | :--- | :--- | :--- |
312
+ | `discover` | Inspect a workspace for frameworks, entrypoints, routes, API specs, ports, slices, and ready-to-run commands | `--dir <path>`, `--pretty` |
313
+ | `lock` | Snapshot working behavior into `.vibecode/contract.json`, `.vibecode/SPEC.md`, external holdouts, and `.vibecode/lock.json` (or check tamper/drift with `--check`) | `--check`, `--source`, `--domain`, `--target <cmd-or-url>`, `--name`, `--force`, `--strict`, `--no-spec`, `--no-verify`, `--pretty`, `--probe` (repeatable), `--probes <file.json>`, `--route` (repeatable), `--crawl-depth <1-3>`, `--holdout-route <path>` (repeatable), `--endpoints <file.json>`, `--base-url <url>`, `--header <Key: Value>` (repeatable), `--storage-state <file>`, `--env <KEY=VAL>` (repeatable), `--fs-diff` |
166
314
  | `init` | Create a starter v0.1-compatible `.vibecode/contract.json` | `--domain`, `--source`, `--name`, `--force` |
167
- | `ingest` | Probe a reference and write a v0.2 `.vibecode/contract.json` | `--source`, `--domain`, `--name`, `--force`, `--probe` (repeatable), `--probes <file.json>`, `--route` (repeatable), `--flow <file.json>`, `--endpoints <file.json>`, `--base-url <url>`, `--scene-threshold <n>`, `--max-frames <n>` |
168
- | `verify` | Run the differential oracle and write `.vibecode/last-report.json` | `--target <cmd-or-url>`, `--strict`, `--invariant <id>` (repeatable), `--slice <id>` (repeatable) |
169
- | `watch` | Re-run verification when watched paths change | `--target <cmd-or-url>`, `--slice <id>` (repeatable), `--watch-path <dir>` (repeatable), `--debounce <ms>`, `--strict`, `--invariant <id>` (repeatable) |
170
- | `status` | Show contract metadata, adapter availability, slice summary, and last report summary | (no required flags) |
171
- | `diff` | Print the full last result (or one invariant result) from `.vibecode/last-report.json` | `--invariant <id>`, `--id <id>` |
172
- | `doctor` | Report environment health: Node, optional adapters, optional CLIs, and MCP registration | `--scope <project\|global>`, `--strict`, `--antigravity-dir <dir>` |
315
+ | `ingest` | Probe a reference and write `.vibecode/contract.json`, `.vibecode/SPEC.md`, and isolated holdouts | `--source`, `--domain`, `--name`, `--force`, `--no-spec`, `--probe` (repeatable), `--probes <file.json>`, `--route` (repeatable), `--crawl-depth <1-3>`, `--holdout-route <path>` (repeatable), `--flow <file.json>`, `--endpoints <file.json>`, `--base-url <url>`, `--scene-threshold <n>`, `--max-frames <n>`, `--crop <w:h:x:y>`, `--env <KEY=VAL>` (repeatable), `--fs-diff`, `--header <Key: Value>` (repeatable), `--storage-state <file>`, `--from-commands <file>`, `--from-har <file>`, `--from-tests <path>` (static JS/TS/pytest import) |
316
+ | `verify` | Run the differential oracle and write `.vibecode/last-report.json`, `.vibecode/report.html` & `.vibecode/trends.ndjson` | `--target <cmd-or-url>` (optional when `--target-map` covers the domains), `--target-map <domain=target\|json>` (repeatable, e.g. `web=http://localhost:3000`), `--var <KEY=VAL>` (repeatable; also `VIBECODE_VAR_*`; fills `{{vars.NAME}}`, bypasses cache, redacted from all output and printed as `<REDACTED>` in `repro`), `--mode <exact\|structural\|functional\|reskin>`, `--concurrency <1-8>`, `--plugin <file.mjs>` (repeatable), `--affected` (verify only git-changed impacted invariants with fail-closed full fallback), `--strict`, `--invariant <id>` (repeatable), `--slice <id>` (repeatable), `--reveal-holdouts`, `--no-report`, `--no-fixtures` (skip `contract.fixtures` setup/teardown/rollback), `--allow-fixture-commands` (CLI-only opt-in for shell-free fixture command hooks), `--cache`, `--pretty`, `--header <Key: Value>` (repeatable), `--storage-state <file>` |
317
+ | `run` | Autonomous fresh-context slice loop until parity passes or safe stop | `--target <cmd-or-url>` (optional when `--target-map` covers the domains), `--target-map <domain=target\|json>` (repeatable), `--var <KEY=VAL>` (repeatable; also `VIBECODE_VAR_*`), `--mode <exact\|structural\|functional\|reskin>`, `--concurrency <1-8>`, `--plugin <file.mjs>` (repeatable), `--source <ref>`, `--domain <domain>`, `--agent <auto\|claude\|codex\|agy\|opencode\|mock:script>`, `--max-iterations <n>`, `--max-minutes <m>`, `--slice <id>` (repeatable), `--strict`, `--dry-run`, `--force`, `--no-report`, `--no-fixtures`, `--allow-fixture-commands`, `--cache`, `--pretty`, `--header <Key: Value>` (repeatable), `--storage-state <file>` |
318
+ | `report` | Generate self-contained HTML report, parity SVG badge, PR Markdown summary, SARIF 2.1.0, or JUnit XML | `--out <file>`, `--badge <file.svg>`, `--markdown <file.md>`, `--sarif <file.sarif>`, `--junit <file.xml>`, `--no-report` |
319
+ | `export-tests` | Export visible contract invariants into standalone zero-dep tests (`node-test`, `vitest`, `pytest`, `shell`, `playwright`) | `--format <node-test\|vitest\|pytest\|shell\|playwright>`, `--out <file>`, `--target <cmd-or-url>` |
320
+ | `export-openapi` | Compile visible HTTP invariants into an OpenAPI 3.0.3 YAML or JSON spec (secrets & holdouts stripped) | `--format <yaml\|json>`, `--out <file>`, `--name <title>`, `--base-url <url>` |
321
+ | `export-http` | Export visible HTTP invariants as `.http`, Copy-as-cURL, or Postman v2.1 collections (secrets & holdouts stripped) | `--format <http-file\|curl\|postman>`, `--out <file>`, `--name <title>`, `--base-url <url>` |
322
+ | `export-client` | Compile visible HTTP invariants into zero-dep typed TypeScript, Python, or Go API clients (secrets & holdouts excluded) | `--format <ts-fetch\|python\|go>`, `--out <file>`, `--name <title>`, `--base-url <url>`, `--pretty` |
323
+ | `export-har` | Export visible HTTP and web route invariants into a W3C HAR 1.2 archive (secrets & holdouts excluded) | `--out <file>`, `--name <title>`, `--base-url <url>`, `--pretty` |
324
+ | `export-graphql` | Compile visible GraphQL & REST HTTP invariants into GraphQL SDL or Introspection JSON (secrets & holdouts excluded) | `--format <sdl\|introspection>`, `--out <file>`, `--name <title>`, `--pretty` |
325
+ | `export-mcp` | Generate a standalone zero-dep runnable stdio JSON-RPC 2.0 MCP server from visible HTTP & CLI invariants | `--format <node-mjs\|ts>`, `--out <file>`, `--name <title>`, `--base-url <url>`, `--pretty` |
326
+ | `export-schema` | Compile visible HTTP & CLI schemas into Zod validators, Draft 2020-12 JSON Schema, or strict TypeScript guards | `--format <zod\|json-schema\|typescript>`, `--out <file>`, `--name <title>`, `--strict`, `--pretty` |
327
+ | `export-load` | Generate zero-secret load & soak benchmark suites for k6, Artillery YAML, or zero-dep Node runner | `--format <k6\|artillery\|node-bench>`, `--out <file>`, `--name <title>`, `--base-url <url>`, `--strict`, `--pretty` |
328
+ | `export-docs` | Generate Markdown reference, zero-CDN HTML interactive explorer, or `llms.txt` from visible invariants | `--format <markdown\|html\|llms-txt>`, `--out <file>`, `--name <title>`, `--base-url <url>`, `--strict`, `--pretty` |
329
+ | `export-ci` | Generate GitHub Actions, GitLab CI, or TAB-indented Makefile parity workflows (holdouts & secrets excluded) | `--format <github-actions\|gitlab-ci\|makefile>`, `--out <file>`, `--name <title>`, `--target <cmd-or-url>`, `--strict`, `--cache`, `--pretty` |
330
+ | `export-server` | Generate runnable zero-dep Node HTTP, Express TypeScript, or Python HTTP server scaffolds (holdouts & secrets excluded) | `--format <node-http\|express-ts\|python-http>`, `--out <file>`, `--name <title>`, `--port <n>`, `--strict`, `--pretty` |
331
+ | `mock` | Serve a deterministic contract mock server for visible `http` & `web_route` invariants (holdouts & secrets excluded) | `--port <n>`, `--dry-run`, `--pretty` |
332
+ | `merge` | Compose another contract into `.vibecode/contract.json` and inspect structural drift | `--with <contract.json>`, `--out <file>`, `--prefix <p>`, `--on-conflict <prefix\|overwrite\|skip>`, `--dry-run`, `--no-spec`, `--pretty` |
333
+ | `watch` | Re-run verification when watched paths change | `--target <cmd-or-url>`, `--target-map <domain=target>` (repeatable), `--var <KEY=VAL>` (repeatable), `--mode <exact\|structural\|functional\|reskin>`, `--concurrency <1-8>`, `--plugin <file.mjs>` (repeatable), `--smart` (selectively re-verify only impacted invariants per edit and skip docs-only edits), `--slice <id>` (repeatable), `--watch-path <dir>` (repeatable), `--debounce <ms>`, `--strict`, `--invariant <id>` (repeatable), `--no-fixtures`, `--allow-fixture-commands`, `--cache`, `--pretty`, `--header <Key: Value>` (repeatable), `--storage-state <file>` |
334
+ | `status` | Show contract metadata, adapter availability, slice summary, last report summary & verification trends | `--trends` (include `.vibecode/trends.ndjson` sparklines, latency drift & flaky hotspots), `--pretty` |
335
+ | `diff` | Compare `.vibecode/last-report.json` against a baseline report (`--baseline`) or inspect one invariant result | `--invariant <id>`, `--id <id>`, `--baseline <report.json>`, `--reveal-holdouts`, `--strict`, `--pretty` |
336
+ | `diagnose` | Root-cause failure triage on `.vibecode/last-report.json` with 3×3 spatial pixel-diff heatmaps, bbox shift vectors, and a minimal repair brief | `--brief`, `--strict`, `--pretty` |
337
+ | `flake` | Run sequential multi-pass verification (bypassing cache) to detect flaky/nondeterministic invariants and suggest `expected.normalize` rules | `--target <cmd-or-url>`, `--target-map <domain=target>` (repeatable), `--var <KEY=VAL>` (repeatable), `--runs <2-10>`, `--invariant <id>` (repeatable), `--slice <id>` (repeatable), `--strict`, `--reveal-holdouts`, `--no-fixtures`, `--allow-fixture-commands`, `--pretty`, `--header <Key: Value>` (repeatable), `--storage-state <file>` |
338
+ | `lint` | Audit `.vibecode/contract.json` for leaked secrets, weak assertions, duplicate IDs/probes, slice issues, and oracle strength | `--strength` (run static oracle strength & stub-bypass mutation audit), `--strict`, `--pretty` |
339
+ | `doctor` | Report environment health: Node, optional adapters, optional CLIs, coding agents, and MCP registration | `--scope <project\|global>`, `--strict`, `--antigravity-dir <dir>`, `--pretty` |
173
340
  | `mcp` | Start the newline-delimited JSON-RPC 2.0 stdio MCP server | (no required flags) |
174
- | `setup` | Idempotently merge MCP config and install `SKILL.md` for coding agents | `--clients <auto\|claude-code,cursor,antigravity>`, `--scope <project\|global>`, `--local`, `--dry-run`, `--antigravity-dir <dir>` |
341
+ | `setup` | Idempotently merge MCP config and install `SKILL.md` for coding agents | `--clients <auto\|all\|claude-code,cursor,antigravity,codex,opencode,windsurf,cline>`, `--scope <project\|global>`, `--local`, `--dry-run`, `--antigravity-dir <dir>` |
175
342
  | `help` | Print CLI usage summary (also `--help` / `-h` after any subcommand) | `--help`, `-h` |
176
343
 
177
- **Exit codes:** `0` = command succeeded or parity gate `pass` / `pass_with_warnings`; `1` = parity gate `fail`, existing contract without `--force` on `init`, `doctor` check failure (or warning with `--strict`), or setup config error; `2` = missing/invalid target or contract, missing required adapter (`incomplete` gate), missing `diff` invariant ID, or unknown command.
344
+ **Exit codes:** `0` = command succeeded, `lock --check` valid, `diagnose` clean, `flake` stable, or parity gate `pass` / `pass_with_warnings`; `1` = parity gate `fail`, `diagnose` issues found, `flake` flaky/nondeterministic/failing invariants detected, `lock` baseline failure / overwrite conflict / tamper detected, existing contract without `--force` on `init`, `doctor` check failure (or warning with `--strict`), or setup config error; `2` = missing/invalid target, `--mode`, `--concurrency`, `--plugin`, `--runs`, directory, lock, report, or contract, missing required adapter (`incomplete` gate or all `flake` invariants skipped), missing `diff` invariant ID, or unknown command.
178
345
 
179
346
  ---
180
347
 
@@ -183,7 +350,7 @@ node benchmarks/runner.ts --results <dir> # aggregate runs -> benchmarks/s
183
350
  <details>
184
351
  <summary><strong>Which coding agents work with vibecode-anything?</strong></summary>
185
352
 
186
- Any agent that supports local stdio MCP servers or agent skills. `vibecode-anything setup` automatically registers MCP configs and installs `SKILL.md` for Claude Code, Cursor, and Antigravity; other clients (such as OpenCode or Codex) can run `vibecode-anything mcp` directly or invoke the CLI.
353
+ Any agent that supports local stdio MCP servers, CLI execution, or agent skills. `vibecode-anything setup` automatically registers MCP configs and installs `SKILL.md` for **Claude Code, Cursor, Antigravity, Codex, OpenCode, Windsurf, and Cline** (`--clients all` installs all 7; `--clients auto` includes the core 3 plus any detected client config); `vibecode-anything run` natively drives `claude`, `codex`, `agy`, `opencode`, and custom `mock:<script>` adapters.
187
354
 
188
355
  </details>
189
356
 
@@ -202,16 +369,16 @@ By default, hard invariants must pass 100% (`exit 1` if any fail) while soft per
202
369
  </details>
203
370
 
204
371
  <details>
205
- <summary><strong>How do --slice and watch speed up agent build loops?</strong></summary>
372
+ <summary><strong>How do --slice, --cache, and watch speed up agent build loops?</strong></summary>
206
373
 
207
- Contracts group invariants into dependency-ordered slices. Passing `--slice <id>` verifies only the target slice and records its progress in `.vibecode/contract.json`, while `watch` debounces filesystem edits and reports `newlyFixed` and `newlyBroken` transitions on every save.
374
+ Contracts group invariants into dependency-ordered slices (`--slice <id>`). Adding `--cache` reuses SHA-256 verified deterministic results while skipping holdouts and live URLs (auto-invalidating on file/strict/env edits), and `watch` debounces filesystem edits to surface `newlyFixed` and `newlyBroken` transitions live.
208
375
 
209
376
  </details>
210
377
 
211
378
  <details>
212
379
  <summary><strong>Does vibecode-anything upload my code or targets anywhere?</strong></summary>
213
380
 
214
- No. All ingestion, sandboxing, differential verification, image diffing, and MCP serving run 100% locally.
381
+ No. All ingestion, sandboxing, differential verification, image diffing, HTML proof generation, and MCP serving run 100% locally. See [SECURITY.md](SECURITY.md) for the full threat model and secret-redaction guarantees.
215
382
 
216
383
  </details>
217
384
 
@@ -220,13 +387,18 @@ No. All ingestion, sandboxing, differential verification, image diffing, and MCP
220
387
  - [x] **v0.1.0-alpha:** Core `.vibecode/contract.json` schema, CLI skeleton, `cli` differential oracle, `SKILL.md`
221
388
  - [x] **v0.2.0:** Multi-modal ingest/oracle support (`web`, `api`, `repo`, `image`, `video`), `rea` / `CLI-Anything` adapters, stdio MCP server, idempotent `setup`, and the A/B benchmark harness
222
389
  - [x] **v0.3.0:** 100% strict TypeScript codebase (`src/`, `test/`, `benchmarks/`, `examples/`), incremental slice tracking, `watch` mode, and `doctor` diagnostics
390
+ - [x] **v0.4.0:** Deterministic `.vibecode/SPEC.md`, external holdout vault + anti-cheat gate, closed-loop Goldfish `run` orchestrator, SHA-256 `--cache`, and self-contained `.vibecode/report.html` visual proof
223
391
 
224
- ## Documentation
392
+ ## Documentation & Community
225
393
 
394
+ - [Contributing Guide](CONTRIBUTING.md)
395
+ - [Changelog](CHANGELOG.md)
396
+ - [Security Policy](SECURITY.md)
226
397
  - [Examples Index](examples/README.md)
227
- - [Idea One-Pager](docs/ideas/vibecode-anything.md)
398
+ - [Live Interactive Showcase](https://nguyenthanhthe.github.io/vibecode-anything/) & [Live Visual Proof Demo](https://nguyenthanhthe.github.io/vibecode-anything/demo/)
399
+ - [GitHub Action Guide](docs/github-action.md)
400
+ - [TypeScript SDK Guide](docs/sdk.md)
228
401
  - [System Architecture](docs/architecture.md)
229
- - [Implementation Plan](docs/implementation-plan.md)
230
402
  - [Benchmark Protocol](benchmarks/PROTOCOL.md)
231
403
  - [Agent Skill](skills/vibecode-anything/SKILL.md)
232
404
  - [Roadmap Queue](docs/roadmap-queue.md) & [Evolution Log](docs/evolution-log.md)