regcode 0.6.0__tar.gz → 0.6.1__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.
- regcode-0.6.1/.gitlab-ci.yml +55 -0
- {regcode-0.6.0 → regcode-0.6.1}/PKG-INFO +1 -1
- {regcode-0.6.0 → regcode-0.6.1}/pyproject.toml +1 -1
- {regcode-0.6.0 → regcode-0.6.1}/regcode/__init__.py +1 -1
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tracing.py +17 -7
- regcode-0.6.1/tests/conftest.py +37 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_context_manager.py +1 -1
- {regcode-0.6.0 → regcode-0.6.1}/uv.lock +1 -1
- regcode-0.6.0/tests/conftest.py +0 -7
- {regcode-0.6.0 → regcode-0.6.1}/.gitignore +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/.python-version +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/.qwen/settings.json +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/AGENTS.md +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/GOALS.md +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/README.md +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/config.yaml.template +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/main.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/cli.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/config.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/conversation_manager.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/dependencies.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/main.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/monty_sandbox.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/permissions.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/sandbox.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tools/__init__.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tools/base.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tools/builtins.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tools/registry.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tools/review_notes.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tools/web_crawl.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tools/web_search.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/regcode/tui.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/__init__.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_api.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_cli.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_config.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_dependencies.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_main.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_monty_sandbox.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_osv_cve.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_provider_extra.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_review_notes.py +0 -0
- {regcode-0.6.0 → regcode-0.6.1}/tests/test_web_search.py +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# .gitlab-ci.yml
|
|
2
|
+
|
|
3
|
+
stages:
|
|
4
|
+
- test
|
|
5
|
+
- build
|
|
6
|
+
- publish
|
|
7
|
+
|
|
8
|
+
variables:
|
|
9
|
+
UV_PIP_PREVENT_WRITE_BACK: "1"
|
|
10
|
+
|
|
11
|
+
lint:
|
|
12
|
+
stage: test
|
|
13
|
+
image: python:3.12-slim
|
|
14
|
+
before_script:
|
|
15
|
+
- pip install uv
|
|
16
|
+
script:
|
|
17
|
+
- uv venv .venv
|
|
18
|
+
- source .venv/bin/activate
|
|
19
|
+
- uv pip install ".[dev]"
|
|
20
|
+
- uv run ruff check regcode/ tests/
|
|
21
|
+
|
|
22
|
+
pytest:
|
|
23
|
+
stage: test
|
|
24
|
+
image: python:3.12-slim
|
|
25
|
+
before_script:
|
|
26
|
+
- pip install uv
|
|
27
|
+
script:
|
|
28
|
+
- uv venv .venv
|
|
29
|
+
- source .venv/bin/activate
|
|
30
|
+
- uv pip install ".[dev]"
|
|
31
|
+
- uv run pytest tests/ -v --tb=short
|
|
32
|
+
|
|
33
|
+
build:
|
|
34
|
+
stage: build
|
|
35
|
+
image: python:3.12-slim
|
|
36
|
+
before_script:
|
|
37
|
+
- pip install uv
|
|
38
|
+
script:
|
|
39
|
+
- uv build
|
|
40
|
+
artifacts:
|
|
41
|
+
paths:
|
|
42
|
+
- dist/
|
|
43
|
+
expire_in: 1 week
|
|
44
|
+
|
|
45
|
+
publish:
|
|
46
|
+
stage: publish
|
|
47
|
+
image: python:3.12-slim
|
|
48
|
+
before_script:
|
|
49
|
+
- pip install uv
|
|
50
|
+
script:
|
|
51
|
+
- uv publish --token $UV_PUBLISH_TOKEN
|
|
52
|
+
rules:
|
|
53
|
+
- if: $CI_COMMIT_BRANCH == "main"
|
|
54
|
+
when: on_success
|
|
55
|
+
- when: never
|
|
@@ -39,9 +39,17 @@ def _initialize_tracing(config: Config | None = None) -> None:
|
|
|
39
39
|
if not _tracing_config.tracing_enabled():
|
|
40
40
|
return
|
|
41
41
|
|
|
42
|
-
if
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
if (
|
|
43
|
+
_tracing_config.mlflow_requires_auth
|
|
44
|
+
and _tracing_config.mlflow_username
|
|
45
|
+
and _tracing_config.mlflow_password
|
|
46
|
+
):
|
|
47
|
+
MLFLOW_TRACKING_USERNAME.set(
|
|
48
|
+
_tracing_config.mlflow_username
|
|
49
|
+
)
|
|
50
|
+
MLFLOW_TRACKING_PASSWORD.set(
|
|
51
|
+
_tracing_config.mlflow_password
|
|
52
|
+
)
|
|
45
53
|
|
|
46
54
|
_logger.info(f"Setting up MLflow tracing with URL: {_tracing_config.mlflow_url}")
|
|
47
55
|
|
|
@@ -76,14 +84,16 @@ def agent_trace(user_message: str, tool_calls_count: int = 0) -> Iterator[None]:
|
|
|
76
84
|
with agent_trace("Fix the bug", 3):
|
|
77
85
|
result = agent.chat("Fix the bug")
|
|
78
86
|
"""
|
|
79
|
-
if
|
|
87
|
+
if (
|
|
88
|
+
not _tracing_initialized
|
|
89
|
+
or not _tracing_config
|
|
90
|
+
or not _tracing_config.tracing_enabled()
|
|
91
|
+
):
|
|
80
92
|
yield
|
|
81
93
|
return
|
|
82
94
|
|
|
83
|
-
trace_name = f"agent.turn.{tool_calls_count}tools"
|
|
84
|
-
|
|
85
95
|
try:
|
|
86
|
-
with mlflow.start_trace()
|
|
96
|
+
with mlflow.start_trace():
|
|
87
97
|
# Log input attributes for better trace UI
|
|
88
98
|
mlflow.set_tag("user_message", user_message[:200])
|
|
89
99
|
mlflow.set_tag("tool_calls", tool_calls_count)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from unittest.mock import patch
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
# Ensure the project root is on sys.path for imports
|
|
8
|
+
project_root = Path(__file__).parent.parent
|
|
9
|
+
if str(project_root) not in sys.path:
|
|
10
|
+
sys.path.insert(0, str(project_root))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@pytest.fixture(autouse=True)
|
|
14
|
+
def mock_config_load(request):
|
|
15
|
+
"""Prevent tests from reading real config.yaml.
|
|
16
|
+
|
|
17
|
+
Patches ``Config.load`` on modules that import it so that
|
|
18
|
+
``ContextManager``, ``Agent``, and other callers all get a
|
|
19
|
+
clean, deterministic Config instead of reading from disk.
|
|
20
|
+
|
|
21
|
+
Excluded: tests in test_config.py (they test Config.load itself).
|
|
22
|
+
"""
|
|
23
|
+
# Skip for tests in the config test module
|
|
24
|
+
if (
|
|
25
|
+
"test_config" in request.node.name or
|
|
26
|
+
request.node.module.__name__ == "tests.test_config"
|
|
27
|
+
):
|
|
28
|
+
yield
|
|
29
|
+
return
|
|
30
|
+
|
|
31
|
+
from regcode.config import Config
|
|
32
|
+
|
|
33
|
+
default = Config()
|
|
34
|
+
|
|
35
|
+
with patch("regcode.config.Config.load", return_value=default):
|
|
36
|
+
with patch("regcode.conversation_manager.Config.load", return_value=default):
|
|
37
|
+
yield
|
|
@@ -6,7 +6,7 @@ from regcode.conversation_manager import ContextManager
|
|
|
6
6
|
def test_context_manager_init():
|
|
7
7
|
cm = ContextManager()
|
|
8
8
|
assert cm.context_window == 128000
|
|
9
|
-
assert cm.max_tokens ==
|
|
9
|
+
assert cm.max_tokens == 4096
|
|
10
10
|
assert cm.compaction_threshold == 0.8
|
|
11
11
|
assert cm.messages == []
|
|
12
12
|
assert cm._review_notes == []
|
regcode-0.6.0/tests/conftest.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|