
Emara: Deterministic feature slicing and dead-code reachability without LLMs
Understand the codebase you are taking over. Emara identifies functionality in JavaScript, TypeScript, and Python repositories, points you to source locations, compares code with documentation, and flags potentially unu…
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Understand the codebase you are taking over. Emara identifies functionality in JavaScript, TypeScript, and Python repositories, points you to source locations, compares code with documentation, and flags potentially unused code for review.
It runs locally in deterministic mode with zero model requests. It parses the target repository rather than executing its application code. Static analysis can be wrong: source evidence helps you inspect a finding, not automatically trust it.
Read the reviewed room-booking sample. It includes booking endpoints, links to exact source lines, one cleanup candidate, and known errors alongside the unchanged generated report. No installation is needed.
For example, Emara locates DELETE /rooms/:id/:bookingId at api/routes/rooms.js:154. The sample checks that handler against source and shows what the result does and does not establish.
Current status: early CLI for developer investigation. Documentation matching and legacy JSX import handling have known errors in this sample. Findings require review; no candidate is automatically safe to delete.
Explore pre-computed interactive feature maps in your browser with zero installation (AST slicing, dependency flow, simulated removal blast radius, and exact source inspection):
Watch or download the walkthrough demo (MP4).
Use a clean Git checkout of a JavaScript, TypeScript, or Python repository you know. The current scanner does not generally honor .gitignore; old reports and other local files can affect an audit. Keep output outside the target repository. The target application's dependencies do not need to be installed.
git clone https://github.com/mohamedswe/emara.git cd emara npm ci npm run auditor -- "/absolute/path/to/repo" --deterministic --output "../mapping-output/functionality-audit.json" --graph "../mapping-output/graph.json"
Replace /absolute/path/to/repo with your target path. Windows accepts forward-slash paths such as C:/projects/client-app. ../mapping-output is relative to the Emara checkout; choose another output directory if that would put results inside your target.
To start the local visualizer workspace and explore architectural flows:
npm run serve
Open http://localhost:4173 in your browser (or use the URL printed by the server).
The local server requires its per-session token for analysis requests, rejects foreign hosts/origins, and accepts JSON bodies up to 16 KiB. It runs one distinct analysis at a time and coalesces identical in-flight requests. Its retained payload cache is limited to eight entries and 64 MiB of serialized JSON; this does not cap a single analysis's peak memory or clone size.
If native package installation needs a compiler, use Docker instead. With Docker running, create an output directory outside the target first. Replace both absolute paths below; the target is mounted read-only:
docker run --rm -v "/absolute/path/to/repo:/repo:ro" -v "/absolute/path/to/output:/output" ghcr.io/mohamedswe/emara:latest /repo --deterministic --output /output/functionality-audit.json --graph /output/graph.json
Use absolute forward-slash Windows paths in PowerShell, for example C:/projects/client-app:/repo:ro and C:/projects/emara-output:/output.
Deterministic analysis is the default, makes zero model requests, and needs no API key—even when DEEPSEEK_API_KEY is present. Installation and image downloads require network access. To explicitly send source/context to DeepSeek, pass --model-assisted and provide the key; the CLI prints the provider endpoint before analysis. --deterministic remains supported and cannot be combined with --model-assisted.
Emara normally parses the target rather than executing its application code. Optional --validate-dead-code commands do execute code in a disposable copy, not a security sandbox: commands retain your user/container permissions and network access. Only run validation commands and repositories you trust.
Open audit-report.md in your chosen output directory when the run completes. The report starts with a Takeover Summary, then lists feature locations and review candidates. Keep functionality-audit.json and graph.json for structured evidence; semantic-passes.json records semantic-pass activity.
Pick one feature you already understand and compare the report with its source. Does Emara locate it correctly? What does it miss or get wrong? Would the report give you a useful starting point on an unfamiliar repository?
Share audit feedback, including setup failures. One specific finding and what you expected is enough. If you received a personal invitation, replying to that email is fine too.
Audit artifacts can contain private names, paths, and documentation. Do not post client code, secrets, or full reports without reviewing them and obtaining permission. A redacted example or public reproduction is enough. Findings are leads for investigation, not proof of runtime behavior or permission to delete code.
The sample's unchanged report shows the current output. Read its review notes before interpreting the counts or verdicts.
Features classified as implemented and documented, implemented but undocumented, partially implemented, documented but not implemented (DNI), or ambiguous.
Dead-code candidates grouped by deterministic reachability class: product-reachable, startup-reachable, test-only, unproven public API, dynamic unknown, and disconnected candidate. A candidate is never declared safe to delete without isolated validation.
Documentation-versus-code drift, including undocumented behavior, unsupported promises, partial promises, and documentation claims that cannot be mapped to implementation evidence.
How findings are produced
The deterministic graph is the evidence boundary. Parsing, framework recognition, entrypoints, source ranges, SHA-256 content hashes, reachability, feature membership, statuses, and dead-code verdicts are computed in code. The language model never decides membership or verdicts; in assisted mode, DeepSeek can only propose human-readable labels and tightly bounded documentation mappings, which deterministic validation may reject. Gold-standard release oracles live in bench/oracles/, repeated-run checks require stable memberships, statuses, canonical IDs, and dead-code candidates, and assisted functionality audits make at most two DeepSeek-only requests. Deterministic mode makes none. See the architecture for the full boundary.
These are historical release checks, not fresh measurements for every engine change or accuracy percentages. An oracle PASS covers selected hand-written expectations, not every finding. The current reproducible sample includes a fresh run and its known failures.
The current evidence frontends cover JavaScript and TypeScript (.js, .jsx, .mjs, .cjs, .ts, .tsx, .mts, and .cts) plus Python (.py, .pyi, and .pyw). Vue, Svelte, and Astro receive line-preserving analysis for their JavaScript/TypeScript script regions. Built-in conventions include Flask, FastAPI, Express, Next.js App Router, knex migrations, and npm-script entrypoints, with broader framework recognition documented in the support contract.
This is static analysis, not a language type checker or a runtime tracer. Go, Rust, Java, C#, Ruby, PHP, and other language families do not yet have source frontends. Generated code, reflection, eval, runtime route construction, monkey-patching, remote plugins, and unresolved dependency injection may remain unknown. Template semantics in Vue, Svelte, and Astro are shallower than JSX analysis, and detected frameworks are reported separately from fully understood conventions.
Maintainability scoring: dead-code ratio, unexplained-code percentage, test-only production code, and coupling.
Change blast-radius analysis: show which features and shared subsystems can be affected when a file or symbol changes.
Certification reports for reproducible release evidence and policy gates.
Deeper language and framework support, with the same exact-source evidence requirements.
License
Software Auditor is source-available under the Functional Source License 1.1, MIT Future License. It is free for non-competing use. Commercial use that competes with Software Auditor requires a paid license. Each released version becomes available under MIT on the second anniversary of its release.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。