Beispiel
scheduler 0.25.0: unstable_IdlePriority
Verifiziertes Beispiel für npm scheduler 0.25.0: unstable_IdlePriority. Der Vertrag lief auf node 22 · linux alpine/x64 · docker und bestand.
sha256:1f20a5fa9f805741df360709ce8048c36429b4bcf72e6e968a0191ddb8e2f0e2
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
linux 24 · ubuntu · glibc 2.39 x64 npm
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 scheduler.unstable_IdlePriority in pkg:npm/scheduler@0.25.0
- Pakete
- Symbole
-
- scheduler.unstable_IdlePriority
- Erstellt
- 2026-08-21T02:43:05Z
Contract
- scheduler.unstable_IdlePriority is exported as a numeric constant with value 5
- unstable_IdlePriority has the lowest priority level relative to Immediate, UserBlocking, Normal, and Low priorities
- scheduler.unstable_runWithPriority executes callbacks with current priority set to unstable_IdlePriority
- scheduler.unstable_scheduleCallback schedules tasks assigned with unstable_IdlePriority level
Dateien
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.mjs
Quelltext
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 scheduler.unstable_IdlePriority in pkg:npm/scheduler@0.25.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/scheduler@0.25.0
Demonstrate these symbols/APIs:
- scheduler.unstable_IdlePriority
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:793ca9e1e6c6d78cd909f0df8debe7aa2dc029bbf4dec9f307898de0dd931fbc","contract":["scheduler.unstable_IdlePriority is exported as a numeric constant with value 5","unstable_IdlePriority has the lowest priority level relative to Immediate, UserBlocking, Normal, and Low priorities","scheduler.unstable_runWithPriority executes callbacks with current priority set to unstable_IdlePriority","scheduler.unstable_scheduleCallback schedules tasks assigned with unstable_IdlePriority level"],"goal":"verify scheduler.unstable_IdlePriority in pkg:npm/scheduler@0.25.0","kind":"HOW","packages":["pkg:npm/scheduler@0.25.0"],"schemaVersion":1,"symbols":["scheduler.unstable_IdlePriority"]},"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/scheduler@0.25.0"],"schemaVersion":1,"subject":"pkg:npm/scheduler@0.25.0","symbols":["scheduler.unstable_IdlePriority"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-scheduler-idle-priority",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-scheduler-idle-priority",
"version": "1.0.0",
"dependencies": {
"scheduler": "0.25.0"
}
},
"node_modules/scheduler": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz",
"integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==",
"license": "MIT"
}
}
}
{
"name": "sample-scheduler-idle-priority",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of scheduler unstable_IdlePriority",
"main": "src/index.js",
"dependencies": {
"scheduler": "0.25.0"
}
}
{
"schemaVersion": 1,
"goal": "verify scheduler.unstable_IdlePriority in pkg:npm/scheduler@0.25.0",
"kind": "HOW",
"packages": [
"pkg:npm/scheduler@0.25.0"
],
"symbols": [
"scheduler.unstable_IdlePriority"
]
}
const scheduler = require('scheduler');
/**
* Returns the numeric value representing the idle priority level.
* @returns {number} The idle priority level constant.
*/
function getIdlePriority() {
return scheduler.unstable_IdlePriority;
}
/**
* Runs a synchronous action under the idle priority level.
* @param {Function} action - Function to execute under idle priority.
* @returns {*} The result of the action and the observed priority level.
*/
function runWithIdlePriority(action) {
return scheduler.unstable_runWithPriority(scheduler.unstable_IdlePriority, () => {
const currentPriority = scheduler.unstable_getCurrentPriorityLevel();
const result = action ? action() : undefined;
return {
priority: currentPriority,
result
};
});
}
/**
* Schedules a callback task with idle priority.
* @param {Function} callback - Task callback.
* @param {object} [options] - Scheduling options.
* @returns {object} The scheduled task node.
*/
function scheduleIdleTask(callback, options) {
return scheduler.unstable_scheduleCallback(
scheduler.unstable_IdlePriority,
callback,
options
);
}
module.exports = {
getIdlePriority,
runWithIdlePriority,
scheduleIdleTask,
scheduler
};
import assert from 'node:assert';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const {
getIdlePriority,
runWithIdlePriority,
scheduleIdleTask,
scheduler
} = require('../src/index.js');
// 1. Export verification
assert.strictEqual(typeof scheduler.unstable_IdlePriority, 'number', 'unstable_IdlePriority should be exported as a number');
assert.strictEqual(scheduler.unstable_IdlePriority, 5, 'unstable_IdlePriority should equal 5');
assert.strictEqual(getIdlePriority(), 5, 'getIdlePriority should return 5');
// 2. Relative priority level ordering
assert.ok(scheduler.unstable_ImmediatePriority < scheduler.unstable_UserBlockingPriority, 'Immediate priority is higher than UserBlocking');
assert.ok(scheduler.unstable_UserBlockingPriority < scheduler.unstable_NormalPriority, 'UserBlocking priority is higher than Normal');
assert.ok(scheduler.unstable_NormalPriority < scheduler.unstable_LowPriority, 'Normal priority is higher than Low');
assert.ok(scheduler.unstable_LowPriority < scheduler.unstable_IdlePriority, 'Low priority is higher than Idle');
// 3. Execution under idle priority with runWithIdlePriority
const executed = runWithIdlePriority(() => 'idle-computed');
assert.strictEqual(executed.priority, scheduler.unstable_IdlePriority, 'Observed execution priority is unstable_IdlePriority');
assert.strictEqual(executed.result, 'idle-computed', 'Action returns expected result under idle priority');
// 4. Scheduling a task with unstable_IdlePriority
const task = scheduleIdleTask(() => 'task-result');
assert.strictEqual(typeof task, 'object', 'scheduleIdleTask returns a task object');
assert.strictEqual(task.priorityLevel, scheduler.unstable_IdlePriority, 'Task priorityLevel is unstable_IdlePriority');
assert.strictEqual(typeof task.callback, 'function', 'Task callback is queued');
assert.ok(task.expirationTime > 0, 'Task expirationTime is computed');
console.log('Contract assertions for scheduler.unstable_IdlePriority passed.');
Ursprungs-Seeder
anonym