Exemplo
fast-uri 3.1.9: parse
Amostra verificada para npm fast-uri 3.1.9: parse. O contrato rodou em node 22 · linux debian/x64 · docker e passou: fastUri.parse extracts scheme, host…
sha256:0ff1d25930b9e7da4828b8f63c5bb8da59435aff9d6f923bf7e7c3887a84b903
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-10-21 |
Caso
HOW- Objetivo
- verify fast-uri.parse in pkg:npm/fast-uri@3.1.9
- Pacotes
- Símbolos
-
- fast-uri.parse
- Criado
- 2026-10-21T04:58:48Z
Contrato
- fastUri.parse extracts scheme, host, port, path, query, and fragment from an absolute URI
- fastUri.parse extracts userinfo and host from network-path authority
- fastUri.parse parses relative path and query without scheme or host
- fastUri.parse parses IPv6 host and port
- fastUri.parse parses URN scheme with nid and nss
- fastUri.parse parses URN UUID scheme with uuid property
- fastUri.parse parses empty string as same-document reference with empty path
- fastUri.parse sets error property on malformed URI authority
Arquivos
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Código-fonte
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 fast-uri.parse in pkg:npm/fast-uri@3.1.9
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/fast-uri@3.1.9
Demonstrate these symbols/APIs:
- fast-uri.parse
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:4d0398b08984496abb031934933f79b814feea95c1da6bed1777d35f5104f8ed","contract":["fastUri.parse extracts scheme, host, port, path, query, and fragment from an absolute URI","fastUri.parse extracts userinfo and host from network-path authority","fastUri.parse parses relative path and query without scheme or host","fastUri.parse parses IPv6 host and port","fastUri.parse parses URN scheme with nid and nss","fastUri.parse parses URN UUID scheme with uuid property","fastUri.parse parses empty string as same-document reference with empty path","fastUri.parse sets error property on malformed URI authority"],"goal":"verify fast-uri.parse in pkg:npm/fast-uri@3.1.9","kind":"HOW","packages":["pkg:npm/fast-uri@3.1.9"],"schemaVersion":1,"symbols":["fast-uri.parse"]},"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/fast-uri@3.1.9"],"schemaVersion":1,"subject":"pkg:npm/fast-uri@3.1.9","symbols":["fast-uri.parse"],"verifierAdapter":"node-typescript@1"}
{
"name": "fast-uri-parse-verification",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "fast-uri-parse-verification",
"version": "1.0.0",
"dependencies": {
"fast-uri": "3.1.9"
}
},
"node_modules/fast-uri": {
"version": "3.1.9",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",
"integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fastify"
},
{
"type": "opencollective",
"url": "https://opencollective.com/fastify"
}
],
"license": "BSD-3-Clause"
}
}
}
{
"name": "fast-uri-parse-verification",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of fast-uri.parse",
"dependencies": {
"fast-uri": "3.1.9"
}
}
{
"schemaVersion": 1,
"goal": "verify fast-uri.parse in pkg:npm/fast-uri@3.1.9",
"kind": "HOW",
"packages": [
"pkg:npm/fast-uri@3.1.9"
],
"symbols": [
"fast-uri.parse"
]
}
import assert from 'node:assert';
import uri from 'fast-uri';
// 1. fastUri.parse extracts scheme, host, port, path, query, and fragment from an absolute URI
const full = uri.parse('https://example.com:8080/api/v1/resource?filter=active&sort=desc#section-2');
assert.strictEqual(full.scheme, 'https');
assert.strictEqual(full.host, 'example.com');
assert.strictEqual(full.port, 8080);
assert.strictEqual(full.path, '/api/v1/resource');
assert.strictEqual(full.query, 'filter=active&sort=desc');
assert.strictEqual(full.fragment, 'section-2');
assert.strictEqual(full.reference, 'uri');
// 2. fastUri.parse extracts userinfo and host from network-path authority
const auth = uri.parse('//user:info@example.com/assets/app.js');
assert.strictEqual(auth.scheme, undefined);
assert.strictEqual(auth.userinfo, 'user:info');
assert.strictEqual(auth.host, 'example.com');
assert.strictEqual(auth.path, '/assets/app.js');
assert.strictEqual(auth.reference, 'relative');
// 3. fastUri.parse parses relative path and query without scheme or host
const rel = uri.parse('/search?q=test#top');
assert.strictEqual(rel.scheme, undefined);
assert.strictEqual(rel.userinfo, undefined);
assert.strictEqual(rel.host, undefined);
assert.strictEqual(rel.port, undefined);
assert.strictEqual(rel.path, '/search');
assert.strictEqual(rel.query, 'q=test');
assert.strictEqual(rel.fragment, 'top');
assert.strictEqual(rel.reference, 'relative');
// 4. fastUri.parse parses IPv6 host and port
const v6 = uri.parse('http://[2001:db8::1]:8080/status');
assert.strictEqual(v6.scheme, 'http');
assert.strictEqual(v6.host, '2001:db8::1');
assert.strictEqual(v6.port, 8080);
assert.strictEqual(v6.path, '/status');
// 5. fastUri.parse parses URN scheme with nid and nss
const urn = uri.parse('urn:isbn:0451450523');
assert.strictEqual(urn.scheme, 'urn');
assert.strictEqual(urn.nid, 'isbn');
assert.strictEqual(urn.nss, '0451450523');
assert.strictEqual(urn.reference, 'absolute');
// 6. fastUri.parse parses URN UUID scheme with uuid property
const uuidUrn = uri.parse('urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6');
assert.strictEqual(uuidUrn.scheme, 'urn');
assert.strictEqual(uuidUrn.nid, 'uuid');
assert.strictEqual(uuidUrn.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6');
// 7. fastUri.parse parses empty string as same-document reference with empty path
const empty = uri.parse('');
assert.strictEqual(empty.scheme, undefined);
assert.strictEqual(empty.path, '');
assert.strictEqual(empty.reference, 'same-document');
// 8. fastUri.parse sets error property on malformed URI authority
const malformed = uri.parse('http://example.com:notaport/');
assert.strictEqual(typeof malformed.error, 'string');
assert.ok(malformed.error.length > 0);
console.log('Contract passed');
Seeder de origem
anônimo