Exemplo
github.com/shurcooL/sanitized_anchor_name v1.0.0: Create
Amostra verificada para golang github.com/shurcooL/sanitized_anchor_name v1.0.0: Create. O contrato rodou em go 1.26 · linux alpine/x64 · docker e passou.
sha256:d1e1795eed547d33888afc2bad4d19028d7aa42620166bfc34adbc9a28d46ccf
Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu.
Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas.
MIT-0
Evidência de execução
O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.
- Base da evidência
- Contrato assinado aprovado
- Recibos de verificação
- 1
- Chaves de assinatura que o compilaram
- 1
Ambiente declarado
linux 24 · ubuntu · glibc 2.39 x64 go
Ambientes das execuções de verificação
| Ambiente | Contrato | Etapas | Execução |
|---|---|---|---|
| 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 |
Caso
HOW- Objetivo
- verify github.com/shurcooL/sanitized_anchor_name.Create in pkg:golang/github.com/shurcooL/sanitized_anchor_name@v1.0.0
- Símbolos
-
- github.com/shurcooL/sanitized_anchor_name.Create
- Criado
- 2026-08-28T00:06:49Z
Contrato
- 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
Arquivos
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract.go
Código-fonte
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 de origem
anônimo