Пример
golang.org/x/net v0.61.0: atom.H5
Проверенный пример — golang golang.org/x/net v0.61.0: atom.H5. Контракт выполнен на go 1.26 · linux debian/x64 · docker и пройден.
sha256:e0d6be6a3f29049426d1eb4b867c188f9ed3f71dec2238d8e5a4e46b0fd5b09a
Эта сеть предлагает одно: образец, который собирается. Она запустила его в песочнице и сохранила подписанную квитанцию. Она ничего не оценивает и ничего не гарантирует — собирается ли тот же код у вас, она не измеряла.
Сколько различных ключей подписи подали пройденную квитанцию контракта. Один — только автор; больше одного — значит, кто-то ещё тоже собрал. Ключ создаётся сам и не имеет зарегистрированной личности, поэтому считаются ключи, а не люди.
MIT-0
Свидетельства выполнения
Заявленное окружение и подписанные запуски разделены, чтобы вы точно видели, что этот образец запускал и где.
- Основа свидетельства
- Подписанный контракт пройден
- Квитанции проверки
- 1
- Ключи подписи, собравшие его
- 1
Заявленная среда
linux 24 · ubuntu · glibc 2.39 x64 go
Среды запусков проверки
| Окружение | Контракт | Этапы | Запуск |
|---|---|---|---|
| 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 |
Кейс
HOW- Цель
- verify golang.org/x/net/html/atom.H5 in pkg:golang/golang.org/x/net@v0.61.0
- Пакеты
- Символы
-
- golang.org/x/net/html/atom.H5
- Создан
- 2026-10-12T05:28:02Z
Контракт
- atom.H5 is a non-zero Atom constant whose String() method returns "h5"
- atom.Lookup on byte slice "h5" returns atom.H5
- atom.String on byte slice "h5" returns "h5"
- atom.H5 is distinct from other heading atoms such as atom.H1, atom.H2, atom.H3, atom.H4, and atom.H6
- html.Parse on HTML containing <h5> tag yields an ElementNode with DataAtom equal to atom.H5
- explicitly created html.Node with DataAtom atom.H5 and Data "h5" renders as an <h5> element
Файлы
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract.go
Исходный код
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.H5 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.H5
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:da7b10180063c911dde10786e8cef197c0810040e49ccdd9b2dc55694152d745","contract":["atom.H5 is a non-zero Atom constant whose String() method returns \"h5\"","atom.Lookup on byte slice \"h5\" returns atom.H5","atom.String on byte slice \"h5\" returns \"h5\"","atom.H5 is distinct from other heading atoms such as atom.H1, atom.H2, atom.H3, atom.H4, and atom.H6","html.Parse on HTML containing \u003ch5\u003e tag yields an ElementNode with DataAtom equal to atom.H5","explicitly created html.Node with DataAtom atom.H5 and Data \"h5\" renders as an \u003ch5\u003e element"],"goal":"verify golang.org/x/net/html/atom.H5 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.H5"]},"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.H5"],"verifierAdapter":"golang@1"}
module sample
go 1.26.0
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 (
"bytes"
"fmt"
"strings"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
func main() {
fmt.Printf("atom: %s (value: %d)\n", atom.H5, atom.H5)
lookup := atom.Lookup([]byte("h5"))
fmt.Printf("atom.Lookup(\"h5\") == atom.H5: %t\n", lookup == atom.H5)
doc, err := html.Parse(strings.NewReader("<h5>Heading</h5>"))
if err != nil {
panic(err)
}
var found bool
var walk func(*html.Node)
walk = func(n *html.Node) {
if n.Type == html.ElementNode && n.DataAtom == atom.H5 {
found = true
return
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
walk(c)
}
}
walk(doc)
fmt.Printf("Found atom.H5 in parsed HTML: %t\n", found)
node := &html.Node{
Type: html.ElementNode,
DataAtom: atom.H5,
Data: atom.H5.String(),
}
var buf bytes.Buffer
if err := html.Render(&buf, node); err != nil {
panic(err)
}
fmt.Printf("Rendered element: %s\n", buf.String())
}
{
"schemaVersion": 1,
"goal": "verify golang.org/x/net/html/atom.H5 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.H5"
]
}
package main
import (
"bytes"
"fmt"
"os"
"strings"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
func main() {
// 1. atom.H5 is a non-zero Atom constant whose String() method returns "h5"
if atom.H5 == 0 {
fmt.Fprintf(os.Stderr, "assertion failed: atom.H5 should not be 0\n")
os.Exit(1)
}
if atom.H5.String() != "h5" {
fmt.Fprintf(os.Stderr, "assertion failed: atom.H5.String() = %q, want %q\n", atom.H5.String(), "h5")
os.Exit(1)
}
// 2. atom.Lookup on byte slice "h5" returns atom.H5
if got := atom.Lookup([]byte("h5")); got != atom.H5 {
fmt.Fprintf(os.Stderr, "assertion failed: atom.Lookup(\"h5\") = %v, want %v\n", got, atom.H5)
os.Exit(1)
}
// 3. atom.String on byte slice "h5" returns "h5"
if got := atom.String([]byte("h5")); got != "h5" {
fmt.Fprintf(os.Stderr, "assertion failed: atom.String(\"h5\") = %q, want %q\n", got, "h5")
os.Exit(1)
}
// 4. atom.H5 is distinct from other heading atoms such as atom.H1, atom.H2, atom.H3, atom.H4, and atom.H6
headings := []struct {
name string
a atom.Atom
}{
{"H1", atom.H1},
{"H2", atom.H2},
{"H3", atom.H3},
{"H4", atom.H4},
{"H6", atom.H6},
}
for _, h := range headings {
if atom.H5 == h.a {
fmt.Fprintf(os.Stderr, "assertion failed: atom.H5 unexpectedly equals atom.%s\n", h.name)
os.Exit(1)
}
}
// 5. html.Parse on HTML containing <h5> tag yields an ElementNode with DataAtom equal to atom.H5
doc, err := html.Parse(strings.NewReader("<!DOCTYPE html><html><body><h5>Heading 5</h5></body></html>"))
if err != nil {
fmt.Fprintf(os.Stderr, "assertion failed: html.Parse error: %v\n", err)
os.Exit(1)
}
var h5Found bool
var walk func(*html.Node)
walk = func(n *html.Node) {
if n.Type == html.ElementNode && n.DataAtom == atom.H5 {
if n.Data != "h5" {
fmt.Fprintf(os.Stderr, "assertion failed: expected element Data to be \"h5\", got %q\n", n.Data)
os.Exit(1)
}
h5Found = true
return
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
walk(c)
}
}
walk(doc)
if !h5Found {
fmt.Fprintf(os.Stderr, "assertion failed: <h5> tag with DataAtom == atom.H5 not found\n")
os.Exit(1)
}
// 6. explicitly created html.Node with DataAtom atom.H5 and Data "h5" renders as an <h5> element
node := &html.Node{
Type: html.ElementNode,
DataAtom: atom.H5,
Data: atom.H5.String(),
}
node.AppendChild(&html.Node{
Type: html.TextNode,
Data: "Test Content",
})
var buf bytes.Buffer
if err := html.Render(&buf, node); err != nil {
fmt.Fprintf(os.Stderr, "assertion failed: html.Render error: %v\n", err)
os.Exit(1)
}
expectedHTML := "<h5>Test Content</h5>"
if buf.String() != expectedHTML {
fmt.Fprintf(os.Stderr, "assertion failed: html.Render output = %q, want %q\n", buf.String(), expectedHTML)
os.Exit(1)
}
fmt.Println("All contract assertions passed successfully.")
}
Исходный сидер
аноним