샘플
bare-path 3.1.1: resolve
검증된 샘플 — npm bare-path 3.1.1: resolve. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: bare-path exports resolve function directly and via…
sha256:5d8194f07c7f92a55972ea610019005234b4c0bdb579867a8c0d3e0df18bae8f
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-27 |
케이스
HOW- 목표
- verify bare-path.resolve in pkg:npm/bare-path@3.1.1
- 패키지
- 심벌
-
- bare-path.resolve
- 환경
- node 22.23.2
- 생성일
- 2026-08-27T16:13:55Z
컨트랙트
- bare-path exports resolve function directly and via posix/win32 sub-namespaces
- resolve resolves absolute and relative path segments into a normalized absolute path
- resolve defaults to current working directory when given relative paths or no arguments
- resolve ignores empty path segments and normalizes dot and dot-dot segments correctly
- resolve validates argument types and throws TypeError when non-string arguments are provided
파일
- PROMPT.md
- csx.json
- index.js
- 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 bare-path.resolve in pkg:npm/bare-path@3.1.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/bare-path@3.1.1
Demonstrate these symbols/APIs:
- bare-path.resolve
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
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:d14e1baf8d2bf1606e2a62474d50739b2163fea2eb9603400c7d43891558a244","constraints":{"executionContext":"node"},"contract":["bare-path exports resolve function directly and via posix/win32 sub-namespaces","resolve resolves absolute and relative path segments into a normalized absolute path","resolve defaults to current working directory when given relative paths or no arguments","resolve ignores empty path segments and normalizes dot and dot-dot segments correctly","resolve validates argument types and throws TypeError when non-string arguments are provided"],"goal":"verify bare-path.resolve in pkg:npm/bare-path@3.1.1","kind":"HOW","packages":["pkg:npm/bare-path@3.1.1"],"schemaVersion":1,"symbols":["bare-path.resolve"]},"contractCommand":["node","test/contract.mjs"],"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/bare-path@3.1.1"],"schemaVersion":1,"subject":"pkg:npm/bare-path@3.1.1","symbols":["bare-path.resolve"],"verifierAdapter":"node-typescript@1"}
import { createRequire } from 'node:module';
import path from 'node:path';
const require = createRequire(import.meta.url);
// Ensure native binding is provided in Node.js environments where Bare runtime is absent
if (typeof Bare === 'undefined') {
globalThis.Bare = {
platform: process.platform
};
const mainPath = require.resolve('bare-path');
const bindingPath = path.join(path.dirname(mainPath), 'binding.js');
require.cache[bindingPath] = {
id: bindingPath,
filename: bindingPath,
loaded: true,
exports: {
cwd() {
return process.cwd();
}
}
};
}
const barePath = require('bare-path');
/**
* Resolves a sequence of paths or path segments into an absolute path using bare-path.
* @param {...string} paths
* @returns {string}
*/
export function resolvePath(...paths) {
return barePath.resolve(...paths);
}
/**
* Resolves path segments specifically using bare-path posix resolver.
* @param {...string} paths
* @returns {string}
*/
export function resolvePosixPath(...paths) {
return barePath.posix.resolve(...paths);
}
export default barePath;
{
"name": "sample-bare-path-resolve",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-bare-path-resolve",
"version": "1.0.0",
"dependencies": {
"bare-path": "3.1.1"
}
},
"node_modules/bare-path": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.1.1.tgz",
"integrity": "sha512-JprUlveX3QjApC1cTpsUOiscADftCGVWkzitbHsRqv84hzYwYHw2mbluddsq5TvI8mH/8Ov1f4BiMAdcB0oYnQ==",
"license": "Apache-2.0"
}
}
}
{
"name": "sample-bare-path-resolve",
"version": "1.0.0",
"type": "module",
"private": true,
"dependencies": {
"bare-path": "3.1.1"
}
}
{
"schemaVersion": 1,
"goal": "verify bare-path.resolve in pkg:npm/bare-path@3.1.1",
"kind": "HOW",
"packages": [
"pkg:npm/bare-path@3.1.1"
],
"symbols": [
"bare-path.resolve"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
import assert from 'node:assert/strict';
import path from 'node:path';
import barePath, { resolvePath, resolvePosixPath } from '../index.js';
// 1. bare-path exports resolve function directly and via posix/win32 sub-namespaces
assert.strictEqual(typeof barePath.resolve, 'function', 'barePath.resolve must be a function');
assert.strictEqual(typeof barePath.posix.resolve, 'function', 'barePath.posix.resolve must be a function');
assert.strictEqual(typeof barePath.win32.resolve, 'function', 'barePath.win32.resolve must be a function');
assert.strictEqual(typeof resolvePath, 'function', 'resolvePath helper must be a function');
assert.strictEqual(typeof resolvePosixPath, 'function', 'resolvePosixPath helper must be a function');
// 2. resolve resolves absolute and relative path segments into a normalized absolute path
const posixAbs = barePath.posix.resolve('/a/b', 'c', 'd');
assert.strictEqual(posixAbs, '/a/b/c/d', 'posix.resolve must resolve segments into an absolute path');
const helperResolved = resolvePosixPath('/foo/bar', '../baz');
assert.strictEqual(helperResolved, '/foo/baz', 'resolvePosixPath helper must resolve relative path segments');
// 3. resolve defaults to current working directory when given relative paths or no arguments
const defaultCwd = barePath.posix.resolve();
assert.strictEqual(defaultCwd, process.cwd(), 'posix.resolve() with no arguments must return cwd');
const relResolved = barePath.posix.resolve('sample', 'test');
assert.strictEqual(relResolved, `${process.cwd()}/sample/test`, 'posix.resolve with relative path must prefix cwd');
// 4. resolve ignores empty path segments and normalizes dot and dot-dot segments correctly
const withEmpty = barePath.posix.resolve('/project', '', 'sub', '.', 'file.txt');
assert.strictEqual(withEmpty, '/project/sub/file.txt', 'posix.resolve must ignore empty segments and normalize dot');
const withParent = barePath.posix.resolve('/project/a/b/c', '../../d');
assert.strictEqual(withParent, '/project/a/d', 'posix.resolve must resolve parent directory dots');
// 5. resolve validates argument types and throws TypeError when non-string arguments are provided
assert.throws(
() => barePath.posix.resolve(123),
{
name: 'TypeError',
message: 'The "paths[0]" argument must be of type string. Received type number'
},
'posix.resolve must throw TypeError for non-string arguments'
);
assert.throws(
() => barePath.posix.resolve('/valid', null),
{
name: 'TypeError',
message: 'The "paths[1]" argument must be of type string. Received type object'
},
'posix.resolve must throw TypeError for null argument'
);
console.log('Contract verification finished successfully.');
오리진 시더
익명