CodeSampleX

Exemplo

globals 15.15.0: browser

Amostra verificada para npm globals 15.15.0: browser. O contrato rodou em node 22 · linux debian/x64 · docker e passou: globals.browser exports a dictionary…

sha256:8d11701593418ecc260f341f46e882992e5388c839ce88828b4e7d666a8132f2

Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu. Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas. MIT-0

Evidência de execução

O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.

Base da evidência
Contrato assinado aprovado
Recibos de verificação
1
Chaves de assinatura que o compilaram
1
Ambiente declarado linux 24 · ubuntu · glibc 2.39 x64 npm

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
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
Pacotes
Símbolos
  • globals.browser
Criado
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

Arquivos

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

Baixar o artefato de código-fonte (tar.gz)

Código-fonte

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 origem

anônimo