docs: purge chain-of-thought leakage from prose

Delete design-session citations (decision/audit/plan ordinals, stack
positions), change narration, review choreography, and reviewer-addressed
justification from comments, JSDoc, docs, READMEs, Agent Notes, tests, and
generator templates; restate every affected fact as current-state contract
prose. Fix generated docs at their sources and regenerate the catalogs and
cordis-surface regions; re-paste type-equiv blocks; update every bilingual
counterpart and re-record the pairs. Record the citation rule in the
committed-artifact-citations Agent Note.
This commit is contained in:
Tianyi Cui
2026-08-09 15:09:19 +08:00
parent 793f6f55df
commit 25dcd7293c
763 changed files with 2705 additions and 1710 deletions

View File

@@ -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 packages/util/retention/README.md
README.md: 45c88e9fc2d8df98f935fd1c3b43c4622802bd2a
README.zh.md: 9419245908d7331c9db24019f1181fcaed848060
README.md: 4f4dda8d8a93cd4cdcc4b3c0d2cc575f21159ffb
README.zh.md: 9ce48c66566dca449cf6c1090f5ef4785e046769

View File

@@ -23,7 +23,7 @@ import type {
| Export | Role |
|---|---|
| `ItemRetainer<T>` | Bounds ordered logical units (paths, grep matches, sources). `head` only in v1. `push()` → `PushDecision`; `finish()` → `RetainedItems<T>`. |
| `ItemRetainer<T>` | Bounds ordered logical units (paths, grep matches, sources). `head` only. `push()` → `PushDecision`; `finish()` → `RetainedItems<T>`. |
| `TextRetainer` | Bounds a byte-oriented text stream. `head` / `tail` / `headTail`, UTF-8 boundaries preserved at `finish()`. `push()` → `PushDecision`; `finish()` → `RetainedText`. |
| `describeOmitted(omitted, unit)` | Standardized omission clause (`exact` prints a count; `unknown` does not). |
| `formatRetentionNotice(notice, recovery)` | Joins the standardized omission clause with the tool's own recovery guidance. |

View File

@@ -23,7 +23,7 @@ import type {
| 导出项 | 职责 |
|---|---|
| `ItemRetainer<T>` | 限制有序逻辑单元(路径、grep 匹配项、来源)。v1 只支持 `head`。`push()` → `PushDecision`;`finish()` → `RetainedItems<T>`。 |
| `ItemRetainer<T>` | 限制有序逻辑单元(路径、grep 匹配项、来源)。只支持 `head`。`push()` → `PushDecision`;`finish()` → `RetainedItems<T>`。 |
| `TextRetainer` | 限制面向字节的文本流。`head` / `tail` / `headTail`,并在 `finish()` 时保留 UTF-8 边界。`push()` → `PushDecision`;`finish()` → `RetainedText`。 |
| `describeOmitted(omitted, unit)` | 标准化的省略子句(`exact` 输出数量;`unknown` 不输出)。 |
| `formatRetentionNotice(notice, recovery)` | 将标准化的省略子句与工具自有的恢复指引连接起来。 |

View File

@@ -211,8 +211,7 @@ const decoder = new TextDecoder() // utf-8, non-fatal: internal malformed bytes
function trimTrailingPartialUtf8(bytes: Uint8Array): Uint8Array {
let i = bytes.length - 1
// Continuation bytes are 0b10xxxxxx; scan back at most 3 (max sequence is 4).
// Indices are bounds-checked by the loop guard, so the reads are in range (a
// cast, not `!`, per the repo's no-non-null-assertion rule).
// Indices are bounds-checked by the loop guard, so the reads are in range.
while (i >= 0 && ((bytes[i] as number) & 0xc0) === 0x80 && bytes.length - i <= 3) i--
if (i < 0) return bytes
const lead = bytes[i] as number
@@ -228,7 +227,7 @@ function trimTrailingPartialUtf8(bytes: Uint8Array): Uint8Array {
*/
function trimLeadingContinuationUtf8(bytes: Uint8Array): Uint8Array {
let i = 0
// i < length guards the read; cast rather than `!` (no-non-null-assertion).
// i < length guards the read.
while (i < bytes.length && ((bytes[i] as number) & 0xc0) === 0x80) i++
return bytes.subarray(i)
}