Summary
Several pieces of dead or near-dead code exist that should be cleaned up per the zero-waste mandate.
Findings
1. Unused sentinel errors in internal/ollama/client.go:20-31
var ErrOllamaUnavailable = errors.New("ollama is not running or unreachable")
var ErrModelNotAvailable = errors.New("requested model is not available")
These are defined but never referenced. The actual error handling in main.go uses inline fmt.Errorf messages. ErrMalformedResponse IS used.
Fix: Either use these sentinels in main.go (replacing inline messages for consistent error typing) or remove them.
2. Deprecated generateEnvFile in selfservice.go:874-904
Marked // Deprecated and documented as backward compatibility. The project has fully migrated to config.yaml.
Fix: Search for callers. If none exist, remove the function.
3. Thin wrappers in main.go and auth_config.go
truncateText (main.go:489-491) wraps ux.TruncateText — only 1 call site
maskSecret (auth_config.go:174-176) wraps ux.MaskSecret — only 1 call site
Fix: Replace call sites with direct ux.TruncateText / ux.MaskSecret calls and remove wrappers.
4. Variable shadowing in ollama/decisions.go:119
Local validCategories shadows the package-level validCategories in guardian.go. Different values, confusing naming.
Fix: Rename to validDecisionCategories to distinguish from sensitivity categories.
Priority
LOW — Code hygiene, no functional impact.
Summary
Several pieces of dead or near-dead code exist that should be cleaned up per the zero-waste mandate.
Findings
1. Unused sentinel errors in internal/ollama/client.go:20-31
These are defined but never referenced. The actual error handling in
main.gouses inlinefmt.Errorfmessages.ErrMalformedResponseIS used.Fix: Either use these sentinels in
main.go(replacing inline messages for consistent error typing) or remove them.2. Deprecated generateEnvFile in selfservice.go:874-904
Marked
// Deprecatedand documented as backward compatibility. The project has fully migrated toconfig.yaml.Fix: Search for callers. If none exist, remove the function.
3. Thin wrappers in main.go and auth_config.go
truncateText(main.go:489-491) wrapsux.TruncateText— only 1 call sitemaskSecret(auth_config.go:174-176) wrapsux.MaskSecret— only 1 call siteFix: Replace call sites with direct
ux.TruncateText/ux.MaskSecretcalls and remove wrappers.4. Variable shadowing in ollama/decisions.go:119
Local
validCategoriesshadows the package-levelvalidCategoriesinguardian.go. Different values, confusing naming.Fix: Rename to
validDecisionCategoriesto distinguish from sensitivity categories.Priority
LOW — Code hygiene, no functional impact.