CodeSampleX

Ejemplo

globals 15.15.0: browser

Muestra verificada para npm globals 15.15.0: browser. El contrato se ejecutó en node 22 · linux debian/x64 · docker y pasó: globals.browser exports a…

sha256:8d11701593418ecc260f341f46e882992e5388c839ce88828b4e7d666a8132f2

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
1
Claves de firma que lo compilaron
1
Entorno declarado linux 24 · ubuntu · glibc 2.39 x64 npm

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
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-03

Caso

HOW
Objetivo
verify globals.browser in pkg:npm/globals@15.15.0
Paquetes
Símbolos
  • globals.browser
Creado
2026-09-03T16:02:08Z

Contrato

  1. globals.browser exports a dictionary containing over 1000 browser global identifiers
  2. globals.browser marks read-only browser APIs including window, document, navigator, fetch, and alert as false
  3. globals.browser marks mutable browser navigation and event handler properties such as location, onload, and onclick as true
  4. globals.browser includes standard modern Web API constructors such as WebSocket, Worker, and Event mapped to false
  5. globals.browser ensures every value in the dictionary is strictly of boolean type

Archivos

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

Descargar el artefacto de código fuente (tar.gz)

Código fuente

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

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

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:ca34125131ed73d72afa42e900a68d02bb1561ade53e71b6ac0df043f72c33c7","contract":["globals.browser exports a dictionary containing over 1000 browser global identifiers","globals.browser marks read-only browser APIs including window, document, navigator, fetch, and alert as false","globals.browser marks mutable browser navigation and event handler properties such as location, onload, and onclick as true","globals.browser includes standard modern Web API constructors such as WebSocket, Worker, and Event mapped to false","globals.browser ensures every value in the dictionary is strictly of boolean type"],"goal":"verify globals.browser in pkg:npm/globals@15.15.0","kind":"HOW","packages":["pkg:npm/globals@15.15.0"],"schemaVersion":1,"symbols":["globals.browser"]},"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/globals@15.15.0"],"schemaVersion":1,"subject":"pkg:npm/globals@15.15.0","symbols":["globals.browser"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-globals-browser",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-globals-browser",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "globals": "15.15.0"
      }
    },
    "node_modules/globals": {
      "version": "15.15.0",
      "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz",
      "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==",
      "license": "MIT",
      "engines": {
        "node": ">=18"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    }
  }
}
package.json
{
  "name": "sample-globals-browser",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification of globals.browser",
  "license": "MIT-0",
  "dependencies": {
    "globals": "15.15.0"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify globals.browser in pkg:npm/globals@15.15.0",
  "kind": "HOW",
  "packages": [
    "pkg:npm/globals@15.15.0"
  ],
  "symbols": [
    "globals.browser"
  ]
}
test/contract.mjs
import assert from 'node:assert/strict';
import globals from 'globals';

// 1. globals.browser exports a dictionary containing over 1000 browser global identifiers
assert.equal(typeof globals.browser, 'object', 'globals.browser should be an object');
assert.ok(globals.browser !== null, 'globals.browser should not be null');
assert.ok(Object.keys(globals.browser).length > 1000, 'globals.browser should contain over 1000 entries');

// 2. globals.browser marks read-only browser APIs including window, document, navigator, fetch, and alert as false
assert.equal(globals.browser.window, false, 'globals.browser.window should be false');
assert.equal(globals.browser.document, false, 'globals.browser.document should be false');
assert.equal(globals.browser.navigator, false, 'globals.browser.navigator should be false');
assert.equal(globals.browser.fetch, false, 'globals.browser.fetch should be false');
assert.equal(globals.browser.alert, false, 'globals.browser.alert should be false');
assert.equal(globals.browser.console, false, 'globals.browser.console should be false');
assert.equal(globals.browser.localStorage, false, 'globals.browser.localStorage should be false');
assert.equal(globals.browser.sessionStorage, false, 'globals.browser.sessionStorage should be false');

// 3. globals.browser marks mutable browser navigation and event handler properties such as location, onload, and onclick as true
assert.equal(globals.browser.location, true, 'globals.browser.location should be true');
assert.equal(globals.browser.onload, true, 'globals.browser.onload should be true');
assert.equal(globals.browser.onclick, true, 'globals.browser.onclick should be true');
assert.equal(globals.browser.onerror, true, 'globals.browser.onerror should be true');
assert.equal(globals.browser.onmessage, true, 'globals.browser.onmessage should be true');

// 4. globals.browser includes standard modern Web API constructors such as WebSocket, Worker, and Event mapped to false
assert.equal(globals.browser.WebSocket, false, 'globals.browser.WebSocket should be false');
assert.equal(globals.browser.Worker, false, 'globals.browser.Worker should be false');
assert.equal(globals.browser.Event, false, 'globals.browser.Event should be false');
assert.equal(globals.browser.CustomEvent, false, 'globals.browser.CustomEvent should be false');
assert.equal(globals.browser.MutationObserver, false, 'globals.browser.MutationObserver should be false');
assert.equal(globals.browser.IntersectionObserver, false, 'globals.browser.IntersectionObserver should be false');
assert.equal(globals.browser.AbortController, false, 'globals.browser.AbortController should be false');

// 5. globals.browser ensures every value in the dictionary is strictly of boolean type
for (const [name, writable] of Object.entries(globals.browser)) {
  assert.equal(typeof writable, 'boolean', `globals.browser.${name} value should be a boolean`);
}

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

Seeder de origen

anónimo