Sample
robots-parser 3.0.1: isAllowed
Verified sample for npm robots-parser 3.0.1: isAllowed. The contract ran on node 22 · linux debian/x64 · docker and passed: isAllowed returns true for paths…
sha256:c1e28b275235f9d6e8c0c8ae55da65afa99406bb02d148660ddf944cef1c9989
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
linux 24 · ubuntu · glibc 2.39 x64 npm
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| 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-13 |
Case
HOW- Goal
- verify isAllowed in pkg:npm/robots-parser@3.0.1
- Packages
- Symbols
-
- isAllowed
- Created
- 2026-09-13T18:40:45Z
Contract
- isAllowed returns true for paths matching an Allow directive and false for paths matching a Disallow directive
- isAllowed returns true by default when no matching rule is specified for a path
- isAllowed respects user-agent specific rules over wildcard rules
- isAllowed applies the longest matching rule when multiple rules match a path
- isAllowed prefers Allow directive over Disallow directive when rule patterns have equal length
- isAllowed supports wildcard (*) and end-of-line ($) pattern matching
- isAllowed returns undefined when the queried URL protocol, hostname, or port does not match the robots.txt base URL
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Source
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 isAllowed in pkg:npm/robots-parser@3.0.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/robots-parser@3.0.1
Demonstrate these symbols/APIs:
- isAllowed
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:5193029bf557b99d4126ad9ad55ec5e22fb83a9a788aa165c3d3130d40243530","contract":["isAllowed returns true for paths matching an Allow directive and false for paths matching a Disallow directive","isAllowed returns true by default when no matching rule is specified for a path","isAllowed respects user-agent specific rules over wildcard rules","isAllowed applies the longest matching rule when multiple rules match a path","isAllowed prefers Allow directive over Disallow directive when rule patterns have equal length","isAllowed supports wildcard (*) and end-of-line ($) pattern matching","isAllowed returns undefined when the queried URL protocol, hostname, or port does not match the robots.txt base URL"],"goal":"verify isAllowed in pkg:npm/robots-parser@3.0.1","kind":"HOW","packages":["pkg:npm/robots-parser@3.0.1"],"schemaVersion":1,"symbols":["isAllowed"]},"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/robots-parser@3.0.1"],"schemaVersion":1,"subject":"pkg:npm/robots-parser@3.0.1","symbols":["isAllowed"],"verifierAdapter":"node-typescript@1"}
{
"name": "robots-parser-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "robots-parser-sample",
"version": "1.0.0",
"dependencies": {
"robots-parser": "3.0.1"
}
},
"node_modules/robots-parser": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/robots-parser/-/robots-parser-3.0.1.tgz",
"integrity": "sha512-s+pyvQeIKIZ0dx5iJiQk1tPLJAWln39+MI5jtM8wnyws+G5azk+dMnMX0qfbqNetKKNgcWWOdi0sfm+FbQbgdQ==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
}
}
}
}
{
"name": "robots-parser-sample",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification for robots-parser",
"dependencies": {
"robots-parser": "3.0.1"
}
}
{
"schemaVersion": 1,
"goal": "verify isAllowed in pkg:npm/robots-parser@3.0.1",
"kind": "HOW",
"packages": [
"pkg:npm/robots-parser@3.0.1"
],
"symbols": [
"isAllowed"
]
}
import assert from 'node:assert';
import robotsParser from 'robots-parser';
// 1. isAllowed returns true for paths matching an Allow directive and false for paths matching a Disallow directive
const robots1 = robotsParser('https://example.com/robots.txt', [
'User-agent: *',
'Disallow: /admin/',
'Allow: /public/'
].join('\n'));
assert.strictEqual(robots1.isAllowed('https://example.com/admin/dashboard'), false);
assert.strictEqual(robots1.isAllowed('https://example.com/public/about'), true);
// 2. isAllowed returns true by default when no matching rule is specified for a path
const robots2 = robotsParser('https://example.com/robots.txt', [
'User-agent: *',
'Disallow: /private/'
].join('\n'));
assert.strictEqual(robots2.isAllowed('https://example.com/unrestricted/page.html'), true);
// 3. isAllowed respects user-agent specific rules over wildcard rules
const robots3 = robotsParser('https://example.com/robots.txt', [
'User-agent: *',
'Disallow: /data/',
'User-agent: TestBot',
'Allow: /data/'
].join('\n'));
assert.strictEqual(robots3.isAllowed('https://example.com/data/report', 'TestBot/2.0'), true);
assert.strictEqual(robots3.isAllowed('https://example.com/data/report', 'OtherBot'), false);
// 4. isAllowed applies the longest matching rule when multiple rules match a path
const robots4 = robotsParser('https://example.com/robots.txt', [
'User-agent: *',
'Disallow: /media/',
'Allow: /media/public/'
].join('\n'));
assert.strictEqual(robots4.isAllowed('https://example.com/media/public/image.png'), true);
assert.strictEqual(robots4.isAllowed('https://example.com/media/private/image.png'), false);
// 5. isAllowed prefers Allow directive over Disallow directive when rule patterns have equal length
const robots5 = robotsParser('https://example.com/robots.txt', [
'User-agent: *',
'Disallow: /shared',
'Allow: /shared'
].join('\n'));
assert.strictEqual(robots5.isAllowed('https://example.com/shared'), true);
// 6. isAllowed supports wildcard (*) and end-of-line ($) pattern matching
const robots6 = robotsParser('https://example.com/robots.txt', [
'User-agent: *',
'Disallow: /*.secret$',
'Disallow: /temp/*/cache'
].join('\n'));
assert.strictEqual(robots6.isAllowed('https://example.com/file.secret'), false);
assert.strictEqual(robots6.isAllowed('https://example.com/file.secret.html'), true);
assert.strictEqual(robots6.isAllowed('https://example.com/temp/user123/cache'), false);
assert.strictEqual(robots6.isAllowed('https://example.com/temp/user123/other'), true);
// 7. isAllowed returns undefined when the queried URL protocol, hostname, or port does not match the robots.txt base URL
const robots7 = robotsParser('https://example.com/robots.txt', [
'User-agent: *',
'Disallow: /admin/'
].join('\n'));
assert.strictEqual(robots7.isAllowed('http://example.com/admin/'), undefined);
assert.strictEqual(robots7.isAllowed('https://different.example.com/admin/'), undefined);
assert.strictEqual(robots7.isAllowed('https://example.com:8080/admin/'), undefined);
console.log('Contract passed');
Origin Seeder
anonymous