サンプル
golang.org/x/sys v0.0.0-20220406155245-289d7a0edf71
検証済みサンプル — golang golang.org/x/sys v0.0.0-20220406155245-289d7a0edf71. go 1.26 · linux alpine/x64 · docker で contract を実行し、成功しました.
sha256:859ce8c7da3ed81ab7ca9b66cc296028f80437be3a6a62f7f0e07e040800ccd4
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux 24 · ubuntu · glibc 2.39 x64 go
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| go 1.26 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26-alpine@sha256:28d89ee9cc0f… |
2026-08-27 |
ケース
HOW- ゴール
- verify pkg:golang/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71
- 作成日
- 2026-08-27T13:05:23Z
コントラクト
- unix.Getrlimit retrieves resource limits where Cur does not exceed Max
- unix.Getuid and unix.Getgid return non-negative user and group identifiers
- unix.Pipe creates connected pipe descriptors that transfer byte payload
- unix.ClockGettime with CLOCK_MONOTONIC retrieves non-zero Timespec
ファイル
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract.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/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71
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.
{"case":{"caseId":"case:sha256:45d7476876e59e7bc0e4fbceb11fea625f3ced58b0587f099e45fa8dcfa88066","contract":["unix.Getrlimit retrieves resource limits where Cur does not exceed Max","unix.Getuid and unix.Getgid return non-negative user and group identifiers","unix.Pipe creates connected pipe descriptors that transfer byte payload","unix.ClockGettime with CLOCK_MONOTONIC retrieves non-zero Timespec"],"goal":"verify pkg:golang/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71","kind":"HOW","packages":["pkg:golang/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71"],"schemaVersion":1},"contractCommand":["go","run","./test"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"golang","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"go","schemaVersion":1},"license":"MIT-0","packages":["pkg:golang/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71","verifierAdapter":"golang@1"}
module sample
go 1.26.6
require golang.org/x/sys v0.0.0-20220406155245-289d7a0edf71
golang.org/x/sys v0.0.0-20220406155245-289d7a0edf71 h1:PRD0hj6tTuUnCFD08vkvjkYFbQg/9lV8KIxe1y4/cvU=
golang.org/x/sys v0.0.0-20220406155245-289d7a0edf71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
package main
import (
"bytes"
"fmt"
"os"
"golang.org/x/sys/unix"
)
func main() {
var rlim unix.Rlimit
if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err != nil {
fmt.Fprintf(os.Stderr, "failed to get rlimit: %v\n", err)
os.Exit(1)
}
uid := unix.Getuid()
gid := unix.Getgid()
var p [2]int
if err := unix.Pipe(p[:]); err != nil {
fmt.Fprintf(os.Stderr, "failed to create pipe: %v\n", err)
os.Exit(1)
}
defer unix.Close(p[0])
defer unix.Close(p[1])
msg := []byte("hello unix")
if _, err := unix.Write(p[1], msg); err != nil {
fmt.Fprintf(os.Stderr, "failed to write to pipe: %v\n", err)
os.Exit(1)
}
buf := make([]byte, len(msg))
if _, err := unix.Read(p[0], buf); err != nil {
fmt.Fprintf(os.Stderr, "failed to read from pipe: %v\n", err)
os.Exit(1)
}
var ts unix.Timespec
if err := unix.ClockGettime(unix.CLOCK_MONOTONIC, &ts); err != nil {
fmt.Fprintf(os.Stderr, "failed to get monotonic clock: %v\n", err)
os.Exit(1)
}
fmt.Printf("RLIMIT_NOFILE: Cur=%d, Max=%d\n", rlim.Cur, rlim.Max)
fmt.Printf("UID: %d, GID: %d\n", uid, gid)
fmt.Printf("Pipe read: %s (equal=%t)\n", string(buf), bytes.Equal(buf, msg))
fmt.Printf("Monotonic time: %d.%09d\n", ts.Sec, ts.Nsec)
}
{
"schemaVersion": 1,
"goal": "verify pkg:golang/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/sys@v0.0.0-20220406155245-289d7a0edf71"
]
}
package main
import (
"bytes"
"fmt"
"os"
"golang.org/x/sys/unix"
)
func main() {
if err := runContract(); err != nil {
fmt.Fprintf(os.Stderr, "Contract verification failed: %v\n", err)
os.Exit(1)
}
fmt.Println("All golang.org/x/sys/unix contract assertions passed.")
}
func runContract() error {
// Assertion 1: unix.Getrlimit retrieves resource limits where Cur does not exceed Max
var rlim unix.Rlimit
if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err != nil {
return fmt.Errorf("unix.Getrlimit failed: %w", err)
}
if rlim.Cur > rlim.Max {
return fmt.Errorf("expected rlim.Cur <= rlim.Max, got Cur=%d Max=%d", rlim.Cur, rlim.Max)
}
// Assertion 2: unix.Getuid and unix.Getgid return non-negative user and group identifiers
uid := unix.Getuid()
gid := unix.Getgid()
if uid < 0 || gid < 0 {
return fmt.Errorf("expected non-negative uid and gid, got uid=%d gid=%d", uid, gid)
}
// Assertion 3: unix.Pipe creates connected pipe descriptors that transfer byte payload
var p [2]int
if err := unix.Pipe(p[:]); err != nil {
return fmt.Errorf("unix.Pipe failed: %w", err)
}
defer unix.Close(p[0])
defer unix.Close(p[1])
testMsg := []byte("csx-pipe-test")
n, err := unix.Write(p[1], testMsg)
if err != nil || n != len(testMsg) {
return fmt.Errorf("unix.Write failed: n=%d, err=%w", n, err)
}
buf := make([]byte, len(testMsg))
nr, err := unix.Read(p[0], buf)
if err != nil || nr != len(testMsg) {
return fmt.Errorf("unix.Read failed: nr=%d, err=%w", nr, err)
}
if !bytes.Equal(buf, testMsg) {
return fmt.Errorf("payload mismatch: got %s, want %s", string(buf), string(testMsg))
}
// Assertion 4: unix.ClockGettime with CLOCK_MONOTONIC retrieves non-zero Timespec
var ts unix.Timespec
if err := unix.ClockGettime(unix.CLOCK_MONOTONIC, &ts); err != nil {
return fmt.Errorf("unix.ClockGettime failed: %w", err)
}
if ts.Sec <= 0 && ts.Nsec <= 0 {
return fmt.Errorf("expected non-zero Timespec from ClockGettime, got sec=%d nsec=%d", ts.Sec, ts.Nsec)
}
return nil
}
オリジンシーダー
匿名