Exemple
golang.org/x/net v0.0.0-20210525063256-abc453219eb5: atom.Form
Échantillon vérifié pour golang golang.org/x/net v0.0.0-20210525063256-abc453219eb5: atom.Form. Le contrat s'est exécuté sur go 1.26 · linux debian/x64 …
sha256:ff8e5b9f11a20a02c20eea46762bd6646b193ebbfd084cdec437e75a7c592182
Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré.
Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes.
MIT-0
Preuves d'exécution
L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.
- Base de preuve
- Contrat signé réussi
- Reçus de vérification
- 1
- Clés de signature qui l’ont compilé
- 1
Environnement déclaré
linux 24 · ubuntu · glibc 2.39 x64 go
Environnements des exécutions de vérification
| Environnement | Contrat | Étapes | Exécution |
|---|---|---|---|
| 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-19 |
Cas
HOW- Objectif
- verify golang.org/x/net/html/atom.Form in pkg:golang/golang.org/x/net@v0.0.0-20210525063256-abc453219eb5
- Symboles
-
- golang.org/x/net/html/atom.Form
- Créé
- 2026-10-19T17:31:52Z
Contrat
- atom.Form is a non-zero Atom constant representing the form HTML tag
- atom.Form.String() returns the lowercase string "form"
- atom.Lookup([]byte("form")) returns atom.Form
- atom.Lookup is case-sensitive and returns 0 for []byte("FORM")
- atom.String([]byte("form")) returns "form"
- atom.Form is distinct from atom.Input, atom.Div, and atom.Formaction
- html.NewTokenizer yields start and end tag tokens with DataAtom equal to atom.Form for a form element
- html.Parse produces an ElementNode with DataAtom equal to atom.Form for a form element
Fichiers
- PROMPT.md
- csx.json
- go.mod
- go.sum
- spec.json
- test/contract.go
Code 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.Form in pkg:golang/golang.org/x/net@v0.0.0-20210525063256-abc453219eb5
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/net@v0.0.0-20210525063256-abc453219eb5
Demonstrate these symbols/APIs:
- golang.org/x/net/html/atom.Form
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:ffeb74bf32c4797b67f62c2827abe2a6ee2f2f5a39baa75a8cbf9fdf8bd41a49","contract":["atom.Form is a non-zero Atom constant representing the form HTML tag","atom.Form.String() returns the lowercase string \"form\"","atom.Lookup([]byte(\"form\")) returns atom.Form","atom.Lookup is case-sensitive and returns 0 for []byte(\"FORM\")","atom.String([]byte(\"form\")) returns \"form\"","atom.Form is distinct from atom.Input, atom.Div, and atom.Formaction","html.NewTokenizer yields start and end tag tokens with DataAtom equal to atom.Form for a form element","html.Parse produces an ElementNode with DataAtom equal to atom.Form for a form element"],"goal":"verify golang.org/x/net/html/atom.Form in pkg:golang/golang.org/x/net@v0.0.0-20210525063256-abc453219eb5","kind":"HOW","packages":["pkg:golang/golang.org/x/net@v0.0.0-20210525063256-abc453219eb5"],"schemaVersion":1,"symbols":["golang.org/x/net/html/atom.Form"]},"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-20210525063256-abc453219eb5"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/net@v0.0.0-20210525063256-abc453219eb5","symbols":["golang.org/x/net/html/atom.Form"],"verifierAdapter":"golang@1"}
module sample
go 1.21
require golang.org/x/net v0.0.0-20210525063256-abc453219eb5
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
{
"schemaVersion": 1,
"goal": "verify golang.org/x/net/html/atom.Form in pkg:golang/golang.org/x/net@v0.0.0-20210525063256-abc453219eb5",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/net@v0.0.0-20210525063256-abc453219eb5"
],
"symbols": [
"golang.org/x/net/html/atom.Form"
]
}
package main
import (
"fmt"
"os"
"strings"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
func assert(cond bool, msg string) {
if !cond {
fmt.Fprintln(os.Stderr, "assertion failed:", msg)
os.Exit(1)
}
}
func main() {
// 1. atom.Form is a non-zero Atom constant representing the "form" HTML tag
var formAtom atom.Atom = atom.Form
assert(formAtom != 0, "atom.Form should be a non-zero Atom constant")
// 2. atom.Form.String() returns the lowercase string "form"
assert(formAtom.String() == "form", "atom.Form.String() should return \"form\"")
// 3. atom.Lookup([]byte("form")) resolves to atom.Form
assert(atom.Lookup([]byte("form")) == atom.Form, "atom.Lookup([]byte(\"form\")) should equal atom.Form")
// 4. atom.Lookup is case-sensitive and returns 0 for uppercase "FORM"
assert(atom.Lookup([]byte("FORM")) == 0, "atom.Lookup([]byte(\"FORM\")) should return 0")
// 5. atom.String([]byte("form")) returns "form"
assert(atom.String([]byte("form")) == "form", "atom.String([]byte(\"form\")) should return \"form\"")
// 6. atom.Form is distinct from other form-related and block atoms
assert(atom.Form != atom.Input, "atom.Form should be distinct from atom.Input")
assert(atom.Form != atom.Div, "atom.Form should be distinct from atom.Div")
assert(atom.Form != atom.Formaction, "atom.Form should be distinct from atom.Formaction")
// 7. html.NewTokenizer sets Token.DataAtom to atom.Form when tokenizing a <form> start and end tag
z := html.NewTokenizer(strings.NewReader(`<form action="/submit"><input type="text"></form>`))
tt := z.Next()
assert(tt == html.StartTagToken, "first token should be StartTagToken")
tok := z.Token()
assert(tok.DataAtom == atom.Form, "start tag Token.DataAtom should equal atom.Form")
assert(tok.Data == "form", "start tag Token.Data should equal \"form\"")
tt = z.Next()
assert(tt == html.StartTagToken, "second token should be StartTagToken for input")
assert(z.Token().DataAtom == atom.Input, "second token DataAtom should equal atom.Input")
tt = z.Next()
assert(tt == html.EndTagToken, "third token should be EndTagToken")
endTok := z.Token()
assert(endTok.DataAtom == atom.Form, "end tag Token.DataAtom should equal atom.Form")
// 8. html.Parse sets Node.DataAtom to atom.Form on parsed <form> ElementNode
doc, err := html.Parse(strings.NewReader(`<!DOCTYPE html><html><body><form id="f1"></form></body></html>`))
assert(err == nil, "html.Parse should succeed without error")
var foundForm bool
var walk func(*html.Node)
walk = func(n *html.Node) {
if n.Type == html.ElementNode && n.DataAtom == atom.Form {
foundForm = true
assert(n.Data == "form", "parsed ElementNode with atom.Form should have Data == \"form\"")
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
walk(c)
}
}
walk(doc)
assert(foundForm, "html.Parse should produce an ElementNode with DataAtom == atom.Form")
}
Seeder d'origine
anonyme