Audit of implementation against the master prompt and specification.
| Category | Status | Notes |
|---|---|---|
| Security (verify-before-materialize) | PASS | Temp file, fsync, atomic rename |
| Path traversal defense | PASS | SanitizeFilename, basename only |
| Tag grammar | PASS | Matches SPEC.md |
| Empty descriptor | PASS | Canonical digest |
| Chunk format | PASS | chunk_N.bin, annotations |
| Discovery (tag + referrers fallback) | PASS | Implemented |
| Exit codes | PASS | 0-5 per contract |
| oras-go version | PASS | oras-go/v2 (stable production line per locked doctrine) |
| No emojis | PASS | None in code/docs |
| No TODO comments | PASS | None |
-
os.Exit outside main: CLI handlers call os.Exit. Master prompt: "os.Exit() outside main()" prohibited. Fix: return ExitError type, handle in main.
-
Ignored errors (_ = ): MarkFlagRequired, unused vars. Fix: handle or remove.
-
Constant-time digest comparison: Not used. sigstore-go does internal verification; add for any manual digest checks.
-
License headers: No SPDX headers in source files. Add to each .go file.
-
golangci-lint config: Missing .golangci.yml. Add with gosec, staticcheck, errcheck.
-
CHANGELOG.md: Missing. Add with v1.0.0 entry.
-
Package doc comments: Some packages lack package-level docs.
-
watch, gc commands: Master prompt lists them; SPEC says optional. Not implemented.
-
internal/version: Master prompt lists it. Not implemented.
-
Viper config: Master prompt says "NO defaults in code"; we use flag defaults. Config is minimal.
-
100% test coverage: Not achieved for crypto, OCI, chunking.
| Master Prompt | Our Implementation |
|---|---|
| pkg/oci/chunk.go | pkg/transfer/chunker.go |
| pkg/oci/discovery.go | In oci/client.go, transfer/recv.go |
| pkg/crypto/sign.go | In transfer/send.go (cosign exec) |
| pkg/crypto/policy.go | Not implemented (policy via flags) |
| internal/gc | Not implemented (optional) |
| internal/version | Not implemented |
| cmd/dockercomms/commands/*.go | pkg/cli/*.go |
- DONE: Refactor CLI to return ExitError; main() is sole os.Exit caller.
- DONE: Add .golangci.yml and run in CI.
- DONE: Add license headers to all source files.
- Handle MarkFlagRequired errors (log or fail init).
- Add constant-time comparison in crypto path if we ever compare digests manually.
- DONE: Create CHANGELOG.md for release tracking.
- errcheck disabled in golangci; 21 defer Close/best-effort cases to address (named returns or nolint).