fix(#146): reuse resolved doc-map path from early validation in Step 6c
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 17s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 25s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 43s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m15s

Addresses sonnet/gpt NIT: early validateWorkspacePath call at line 176
discarded the resolved path (using _), then Step 6c called it again.
Store the resolved path in resolvedDocMapFile and reuse it downstream,
eliminating the redundant EvalSymlinks syscall on the happy path.
This commit is contained in:
Rodin
2026-05-15 01:36:17 -07:00
parent 40a16b75e0
commit 9b64c605f8
+5 -7
View File
@@ -174,11 +174,14 @@ func main() {
} }
// Early validation of filesystem-path flags (fail fast before network I/O) // Early validation of filesystem-path flags (fail fast before network I/O)
var resolvedDocMapFile string
if *docMapFile != "" { if *docMapFile != "" {
if _, err := validateWorkspacePath(*docMapFile, "doc-map"); err != nil { resolved, err := validateWorkspacePath(*docMapFile, "doc-map")
if err != nil {
slog.Error("invalid doc-map path", "error", err) slog.Error("invalid doc-map path", "error", err)
os.Exit(1) os.Exit(1)
} }
resolvedDocMapFile = resolved
} }
// Initialize clients // Initialize clients
@@ -365,12 +368,7 @@ func main() {
// Step 6c: Load path-scoped design docs if doc-map specified // Step 6c: Load path-scoped design docs if doc-map specified
designDocs := "" designDocs := ""
if *docMapFile != "" { if *docMapFile != "" {
resolvedDocMap, err := validateWorkspacePath(*docMapFile, "doc-map") docMapCfg, err := review.ParseDocMapConfig(resolvedDocMapFile)
if err != nil {
slog.Error("invalid doc-map path", "error", err)
os.Exit(1)
}
docMapCfg, err := review.ParseDocMapConfig(resolvedDocMap)
if err != nil { if err != nil {
slog.Error("failed to parse doc-map file", "file", *docMapFile, "error", err) slog.Error("failed to parse doc-map file", "file", *docMapFile, "error", err)
os.Exit(1) os.Exit(1)