Sample
github.com/rs/zerolog v1.15.0: New
Verified sample for golang github.com/rs/zerolog v1.15.0: New. The contract ran on go 1.26 · linux debian/x64 · docker and passed.
sha256:1fd9339e2f46d9972c840e336b1e6bf8e4cb7b39500300702ab678676f4ffbe9
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
go 1.26 linux 24 · ubuntu · glibc 2.39 amd64 go 1.26 go 1.26 go 1
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 github.com/rs/zerolog.New in pkg:golang/github.com/rs/zerolog@v1.15.0
- Packages
- Symbols
-
- github.com/rs/zerolog.New
- Environment
- go 1.26.6
- Created
- 2026-09-15T00:46:35Z
Contract
- zerolog.New creates a Logger writing structured JSON to an io.Writer
- zerolog.New writes log events formatted with message and level
- zerolog.New with nil writer creates a Logger that safely discards log output
- zerolog.New logger formats structured key-value fields as JSON
- zerolog.New logger creates a context child logger via With()
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 github.com/rs/zerolog.New in pkg:golang/github.com/rs/zerolog@v1.15.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/github.com/rs/zerolog@v1.15.0
Demonstrate these symbols/APIs:
- github.com/rs/zerolog.New
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:af52b1dc0af48005375fe1474d62893973dff42938ed878c95c8b2041dcd96ae","contract":["zerolog.New creates a Logger writing structured JSON to an io.Writer","zerolog.New writes log events formatted with message and level","zerolog.New with nil writer creates a Logger that safely discards log output","zerolog.New logger formats structured key-value fields as JSON","zerolog.New logger creates a context child logger via With()"],"goal":"verify github.com/rs/zerolog.New in pkg:golang/github.com/rs/zerolog@v1.15.0","kind":"HOW","packages":["pkg:golang/github.com/rs/zerolog@v1.15.0"],"schemaVersion":1,"symbols":["github.com/rs/zerolog.New"]},"contractCommand":["go","run","./test"],"environment":{"arch":"amd64","compiler":"go","compilerVersion":"1.26.6","distro":"ubuntu","ecosystem":"golang","language":"go","languageVersion":"1.26.6","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"go","packageManagerVersion":"1.26.6","runtime":"go","runtimeVersion":"1.26.6","schemaVersion":1},"license":"MIT-0","packages":["pkg:golang/github.com/rs/zerolog@v1.15.0"],"schemaVersion":1,"subject":"pkg:golang/github.com/rs/zerolog@v1.15.0","symbols":["github.com/rs/zerolog.New"],"verifierAdapter":"golang@1"}
module sample
go 1.26.6
require github.com/rs/zerolog v1.15.0
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.15.0 h1:uPRuwkWF4J6fGsJ2R0Gn2jB1EQiav9k3S6CSdygQJXY=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
package main
import (
"bytes"
"fmt"
"github.com/rs/zerolog"
)
func main() {
buf := &bytes.Buffer{}
logger := zerolog.New(buf)
logger.Info().Str("app", "csx-sample").Msg("application started")
fmt.Printf("Log output: %s\n", buf.String())
}
{
"schemaVersion": 1,
"goal": "verify github.com/rs/zerolog.New in pkg:golang/github.com/rs/zerolog@v1.15.0",
"kind": "HOW",
"packages": [
"pkg:golang/github.com/rs/zerolog@v1.15.0"
],
"symbols": [
"github.com/rs/zerolog.New"
]
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"os"
"github.com/rs/zerolog"
)
func main() {
// Assertion 1: zerolog.New creates a Logger writing structured JSON to an io.Writer
{
buf := &bytes.Buffer{}
logger := zerolog.New(buf)
logger.Log().Msg("test message")
var parsed map[string]interface{}
if err := json.Unmarshal(buf.Bytes(), &parsed); err != nil {
fmt.Fprintf(os.Stderr, "assertion 1 failed: invalid JSON output: %v\n", err)
os.Exit(1)
}
if parsed["message"] != "test message" {
fmt.Fprintf(os.Stderr, "assertion 1 failed: expected message %q, got %v\n", "test message", parsed["message"])
os.Exit(1)
}
}
// Assertion 2: zerolog.New writes log events formatted with message and level
{
buf := &bytes.Buffer{}
logger := zerolog.New(buf)
logger.Info().Msg("hello world")
var parsed map[string]interface{}
if err := json.Unmarshal(buf.Bytes(), &parsed); err != nil {
fmt.Fprintf(os.Stderr, "assertion 2 failed: invalid JSON output: %v\n", err)
os.Exit(1)
}
if parsed["level"] != "info" || parsed["message"] != "hello world" {
fmt.Fprintf(os.Stderr, "assertion 2 failed: expected level 'info' and message 'hello world', got %+v\n", parsed)
os.Exit(1)
}
}
// Assertion 3: zerolog.New with nil writer creates a Logger that safely discards log output
{
logger := zerolog.New(nil)
logger.Info().Str("field", "value").Msg("discarded message")
}
// Assertion 4: zerolog.New logger formats structured key-value fields as JSON
{
buf := &bytes.Buffer{}
logger := zerolog.New(buf)
logger.Info().Str("service", "auth").Int("port", 8080).Bool("enabled", true).Msg("server starting")
var parsed map[string]interface{}
if err := json.Unmarshal(buf.Bytes(), &parsed); err != nil {
fmt.Fprintf(os.Stderr, "assertion 4 failed: invalid JSON output: %v\n", err)
os.Exit(1)
}
if parsed["service"] != "auth" || parsed["port"] != float64(8080) || parsed["enabled"] != true || parsed["message"] != "server starting" {
fmt.Fprintf(os.Stderr, "assertion 4 failed: field values mismatch: %+v\n", parsed)
os.Exit(1)
}
}
// Assertion 5: zerolog.New logger creates a context child logger via With()
{
buf := &bytes.Buffer{}
logger := zerolog.New(buf)
child := logger.With().Str("component", "worker").Int("worker_id", 1).Logger()
child.Info().Msg("task executed")
var parsed map[string]interface{}
if err := json.Unmarshal(buf.Bytes(), &parsed); err != nil {
fmt.Fprintf(os.Stderr, "assertion 5 failed: invalid JSON output: %v\n", err)
os.Exit(1)
}
if parsed["component"] != "worker" || parsed["worker_id"] != float64(1) || parsed["message"] != "task executed" {
fmt.Fprintf(os.Stderr, "assertion 5 failed: child logger context mismatch: %+v\n", parsed)
os.Exit(1)
}
}
fmt.Println("All contract assertions passed successfully.")
}
Origin Seeder
anonymous