Description
cacheMemoryDirFor (pkg/workflow/cache_config.go:37) panics on an invalid cache-memory ID instead of returning an error, forcing a string-returning API shape onto what is really a fallible operation. It's called from 8 sites across cache_memory.go and sandbox.go. Validation currently happens at parse time so the practical risk is low, but any future caller that skips that validation step (or a validation gap) turns into an uncaught panic rather than a handled error.
Expected Impact
Removes the last of the four reachable-panic sites flagged in this audit, making the cache-memory path consistent with the rest of the compiler's error-returning conventions.
Suggested Agent
GitHub Copilot coding agent — change cacheMemoryDirFor to return (string, error), update all 8 callers in cache_memory.go/sandbox.go to propagate the error, and update TestCacheMemoryDirFor_InvalidIDPanics (in cache_id_validation_test.go) to assert an error instead of a panic.
Estimated Effort
Quick (<1 hour)
Data Source
DeepReport Intelligence Briefing — 2026-10-02, sourced from Repository Quality Improvement Report #65022 ("Compiler Panic Containment"), Task 4.
Generated by 🔬 Deep Report · claude · agent · 212 AIC · ⌖ 7.99 AIC · ⊞ 7.3K · ◷
Description
cacheMemoryDirFor(pkg/workflow/cache_config.go:37) panics on an invalid cache-memory ID instead of returning an error, forcing a string-returning API shape onto what is really a fallible operation. It's called from 8 sites acrosscache_memory.goandsandbox.go. Validation currently happens at parse time so the practical risk is low, but any future caller that skips that validation step (or a validation gap) turns into an uncaught panic rather than a handled error.Expected Impact
Removes the last of the four reachable-panic sites flagged in this audit, making the cache-memory path consistent with the rest of the compiler's error-returning conventions.
Suggested Agent
GitHub Copilot coding agent — change
cacheMemoryDirForto return(string, error), update all 8 callers incache_memory.go/sandbox.goto propagate the error, and updateTestCacheMemoryDirFor_InvalidIDPanics(incache_id_validation_test.go) to assert an error instead of a panic.Estimated Effort
Quick (<1 hour)
Data Source
DeepReport Intelligence Briefing — 2026-10-02, sourced from Repository Quality Improvement Report #65022 ("Compiler Panic Containment"), Task 4.