CodeSampleX

Beispiel

aria-query 5.3.0

Verifiziertes Beispiel für npm aria-query 5.3.0. Der Vertrag lief auf node 22 · linux alpine/x64 · docker und bestand: roles Map provides WAI-ARIA role…

sha256:25c2e22d9749ebfca0ddaff4e6b51275a3dd53e0fe3ea1c867d310d53d3e09af

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
1
Signaturschlüssel, die es gebaut haben
1
Deklarierte Umgebung node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-21

Fall

HOW
Ziel
verify pkg:npm/aria-query@5.3.0
Pakete
Umgebung
node 22.23.2
Erstellt
2026-08-21T11:43:32Z

Contract

  1. roles Map provides WAI-ARIA role definitions including abstract status, requiredProps, nameFrom, and superClass hierarchy
  2. aria Map provides ARIA attribute definitions with type and allowundefined metadata
  3. dom Map provides HTML DOM element definitions and reserved status
  4. roleElements Map maps ARIA roles to corresponding HTML DOM elements and attributes
  5. elementRoles Map maps HTML DOM element concepts to corresponding ARIA roles

Dateien

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.js

Quellartefakt herunterladen (tar.gz)

Quelltext

PROMPT.md
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/aria-query@5.3.0
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/aria-query@5.3.0
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.
csx.json
{"case":{"caseId":"case:sha256:2adbda369f047ec684be3d9883c0ba760a6f23dc4bec7de9625a78c7e886245e","constraints":{"executionContext":"node"},"contract":["roles Map provides WAI-ARIA role definitions including abstract status, requiredProps, nameFrom, and superClass hierarchy","aria Map provides ARIA attribute definitions with type and allowundefined metadata","dom Map provides HTML DOM element definitions and reserved status","roleElements Map maps ARIA roles to corresponding HTML DOM elements and attributes","elementRoles Map maps HTML DOM element concepts to corresponding ARIA roles"],"goal":"verify pkg:npm/aria-query@5.3.0","kind":"HOW","packages":["pkg:npm/aria-query@5.3.0"],"schemaVersion":1},"contractCommand":["node","test/contract.js"],"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/aria-query@5.3.0"],"schemaVersion":1,"subject":"pkg:npm/aria-query@5.3.0","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-aria-query",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-aria-query",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "aria-query": "5.3.0"
      }
    },
    "node_modules/aria-query": {
      "version": "5.3.0",
      "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
      "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
      "license": "Apache-2.0",
      "dependencies": {
        "dequal": "^2.0.3"
      }
    },
    "node_modules/dequal": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
      "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
      "license": "MIT",
      "engines": {
        "node": ">=6"
      }
    }
  }
}
package.json
{
  "name": "sample-aria-query",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification for aria-query",
  "main": "test/contract.js",
  "scripts": {
    "test": "node test/contract.js"
  },
  "dependencies": {
    "aria-query": "5.3.0"
  },
  "license": "MIT-0"
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/aria-query@5.3.0",
  "kind": "HOW",
  "packages": [
    "pkg:npm/aria-query@5.3.0"
  ],
  "constraints": {
    "executionContext": "node"
  },
  "runtimeConditions": {
    "ecosystem": "npm",
    "language": "javascript",
    "moduleSystem": "cjs",
    "packageManager": "npm@10.9.8",
    "runtime": "node@22.23.2"
  }
}
test/contract.js
const assert = require('node:assert');
const { aria, dom, roles, elementRoles, roleElements } = require('aria-query');

// 1. roles Map provides WAI-ARIA role definitions
assert.strictEqual(typeof roles.get, 'function', 'roles must have a get method');
assert.strictEqual(typeof roles.has, 'function', 'roles must have a has method');
assert.strictEqual(roles.has('button'), true, 'roles must contain button role');
assert.strictEqual(roles.has('checkbox'), true, 'roles must contain checkbox role');
assert.strictEqual(roles.has('nonexistent-role'), false, 'roles must not contain nonexistent role');

const buttonRole = roles.get('button');
assert.strictEqual(buttonRole.abstract, false, 'button role must not be abstract');
assert.strictEqual(buttonRole.accessibleNameRequired, true, 'button role must require accessible name');
assert.deepStrictEqual(buttonRole.nameFrom, ['author', 'contents'], 'button role nameFrom must match');
assert.deepStrictEqual(buttonRole.superClass, [['roletype', 'widget', 'command']], 'button role superClass hierarchy must match');
assert.ok('aria-pressed' in buttonRole.props, 'button role props must include aria-pressed');

const widgetRole = roles.get('widget');
assert.strictEqual(widgetRole.abstract, true, 'widget role must be abstract');

const checkboxRole = roles.get('checkbox');
assert.deepStrictEqual(checkboxRole.requiredProps, { 'aria-checked': null }, 'checkbox role must have requiredProps aria-checked');

// 2. aria Map provides ARIA attribute definitions
assert.strictEqual(typeof aria.get, 'function', 'aria must have a get method');
assert.strictEqual(typeof aria.has, 'function', 'aria must have a has method');
assert.strictEqual(aria.has('aria-expanded'), true, 'aria must contain aria-expanded attribute');
assert.strictEqual(aria.has('aria-checked'), true, 'aria must contain aria-checked attribute');
assert.strictEqual(aria.has('aria-nonexistent'), false, 'aria must not contain nonexistent attribute');

const ariaExpanded = aria.get('aria-expanded');
assert.strictEqual(ariaExpanded.type, 'boolean', 'aria-expanded type must be boolean');
assert.strictEqual(ariaExpanded.allowundefined, true, 'aria-expanded must allow undefined');

const ariaChecked = aria.get('aria-checked');
assert.strictEqual(ariaChecked.type, 'tristate', 'aria-checked type must be tristate');

const ariaInvalid = aria.get('aria-invalid');
assert.strictEqual(ariaInvalid.type, 'token', 'aria-invalid type must be token');
assert.deepStrictEqual(ariaInvalid.values, ['grammar', false, 'spelling', true], 'aria-invalid allowed token values must match');

// 3. dom Map provides HTML DOM element definitions
assert.strictEqual(typeof dom.get, 'function', 'dom must have a get method');
assert.strictEqual(typeof dom.has, 'function', 'dom must have a has method');
assert.strictEqual(dom.has('button'), true, 'dom must contain button element');
assert.strictEqual(dom.has('input'), true, 'dom must contain input element');
assert.strictEqual(dom.has('custom-unknown-element'), false, 'dom must not contain unknown element');

const buttonDom = dom.get('button');
assert.strictEqual(buttonDom.reserved, false, 'button element must not be reserved');

// 4. roleElements Map maps ARIA roles to DOM element concepts
assert.strictEqual(typeof roleElements.get, 'function', 'roleElements must have a get method');
assert.strictEqual(typeof roleElements.has, 'function', 'roleElements must have a has method');
assert.strictEqual(roleElements.has('button'), true, 'roleElements must have entry for button');
assert.strictEqual(roleElements.has('checkbox'), true, 'roleElements must have entry for checkbox');

const buttonElements = roleElements.get('button');
assert.ok(Array.isArray(buttonElements), 'button role elements must be an array');
assert.ok(buttonElements.some((el) => el.name === 'button'), 'button role elements must include button tag');

const checkboxElements = roleElements.get('checkbox');
assert.ok(Array.isArray(checkboxElements), 'checkbox role elements must be an array');
assert.deepStrictEqual(
  checkboxElements,
  [
    {
      attributes: [
        {
          name: 'type',
          value: 'checkbox'
        }
      ],
      name: 'input'
    }
  ],
  'checkbox role elements must map to input[type=checkbox]'
);

// 5. elementRoles Map maps DOM element concepts to ARIA roles
assert.strictEqual(typeof elementRoles.entries, 'function', 'elementRoles must have entries method');
const allElementRoles = Array.from(elementRoles.entries());
assert.ok(allElementRoles.length > 0, 'elementRoles must not be empty');

const buttonElementConcept = allElementRoles.find(([concept]) => concept.name === 'button' && !concept.attributes);
assert.ok(buttonElementConcept, 'elementRoles must contain concept for button without attributes');
assert.deepStrictEqual(buttonElementConcept[1], ['button'], 'button concept must map to button role');

const articleElementConcept = allElementRoles.find(([concept]) => concept.name === 'article' && !concept.attributes);
assert.ok(articleElementConcept, 'elementRoles must contain concept for article without attributes');
assert.deepStrictEqual(articleElementConcept[1], ['article'], 'article concept must map to article role');

console.log('All aria-query contract assertions passed successfully.');

Ursprungs-Seeder

anonym