dsh-find-simplifications
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFinding DeepSeek Harness Simplifications
查找 DeepSeek Harness 简化方案
Find changes that remove maintained obligations: APIs, representations, lifecycle states, configuration paths, dependencies, tests, or documentation. Prefer a few well-supported candidates over a count of deletions. This is guidance, not a checklist; keep the user's scope and distinguish a survey from permission to implement its proposals.
查找能够消除持续维护负担的变更:API、表示形式、生命周期状态、配置路径、依赖项、测试或文档。相较于追求删除数量,应优先选择少量有充分证据支持的候选项。本文档提供的是指导,而非检查清单;应遵循用户给定的范围,并区分概览调查与实施其提案的授权。
Establish scope and constraints
确定范围与约束
Read , architecture before judging packages, defensive patterns, and testing policy. Consult the relevant active Agent Notes for intentional decisions; use the note rules for new records. Archived notes are historical examples, not current authority: never inspect, verify, or repair their outbound links.
AGENTS.mdThe two LLM adapters are intentional. JSONL is the sole first-party Session persistence provider, while the backend-neutral Service Definition supports out-of-tree providers. Do not propose deleting an LLM twin or the persistence seam unless the user explicitly overrides that constraint. Unused members within a protected design remain candidates when their removal preserves its purpose.
For broad requests, divide independent domains among subagents: loop and persistence; model/tool assembly; Host, Client, and SDKs; subprocess and execution providers; composition, scripts, tests, and documentation. Give each agent a bounded domain and require consumer evidence and rejected alternatives. Inspect substantial production machinery as well as obvious unused symbols; do not stop after the first promising deletion.
在判断各个 package 前,先阅读 、架构、防御性模式 和测试策略。查阅相关的当前有效 Agent Notes,以了解有意作出的决策;创建新记录时遵循 note 规则。归档的 notes 是历史示例,并非当前权威依据:绝不要检查、验证或修复其出站链接。
AGENTS.md两个 LLM adapter 是有意保留的。JSONL 是唯一的第一方 Session 持久化 provider,而与 backend 无关的 Service Definition 支持 out-of-tree provider。除非用户明确推翻该约束,否则不要提议删除 LLM twin 或 persistence seam。受保护设计中的未使用成员仍可列为候选项,前提是移除它们不会破坏该设计的目的。
对于广泛请求,将彼此独立的领域划分给不同 subagent:loop 与 persistence;model/tool 组装;Host、Client 和 SDK;subprocess 与 execution provider;composition、脚本、测试和文档。为每个 agent 划定有界领域,并要求提供 consumer 证据和已否决的替代方案。既要检查明显的 unused symbol,也要检查规模可观的 production machinery;不要在发现第一个有潜力的删除项后就停止。
Search for removable obligations
查找可移除的维护负担
Use these questions to guide discovery. Read the relevant section of historical patterns when a candidate needs calibration; the examples illustrate decisions, not a current deletion inventory.
- Does a declared feature have a complete effect path? Trace producer, transformations, provider or endpoint support, and observable result. A field copied everywhere may still have no setter, no reader, or only implementations that reject it. Search constructors and discriminant emitters as well as callers.
- Which distinctions change a consumer's action? Several internal states may require one model-facing status or one usable identifier. Keep internal distinctions that control authorization, residency, durability, or ownership; remove public distinctions that only invite an unusable choice.
- Could a smaller explicit behavior remove the subsystem? Fixed intervals, caller-supplied time zones, or reported activation failure can eliminate generalized calendars, persisted defaults, or automatic rollback. Name the capability given up and the machinery deleted. A production caller makes this a behavior decision, not an automatic rejection; implementation must remain within the user's authorization.
- Can a consumer read the authoritative value when needed? Look for copied histories, promotion ledgers, invalidation events followed by reads, and feature caches beside a shared projection stream. Derivation or reuse may delete subscriptions, retained data, stale-response handling, and recovery paths together. Establish the required time of observation first.
- Is composition being mistaken for policy? Optional service presence, a provider method, or a sibling tool can express availability without deciding deployment behavior. Explicit configuration or a caller-intent operation may remove registries and dependency checks. Preserve distinct operations when their ownership or completion timing differs.
- What owns the complete maintenance cost? Trace pass-through configuration, duplicate application trees, demo launchers used by products, resolver-only workspaces, and installation helpers with their own upgrade lifecycle. Compare the entire removed system with the replacement, including residual glue; moving complexity or adding a gate to keep duplicate definitions equal does not remove it.
使用以下问题指导排查。当候选项需要校准时,阅读 历史模式 的相关章节;其中的示例用于说明决策,而不是当前可删除项清单。
- 声明的功能是否具备完整的生效路径? 追踪 producer、转换过程、provider 或 endpoint 支持情况,以及可观察结果。一个被到处复制的字段仍可能没有 setter、没有 reader,或者只有拒绝它的实现。除 caller 外,也要搜索构造函数和 discriminant emitter。
- 哪些差异会改变 consumer 的行为? 多个内部状态可能只需一种面向 model 的 status 或一个可用的 identifier。应保留控制 authorization、residency、durability 或 ownership 的内部差异;移除只会让用户做出无法执行之选择的公开差异。
- 更小且明确的行为能否移除整个子系统? 固定间隔、由 caller 提供的时区或明确报告的 activation failure,可以消除通用日历、持久化默认值或自动回滚。写明放弃的 capability 和将删除的 machinery。生产环境中的 caller 表明这是一项行为决策,而非自动拒绝的理由;实施仍必须处于用户授权范围内。
- consumer 能否在需要时读取权威值? 查找复制的历史记录、promotion ledger、invalidation event 之后的读取,以及与 shared projection stream 并列的 feature cache。通过 derivation 或 reuse,可能一并删除 subscription、保留数据、stale-response 处理和 recovery path。首先确定所需的观察时点。
- 是否把 composition 误当成了 policy? 可选 service 是否存在、provider method 或 sibling tool 都可以表达可用性,而无需决定部署行为。显式配置或 caller-intent operation 可能移除 registry 和 dependency check。当不同 operation 的 ownership 或完成时机不同时,应予保留。
- 完整的维护成本由什么承担? 追踪透传配置、重复的 application tree、产品使用的 demo launcher、仅用于 resolver 的 workspace,以及拥有自身升级 lifecycle 的 installation helper。将整个待移除系统与替代方案进行比较,包括残余 glue;移动复杂性或增加 gate 来保持重复定义一致,并不能消除维护成本。
Prove reachability and the trade-off
证明可达性并权衡取舍
Start with , then read the matches. Search exact symbols, property reads and writes, discriminants, event and wire strings, config keys, package names, and both and forms. Tests and declarations can show a contract without proving a shipped producer or consumer.
rg.method(method(Include , , , runtime scripts, shipped profiles and overlays, package manifests and exports, loader resolution, generated runtime assets, and installed-package consumers. Classify examples and fixtures by their actual entry point rather than directory name. Follow generated catalogs to their consumers: a catalog used by model-written plugin mounts is a dynamic product API, while a documentation-only listing is not a fixed caller. Public third-party extension paths can be intentional despite zero repository call sites. A static unused-code checker must cover manifest-driven loading, generated outputs, and compiler faces without maintaining a parallel per-workspace exception inventory.
packages/*/*/srcapps/python/For each candidate, record the current owner, effective producer/consumer path, what disappears, what remains, and the strongest reason to retain it. Distinguish:
- removal of unreachable or unread behavior;
- a narrower public or product behavior with an explicit loss;
- a protected obligation or insufficient evidence.
Reject a candidate when it breaks a retained obligation, merely relocates the same complexity, or has no meaningful reduction. Read rejection reasons at the level of the proposed change: a stale inventory or a mixed proposal's rejected behavior does not settle every independent item. Refresh the evidence before re-proposing one. Small local improvements belong in actionable // comments under the urgency rules, not standalone design records.
TODOFIXMEXXX先使用 ,然后阅读匹配结果。搜索精确符号、property 的读取和写入、discriminant、event string 与 wire string、config key、package 名称,以及 和 两种形式。测试和声明可以显示 contract,但不能证明已发布版本中存在 producer 或 consumer。
rg.method(method(检查范围应包括 、、、runtime script、随附发布的 profile 和 overlay、package manifest 与 export、loader resolution、generated runtime asset,以及 installed-package consumer。根据实际入口点而非目录名称对 example 和 fixture 分类。顺着 generated catalog 追踪到其 consumer:供 model 编写的 plugin mount 使用的 catalog 是一种动态 product API,而仅用于文档的 listing 并非固定 caller。即使仓库内没有任何 call site,公开的第三方扩展路径也可能是刻意保留的。静态 unused-code checker 必须覆盖 manifest 驱动的加载、generated output 和 compiler 接口,同时不能维护一套与各 workspace 对应的平行 exception 清单。
packages/*/*/srcapps/python/对于每个候选项,记录当前 owner、实际 producer/consumer 路径、将消失的内容、保留的内容,以及保留它的最强理由。区分:
- 移除不可达或不可读取的行为;
- 收窄公开或产品行为,并明确说明损失;
- 受保护的义务,或证据不足。
如果某项变更会破坏必须保留的义务、只是重新安置同样的复杂性,或无法带来有意义的精简,就应拒绝该候选项。应在拟议变更这一层面审视否决理由;过时清单或混合提案中被否决的行为,不能决定其中每个独立项的去留。重新提出候选项前应更新证据。小型局部改进应按照 紧迫性规则,以可执行的 // 注释记录,而不是单独创建设计记录。
TODOFIXMEXXXPreserve ownership and failure semantics
保留所有权与失败语义
For copies, freezes, validators, and callback captures, name the value's origin, next owner, and trust boundary. Typed same-process calls ordinarily borrow readonly values; parsers, config loaders, queues, model/tool JSON, durable files, workers, processes, and wire decoders own or validate their inputs. Hostile-getter or callback-replacement tests do not establish a requirement by themselves. A frozen root does not prove its descendants immutable, and equal ids do not prove object identity.
For asynchronous machinery, map each promise, flag, cancellation path, disposer, and reservation to its owner and transition. Collapse mechanisms only when they express the same fact. Preserve synchronous publication and rollback, callback containment, first-terminal-outcome arbitration, worker/process ownership, and dispose-to-quiescence where required. Durable start/end markers can record real facts even when transcript renderers ignore them; dropping interrupted work is a capability loss, not redundant-log cleanup.
对于 copy、freeze、validator 和 callback capture,应明确 value 的来源、下一任 owner 和 trust boundary。有类型的同进程调用通常借用 readonly value;而 parser、config loader、queue、model/tool JSON、durable file、worker、process 和 wire decoder 则拥有或验证其输入。仅凭 hostile-getter 或 callback-replacement 测试无法确立需求。冻结 root 并不证明其 descendant 不可变,id 相等也不证明 object identity 相同。
对于异步机制,将每个 promise、flag、cancellation path、disposer 和 reservation 映射到其 owner 与 transition。只有在表达同一事实时,才能合并机制。在需要时保留同步发布与回滚、callback containment、first-terminal-outcome 仲裁、worker/process ownership 和 dispose-to-quiescence。持久化的 start/end marker 即使被 transcript renderer 忽略,也可能记录了真实事实;丢弃中断的工作属于 capability 损失,而不是冗余日志清理。
Replace infrastructure only for a net reduction
仅在能够净简化时替换基础设施
Follow the dependency policy. Search existing dependencies and Node builtins at the engine floor before adding a package. Identify the exact implementation and dedicated tests the replacement deletes, its maintenance and transitive cost, and every residual behavior the glue must preserve.
Exercise the mismatches most likely to defeat the replacement: protocol truncation, cancellation and teardown, configured bounds, deterministic test clocks, platform packaging, and source versus built entry points. A library that covers framing but requires rebuilding the same framing to enforce a size limit is not a simplification. An accepted edge-behavior change belongs in the proposal and relevant tests. Do not re-prove a dependency's generic specification while omitting tests for the harness-specific shim.
遵循 dependency policy。在添加 package 前,先在 engine floor 层级搜索现有 dependency 和 Node builtin。明确替代方案具体删除了哪些实现和专项测试、其维护与传递成本,以及 glue 必须保留的全部剩余行为。
验证最可能使替代方案失效的差异:protocol 截断、cancellation 与 teardown、配置的界限、确定性测试时钟、平台打包,以及 source 与 built 入口点之间的差异。一个 library 即使覆盖 framing,却需要重新构建相同的 framing 来强制执行大小限制,也不能算作简化。已接受的边缘行为变更应写入 proposal 和相关测试。不要在省略 harness-specific shim 测试的同时,重复验证 dependency 的通用规范。
Record, consolidate, and validate
记录、整合与验证
Use dsh-prose-standard when prose is in scope. Remove code-restating or remotely owned explanations while preserving local behavior, timing, ownership, and failure obligations. Update affected READMEs, JSDoc, model-visible catalogs, configuration, snapshots, and generated files with their owning change.
A substantial proposal uses the mandatory note skeleton: , , , , and . Include concrete consumer evidence, the removed maintenance cost, the capability given up, and observable acceptance conditions. An implemented decision uses the implemented format instead. Update an existing owner when the decision is the same; do not create duplicate notes to preserve candidate counts.
ProblemProposalAlternatives consideredAcceptance criteriaRisksEvery new note requires a scoped supersession check through dsh-archive-agent-notes. That workflow owns retention, consolidation, triplet deletion, and frozen archive mechanics. A code survey does not imply a repository-wide note audit. Preserve partial supersessions and current durable, wire, compatibility, or rejected-alternative obligations.
When folding another branch, compare its independent diff against the target base, port only supported non-overlapping proposals, and consolidate overlapping rationale. Closing another PR requires authorization or clear ownership of that housekeeping.
For docs-only Agent Note work, run , , and ; for skill or comment edits, include the applicable validator. Select other checks through dsh-pre-push-checks. Report the surveyed areas, supported candidates, meaningful rejections or deferrals, notes added/consolidated/retained/removed, and commands actually run. Use a draft PR while the survey is expanding; do not describe an unverified search as exhaustive.
pnpm run doc-syncpnpm run lintgit diff --check当范围包含 prose 时,使用 dsh-prose-standard。删除仅在复述代码或由远端负责的解释,同时保留本地行为、时序、ownership 和 failure obligation。在所属变更中更新受影响的 README、JSDoc、model-visible catalog、configuration、snapshot 和 generated file。
内容较为全面的 proposal 必须采用以下强制 note skeleton:、、、 和 。应包含具体 consumer 证据、消除的维护成本、放弃的 capability 和可观察的 acceptance condition。已实施的决策则改用 implemented format。若决策相同,应更新现有 owner;不要为了维持候选数量而创建重复 note。
ProblemProposalAlternatives consideredAcceptance criteriaRisks每个新 note 都必须通过 dsh-archive-agent-notes 进行限定范围的 supersession check。该 workflow 负责 retention、consolidation、triplet deletion 和 frozen archive mechanics。代码概览并不意味着要对整个仓库执行 note audit。保留部分 supersession,以及当前关于 durable、wire、compatibility 或 rejected alternative 的义务。
合并另一个分支时,应将其独立 diff 与目标 base 比较,只移植有证据支持且互不重叠的 proposal,并整合重叠部分的 rationale。关闭另一个 PR 需要获得授权,或明确由当前工作负责该 housekeeping。
对于仅涉及文档的 Agent Note 工作,运行 、 和 ;对于 skill 或注释编辑,还应运行适用的 validator。其他检查应通过 dsh-pre-push-checks 选择。报告已调查区域、有证据支持的候选项、值得说明的否决或暂缓项、已新增/整合/保留/删除的 notes,以及实际运行的命令。在调查范围扩大期间使用 draft PR;不要将未经验证的搜索描述为穷尽检查。
pnpm run doc-syncpnpm run lintgit diff --check