dedupe
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDedupe
去重
Produce a proof-rich duplicate report for a bounded collection. Keep discovery, grouping, canonical selection, mutation, and verification separate so unique information cannot disappear silently.
为有界集合生成包含充分证据的重复项报告。将发现、分组、标准项选择、变更和验证步骤分离,确保唯一信息不会无声丢失。
Runtime composition
运行时组合
Apply these owners for every dedupe task. Load their current instructions instead of copying their procedures here.
- Load and acquire its clock anchor before a user-facing reply. Query runtime time again only when freshness, age, redirects, file times, or a newest-item tie-breaker affects the decision.
always-current-datetime - Load . Fix the requested result, bounded inputs, authority, required evidence, unknowns, and forbidden outcomes.
starting-point - Load . Treat adapter steps as candidate routes unless a step protects identity, safety, authorization, reproducibility, or proof.
outcome-bounded-work - Load . Audit identity rules, normalization, similarity thresholds, non-transitive pairs, conflicts, canonical tie-breakers, nulls, missing values, links, and edge cases before mutation and completion.
logic-audit
Stop with if a required owner cannot load. Never replace an unavailable owner with remembered text.
contract-unavailable: <skill-name>为每个去重任务应用以下所有者。加载它们的当前指令,而非在此复制其流程。
- 加载并在面向用户回复前获取其时钟锚点。仅当新鲜度、时长、重定向、文件时间或最新项平局决胜规则影响决策时,才再次查询运行时间。
always-current-datetime - 加载。确定请求的结果、有界输入、权限、所需证据、未知项和禁止的结果。
starting-point - 加载。除非步骤涉及身份保护、安全、授权、可复现性或证据,否则将适配器步骤视为候选路径。
outcome-bounded-work - 加载。在变更和完成前,审核身份规则、归一化、相似度阈值、非传递对、冲突、标准项平局决胜规则、空值、缺失值、链接和边缘情况。
logic-audit
如果无法加载所需的所有者,终止并返回。切勿用记忆中的文本替代不可用的所有者。
contract-unavailable: <skill-name>Commands
命令
| Command | Result |
|---|---|
| Show adapters, identity classes, defaults, and required inputs. |
| Produce a non-mutating report and proposed canonical map. |
| Execute one explicitly approved mutation plan, then verify it. |
applyapplyMap a destructive request to first unless a current, reviewed report and exact mutation authority are already present.
inspect| 命令 | 结果 |
|---|---|
| 显示适配器、身份类别、默认值和所需输入。 |
| 生成非变更性报告和建议的标准项映射。 |
| 执行一个经明确批准的变更计划,然后进行验证。 |
applyapply除非当前已有经过审核的报告和确切的变更权限,否则先将破坏性请求映射到操作。
inspectRequired inputs
所需输入
Before inspection, establish:
- bounded source items and the dedupe unit
- one adapter: ,
text,file,record,url, orlistskill - identity class: exact, normalized, or similarity candidate
- normalization and comparison policy
- canonical-selection rule
- conflict and merge policy
- mutation authority and destination
- proof threshold and rollback or reconstruction path
Do not invent a missing identity, normalization, threshold, or tie-breaker. Ask only when the missing fact cannot be retrieved and would change the result.
在检查前,需确定:
- 有界源项和去重单元
- 一个适配器:、
text、file、record、url或listskill - 身份类别:精确匹配、归一化匹配或相似度候选
- 归一化和比较策略
- 标准项选择规则
- 冲突和合并策略
- 变更权限和目标位置
- 证据阈值以及回滚或重建路径
切勿虚构缺失的身份、归一化、阈值或平局决胜规则。仅当缺失的信息无法检索且会影响结果时,才进行询问。
Identity classes
身份类别
Keep these classes separate in every report:
- Exact identity: byte, value, or packet equality under a deterministic representation.
- Normalized equality: equality only after the disclosed normalization policy.
- Similarity candidate: a scored pair from an explicit algorithm and threshold. It is not identity and does not reduce the canonical count without review.
Similarity is generally non-transitive. Never turn and into unless the selected algorithm proves an equivalence relation.
A≈BB≈CA=B=C在每份报告中保持以下类别分离:
- 精确身份:确定性表示下的字节、值或数据包相等。
- 归一化相等:仅在应用公开的归一化策略后相等。
- 相似度候选:由明确算法和阈值生成的评分对。它不属于身份匹配,未经审核不得减少标准项数量。
相似度通常是非传递的。除非所选算法证明是等价关系,否则切勿将和转换为。
A≈BB≈CA=B=CProcedure
流程
- Enumerate only the requested scope with stable source indices and provenance.
- Load the matching adapter reference before choosing keys or normalization.
- Run exact comparison before normalized or similarity comparison.
- Group equal comparison keys. Preserve unresolved items outside groups.
- Select one canonical item by the declared rule. Default to first-seen only when source order is meaningful and the user accepts it.
- Record conflicts and unique fields. Conflicts are not removable duplicates.
- Produce the report before any write, delete, replace, move, merge, redirect lookup, or persisted change.
- Build a mutation plan from reviewed groups. Map every affected item to its canonical item and state retained information.
- Apply only the approved plan. Do not widen scope or recursively clean related collections.
- Re-enumerate the source, reconcile counts, verify hashes or values, and rerun inspection. The second run must be a no-op for the approved identity class.
- 仅枚举请求范围内的内容,保留稳定的源索引和来源信息。
- 在选择键或归一化前,加载匹配的适配器参考。
- 先执行精确比较,再进行归一化或相似度比较。
- 对相等的比较键进行分组。将未解析的项保留在组外。
- 根据声明的规则选择一个标准项。仅当源顺序有意义且用户接受时,才默认选择首次出现的项。
- 记录冲突和唯一字段。冲突项不可作为可移除的重复项处理。
- 在进行任何写入、删除、替换、移动、合并、重定向查找或持久化变更前,生成报告。
- 根据已审核的组构建变更计划。将每个受影响的项映射到其标准项,并记录保留的信息。
- 仅执行已批准的计划。不得扩大范围或递归清理相关集合。
- 重新枚举源,核对计数,验证哈希或值,并重新运行检查。对于已批准的身份类别,第二次运行必须无任何操作。
Deterministic inspector
确定性检查器
Create a JSON request, then run from the skill root:
text
python3 scripts/dedupe.py inspect --request /absolute/path/request.jsonThe inspector never mutates input. It emits canonical indices, duplicate groups, hashed comparison keys, similarity candidates, conflicts, unresolved items, provenance, disclosed policies, and reconciled counts. See for a real request and output.
examples/inspect.md创建一个JSON请求,然后从skill根目录运行:
text
python3 scripts/dedupe.py inspect --request /absolute/path/request.json检查器绝不会变更输入。它会输出标准项索引、重复项组、哈希比较键、相似度候选、冲突、未解析项、来源信息、公开的策略以及核对后的计数。有关真实请求和输出,请参阅。
examples/inspect.mdMutation gate
变更闸门
Deletion, replacement, merge, movement, link following, redirect resolution, or persistence of user data requires explicit authority for the exact plan. Approval must identify the source, canonical targets, actions, conflict handling, and destination.
Fail closed when authority is missing, the source changed after inspection, a plan hash changed, conflicts remain, provenance stores disagree, or rollback and reconstruction are impossible for destructive work.
删除、替换、合并、移动、链接跟踪、重定向解析或持久化用户数据需要针对确切计划的明确权限。批准必须明确源、标准目标、操作、冲突处理方式和目标位置。
当权限缺失、检查后源发生变更、计划哈希变更、冲突仍存在、来源存储不一致,或者破坏性操作无法回滚或重建时,终止操作并返回失败。
Verification
验证
Require all of the following:
source_count = canonical_count + duplicate_count + unresolved_count- every removed or merged item maps to one retained item
- every unique field or passage is retained or explicitly discarded by authority
- comparison keys and policies are recorded without exposing sensitive raw values
- similarity candidates remain separate until reviewed
- the post-apply inspection reports no remaining approved duplicates
- exits 0 after package changes
mise run ci
If Mise is unavailable, run every task command from directly and state that Mise itself did not run. Tests under , native cases under , and templates under remain package evidence, not permission to mutate user data.
mise.tomlscripts/tests/evals/assets/需满足以下所有条件:
source_count = canonical_count + duplicate_count + unresolved_count- 每个被移除或合并的项都映射到一个保留的项
- 每个唯一字段或段落都被保留或经权限明确丢弃
- 记录比较键和策略,且不暴露敏感原始值
- 相似度候选保持分离状态直至审核通过
- 变更后的检查报告显示无剩余已批准的重复项
- 包变更后退出码为0
mise run ci
如果Mise不可用,直接运行中的所有任务命令,并说明未运行Mise本身。下的测试、下的原生用例和下的模板属于包证据,而非变更用户数据的权限。
mise.tomlscripts/tests/evals/assets/Progressive disclosure map
渐进式披露映射
- :
PD-001owns the full report, canonical-selection, authority, and verification contract. Load it for every inspection or apply request. This section is its backlink.references/core-contract.md - :
PD-002owns text and list policy. Load it when either adapter is selected. This section is its backlink.references/text-list.md - :
PD-003owns file and record policy. Load it when either adapter is selected. This section is its backlink.references/file-record.md - :
PD-004owns URL and skill policy. Load it when either adapter is selected. This section is its backlink.references/url-skill.md - :
PD-005owns request and report fields, approval shape, apply checks, and degraded verification. Load it before producing a report or mutation plan. This section is its backlink.references/report-mutation.md - records why these boundaries exist. Read it before changing this skill.
references/decisions.md - holds one worked case per command plus the common failure path. Load the matching example when output shape is unclear.
examples/
- :
PD-001负责完整报告、标准项选择、权限和验证合约。每次检查或应用请求都需加载它。本节是其反向链接。references/core-contract.md - :
PD-002负责文本和列表策略。当选择其中任一适配器时加载它。本节是其反向链接。references/text-list.md - :
PD-003负责文件和记录策略。当选择其中任一适配器时加载它。本节是其反向链接。references/file-record.md - :
PD-004负责URL和skill策略。当选择其中任一适配器时加载它。本节是其反向链接。references/url-skill.md - :
PD-005负责请求和报告字段、批准格式、应用检查和降级验证。生成报告或变更计划前需加载它。本节是其反向链接。references/report-mutation.md - 记录了这些边界存在的原因。修改此skill前请阅读它。
references/decisions.md - 包含每个命令的一个实际案例以及常见失败路径。当输出格式不明确时,加载匹配的示例。
examples/
Done
完成
The task is done only when the requested bounded outcome passes, every retained task and adapter decision is evidenced, all authorized changes verify, unresolved items are visible, and the final logic audit finds no unsupported identity, threshold, tie-breaker, or completion claim.
仅当以下条件全部满足时,任务才算完成:请求的有界结果通过验证,每个保留的任务和适配器决策都有证据支持,所有经授权的变更都已验证,未解析项可见,且最终逻辑审核未发现任何未被支持的身份、阈值、平局决胜规则或完成声明。