Exemple
github.com/shurcooL/sanitized_anchor_name v1.0.0: Create
Échantillon vérifié pour golang github.com/shurcooL/sanitized_anchor_name v1.0.0: Create. Le contrat s'est exécuté sur go 1.26 · linux alpine/x64 · docker et…
sha256:d1e1795eed547d33888afc2bad4d19028d7aa42620166bfc34adbc9a28d46ccf
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 alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26-alpine@sha256:28d89ee9cc0f… |
2026-08-28 |
Cas
HOW- Objectif
- verify github.com/shurcooL/sanitized_anchor_name.Create in pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0
- Symboles
-
- github.com/shurcooL/sanitized_anchor_name.Create
- Créé
- 2026-08-28T00:06:49Z
Contrat
- sanitized_anchor_name.Create converts uppercase letters to lowercase and spaces to hyphens
- sanitized_anchor_name.Create strips punctuation and handles version numbers
- sanitized_anchor_name.Create trims leading and trailing whitespace and collapses multiple spaces
- sanitized_anchor_name.Create preserves non-ASCII Unicode letters
- sanitized_anchor_name.Create returns an empty string for empty or whitespace-only input
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 github.com/shurcooL/sanitized_anchor_name.Create in pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0
Demonstrate these symbols/APIs:
- github.com/shurcooL/sanitized_anchor_name.Create
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:6ce480bfc3681680a6037170950a2a8628af8dfd77dc92378660a11df45601c8","contract":["sanitized_anchor_name.Create converts uppercase letters to lowercase and spaces to hyphens","sanitized_anchor_name.Create strips punctuation and handles version numbers","sanitized_anchor_name.Create trims leading and trailing whitespace and collapses multiple spaces","sanitized_anchor_name.Create preserves non-ASCII Unicode letters","sanitized_anchor_name.Create returns an empty string for empty or whitespace-only input"],"goal":"verify github.com/shurcooL/sanitized_anchor_name.Create in pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0","kind":"HOW","packages":["pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0"],"schemaVersion":1,"symbols":["github.com/shurcooL/sanitized_anchor_name.Create"]},"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/github.com/shurcooL/sanitized_anchor_name@v1.0.0"],"schemaVersion":1,"subject":"pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0","symbols":["github.com/shurcooL/sanitized_anchor_name.Create"],"verifierAdapter":"golang@1"}
module sample
go 1.22
require github.com/shurcooL/sanitized_anchor_name v1.0.0
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
package main
import (
"fmt"
"github.com/shurcooL/sanitized_anchor_name"
)
func main() {
title := "User Guide & Reference (v1.0)"
anchor := sanitized_anchor_name.Create(title)
fmt.Printf("Input: %s -> Anchor: %s\n", title, anchor)
}
{
"schemaVersion": 1,
"goal": "verify github.com/shurcooL/sanitized_anchor_name.Create in pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0",
"kind": "HOW",
"packages": [
"pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0"
],
"symbols": [
"github.com/shurcooL/sanitized_anchor_name.Create"
]
}
package main
import (
"fmt"
"os"
"github.com/shurcooL/sanitized_anchor_name"
)
func main() {
if err := runContract(); err != nil {
fmt.Fprintf(os.Stderr, "Contract verification failed: %v\n", err)
os.Exit(1)
}
fmt.Println("All sanitized_anchor_name.Create contract assertions passed successfully.")
}
func runContract() error {
// Assertion 1: sanitized_anchor_name.Create converts uppercase letters to lowercase and spaces to hyphens
heading1 := "Getting Started"
expected1 := "getting-started"
if got := sanitized_anchor_name.Create(heading1); got != expected1 {
return fmt.Errorf("assertion 1 failed: expected %q, got %q", expected1, got)
}
// Assertion 2: sanitized_anchor_name.Create strips punctuation and handles version numbers
heading2 := "Features & Capabilities (v2.0)!"
expected2 := "features-capabilities-v2-0"
if got := sanitized_anchor_name.Create(heading2); got != expected2 {
return fmt.Errorf("assertion 2 failed: expected %q, got %q", expected2, got)
}
// Assertion 3: sanitized_anchor_name.Create trims leading and trailing whitespace and collapses multiple spaces
heading3 := " Whitespace Trimming Test "
expected3 := "whitespace-trimming-test"
if got := sanitized_anchor_name.Create(heading3); got != expected3 {
return fmt.Errorf("assertion 3 failed: expected %q, got %q", expected3, got)
}
// Assertion 4: sanitized_anchor_name.Create preserves non-ASCII Unicode letters
heading4 := "Chapitre 1: Introduction à la programmation"
expected4 := "chapitre-1-introduction-à-la-programmation"
if got := sanitized_anchor_name.Create(heading4); got != expected4 {
return fmt.Errorf("assertion 4 failed: expected %q, got %q", expected4, got)
}
// Assertion 5: sanitized_anchor_name.Create returns an empty string for empty or whitespace-only input
heading5 := " \t\n "
expected5 := ""
if got := sanitized_anchor_name.Create(heading5); got != expected5 {
return fmt.Errorf("assertion 5 failed: expected %q, got %q", expected5, got)
}
return nil
}
Seeder d'origine
anonyme