MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / verifyCandidate

Function verifyCandidate

pkg/go/cmd/codebase-memory-mcp/main.go:1010–1024  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

1008}
1009
1010func verifyCandidate(path string) error {
1011 ctx, cancel := context.WithTimeout(context.Background(), candidateTimeout)
1012 defer cancel()
1013 cmd := exec.CommandContext(ctx, path, "--version")
1014 cmd.Stdin = nil
1015 cmd.Stdout = io.Discard
1016 cmd.Stderr = io.Discard
1017 if err := cmd.Run(); err != nil {
1018 if ctx.Err() != nil {
1019 return fmt.Errorf("downloaded binary verification timed out: %w", ctx.Err())
1020 }
1021 return fmt.Errorf("downloaded binary failed to run: %w", err)
1022 }
1023 return nil
1024}
1025
1026func fileSHA256(path string) ([sha256.Size]byte, error) {
1027 var digest [sha256.Size]byte

Callers 1

downloadFunction · 0.70

Calls 1

cancelFunction · 0.85

Tested by

no test coverage detected