CodeSampleX

Пример

bare-fs 4.8.7

Проверенный пример — npm bare-fs 4.8.7. Контракт выполнен на node 22 · linux debian/x64 · docker и пройден: bare-fs/constants and bare-fs.constants export…

sha256:403480584a12934b377a700fa5f458a9f11bee4f0511c1569c79857c44e7871c

Эта сеть предлагает одно: образец, который собирается. Она запустила его в песочнице и сохранила подписанную квитанцию. Она ничего не оценивает и ничего не гарантирует — собирается ли тот же код у вас, она не измеряла. Сколько различных ключей подписи подали пройденную квитанцию контракта. Один — только автор; больше одного — значит, кто-то ещё тоже собрал. Ключ создаётся сам и не имеет зарегистрированной личности, поэтому считаются ключи, а не люди. MIT-0

Свидетельства выполнения

Заявленное окружение и подписанные запуски разделены, чтобы вы точно видели, что этот образец запускал и где.

Основа свидетельства
Подписанный контракт пройден
Квитанции проверки
1
Ключи подписи, собравшие его
1
Заявленная среда node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

Среды запусков проверки

Окружение Контракт Этапы Запуск
node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2…
2026-11-29

Кейс

HOW
Цель
verify pkg:npm/bare-fs@4.8.7
Пакеты
Окружение
node 22.23.2
Создан
2026-11-29T23:31:32Z

Контракт

  1. bare-fs/constants and bare-fs.constants export matching POSIX open flags, access modes, and file mode masks
  2. synchronous mkdirSync, writeFileSync, appendFileSync, readFileSync, statSync, and readdirSync with Dirent entries operate on real files and directories
  3. low-level file descriptor openSync, writeSync, ftruncateSync, fstatSync, readSync, and closeSync round-trip binary bytes
  4. bare-fs/promises writeFile, readFile, open returning FileHandle, FileHandle.stat, FileHandle.read, and FileHandle.close emit close and reset fd
  5. promises copyFile with COPYFILE_EXCL, rename, symlink, lstat, readlink, realpath, and statfs operate on real filesystem entries
  6. createWriteStream and createReadStream stream chunks to and from a file
  7. statSync on a missing path throws FileError with code ENOENT and syscall stat, and null bytes in path throw TypeError

Файлы

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/bare-contract.cjs
  • test/contract.mjs

Скачать артефакт с исходным кодом (tar.gz)

Исходный код

PROMPT.md
Clean-room public code sample — generation instructions

Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.

A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.

Goal: verify pkg:npm/bare-fs@4.8.7
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/bare-fs@4.8.7
Constraints:
  - executionContext: node
Required runtime conditions:
  - ecosystem: npm
  - language: javascript
  - moduleSystem: cjs
  - packageManager: npm@10.9.8
  - runtime: node@22.23.2

Rules:
  - One focused purpose; the smallest project that proves the goal.
  - Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
  - Pin every dependency with a lockfile so resolution is reproducible.
  - No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
  - No personal names, emails, company names, or project identifiers of any kind.
  - No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
  - Keep it under 200 files and 256KB packed.
csx.json
{"case":{"caseId":"case:sha256:71e046026afec79feb9d7c22328cb3ac55deb57fbe0cc64d652909e66c653dc4","constraints":{"executionContext":"node"},"contract":["bare-fs/constants and bare-fs.constants export matching POSIX open flags, access modes, and file mode masks","synchronous mkdirSync, writeFileSync, appendFileSync, readFileSync, statSync, and readdirSync with Dirent entries operate on real files and directories","low-level file descriptor openSync, writeSync, ftruncateSync, fstatSync, readSync, and closeSync round-trip binary bytes","bare-fs/promises writeFile, readFile, open returning FileHandle, FileHandle.stat, FileHandle.read, and FileHandle.close emit close and reset fd","promises copyFile with COPYFILE_EXCL, rename, symlink, lstat, readlink, realpath, and statfs operate on real filesystem entries","createWriteStream and createReadStream stream chunks to and from a file","statSync on a missing path throws FileError with code ENOENT and syscall stat, and null bytes in path throw TypeError"],"goal":"verify pkg:npm/bare-fs@4.8.7","kind":"HOW","packages":["pkg:npm/bare-fs@4.8.7"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/bare-fs@4.8.7"],"schemaVersion":1,"subject":"pkg:npm/bare-fs@4.8.7","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-bare-fs",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-bare-fs",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "bare-fs": "4.8.7"
      },
      "devDependencies": {
        "bare": "1.39.0"
      }
    },
    "node_modules/b4a": {
      "version": "1.9.0",
      "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.9.0.tgz",
      "integrity": "sha512-dpfcF9fDNR6++cthXR67iyhgqWy9CBouAvIWhIntzBG6cvK/cnIPiZQjBwi/ZqjjBEDGfoNDtmB0kTjroOJ3pQ==",
      "license": "Apache-2.0",
      "peerDependencies": {
        "react-native-b4a": "*"
      },
      "peerDependenciesMeta": {
        "react-native-b4a": {
          "optional": true
        }
      }
    },
    "node_modules/bare": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare/-/bare-1.39.0.tgz",
      "integrity": "sha512-FdOF36G1F8wwHTMx4DzR/JISr11ph3Bowtum4UVpy0mjlt716evfN9F09xca/WCzAaMyZH8fFGFY+u51GLD5zA==",
      "dev": true,
      "license": "Apache-2.0",
      "bin": {
        "bare": "bin/bare"
      },
      "peerDependencies": {
        "bare-buffer": "*",
        "bare-console": "*",
        "bare-events": "*",
        "bare-queue-microtask": "*",
        "bare-runtime": "*",
        "bare-stream": "*",
        "bare-structured-clone": "*",
        "bare-timers": "*",
        "bare-url": "*"
      },
      "peerDependenciesMeta": {
        "bare-buffer": {
          "optional": true
        },
        "bare-console": {
          "optional": true
        },
        "bare-events": {
          "optional": true
        },
        "bare-queue-microtask": {
          "optional": true
        },
        "bare-stream": {
          "optional": true
        },
        "bare-structured-clone": {
          "optional": true
        },
        "bare-timers": {
          "optional": true
        },
        "bare-url": {
          "optional": true
        }
      }
    },
    "node_modules/bare-abort": {
      "version": "2.0.14",
      "resolved": "https://registry.npmjs.org/bare-abort/-/bare-abort-2.0.14.tgz",
      "integrity": "sha512-6H2FRP7HmZG5aDHvezZksGk/QgwTMYPvMrfYMITTsD8M39z97RYAq2gGMvuznN1vgN/Iw0f/A552pcv3dCtaTw==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true
    },
    "node_modules/bare-buffer": {
      "version": "3.7.3",
      "resolved": "https://registry.npmjs.org/bare-buffer/-/bare-buffer-3.7.3.tgz",
      "integrity": "sha512-77owW16RX6YgdOzddHtM0oGz8wsd0/F9k/0coz6TPmjUHnr/9FwWODVMNKwyYWM/a/ESdTum855nfQxnsKUygA==",
      "license": "Apache-2.0",
      "engines": {
        "bare": ">=1.20.0"
      }
    },
    "node_modules/bare-dns": {
      "version": "2.3.5",
      "resolved": "https://registry.npmjs.org/bare-dns/-/bare-dns-2.3.5.tgz",
      "integrity": "sha512-8EuvgzK4stdPMZcnp1ALOMcBqq2yrPohtuIWPn6PRCp6SDez0axbjq1psXlfH63vq9hVbqDZMjWAGjyA/e5Igw==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "engines": {
        "bare": ">=1.33.0"
      },
      "peerDependencies": {
        "bare-buffer": "*"
      },
      "peerDependenciesMeta": {
        "bare-buffer": {
          "optional": true
        }
      }
    },
    "node_modules/bare-env": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/bare-env/-/bare-env-3.0.1.tgz",
      "integrity": "sha512-BdoLvnzaWR0YyyJreEx4zG2Od0AC/s9JSZ+EXyMZKunpn8zEgR/dGv37hdFUaY1bjDkcRKvcKkFyJIwlJ0CaYA==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-os": "^3.0.1"
      }
    },
    "node_modules/bare-events": {
      "version": "2.9.2",
      "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.9.2.tgz",
      "integrity": "sha512-AIPKioV7/Y/8KfZ3AAhjPJxLLbY49S64Ym5DakZlUg75qQiTgUq9hEJoEwa4eUezPUlXRy/i5NpsKvo9jgKmoA==",
      "license": "Apache-2.0",
      "peerDependencies": {
        "bare-abort-controller": "*"
      },
      "peerDependenciesMeta": {
        "bare-abort-controller": {
          "optional": true
        }
      }
    },
    "node_modules/bare-fs": {
      "version": "4.8.7",
      "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.8.7.tgz",
      "integrity": "sha512-bNBjq+x9Wezp3risJs7TaPH3jjVnyFmmSSxfpES8tp9xjvL4t6Bk9v2nC+xm5lfxJeDzChK7NBryK+JciM/pfQ==",
      "license": "Apache-2.0",
      "dependencies": {
        "bare-events": "^2.5.4",
        "bare-path": "^3.0.0",
        "bare-stream": "^2.6.4",
        "bare-url": "^2.2.2",
        "fast-fifo": "^1.3.2"
      },
      "engines": {
        "bare": ">=1.28.0"
      },
      "peerDependencies": {
        "bare-buffer": "*"
      },
      "peerDependenciesMeta": {
        "bare-buffer": {
          "optional": true
        }
      }
    },
    "node_modules/bare-hrtime": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/bare-hrtime/-/bare-hrtime-2.1.2.tgz",
      "integrity": "sha512-ePu0axonbewvuUv9TFqjfvnZTaw+mL4JNx1q79dw8T3DIQEjqHs+pXyj92ghepa8K14KLtX3GdUuAVB+faaGDw==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true
    },
    "node_modules/bare-module-resolve": {
      "version": "1.12.6",
      "resolved": "https://registry.npmjs.org/bare-module-resolve/-/bare-module-resolve-1.12.6.tgz",
      "integrity": "sha512-tsoOqHmtF6VmNX4LYDBZwvQVkSmEagnbykNjK31LMxz/amyKfjCs4K976n7uJd1bvWfxbpLQ3Fy7qq8an6jR6Q==",
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "peer": true,
      "dependencies": {
        "bare-semver": "^1.0.0"
      },
      "peerDependencies": {
        "bare-url": "*"
      },
      "peerDependenciesMeta": {
        "bare-url": {
          "optional": true
        }
      }
    },
    "node_modules/bare-os": {
      "version": "3.9.4",
      "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.9.4.tgz",
      "integrity": "sha512-8ktmRKEyGd9FcTKT2iiYel2bBAUanxHCOQXb+SkU/rddYkLweTgcz+nD0slw3rIuRGVRJMGFCeobvUJtkLB1wQ==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "engines": {
        "bare": ">=1.14.0"
      }
    },
    "node_modules/bare-path": {
      "version": "3.1.3",
      "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.1.3.tgz",
      "integrity": "sha512-8r+FVU/o4zcFmpCDqbqAYhHHbtXPP+cyZKo7DRGRWc7OLlNs4TMaSQEpXL/sIdzyEG0M7RHw4B7xYMGrTc+qrg==",
      "license": "Apache-2.0"
    },
    "node_modules/bare-pipe": {
      "version": "4.4.2",
      "resolved": "https://registry.npmjs.org/bare-pipe/-/bare-pipe-4.4.2.tgz",
      "integrity": "sha512-1GI7QpAOMisNkHnjLB5WeXyVcGNYYp1j9FTiv2tOy8yNhGJA4BpP86NHl8qUe9m57NEfmHuNrKKg+luMLa7Onw==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-events": "^2.5.4",
        "bare-stream": "^2.6.4"
      },
      "engines": {
        "bare": ">=1.16.0"
      },
      "peerDependencies": {
        "bare-buffer": "*"
      },
      "peerDependenciesMeta": {
        "bare-buffer": {
          "optional": true
        }
      }
    },
    "node_modules/bare-posix": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/bare-posix/-/bare-posix-1.0.2.tgz",
      "integrity": "sha512-JC9Uw5a31F8fnP5XOKGC02jUtRdPi4hisZIEnjBblR58a/vZx4LU+q4dUHhUtFE1VqhvzopRO4dCPTKW6dAuOw==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true
    },
    "node_modules/bare-process": {
      "version": "4.5.1",
      "resolved": "https://registry.npmjs.org/bare-process/-/bare-process-4.5.1.tgz",
      "integrity": "sha512-CaAvy1trputD49mtwfJ6G75vydhnirLrW/F3Sznp4H556e1uZn8YMo9ELicBTrGYy7RBNUgPl9bpB/ERzRCiDw==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-abort": "^2.0.13",
        "bare-env": "^3.0.0",
        "bare-events": "^2.3.1",
        "bare-hrtime": "^2.0.0",
        "bare-os": "^3.7.1",
        "bare-posix": "^1.0.1",
        "bare-signals": "^5.0.0",
        "bare-stdio": "^1.0.1"
      }
    },
    "node_modules/bare-runtime": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime/-/bare-runtime-1.39.0.tgz",
      "integrity": "sha512-VxibJjbpHpZdPbvTWZfqji7RuYOrqTu3gxT8W7K+yJwrl9X/MLLb3M9T7ArXG/ZPt9YGSin8fQfdxE1WIbZDaw==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "workspaces": [
        "npm/*"
      ],
      "dependencies": {
        "bare-fs": "^4.4.4",
        "bare-os": "^3.0.1",
        "bare-path": "^3.0.0",
        "bare-process": "^4.2.1",
        "bare-subprocess": "^6.1.0"
      },
      "bin": {
        "bare": "bin/bare"
      },
      "optionalDependencies": {
        "bare-runtime-android-arm": "1.39.0",
        "bare-runtime-android-arm64": "1.39.0",
        "bare-runtime-android-ia32": "1.39.0",
        "bare-runtime-android-x64": "1.39.0",
        "bare-runtime-darwin-arm64": "1.39.0",
        "bare-runtime-darwin-x64": "1.39.0",
        "bare-runtime-ios-arm64": "1.39.0",
        "bare-runtime-ios-arm64-simulator": "1.39.0",
        "bare-runtime-ios-x64-simulator": "1.39.0",
        "bare-runtime-linux-arm64": "1.39.0",
        "bare-runtime-linux-x64": "1.39.0",
        "bare-runtime-win32-arm64": "1.39.0",
        "bare-runtime-win32-x64": "1.39.0"
      }
    },
    "node_modules/bare-runtime-android-arm": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-android-arm/-/bare-runtime-android-arm-1.39.0.tgz",
      "integrity": "sha512-N7ms/FKtarqggQvrSw6vfhZq5n7EY31gQEQGwu5Hf1jQVIRcDxAnYGNZSa6Lt2jzLsUc7Wtj1kiwYr1az/O3gQ==",
      "cpu": [
        "arm"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "android"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-android-arm64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-android-arm64/-/bare-runtime-android-arm64-1.39.0.tgz",
      "integrity": "sha512-ly8kRjL4NnI47SNRzzcnhxSLKHS2QXvtNgQgaEd1qxzUaOaI4eTBF7AfO44S60q4MRlSZqQQrquOmTyR8kT7rA==",
      "cpu": [
        "arm64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "android"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-android-ia32": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-android-ia32/-/bare-runtime-android-ia32-1.39.0.tgz",
      "integrity": "sha512-Nw9+erDWmXPTlSY+mxHGKCR3c2a89sbvZbLAU20nTjtqHmYslEYQDQY09Nau9DH0xsbvzkR58YRpnPiM3M32Sg==",
      "cpu": [
        "ia32"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "android"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-android-x64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-android-x64/-/bare-runtime-android-x64-1.39.0.tgz",
      "integrity": "sha512-oJ0aSK565OCI2rv4TQdt+AXUx+LF/2dIh1J7YQLIVGUjYnCZUcBO1NcomiN2nJ1RmVbpiCjjgqfgrh9aaRJ7Xg==",
      "cpu": [
        "x64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "android"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-darwin-arm64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-darwin-arm64/-/bare-runtime-darwin-arm64-1.39.0.tgz",
      "integrity": "sha512-cjxTJcKg/ZvbRnMLfjpeRAni+P/yNSwIJA54fZr8rk23CW9Qnu9MOqUU6Atgp1Lg8v6zq8XT6G0xo/BnakQ8Nw==",
      "cpu": [
        "arm64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "darwin"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-darwin-x64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-darwin-x64/-/bare-runtime-darwin-x64-1.39.0.tgz",
      "integrity": "sha512-uv0GXAkHt0zgo0niL9gRB0R5iUBJL2qsnyF8GFEsHjfWRnPFDONruTdeisTPg1DXb8Aw0SaYF0QsyXJf9HvDgw==",
      "cpu": [
        "x64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "darwin"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-ios-arm64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-ios-arm64/-/bare-runtime-ios-arm64-1.39.0.tgz",
      "integrity": "sha512-lL1wgUsW6OjkDLjm3wt8vpxKf1bqNQ9pJXlMa08WOQ+kIvixt0cC8UgS9XTDn+1Tj6zwdbyt940r8R78mV3/QQ==",
      "cpu": [
        "arm64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "ios"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-ios-arm64-simulator": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-ios-arm64-simulator/-/bare-runtime-ios-arm64-simulator-1.39.0.tgz",
      "integrity": "sha512-2kaCFAN2Dgl3C9F7gzzkR+G+4/WdoqrZJJwFpMsWTrbtQ2C40LwAcROhwHEJa87rpDY8cwJ3cavowyCUeRUQMQ==",
      "cpu": [
        "arm64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "ios"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-ios-x64-simulator": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-ios-x64-simulator/-/bare-runtime-ios-x64-simulator-1.39.0.tgz",
      "integrity": "sha512-lo7OfNNZjvt8WcCM+eIC4lZH9rc69FKTOvV+ipZAlo2XBwZRrOJKoVsrtdQjRFLF9A5pOrH05FmHSG884H4RYw==",
      "cpu": [
        "x64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "ios"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-linux-arm64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-linux-arm64/-/bare-runtime-linux-arm64-1.39.0.tgz",
      "integrity": "sha512-+yDhwt86rjnTZeF7+nWgVE2hD+J6myQrzhhTWpU9e0IVjv5gll+uCbyvd2ev9+YQlDUHTE73z+eXsoKlm+0t+A==",
      "cpu": [
        "arm64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "linux"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-linux-x64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-linux-x64/-/bare-runtime-linux-x64-1.39.0.tgz",
      "integrity": "sha512-baR1Zg5g1mEu3hfIaOOAieKkbEMtCpM4rLOJKKHjy1O477GvLWQGhxt3ycuXhgqVC0aVMclB7JhDoATXzZt6ww==",
      "cpu": [
        "x64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "linux"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare"
      }
    },
    "node_modules/bare-runtime-win32-arm64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-win32-arm64/-/bare-runtime-win32-arm64-1.39.0.tgz",
      "integrity": "sha512-H3DQlF5lp20lh4eYJFJShPPC0/e2vF70968rgs5UzEYC/qkGJxvQxbeYQP8MqKDLW55nT72rzlrMzeXJ8Rh44Q==",
      "cpu": [
        "arm64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "win32"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare.exe"
      }
    },
    "node_modules/bare-runtime-win32-x64": {
      "version": "1.39.0",
      "resolved": "https://registry.npmjs.org/bare-runtime-win32-x64/-/bare-runtime-win32-x64-1.39.0.tgz",
      "integrity": "sha512-AuZcSCYp95AA8DRPbQH+AwHZM2Mo3MV0x1s9lZkP4Lf3FSlsbaGpE4AlkHEc97ksuUWN2mTwT1wc6514BK0QTw==",
      "cpu": [
        "x64"
      ],
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "os": [
        "win32"
      ],
      "peer": true,
      "dependencies": {
        "require-asset": "^1.0.2"
      },
      "bin": {
        "bare": "bin/bare.exe"
      }
    },
    "node_modules/bare-semver": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/bare-semver/-/bare-semver-1.1.0.tgz",
      "integrity": "sha512-1Hw5qJ7hXdVt3uPUqjeFTuxyvBUJauvz5A1I2jk8gzjZMHp04n//6nV9MDbG9CMw78JHY2lGV0w6s//LrASm2w==",
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "peer": true
    },
    "node_modules/bare-signals": {
      "version": "5.0.1",
      "resolved": "https://registry.npmjs.org/bare-signals/-/bare-signals-5.0.1.tgz",
      "integrity": "sha512-cdClWq35Tpjm/8C4h6gajbxWhODmSlDZI+8UMvF+1fwC/syrRlMDrTyksEzeWhD1lWhEc1DH3OPZBdUq0YAqgA==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-events": "^2.5.3"
      },
      "engines": {
        "bare": ">=1.7.0"
      }
    },
    "node_modules/bare-stdio": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/bare-stdio/-/bare-stdio-1.0.3.tgz",
      "integrity": "sha512-8BRMx7RWMWCbBmKhyHgBco62J+Pgss7+EPI21L3R9+w0UpwDYWUUcbE0YTOesGyt7M6N7VtoshYbzwrP0pI52Q==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-fs": "^4.5.2",
        "bare-pipe": "^4.1.5",
        "bare-tty": "^5.0.3"
      }
    },
    "node_modules/bare-stream": {
      "version": "2.13.4",
      "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.13.4.tgz",
      "integrity": "sha512-PcrQ8lVLbiJscNm1Kez+Yp4Gy4AHGcN1lzwjvf5NybWen7VvEgUfyfnXYJ2zNqWnzOfCb1Abq6lH8ti0syQszA==",
      "license": "Apache-2.0",
      "dependencies": {
        "b4a": "^1.8.1",
        "streamx": "^2.25.0",
        "teex": "^1.0.1"
      },
      "peerDependencies": {
        "bare-abort-controller": "*",
        "bare-buffer": "*",
        "bare-events": "*"
      },
      "peerDependenciesMeta": {
        "bare-abort-controller": {
          "optional": true
        },
        "bare-buffer": {
          "optional": true
        },
        "bare-events": {
          "optional": true
        }
      }
    },
    "node_modules/bare-structured-clone": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/bare-structured-clone/-/bare-structured-clone-2.0.1.tgz",
      "integrity": "sha512-F/n/etzjf4YlW4OCF0kpe0H6UOcCXZg0LrPMCY2dP9fg2R7fME5crkmQlM1Hl62iKipMQFaT9S2eSyx0tBCJ8g==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-buffer": "^3.6.0",
        "bare-type": "^1.3.0",
        "bare-url": "^2.4.0",
        "compact-encoding": "^3.0.1"
      },
      "engines": {
        "bare": ">=1.2.0"
      }
    },
    "node_modules/bare-subprocess": {
      "version": "6.2.3",
      "resolved": "https://registry.npmjs.org/bare-subprocess/-/bare-subprocess-6.2.3.tgz",
      "integrity": "sha512-Qz9T1Ej+xTdsWdh5uTL4CSaMtUlcK+Hji+6QktP8kWWHc91N3V79OsjUigaYWdBSpoPf8ZgGeXAXkn7T2LXimQ==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-env": "^3.0.0",
        "bare-events": "^2.5.4",
        "bare-os": "^3.0.1",
        "bare-pipe": "^4.2.0",
        "bare-structured-clone": "^2.0.0",
        "bare-tcp": "^2.4.1",
        "bare-url": "^2.2.2"
      },
      "engines": {
        "bare": ">=1.7.0"
      },
      "peerDependencies": {
        "bare-buffer": "*"
      },
      "peerDependenciesMeta": {
        "bare-buffer": {
          "optional": true
        }
      }
    },
    "node_modules/bare-tcp": {
      "version": "2.6.1",
      "resolved": "https://registry.npmjs.org/bare-tcp/-/bare-tcp-2.6.1.tgz",
      "integrity": "sha512-8f8UFP7O27gIGaVWJPysQ2am8LSD6YCuVSbnTbOrQjUD0RkWEZexvi2Q66P99MLxSephlyjoU0mLxWmozRJMnA==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-dns": "^2.0.4",
        "bare-events": "^2.5.4",
        "bare-stream": "^2.6.4"
      },
      "engines": {
        "bare": ">=1.16.0"
      },
      "peerDependencies": {
        "bare-pipe": "*"
      },
      "peerDependenciesMeta": {
        "bare-pipe": {
          "optional": true
        }
      }
    },
    "node_modules/bare-tty": {
      "version": "5.2.2",
      "resolved": "https://registry.npmjs.org/bare-tty/-/bare-tty-5.2.2.tgz",
      "integrity": "sha512-oyrepHCXHn4uLNCW1BKa61340ymtiAnvdVaW3qOot/yqmBWJqDSOqVBzLCeroMsZKuaODaIrAGVpTxXWxIZskg==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "bare-events": "^2.2.0",
        "bare-signals": "^5.0.0",
        "bare-stream": "^2.0.0"
      },
      "engines": {
        "bare": ">=1.16.0"
      }
    },
    "node_modules/bare-type": {
      "version": "1.6.0",
      "resolved": "https://registry.npmjs.org/bare-type/-/bare-type-1.6.0.tgz",
      "integrity": "sha512-MxcXJP14DYFVQVmsKuROEuFsevwbf80kyWnai3cd8nio2OIjSkoYq+60KK31OE6LyIrXq190ER1MNcmUpVEmYA==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "engines": {
        "bare": ">=1.37.0"
      }
    },
    "node_modules/bare-url": {
      "version": "2.5.8",
      "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.5.8.tgz",
      "integrity": "sha512-G5KTe5Bj6z5pqIxcn3lWlIFIv0rkXbccx0T0Xuf7t4RapfSWvFlcVbrwYXxFZ00PC4lp57OCIk6uXP/r3GbpDw==",
      "license": "Apache-2.0",
      "dependencies": {
        "bare-buffer": "^3.0.0",
        "bare-path": "^3.0.0"
      }
    },
    "node_modules/compact-encoding": {
      "version": "3.7.1",
      "resolved": "https://registry.npmjs.org/compact-encoding/-/compact-encoding-3.7.1.tgz",
      "integrity": "sha512-woJ7awiWH6naB0Nd0k8Biu/2HgbcA1Ii7cjJdpyiUEpAhlfVBUzi0FG6/go/9kZ+zo3MDDznvi7UmH24kD/1dg==",
      "dev": true,
      "license": "Apache-2.0",
      "peer": true,
      "dependencies": {
        "b4a": "^1.3.0"
      }
    },
    "node_modules/events-universal": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",
      "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==",
      "license": "Apache-2.0",
      "dependencies": {
        "bare-events": "^2.7.0"
      }
    },
    "node_modules/fast-fifo": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
      "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",
      "license": "MIT"
    },
    "node_modules/require-asset": {
      "version": "1.2.4",
      "resolved": "https://registry.npmjs.org/require-asset/-/require-asset-1.2.4.tgz",
      "integrity": "sha512-wGqZYy8rDKHNvBJ4qmxM+34zatGwuGQhHpTxunnnjJkT29wO8vGfZQRCfN6hCR7qstENQbem4fAJ2XqwK3O8KQ==",
      "dev": true,
      "license": "Apache-2.0",
      "optional": true,
      "peer": true,
      "dependencies": {
        "bare-module-resolve": "^1.6.2"
      },
      "engines": {
        "bare": ">=1.10.0",
        "node": ">=18"
      }
    },
    "node_modules/streamx": {
      "version": "2.28.1",
      "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.28.1.tgz",
      "integrity": "sha512-zEzXb0s5Cds7tqMH6rhZ05lcJydCWiQPEwiNngVqzsxCc962vLY4Uw+mW7od8kDH258k2Uz/JrOkdIAAhSh9VA==",
      "license": "MIT",
      "dependencies": {
        "events-universal": "^1.0.0",
        "fast-fifo": "^1.3.2",
        "text-decoder": "^1.1.0"
      }
    },
    "node_modules/teex": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz",
      "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==",
      "license": "MIT",
      "dependencies": {
        "streamx": "^2.12.5"
      }
    },
    "node_modules/text-decoder": {
      "version": "1.2.7",
      "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz",
      "integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==",
      "license": "Apache-2.0",
      "dependencies": {
        "b4a": "^1.6.4"
      }
    }
  }
}
package.json
{
  "name": "sample-bare-fs",
  "version": "1.0.0",
  "private": true,
  "license": "MIT-0",
  "dependencies": {
    "bare-fs": "4.8.7"
  },
  "devDependencies": {
    "bare": "1.39.0"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/bare-fs@4.8.7",
  "kind": "HOW",
  "packages": [
    "pkg:npm/bare-fs@4.8.7"
  ],
  "constraints": {
    "executionContext": "node"
  },
  "runtimeConditions": {
    "ecosystem": "npm",
    "language": "javascript",
    "moduleSystem": "cjs",
    "packageManager": "npm@10.9.8",
    "runtime": "node@22.23.2"
  }
}
test/bare-contract.cjs
const fs = require('bare-fs')
const fsp = require('bare-fs/promises')
const constants = require('bare-fs/constants')
const path = require('bare-path')

function assert(cond, msg) {
  if (!cond) throw new Error('Assertion failed: ' + msg)
}

function assertEqual(actual, expected, msg) {
  if (actual !== expected) {
    throw new Error(`Assertion failed (${msg}): expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`)
  }
}

async function main() {
  // 1. Constants subpath & re-export
  assertEqual(fs.constants, constants, 'fs.constants equals bare-fs/constants')
  assert(typeof constants.O_RDONLY === 'number', 'O_RDONLY is number')
  assert(typeof constants.O_RDWR === 'number', 'O_RDWR is number')
  assert(typeof constants.O_CREAT === 'number', 'O_CREAT is number')
  assert(typeof constants.F_OK === 'number', 'F_OK is number')
  assert(typeof constants.R_OK === 'number', 'R_OK is number')
  assert(typeof constants.W_OK === 'number', 'W_OK is number')
  assert(typeof constants.S_IFREG === 'number', 'S_IFREG is number')
  assert(typeof constants.S_IFDIR === 'number', 'S_IFDIR is number')

  // Create isolated temporary directory under current working directory
  const baseDir = fs.mkdtempSync('.bare-fs-test-')

  try {
    // 2. Synchronous directory and file operations
    const subDir = path.join(baseDir, 'nested', 'dir')
    fs.mkdirSync(subDir, { recursive: true })
    assert(fs.existsSync(subDir), 'nested directory exists after mkdirSync recursive')

    const syncFile = path.join(subDir, 'hello.txt')
    fs.writeFileSync(syncFile, 'hello bare-fs')
    const syncContent = fs.readFileSync(syncFile, 'utf8')
    assertEqual(syncContent, 'hello bare-fs', 'readFileSync returns written UTF-8 text')

    fs.appendFileSync(syncFile, '!')
    assertEqual(fs.readFileSync(syncFile, 'utf8'), 'hello bare-fs!', 'appendFileSync appends text')

    const st = fs.statSync(syncFile)
    assert(st instanceof fs.Stats, 'statSync returns Stats instance')
    assert(st.isFile(), 'statSync.isFile() is true for regular file')
    assert(!st.isDirectory(), 'statSync.isDirectory() is false for regular file')
    assertEqual(st.size, 14, 'statSync reports exact byte length')

    const dirEntries = fs.readdirSync(subDir, { withFileTypes: true })
    assertEqual(dirEntries.length, 1, 'readdirSync returns 1 entry')
    assert(dirEntries[0] instanceof fs.Dirent, 'readdirSync withFileTypes returns Dirent')
    assertEqual(dirEntries[0].name, 'hello.txt', 'Dirent name matches')
    assert(dirEntries[0].isFile(), 'Dirent.isFile() is true')

    // 3. Low-level fd open/write/read/fstat/ftruncate/close (sync)
    const fdFile = path.join(baseDir, 'fd.bin')
    const fd = fs.openSync(fdFile, 'w+')
    try {
      const payload = new Uint8Array([65, 66, 67, 68, 69])
      const written = fs.writeSync(fd, payload, 0, payload.byteLength, 0)
      assertEqual(written, 5, 'writeSync writes 5 bytes')

      fs.ftruncateSync(fd, 3)
      const fst = fs.fstatSync(fd)
      assertEqual(fst.size, 3, 'ftruncateSync truncates file to 3 bytes')

      const out = new Uint8Array(3)
      const bytesRead = fs.readSync(fd, out, 0, 3, 0)
      assertEqual(bytesRead, 3, 'readSync reads 3 bytes')
      assertEqual(out[0], 65, 'first byte matches')
      assertEqual(out[1], 66, 'second byte matches')
      assertEqual(out[2], 67, 'third byte matches')
    } finally {
      fs.closeSync(fd)
    }

    // 4. Promise API & FileHandle (bare-fs/promises)
    assertEqual(fs.promises, fsp, 'fs.promises equals bare-fs/promises')
    const asyncFile = path.join(baseDir, 'async.txt')
    await fsp.writeFile(asyncFile, 'async payload')
    const asyncRead = await fsp.readFile(asyncFile, 'utf8')
    assertEqual(asyncRead, 'async payload', 'promises.readFile matches promises.writeFile')

    const handle = await fsp.open(asyncFile, 'r+')
    let closedEvent = false
    handle.on('close', () => {
      closedEvent = true
    })
    try {
      const hStat = await handle.stat()
      assertEqual(hStat.size, 13, 'FileHandle.stat() reports file size')
      const buf = new Uint8Array(5)
      const res = await handle.read(buf, 0, 5, 0)
      assertEqual(res.bytesRead, 5, 'FileHandle.read() returns bytesRead')
      assertEqual(String.fromCharCode(...buf), 'async', 'FileHandle.read() populates buffer')
    } finally {
      await handle.close()
    }
    assert(closedEvent, 'FileHandle emits close event')
    assertEqual(handle.fd, -1, 'FileHandle resets fd to -1 after close')

    // 5. Copy, rename, symlink, realpath, statfs
    const copiedFile = path.join(baseDir, 'copied.txt')
    await fsp.copyFile(asyncFile, copiedFile, constants.COPYFILE_EXCL)
    assertEqual(await fsp.readFile(copiedFile, 'utf8'), 'async payload', 'copyFile copies contents')

    const renamedFile = path.join(baseDir, 'renamed.txt')
    await fsp.rename(copiedFile, renamedFile)
    assert(!fs.existsSync(copiedFile), 'source gone after rename')
    assert(fs.existsSync(renamedFile), 'destination exists after rename')

    const linkPath = path.join(baseDir, 'link.txt')
    await fsp.symlink('renamed.txt', linkPath)
    const lst = await fsp.lstat(linkPath)
    assert(lst.isSymbolicLink(), 'lstat identifies symlink')
    assertEqual(await fsp.readlink(linkPath), 'renamed.txt', 'readlink returns symlink target')
    assertEqual(await fsp.realpath(linkPath), await fsp.realpath(renamedFile), 'realpath resolves symlink')

    const sfs = await fsp.statfs(baseDir)
    assert(sfs instanceof fs.StatFs, 'statfs returns StatFs instance')
    assert(sfs.bsize > 0, 'StatFs.bsize is positive')

    // 6. Streams: createWriteStream and createReadStream
    const streamFile = path.join(baseDir, 'stream.txt')
    await new Promise((resolve, reject) => {
      const ws = fs.createWriteStream(streamFile)
      ws.on('error', reject)
      ws.on('close', resolve)
      ws.write('stream-chunk-1|')
      ws.end('stream-chunk-2')
    })

    const streamed = await new Promise((resolve, reject) => {
      const chunks = []
      const rs = fs.createReadStream(streamFile)
      rs.on('error', reject)
      rs.on('data', (chunk) => chunks.push(chunk))
      rs.on('end', () => {
        const total = chunks.reduce((n, c) => n + c.byteLength, 0)
        const merged = new Uint8Array(total)
        let off = 0
        for (const c of chunks) {
          merged.set(c, off)
          off += c.byteLength
        }
        resolve(String.fromCharCode(...merged))
      })
    })
    assertEqual(streamed, 'stream-chunk-1|stream-chunk-2', 'createReadStream reads createWriteStream output')

    // 7. Error handling: ENOENT FileError and null-byte path rejection
    let enoentErr = null
    try {
      fs.statSync(path.join(baseDir, 'does-not-exist'))
    } catch (err) {
      enoentErr = err
    }
    assert(enoentErr !== null, 'statSync throws on missing path')
    assertEqual(enoentErr.name, 'FileError', 'missing path error is FileError')
    assertEqual(enoentErr.code, 'ENOENT', 'missing path error has code ENOENT')
    assertEqual(enoentErr.syscall, 'stat', 'FileError exposes syscall')

    let nullByteErr = null
    try {
      fs.statSync('invalid\0path')
    } catch (err) {
      nullByteErr = err
    }
    assert(nullByteErr instanceof TypeError, 'null byte in path throws TypeError')
  } finally {
    fs.rmSync(baseDir, { recursive: true, force: true })
  }

  console.log('bare-fs runtime contract passed')
}

main().catch((err) => {
  console.error(err)
  Bare.exit(1)
})
test/contract.mjs
import assert from 'node:assert/strict'
import { execFileSync } from 'node:child_process'
import { createRequire } from 'node:module'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const require = createRequire(import.meta.url)
const __dirname = path.dirname(fileURLToPath(import.meta.url))

const bareBin = path.resolve(__dirname, '..', 'node_modules', 'bare', 'bin', 'bare')
const contractScript = path.join(__dirname, 'bare-contract.cjs')

const output = execFileSync(process.execPath, [bareBin, contractScript], {
  encoding: 'utf8',
  stdio: ['ignore', 'pipe', 'pipe']
})

assert.ok(output.includes('bare-fs runtime contract passed'), 'bare-fs runtime contract must succeed')
console.log(output.trim())

Исходный сидер

аноним