MCPcopy Index your code
hub / github.com/corca-ai/nose

github.com/corca-ai/nose @v0.18.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.18.0 ↗ · + Follow
9,376 symbols 40,431 edges 1,237 files 897 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

nose

nose finds duplicated code — literal copy-paste, renamed copies, and the same logic written in a different style or language — across Python, JavaScript, TypeScript, Go, Rust, Java, C, Ruby, Swift, plus declarative CSS (computed-style equivalence) and HTML markup (rendered-DOM equivalence), including the <script>/<style>/markup regions inside Vue, Svelte, and HTML. It proves its semantic matches are real — equal fingerprint ⟹ equal behavior, never a false equivalence — and ranks candidates by refactoring value for triage or CI. One self-contained Rust binary; no runtime, services, or network.

What semantic means

Other copy-paste detectors compare token runs. nose lowers code into a normalized semantic IL, so it can catch repeated computation even when the code does not look copied:

def a(xs):
    total = 0
    for x in xs:
        if x > 0:
            total += x
    return total

def b(xs):
    return sum(x for x in xs if x > 0)
def a(p, q, r, s):
    return not ((p or q) and (r or s))

def b(p, q, r, s):
    return (not s and not r) or (not q and not p)

Install

# Homebrew (macOS / Linux):
brew install corca-ai/tap/nose

# Or the install script (downloads a prebuilt binary):
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/corca-ai/nose/releases/latest/download/nose-cli-installer.sh | sh

Quick start

Point nose query at a directory to inspect its duplication. It prints a summary and runnable next commands, so you can filter, group, or open one family without memorizing flags:

$ nose query src
nose finds duplication in code and docs.
nose finds; you judge. Filter, group, sort, or open families to explore.
analyzed 23 files · python 14 · typescript 9

4 duplicated-code families.
  verified 1 (exact 1 · shared-core 0) · copy-paste 1 · similar 2
  verified = machine-checked evidence · exact = same unit behavior · shared-core = shared computation

best candidates:
  src/loaders/users.py:1  load_users  2 copies · 8/10 shared, 2p · ~8 removable · similar   nose query src id=b221962180
  …
next commands — replace <path> with your path; terms combine with AND:
  filter  nose query <path> witness=exact   keep only the exact-behavior families
  group   nose query <path> group=dir       totals by directory (or: witness, lang, scope)
  open    nose query <path> id=<id> full     one family: every copy + the extraction skeleton

nose query is the one command for every workflow over that dataset. Use it broadly for agent/human exploration, and pin it tightly when it is a CI gate:

# Explore and triage
nose query src                               # summary, best candidates first
nose query src id=<fam> full                 # open one family: every copy + extraction skeleton
nose query src base=origin/main              # PR check: a change applied to one copy but not its siblings
nose query src --format markdown             # a ranked report to paste into a PR or issue
nose query src --format json                 # the versioned machine-readable contract
nose query docs                              # also reports same-language near-duplicate Markdown prose

# Gate on copy-paste only, with an explicit size budget
nose query src --mode syntax --min-size 80 'lines>25' --fail-on any
nose query src --mode syntax --min-size 80 'shared>20' --fail-on any
nose query src --mode syntax --min-size 80 'dup>80' --fail-on any

By default it runs all three channels — syntax (copy-paste runs), semantic (exact same-logic Type-4 clones), and near (fuzzy near-duplicates) — and respects .gitignore; pass --mode to run exactly the channels you list. See agent-recipe for the exploration loop and continuous integration for stable copy-paste-only gates, baselines, and SARIF.

Documentation

Status

Pre-1.0. Current capability, language, JSON, benchmark, and soundness details live in the wiki so claims have one source of truth:

License

MIT

Extension points exported contracts — how you extend this code

LibraryApiContractParts (Interface)
(no doc) [27 implementers]
crates/nose-semantics/src/library_api/resolvers/admission.rs
Detector (Interface)
Pluggable similarity scorer. Returns a score in `[0, 1]` for a candidate pair. [4 implementers]
crates/nose-detect/src/detectors.rs
EvidenceKindPrefix (Interface)
(no doc) [1 implementers]
crates/nose-semantics/src/packs/validation.rs
LibraryApiFixtureContract (Interface)
(no doc)
crates/nose-semantics/src/tests/library_api_evidence/records.rs

Core symbols most depended-on inside this repo

add
called by 2389
crates/nose-il/src/builder.rs
get
called by 1488
crates/nose-frontend/src/module_imports/exports.rs
iter
called by 1333
crates/nose-il/src/unit_domains.rs
len
called by 1176
crates/nose-il/src/builder.rs
node
called by 1134
crates/nose-il/src/il.rs
kind
called by 1124
crates/nose-il/src/il.rs
join
called by 951
crates/nose-semantics/src/evidence/value_laws.rs
stable_symbol_hash
called by 850
crates/nose-il/src/intern.rs

Shape

Function 7,363
Method 1,225
Class 578
Enum 206
Interface 4

Languages

Rust84%
Python13%
TypeScript1%
Java1%
Ruby1%
Go1%

Modules by API surface

scripts/scheduling-lifecycle-boundary-audit.py103 symbols
bench/type4/generate.py89 symbols
eval/divergence_fire/replay.py51 symbols
scripts/python-hof-runtime-audit.py47 symbols
crates/nose-semantics/src/library_api/contracts.rs46 symbols
crates/nose-semantics/src/effects.rs46 symbols
crates/nose-semantics/src/library_api/resolvers.rs43 symbols
crates/nose-semantics/src/demand.rs41 symbols
crates/nose-frontend/src/rust/functions.rs40 symbols
bench/type4/query_regression/query_regression.py40 symbols
crates/nose-semantics/src/operators.rs38 symbols
crates/nose-normalize/src/value_graph/state.rs38 symbols

For agents

$ claude mcp add nose \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact