Ejemplo
github.com/slackhq/nebula v1.6.1: header.H
Muestra verificada para golang github.com/slackhq/nebula v1.6.1: header.H. El contrato se ejecutó en go 1.26 · linux debian/x64 · docker y pasó.
sha256:635274025ee03dd9830f7fd1aa8e60b42d8980c5f559285627c119890fc7b840
Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido.
Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas.
MIT-0
Evidencia de ejecución
El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.
- Base de evidencia
- Contrato firmado aprobado
- Recibos de verificación
- 3
- Claves de firma que lo compilaron
- 1
Entorno declarado
linux 24 · ubuntu · glibc 2.39 x64 go
Entornos de las ejecuciones de verificación
| Entorno | Contrato | Etapas | Ejecución |
|---|---|---|---|
| go 1.26 · linux debian/x64 · docker ed25519:c1973797be207ac4 | SKIPPED | compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL CONTAINER_RUN · golang@1golang:1.26@sha256:e30143be198a… |
2026-09-02 |
| go 1.26 · linux debian/x64 · docker ed25519:c1973797be207ac4 | SKIPPED | compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL CONTAINER_RUN · golang@1golang:1.26@sha256:e30143be198a… |
2026-09-02 |
| 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-02 |
Caso
HOW- Objetivo
- verify github.com/slackhq/nebula/header.H in pkg:golang/github.com/slackhq/nebula@v1.6.1
- Paquetes
- Símbolos
-
- github.com/slackhq/nebula/header.H
- Creado
- 2026-09-02T14:35:19Z
Contrato
- header.H encodes into 16-byte wire format and parses back identical header fields
- header.NewHeader and header.H Parse reject byte slices shorter than 16 bytes with ErrHeaderTooShort
- header.H Encode on nil pointer returns error without panicking
- header.H TypeName and SubTypeName map known message types and subtypes to human strings
- header.H MarshalJSON produces valid JSON with string type names and numeric counters
Archivos
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract.go
Código fuente
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/slackhq/nebula/header.H in pkg:golang/github.com/slackhq/nebula@v1.6.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/github.com/slackhq/nebula@v1.6.1
Demonstrate these symbols/APIs:
- github.com/slackhq/nebula/header.H
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:82122666fcd86308db444d40c31901314cda1caa72ec29dfa405847d737ba8d5","contract":["header.H encodes into 16-byte wire format and parses back identical header fields","header.NewHeader and header.H Parse reject byte slices shorter than 16 bytes with ErrHeaderTooShort","header.H Encode on nil pointer returns error without panicking","header.H TypeName and SubTypeName map known message types and subtypes to human strings","header.H MarshalJSON produces valid JSON with string type names and numeric counters"],"goal":"verify github.com/slackhq/nebula/header.H in pkg:golang/github.com/slackhq/nebula@v1.6.1","kind":"HOW","packages":["pkg:golang/github.com/slackhq/nebula@v1.6.1"],"schemaVersion":1,"symbols":["github.com/slackhq/nebula/header.H"]},"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/github.com/slackhq/nebula@v1.6.1"],"schemaVersion":1,"subject":"pkg:golang/github.com/slackhq/nebula@v1.6.1","symbols":["github.com/slackhq/nebula/header.H"],"verifierAdapter":"golang@1"}
module sample
go 1.26.6
require github.com/slackhq/nebula v1.6.1
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/slackhq/nebula v1.6.1 h1:/OCTR3abj0Sbf2nGoLUrdDXImrCv0ZVFpVPP5qa0DsM=
github.com/slackhq/nebula v1.6.1/go.mod h1:UmkqnXe4O53QwToSl/gG7sM4BroQwAB7dd4hUaT6MlI=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
package main
import (
"encoding/hex"
"fmt"
"os"
"github.com/slackhq/nebula/header"
)
func main() {
hdr := &header.H{
Version: header.Version,
Type: header.Message,
Subtype: header.MessageNone,
Reserved: 0,
RemoteIndex: 12345,
MessageCounter: 1,
}
buf := make([]byte, header.Len)
encoded, err := hdr.Encode(buf)
if err != nil {
fmt.Fprintf(os.Stderr, "Encode failed: %v\n", err)
os.Exit(1)
}
fmt.Printf("Encoded header (%d bytes): %s\n", len(encoded), hex.EncodeToString(encoded))
fmt.Printf("Type name: %s, SubType name: %s\n", hdr.TypeName(), hdr.SubTypeName())
fmt.Printf("Header summary: %s\n", hdr.String())
parsed, err := header.NewHeader(encoded)
if err != nil {
fmt.Fprintf(os.Stderr, "Parse failed: %v\n", err)
os.Exit(1)
}
fmt.Printf("Parsed RemoteIndex: %d, MessageCounter: %d\n", parsed.RemoteIndex, parsed.MessageCounter)
}
{
"schemaVersion": 1,
"goal": "verify github.com/slackhq/nebula/header.H in pkg:golang/github.com/slackhq/nebula@v1.6.1",
"kind": "HOW",
"packages": [
"pkg:golang/github.com/slackhq/nebula@v1.6.1"
],
"symbols": [
"github.com/slackhq/nebula/header.H"
]
}
package main
import (
"encoding/json"
"errors"
"fmt"
"os"
"github.com/slackhq/nebula/header"
)
func main() {
// Assertion 1: header.H encodes into 16-byte wire format and parses back identical header fields
orig := &header.H{
Version: header.Version,
Type: header.Message,
Subtype: header.MessageNone,
Reserved: 0,
RemoteIndex: 0xdeadbeef,
MessageCounter: 0x0123456789abcdef,
}
buf := make([]byte, header.Len)
encoded, err := orig.Encode(buf)
if err != nil {
fmt.Fprintf(os.Stderr, "FAIL: orig.Encode error: %v\n", err)
os.Exit(1)
}
if len(encoded) != header.Len {
fmt.Fprintf(os.Stderr, "FAIL: encoded length mismatch: got %d, expected %d\n", len(encoded), header.Len)
os.Exit(1)
}
parsed, err := header.NewHeader(encoded)
if err != nil {
fmt.Fprintf(os.Stderr, "FAIL: NewHeader parse error: %v\n", err)
os.Exit(1)
}
if *parsed != *orig {
fmt.Fprintf(os.Stderr, "FAIL: field mismatch after encode/parse: parsed=%+v, orig=%+v\n", parsed, orig)
os.Exit(1)
}
var parsedViaMethod header.H
if err := parsedViaMethod.Parse(encoded); err != nil {
fmt.Fprintf(os.Stderr, "FAIL: header.Parse error: %v\n", err)
os.Exit(1)
}
if parsedViaMethod != *orig {
fmt.Fprintf(os.Stderr, "FAIL: parsedViaMethod mismatch: got %+v, want %+v\n", parsedViaMethod, orig)
os.Exit(1)
}
// Assertion 2: header.NewHeader and header.H Parse reject byte slices shorter than 16 bytes with ErrHeaderTooShort
shortBuf := make([]byte, header.Len-1)
if _, err := header.NewHeader(shortBuf); !errors.Is(err, header.ErrHeaderTooShort) {
fmt.Fprintf(os.Stderr, "FAIL: expected ErrHeaderTooShort from NewHeader, got %v\n", err)
os.Exit(1)
}
var dummy header.H
if err := dummy.Parse(shortBuf); !errors.Is(err, header.ErrHeaderTooShort) {
fmt.Fprintf(os.Stderr, "FAIL: expected ErrHeaderTooShort from Parse, got %v\n", err)
os.Exit(1)
}
// Assertion 3: header.H Encode on nil pointer returns error without panicking
var nilHdr *header.H
if _, err := nilHdr.Encode(buf); err == nil {
fmt.Fprintf(os.Stderr, "FAIL: expected error encoding nil header, got nil\n")
os.Exit(1)
}
// Assertion 4: header.H TypeName and SubTypeName map known message types and subtypes to human strings
handshakeHdr := &header.H{
Version: header.Version,
Type: header.Handshake,
Subtype: header.HandshakeIXPSK0,
}
if handshakeHdr.TypeName() != "handshake" {
fmt.Fprintf(os.Stderr, "FAIL: Handshake TypeName mismatch: got %q, expected %q\n", handshakeHdr.TypeName(), "handshake")
os.Exit(1)
}
if handshakeHdr.SubTypeName() != "ix_psk0" {
fmt.Fprintf(os.Stderr, "FAIL: Handshake SubTypeName mismatch: got %q, expected %q\n", handshakeHdr.SubTypeName(), "ix_psk0")
os.Exit(1)
}
testHdr := &header.H{
Version: header.Version,
Type: header.Test,
Subtype: header.TestRequest,
}
if testHdr.TypeName() != "test" {
fmt.Fprintf(os.Stderr, "FAIL: Test TypeName mismatch: got %q, expected %q\n", testHdr.TypeName(), "test")
os.Exit(1)
}
if testHdr.SubTypeName() != "testRequest" {
fmt.Fprintf(os.Stderr, "FAIL: Test SubTypeName mismatch: got %q, expected %q\n", testHdr.SubTypeName(), "testRequest")
os.Exit(1)
}
// Assertion 5: header.H MarshalJSON produces valid JSON with string type names and numeric counters
jsonData, err := orig.MarshalJSON()
if err != nil {
fmt.Fprintf(os.Stderr, "FAIL: MarshalJSON error: %v\n", err)
os.Exit(1)
}
var jsonMap map[string]interface{}
if err := json.Unmarshal(jsonData, &jsonMap); err != nil {
fmt.Fprintf(os.Stderr, "FAIL: unmarshal JSON error: %v\n", err)
os.Exit(1)
}
if jsonMap["version"] != float64(1) ||
jsonMap["type"] != "message" ||
jsonMap["subType"] != "none" ||
jsonMap["remoteIndex"] != float64(0xdeadbeef) ||
jsonMap["messageCounter"] != float64(0x0123456789abcdef) {
fmt.Fprintf(os.Stderr, "FAIL: JSON fields mismatch: %s\n", string(jsonData))
os.Exit(1)
}
fmt.Println("PASS: github.com/slackhq/nebula/header.H contract verified")
}
Seeder de origen
anónimo