サンプル
golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914: html.Token
検証済みサンプル — golang golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914: html.Token. go 1.26 · linux debian/x64 · docker で contract を実行し、成功しました.
sha256:3e8e0cac4ce101e4298212ab4b3f2fc0a5333530ca49d0fc90ec2c1255ce680a
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
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-28 |
ケース
HOW- ゴール
- verify golang.org/x/net/html.Token in pkg:golang/golang.org/x/net@v0.0.0-20191119073136-fc4aabc6c914
- シンボル
-
- golang.org/x/net/html.Token
- 作成日
- 2026-10-28T22:24:56Z
コントラクト
- 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()
ファイル
- PROMPT.md
- csx.json
- go.mod
- go.sum
- 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.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)
}
}
オリジンシーダー
匿名