Exemplo
golang.org/x/net v0.61.0: atom.H3
Amostra verificada para golang golang.org/x/net v0.61.0: atom.H3. O contrato rodou em go 1.26 · linux debian/x64 · docker e passou.
sha256:b537b7e8a9a88a21499859d1e0e20d62ebd063db26088c23b238a4ee3517d745
Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu.
Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas.
MIT-0
Evidência de execução
O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.
- Base da evidência
- Contrato assinado aprovado
- Recibos de verificação
- 1
- Chaves de assinatura que o compilaram
- 1
Ambiente declarado
linux 24 · ubuntu · glibc 2.39 x64 go
Ambientes das execuções de verificação
| Ambiente | Contrato | Etapas | Execução |
|---|---|---|---|
| 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-10-12 |
Caso
HOW- Objetivo
- verify golang.org/x/net/html/atom.H3 in pkg:golang/golang.org/x/net@v0.61.0
- Pacotes
- Símbolos
-
- golang.org/x/net/html/atom.H3
- Criado
- 2026-10-12T04:20:56Z
Contrato
- atom.H3 is non-zero and its String method returns "h3"
- atom.Lookup returns atom.H3 for byte slice "h3"
- html.Parse parses <h3> element with DataAtom equal to atom.H3
Arquivos
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract.go
Código-fonte
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 golang.org/x/net/html/atom.H3 in pkg:golang/golang.org/x/net@v0.61.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/net@v0.61.0
Demonstrate these symbols/APIs:
- golang.org/x/net/html/atom.H3
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:93c88f29e41d98d625458276dc0cb7cd1bd16e11f09a491ddb6cf9b80e3504b4","contract":["atom.H3 is non-zero and its String method returns \"h3\"","atom.Lookup returns atom.H3 for byte slice \"h3\"","html.Parse parses \u003ch3\u003e element with DataAtom equal to atom.H3"],"goal":"verify golang.org/x/net/html/atom.H3 in pkg:golang/golang.org/x/net@v0.61.0","kind":"HOW","packages":["pkg:golang/golang.org/x/net@v0.61.0"],"schemaVersion":1,"symbols":["golang.org/x/net/html/atom.H3"]},"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/net@v0.61.0"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/net@v0.61.0","symbols":["golang.org/x/net/html/atom.H3"],"verifierAdapter":"golang@1"}
module example.com/sample
go 1.26.6
require golang.org/x/net v0.61.0
golang.org/x/net v0.61.0 h1:RR+6j/BTBCrggOLugxa+66R8FvoN6MHlzDlZIbN9YFw=
golang.org/x/net v0.61.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
package main
import (
"fmt"
"strings"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
func main() {
rawHTML := "<div><h3>Heading 3 Text</h3><p>Paragraph</p></div>"
doc, err := html.Parse(strings.NewReader(rawHTML))
if err != nil {
panic(err)
}
var foundH3 bool
var traverse func(*html.Node)
traverse = func(n *html.Node) {
if n.Type == html.ElementNode && n.DataAtom == atom.H3 {
foundH3 = true
if n.FirstChild != nil {
fmt.Printf("Found <%s>: %s\n", n.DataAtom.String(), n.FirstChild.Data)
}
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
traverse(c)
}
}
traverse(doc)
if !foundH3 {
panic("expected to find <h3> element")
}
lookupAtom := atom.Lookup([]byte("h3"))
fmt.Printf("Lookup 'h3' matches atom.H3: %t\n", lookupAtom == atom.H3)
}
{
"schemaVersion": 1,
"goal": "verify golang.org/x/net/html/atom.H3 in pkg:golang/golang.org/x/net@v0.61.0",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/net@v0.61.0"
],
"symbols": [
"golang.org/x/net/html/atom.H3"
]
}
package main
import (
"fmt"
"os"
"strings"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
func main() {
if err := runContractTests(); err != nil {
fmt.Fprintf(os.Stderr, "Contract test failed: %v\n", err)
os.Exit(1)
}
fmt.Println("All contract assertions passed.")
}
func runContractTests() error {
// Assertion 1: atom.H3 is non-zero and its String method returns "h3"
if atom.H3 == 0 {
return fmt.Errorf("expected atom.H3 to be non-zero, got 0")
}
if got := atom.H3.String(); got != "h3" {
return fmt.Errorf("expected atom.H3.String() to be %q, got %q", "h3", got)
}
// Assertion 2: atom.Lookup returns atom.H3 for byte slice "h3"
if got := atom.Lookup([]byte("h3")); got != atom.H3 {
return fmt.Errorf("expected atom.Lookup([]byte(\"h3\")) to be atom.H3 (%d), got %d", atom.H3, got)
}
// Assertion 3: html.Parse parses <h3> element with DataAtom equal to atom.H3
doc, err := html.Parse(strings.NewReader("<html><body><H3>Section Heading</H3></body></html>"))
if err != nil {
return fmt.Errorf("html.Parse failed: %w", err)
}
var foundH3 bool
var traverse func(*html.Node)
traverse = func(n *html.Node) {
if n.Type == html.ElementNode && n.DataAtom == atom.H3 {
foundH3 = true
if n.Data != "h3" {
// Note: HTML parser canonicalizes tag names to lower case
err = fmt.Errorf("expected Data to be %q, got %q", "h3", n.Data)
}
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
traverse(c)
}
}
traverse(doc)
if err != nil {
return err
}
if !foundH3 {
return fmt.Errorf("failed to find ElementNode with DataAtom == atom.H3")
}
return nil
}
Seeder de origem
anônimo