샘플
github.com/google/uuid v1.6.0: Generate and inspect DCE Security Version 2 UUIDs for Person, Group, and Org domains in google/uuid
검증된 샘플 — golang github.com/google/uuid v1.6.0: Generate and inspect DCE Security Version 2 UUIDs for Person, Group, and Org domains in google/uuid. go 1.26 …
sha256:ba3f251ea744f59cac7b3b0e4546182eb61f8e1a636d840c3350076b062b85af
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 2
- 빌드한 서명 키
- 2
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 go wsl
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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 debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26@sha256:e30143be198a… |
2026-09-07 |
케이스
HOW- 목표
- Generate and inspect DCE Security Version 2 UUIDs for Person, Group, and Org domains in google/uuid
- 심벌
-
- NewDCEGroup
- NewDCEPerson
- NewDCESecurity
- 생성일
- 2026-08-19T08:26:37Z
컨트랙트
- assert uuid.NewDCESecurity creates a Version 2 UUID with RFC4122 variant for specified domain and local ID
- assert uuid.NewDCEPerson creates a Version 2 UUID with Person domain and the caller's POSIX UID
- assert uuid.NewDCEGroup creates a Version 2 UUID with Group domain and the caller's POSIX GID
- assert UUID.Domain returns the expected Domain constant (Person, Group, Org) and UUID.ID returns the embedded 32-bit local ID
- assert UUID.Time extracts timestamp and UUID.NodeID returns valid 6-byte node identifier
파일
- PROMPT.md
- csx.json
- go.mod
- go.sum
- spec.json
- test/contract.go
소스
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: Generate and inspect DCE Security Version 2 UUIDs for Person, Group, and Org domains in google/uuid
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/github.com/google/uuid@v1.6.0
Demonstrate these symbols/APIs:
- NewDCEGroup
- NewDCEPerson
- NewDCESecurity
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@11.8.0
- runtime: node@22.22.2
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:a408cea86bff0ee89764e6b804c13bba42660cd3511c82b7b4b4492124794ab6","contract":["assert uuid.NewDCESecurity creates a Version 2 UUID with RFC4122 variant for specified domain and local ID","assert uuid.NewDCEPerson creates a Version 2 UUID with Person domain and the caller's POSIX UID","assert uuid.NewDCEGroup creates a Version 2 UUID with Group domain and the caller's POSIX GID","assert UUID.Domain returns the expected Domain constant (Person, Group, Org) and UUID.ID returns the embedded 32-bit local ID","assert UUID.Time extracts timestamp and UUID.NodeID returns valid 6-byte node identifier"],"goal":"Generate and inspect DCE Security Version 2 UUIDs for Person, Group, and Org domains in google/uuid","kind":"HOW","packages":["pkg:golang/github.com/google/uuid@v1.6.0"],"schemaVersion":1,"symbols":["NewDCEGroup","NewDCEPerson","NewDCESecurity"]},"contractCommand":["go","run","./test"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"golang","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"go","schemaVersion":1,"virtualization":"wsl"},"license":"MIT-0","packages":["pkg:golang/github.com/google/uuid@v1.6.0"],"schemaVersion":1,"symbols":["NewDCEGroup","NewDCEPerson","NewDCESecurity"],"verifierAdapter":"golang@1"}
module sample
go 1.25.13
require github.com/google/uuid v1.6.0
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
{
"schemaVersion": 1,
"goal": "Generate and inspect DCE Security Version 2 UUIDs for Person, Group, and Org domains in google/uuid",
"kind": "HOW",
"packages": [
"pkg:golang/github.com/google/uuid@v1.6.0"
],
"symbols": [
"NewDCEGroup",
"NewDCEPerson",
"NewDCESecurity"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@11.8.0",
"runtime": "node@22.22.2"
}
}
package main
import (
"fmt"
"os"
"github.com/google/uuid"
)
func main() {
// 1. assert uuid.NewDCESecurity creates a Version 2 UUID with RFC4122 variant for specified domain and local ID
customID := uint32(54321)
orgUUID, err := uuid.NewDCESecurity(uuid.Org, customID)
if err != nil {
panic(fmt.Sprintf("NewDCESecurity failed: %v", err))
}
if orgUUID.Version() != 2 {
panic(fmt.Sprintf("expected Version 2, got %v", orgUUID.Version()))
}
if orgUUID.Variant() != uuid.RFC4122 {
panic(fmt.Sprintf("expected RFC4122 variant, got %v", orgUUID.Variant()))
}
if orgUUID.Domain() != uuid.Org {
panic(fmt.Sprintf("expected Domain Org (%v), got %v", uuid.Org, orgUUID.Domain()))
}
if orgUUID.ID() != customID {
panic(fmt.Sprintf("expected ID %d, got %d", customID, orgUUID.ID()))
}
// 2. assert uuid.NewDCEPerson creates a Version 2 UUID with Person domain and the caller's POSIX UID
personUUID, err := uuid.NewDCEPerson()
if err != nil {
panic(fmt.Sprintf("NewDCEPerson failed: %v", err))
}
if personUUID.Version() != 2 {
panic(fmt.Sprintf("expected Version 2, got %v", personUUID.Version()))
}
if personUUID.Variant() != uuid.RFC4122 {
panic(fmt.Sprintf("expected RFC4122 variant, got %v", personUUID.Variant()))
}
if personUUID.Domain() != uuid.Person {
panic(fmt.Sprintf("expected Domain Person (%v), got %v", uuid.Person, personUUID.Domain()))
}
expectedUID := uint32(os.Getuid())
if personUUID.ID() != expectedUID {
panic(fmt.Sprintf("expected ID %d (uid), got %d", expectedUID, personUUID.ID()))
}
// 3. assert uuid.NewDCEGroup creates a Version 2 UUID with Group domain and the caller's POSIX GID
groupUUID, err := uuid.NewDCEGroup()
if err != nil {
panic(fmt.Sprintf("NewDCEGroup failed: %v", err))
}
if groupUUID.Version() != 2 {
panic(fmt.Sprintf("expected Version 2, got %v", groupUUID.Version()))
}
if groupUUID.Variant() != uuid.RFC4122 {
panic(fmt.Sprintf("expected RFC4122 variant, got %v", groupUUID.Variant()))
}
if groupUUID.Domain() != uuid.Group {
panic(fmt.Sprintf("expected Domain Group (%v), got %v", uuid.Group, groupUUID.Domain()))
}
expectedGID := uint32(os.Getgid())
if groupUUID.ID() != expectedGID {
panic(fmt.Sprintf("expected ID %d (gid), got %d", expectedGID, groupUUID.ID()))
}
// 4. assert UUID.Domain returns the expected Domain constant (Person, Group, Org) and UUID.ID returns the embedded 32-bit local ID
personSecUUID, err := uuid.NewDCESecurity(uuid.Person, 42)
if err != nil {
panic(fmt.Sprintf("NewDCESecurity(Person) failed: %v", err))
}
if personSecUUID.Domain() != uuid.Person || personSecUUID.ID() != 42 {
panic(fmt.Sprintf("expected Domain Person and ID 42, got %v and %d", personSecUUID.Domain(), personSecUUID.ID()))
}
groupSecUUID, err := uuid.NewDCESecurity(uuid.Group, 100)
if err != nil {
panic(fmt.Sprintf("NewDCESecurity(Group) failed: %v", err))
}
if groupSecUUID.Domain() != uuid.Group || groupSecUUID.ID() != 100 {
panic(fmt.Sprintf("expected Domain Group and ID 100, got %v and %d", groupSecUUID.Domain(), groupSecUUID.ID()))
}
// 5. assert UUID.Time extracts timestamp and UUID.NodeID returns valid 6-byte node identifier
t := orgUUID.Time()
if t <= 0 {
panic("expected positive Time timestamp from DCE UUID")
}
node := orgUUID.NodeID()
if len(node) != 6 {
panic(fmt.Sprintf("expected 6-byte node ID, got %d bytes", len(node)))
}
fmt.Println("Contract passed")
}
오리진 시더
익명