From 3b2fc332fc2c955ce997659325d41d8c2603365b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 21:20:51 +0000 Subject: [PATCH] Fix hardcoded Go/TS suffixes on unknown file extensions in edge case detector Co-authored-by: theRebelliousNerd <187437903+theRebelliousNerd@users.noreply.github.com> --- internal/campaign/edge_case_detector.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/campaign/edge_case_detector.go b/internal/campaign/edge_case_detector.go index 6a84513f..a7776c89 100644 --- a/internal/campaign/edge_case_detector.go +++ b/internal/campaign/edge_case_detector.go @@ -464,6 +464,17 @@ func (d *EdgeCaseDetector) suggestSplits(decision FileDecision) []SplitSuggestio ext := filepath.Ext(decision.Path) dir := filepath.Dir(decision.Path) + lang := d.detectLanguage(decision.Path) + if lang == "unknown" { + for i := 1; i <= 3; i++ { + suggestions = append(suggestions, SplitSuggestion{ + NewFileName: filepath.Join(dir, fmt.Sprintf("%s_part%d%s", baseName, i, ext)), + Reason: fmt.Sprintf("Part %d of large file", i), + }) + } + return suggestions + } + // Generic split suggestions based on common patterns patterns := []struct { suffix string @@ -812,10 +823,6 @@ func (a *EdgeCaseAnalysis) GetPreworkTasks() []string { // Check if Mangle returns NaN/Inf for floats; complexity logic might permanently // trigger ActionRefactorFirst or create panics on math operations. -// TODO: Missing Edge Case - User Request Extremes: Unknown file extensions. -// For `.xyz` or unrecognized file extensions, suggestSplits appends hardcoded -// golang/typescript-style suffixes (`_types`, `_helpers`) which could be invalid syntax. - // TODO: Missing Edge Case - State Conflicts: Race condition between `intel` and actual filesystem. // Files marked `Exists: true` in intelligence might have been deleted. Should verify // against `os.Stat(path)` to prevent invalid `ActionExtend` or `ActionModularize` commands.