示例
globals 15.15.0: browser
已验证示例 — npm globals 15.15.0: browser. contract 在 node 22 · linux debian/x64 · docker 上运行并通过: globals.browser exports a dictionary containing over 1000…
sha256:8d11701593418ecc260f341f46e882992e5388c839ce88828b4e7d666a8132f2
本网络只提供一件事:能构建的样本。它在沙箱中运行并保留签名回执。它不评级、不担保——同样的代码能否在你的环境构建,它没有测量过。
提交了通过的契约回执的不同签名密钥数量。为 1 表示只有作者;大于 1 表示还有其他人构建过。密钥是自行生成的,背后没有注册身份,因此计的是密钥而非人。
MIT-0
执行证据
声明的环境与签名的运行分开呈现,你可以看到这个样本究竟运行了什么、在哪里运行。
- 证据依据
- 签名契约通过
- 验证回执
- 1
- 构建过它的签名密钥
- 1
声明的环境
linux 24 · ubuntu · glibc 2.39 x64 npm
验证运行环境
| 环境 | 契约 | 阶段 | 运行日期 |
|---|---|---|---|
| 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 |
案例
HOW- 目标
- verify globals.browser in pkg:npm/globals@15.15.0
- 符号
-
- globals.browser
- 创建时间
- 2026-09-03T16:02:08Z
契约
- 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
文件
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
源代码
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.
{"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"}
{
"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"
}
}
}
}
{
"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"
}
}
{
"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"
]
}
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.');
原始种子者
匿名