Use crypto/rand-backed stdlib uuid.NewV4().String() for random UUIDs and stdlib parsing instead of github.com/google/uuid, wherever the stdlib can express the behavior.
github.com/google/uuid is kept only in pkg/model/provider/base/opencode.go for uuid.NewSHA1, since the stdlib has no UUIDv5 support; the namespace and resulting IDs are unchanged.
pkg/userid/userid.go keeps a compatibility helper that preserves every legacy persisted-ID form the Google parser accepted, without rewriting or rotating existing IDs. pkg/evaluation/eval.go keeps reading the first 4 UUID bytes as big-endian to preserve existing decimal evaluation names.
Added tests covering v4 bit layout, legacy persisted-ID forms, the evaluation name format, and the OpenCode UUIDv5 fallback.
Signed-off-by: David Gageot <david.gageot@docker.com>
Replace package-level mutable state with a Resolver struct that owns
its directory and cache. Tests create isolated instances via New(t.TempDir())
and can now run with t.Parallel() without sharing global state.
Remove ResetForTests as it is no longer needed.
Assisted-By: Claude
The save helper created the config directory with 0o755, letting
any local user enumerate it and observe that the user-uuid file
exists (and its mtime via ls -la), even though they cannot read
its 0o600-protected contents.
Since the UUID is a persistent per-install identifier forwarded as
X-Cagent-Id on every gateway request, directory-level enumeration
on a shared/multi-user host is a mild privacy leak. Use 0o700 on
the directory to match the 0o600 protection on the file itself,
consistent with other sensitive paths in the codebase (sandbox
tokens, sqlite stores, log files).
Assisted-By: docker-agent