サンプル
scheduler 0.25.0: unstable_UserBlockingPriority
検証済みサンプル — npm scheduler 0.25.0: unstable_UserBlockingPriority. node 22 · linux alpine/x64 · docker で contract を実行し、成功しました…
sha256:15b3f0a868bc84dc8d30cc571ffdb98a149e00c811cc865d3570cdf706f796e9
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux 24 · ubuntu · glibc 2.39 x64 npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| 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 |
ケース
HOW- ゴール
- verify scheduler.unstable_UserBlockingPriority in pkg:npm/scheduler@0.25.0
- パッケージ
- シンボル
-
- scheduler.unstable_UserBlockingPriority
- 作成日
- 2026-08-21T02:51:42Z
コントラクト
- scheduler.unstable_UserBlockingPriority is exported as a numeric constant with value 2
- unstable_UserBlockingPriority is higher priority than Normal, Low, and Idle priorities and lower than Immediate priority
- scheduler.unstable_runWithPriority executes callbacks with current priority set to unstable_UserBlockingPriority
- scheduler.unstable_scheduleCallback schedules tasks assigned with unstable_UserBlockingPriority level
ファイル
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- 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 scheduler.unstable_UserBlockingPriority 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_UserBlockingPriority
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:c545289369d73cb0047374ac713fd8fd4aa11a284bc61923b7dfcc5d2b07b273","contract":["scheduler.unstable_UserBlockingPriority is exported as a numeric constant with value 2","unstable_UserBlockingPriority is higher priority than Normal, Low, and Idle priorities and lower than Immediate priority","scheduler.unstable_runWithPriority executes callbacks with current priority set to unstable_UserBlockingPriority","scheduler.unstable_scheduleCallback schedules tasks assigned with unstable_UserBlockingPriority level"],"goal":"verify scheduler.unstable_UserBlockingPriority in pkg:npm/scheduler@0.25.0","kind":"HOW","packages":["pkg:npm/scheduler@0.25.0"],"schemaVersion":1,"symbols":["scheduler.unstable_UserBlockingPriority"]},"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_UserBlockingPriority"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-scheduler-user-blocking-priority",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-scheduler-user-blocking-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-user-blocking-priority",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of scheduler unstable_UserBlockingPriority",
"main": "src/index.js",
"dependencies": {
"scheduler": "0.25.0"
}
}
{
"schemaVersion": 1,
"goal": "verify scheduler.unstable_UserBlockingPriority in pkg:npm/scheduler@0.25.0",
"kind": "HOW",
"packages": [
"pkg:npm/scheduler@0.25.0"
],
"symbols": [
"scheduler.unstable_UserBlockingPriority"
]
}
const scheduler = require('scheduler');
/**
* Returns the numeric value representing the user-blocking priority level.
* @returns {number} The user-blocking priority level constant.
*/
function getUserBlockingPriority() {
return scheduler.unstable_UserBlockingPriority;
}
/**
* Runs a synchronous action under the user-blocking priority level.
* @param {Function} action - Function to execute under user-blocking priority.
* @returns {*} The result of the action and the observed priority level.
*/
function runWithUserBlockingPriority(action) {
return scheduler.unstable_runWithPriority(scheduler.unstable_UserBlockingPriority, () => {
const currentPriority = scheduler.unstable_getCurrentPriorityLevel();
const result = action ? action() : undefined;
return {
priority: currentPriority,
result
};
});
}
/**
* Schedules a callback task with user-blocking priority.
* @param {Function} callback - Task callback.
* @param {object} [options] - Scheduling options.
* @returns {object} The scheduled task node.
*/
function scheduleUserBlockingTask(callback, options) {
return scheduler.unstable_scheduleCallback(
scheduler.unstable_UserBlockingPriority,
callback,
options
);
}
module.exports = {
getUserBlockingPriority,
runWithUserBlockingPriority,
scheduleUserBlockingTask,
scheduler
};
import assert from 'node:assert';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const {
getUserBlockingPriority,
runWithUserBlockingPriority,
scheduleUserBlockingTask,
scheduler
} = require('../src/index.js');
// 1. Export verification
assert.strictEqual(typeof scheduler.unstable_UserBlockingPriority, 'number', 'unstable_UserBlockingPriority should be exported as a number');
assert.strictEqual(scheduler.unstable_UserBlockingPriority, 2, 'unstable_UserBlockingPriority should equal 2');
assert.strictEqual(getUserBlockingPriority(), 2, 'getUserBlockingPriority should return 2');
// 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 user-blocking priority with runWithUserBlockingPriority
const executed = runWithUserBlockingPriority(() => 'user-blocking-computed');
assert.strictEqual(executed.priority, scheduler.unstable_UserBlockingPriority, 'Observed execution priority is unstable_UserBlockingPriority');
assert.strictEqual(executed.result, 'user-blocking-computed', 'Action returns expected result under user-blocking priority');
// 4. Scheduling a task with unstable_UserBlockingPriority
const task = scheduleUserBlockingTask(() => 'task-result');
assert.strictEqual(typeof task, 'object', 'scheduleUserBlockingTask returns a task object');
assert.strictEqual(task.priorityLevel, scheduler.unstable_UserBlockingPriority, 'Task priorityLevel is unstable_UserBlockingPriority');
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_UserBlockingPriority passed.');
オリジンシーダー
匿名