cluxion-agentplugin-supercoder 0.2.4__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/PKG-INFO +1 -1
  2. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/pyproject.toml +1 -2
  3. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/__init__.py +1 -1
  4. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/hash_patch.py +16 -0
  5. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/lint_gate.py +3 -1
  6. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/plugin.py +2 -1
  7. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_hash_patch.py +36 -0
  8. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_lint_gate.py +13 -0
  9. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_plugin.py +22 -10
  10. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/uv.lock +1 -1
  11. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/.github/workflows/ci.yml +0 -0
  12. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/.github/workflows/publish.yml +0 -0
  13. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/.gitignore +0 -0
  14. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/ARCHITECTURE.md +0 -0
  15. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/Docs/README.md +0 -0
  16. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/Docs/agent-surfaces.md +0 -0
  17. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/Docs/architecture.md +0 -0
  18. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/Docs/capabilities.md +0 -0
  19. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/Docs/design.md +0 -0
  20. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/Docs/installation.md +0 -0
  21. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/Docs/rust-architecture.md +0 -0
  22. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/Docs/tools.md +0 -0
  23. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/LICENSE +0 -0
  24. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/README.md +0 -0
  25. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/__init__.py +0 -0
  26. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/adapters/claude/.claude-plugin/plugin.json +0 -0
  27. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/adapters/claude/skills/supercoder/SKILL.md +0 -0
  28. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/adapters/codex/config-snippet.toml +0 -0
  29. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/adapters/hermes/README.md +0 -0
  30. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/plugin.yaml +0 -0
  31. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/rust/supercoder_index/Cargo.lock +0 -0
  32. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/rust/supercoder_index/Cargo.toml +0 -0
  33. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/rust/supercoder_index/pyproject.toml +0 -0
  34. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/rust/supercoder_index/src/lib.rs +0 -0
  35. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/rust/supercoder_index/src/main.rs +0 -0
  36. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/rust/supercoder_index/src/outline.rs +0 -0
  37. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/rust/supercoder_index/src/syntax.rs +0 -0
  38. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/scripts/repack_native_wheel.py +0 -0
  39. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/cli.py +0 -0
  40. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/cursor.py +0 -0
  41. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/line_budget.py +0 -0
  42. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/queue.py +0 -0
  43. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/repo_map.py +0 -0
  44. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/retry_loop.py +0 -0
  45. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/safety.py +0 -0
  46. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/syntax_gate.py +0 -0
  47. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/core/test_gate.py +0 -0
  48. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/doctor/__init__.py +0 -0
  49. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/doctor/catalog.json +0 -0
  50. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/doctor/framework.py +0 -0
  51. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/doctor/probes.py +0 -0
  52. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/runner.py +0 -0
  53. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/rust_bridge.py +0 -0
  54. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/src/cluxion_agentplugin_supercoder/schemas.py +0 -0
  55. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_cursor.py +0 -0
  56. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_doctor.py +0 -0
  57. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_line_budget.py +0 -0
  58. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_queue.py +0 -0
  59. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_repo_map.py +0 -0
  60. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_retry_loop.py +0 -0
  61. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_rust_bridge.py +0 -0
  62. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_safety.py +0 -0
  63. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_syntax_gate.py +0 -0
  64. {cluxion_agentplugin_supercoder-0.2.4 → cluxion_agentplugin_supercoder-0.2.6}/tests/test_test_gate.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cluxion-agentplugin-supercoder
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Universal agent coding harness plugin: cursor logic, safe patch, line budget, Rust index, test gates.
5
5
  Project-URL: Homepage, https://github.com/cluxion/cluxion-Agentplugin-supercoder
6
6
  Project-URL: Repository, https://github.com/cluxion/cluxion-Agentplugin-supercoder
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "cluxion-agentplugin-supercoder"
7
- version = "0.2.4"
7
+ version = "0.2.6"
8
8
  description = "Universal agent coding harness plugin: cursor logic, safe patch, line budget, Rust index, test gates."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -30,7 +30,6 @@ Issues = "https://github.com/cluxion/cluxion-Agentplugin-supercoder/issues"
30
30
  [tool.hatch.build.targets.wheel]
31
31
  packages = ["src/cluxion_agentplugin_supercoder"]
32
32
 
33
-
34
33
  [tool.pytest.ini_options]
35
34
  testpaths = ["tests"]
36
35
  addopts = "-q"
@@ -1,5 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.2.4"
3
+ __version__ = "0.2.6"
4
4
 
5
5
  __all__ = ["__version__"]
@@ -114,13 +114,29 @@ def _candidate_spans(text: str, reference: str, line_drift: int) -> list[tuple[i
114
114
 
115
115
  def _best_fuzzy_span(text: str, reference: str) -> tuple[int, int, str, float, bool] | None:
116
116
  best: tuple[int, int, str, float] | None = None
117
+ best_lines: tuple[int, int] | None = None
117
118
  ambiguous = False
119
+ lines = text.splitlines(keepends=True)
120
+ offsets = [0]
121
+ for line in lines:
122
+ offsets.append(offsets[-1] + len(line))
118
123
  for start, end, block in _candidate_spans(text, reference, MAX_LINE_DRIFT):
124
+ # compute line range [start_line, end_line) for overlap test
125
+ start_line = 0
126
+ while start_line < len(offsets) - 1 and offsets[start_line + 1] <= start:
127
+ start_line += 1
128
+ end_line = start_line
129
+ while end_line < len(offsets) - 1 and offsets[end_line] < end:
130
+ end_line += 1
119
131
  score = SequenceMatcher(None, block, reference, autojunk=False).ratio()
120
132
  if best is None or score > best[3]:
121
133
  best = (start, end, block, score)
134
+ best_lines = (start_line, end_line)
122
135
  ambiguous = False
123
136
  elif score >= DEFAULT_FUZZY_THRESHOLD and best and abs(score - best[3]) < 0.015:
137
+ # only treat as ambiguous if a genuinely different (non-overlapping) location matches closely
138
+ if best_lines is not None and not (end_line <= best_lines[0] or start_line >= best_lines[1]):
139
+ continue # overlapping window on same location -> not real ambiguity
124
140
  ambiguous = True
125
141
  if best is None:
126
142
  return None
@@ -46,7 +46,9 @@ def _discover_ruff() -> str | None:
46
46
 
47
47
  def check_file(path: str | Path, *, cwd: str | Path | None = None) -> dict[str, Any]:
48
48
  """Lint one file and return structured advisory findings."""
49
- target = Path(path)
49
+ target = Path(path).resolve()
50
+ if target.is_dir():
51
+ return {"ok": False, "error": "path is a directory"}
50
52
  language = language_for_path(target)
51
53
  if language not in LINTABLE_LANGUAGES:
52
54
  return _unchecked(language or "", "no_linter")
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
- from collections.abc import Callable
4
+ from collections.abc import Callable, Mapping
5
5
 
6
6
  from cluxion_agentplugin_supercoder import runner
7
7
  from cluxion_agentplugin_supercoder.core.test_gate import suggest_test_commands
@@ -116,6 +116,7 @@ def register(ctx: object) -> None:
116
116
 
117
117
  def _wrap(callback: Callable[[dict[str, object]], runner.ToolResult]) -> Callable[[dict[str, object]], str]:
118
118
  def handler(args: dict[str, object], **_: object) -> str:
119
+ args = args if isinstance(args, Mapping) else {}
119
120
  try:
120
121
  return callback(args).to_json()
121
122
  except (ValueError, TypeError, OSError) as exc:
@@ -80,3 +80,39 @@ def test_sha256_prefix_and_bad_hash_rejected(tmp_path: Path) -> None:
80
80
  path.write_text("one\n", encoding="utf-8")
81
81
  with pytest.raises(ValueError):
82
82
  apply_patch(path, old_text="one\n", new_text="two\n", expected_file_hash="abc")
83
+
84
+
85
+ def test_fuzzy_short_2line_block_with_drift_applies(tmp_path: Path) -> None:
86
+ # regression: 2-line unique target with minor drift (trailing space + typo) must apply
87
+ # even though different window widths produce overlapping candidates
88
+ path = tmp_path / "multi.py"
89
+ body = """def foo():
90
+ x = 1
91
+ return x
92
+
93
+ def bar():
94
+ y = 2
95
+ return y
96
+ """
97
+ path.write_text(body, encoding="utf-8")
98
+ # drifted old_text: trailing space on first line of block, one-char typo on second
99
+ drifted = " y = 2 \n return z\n"
100
+ new = " y = 42\n return y\n"
101
+ result = apply_patch(path, old_text=drifted, new_text=new)
102
+ assert result.success is True
103
+ assert result.strategy == "fuzzy"
104
+ content = path.read_text(encoding="utf-8")
105
+ assert "y = 42" in content
106
+ assert "return y" in content
107
+ assert "def bar():" in content
108
+
109
+
110
+ def test_duplicate_blocks_still_ambiguous(tmp_path: Path) -> None:
111
+ # genuine duplicate (non-overlapping) must still refuse
112
+ path = tmp_path / "dups.py"
113
+ block = "def f():\n return 1\n"
114
+ path.write_text(block + "\n" + block, encoding="utf-8")
115
+ near = "def f():\n return 2\n"
116
+ result = apply_patch(path, old_text=near, new_text="def f():\n return 3\n")
117
+ assert result.success is False
118
+ assert result.strategy == "no_match"
@@ -95,3 +95,16 @@ def test_lint_gate_tool(tmp_path: Path) -> None:
95
95
  assert result.ok is True
96
96
  assert result.payload["clean"] is False
97
97
  assert result.payload["finding_count"] >= 1
98
+
99
+
100
+ def test_lint_gate_rejects_directory(tmp_path: Path) -> None:
101
+ d = tmp_path / "emptydir"
102
+ d.mkdir()
103
+ result = lint_gate.check_file(d)
104
+ assert result.get("ok") is False
105
+ assert result.get("error") == "path is a directory"
106
+
107
+ # also via runner tool
108
+ res_tool = runner.lint_gate_tool({"cwd": str(tmp_path), "path": "emptydir"})
109
+ assert res_tool.ok is False
110
+ assert res_tool.payload.get("error") == "path is a directory"
@@ -1,3 +1,5 @@
1
+ """Tests for plugin registration and _wrap error handling."""
2
+
1
3
  from __future__ import annotations
2
4
 
3
5
  import json
@@ -5,18 +7,15 @@ import json
5
7
  from cluxion_agentplugin_supercoder import plugin, runner
6
8
 
7
9
 
8
- class FakeContext:
9
- def __init__(self) -> None:
10
- self.tools: dict[str, dict[str, object]] = {}
11
-
12
- def register_tool(
13
- self, *, name: str, toolset: str, schema: dict[str, object], handler: object, emoji: str = ""
14
- ) -> None:
15
- self.tools[name] = {"toolset": toolset, "schema": schema, "handler": handler, "emoji": emoji}
10
+ def test_register_exposes_all_tools() -> None:
11
+ class FakeCtx:
12
+ def __init__(self):
13
+ self.tools = {}
16
14
 
15
+ def register_tool(self, name, toolset=None, schema=None, handler=None, emoji=None):
16
+ self.tools[name] = {"toolset": toolset, "schema": schema}
17
17
 
18
- def test_register_tools() -> None:
19
- ctx = FakeContext()
18
+ ctx = FakeCtx()
20
19
  plugin.register(ctx)
21
20
  assert sorted(ctx.tools) == [
22
21
  "supercoder_brief",
@@ -46,6 +45,19 @@ def test_wrap_catches_isadirectory_and_typeerror() -> None:
46
45
  assert res_type == {"ok": False, "error": "bad int coercion"}
47
46
 
48
47
 
48
+ def test_wrap_coerces_none_args_to_clean_error() -> None:
49
+ def any_handler(args):
50
+ # if args was None, before fix: AttributeError on .get inside tools
51
+ # now coerced to {}, so callback runs and may raise ValueError for missing keys
52
+ if not args:
53
+ raise ValueError("args required after coercion")
54
+ return runner.ToolResult(True, {"echo": args})
55
+
56
+ wrapped = plugin._wrap(any_handler)
57
+ res = json.loads(wrapped(None))
58
+ assert res == {"ok": False, "error": "args required after coercion"}
59
+
60
+
49
61
  def test_repo_map_deterministic(tmp_path) -> None:
50
62
  # ensure deterministic output (no varying cache stats in payload)
51
63
  from cluxion_agentplugin_supercoder.core import repo_map as rm
@@ -160,7 +160,7 @@ wheels = [
160
160
 
161
161
  [[package]]
162
162
  name = "cluxion-agentplugin-supercoder"
163
- version = "0.2.4"
163
+ version = "0.2.6"
164
164
  source = { editable = "." }
165
165
  dependencies = [
166
166
  { name = "psutil" },