Ejemplo
golang.org/x/text v0.3.4: language.French
Muestra verificada para golang golang.org/x/text v0.3.4: language.French. El contrato se ejecutó en go 1.26 · linux debian/x64 · docker y pasó.
sha256:8d9e6184ef9d5c172eb31d8b62701b408d06814965d0076cadd4aed7f611a2e1
Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido.
Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas.
MIT-0
Evidencia de ejecución
El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.
- Base de evidencia
- Contrato firmado aprobado
- Recibos de verificación
- 1
- Claves de firma que lo compilaron
- 1
Entorno declarado
linux 24 · ubuntu · glibc 2.39 x64 go
Entornos de las ejecuciones de verificación
| Entorno | Contrato | Etapas | Ejecución |
|---|---|---|---|
| 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-22 |
Caso
HOW- Objetivo
- verify golang.org/x/text/language.French in pkg:golang/golang.org/x/text@v0.3.4
- Paquetes
- Símbolos
-
- golang.org/x/text/language.French
- Creado
- 2026-10-22T10:50:44Z
Contrato
- language.French is a predefined Tag whose String representation equals 'fr' and equals language.Make('fr')
- language.French.Base returns Base 'fr' with Exact confidence
- language.French.Script infers Latin script 'Latn' with High confidence and Region infers 'FR' with Low confidence
- language.French.Parent returns Und root tag with IsRoot true
- language.NewMatcher with language.French matches French regional variants such as fr-CA and fr-BE to French
Archivos
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract.go
Código fuente
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/text/language.French in pkg:golang/golang.org/x/text@v0.3.4
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/text@v0.3.4
Demonstrate these symbols/APIs:
- golang.org/x/text/language.French
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:019b607349b0dc0ff927d86c97b8b39c1284f132ecd8c8713358f30a384d19cc","contract":["language.French is a predefined Tag whose String representation equals 'fr' and equals language.Make('fr')","language.French.Base returns Base 'fr' with Exact confidence","language.French.Script infers Latin script 'Latn' with High confidence and Region infers 'FR' with Low confidence","language.French.Parent returns Und root tag with IsRoot true","language.NewMatcher with language.French matches French regional variants such as fr-CA and fr-BE to French"],"goal":"verify golang.org/x/text/language.French in pkg:golang/golang.org/x/text@v0.3.4","kind":"HOW","packages":["pkg:golang/golang.org/x/text@v0.3.4"],"schemaVersion":1,"symbols":["golang.org/x/text/language.French"]},"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/text@v0.3.4"],"schemaVersion":1,"subject":"pkg:golang/golang.org/x/text@v0.3.4","symbols":["golang.org/x/text/language.French"],"verifierAdapter":"golang@1"}
module example.com/sample
go 1.23
require golang.org/x/text v0.3.4
golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
package main
import (
"fmt"
"golang.org/x/text/language"
)
func main() {
tag := language.French
fmt.Printf("Tag: %s\n", tag.String())
base, baseConf := tag.Base()
script, scriptConf := tag.Script()
region, regionConf := tag.Region()
fmt.Printf("Base: %s (%s), Script: %s (%s), Region: %s (%s)\n",
base, baseConf, script, scriptConf, region, regionConf)
parent := tag.Parent()
fmt.Printf("Parent of French: %s (is root: %t)\n", parent, parent.IsRoot())
matcher := language.NewMatcher([]language.Tag{
language.English,
language.German,
language.French,
})
matchedTag, index, conf := matcher.Match(language.Make("fr-CA"))
fmt.Printf("Matched: %s at index %d with confidence %s\n", matchedTag, index, conf)
}
{
"schemaVersion": 1,
"goal": "verify golang.org/x/text/language.French in pkg:golang/golang.org/x/text@v0.3.4",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/text@v0.3.4"
],
"symbols": [
"golang.org/x/text/language.French"
]
}
package main
import (
"fmt"
"os"
"golang.org/x/text/language"
)
func main() {
// Assertion 1: language.French is a predefined Tag whose String representation equals "fr" and equals language.Make("fr")
if tagStr := language.French.String(); tagStr != "fr" {
fmt.Fprintf(os.Stderr, "FAIL: expected language.French.String() to be 'fr', got %q\n", tagStr)
os.Exit(1)
}
if parsed := language.Make("fr"); parsed != language.French {
fmt.Fprintf(os.Stderr, "FAIL: expected language.Make('fr') to equal language.French\n")
os.Exit(1)
}
// Assertion 2: language.French.Base returns Base "fr" with Exact confidence
base, baseConf := language.French.Base()
if base.String() != "fr" {
fmt.Fprintf(os.Stderr, "FAIL: expected base 'fr', got %q\n", base.String())
os.Exit(1)
}
if baseConf != language.Exact {
fmt.Fprintf(os.Stderr, "FAIL: expected Exact confidence for base, got %v\n", baseConf)
os.Exit(1)
}
// Assertion 3: language.French.Script infers Latin script "Latn" with High confidence and Region infers "FR" with Low confidence
script, scriptConf := language.French.Script()
if script.String() != "Latn" {
fmt.Fprintf(os.Stderr, "FAIL: expected script 'Latn', got %q\n", script.String())
os.Exit(1)
}
if scriptConf != language.High {
fmt.Fprintf(os.Stderr, "FAIL: expected High confidence for inferred script, got %v\n", scriptConf)
os.Exit(1)
}
region, regionConf := language.French.Region()
if region.String() != "FR" {
fmt.Fprintf(os.Stderr, "FAIL: expected region 'FR', got %q\n", region.String())
os.Exit(1)
}
if regionConf != language.Low {
fmt.Fprintf(os.Stderr, "FAIL: expected Low confidence for inferred region, got %v\n", regionConf)
os.Exit(1)
}
// Assertion 4: language.French.Parent returns Und root tag with IsRoot true
parent := language.French.Parent()
if parent != language.Und {
fmt.Fprintf(os.Stderr, "FAIL: expected parent of French to be Und, got %v\n", parent)
os.Exit(1)
}
if !parent.IsRoot() {
fmt.Fprintf(os.Stderr, "FAIL: expected parent.IsRoot() to be true\n")
os.Exit(1)
}
// Assertion 5: language.NewMatcher with language.French matches French regional variants such as fr-CA and fr-BE to French
serverLangs := []language.Tag{
language.English,
language.German,
language.French,
}
matcher := language.NewMatcher(serverLangs)
frCA := language.Make("fr-CA")
_, indexCA, confCA := matcher.Match(frCA)
if serverLangs[indexCA] != language.French || indexCA != 2 {
fmt.Fprintf(os.Stderr, "FAIL: expected fr-CA to select serverLangs[2] (French), got index %d\n", indexCA)
os.Exit(1)
}
if confCA < language.High {
fmt.Fprintf(os.Stderr, "FAIL: expected High or Exact confidence for fr-CA match, got %v\n", confCA)
os.Exit(1)
}
frBE := language.Make("fr-BE")
_, indexBE, confBE := matcher.Match(frBE)
if serverLangs[indexBE] != language.French || indexBE != 2 {
fmt.Fprintf(os.Stderr, "FAIL: expected fr-BE to select serverLangs[2] (French), got index %d\n", indexBE)
os.Exit(1)
}
if confBE < language.High {
fmt.Fprintf(os.Stderr, "FAIL: expected High or Exact confidence for fr-BE match, got %v\n", confBE)
os.Exit(1)
}
if comp := language.Comprehends(frCA, language.French); comp < language.High {
fmt.Fprintf(os.Stderr, "FAIL: expected High comprehension between fr-CA and French, got %v\n", comp)
os.Exit(1)
}
fmt.Println("PASS: pkg:golang/golang.org/x/text@v0.3.4 language.French contract verified")
}
Seeder de origen
anónimo