Sample
golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914: html.Token
Verified sample for golang golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914: html.Token. The contract ran on go 1.26 · linux debian/x64 · docker and…
sha256:3e8e0cac4ce101e4298212ab4b3f2fc0a5333530ca49d0fc90ec2c1255ce680a
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-10-28 |
Case
HOW- Goal
- verify golang.org/x/net/html.Token in pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914
- Symbols
-
- golang.org/x/net/html.Token
- Created
- 2026-10-28T22:24:56Z
Contract
- Tokenizer.Token() returns an html.Token with Type StartTagToken, Data 'a', and parsed Attr slice for an anchor opening tag
- html.Token.String() reconstructs the HTML representation of a start tag token including attributes
- html.Token for a text node holds entity-unescaped text in Data and returns entity-escaped text from String()
Files
- PROMPT.md
- csx.json
- go.mod
- go.sum
- 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.Token in pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914
Demonstrate these symbols/APIs:
- golang.org/x/net/html.Token
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:fa15358fc960fe37a65eba884bec278d4c3ae0ea7ad389fe6fc908ccb5edccb3","contract":["Tokenizer.Token() returns an html.Token with Type StartTagToken, Data 'a', and parsed Attr slice for an anchor opening tag","html.Token.String() reconstructs the HTML representation of a start tag token including attributes","html.Token for a text node holds entity-unescaped text in Data and returns entity-escaped text from String()"],"goal":"verify golang.org/x/net/html.Token in pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914","kind":"HOW","packages":["pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914"],"schemaVersion":1,"symbols":["golang.org/x/net/html.Token"]},"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.0.0-20191119073136-fc4aabc6c914"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914","symbols":["golang.org/x/net/html.Token"],"verifierAdapter":"golang@1"}
module example.com/sample
go 1.21
require golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914 h1:MlY3mEfbnWGmUi4rtHOtNnnnN4UJRGSyLPx+DXA5Sq4=
golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
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=
{
"schemaVersion": 1,
"goal": "verify golang.org/x/net/html.Token in pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914"
],
"symbols": [
"golang.org/x/net/html.Token"
]
}
package main
import (
"fmt"
"os"
"strings"
"golang.org/x/net/html"
)
func main() {
raw := `<a href="https://example.com" class="link">Hello & Welcome</a>`
z := html.NewTokenizer(strings.NewReader(raw))
// First token: start tag <a>
tt1 := z.Next()
if tt1 != html.StartTagToken {
fmt.Fprintf(os.Stderr, "expected StartTagToken, got %v\n", tt1)
os.Exit(1)
}
var tok1 html.Token = z.Token()
if tok1.Type != html.StartTagToken || tok1.Data != "a" {
fmt.Fprintf(os.Stderr, "unexpected start tag token: %+v\n", tok1)
os.Exit(1)
}
if len(tok1.Attr) != 2 || tok1.Attr[0].Key != "href" || tok1.Attr[0].Val != "https://example.com" {
fmt.Fprintf(os.Stderr, "unexpected attributes: %+v\n", tok1.Attr)
os.Exit(1)
}
expectedStr1 := `<a href="https://example.com" class="link">`
if tok1.String() != expectedStr1 {
fmt.Fprintf(os.Stderr, "expected %q, got %q\n", expectedStr1, tok1.String())
os.Exit(1)
}
// Second token: text token with entity unescaped in Data and escaped in String()
tt2 := z.Next()
if tt2 != html.TextToken {
fmt.Fprintf(os.Stderr, "expected TextToken, got %v\n", tt2)
os.Exit(1)
}
var tok2 html.Token = z.Token()
if tok2.Type != html.TextToken || tok2.Data != "Hello & Welcome" {
fmt.Fprintf(os.Stderr, "unexpected text token data: %q\n", tok2.Data)
os.Exit(1)
}
if tok2.String() != "Hello & Welcome" {
fmt.Fprintf(os.Stderr, "unexpected text token String(): %q\n", tok2.String())
os.Exit(1)
}
// Third token: end tag </a>
tt3 := z.Next()
if tt3 != html.EndTagToken {
fmt.Fprintf(os.Stderr, "expected EndTagToken, got %v\n", tt3)
os.Exit(1)
}
var tok3 html.Token = z.Token()
if tok3.Type != html.EndTagToken || tok3.Data != "a" || tok3.String() != "</a>" {
fmt.Fprintf(os.Stderr, "unexpected end tag token: %+v\n", tok3)
os.Exit(1)
}
}
Origin Seeder
anonymous