← 返回列表
全部 Skill›工具 Tools›cordis-styling-nitpicking

cordis-styling-nitpicking

作者 @deepseek-ai · 语言 en
Use during code review of DeepSeek Harness Cordis plugins and helpers reachable from their entrypoints, including pull requests, and during focused lifecycle audits. Checks singleton state, unreversed side effects, and cleanup dependencies released before consumers finish; reports substantiated P0 findings with ownership evidence and deterministic verification.
工具 Tools生产力工具通用访问网络待翻译
最近源活动
—
检测 SKILL.md 语言
en
星标 ★
286,160
分支 Fork
0
安装选项
提示
指令
使用 AI 助手安装
将下面的提示复制到你正在使用的 AI 助手中。
下载完整 Skill 目录(含全部配套文件)。 下载压缩包 ↓
SKILL.md 原文预览

Cordis Ownership and Lifecycle Audit

This is a focused semantic review of Cordis ownership and lifecycle. Start a repository audit from exported plugin entrypoints (apply or a concrete default export invoked by Cordis), then trace module initialization, registered services, listeners, effects, disposers, and transitive calls reachable from those roots. Exclude unrelated helpers, build tools, CLI paths, and tests as finding targets. Read tests and vendored Cordis to establish behavior; report a generated defect against its owning source. Do not report defects in vendored code under this skill.

Sources of truth

  • Repository conventions: Cordis ownership requirements.
  • Lifecycle and effects: effect acquisition and disposal.
  • Services: dependency tracking and service availability.
  • Defensive patterns: quiescent teardown and required completion listeners.

Review workflow

  1. Locate mutable owners, registrations, resource acquisition, and work admission reachable from the requested plugin roots. For large scopes, use independent directory scans, then consolidate findings involving the same consumer and resource.
  2. Trace ownership through the actual context: in a traceable service method, this.ctx is the caller's context. Identify who owns each effect and the disposer that releases it.
  3. Trace cleanup through every await to its last service call, emitted event, acknowledged operation, and durable write. Include indirect event delivery and cleanup performed after abort, kill, or cancellation.
  4. Compare consumer completion with the time each required listener, registry, writer, connection, domain, or transport becomes unusable. Inspect the current Cordis implementation; reverse start order and dependency registration alone do not establish completion order.
  5. Establish a legal failing interleaving and observable impact. Check existing cancellation, explicit sequencing, and documented discard semantics before reporting. Use controlled promises for reproduction where feasible, and label source-only findings accurately.

P0: singleton pattern

Flag one process-wide instance or mutable state owner whose identity or lifetime comes from module loading, a static field, a global symbol, a hidden cache, or a getInstance() accessor. Weak keys, size bounds, generation checks, and behavior-preserving memoization do not give a module-level cache Cordis ownership.

Exclude immutable scalar constants, pure frozen tables, stateless functions, and objects allocated inside an explicitly scoped owner. Recommend a Cordis service and declared or otherwise resolved consumer dependencies; use a scoped context or service-owned keyed record for narrower lifetimes.

P0: unreversed side effect

Flag an owner that leaves a live effect behind after disposal: listeners, registrations, timers, watchers, child fibers, processes, connections, temporary files, subscriptions, ambient patches, or asynchronous work. Aborting or killing without awaiting settlement is a violation when cleanup can return before owned work stops.

Correctly owned ctx.on(), ctx.plugin(), and ctx.effect() registrations already provide reversal; callers need not retain their early disposers. Unmanaged resources need an owned effect or explicit awaited cleanup. Do not demand rollback of intentional durable writes or remote mutations; temporary and live resources used by those operations still need owners.

P0: cleanup dependency released before consumer completion

Any service call or event delivery required to finish cleanup is a lifecycle dependency. Keep its actual resources and listeners usable until the consumer has settled, including final result publication and durable writes. A provider's disposal promise finishing after consumers does not prove its resources survived their cleanup.

The current fiber unload starts sibling disposers concurrently. Service withdrawal awaits dependent fibers inside its own disposer, while sibling resource closers can already run. Adding inject, reversing registration order, or retaining a service reference does not fix that race. A listener can also belong to the consumer fiber and auto-unsubscribe alongside an operation's drain.

Require explicit ownership and awaited sequencing: stop admission, settle admitted consumers while their dependencies remain usable, then drain and release the resources. Scope new-admission rejection separately from completion of accepted operations. Use an explicitly composed effect or a resource-owning parent with an awaited consumer/service child; verify the actual captured disposer identities. ctx.effect(function* ...) serializes the disposers it collects, but a wrapper around an independently registered effect does not transfer ownership of the original effect. Top-level plugin generator yields are not a general promise of serial sibling disposal. Check failure paths as well: one cleanup error must not skip required abort, settlement, or resource release.

Current workaround: function plugin with yielded effects

Use a function-style provider plugin with one ctx.effect(function* () { ... }) to compose service publication and resource effects. Yield the exact disposers returned by the registrations so the composed effect takes ownership of them:

  1. Acquire the resources and
评论
Ddeepseek-ai
deepseek-ai
deepseek-ai/deepseek-harness
查看 GitHub 仓库 查看作者的其他 Skill
来源信息
作者@deepseek-ai
所属大类工具 Tools / 生产力工具
国内可用性通用
最近源活动—
风险提示访问网络
提示:风险标签为程序静态扫描结果,仅作提示,不代表安全认证。安装前请阅读 SKILL.md 及其引用的脚本、权限,自行判断是否可信。