Sample
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
Verified sample for golang golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1. The contract ran on go 1.26 · linux debian/x64 · docker and passed.
sha256:ecd8f4d70eff2115c6a432f76cec4a6cb084cd0a5e5fc25f5b7d6a2e03bd27dc
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
linux 24 · ubuntu · glibc 2.39 x64 go
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| go 1.26 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26@sha256:e30143be198a… |
2026-09-15 |
Case
HOW- Goal
- verify pkg:golang/golang.org/x/sys@v0.0.0-20210615035016-665e8c7367d1
- Created
- 2026-09-15T16:24:19Z
Contract
- unix.Getpid returns a positive integer process ID matching os.Getpid
- unix.Getppid returns a positive integer parent process ID matching os.Getppid
- unix.Getpagesize returns a positive system page size that is a power of two matching os.Getpagesize
- unix.ByteSliceToString converts a null-terminated byte slice into a Go string
- unix.BytePtrToString converts a null-terminated byte pointer into a Go string
- unix.Uname populates a Utsname structure with non-empty sysname and nodename
Files
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract.go
Source
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-20210615035016-665e8c7367d1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/sys@v0.0.0-20210615035016-665e8c7367d1
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:20cb7c5715095c4fc4b1fca360b6d6ed94be2f7f8165aef68f20fbd63da453e7","contract":["unix.Getpid returns a positive integer process ID matching os.Getpid","unix.Getppid returns a positive integer parent process ID matching os.Getppid","unix.Getpagesize returns a positive system page size that is a power of two matching os.Getpagesize","unix.ByteSliceToString converts a null-terminated byte slice into a Go string","unix.BytePtrToString converts a null-terminated byte pointer into a Go string","unix.Uname populates a Utsname structure with non-empty sysname and nodename"],"goal":"verify pkg:golang/golang.org/x/sys@v0.0.0-20210615035016-665e8c7367d1","kind":"HOW","packages":["pkg:golang/golang.org/x/sys@v0.0.0-20210615035016-665e8c7367d1"],"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-20210615035016-665e8c7367d1"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/sys@v0.0.0-20210615035016-665e8c7367d1","verifierAdapter":"golang@1"}
module example.com/sample
go 1.26.6
require golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
package main
import (
"fmt"
"os"
"golang.org/x/sys/unix"
)
func main() {
pid := unix.Getpid()
ppid := unix.Getppid()
pageSize := unix.Getpagesize()
fmt.Printf("Process ID: %d (os: %d)\n", pid, os.Getpid())
fmt.Printf("Parent Process ID: %d (os: %d)\n", ppid, os.Getppid())
fmt.Printf("Page size: %d bytes\n", pageSize)
b := []byte{'s', 'a', 'm', 'p', 'l', 'e', 0, 't', 'e', 'x', 't'}
str := unix.ByteSliceToString(b)
fmt.Printf("Converted string: %s\n", str)
var uts unix.Utsname
if err := unix.Uname(&uts); err == nil {
fmt.Printf("OS sysname: %s\n", unix.ByteSliceToString(uts.Sysname[:]))
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:golang/golang.org/x/sys@v0.0.0-20210615035016-665e8c7367d1",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/sys@v0.0.0-20210615035016-665e8c7367d1"
]
}
package main
import (
"fmt"
"os"
"golang.org/x/sys/unix"
)
func main() {
if err := runTests(); err != nil {
fmt.Fprintf(os.Stderr, "Contract test failed: %v\n", err)
os.Exit(1)
}
fmt.Println("All contract assertions passed.")
}
func runTests() error {
// 1. unix.Getpid returns a positive integer process ID matching os.Getpid
pid := unix.Getpid()
if pid <= 0 {
return fmt.Errorf("expected unix.Getpid() > 0, got %d", pid)
}
if pid != os.Getpid() {
return fmt.Errorf("expected unix.Getpid() (%d) to equal os.Getpid() (%d)", pid, os.Getpid())
}
// 2. unix.Getppid returns a positive integer parent process ID matching os.Getppid
ppid := unix.Getppid()
if ppid <= 0 {
return fmt.Errorf("expected unix.Getppid() > 0, got %d", ppid)
}
if ppid != os.Getppid() {
return fmt.Errorf("expected unix.Getppid() (%d) to equal os.Getppid() (%d)", ppid, os.Getppid())
}
// 3. unix.Getpagesize returns a positive system page size that is a power of two matching os.Getpagesize
pageSize := unix.Getpagesize()
if pageSize <= 0 || (pageSize&(pageSize-1)) != 0 {
return fmt.Errorf("expected positive power of 2 page size, got %d", pageSize)
}
if pageSize != os.Getpagesize() {
return fmt.Errorf("expected unix.Getpagesize() (%d) to equal os.Getpagesize() (%d)", pageSize, os.Getpagesize())
}
// 4. unix.ByteSliceToString converts a null-terminated byte slice into a Go string
buf := []byte{'t', 'e', 's', 't', 0, 'e', 'x', 't', 'r', 'a'}
str := unix.ByteSliceToString(buf)
if str != "test" {
return fmt.Errorf("expected 'test', got %q", str)
}
// 5. unix.BytePtrToString converts a null-terminated byte pointer into a Go string
ptrStr := unix.BytePtrToString(&buf[0])
if ptrStr != "test" {
return fmt.Errorf("expected 'test', got %q", ptrStr)
}
// 6. unix.Uname populates a Utsname structure with non-empty sysname and nodename
var uts unix.Utsname
if err := unix.Uname(&uts); err != nil {
return fmt.Errorf("unix.Uname failed: %w", err)
}
sysname := unix.ByteSliceToString(uts.Sysname[:])
nodename := unix.ByteSliceToString(uts.Nodename[:])
if sysname == "" {
return fmt.Errorf("expected non-empty sysname from unix.Uname")
}
if nodename == "" {
return fmt.Errorf("expected non-empty nodename from unix.Uname")
}
return nil
}
Origin Seeder
anonymous