npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cleak/common

v0.2.1

Published

Shared types, Zod schemas, and framework-free C/C++ memory-leak analysis (heuristic + consensus judge, report renderers) for the cleak toolchain.

Readme

@cleak/common

Thư viện dùng chung cho cả workspace: kiểu dữ liệu + Zod schema, judge layer (heuristic + consensus), phân tích rò rỉ, đối chiếu bằng chứng động, độ đo đánh giá, và bộ render report. Đây là nơi đặt ranh giới quyết định leak-vs-clean — phần lõi học thuật của luận văn — để mọi orchestrator/script dùng chung một logic, một schema.

Publish lên npm (@cleak/common); build bằng tsup. Không thực thi gì, không đọc env.

Bố cục & subpath export

src/
  index.ts                         → "@cleak/common"            (types + validation + scan-flow-contract)
  types/leak-schema.types.ts       LeakCandidate, LeakBundle, Evidence, Verdict, …  ("@cleak/common/types")
  validation/                      Zod schema cho I/O analyzer + verdict
  flow/scan-flow-contract.ts       ScanEvent/ScanEventName, hợp đồng pha scan ("@cleak/common/flow/scan-flow-contract")
  analysis/                        ("@cleak/common/analysis/*")
    heuristic-judge.ts             judgeHeuristically() — chốt verdict tất định cho MỌI bundle
    consensus-judge.ts             judgeByConsensus() — k mẫu LLM + luật gộp (điểm novelty)
    heuristic-leak-analysis.ts     analyzeLeakHeuristically(), enrichLeakVerdict(), repair suggestion
    dynamic-evidence.ts            correlateEvidence(), firstUserFrame(), normalizeLeakKind()
    judge-shared.ts                ngưỡng + chuỗi verdict dùng chung (JUDGE_VERDICT_THRESHOLDS, …)
    metrics.ts                     computeMetrics(), mcnemar(), bootstrapCI(), calibration/ECE
    reporting.ts                   LeakReporting — render JSON / Markdown / HTML / snapshot

Lưu ý import: analysis/* không re-export ở root. Dùng subpath, ví dụ import { judgeHeuristically } from '@cleak/common/analysis/heuristic-judge'.

API tiêu biểu

| Symbol | Module | Vai trò | |---|---|---| | judgeHeuristically(...) | analysis/heuristic-judge | verdict tất định cho mọi bundle (heuristic) | | judgeByConsensus(...) | analysis/consensus-judge | gộp k mẫu LLM judge (ConsensusConfig, luật majority/weighted/unanimous) | | analyzeLeakHeuristically, enrichLeakVerdict, buildRepairSuggestion | analysis/heuristic-leak-analysis | phân tích + làm giàu verdict + gợi ý sửa | | correlateEvidence, firstUserFrame, normalizeLeakKind, deriveDynamicFields | analysis/dynamic-evidence | đối chiếu bằng chứng động ↔ ứng viên tĩnh | | computeMetrics, mcnemar, bootstrapCI, expectedCalibrationError | analysis/metrics | confusion matrix, kiểm định McNemar, CI bootstrap, ECE | | LeakReporting | analysis/reporting | render report 4 định dạng | | LeakCandidate, LeakBundle, Evidence, Verdict | types | schema bó dữ liệu chia sẻ giữa các app | | ScanEvent, ScanEventName | flow/scan-flow-contract | hợp đồng sự kiện pha scan |

Mô hình verdict (tóm tắt)

Heuristic chấm điểm bằng chứng (tĩnh + động) → ánh xạ qua JUDGE_VERDICT_THRESHOLDS thành verdict; bundle borderline mới đẩy lên LLM judge / consensus. Bằng chứng động exercised_clean kích hoạt cổng minh oan (giảm FP), definitely_lost tương quan thì cộng điểm. Chi tiết: docs/EVALUATION.md · docs/ARCHITECTURE.md.

Build / test

turbo run build --filter=@cleak/common    # tsup (nhiều entry: index/types/flow/analysis)
turbo run test  --filter=@cleak/common    # bun test