Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions internal/campaign/edge_case_detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down