docs: fix NIH-audit review findings (Codex round 1)
- Drop the AGENTS.md budget bump: trim filler words in the layout map and command comments so the new convention line fits the existing 1680 ceiling (1679/1680; master was 1680/1680) - timers/promises note: 'Replace both' -> all three sites, and add pty-local to the acceptance criteria (EN+ZH) - execa note: 17 value-taking options plus boolean flags, not 18 (EN+ZH) - rejected roll-up: lsp-local src is ~1,800 lines, not 2,112 (EN+ZH) - re-record the three touched i18n pairs
This commit is contained in:
+2
-2
@@ -2,5 +2,5 @@
|
||||
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
||||
# after editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write
|
||||
2026-07-26-builtin-timer-promises-for-hand-rolled-sleeps.md: 036e2f2906ca99aaab30a2164649f9c750b4ad21
|
||||
2026-07-26-builtin-timer-promises-for-hand-rolled-sleeps.zh.md: 15a6f0dd412d142647df2722335a454a028cb798
|
||||
2026-07-26-builtin-timer-promises-for-hand-rolled-sleeps.md: 1a012aeabc7f9445127d6b8edcbe2f72e62f0eba
|
||||
2026-07-26-builtin-timer-promises-for-hand-rolled-sleeps.zh.md: 742d2c5ee8573c9b2bdf555c938c83dd6ea9f999
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@ Three packages hand-roll promise-wrapped timers that the `node:timers/promises`
|
||||
|
||||
## Proposal
|
||||
|
||||
Replace both with `import { setTimeout } from 'node:timers/promises'`:
|
||||
Replace all three with `import { setTimeout } from 'node:timers/promises'`:
|
||||
|
||||
- llm-retry: `try { await setTimeout(delayMs, undefined, { signal }); /* retry */ } catch { /* abort → fail */ }` — with a signal, the promise rejects only with the abort error, and a pre-aborted signal rejects immediately; behavior is identical, including timer clearing on abort. The empty `catch` names the abort rejection per the repo's empty-catch rule.
|
||||
- workflow-workerthread: `setTimeout(ms, undefined, { ref: false })` — exact semantics including not holding the event loop open.
|
||||
@@ -29,8 +29,8 @@ No dedicated tests pin the helpers themselves; the packages' behavior suites kee
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- Neither package defines a promise-wrapped `setTimeout` helper; both import from `node:timers/promises`.
|
||||
- `llm-retry` and `workflow-workerthread` test suites pass unchanged (behavioral parity).
|
||||
- None of the three packages defines a promise-wrapped `setTimeout` helper; all import from `node:timers/promises`.
|
||||
- The `llm-retry`, `workflow-workerthread`, and `pty-local` test suites pass unchanged (behavioral parity).
|
||||
|
||||
## Risks
|
||||
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@ Status: proposed
|
||||
|
||||
## 提案
|
||||
|
||||
用 `import { setTimeout } from 'node:timers/promises'` 替换上述实现:
|
||||
用 `import { setTimeout } from 'node:timers/promises'` 替换这三处实现:
|
||||
|
||||
- llm-retry:`try { await setTimeout(delayMs, undefined, { signal }); /* retry */ } catch { /* abort → fail */ }`。传入 signal 后,该 promise 只会以 abort 错误拒绝,已提前中止的 signal 则立即拒绝;行为完全一致,包括中止时清除定时器。按仓库的空 catch 规则,这个空 `catch` 注明其吞下的是 abort 拒绝。
|
||||
- workflow-workerthread:`setTimeout(ms, undefined, { ref: false })`,语义完全等价,包括不会让事件循环保持存活。
|
||||
@@ -29,8 +29,8 @@ Status: proposed
|
||||
|
||||
## 验收标准
|
||||
|
||||
- 上述包不再各自定义 promise 包装的 `setTimeout` 辅助函数,而是都从 `node:timers/promises` 导入。
|
||||
- `llm-retry` 与 `workflow-workerthread` 的测试套件原样通过(行为等价)。
|
||||
- 这三个包都不再各自定义 promise 包装的 `setTimeout` 辅助函数,而是都从 `node:timers/promises` 导入。
|
||||
- `llm-retry`、`workflow-workerthread` 与 `pty-local` 的测试套件原样通过(行为等价)。
|
||||
|
||||
## 风险
|
||||
|
||||
|
||||
Reference in New Issue
Block a user