Beispiel
bare-abort 2.0.13: abort
Verifiziertes Beispiel für npm bare-abort 2.0.13: abort. Der Vertrag lief auf node 22 · linux alpine/x64 · docker und bestand.
sha256:f166bc67b04568586a23edeb52aed7658f4aeb048188a921dc4248876273ccab
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
linux 24 · ubuntu · glibc 2.39 x64 npm
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| 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-26 |
Fall
HOW- Ziel
- verify pkg:npm/bare-abort@2.0.13
- Pakete
- Symbole
-
- abort
- Erstellt
- 2026-08-26T13:56:10Z
Contract
- package manifest specifies Bare native addon configuration, Apache-2.0 license, and exports for root and package subpaths
- declares abort function with never return type in TypeScript definition index.d.ts
- implements binding loader via require.addon and re-exports binding.abort in index.js
- implements native Bare module binding bare_abort calling C abort() in binding.c with CMakeLists.txt build definition
- provides multi-platform precompiled .bare addon binaries including linux-x64, linux-arm64, darwin, ios, android, and win32 targets
Dateien
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Quelltext
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.
{"case":{"caseId":"case:sha256:504b3028fe09412e5bb3be4fb64de9949ca8dad187ec49b00e2318b9fdc95c54","contract":["package manifest specifies Bare native addon configuration, Apache-2.0 license, and exports for root and package subpaths","declares abort function with never return type in TypeScript definition index.d.ts","implements binding loader via require.addon and re-exports binding.abort in index.js","implements native Bare module binding bare_abort calling C abort() in binding.c with CMakeLists.txt build definition","provides multi-platform precompiled .bare addon binaries including linux-x64, linux-arm64, darwin, ios, android, and win32 targets"],"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"}
{
"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"
}
}
}
{
"name": "sample-bare-abort",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"bare-abort": "2.0.13"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/bare-abort@2.0.13",
"kind": "HOW",
"packages": [
"pkg:npm/bare-abort@2.0.13"
],
"symbols": [
"abort"
]
}
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. Resolve bare-abort package manifest and verify exports and metadata
const pkgPath = require.resolve('bare-abort/package');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, 'bare-abort', 'Package name must be bare-abort');
assert.equal(pkg.version, '2.0.13', 'Package version must be 2.0.13');
assert.equal(pkg.license, 'Apache-2.0', 'Package license must be Apache-2.0');
assert.equal(pkg.addon, true, 'Package must be marked as addon');
assert.ok(pkg.exports, 'Package must define exports');
assert.equal(pkg.exports['.'].types, './index.d.ts', 'Root export must specify ./index.d.ts types');
assert.equal(pkg.exports['.'].default, './index.js', 'Root export must specify ./index.js default');
assert.equal(pkg.exports['./package'], './package.json', 'Package export must point to ./package.json');
assert.deepEqual(
pkg.files,
['index.js', 'index.d.ts', 'binding.c', 'binding.js', 'CMakeLists.txt', 'prebuilds'],
'Package files array must contain expected source and build files'
);
const pkgDir = path.dirname(pkgPath);
// 2. Verify TypeScript declarations (index.d.ts)
const indexDtsPath = path.join(pkgDir, 'index.d.ts');
assert.ok(fs.existsSync(indexDtsPath), 'index.d.ts must exist');
const indexDts = fs.readFileSync(indexDtsPath, 'utf8');
assert.ok(indexDts.includes('declare function abort(): never'), 'index.d.ts must declare abort function returning never');
assert.ok(indexDts.includes('export = abort'), 'index.d.ts must export abort function');
// 3. Verify JavaScript module files (index.js and binding.js)
const indexJsPath = path.join(pkgDir, 'index.js');
assert.ok(fs.existsSync(indexJsPath), 'index.js must exist');
const indexJs = fs.readFileSync(indexJsPath, 'utf8');
assert.ok(indexJs.includes("require('./binding')"), 'index.js must require binding');
assert.ok(indexJs.includes('module.exports = binding.abort'), 'index.js must export binding.abort');
const bindingJsPath = path.join(pkgDir, 'binding.js');
assert.ok(fs.existsSync(bindingJsPath), 'binding.js must exist');
const bindingJs = fs.readFileSync(bindingJsPath, 'utf8');
assert.ok(bindingJs.includes('require.addon()'), 'binding.js must invoke require.addon()');
// 4. Verify C native addon source and build configuration
const bindingCPath = path.join(pkgDir, 'binding.c');
assert.ok(fs.existsSync(bindingCPath), 'binding.c must exist');
const bindingC = fs.readFileSync(bindingCPath, 'utf8');
assert.ok(bindingC.includes('#include <bare.h>'), 'binding.c must include <bare.h>');
assert.ok(bindingC.includes('#include <js.h>'), 'binding.c must include <js.h>');
assert.ok(bindingC.includes('#include <stdlib.h>'), 'binding.c must include <stdlib.h>');
assert.ok(bindingC.includes('abort();'), 'binding.c must invoke standard abort()');
assert.ok(bindingC.includes('BARE_MODULE(bare_abort, bare_abort_exports)'), 'binding.c must define BARE_MODULE');
const cmakePath = path.join(pkgDir, 'CMakeLists.txt');
assert.ok(fs.existsSync(cmakePath), 'CMakeLists.txt must exist');
const cmake = fs.readFileSync(cmakePath, 'utf8');
assert.ok(cmake.includes('project(bare_abort C)'), 'CMakeLists.txt must define project bare_abort');
assert.ok(cmake.includes('add_bare_module(bare_abort)'), 'CMakeLists.txt must declare bare module');
assert.ok(cmake.includes('binding.c'), 'CMakeLists.txt must include binding.c');
// 5. Verify prebuilt native binaries across architectures
const prebuildsDir = path.join(pkgDir, 'prebuilds');
assert.ok(fs.existsSync(prebuildsDir), 'prebuilds directory must exist');
const expectedTargets = [
'android-arm',
'android-arm64',
'android-ia32',
'android-x64',
'darwin-arm64',
'darwin-x64',
'ios-arm64-simulator',
'ios-arm64',
'ios-x64-simulator',
'linux-arm64',
'linux-x64',
'win32-arm64',
'win32-x64'
];
for (const target of expectedTargets) {
const binaryPath = path.join(prebuildsDir, target, 'bare-abort.bare');
assert.ok(fs.existsSync(binaryPath), `Prebuild binary must exist for target: ${target}`);
const stat = fs.statSync(binaryPath);
assert.ok(stat.size > 0, `Prebuild binary for ${target} must not be empty`);
}
const linuxX64Binary = fs.readFileSync(path.join(prebuildsDir, 'linux-x64', 'bare-abort.bare'));
assert.ok(linuxX64Binary.length > 1000, 'linux-x64 prebuild binary size must exceed 1000 bytes');
console.log('Contract tests passed successfully.');
Ursprungs-Seeder
anonym