[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107580":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":36,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":15,"starSnapshotCount":15,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},107580,"crab","lemonadesaltbagel\u002Fcrab","lemonadesaltbagel","CRAB (Clean Rebuild of Anything's Behavior): rebuild software from behavior, not source code. An MCP-powered toolkit for black-box observation, clean-room reimplementation, and behavioral verification.","https:\u002F\u002Fpypi.org\u002Fproject\u002Fcrab-cleanroom\u002F",null,"Python",431,80,58,0,13,55,251,43,95.68,"Apache License 2.0",false,"main",true,[26,27,28,29,30,31,32,33,34,35],"ai-agents","behavioral-testing","black-box-testing","clean-room-reimplementation","model-context-protocol","playwright","reverse-enginnering","sandboxing","software-reimplementation","specification-generation","2026-11-14 05:37:04","2026-11-23 18:41:55","\u003Cdiv align=\"center\">\n\n# CRAB\n\n### Clean Rebuild of Anything's Behavior\n\nClean-room reimplementation by black-box observation.\n\n**See a feature you like. Rebuild it from how it behaves, never from its code.**\n\n[![Python 3.12+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12%2B-3776ab?style=flat-square&logo=python&logoColor=white)](pyproject.toml)\n[![MCP servers](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMCP-observe_%C2%B7_clean-5c4ee5?style=flat-square)](#how-crab-works)\n[![Targets](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftargets-CLI_%C2%B7_web_%C2%B7_Android-0f766e?style=flat-square)](#what-you-can-analyze)\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fcrab-cleanroom?style=flat-square&color=f59e0b)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fcrab-cleanroom\u002F)\n[![Apache-2.0 license](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache--2.0-d22128?style=flat-square)](LICENSE)\n\n[Quick start](#quick-start) · [How CRAB works](#how-crab-works) · [What you can analyze](#what-you-can-analyze) · [Results](#results) · [FAQ](#faq) · [Documentation](#documentation)\n\n\u003Ccode>uv tool install \"crab-cleanroom[web]\" && crab demo\u003C\u002Fcode>\n\n\u003C\u002Fdiv>\n\n> [!NOTE]\n> CRAB was called **Teardown** until 0.3. The `teardown` command, `TEARDOWN_*` variables and an existing\n> `~\u002F.teardown` keep working for this release; the package is now `crab-cleanroom`.\n\n> [!IMPORTANT]\n> CRAB is early software (0.4). You declare the purpose of every analysis at intake and own its legal\n> assessment. Read [Responsible use](#responsible-use) first.\n\n\u003Cdiv align=\"center\">\n\n\u003Cbr \u002F>\n\n\u003Cimg src=\"docs\u002Fassets\u002Fcrab-flow.svg\" alt=\"A confined observer studies the target's behavior through CRAB's drivers; the gate releases a sanitized spec; a confined clean agent rebuilds the feature and gets abstract verdicts back\" width=\"1200\" \u002F>\n\n\u003Cbr \u002F>\u003Cbr \u002F>\n\n\u003C\u002Fdiv>\n\n---\n\nSee a feature in an app that you want in your own product? CRAB lets you rebuild it **without ever looking at\nits implementation**. One agent, the *observer*, studies the app as a black box. It records what the app accepts,\nrefuses and defaults to, what it does at the edges, and how its screens are sequenced. CRAB turns that into\nfalsifiable rules and claims and releases them as a sanitized spec. A second agent, the *clean implementer*, sees\nonly that spec and writes its own implementation. It can check its work against the original, but it only ever\ngets back abstract pass\u002Ffail verdicts.\n\nThe valuable knowledge about a feature is behavioral. Tracing the implementation through binaries, minified\nbundles or obfuscated code is slow, brittle, and copies expression you don't want. CRAB never captures code,\ndecompilation or stack traces. What it cannot observe becomes an explicit *unknown*, not a silent gap.\n\nBoth sides can run **enforced, not just instructed**. The observer works in a container whose only way to the\ntarget is CRAB's drivers. The implementer works in a container that sees only the spec. Every crossing goes\nthrough the gate and is recorded in a signed, hash-chained audit log.\n\n## Quick start\n\n### Install\n\n```bash\nuv tool install \"crab-cleanroom[web]\"   # Python 3.12+; the command is `crab`\ncrab install-browser                   # Chromium for web targets\ncrab demo                              # observe -> gate -> clean -> verdict on a built-in example\n```\n\n`pip install \"crab-cleanroom[web]\"` works too, and\n`uv tool install \"crab-cleanroom[web] @ git+https:\u002F\u002Fgithub.com\u002Flemonadesaltbagel\u002Fcrab\"` installs the\nlatest unreleased version. Docker is needed for CLI targets (each run is isolated in a container)\nand for the enforced rooms; an installed copy builds the room images from files it carries. Android needs the SDK\nand an emulator or device reachable through `adb`.\n\nTo work on CRAB itself, use a checkout: `git clone https:\u002F\u002Fgithub.com\u002Flemonadesaltbagel\u002Fcrab.git`, then\n`uv sync` and `uv run crab ...`.\n\n### Set up your agent\n\nRegister the observe server with your agent (Claude Code shown; any MCP client works):\n\n```bash\nclaude mcp add crab-observe -- crab observe --project \u002Fpath\u002Fto\u002Fproject\n```\n\nFrom a checkout, use `uv run --directory \u002Fpath\u002Fto\u002Fcrab crab observe ...` instead.\n\nThen ask:\n\n```text\nOpen web:http:\u002F\u002Flocalhost:3000\u002F as a research target and follow the observe_target playbook:\ndiscover the UI, probe every field, inject API faults, state rules, close the coverage gaps\nand release the spec.\n```\n\nThe playbook ([docs\u002Fobserver-playbook.md](docs\u002Fobserver-playbook.md)) is served as the `observe_target` MCP\nprompt; the observer guide ([docs\u002Fobserver-guide.md](docs\u002Fobserver-guide.md)) details every tool.\n\n### Review and release\n\n```bash\ncrab review  --project P --feature F           # gate findings by class, coverage gaps\ncrab approve --project P --feature F --by you@example.com --class expected-output --reason test-oracle\ncrab release --project P --feature F\ncrab export-clean --project P --out KIT        # the kit: released spec + build\u002Fverify scaffolding\n```\n\nIn strict mode every release needs your approval at a terminal, and the observer's tools cannot approve\nanything. In practice that is a few class-level decisions per release: approve the app text the clone must\nreproduce, approve the action names, acknowledge the coverage gaps the observer explained\n([docs\u002Fstrict-gate.md](docs\u002Fstrict-gate.md)).\n\n### Rebuild in the clean room\n\n```bash\ncrab cleanroom up    --project P --kit KIT --claude-token-file ~\u002F.config\u002Fcrab-claude-token\ncrab cleanroom check --project P               # isolation probes, run from inside the container\ncrab cleanroom shell --project P -- claude     # the implementer sees only \u002Fkit; `verify` asks the gate\ncrab cleanroom down  --project P\n```\n\n`crab observerroom` confines the observer the same way\n([docs\u002Fclean-runtime.md](docs\u002Fclean-runtime.md)).\n\n## How CRAB works\n\n1. **Observe.** Drivers run the target and capture behavior only: outputs and file effects for CLIs,\n   accessibility trees and API exchanges for web apps, accessibility trees for Android. A *mapper* turns each\n   observation into a compact, wording-agnostic symbol. For web apps that symbol is versioned (`web.aria\u002Fv10`)\n   and records everything a user-facing Playwright test can tell apart.\n2. **Generalize.** UI discovery crawls every screen. The observer probes fields by equivalence class and\n   boundary, injects faults (server errors, network failures, malformed bodies, unreadable files, airplane\n   mode) and states rules in its own words. CRAB checks every rule against the original and records it as\n   corroborated or falsified. Coverage lists what is left: each control, field, endpoint × fault, data state\n   and live output, every route signed in and signed out, and record pages in each status. A release is\n   refused until every item is exercised or explained.\n3. **Gate.** The release is checked for copied expression (verbatim and near-verbatim matches against everything\n   observed and every ingested document) and for real names, which become a codename. In strict mode, findings\n   need your recorded approval.\n4. **Rebuild.** The clean agent builds from the spec and asks the gate to verify its build. The gate runs the\n   original and the clone through the same tests and returns pass\u002Ffail with abstract symbols, never the\n   original's text or evidence.\n\n## What you can analyze\n\n| Target | What CRAB observes | Faults it can inject | Requirements | Status |\n|---|---|---|---|---|\n| Command-line tools | Exit code, stdout, diagnostic presence and errno class, file effects | Closed\u002Ffull stdio, unreadable files, read-only directories | Docker (isolated runner) or local | **Stable** |\n| Web apps | Everything a user-facing Playwright locator or assertion can tell apart (the accessibility tree with roles, names, levels, states and nesting; field values and properties; titles, focus, status messages, landmarks text), plus API method\u002Fpath\u002Fstatus and public-contract selectors | 5xx, network failure, timeout, malformed body, pending requests, changed responses (server modes); API setup calls to reach deep screens | Playwright Chromium; optional backend reset command | **Working**: 96.9–99.2% of hidden tests on the last three held-out apps (see Results) |\n| Android apps | Controls by role and name with state flags, visible text, system dialogs | Network off (airplane mode) | Android SDK, emulator or device via `adb` | **Working** |\n| Linux desktop apps | AT-SPI tree: windows, controls, text, list items | — | Docker (Xvfb + AT-SPI container) | Experimental |\n| macOS, Windows, iOS | — | — | — | Not started |\n\nCRAB refuses to bypass protections and never captures implementation-tier data (see\n[Responsible use](#responsible-use)).\n\n## Results\n\nEach result was scored on a hidden test suite the observer never saw, against the original's own score under\nthe same harness. How the evaluation works, and every result with its caveat, is in\n[docs\u002Fevaluation.md](docs\u002Fevaluation.md).\n\n| target | hidden suite |\n|---|---|\n| A command-line tool no model has seen | **397\u002F397** from the spec alone |\n| Web apps no model has seen (the last three held-out apps) | **129\u002F130, 126\u002F130, 125\u002F127** |\n| Android apps no model has seen | **113\u002F118** and **100\u002F119** (the second built without any verification feedback) |\n| RealWorld \"Conduit\" web frontend (tooling tuned against it) | 99\u002F101 |\n| Flipt v1.61.0, a real open-source web app, on its own suite | 19\u002F55 in the fourth round (from 9 in the first): an application many times larger; 21 of its tests need a server mode the observer could not find, and the other misses are sections the coverage report listed as unexplored (see the evaluation notes) |\n\n- **The clones reproduced their specs.** What the hidden suites caught were things the spec did not contain.\n- **The web abstraction is built from a principle.** It records every difference a user-facing Playwright\n  locator or assertion can see, checked by an audit of page pairs that must differ and pairs that must not.\n- **The strict-gate rounds took a few class-level decisions** at the person's own terminal per release. The\n  audit log records each one.\n- **Famous targets measure the model's memory too.** On `jq`, the same model with no spec at all did as well as\n  with it. That is why the benchmarks use apps written for the purpose.\n\n## FAQ\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Which agents can use CRAB?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nAny agent that supports MCP. The observe server runs over stdio or HTTP (`crab observe --port`). The\nenforced rooms ship a container with Claude Code and register only the room's CRAB server. Any other agent\nthat can run in the container and use a proxy works too.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Does CRAB read the target's code?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nNo. Drivers capture behavior-tier data only. Stack traces are redacted at capture, Android resource ids and\nactivity names never enter observations, and web API bodies are reduced to value-free shapes. In the observer\nroom, the observer agent cannot reach the target's files, bundles or the internet at all: only CRAB's tools.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>How is the clean side kept clean?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nThe implementer's container mounts only the kit. Its only network peer is an egress proxy that allows the gate\nand the model API. The gate accepts only clones built from the kit and returns abstract verdicts. Unexpected\nerrors come back generic, so dirty-side detail cannot leak through them. `cleanroom check` proves the isolation\nfrom inside the container.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>What about the model's own memory?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nNo container can close that gap. If the implementer's model already knows the target, part of the result is\nmemory. CRAB asks implementers whether they recognized the target and reports it. The uncontaminated\nbenchmarks use apps written for the purpose.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Does CRAB upload my app?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nCRAB runs locally. Your agents send their tool results to their model provider, which has its own data\npolicy.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Is reimplementing a product this way legal?\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nThat depends on your jurisdiction, the target's terms and what you build. CRAB records your declared\npurpose and shows applicable warnings, but it does not give legal advice. A clean room addresses copying of\nexpression. It does not address patents, trademarks or trade dress.\n\n\u003C\u002Fdetails>\n\n## Documentation\n\n- [Observer playbook](docs\u002Fobserver-playbook.md): the loop the observer agent follows (also an MCP prompt).\n- [Observer guide](docs\u002Fobserver-guide.md): driving the dirty side for CLI, web and Android targets.\n- [Strict gate](docs\u002Fstrict-gate.md): reviewing findings and approving releases.\n- [Clean runtime](docs\u002Fclean-runtime.md): the enforced clean room and observer room.\n- [Evaluation](docs\u002Fevaluation.md): the benchmark method and every result with its caveats.\n\n## Responsible use\n\nCRAB never:\n\n- bypasses CAPTCHAs, bot protection, certificate pinning, root or attestation checks, or FLAG_SECURE;\n- flips Electron fuses or re-signs binaries;\n- uses fake accounts or exceeds configured rate limits;\n- captures implementation-tier data (code bodies, decompilation, stack traces).\n\nThese refusals are not configurable. Observe only software you are allowed to observe, within its terms. You\ndeclare your purpose at intake and own the legal assessment.\n\n## Contributing\n\nIssues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the ground rules, and report\nanything that could let information cross the clean-room barrier privately through [SECURITY.md](SECURITY.md).\nChanges are listed in [CHANGELOG.md](CHANGELOG.md).\n\n```bash\nuv sync\nuv run ruff check src tests\nuv run pytest -q    # Android and desktop tests run when an emulator \u002F the desktop image is available\n```\n\n## License\n\n[Apache License 2.0](LICENSE). See [NOTICE](NOTICE).\n\nThe license covers CRAB's own code and documents. CRAB grants no rights in the software you analyze:\nobserving a target, and building and distributing anything from what you observed, remain subject to that\ntarget's terms and the law that applies to you.\n","CRAB（Clean Rebuild of Anything's Behavior）是一个基于行为驱动的黑盒软件重实现工具包，支持对CLI、Web和Android等目标进行纯行为观测、清洁室重实现与行为一致性验证。其核心采用MCP（Model Context Protocol）架构，通过隔离的观察者代理采集输入-输出响应、边界行为与状态流转，生成可证伪的抽象规格；再由隔离的实现者代理仅依据该规格开发新实现，并通过沙箱化交互获取抽象化的通过\u002F失败反馈。全程不接触源码、不反编译、不提取堆栈，确保法律与技术合规性。适用于需规避知识产权风险的竞品功能复现、遗留系统行为迁移、第三方服务API契约推断等场景。",2,"2026-11-24 04:32:17","CREATED_QUERY"]