Merge remote-tracking branch 'origin/master' into worktree/ci-native-windows-20260808
# Conflicts: # .agents/notes/archived/process/2026-07-27-wine-windows-gates-experiment.i18n.yaml
This commit is contained in:
@@ -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
|
||||
@@ -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. |
|
||||
|
||||
@@ -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)` | 将标准化的省略子句与工具自有的恢复指引连接起来。 |
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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/timeout/README.md
|
||||
README.md: e0d3595e7771fd19c808e89d440e69bca40da286
|
||||
README.zh.md: 99b7f281c2af7746fc2a105ee08df870fd3a9583
|
||||
README.md: 40a655200780e25c434beed4953d96f46e3604fd
|
||||
README.zh.md: 638dc1af60761f9c964e356edc070d20af0f4819
|
||||
@@ -52,7 +52,7 @@ For a streamed transport, create one `idleWatchdog`, pass its stable `signal` in
|
||||
|
||||
## What does NOT get a timeout
|
||||
|
||||
Local file `read`/`write`/`edit` take no `timeoutMs`: a syscall is best-effort-abortable at most, a timeout could not force `fsync`/`rename` to stop, and adding one would be an implicit default that violates explicit-over-implicit. See [`fs/`](../../fs/README.md).
|
||||
Local file `read`/`write`/`edit` take no `timeoutMs`: file IO runs untimed because a deadline would kill work the OS will still finish. See [the filesystem subsystem page](../../../docs/subsystems/filesystem.md).
|
||||
|
||||
## Model Experience
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export async function runWithDeadline(upstream: AbortSignal | undefined, timeout
|
||||
|
||||
## 哪些操作不设置超时
|
||||
|
||||
本地文件 `read`/`write`/`edit` 不接受 `timeoutMs`:中止系统调用至多只能尽力而为,超时无法强制 `fsync`/`rename` 停止,而添加超时会引入一个违反显式优于隐式原则的隐式默认值。详见 [`fs/`](../../fs/README.md)。
|
||||
本地文件 `read`/`write`/`edit` 不接受 `timeoutMs`:文件 IO 不设时限地运行,因为截止时间会中止操作系统仍会完成的工作。详见[文件系统子系统页面](../../../docs/subsystems/filesystem.md)。
|
||||
|
||||
## 模型体验
|
||||
|
||||
|
||||
Reference in New Issue
Block a user