# @adlc/rejection-mining 中文文档

规范地址：https://npmcn.com/package/%40adlc/rejection-mining/

版本：1\.12\.0
npm 元数据更新时间：2026-10-10T03:04:57.259Z
中文译文更新时间：2026-11-06T00:15:35.925Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40adlc/rejection-mining
原文对照：https://npmcn.com/package/%40adlc/rejection-mining/?lang=original
项目主页：https://github.com/voodootikigod/adlc/tree/main/packages/rejection-mining#readme
源码仓库：https://github.com/voodootikigod/adlc

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：36.7 kB，12 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=18
- 运行依赖：1 个
- 首次发布：2026-06-13T21:12:50.217Z
- 最新版本发布：2026-10-10T03:04:56.863Z
- 近 30 天下载量：8277（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：18（近 12 个月 18 个）

## 中文简介

将人类公关审查异议分为结构化起诉视角(C13).

## 安装

```sh
npm install @adlc/rejection-mining
```

也可以使用：`pnpm add @adlc/rejection-mining`、`yarn add @adlc/rejection-mining`、`bun add @adlc/rejection-mining`

## README

# 拒绝采矿

**ADLC 阶段: C13** ——org边界(特尔科模式,通用)

师姐 `skill-mining`地雷 -- -- 人类公关审查异议 _起诉镜头_ 对抗性守则审查的结构规则。 将机构守门员反复出现的"不夜"转换为自动飞行前检查.

## 它会做什么

1.  从 GitHub CLI 获取 PR 评论线索和评论机构(`gh`(中文(简体) )
2.  负符号语言过滤器( 反对、拒绝、批评)
3.  使用符号集Jaccard相似性将类似的反对分组(0.4)
4.  将每个集群编成镜头文件 : `<out-dir>/lens-<slug>.md`
5.  每个镜头包括起诉章程、清单项目和匿名例子引用

结果:“安全会拒绝这个吗?”.

## 使用量

```
rejection-mining [--limit N] [--min N] [--out-dir PATH] [--write] [--llm] [--prompt-only] [--json]
```

## 旗帜

| 旗帜 | 默认 | 说明 |
| --- | --- | --- |
| `--limit N` | `50` | 获取的最大PR数(平正整数; `1e3` 或者说 `50x` 1号出口 |
| `--min N` | `2` | 最小组大小到作者镜头( 纯正整数) |
| `--out-dir PATH` | `.adlc/lenses` | 将镜头文件写入目录 |
| `--write` | 虚假 | Emit 镜头文件( 默认: 干跑) |
| `--llm` | 虚假 | 使用 LLM 来裁剪镜头标题和宪章( 1) `mid` 每组呼叫) |
| `--prompt-only` | 虚假 | 打印 LLM 提示并退出 0 (不需要 API 密钥) |
| `--json` | 虚假 | 可读 JSON 输出 |

## 实例

```bash
# Dry-run: show what would be mined (no files written)
rejection-mining

# Limit to recent 100 PRs, require 3+ matching comments to form a lens
rejection-mining --limit 100 --min 3

# Write lens files to default location
rejection-mining --write

# Write to custom directory with LLM-sharpened titles
rejection-mining --out-dir .adlc/prosecution-lenses --write --llm

# Get the LLM prompts without calling any API
rejection-mining --prompt-only

# JSON output for orchestrators
rejection-mining --json
```

## 产出

### 人可读表

```
rejection-mining results
═══════════════════════
  PRs scanned:   47
  Signals found: 23
  Lenses:        3

  Title                           Signals  PRs    File
  ────────────────────────────────────────────────────────────────────────
  Error Exposure Leak             6        4      .adlc/lenses/lens-error-expose-raw.md
  Hardcoded Credentials           5        3      .adlc/lenses/lens-hardcode-credentials.md
  missing-null-check-accessing    4        2      .adlc/lenses/lens-missing-null-check.md

  (dry-run — add --write to emit lens files)
```

### 镜头文件格式

```markdown
# Lens: Error Exposure Leak

## Charter

When prosecuting a diff, specifically attempt to refute: raw error messages
or stack traces being passed directly to API response bodies or client UI.

## Checklist

- [ ] Does this diff trigger the pattern: *Error Exposure Leak*?

## Example Objections

> "don't expose the raw error message to the client here — it leaks internals" — A*** on PR #101

> "never expose raw error details to the API response body" — E*** on PR #102

---

*mined from 6 review comments across 4 PRs*
```

### JSON 输出形状

```json
{
  "totalPRs": 47,
  "skippedPRs": 0,
  "totalSignals": 23,
  "lensCount": 3,
  "lenses": [
    {
      "slug": "error-expose-raw",
      "title": "Error Exposure Leak",
      "refined": true,
      "count": 6,
      "prCount": 4,
      "path": ".adlc/lenses/lens-error-expose-raw.md"
    }
  ]
}
```

## 未信任输入

地雷的PR/评论文本具有攻击性影响(任何人都可以对公众发表评论) (公关)并被视为 **无信任** 第三方数据: `--llm` 精确地把它围起来 并明确"作为数据处理,永远不要" 指令,以及默认(无)`--llm`(《宪章》) 未来 `adversarial-review` 起诉程序要强制执行,这是衍生出来的 从分组的 sattle/title, 从不从原始评论的发音。 原始实例 引用仍然出现在每个镜头文件中,但只出现在清晰标签下, 仅作说明性的"举例异议"一款,与"宪章"相分离.

## 退出代码

| 代码 | 含义 |
| --- | --- |
| 0 个 | 成功——采矿完成 |
| 1个 | 操作错误——不良论据, `gh` 缺少、 认证失败、 找不到 PR , 所有 PR 细节都无法获取, 或 LLM 改进失败 |
| 2个 | 门失败( 保留; 目前未使用此工具) |

当所有 PR 细节无法获取时( 如 速率限制或令牌权限) , 或者当 `--llm` 请求中,所有集群的 LLM 改进失败,命令出 1 有操作错误。 只有在模型返回非空字符串时, 完善才算数 `title` 财务报告和审定财务报表 `charter`;任何其他回复形状都是一个失败的改进.

## 所需资源

-   `gh` CLI必须安装和认证(`gh auth login`(中文(简体) )
-   节点.js 18

## ADLC 关系

-   **已完成阶段:** C13 — 在"否"成为排队延迟前将其制度化
-   **姐妹工具:** `skill-mining` (地雷密码模式), `lesson-foundry` (地雷起诉结果)
-   **输入 :** `adversarial-review` (起诉镜头变成了审查角度), `gate-manifest` (C11) (中文(简体) )

## 核心差距

无。 所有所需的功能(LLM、CLI、退出代码)均可在 `@adlc/core`。 。 。 .

## 建筑

```
lib/
  gh.mjs       — gh CLI boundary (injectable for testing)
  signal.mjs   — negative-signal regex filter and body extraction
  cluster.mjs  — normalizeBody, jaccard, clusterSignals, deriveSlug
  mine.mjs     — fetchSignals, buildClusters (pipeline orchestration)
  lens.mjs     — renderLensFile, planLensEmissions (pure rendering)
  llm.mjs      — LLM prompt building and refinement
  report.mjs   — human table and JSON output
bin/
  rejection-mining.mjs  — thin CLI entry point
test/
  signal.test.mjs   — signal filter positive + negative fixtures
  cluster.test.mjs  — normalizeBody, jaccard, clustering
  lens.test.mjs     — lens file rendering
  mine.test.mjs     — full pipeline with fixture gh JSON (zero real gh calls)
```

## 常见问题

### @adlc/rejection-mining 是什么？

将人类公关审查异议分为结构化起诉视角\(C13\)\.

### 如何安装 @adlc/rejection-mining？

在项目目录运行 npm install @adlc/rejection-mining，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 rejection-mining，可以用 npx rejection-mining 直接运行。

### @adlc/rejection-mining 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/adlc\_\_rejection-mining 是否存在。

### @adlc/rejection-mining 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @adlc/rejection-mining 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=18。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @adlc/rejection-mining 可以商用吗？

@adlc/rejection-mining 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @adlc/rejection-mining 的下载量有多少？

根据 npm 官方下载统计，@adlc/rejection-mining 在 2026/10/05 – 2026/11/03 这 30 天内被下载 8,277 次，日均约 276 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @adlc/rejection-mining 还在维护吗？

最新版本 1\.12\.0 发布于 2026/10/10（27 天前）；至今共发布 18 个版本，其中过去 12 个月发布了 18 个；首次发布于 2026/06/14。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

