skill-family-harness-node 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ <!-- release-skill:changelog:start version=0.8.3 locale=en baseline=sha256:449943bedf3698888fec4dcb09a0460f337b9406d5258946a3d3ffcd23143b8d -->
4
+ ## [0.8.3] - 2026-08-23
5
+
6
+ Path containment now tolerates one exact anchor-removal race while preserving fail-closed escape checks.
7
+
8
+ ### Changed
9
+
10
+ - A second ENOENT and every non-ENOENT failure remain closed; symlink swaps, out-of-root targets, and all existing containment checks remain rejected.
11
+ - Keeps the hook private to the paths module test surface and adds no public export, general retry policy, lock layer, ledger, or runner.
12
+ - Moves the package version to 0.8.3 together with Contracts and Engineering Kit.
13
+
14
+ ### Fixed
15
+
16
+ - When realpath of the selected existing anchor fails with ENOENT because another process removed it, resolveContained recomputes the deepest existing ancestor exactly once.
17
+
18
+ ### Upgrade Notes
19
+
20
+ Consumers must pin all three Foundation packages to exactly 0.8.3. Concurrent lock acquisition can now survive the current owner removing the selected lock-file anchor; no Harness API migration is required.
21
+ <!-- release-skill:changelog:end version=0.8.3 locale=en -->
22
+
23
+
24
+ <!-- release-skill:changelog:start version=0.8.2 locale=en baseline=sha256:af051a6925c7d1f46bef6fbe367aceea8685b4a916629af4e69334e73014e3a7 -->
25
+ ## [0.8.2] - 2026-08-23
26
+
27
+ The fixed candidate mechanism bridge now exposes the existing strict reader through read-file-strict.
28
+
29
+ ### Added
30
+
31
+ - Adds read-file-strict to invokeFoundationMechanism with closed root, path, encoding, and expectedSha256 parameters.
32
+ - Returns UTF-8 content as a string and binary content in the standard JSON-safe Buffer shape.
33
+
34
+ ### Changed
35
+
36
+ - Delegates containment, file reading, digest verification, and failure classification directly to readFileStrict; no second read algorithm is introduced.
37
+ - Moves the package version to 0.8.2 together with Contracts and Engineering Kit.
38
+
39
+ ### Upgrade Notes
40
+
41
+ Candidate consumers must pin all three Foundation packages to exactly 0.8.2 and rebuild their managed Bundle. Direct calls retain SFC2004 details.kind failures; the JSON CLI continues to promise only exit code 0 for success and 2 for rejection.
42
+ <!-- release-skill:changelog:end version=0.8.2 locale=en -->
43
+
44
+
3
45
  <!-- release-skill:changelog:start version=0.8.1 locale=en baseline=sha256:4cd9f23da3561184cef4ebadb7e758a22d377d069742bbe7c77166d6c1b3bd14 -->
4
46
  ## [0.8.1] - 2026-08-22
5
47
 
@@ -1,5 +1,47 @@
1
1
  # 变更日志
2
2
 
3
+ <!-- release-skill:changelog:start version=0.8.3 locale=zh-CN baseline=sha256:b84695a286aca7c1a9f90844f8682cde07d32276cebc11583568bc5ef11753fc -->
4
+ ## [0.8.3] - 2026-08-23
5
+
6
+ 路径收容现在可处理一次精确的锚点并发删除,同时保持越界检查失败关闭。
7
+
8
+ ### 变更
9
+
10
+ - 第二次 ENOENT 与所有非 ENOENT 错误仍失败关闭;符号链接替换、根目录外目标和既有收容检查仍全部拒绝。
11
+ - 测试钩子只留在 paths 模块的测试表面,不新增公共导出、通用重试策略、锁层、账本或 runner。
12
+ - 包版本与 Contracts、Engineering Kit 一同升至 0.8.3。
13
+
14
+ ### 修复
15
+
16
+ - 当另一进程删除已选锚点,导致该锚点的 realpath 返回 ENOENT 时,resolveContained 仅重新计算一次最深既存祖先。
17
+
18
+ ### 升级说明
19
+
20
+ 消费者必须把三个 Foundation 包精确锁定到 0.8.3。并发获取锁时,即使当前持有者删除已选锁文件锚点,也能完成一次安全重求;Harness API 无需迁移。
21
+ <!-- release-skill:changelog:end version=0.8.3 locale=zh-CN -->
22
+
23
+
24
+ <!-- release-skill:changelog:start version=0.8.2 locale=zh-CN baseline=sha256:748d79d51dcabe6193332e60ec69a6eb26fd914ad3555f6e924b78db71016192 -->
25
+ ## [0.8.2] - 2026-08-23
26
+
27
+ 固定的候选机制桥接新增 read-file-strict,直接公开既有严格读取机制。
28
+
29
+ ### 新增
30
+
31
+ - invokeFoundationMechanism 新增 read-file-strict;参数闭合为 root、path、encoding 和 expectedSha256。
32
+ - UTF-8 内容返回字符串,二进制内容返回标准的 JSON 安全 Buffer 形态。
33
+
34
+ ### 变更
35
+
36
+ - 路径收容、文件读取、摘要复验和失败分类全部转发给 readFileStrict,不新增第二套读取算法。
37
+ - 包版本与 Contracts、Engineering Kit 一同升至 0.8.2。
38
+
39
+ ### 升级说明
40
+
41
+ 候选消费者必须把三个 Foundation 包精确锁定到 0.8.2,再重建受管 Bundle。直接调用继续返回 SFC2004 与 details.kind;JSON CLI 只承诺成功退出码 0 和拒绝退出码 2。
42
+ <!-- release-skill:changelog:end version=0.8.2 locale=zh-CN -->
43
+
44
+
3
45
  <!-- release-skill:changelog:start version=0.8.1 locale=zh-CN baseline=sha256:904de77446dbc69ef7e70cdda0020fd98632a6e704754f6ed57e136764e3112e -->
4
46
  ## [0.8.1] - 2026-08-22
5
47
 
package/README.md CHANGED
@@ -4,28 +4,28 @@
4
4
 
5
5
  # skill-family-harness-node
6
6
 
7
- <!-- release-skill:release-version: 0.8.1 -->
7
+ <!-- release-skill:release-version: 0.8.3 -->
8
8
 
9
9
  The **single default Node implementation** of the Contracts mechanism protocol. This is a thin runtime: it only implements the mechanism protocol, introduces no business semantics, and does not provide a second-language implementation.
10
10
 
11
11
  <!-- release-skill:managed:start id=latest-release -->
12
- **0.8.1** (2026-08-22)
12
+ **0.8.3** (2026-08-23)
13
13
 
14
- Harness now preserves its own report renderer version when a host bundles it into a single-file adapter.
14
+ Path containment now tolerates one exact anchor-removal race while preserving fail-closed escape checks.
15
15
 
16
16
  **Changed**
17
17
 
18
- - Moves the package version to 0.8.1 together with Contracts and Engineering Kit.
19
- - Keeps all 21 Harness capabilities, report contracts, and public exports unchanged.
18
+ - A second ENOENT and every non-ENOENT failure remain closed; symlink swaps, out-of-root targets, and all existing containment checks remain rejected.
19
+ - Keeps the hook private to the paths module test surface and adds no public export, general retry policy, lock layer, ledger, or runner.
20
+ - Moves the package version to 0.8.3 together with Contracts and Engineering Kit.
20
21
 
21
22
  **Fixed**
22
23
 
23
- - Replaces the report renderer's runtime import.meta.url package-manifest lookup with a static JSON import, so esbuild inlines the Harness version instead of resolving the host adapter's package metadata.
24
- - Adds source and third-party single-file bundle regression tests for REPORT_RENDERER_VERSION.
24
+ - When realpath of the selected existing anchor fails with ENOENT because another process removed it, resolveContained recomputes the deepest existing ancestor exactly once.
25
25
 
26
26
  **Upgrade Notes**
27
27
 
28
- Host adapters that bundle the report renderer must pin Harness 0.8.1. The report API and renderer identity remain unchanged, so no API migration is required from 0.8.0.
28
+ Consumers must pin all three Foundation packages to exactly 0.8.3. Concurrent lock acquisition can now survive the current owner removing the selected lock-file anchor; no Harness API migration is required.
29
29
  <!-- release-skill:managed:end id=latest-release -->
30
30
 
31
31
  ## Problem It Solves
@@ -39,14 +39,14 @@ The Harness consumes `skill-family-contracts` (a workspace dependency), reusing
39
39
  ## Installation and Minimal Example
40
40
 
41
41
  ```sh
42
- npm install skill-family-harness-node@0.8.1
42
+ npm install skill-family-harness-node@0.8.3
43
43
  npm info skill-family-harness-node --help
44
44
  ```
45
45
 
46
46
  The minimal example shows validating a contract document inside Node:
47
47
 
48
48
  ```js
49
- // Run from an empty directory: npm install skill-family-harness-node@0.8.1
49
+ // Run from an empty directory: npm install skill-family-harness-node@0.8.3
50
50
  import { validateContractDocument } from "skill-family-harness-node";
51
51
 
52
52
  const document = {
package/README.zh-CN.md CHANGED
@@ -5,28 +5,28 @@
5
5
 
6
6
  # skill-family-harness-node
7
7
 
8
- <!-- release-skill:release-version: 0.8.1 -->
8
+ <!-- release-skill:release-version: 0.8.3 -->
9
9
 
10
10
  Contracts 机制协议的**唯一默认 Node 实现**。这是一个薄运行时(thin runtime):只实现机制协议,不引入业务语义,不做第二语言实现。
11
11
 
12
12
  <!-- release-skill:managed:start id=latest-release -->
13
- **0.8.1** (2026-08-22)
13
+ **0.8.3** (2026-08-23)
14
14
 
15
- 宿主把 Harness 打包进单文件适配器后,报告渲染器仍能保留 Harness 自身的包版本。
15
+ 路径收容现在可处理一次精确的锚点并发删除,同时保持越界检查失败关闭。
16
16
 
17
17
  **变更**
18
18
 
19
- - 包版本与 Contracts、Engineering Kit 一同升至 0.8.1。
20
- - Harness 21 项能力、报告合同和公共导出均保持不变。
19
+ - 第二次 ENOENT 与所有非 ENOENT 错误仍失败关闭;符号链接替换、根目录外目标和既有收容检查仍全部拒绝。
20
+ - 测试钩子只留在 paths 模块的测试表面,不新增公共导出、通用重试策略、锁层、账本或 runner。
21
+ - 包版本与 Contracts、Engineering Kit 一同升至 0.8.3。
21
22
 
22
23
  **修复**
23
24
 
24
- - 用静态 JSON import 替换报告渲染器运行时基于 import.meta.url 的包清单查找,使 esbuild 内联 Harness 版本,不再读取宿主适配器的包元数据。
25
- - 为 REPORT_RENDERER_VERSION 新增源码运行与第三方单文件 bundle 回归测试。
25
+ - 当另一进程删除已选锚点,导致该锚点的 realpath 返回 ENOENT 时,resolveContained 仅重新计算一次最深既存祖先。
26
26
 
27
27
  **升级说明**
28
28
 
29
- 把报告渲染器打包进宿主适配器的消费者必须精确锁定 Harness 0.8.1;报告 API 与渲染器身份保持不变,从 0.8.0 升级不需要迁移 API。
29
+ 消费者必须把三个 Foundation 包精确锁定到 0.8.3。并发获取锁时,即使当前持有者删除已选锁文件锚点,也能完成一次安全重求;Harness API 无需迁移。
30
30
  <!-- release-skill:managed:end id=latest-release -->
31
31
 
32
32
  ## 解决的问题
@@ -40,14 +40,14 @@ Harness 消费 `skill-family-contracts`(工作区依赖),复用其方言
40
40
  ## 安装和最小示例
41
41
 
42
42
  ```sh
43
- npm install skill-family-harness-node@0.8.1
43
+ npm install skill-family-harness-node@0.8.3
44
44
  npm info skill-family-harness-node --help
45
45
  ```
46
46
 
47
47
  最小示例演示在 Node 内校验一份契约文档:
48
48
 
49
49
  ```js
50
- // 从空目录运行:npm install skill-family-harness-node@0.8.1
50
+ // 从空目录运行:npm install skill-family-harness-node@0.8.3
51
51
  import { validateContractDocument } from "skill-family-harness-node";
52
52
 
53
53
  const document = {
@@ -13,6 +13,7 @@ import { fileURLToPath } from "node:url";
13
13
  import { computeResourceClosure, digestBytes } from "../src/closure.mjs";
14
14
  import { HARNESS_ERROR_KINDS, HarnessError, mechanismError } from "../src/errors.mjs";
15
15
  import { resolveContained } from "../src/paths.mjs";
16
+ import { readFileStrict } from "../src/strict-read.mjs";
16
17
 
17
18
  /**
18
19
  * Candidate quickstart profile v2 mechanisms (unstable).
@@ -455,6 +456,7 @@ const FOUNDATION_MECHANISM_OPERATIONS = Object.freeze([
455
456
  "digest-document",
456
457
  "resource-closure",
457
458
  "resolve-contained",
459
+ "read-file-strict",
458
460
  "create-task",
459
461
  "wrap-result",
460
462
  "verify-exchange",
@@ -483,6 +485,34 @@ function findUnsafeInteger(value, instancePath = "") {
483
485
  return null;
484
486
  }
485
487
 
488
+ function assertReadFileStrictParams(params) {
489
+ const allowedKeys = new Set(["root", "path", "encoding", "expectedSha256"]);
490
+ const unknownKey = Object.keys(params).find((key) => !allowedKeys.has(key));
491
+ if (unknownKey !== undefined) {
492
+ throw new TypeError(`invokeFoundationMechanism: read-file-strict unknown param: ${unknownKey}`);
493
+ }
494
+ for (const key of ["root", "path"]) {
495
+ if (!Object.hasOwn(params, key) || typeof params[key] !== "string" || params[key].length === 0) {
496
+ throw new TypeError(`invokeFoundationMechanism: read-file-strict ${key} must be a non-empty string`);
497
+ }
498
+ }
499
+ if (Object.hasOwn(params, "encoding") && params.encoding !== "utf8") {
500
+ throw new TypeError('invokeFoundationMechanism: read-file-strict encoding must be "utf8" or omitted');
501
+ }
502
+ }
503
+
504
+ async function invokeReadFileStrict(params) {
505
+ assertReadFileStrictParams(params);
506
+ const receipt = await readFileStrict(params.root, params.path, {
507
+ ...(Object.hasOwn(params, "encoding") ? { encoding: params.encoding } : {}),
508
+ ...(Object.hasOwn(params, "expectedSha256") ? { expectedSha256: params.expectedSha256 } : {}),
509
+ });
510
+ return {
511
+ ...receipt,
512
+ content: Buffer.isBuffer(receipt.content) ? receipt.content.toJSON() : receipt.content,
513
+ };
514
+ }
515
+
486
516
  /**
487
517
  * Fixed, business-neutral mechanism bridge for consumers that cannot import
488
518
  * several Foundation modules directly. validateBySchemaId is injected only
@@ -525,6 +555,9 @@ export async function invokeFoundationMechanism(request, { validateBySchemaId }
525
555
  if (operation === "resource-closure") {
526
556
  return computeResourceClosure({ root: params.root, resources: params.resources });
527
557
  }
558
+ if (operation === "read-file-strict") {
559
+ return invokeReadFileStrict(params);
560
+ }
528
561
  if (operation === "create-task") {
529
562
  return createQuickstartTask(params);
530
563
  }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@pnpm/lockfile.fs": "1001.1.35",
12
12
  "ipaddr.js": "2.5.0",
13
- "skill-family-contracts": "0.8.1",
13
+ "skill-family-contracts": "0.8.3",
14
14
  "yaml": "2.9.0"
15
15
  },
16
16
  "description": "Thin Node.js mechanism runtime for Skill Family engineering contracts.",
@@ -45,7 +45,7 @@
45
45
  "url": "https://github.com/ifoohoo/skill-family-harness-node.git"
46
46
  },
47
47
  "type": "module",
48
- "version": "0.8.1",
48
+ "version": "0.8.3",
49
49
  "scripts": {
50
50
  "check": "node --test",
51
51
  "test": "node --test"
@@ -0,0 +1,23 @@
1
+ version: 0.8.2
2
+ date: 2026-08-23
3
+ locales:
4
+ en:
5
+ summary: The fixed candidate mechanism bridge now exposes the existing strict reader through read-file-strict.
6
+ changes:
7
+ added:
8
+ - Adds read-file-strict to invokeFoundationMechanism with closed root, path, encoding, and expectedSha256 parameters.
9
+ - Returns UTF-8 content as a string and binary content in the standard JSON-safe Buffer shape.
10
+ changed:
11
+ - Delegates containment, file reading, digest verification, and failure classification directly to readFileStrict; no second read algorithm is introduced.
12
+ - Moves the package version to 0.8.2 together with Contracts and Engineering Kit.
13
+ upgradeNotes: Candidate consumers must pin all three Foundation packages to exactly 0.8.2 and rebuild their managed Bundle. Direct calls retain SFC2004 details.kind failures; the JSON CLI continues to promise only exit code 0 for success and 2 for rejection.
14
+ zh-CN:
15
+ summary: 固定的候选机制桥接新增 read-file-strict,直接公开既有严格读取机制。
16
+ changes:
17
+ added:
18
+ - invokeFoundationMechanism 新增 read-file-strict;参数闭合为 root、path、encoding 和 expectedSha256。
19
+ - UTF-8 内容返回字符串,二进制内容返回标准的 JSON 安全 Buffer 形态。
20
+ changed:
21
+ - 路径收容、文件读取、摘要复验和失败分类全部转发给 readFileStrict,不新增第二套读取算法。
22
+ - 包版本与 Contracts、Engineering Kit 一同升至 0.8.2。
23
+ upgradeNotes: 候选消费者必须把三个 Foundation 包精确锁定到 0.8.2,再重建受管 Bundle。直接调用继续返回 SFC2004 与 details.kind;JSON CLI 只承诺成功退出码 0 和拒绝退出码 2。
@@ -0,0 +1,23 @@
1
+ version: 0.8.3
2
+ date: 2026-08-23
3
+ locales:
4
+ en:
5
+ summary: Path containment now tolerates one exact anchor-removal race while preserving fail-closed escape checks.
6
+ changes:
7
+ fixed:
8
+ - When realpath of the selected existing anchor fails with ENOENT because another process removed it, resolveContained recomputes the deepest existing ancestor exactly once.
9
+ changed:
10
+ - A second ENOENT and every non-ENOENT failure remain closed; symlink swaps, out-of-root targets, and all existing containment checks remain rejected.
11
+ - Keeps the hook private to the paths module test surface and adds no public export, general retry policy, lock layer, ledger, or runner.
12
+ - Moves the package version to 0.8.3 together with Contracts and Engineering Kit.
13
+ upgradeNotes: Consumers must pin all three Foundation packages to exactly 0.8.3. Concurrent lock acquisition can now survive the current owner removing the selected lock-file anchor; no Harness API migration is required.
14
+ zh-CN:
15
+ summary: 路径收容现在可处理一次精确的锚点并发删除,同时保持越界检查失败关闭。
16
+ changes:
17
+ fixed:
18
+ - 当另一进程删除已选锚点,导致该锚点的 realpath 返回 ENOENT 时,resolveContained 仅重新计算一次最深既存祖先。
19
+ changed:
20
+ - 第二次 ENOENT 与所有非 ENOENT 错误仍失败关闭;符号链接替换、根目录外目标和既有收容检查仍全部拒绝。
21
+ - 测试钩子只留在 paths 模块的测试表面,不新增公共导出、通用重试策略、锁层、账本或 runner。
22
+ - 包版本与 Contracts、Engineering Kit 一同升至 0.8.3。
23
+ upgradeNotes: 消费者必须把三个 Foundation 包精确锁定到 0.8.3。并发获取锁时,即使当前持有者删除已选锁文件锚点,也能完成一次安全重求;Harness API 无需迁移。
package/src/paths.mjs CHANGED
@@ -32,6 +32,13 @@ import { HARNESS_ERROR_KINDS, mechanismError } from "./errors.mjs";
32
32
  const WINDOWS_DRIVE_PATTERN = /^[A-Za-z]:/;
33
33
  const WINDOWS_UNC_PATTERN = /^\\\\/;
34
34
  const POSIX_UNC_PATTERN = /^\/\//;
35
+ const ANCHOR_REALPATH_ATTEMPTS = 2;
36
+
37
+ let testHooks = null;
38
+
39
+ async function runTestHook(name, context) {
40
+ if (typeof testHooks?.[name] === "function") await testHooks[name](context);
41
+ }
35
42
 
36
43
  /**
37
44
  * Classifies one candidate relative path without touching the filesystem.
@@ -143,7 +150,13 @@ async function deepestExistingAncestor(rootReal, absPath) {
143
150
  try {
144
151
  await lstat(current);
145
152
  return { anchor: current, missing };
146
- } catch {
153
+ } catch (cause) {
154
+ if (cause?.code !== "ENOENT" && cause?.code !== "ENOTDIR") {
155
+ throw mechanismError(
156
+ HARNESS_ERROR_KINDS.READ_FAILED,
157
+ `path ancestor cannot be inspected: ${cause?.code ?? "unknown"}`,
158
+ );
159
+ }
147
160
  missing.unshift(path.basename(current));
148
161
  const parent = path.dirname(current);
149
162
  if (parent === current) break;
@@ -158,6 +171,31 @@ async function deepestExistingAncestor(rootReal, absPath) {
158
171
  );
159
172
  }
160
173
 
174
+ async function canonicalAnchor(rootReal, resolved, relPath) {
175
+ for (let attempt = 0; attempt < ANCHOR_REALPATH_ATTEMPTS; attempt += 1) {
176
+ const { anchor, missing } = await deepestExistingAncestor(rootReal, resolved);
177
+ await runTestHook("beforeAnchorRealpath", { anchor, attempt });
178
+ try {
179
+ return { anchorReal: await realpath(anchor), missing };
180
+ } catch (cause) {
181
+ // An existing lock or staging file can be removed by its owner between
182
+ // lstat() and realpath(). Recompute the ancestor once for that exact
183
+ // disappearance race; every other error remains fail-closed.
184
+ if (cause?.code === "ENOENT" && attempt + 1 < ANCHOR_REALPATH_ATTEMPTS) continue;
185
+ throw mechanismError(
186
+ HARNESS_ERROR_KINDS.REALPATH_ESCAPE,
187
+ "anchor directory vanished during canonical resolution",
188
+ { input: relPath, code: cause?.code },
189
+ );
190
+ }
191
+ }
192
+ throw mechanismError(
193
+ HARNESS_ERROR_KINDS.REALPATH_ESCAPE,
194
+ "anchor directory vanished during canonical resolution",
195
+ { input: relPath },
196
+ );
197
+ }
198
+
161
199
  /**
162
200
  * Resolves `relPath` against `root` and proves the target stays inside.
163
201
  * Returns the absolute, lexically resolved path (strictly inside the root).
@@ -221,17 +259,7 @@ export async function resolveContained(root, relPath) {
221
259
 
222
260
  // Escape class 3: canonical resolution (any intermediate symlink chain)
223
261
  // must stay inside the canonical root.
224
- const { anchor, missing } = await deepestExistingAncestor(rootReal, resolved);
225
- let anchorReal;
226
- try {
227
- anchorReal = await realpath(anchor);
228
- } catch {
229
- throw mechanismError(
230
- HARNESS_ERROR_KINDS.REALPATH_ESCAPE,
231
- "anchor directory vanished during canonical resolution",
232
- { input: relPath },
233
- );
234
- }
262
+ const { anchorReal, missing } = await canonicalAnchor(rootReal, resolved, relPath);
235
263
  if (!insideOrEqualRoot(rootReal, anchorReal)) {
236
264
  throw mechanismError(
237
265
  HARNESS_ERROR_KINDS.REALPATH_ESCAPE,
@@ -250,6 +278,14 @@ export async function resolveContained(root, relPath) {
250
278
  return resolved;
251
279
  }
252
280
 
281
+ /** Test-only hooks. Deliberately not re-exported from the package index. */
282
+ export function __setPathsTestHooks(hooks) {
283
+ if (hooks !== null && (!hooks || typeof hooks !== "object" || Array.isArray(hooks))) {
284
+ throw new TypeError("paths test hooks must be an object or null");
285
+ }
286
+ testHooks = hooks;
287
+ }
288
+
253
289
  /**
254
290
  * Contained read. Returns the file content as a Buffer (utf8 string when
255
291
  * encoding is "utf8"). Missing resources surface as SFC2004 with the stable