サンプル
wasm-bindgen-shared 0.2.127
検証済みサンプル — cargo wasm-bindgen-shared 0.2.127. rust 1 · linux alpine/x64 · docker で contract を実行し、成功しました: SCHEMA_VERSION specifies the shared protocol version…
sha256:5f1419f810e357dc1d0b37df02b651708150e0177832f82b1dd63a5f3ab9c7e3
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux · alpine · musl x64 cargo
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1rust:1-alpine@sha256:a10e64dd139b… |
2026-09-19 |
ケース
HOW- ゴール
- verify pkg:cargo/wasm-bindgen-shared@0.2.127
- 作成日
- 2026-09-19T04:33:57Z
コントラクト
- SCHEMA_VERSION specifies the shared protocol version string
- version returns the crate package version string
- qualified_name disambiguates JavaScript names with namespaces joined by double underscores
- symbol naming helpers construct standardized wasm-bindgen export and helper names
- escape_string escapes special characters in strings
- identifier module validates and normalizes JavaScript identifiers
- tys module provides constant type discriminator identifiers
ファイル
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/lib.rs
- test/contract.rs
ソース
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "sample-wasm-bindgen-shared"
version = "1.0.0"
dependencies = [
"wasm-bindgen-shared",
]
[[package]]
name = "unicode-ident"
version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.127"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf"
dependencies = [
"unicode-ident",
]
[package]
name = "sample-wasm-bindgen-shared"
version = "1.0.0"
edition = "2021"
publish = false
[dependencies]
wasm-bindgen-shared = "=0.2.127"
[[bin]]
name = "contract"
path = "test/contract.rs"
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:cargo/wasm-bindgen-shared@0.2.127
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/wasm-bindgen-shared@0.2.127
Required runtime conditions:
- ecosystem: golang
- language: go
- packageManager: go@1.26.6
- runtime: go@1.26.6
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:38a4c568d06f261e40fb4afece22034a7ff06f4c86a22b68459771bd53063315","contract":["SCHEMA_VERSION specifies the shared protocol version string","version returns the crate package version string","qualified_name disambiguates JavaScript names with namespaces joined by double underscores","symbol naming helpers construct standardized wasm-bindgen export and helper names","escape_string escapes special characters in strings","identifier module validates and normalizes JavaScript identifiers","tys module provides constant type discriminator identifiers"],"goal":"verify pkg:cargo/wasm-bindgen-shared@0.2.127","kind":"HOW","packages":["pkg:cargo/wasm-bindgen-shared@0.2.127"],"schemaVersion":1},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","distro":"alpine","ecosystem":"cargo","libc":"musl","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/wasm-bindgen-shared@0.2.127"],"schemaVersion":1,"subject":"pkg:cargo/wasm-bindgen-shared@0.2.127","verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify pkg:cargo/wasm-bindgen-shared@0.2.127",
"kind": "HOW",
"packages": [
"pkg:cargo/wasm-bindgen-shared@0.2.127"
]
}
//! Clean-room verification sample for wasm-bindgen-shared.
pub use wasm_bindgen_shared::*;
use wasm_bindgen_shared::{
dynamic_union_variant, escape_string, free_function, free_function_export_name,
identifier, new_function, qualified_name, struct_field_get, struct_field_set,
struct_function_export_name, tys, unwrap_function, upcast_function, version,
SCHEMA_VERSION,
};
fn main() {
// 1. SCHEMA_VERSION specifies the shared protocol version string
assert_eq!(SCHEMA_VERSION, "0.2.122");
// 2. version returns the crate package version string
let ver = version();
assert!(ver.starts_with("0.2.127"));
// 3. qualified_name disambiguates JavaScript names with namespaces joined by double underscores
let ns = ["window", "document"];
assert_eq!(qualified_name(Some(&ns), "body"), "window__document__body");
let no_ns: Option<&[&str]> = None;
assert_eq!(qualified_name(no_ns, "alert"), "alert");
let empty_ns: [&str; 0] = [];
assert_eq!(qualified_name(Some(&empty_ns), "alert"), "alert");
// 4. symbol naming helpers construct standardized wasm-bindgen export and helper names
assert_eq!(new_function("MyClass"), "__wbg_myclass_new");
assert_eq!(free_function("MyClass"), "__wbg_myclass_free");
assert_eq!(unwrap_function("MyClass"), "__wbg_myclass_unwrap");
assert_eq!(upcast_function("Child", "Parent"), "__wbg_upcast_child_to_parent");
assert_eq!(struct_field_get("MyClass", "field"), "__wbg_get_myclass_field");
assert_eq!(struct_field_set("MyClass", "field"), "__wbg_set_myclass_field");
assert_eq!(free_function_export_name("my_fn"), "my_fn");
assert_eq!(struct_function_export_name("MyClass", "method"), "myclass_method");
assert_eq!(dynamic_union_variant("MyUnion", 2), "__wbg_dynamic_union_myunion_2");
// 5. escape_string escapes special characters in strings
assert_eq!(escape_string("hello\n\"world\"\\"), "hello\\n\\\"world\\\"\\\\");
assert_eq!(escape_string("test\r'string'"), "test\\r\\'string\\'");
// 6. identifier module validates and normalizes JavaScript identifiers
assert!(identifier::is_js_keyword("function"));
assert!(identifier::is_js_keyword("class"));
assert!(!identifier::is_js_keyword("custom_identifier"));
assert!(identifier::is_non_value_js_keyword("let"));
assert!(!identifier::is_non_value_js_keyword("this"));
assert!(identifier::is_valid_ident("valid_name$1"));
assert!(!identifier::is_valid_ident("123invalid"));
assert!(!identifier::is_valid_ident("invalid-kebab"));
assert_eq!(identifier::to_valid_ident("valid_name"), "valid_name");
assert_eq!(identifier::to_valid_ident("invalid-name"), "invalid_name");
assert_eq!(identifier::to_valid_ident("default"), "_default");
// 7. tys module provides constant type discriminator identifiers
assert_eq!(tys::I8, 0);
assert_eq!(tys::U8, 1);
assert_eq!(tys::I16, 2);
assert_eq!(tys::U16, 3);
assert_eq!(tys::I32, 4);
assert_eq!(tys::U32, 5);
assert_eq!(tys::BOOLEAN, 14);
assert_eq!(tys::STRING, 18);
println!("All wasm-bindgen-shared contract assertions passed successfully.");
}
オリジンシーダー
匿名