サンプル
github.com/google/uuid v1.6.0
検証済みサンプル — golang github.com/google/uuid v1.6.0. go 1.26 · linux alpine/x64 · docker で contract を実行し、成功しました: GenerateV4 returns a valid RFC4122 version 4…
sha256:40e31ec292ca9704e42ea297fa880c783e4f51e4318ffc7b2015bcc3a758e4b5
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 4
- ビルドした署名鍵
- 1
宣言された環境
host 1.27 windows 10 x64 go 1.27 go go 1 vm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| go 1.26 · linux debian/x64 · docker ed25519:c1973797be207ac4 | SKIPPED | compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL CONTAINER_RUN · golang@1 |
2026-08-23 |
| go 1.26 · linux debian/x64 · docker ed25519:c1973797be207ac4 | SKIPPED | compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL CONTAINER_RUN · golang@1 |
2026-08-23 |
| go 1.26 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26-alpine@sha256:28d89ee9cc0f… |
2026-08-23 |
| go 1.26 · linux debian/x64 · docker ed25519:c1973797be207ac4 | SKIPPED | compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL CONTAINER_RUN · golang@1 |
2026-09-07 |
ケース
HOW- ゴール
- verify pkg:golang/github.com/google/uuid@v1.6.0
- 環境
- host 1.27.0
- 作成日
- 2026-08-20T01:45:42Z
コントラクト
- GenerateV4 returns a valid RFC4122 version 4 UUID with length 36
- GenerateV7 returns a valid RFC4122 version 7 UUID
- ParseUUID parses canonical UUID strings and round-trips with FormatUUID
- ParseUUID returns an error when given invalid UUID strings
ファイル
- PROMPT.md
- csx.json
- go.mod
- go.sum
- spec.json
- test/contract_test.go
- uuid_sample.go
ソース
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:golang/github.com/google/uuid@v1.6.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/github.com/google/uuid@v1.6.0
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@11.17.0
- runtime: node@24.19.0
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:b59a5f38f65cc98b422ddba1765e18fcc527f2fbad770ecbb1320b157306a58e","constraints":{"executionContext":"host"},"contract":["GenerateV4 returns a valid RFC4122 version 4 UUID with length 36","GenerateV7 returns a valid RFC4122 version 7 UUID","ParseUUID parses canonical UUID strings and round-trips with FormatUUID","ParseUUID returns an error when given invalid UUID strings"],"goal":"verify pkg:golang/github.com/google/uuid@v1.6.0","kind":"HOW","packages":["pkg:golang/github.com/google/uuid@v1.6.0"],"schemaVersion":1},"contractCommand":["go","test","./..."],"environment":{"arch":"x64","ecosystem":"golang","executionContext":"host","language":"go","moduleSystem":"module","os":"windows","osVersionBucket":"10","packageManager":"go","packageManagerVersion":"1.27.0","runtime":"go","runtimeVersion":"1.27.0","schemaVersion":1,"virtualization":"vm"},"license":"MIT-0","packages":["pkg:golang/github.com/google/uuid@v1.6.0"],"schemaVersion":1,"verifierAdapter":"golang@1"}
module example.com/uuid-sample
go 1.22.0
require github.com/google/uuid v1.6.0
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
{
"schemaVersion": 1,
"goal": "verify pkg:golang/github.com/google/uuid@v1.6.0",
"kind": "HOW",
"packages": [
"pkg:golang/github.com/google/uuid@v1.6.0"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@11.17.0",
"runtime": "node@24.19.0"
}
}
package test
import (
"testing"
sample "example.com/uuid-sample"
"github.com/google/uuid"
)
func TestUUIDV4Generation(t *testing.T) {
u, err := sample.GenerateV4()
if err != nil {
t.Fatalf("unexpected error generating v4 UUID: %v", err)
}
if u.Version() != 4 {
t.Fatalf("expected UUID version 4, got %v", u.Version())
}
if u.Variant() != uuid.RFC4122 {
t.Fatalf("expected RFC4122 variant, got %v", u.Variant())
}
if len(u.String()) != 36 {
t.Fatalf("expected string length 36, got %d", len(u.String()))
}
}
func TestUUIDV7Generation(t *testing.T) {
u, err := sample.GenerateV7()
if err != nil {
t.Fatalf("unexpected error generating v7 UUID: %v", err)
}
if u.Version() != 7 {
t.Fatalf("expected UUID version 7, got %v", u.Version())
}
if u.Variant() != uuid.RFC4122 {
t.Fatalf("expected RFC4122 variant, got %v", u.Variant())
}
}
func TestUUIDParseAndFormat(t *testing.T) {
raw := "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
u, err := sample.ParseUUID(raw)
if err != nil {
t.Fatalf("failed to parse valid UUID: %v", err)
}
formatted := sample.FormatUUID(u)
if formatted != raw {
t.Fatalf("expected round-trip formatted %s, got %s", raw, formatted)
}
}
func TestUUIDInvalidParsing(t *testing.T) {
invalid := "not-a-valid-uuid"
_, err := sample.ParseUUID(invalid)
if err == nil {
t.Fatalf("expected error parsing invalid UUID, got nil")
}
}
package sample
import (
"github.com/google/uuid"
)
// GenerateV4 generates a new random UUID (version 4).
func GenerateV4() (uuid.UUID, error) {
return uuid.NewRandom()
}
// GenerateV7 generates a new time-ordered UUID (version 7).
func GenerateV7() (uuid.UUID, error) {
return uuid.NewV7()
}
// ParseUUID parses a canonical UUID string representation.
func ParseUUID(s string) (uuid.UUID, error) {
return uuid.Parse(s)
}
// FormatUUID returns the canonical string representation of a UUID.
func FormatUUID(u uuid.UUID) string {
return u.String()
}
オリジンシーダー
匿名