Sample
golang.org/x/net v0.24.0: atom.H6
Verified sample for golang golang.org/x/net v0.24.0: atom.H6. The contract ran on go 1.26 · linux debian/x64 · docker and passed: atom.H6 constant represents…
sha256:9b5b05b08eac5dee2f7c159ae17d1154c719df33bec95740c944f7de5f4007d9
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 debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26@sha256:e30143be198a… |
2026-09-05 |
Case
HOW- Goal
- verify golang.org/x/net/html/atom.H6 in pkg:golang/golang.org/x/net@v0.24.0
- Packages
- Symbols
-
- golang.org/x/net/html/atom.H6
- Created
- 2026-09-05T10:42:30Z
Contract
- atom.H6 constant represents the HTML h6 element tag with string value h6
- atom.Lookup resolves byte slice []byte("h6") to atom.H6
- html.Tokenizer recognizes <h6> start and end tags with atom.Lookup matching atom.H6
- html.Parse constructs an AST ElementNode with DataAtom equal to atom.H6 for heading elements
- html.Render formats an ElementNode with DataAtom atom.H6 into valid HTML <h6> element tags
Files
- PROMPT.md
- csx.json
- go.mod
- go.sum
- sample.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 golang.org/x/net/html/atom.H6 in pkg:golang/golang.org/x/net@v0.24.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/net@v0.24.0
Demonstrate these symbols/APIs:
- golang.org/x/net/html/atom.H6
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:36cf146c0de88fe38b23ee0a081afd18c538b6cfe05ee7fa4407f450bea99208","contract":["atom.H6 constant represents the HTML h6 element tag with string value h6","atom.Lookup resolves byte slice []byte(\"h6\") to atom.H6","html.Tokenizer recognizes \u003ch6\u003e start and end tags with atom.Lookup matching atom.H6","html.Parse constructs an AST ElementNode with DataAtom equal to atom.H6 for heading elements","html.Render formats an ElementNode with DataAtom atom.H6 into valid HTML \u003ch6\u003e element tags"],"goal":"verify golang.org/x/net/html/atom.H6 in pkg:golang/golang.org/x/net@v0.24.0","kind":"HOW","packages":["pkg:golang/golang.org/x/net@v0.24.0"],"schemaVersion":1,"symbols":["golang.org/x/net/html/atom.H6"]},"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.24.0"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/net@v0.24.0","symbols":["golang.org/x/net/html/atom.H6"],"verifierAdapter":"golang@1"}
module sample
go 1.22
require golang.org/x/net v0.24.0
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
package sample
import (
"bytes"
"fmt"
"io"
"strings"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
// IsH6Atom returns true if the given atom equals atom.H6.
func IsH6Atom(a atom.Atom) bool {
return a == atom.H6
}
// LookupH6 checks if the byte slice maps to atom.H6.
func LookupH6(b []byte) (atom.Atom, bool) {
a := atom.Lookup(b)
return a, a == atom.H6
}
// FindH6Nodes recursively searches an HTML node tree for all element nodes with DataAtom == atom.H6.
func FindH6Nodes(root *html.Node) []*html.Node {
var results []*html.Node
var walk func(*html.Node)
walk = func(n *html.Node) {
if n.Type == html.ElementNode && n.DataAtom == atom.H6 {
results = append(results, n)
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
walk(c)
}
}
walk(root)
return results
}
// RenderH6 creates an HTML element node for atom.H6 and renders it to a string.
func RenderH6(text string) (string, error) {
h6Node := &html.Node{
Type: html.ElementNode,
DataAtom: atom.H6,
Data: atom.H6.String(),
}
if text != "" {
h6Node.AppendChild(&html.Node{
Type: html.TextNode,
Data: text,
})
}
var buf bytes.Buffer
if err := html.Render(&buf, h6Node); err != nil {
return "", fmt.Errorf("render h6: %w", err)
}
return buf.String(), nil
}
// ExtractH6Headings parses HTML content and extracts the text content of all <h6> headings.
func ExtractH6Headings(r io.Reader) ([]string, error) {
doc, err := html.Parse(r)
if err != nil {
return nil, fmt.Errorf("parse html: %w", err)
}
nodes := FindH6Nodes(doc)
var headings []string
for _, n := range nodes {
var text strings.Builder
for c := n.FirstChild; c != nil; c = c.NextSibling {
if c.Type == html.TextNode {
text.WriteString(c.Data)
}
}
headings = append(headings, text.String())
}
return headings, nil
}
{
"schemaVersion": 1,
"goal": "verify golang.org/x/net/html/atom.H6 in pkg:golang/golang.org/x/net@v0.24.0",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/net@v0.24.0"
],
"symbols": [
"golang.org/x/net/html/atom.H6"
]
}
package main
import (
"fmt"
"os"
"strings"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
"sample"
)
func main() {
// Assertion 1: atom.H6 constant represents the HTML h6 element tag with string value "h6"
if atom.H6 == 0 {
fmt.Fprintf(os.Stderr, "FAIL: atom.H6 must not be zero\n")
os.Exit(1)
}
if atom.H6.String() != "h6" {
fmt.Fprintf(os.Stderr, "FAIL: expected atom.H6.String() == 'h6', got %q\n", atom.H6.String())
os.Exit(1)
}
if !sample.IsH6Atom(atom.H6) {
fmt.Fprintf(os.Stderr, "FAIL: sample.IsH6Atom failed for atom.H6\n")
os.Exit(1)
}
if sample.IsH6Atom(atom.H1) {
fmt.Fprintf(os.Stderr, "FAIL: sample.IsH6Atom returned true for atom.H1\n")
os.Exit(1)
}
// Assertion 2: atom.Lookup resolves byte slice []byte("h6") to atom.H6
lookedUp, isH6 := sample.LookupH6([]byte("h6"))
if !isH6 || lookedUp != atom.H6 {
fmt.Fprintf(os.Stderr, "FAIL: expected LookupH6('h6') to return atom.H6, got %v\n", lookedUp)
os.Exit(1)
}
if atom.String([]byte("h6")) != "h6" {
fmt.Fprintf(os.Stderr, "FAIL: expected atom.String('h6') == 'h6', got %q\n", atom.String([]byte("h6")))
os.Exit(1)
}
_, notH6 := sample.LookupH6([]byte("div"))
if notH6 {
fmt.Fprintf(os.Stderr, "FAIL: LookupH6('div') unexpectedly returned true\n")
os.Exit(1)
}
// Assertion 3: html.Tokenizer recognizes <h6> start and end tags with atom.Lookup matching atom.H6
snippet := "<article><h6>Subheading</h6><p>Content</p></article>"
tokenizer := html.NewTokenizer(strings.NewReader(snippet))
foundStart := false
foundEnd := false
for {
tt := tokenizer.Next()
if tt == html.ErrorToken {
break
}
tagName, _ := tokenizer.TagName()
if tt == html.StartTagToken && atom.Lookup(tagName) == atom.H6 {
foundStart = true
}
if tt == html.EndTagToken && atom.Lookup(tagName) == atom.H6 {
foundEnd = true
}
}
if !foundStart {
fmt.Fprintf(os.Stderr, "FAIL: html.Tokenizer failed to identify <h6> StartTagToken with atom.H6\n")
os.Exit(1)
}
if !foundEnd {
fmt.Fprintf(os.Stderr, "FAIL: html.Tokenizer failed to identify </h6> EndTagToken with atom.H6\n")
os.Exit(1)
}
// Assertion 4: html.Parse constructs an AST ElementNode with DataAtom equal to atom.H6 for heading elements
htmlDoc := `<html><body><h6>Header Level 6</h6><p>Body</p><h6>Another Heading</h6></body></html>`
headings, err := sample.ExtractH6Headings(strings.NewReader(htmlDoc))
if err != nil {
fmt.Fprintf(os.Stderr, "FAIL: ExtractH6Headings returned error: %v\n", err)
os.Exit(1)
}
if len(headings) != 2 {
fmt.Fprintf(os.Stderr, "FAIL: expected 2 headings, got %d\n", len(headings))
os.Exit(1)
}
if headings[0] != "Header Level 6" || headings[1] != "Another Heading" {
fmt.Fprintf(os.Stderr, "FAIL: unexpected headings extracted: %v\n", headings)
os.Exit(1)
}
// Assertion 5: html.Render formats an ElementNode with DataAtom atom.H6 into valid HTML <h6> element tags
rendered, err := sample.RenderH6("Nested Heading Text")
if err != nil {
fmt.Fprintf(os.Stderr, "FAIL: RenderH6 returned error: %v\n", err)
os.Exit(1)
}
expectedRender := "<h6>Nested Heading Text</h6>"
if rendered != expectedRender {
fmt.Fprintf(os.Stderr, "FAIL: expected rendered %q, got %q\n", expectedRender, rendered)
os.Exit(1)
}
emptyRender, err := sample.RenderH6("")
if err != nil {
fmt.Fprintf(os.Stderr, "FAIL: RenderH6 empty returned error: %v\n", err)
os.Exit(1)
}
if emptyRender != "<h6></h6>" {
fmt.Fprintf(os.Stderr, "FAIL: expected empty render '<h6></h6>', got %q\n", emptyRender)
os.Exit(1)
}
fmt.Println("PASS: all golang.org/x/net/html/atom.H6 contract assertions passed")
}
Origin Seeder
anonymous