CodeSampleX

サンプル

@esbuild/linux-s390x 0.28.2

検証済みサンプル — npm @esbuild/linux-s390x 0.28.2. node 22 · linux alpine/x64 · docker で contract を実行し、成功しました: assert package resolution locates…

sha256:d641f155218e6f1b8fa2dedca03519ae7564745bbb49e8c49540cad003fae37f

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
1
ビルドした署名鍵
1
宣言された環境 node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

検証実行環境

環境 コントラクト ステージ 実行日
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-21

ケース

HOW
ゴール
verify pkg:npm/%40esbuild/linux-s390x@0.28.2
パッケージ
環境
node 22.23.2
作成日
2026-08-21T13:40:54Z

コントラクト

  1. assert package resolution locates @esbuild/linux-s390x manifest and binary
  2. assert package manifest specifies os linux, cpu s390x, and node >= 18
  3. assert binary header contains 64-bit big-endian ELF magic and EM_S390 architecture code 22
  4. assert executing s390x native binary on mismatched host fails

ファイル

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

ソースアーティファクトをダウンロード (tar.gz)

ソース

.npmrc
force = true
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/%40esbuild/linux-s390x@0.28.2
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40esbuild/linux-s390x@0.28.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:cb6898f61df7044da41941984182a732b71eafe5da0989c839d840cc414cc5ed","contract":["assert package resolution locates @esbuild/linux-s390x manifest and binary","assert package manifest specifies os linux, cpu s390x, and node \u003e= 18","assert binary header contains 64-bit big-endian ELF magic and EM_S390 architecture code 22","assert executing s390x native binary on mismatched host fails"],"goal":"verify pkg:npm/%40esbuild/linux-s390x@0.28.2","kind":"HOW","packages":["pkg:npm/%40esbuild/linux-s390x@0.28.2"],"schemaVersion":1},"contractCommand":["node","test/contract.cjs"],"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/%40esbuild/linux-s390x@0.28.2"],"schemaVersion":1,"subject":"pkg:npm/%40esbuild/linux-s390x@0.28.2","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-esbuild-linux-s390x",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-esbuild-linux-s390x",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "@esbuild/linux-s390x": "0.28.2"
      }
    },
    "node_modules/@esbuild/linux-s390x": {
      "version": "0.28.2",
      "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",
      "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",
      "cpu": [
        "s390x"
      ],
      "license": "MIT",
      "os": [
        "linux"
      ],
      "engines": {
        "node": ">=18"
      }
    }
  }
}
package.json
{
  "name": "sample-esbuild-linux-s390x",
  "version": "1.0.0",
  "private": true,
  "license": "MIT-0",
  "dependencies": {
    "@esbuild/linux-s390x": "0.28.2"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40esbuild/linux-s390x@0.28.2",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40esbuild/linux-s390x@0.28.2"
  ]
}
test/contract.cjs
const assert = require("node:assert");
const fs = require("node:fs");
const path = require("node:path");
const cp = require("node:child_process");

// 1. Assert package resolution locates @esbuild/linux-s390x manifest and binary
const pkgJsonPath = require.resolve("@esbuild/linux-s390x/package.json");
const pkgDir = path.dirname(pkgJsonPath);
const binPath = path.join(pkgDir, "bin", "esbuild");

assert(fs.existsSync(binPath), "bin/esbuild binary exists");
const stat = fs.statSync(binPath);
assert((stat.mode & 0o111) !== 0, "bin/esbuild is marked executable");

// 2. Assert package manifest specifies os linux, cpu s390x, and node >= 18
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf8"));
assert.strictEqual(pkgJson.name, "@esbuild/linux-s390x");
assert.strictEqual(pkgJson.version, "0.28.2");
assert.deepStrictEqual(pkgJson.os, ["linux"]);
assert.deepStrictEqual(pkgJson.cpu, ["s390x"]);
assert.strictEqual(pkgJson.preferUnplugged, true);
assert.strictEqual(pkgJson.engines.node, ">=18");

// 3. Assert binary header contains 64-bit big-endian ELF magic and EM_S390 architecture code 22
const fd = fs.openSync(binPath, "r");
const header = Buffer.alloc(20);
fs.readSync(fd, header, 0, 20, 0);
fs.closeSync(fd);

// ELF Magic: 0x7f, "E", "L", "F"
assert.strictEqual(header[0], 0x7f, "ELF magic byte 0");
assert.strictEqual(header[1], 0x45, "ELF magic byte 1 ('E')");
assert.strictEqual(header[2], 0x4c, "ELF magic byte 2 ('L')");
assert.strictEqual(header[3], 0x46, "ELF magic byte 3 ('F')");

// ELF Class: 2 = 64-bit
assert.strictEqual(header[4], 2, "ELF class is 64-bit (ELFCLASS64)");

// ELF Data: 2 = Big-endian
assert.strictEqual(header[5], 2, "ELF data encoding is 2's complement, big endian");

// ELF Machine: 22 = EM_S390
const eMachine = header.readUInt16BE(18);
assert.strictEqual(eMachine, 22, "ELF machine is EM_S390");

// 4. Assert executing s390x native binary on mismatched host fails
if (process.arch !== "s390x" || process.platform !== "linux") {
  const res = cp.spawnSync(binPath, ["--version"]);
  assert(
    res.status !== 0 || res.error !== undefined,
    "executing s390x binary on mismatched host fails with non-zero exit code or spawn error"
  );
}

オリジンシーダー

匿名