CodeSampleX

샘플

bare-abort 2.0.13: abort

검증된 샘플 — npm bare-abort 2.0.13: abort. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: verifies package manifest declares bare-abort version…

sha256:376b99353a2df66985e2f0c8361c79bd4004ea2799234c03a0a519cc8928905e

이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다. 통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다. MIT-0

실행 증거

선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.

증거 기준
서명된 컨트랙트 통과
검증 영수증
1
빌드한 서명 키
1
선언된 환경 linux 24 · ubuntu · glibc 2.39 x64 npm

검증 실행 환경

환경 컨트랙트 단계 실행일
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5…
2026-08-27

케이스

HOW
목표
verify pkg:npm/bare-abort@2.0.13
패키지
심벌
  • abort
생성일
2026-08-27T13:14:37Z

컨트랙트

  1. verifies package manifest declares bare-abort version 2.0.13 with Apache-2.0 license and addon flag
  2. verifies package exports map root to index.d.ts types and index.js default, and ./package to package.json
  3. verifies TypeScript definitions declare abort function returning never
  4. verifies binding.js loads native addon via Bare runtime require.addon loader
  5. verifies native C binding implements bare_abort calling stdlib abort and exports via BARE_MODULE
  6. verifies CMakeLists.txt configures bare_abort C project and bare module with binding.c
  7. verifies multi-platform precompiled .bare binaries exist for linux, darwin, win32, android, and ios architectures
  8. verifies loading in standard Node.js identifies Bare runtime dependency requirement

파일

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • 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-abort@2.0.13
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/bare-abort@2.0.13
Demonstrate these symbols/APIs:
  - abort

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:366ec023a4bbc72a1353e59cd13a607121b90687e5bf08675fc0080bfc380a67","contract":["verifies package manifest declares bare-abort version 2.0.13 with Apache-2.0 license and addon flag","verifies package exports map root to index.d.ts types and index.js default, and ./package to package.json","verifies TypeScript definitions declare abort function returning never","verifies binding.js loads native addon via Bare runtime require.addon loader","verifies native C binding implements bare_abort calling stdlib abort and exports via BARE_MODULE","verifies CMakeLists.txt configures bare_abort C project and bare module with binding.c","verifies multi-platform precompiled .bare binaries exist for linux, darwin, win32, android, and ios architectures","verifies loading in standard Node.js identifies Bare runtime dependency requirement"],"goal":"verify pkg:npm/bare-abort@2.0.13","kind":"HOW","packages":["pkg:npm/bare-abort@2.0.13"],"schemaVersion":1,"symbols":["abort"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/bare-abort@2.0.13"],"schemaVersion":1,"subject":"pkg:npm/bare-abort@2.0.13","symbols":["abort"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-bare-abort",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-bare-abort",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "bare-abort": "2.0.13"
      }
    },
    "node_modules/bare-abort": {
      "version": "2.0.13",
      "resolved": "https://registry.npmjs.org/bare-abort/-/bare-abort-2.0.13.tgz",
      "integrity": "sha512-zdc8l88eB11Jsz5rDd6sCAgv2kUFXgdrZWoMlgU6JMkfAi1/uuGFC3IEHswKbIRQTk5H3T5CMuechsXYxiaHlQ==",
      "license": "Apache-2.0"
    }
  }
}
package.json
{
  "name": "sample-bare-abort",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "license": "MIT-0",
  "dependencies": {
    "bare-abort": "2.0.13"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/bare-abort@2.0.13",
  "kind": "HOW",
  "packages": [
    "pkg:npm/bare-abort@2.0.13"
  ],
  "symbols": [
    "abort"
  ]
}
test/contract.mjs
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import fs from 'node:fs';
import path from 'node:path';

const require = createRequire(import.meta.url);

// 1. Verify package manifest and exports
const pkgPath = require.resolve('bare-abort/package');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));

assert.equal(pkg.name, 'bare-abort');
assert.equal(pkg.version, '2.0.13');
assert.equal(pkg.license, 'Apache-2.0');
assert.equal(pkg.addon, true);

assert.ok(pkg.exports);
assert.equal(pkg.exports['.'].types, './index.d.ts');
assert.equal(pkg.exports['.'].default, './index.js');
assert.equal(pkg.exports['./package'], './package.json');

const pkgDir = path.dirname(pkgPath);

// 2. Verify TypeScript declaration
const dts = fs.readFileSync(path.join(pkgDir, 'index.d.ts'), 'utf8');
assert.match(dts, /declare\s+function\s+abort\(\)\s*:\s*never/);
assert.match(dts, /export\s*=\s*abort/);

// 3. Verify module loader and binding wrapper
const indexJs = fs.readFileSync(path.join(pkgDir, 'index.js'), 'utf8');
assert.match(indexJs, /require\(['"]\.\/binding['"]\)/);
assert.match(indexJs, /module\.exports\s*=\s*binding\.abort/);

const bindingJs = fs.readFileSync(path.join(pkgDir, 'binding.js'), 'utf8');
assert.match(bindingJs, /require\.addon\(\)/);

// 4. Verify C native module and build configuration
const bindingC = fs.readFileSync(path.join(pkgDir, 'binding.c'), 'utf8');
assert.ok(bindingC.includes('#include <bare.h>'));
assert.ok(bindingC.includes('#include <js.h>'));
assert.ok(bindingC.includes('#include <stdlib.h>'));
assert.ok(bindingC.includes('abort();'));
assert.ok(bindingC.includes('BARE_MODULE(bare_abort, bare_abort_exports)'));

const cmake = fs.readFileSync(path.join(pkgDir, 'CMakeLists.txt'), 'utf8');
assert.ok(cmake.includes('project(bare_abort C)'));
assert.ok(cmake.includes('add_bare_module(bare_abort)'));
assert.ok(cmake.includes('binding.c'));

// 5. Verify multi-platform prebuilds
const prebuildsDir = path.join(pkgDir, 'prebuilds');
const architectures = [
  'linux-x64',
  'linux-arm64',
  'darwin-x64',
  'darwin-arm64',
  'win32-x64',
  'win32-arm64',
  'android-x64',
  'android-arm64',
  'android-arm',
  'android-ia32',
  'ios-arm64',
  'ios-arm64-simulator',
  'ios-x64-simulator'
];

for (const arch of architectures) {
  const binaryFile = path.join(prebuildsDir, arch, 'bare-abort.bare');
  assert.ok(fs.existsSync(binaryFile), `Missing prebuild binary for ${arch}`);
  const stats = fs.statSync(binaryFile);
  assert.ok(stats.size > 0, `Prebuild binary for ${arch} is empty`);
}

// 6. Verify runtime requirement in Node.js environment
assert.throws(
  () => {
    require('bare-abort');
  },
  (err) => {
    return err instanceof TypeError && /require\.addon/.test(err.message);
  },
  'Should fail in Node.js because require.addon is a Bare runtime extension'
);

console.log('All bare-abort contract verifications passed.');

오리진 시더

익명