Sample
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9: code.Code_OK
Verified sample for golang google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9: code.Code_OK. The contract ran on go 1.26 · linux…
sha256:8f17be9cb49b5756808ed83e87ff88a5465fd4cbc7b5a35a274b76ee5f880deb
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 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 |
Case
HOW- Goal
- verify google.golang.org/genproto/googleapis/rpc/code.Code_OK in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9
- Symbols
-
- google.golang.org/genproto/googleapis/rpc/code.Code_OK
- Created
- 2026-08-27T10:58:02Z
Contract
- code.Code_OK equals 0
- code.Code_OK is a code.Code enum value
- code.Code_OK String() returns "OK"
- code.Code_name maps 0 to "OK"
- code.Code_value maps "OK" to 0
- IsOK returns true for Code_OK and false for Code_CANCELLED
- GetOKCode returns Code_OK
- GetOKName returns "OK"
- GetOKNumber returns 0
Files
- PROMPT.md
- csx.json
- go.mod
- go.sum
- ok.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 google.golang.org/genproto/googleapis/rpc/code.Code_OK in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9
Demonstrate these symbols/APIs:
- google.golang.org/genproto/googleapis/rpc/code.Code_OK
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: esm
- 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:e1cfd2c81001aac3282f5caf1d67d9844522cc62b58112d8428a6edb0bff57a8","contract":["code.Code_OK equals 0","code.Code_OK is a code.Code enum value","code.Code_OK String() returns \"OK\"","code.Code_name maps 0 to \"OK\"","code.Code_value maps \"OK\" to 0","IsOK returns true for Code_OK and false for Code_CANCELLED","GetOKCode returns Code_OK","GetOKName returns \"OK\"","GetOKNumber returns 0"],"goal":"verify google.golang.org/genproto/googleapis/rpc/code.Code_OK in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9","kind":"HOW","packages":["pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9"],"schemaVersion":1,"symbols":["google.golang.org/genproto/googleapis/rpc/code.Code_OK"]},"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/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9"],"schemaVersion":1,"subject":"pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9","symbols":["google.golang.org/genproto/googleapis/rpc/code.Code_OK"],"verifierAdapter":"golang@1"}
module sample
go 1.26.6
require google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9
require google.golang.org/protobuf v1.35.1 // indirect
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
package sample
import (
"google.golang.org/genproto/googleapis/rpc/code"
)
// IsOK returns true if the given code is Code_OK.
func IsOK(c code.Code) bool {
return c == code.Code_OK
}
// GetOKCode returns the Code_OK enum value.
func GetOKCode() code.Code {
return code.Code_OK
}
// GetOKName returns the string representation of Code_OK.
func GetOKName() string {
return code.Code_OK.String()
}
// GetOKNumber returns the integer value of Code_OK.
func GetOKNumber() int32 {
return int32(code.Code_OK)
}
{
"schemaVersion": 1,
"goal": "verify google.golang.org/genproto/googleapis/rpc/code.Code_OK in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9",
"kind": "HOW",
"packages": [
"pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9"
],
"symbols": [
"google.golang.org/genproto/googleapis/rpc/code.Code_OK"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "esm",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
package main
import (
"fmt"
"os"
"google.golang.org/genproto/googleapis/rpc/code"
"sample"
)
func main() {
// Assertion 1: Code_OK has enum integer value 0
if code.Code_OK != 0 {
fmt.Fprintf(os.Stderr, "expected code.Code_OK to equal 0, got %d\n", int32(code.Code_OK))
os.Exit(1)
}
// Assertion 2: Code_OK is of type code.Code
var c code.Code = code.Code_OK
if c != code.Code_OK {
fmt.Fprintf(os.Stderr, "type mismatch for code.Code\n")
os.Exit(1)
}
// Assertion 3: Code_OK String() returns "OK"
if code.Code_OK.String() != "OK" {
fmt.Fprintf(os.Stderr, "expected String() to return \"OK\", got %q\n", code.Code_OK.String())
os.Exit(1)
}
// Assertion 4: Code_name mapping contains "OK" for value 0
if name, ok := code.Code_name[int32(code.Code_OK)]; !ok || name != "OK" {
fmt.Fprintf(os.Stderr, "expected Code_name[0] to be \"OK\", got %q\n", name)
os.Exit(1)
}
// Assertion 5: Code_value mapping maps "OK" to 0
if val, ok := code.Code_value["OK"]; !ok || val != int32(code.Code_OK) {
fmt.Fprintf(os.Stderr, "expected Code_value[\"OK\"] to be 0, got %d\n", val)
os.Exit(1)
}
// Assertion 6: IsOK helper returns true for Code_OK and false for Code_CANCELLED
if !sample.IsOK(code.Code_OK) {
fmt.Fprintf(os.Stderr, "expected IsOK(Code_OK) to be true\n")
os.Exit(1)
}
if sample.IsOK(code.Code_CANCELLED) {
fmt.Fprintf(os.Stderr, "expected IsOK(Code_CANCELLED) to be false\n")
os.Exit(1)
}
// Assertion 7: GetOKCode helper returns Code_OK
if sample.GetOKCode() != code.Code_OK {
fmt.Fprintf(os.Stderr, "expected GetOKCode() to return Code_OK\n")
os.Exit(1)
}
// Assertion 8: GetOKName helper returns "OK"
if sample.GetOKName() != "OK" {
fmt.Fprintf(os.Stderr, "expected GetOKName() to return \"OK\", got %q\n", sample.GetOKName())
os.Exit(1)
}
// Assertion 9: GetOKNumber helper returns 0
if sample.GetOKNumber() != 0 {
fmt.Fprintf(os.Stderr, "expected GetOKNumber() to return 0, got %d\n", sample.GetOKNumber())
os.Exit(1)
}
fmt.Println("All google.golang.org/genproto/googleapis/rpc/code.Code_OK contract assertions passed.")
}
Origin Seeder
anonymous