Exemplo
golang.org/x/sys v0.47.0: registry.QUERY_VALUE
Amostra verificada para golang golang.org/x/sys v0.47.0: registry.QUERY_VALUE. O contrato rodou em go 1.26 · linux alpine/x64 · docker e passou.
sha256:ce8b7575f15f7ea5b09d248c8424fe29476caf9acca3472c4bbb2370c01ac1e8
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
- 2
- Chaves de assinatura que o compilaram
- 2
Ambiente declarado
windows 11 x64 go
Ambientes das execuções de verificação
| Ambiente | Contrato | Etapas | Execução |
|---|---|---|---|
| go 1.26 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1 |
2026-08-19 |
| 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-09-07 |
Caso
HOW- Objetivo
- verify golang.org/x/sys/windows/registry.QUERY_VALUE in pkg:golang/golang.org/x/sys@v0.47.0
- Pacotes
- Símbolos
-
- golang.org/x/sys/windows/registry.QUERY_VALUE
- Criado
- 2026-08-18T17:38:14Z
Contrato
- registry.QUERY_VALUE constant equals 0x0001
- registry.QUERY_VALUE bitwise mask check succeeds
- registry.READ access mask includes registry.QUERY_VALUE
- registry.ALL_ACCESS access mask includes registry.QUERY_VALUE
Arquivos
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/main.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 golang.org/x/sys/windows/registry.QUERY_VALUE in pkg:golang/golang.org/x/sys@v0.47.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/golang.org/x/sys@v0.47.0
Demonstrate these symbols/APIs:
- golang.org/x/sys/windows/registry.QUERY_VALUE
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:3134e2e65efe81b4261a516d6b0b78cd899f88094d653f14ef2d2f33ce1754f5","contract":["registry.QUERY_VALUE constant equals 0x0001","registry.QUERY_VALUE bitwise mask check succeeds","registry.READ access mask includes registry.QUERY_VALUE","registry.ALL_ACCESS access mask includes registry.QUERY_VALUE"],"goal":"verify golang.org/x/sys/windows/registry.QUERY_VALUE in pkg:golang/golang.org/x/sys@v0.47.0","kind":"HOW","packages":["pkg:golang/golang.org/x/sys@v0.47.0"],"schemaVersion":1,"symbols":["golang.org/x/sys/windows/registry.QUERY_VALUE"]},"contractCommand":["sh","-c","GOOS=windows go build ./..."],"environment":{"arch":"x64","ecosystem":"golang","os":"windows","osVersionBucket":"11","packageManager":"go","schemaVersion":1},"license":"MIT-0","packages":["pkg:golang/golang.org/x/sys@v0.47.0"],"schemaVersion":1,"symbols":["golang.org/x/sys/windows/registry.QUERY_VALUE"],"verifierAdapter":"golang@1"}
module sample
go 1.25.0
require golang.org/x/sys v0.47.0
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
package main
import (
"fmt"
"golang.org/x/sys/windows/registry"
)
// QueryValueMask returns the access mask constant registry.QUERY_VALUE.
func QueryValueMask() uint32 {
return registry.QUERY_VALUE
}
// OpenKeyWithQueryValue opens a Windows registry key with registry.QUERY_VALUE access rights.
func OpenKeyWithQueryValue(root registry.Key, path string) (registry.Key, error) {
return registry.OpenKey(root, path, registry.QUERY_VALUE)
}
// HasQueryValueAccess checks if the QUERY_VALUE permission bit is set in the provided access mask.
func HasQueryValueAccess(access uint32) bool {
return (access & registry.QUERY_VALUE) == registry.QUERY_VALUE
}
func main() {
mask := QueryValueMask()
fmt.Printf("registry.QUERY_VALUE access mask: 0x%04X\n", mask)
fmt.Printf("Has QUERY_VALUE in READ: %t\n", HasQueryValueAccess(registry.READ))
fmt.Printf("Has QUERY_VALUE in ALL_ACCESS: %t\n", HasQueryValueAccess(registry.ALL_ACCESS))
}
{
"schemaVersion": 1,
"goal": "verify golang.org/x/sys/windows/registry.QUERY_VALUE in pkg:golang/golang.org/x/sys@v0.47.0",
"kind": "HOW",
"packages": [
"pkg:golang/golang.org/x/sys@v0.47.0"
],
"symbols": [
"golang.org/x/sys/windows/registry.QUERY_VALUE"
]
}
package main
import (
"fmt"
"os"
"golang.org/x/sys/windows/registry"
)
func assertTrue(name string, condition bool) {
if !condition {
fmt.Fprintf(os.Stderr, "Assertion failed for %s: expected true, got false\n", name)
os.Exit(1)
}
}
func assertEqualUint32(name string, actual, expected uint32) {
if actual != expected {
fmt.Fprintf(os.Stderr, "Assertion failed for %s: got 0x%04X, expected 0x%04X\n", name, actual, expected)
os.Exit(1)
}
}
func main() {
// Assertion 1: registry.QUERY_VALUE constant equals 0x0001
assertEqualUint32("registry.QUERY_VALUE constant value", registry.QUERY_VALUE, 0x0001)
// Assertion 2: registry.QUERY_VALUE bitwise mask check succeeds
combinedAccess := uint32(registry.QUERY_VALUE | registry.ENUMERATE_SUB_KEYS)
assertTrue("Bitwise mask check for registry.QUERY_VALUE", (combinedAccess®istry.QUERY_VALUE) == registry.QUERY_VALUE)
// Assertion 3: registry.READ access mask includes registry.QUERY_VALUE
assertTrue("registry.READ access mask includes registry.QUERY_VALUE", (registry.READ®istry.QUERY_VALUE) == registry.QUERY_VALUE)
// Assertion 4: registry.ALL_ACCESS access mask includes registry.QUERY_VALUE
assertTrue("registry.ALL_ACCESS access mask includes registry.QUERY_VALUE", (registry.ALL_ACCESS®istry.QUERY_VALUE) == registry.QUERY_VALUE)
fmt.Println("All contract assertions passed successfully.")
}
Seeder de origem
anônimo