CodeSampleX

Beispiel

globals 14.0.0: commonjs

Verifiziertes Beispiel für npm globals 14.0.0: commonjs. Der Vertrag lief auf node 22 · linux debian/x64 · docker und bestand.

sha256:8c6fb0720e47f069db5425edbb1328afe09104e0fc4010256d63a3c45cb15663

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 node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
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-09-05

Fall

HOW
Ziel
verify globals.commonjs in pkg:npm/globals@14.0.0
Pakete
Symbole
  • globals.commonjs
Umgebung
node 22.23.2
Erstellt
2026-09-05T23:21:33Z

Contract

  1. globals.commonjs is an object mapping CommonJS global identifiers to boolean writeability flags
  2. globals.commonjs defines exports as writable (true)
  3. globals.commonjs defines module, require, and global as non-writable (false)
  4. globals.commonjs contains exactly four identifier definitions: exports, module, require, and global
  5. globals.commonjs properties are strictly boolean values

Dateien

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

Quellartefakt herunterladen (tar.gz)

Quelltext

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 globals.commonjs in pkg:npm/globals@14.0.0
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/globals@14.0.0
Demonstrate these symbols/APIs:
  - globals.commonjs

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:9f7a372fdef2448dac978164cfb1f073bef54a342a3de7fd1b36fe1f2f30afe3","contract":["globals.commonjs is an object mapping CommonJS global identifiers to boolean writeability flags","globals.commonjs defines exports as writable (true)","globals.commonjs defines module, require, and global as non-writable (false)","globals.commonjs contains exactly four identifier definitions: exports, module, require, and global","globals.commonjs properties are strictly boolean values"],"goal":"verify globals.commonjs in pkg:npm/globals@14.0.0","kind":"HOW","packages":["pkg:npm/globals@14.0.0"],"schemaVersion":1,"symbols":["globals.commonjs"]},"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/globals@14.0.0"],"schemaVersion":1,"subject":"pkg:npm/globals@14.0.0","symbols":["globals.commonjs"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-globals-commonjs",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-globals-commonjs",
      "version": "1.0.0",
      "dependencies": {
        "globals": "14.0.0"
      }
    },
    "node_modules/globals": {
      "version": "14.0.0",
      "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
      "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
      "license": "MIT",
      "engines": {
        "node": ">=18"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    }
  }
}
package.json
{
  "name": "sample-globals-commonjs",
  "version": "1.0.0",
  "private": true,
  "description": "verify globals.commonjs in pkg:npm/globals@14.0.0",
  "dependencies": {
    "globals": "14.0.0"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify globals.commonjs in pkg:npm/globals@14.0.0",
  "kind": "HOW",
  "packages": [
    "pkg:npm/globals@14.0.0"
  ],
  "symbols": [
    "globals.commonjs"
  ]
}
test/contract.cjs
'use strict';

const assert = require('node:assert/strict');
const globals = require('globals');

// 1. globals.commonjs is an object mapping CommonJS global identifiers to boolean writeability flags
assert.equal(typeof globals.commonjs, 'object', 'globals.commonjs should be an object');
assert.ok(globals.commonjs !== null, 'globals.commonjs should not be null');

// 2. globals.commonjs defines exports as writable (true)
assert.strictEqual(globals.commonjs.exports, true, 'globals.commonjs.exports should be true');

// 3. globals.commonjs defines module, require, and global as non-writable (false)
assert.strictEqual(globals.commonjs.module, false, 'globals.commonjs.module should be false');
assert.strictEqual(globals.commonjs.require, false, 'globals.commonjs.require should be false');
assert.strictEqual(globals.commonjs.global, false, 'globals.commonjs.global should be false');

// 4. globals.commonjs contains exactly four identifier definitions: exports, module, require, and global
const keys = Object.keys(globals.commonjs).sort();
assert.deepStrictEqual(keys, ['exports', 'global', 'module', 'require'], 'globals.commonjs keys mismatch');

// 5. globals.commonjs properties are strictly boolean values
for (const key of keys) {
  assert.strictEqual(typeof globals.commonjs[key], 'boolean', `globals.commonjs.${key} must be a boolean`);
}

console.log('Contract test passed.');

Ursprungs-Seeder

anonym