Exemple
golang.org/x/net v0.12.0: publicsuffix.PublicSuffix
Échantillon vérifié pour golang golang.org/x/net v0.12.0: publicsuffix.PublicSuffix. Le contrat s'est exécuté sur go 1.26 · linux debian/x64 · docker et a…
sha256:5770c8147f1b43b4d50767a734dcba16dcd31213c597d8080c3e0bb1ca0ac683
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-09-02 |
Cas
HOW- Objectif
- verify golang.org/x/net/publicsuffix.PublicSuffix in pkg:golang/golang.org/x/net@v0.12.0
- Paquets
- Symboles
-
- golang.org/x/net/publicsuffix.PublicSuffix
- Créé
- 2026-09-02T21:34:42Z
Contrat
- publicsuffix.PublicSuffix extracts the public suffix and indicates if it is managed by ICANN for domain names
Fichiers
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- 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/publicsuffix.PublicSuffix in pkg:golang/golang.org/x/net@v0.12.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/net@v0.12.0
Demonstrate these symbols/APIs:
- golang.org/x/net/publicsuffix.PublicSuffix
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:2cc2be891c0eb138da1e4c293f65654246f717c5f4e8c011dfd530682871804c","contract":["publicsuffix.PublicSuffix extracts the public suffix and indicates if it is managed by ICANN for domain names"],"goal":"verify golang.org/x/net/publicsuffix.PublicSuffix in pkg:golang/golang.org/x/net@v0.12.0","kind":"HOW","packages":["pkg:golang/golang.org/x/net@v0.12.0"],"schemaVersion":1,"symbols":["golang.org/x/net/publicsuffix.PublicSuffix"]},"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.12.0"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/net@v0.12.0","symbols":["golang.org/x/net/publicsuffix.PublicSuffix"],"verifierAdapter":"golang@1"}
module example.com/sample
go 1.25.0
require golang.org/x/net v0.12.0
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
package main
import (
"fmt"
"golang.org/x/net/publicsuffix"
)
func main() {
domains := []string{
"example.com",
"subdomain.example.co.uk",
"golang.org",
"myproject.github.io",
}
for _, domain := range domains {
suffix, icann := publicsuffix.PublicSuffix(domain)
fmt.Printf("domain: %s -> suffix: %s, icann: %t\n", domain, suffix, icann)
}
}
{
"schemaVersion": 1,
"goal": "verify golang.org/x/net/publicsuffix.PublicSuffix in pkg:golang/golang.org/x/net@v0.12.0",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/net@v0.12.0"
],
"symbols": [
"golang.org/x/net/publicsuffix.PublicSuffix"
]
}
package main
import (
"fmt"
"os"
"golang.org/x/net/publicsuffix"
)
func main() {
// Assertion 1: publicsuffix.PublicSuffix extracts the public suffix and indicates if it is managed by ICANN for domain names
{
testCases := []struct {
domain string
wantSuffix string
wantICANN bool
}{
{"example.com", "com", true},
{"foo.example.co.uk", "co.uk", true},
{"golang.org", "org", true},
{"myproject.github.io", "github.io", false},
{"customblog.blogspot.com", "blogspot.com", false},
{"localhost", "localhost", false},
}
for _, tc := range testCases {
gotSuffix, gotICANN := publicsuffix.PublicSuffix(tc.domain)
if gotSuffix != tc.wantSuffix || gotICANN != tc.wantICANN {
fmt.Fprintf(os.Stderr, "assertion 1 failed for %q: got (%q, %v), want (%q, %v)\n",
tc.domain, gotSuffix, gotICANN, tc.wantSuffix, tc.wantICANN)
os.Exit(1)
}
}
}
fmt.Println("PASS: pkg:golang/golang.org/x/net@v0.12.0 contract passed")
}
Seeder d'origine
anonyme