Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

🔖 Checkpoint: Edit /workspaces/claude-code-flow/test_recursion_bug.py

rUv8a95272cc802
diff --git a/.claude/checkpoints/1754577214.json b/.claude/checkpoints/1754577214.json
new file mode 100644
index 0000000000..98df37d1c4
--- /dev/null
+++ b/.claude/checkpoints/1754577214.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250807-143334", "file": "/workspaces/claude-code-flow/benchmark/src/swarm_benchmark/cli/swe_bench_command.py", "timestamp": "2025-08-07T14:33:34Z", "type": "pre-edit", "original_branch": "swe-bench"}
diff --git a/.claude/checkpoints/1754577215.json b/.claude/checkpoints/1754577215.json
new file mode 100644
index 0000000000..ac9eafcc08
--- /dev/null
+++ b/.claude/checkpoints/1754577215.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250807-143335", "file": "/workspaces/claude-code-flow/benchmark/src/swarm_benchmark/cli/swe_bench_command.py", "timestamp": "2025-08-07T14:33:35Z", "type": "post-edit", "branch": "swe-bench", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 96 ++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1754577189.json | 1 + .claude/checkpoints/1754577191.json | 1 + .../src/swarm_benchmark/cli/swe_bench_command.py | 94 +++++++++++++++++++++ 6 files changed, 196 insertions(+), 4 deletions(-) "}
diff --git a/test_recursion_bug.py b/test_recursion_bug.py
new file mode 100644
index 0000000000..9a36929968
--- /dev/null
+++ b/test_recursion_bug.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+"""
+Test the recursion bug - when _cdot receives a CompoundModel as input
+"""
+import numpy as np
+from astropy.modeling import models as m
+from astropy.modeling.separable import separability_matrix, _separable
+
+# The real bug appears to be in how _cdot handles CompoundModels
+# When processing nested CompoundModels, _cdot may receive a CompoundModel
+# as left or right, but tries to call .separable on it
+
+print("=== Testing the real bug ===")
+print("When we have deeply nested CompoundModels, _cdot might receive")
+print("a CompoundModel instead of a simple Model or array")
+print()
+
+# Create a case that triggers this
+cm1 = m.Linear1D(1) & m.Linear1D(2)
+print(f"cm1: {cm1}")
+print(f"cm1 separability: {_separable(cm1)}")
+print()
+
+# Now create a nested case
+mapping = m.Mapping([0, 1])
+nested = mapping | cm1
+print(f"nested: {nested}")
+
+# The issue is that when _separable processes 'nested', it calls:
+# _cdot(mapping, cm1)
+# And _cdot tries to process cm1 using _coord_matrix
+# But _coord_matrix checks model.separable which doesn't exist for CompoundModels
+
+# The fix should be to have _cdot call _separable recursively on CompoundModels
+# rather than trying to use _coord_matrix directly
+
+print("\nThe bug is in _cdot function at line 264-275 of separable.py")
+print("It should check if input is a CompoundModel and call _separable on it")
+print("rather than calling _coord_matrix which expects simple Models")
\ No newline at end of file