샘플
picocolors 1.1.1
검증된 샘플 — npm picocolors 1.1.1. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: createColors(true).red formats text with red ANSI escape codes
sha256:ac0bc21fcbbee9deeb1a9c89089a71ab23dd2007cd9cbc66c47f5be93e932ec1
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 2
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-23 |
| 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-08 |
케이스
HOW- 목표
- verify pkg:npm/picocolors@1.1.1
- 패키지
- 생성일
- 2026-08-23T06:41:57Z
컨트랙트
- createColors(true).red formats text with red ANSI escape codes
- createColors(true).green formats text with green ANSI escape codes
- createColors(true).bold formats text with bold ANSI escape codes
- createColors(true).bgBlue formats text with blue background ANSI escape codes
- createColors(false) disables color formatting and returns input unchanged
파일
- PROMPT.md
- csx.json
- index.mjs
- 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 pkg:npm/picocolors@1.1.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/picocolors@1.1.1
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:53d714c534c9d567fa2246b74d4244d81338020d7b2d6c716560228e596d8c07","contract":["createColors(true).red formats text with red ANSI escape codes","createColors(true).green formats text with green ANSI escape codes","createColors(true).bold formats text with bold ANSI escape codes","createColors(true).bgBlue formats text with blue background ANSI escape codes","createColors(false) disables color formatting and returns input unchanged"],"goal":"verify pkg:npm/picocolors@1.1.1","kind":"HOW","packages":["pkg:npm/picocolors@1.1.1"],"schemaVersion":1},"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/picocolors@1.1.1"],"schemaVersion":1,"subject":"pkg:npm/picocolors@1.1.1","verifierAdapter":"node-typescript@1"}
import pc from "picocolors";
export function formatMessage(level, message) {
const colors = pc.createColors(true);
switch (level) {
case "error":
return colors.red(`[ERROR] ${message}`);
case "warn":
return colors.yellow(`[WARN] ${message}`);
case "info":
return colors.cyan(`[INFO] ${message}`);
default:
return colors.green(`[OK] ${message}`);
}
}
export function formatHeading(title) {
const colors = pc.createColors(true);
return colors.bold(colors.underline(title));
}
{
"name": "sample-picocolors",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-picocolors",
"version": "1.0.0",
"dependencies": {
"picocolors": "1.1.1"
}
},
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"license": "ISC"
}
}
}
{
"name": "sample-picocolors",
"version": "1.0.0",
"private": true,
"type": "module",
"dependencies": {
"picocolors": "1.1.1"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/picocolors@1.1.1",
"kind": "HOW",
"packages": [
"pkg:npm/picocolors@1.1.1"
]
}
import assert from "node:assert/strict";
import pc from "picocolors";
// 1. Verify forced color formatting with createColors(true)
const colors = pc.createColors(true);
assert.equal(colors.isColorSupported, true, "isColorSupported should be true when enabled");
// Color functions produce expected ANSI escape sequences
assert.equal(colors.red("error"), "\x1b[31merror\x1b[39m");
assert.equal(colors.green("ok"), "\x1b[32mok\x1b[39m");
assert.equal(colors.yellow("warning"), "\x1b[33mwarning\x1b[39m");
assert.equal(colors.blue("info"), "\x1b[34minfo\x1b[39m");
assert.equal(colors.magenta("highlight"), "\x1b[35mhighlight\x1b[39m");
assert.equal(colors.cyan("link"), "\x1b[36mlink\x1b[39m");
assert.equal(colors.white("text"), "\x1b[37mtext\x1b[39m");
assert.equal(colors.gray("dimmed"), "\x1b[90mdimmed\x1b[39m");
// Modifiers
assert.equal(colors.bold("bold text"), "\x1b[1mbold text\x1b[22m");
assert.equal(colors.dim("dim text"), "\x1b[2mdim text\x1b[22m");
assert.equal(colors.italic("italic text"), "\x1b[3mitalic text\x1b[23m");
assert.equal(colors.underline("underlined"), "\x1b[4munderlined\x1b[24m");
assert.equal(colors.inverse("inverted"), "\x1b[7minverted\x1b[27m");
assert.equal(colors.strikethrough("strike"), "\x1b[9mstrike\x1b[29m");
assert.equal(colors.reset("reset"), "\x1b[0mreset\x1b[0m");
// Background colors
assert.equal(colors.bgBlack("black"), "\x1b[40mblack\x1b[49m");
assert.equal(colors.bgRed("red"), "\x1b[41mred\x1b[49m");
assert.equal(colors.bgGreen("green"), "\x1b[42mgreen\x1b[49m");
assert.equal(colors.bgYellow("yellow"), "\x1b[43myellow\x1b[49m");
assert.equal(colors.bgBlue("blue"), "\x1b[44mblue\x1b[49m");
assert.equal(colors.bgMagenta("magenta"), "\x1b[45mmagenta\x1b[49m");
assert.equal(colors.bgCyan("cyan"), "\x1b[46mcyan\x1b[49m");
assert.equal(colors.bgWhite("white"), "\x1b[47mwhite\x1b[49m");
// 2. Verify disabled color mode with createColors(false)
const disabled = pc.createColors(false);
assert.equal(disabled.isColorSupported, false, "isColorSupported should be false when disabled");
assert.equal(disabled.red("error"), "error");
assert.equal(disabled.green("ok"), "ok");
assert.equal(disabled.bold("bold text"), "bold text");
assert.equal(disabled.bgBlue("blue"), "blue");
// 3. Verify function nesting
assert.equal(colors.bold(colors.red("alert")), "\x1b[1m\x1b[31malert\x1b[39m\x1b[22m");
console.log("All contract tests passed successfully.");
오리진 시더
익명