CodeSampleX

Sample

google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9: code.Code_INTERNAL

Verified sample for golang google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9: code.Code_INTERNAL. The contract ran on go 1.26 …

sha256:ad852fe5b55a149f8cb433b83cb8608907a7001a23e47371b738a273ea28ea0b

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 code.Code_INTERNAL in pkg:golang/google.golang.org/genproto/googleapis/rpc@v0.0.0-20241007155032-5fefd90f89a9
Packages
Symbols
  • code.Code_INTERNAL
Created
2026-08-27T13:59:44Z

Contract

  1. code.Code_INTERNAL evaluates to code.Code enum value 13
  2. code.Code_INTERNAL String() returns INTERNAL
  3. code.Code_name maps Code_INTERNAL value 13 to INTERNAL
  4. code.Code_value maps INTERNAL to int32 value 13
  5. code.Code_INTERNAL descriptor and enum number are consistent

Files

  • PROMPT.md
  • csx.json
  • go.mod
  • go.sum
  • main.go
  • spec.json
  • test/main.go

Download the source artifact (tar.gz)

Source

PROMPT.md
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 code.Code_INTERNAL 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:
  - code.Code_INTERNAL

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.
csx.json
{"case":{"caseId":"case:sha256:cc3af82f29b2dc3ae0cdaa1e93af68688af4b139898abfb2b7d760ebff0fd6a0","contract":["code.Code_INTERNAL evaluates to code.Code enum value 13","code.Code_INTERNAL String() returns INTERNAL","code.Code_name maps Code_INTERNAL value 13 to INTERNAL","code.Code_value maps INTERNAL to int32 value 13","code.Code_INTERNAL descriptor and enum number are consistent"],"goal":"verify code.Code_INTERNAL 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":["code.Code_INTERNAL"]},"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":["code.Code_INTERNAL"],"verifierAdapter":"golang@1"}
go.mod
module sample

go 1.23.0

require google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9

require google.golang.org/protobuf v1.35.1 // indirect
go.sum
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=
main.go
package main

import (
	"fmt"

	"google.golang.org/genproto/googleapis/rpc/code"
)

// GetInternalCode returns the Code_INTERNAL enum value.
func GetInternalCode() code.Code {
	return code.Code_INTERNAL
}

// FormatCodeName returns the string representation of a code.Code.
func FormatCodeName(c code.Code) string {
	return c.String()
}

func main() {
	c := GetInternalCode()
	fmt.Printf("Code: %s (%d)\n", FormatCodeName(c), int32(c))
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify code.Code_INTERNAL 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": [
    "code.Code_INTERNAL"
  ]
}
test/main.go
package main

import (
	"fmt"
	"os"

	"google.golang.org/genproto/googleapis/rpc/code"
)

func assertTrue(name string, condition bool) {
	if !condition {
		fmt.Fprintf(os.Stderr, "Assertion failed for %s: expected true, got false\n", name)
		os.Exit(1)
	}
}

func assertEqual[T comparable](name string, expected, actual T) {
	if expected != actual {
		fmt.Fprintf(os.Stderr, "Assertion failed for %s: expected %v, got %v\n", name, expected, actual)
		os.Exit(1)
	}
}

func main() {
	// Contract: code.Code_INTERNAL evaluates to code.Code enum value 13
	internalCode := code.Code_INTERNAL
	assertEqual("Code_INTERNAL int32 value", int32(13), int32(internalCode))

	// Contract: code.Code_INTERNAL String() returns "INTERNAL"
	assertEqual("Code_INTERNAL String()", "INTERNAL", internalCode.String())

	// Contract: code.Code_name maps Code_INTERNAL value 13 to "INTERNAL"
	name, exists := code.Code_name[int32(internalCode)]
	assertTrue("Code_name exists for Code_INTERNAL", exists)
	assertEqual("Code_name value for Code_INTERNAL", "INTERNAL", name)

	// Contract: code.Code_value maps "INTERNAL" to int32 value 13
	val, exists := code.Code_value["INTERNAL"]
	assertTrue("Code_value exists for INTERNAL", exists)
	assertEqual("Code_value for INTERNAL", int32(internalCode), val)

	// Contract: code.Code_INTERNAL descriptor and enum number are consistent
	assertEqual("Code_INTERNAL Number", int32(13), int32(internalCode.Number()))

	fmt.Println("All contract assertions passed successfully.")
}

Origin Seeder

anonymous