refactorai-cli 0.2.17__tar.gz → 0.2.19__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.
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/PKG-INFO +1 -1
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/pyproject.toml +1 -1
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/__init__.py +1 -1
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/run_cmds.py +49 -12
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli.egg-info/PKG-INFO +1 -1
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/README.md +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/auth.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/client.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/__init__.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/auth_cmds.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/engine_cmds.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/model_cmds.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/rules_cmds.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/runtime_cmds.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/runtime_proxy_cmds.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/setup_cmds.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/control_plane.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/credentials.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/local_constitution.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/local_engine_runtime.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/local_paths.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/main.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/model_policy.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/runtime_manager.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/settings.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/setup_flow.py +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli.egg-info/SOURCES.txt +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli.egg-info/dependency_links.txt +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli.egg-info/entry_points.txt +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli.egg-info/requires.txt +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli.egg-info/top_level.txt +0 -0
- {refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/setup.cfg +0 -0
|
@@ -35,7 +35,10 @@ from refactor_core.constitution import (
|
|
|
35
35
|
raw_secret_matches,
|
|
36
36
|
raw_secret_matches_config,
|
|
37
37
|
)
|
|
38
|
-
from refactor_core.compliance_settings import
|
|
38
|
+
from refactor_core.compliance_settings import (
|
|
39
|
+
ComplianceSelectionError,
|
|
40
|
+
resolve_compliance_selection,
|
|
41
|
+
)
|
|
39
42
|
from refactor_core.compliance.loader import CompliancePackError, resolve_compliance_packs
|
|
40
43
|
from refactor_core.compliance.models import CompliancePackResolution
|
|
41
44
|
from refactor_core.compliance.evidence import build_compliance_evidence_bundle, evaluate_compliance_gate
|
|
@@ -184,6 +187,25 @@ _REQUIRED_ENV_BY_PROVIDER: dict[str, list[object]] = {
|
|
|
184
187
|
}
|
|
185
188
|
|
|
186
189
|
|
|
190
|
+
def _sanitize_runtime_error_message(message: object) -> str:
|
|
191
|
+
"""Normalize provider/runtime errors to runtime-artifact-friendly guidance."""
|
|
192
|
+
text = str(message or "").strip()
|
|
193
|
+
if not text:
|
|
194
|
+
return "unknown"
|
|
195
|
+
install_hint = re.search(
|
|
196
|
+
r"Install with:\s*pip install ['\"]refactor-core(?:\[[^'\"]+\])?['\"]",
|
|
197
|
+
text,
|
|
198
|
+
flags=re.IGNORECASE,
|
|
199
|
+
)
|
|
200
|
+
if install_hint:
|
|
201
|
+
return (
|
|
202
|
+
"Bedrock credentials are not configured for runtime execution. "
|
|
203
|
+
"Set AWS_BEARER_TOKEN_BEDROCK (for example: `set -a; source .env; set +a`) "
|
|
204
|
+
"or run with AWS SDK credentials in an environment that includes boto3."
|
|
205
|
+
)
|
|
206
|
+
return text
|
|
207
|
+
|
|
208
|
+
|
|
187
209
|
def _agent_progress_logger(
|
|
188
210
|
stage: str, *, status=None, verbose_steps: bool = True
|
|
189
211
|
) -> Callable[[dict], None]:
|
|
@@ -302,16 +324,18 @@ def _agent_progress_logger(
|
|
|
302
324
|
f"[dim]{stage}: step {event.get('step', '?')} result -> {summary}[/dim]"
|
|
303
325
|
)
|
|
304
326
|
elif kind == "tool_error":
|
|
327
|
+
error_text = _sanitize_runtime_error_message(event.get("error", "unknown"))
|
|
305
328
|
console.print(
|
|
306
329
|
f"[yellow]{stage}: step {event.get('step', '?')} tool `{event.get('tool', '?')}` "
|
|
307
|
-
f"error: {
|
|
330
|
+
f"error: {error_text}[/yellow]"
|
|
308
331
|
)
|
|
309
332
|
elif kind == "invalid_response":
|
|
310
333
|
console.print(f"[yellow]{stage}: step {event.get('step', '?')} returned invalid JSON tool call.[/yellow]")
|
|
311
334
|
elif kind == "transport_error":
|
|
335
|
+
error_text = _sanitize_runtime_error_message(event.get("error", "unknown"))
|
|
312
336
|
console.print(
|
|
313
337
|
f"[yellow]{stage}: model transport error at step {event.get('step', '?')}: "
|
|
314
|
-
f"{
|
|
338
|
+
f"{error_text}[/yellow]"
|
|
315
339
|
)
|
|
316
340
|
elif kind == "finish":
|
|
317
341
|
_set_status(
|
|
@@ -1554,6 +1578,9 @@ def review(
|
|
|
1554
1578
|
cli_canary_percent=compliance_canary_percent,
|
|
1555
1579
|
)
|
|
1556
1580
|
)
|
|
1581
|
+
except ComplianceSelectionError as exc:
|
|
1582
|
+
console.print(f"[red]review: invalid compliance selection:[/red] {exc}")
|
|
1583
|
+
raise typer.Exit(code=2) from exc
|
|
1557
1584
|
except CompliancePackError as exc:
|
|
1558
1585
|
console.print(f"[red]review: compliance pack resolution failed:[/red] {exc}")
|
|
1559
1586
|
raise typer.Exit(code=1) from exc
|
|
@@ -1630,7 +1657,7 @@ def review(
|
|
|
1630
1657
|
"Review continued; address sandbox install/toolchain incompatibilities for best results."
|
|
1631
1658
|
)
|
|
1632
1659
|
except Exception as exc: # provider/transport errors should not crash the CLI
|
|
1633
|
-
console.print(f"[red]Review failed:[/red] {exc}")
|
|
1660
|
+
console.print(f"[red]Review failed:[/red] {_sanitize_runtime_error_message(exc)}")
|
|
1634
1661
|
raise typer.Exit(code=1) from exc
|
|
1635
1662
|
finally:
|
|
1636
1663
|
_teardown_sandbox_context(project_root, sandbox_ctx)
|
|
@@ -1762,6 +1789,9 @@ def code(
|
|
|
1762
1789
|
cli_canary_percent=compliance_canary_percent,
|
|
1763
1790
|
)
|
|
1764
1791
|
)
|
|
1792
|
+
except ComplianceSelectionError as exc:
|
|
1793
|
+
console.print(f"[red]code: invalid compliance selection:[/red] {exc}")
|
|
1794
|
+
raise typer.Exit(code=2) from exc
|
|
1765
1795
|
except CompliancePackError as exc:
|
|
1766
1796
|
console.print(f"[red]code: compliance pack resolution failed:[/red] {exc}")
|
|
1767
1797
|
raise typer.Exit(code=1) from exc
|
|
@@ -1897,7 +1927,7 @@ def code(
|
|
|
1897
1927
|
equivalence_mode=equivalence,
|
|
1898
1928
|
)
|
|
1899
1929
|
except Exception as exc:
|
|
1900
|
-
console.print(f"[red]Refactor failed:[/red] {exc}")
|
|
1930
|
+
console.print(f"[red]Refactor failed:[/red] {_sanitize_runtime_error_message(exc)}")
|
|
1901
1931
|
raise typer.Exit(code=1) from exc
|
|
1902
1932
|
finally:
|
|
1903
1933
|
_teardown_sandbox_context(project_root, sandbox_ctx)
|
|
@@ -2051,13 +2081,20 @@ def compliance(
|
|
|
2051
2081
|
"""Show/export compliance packs, coverage, and rule details."""
|
|
2052
2082
|
_require_auth()
|
|
2053
2083
|
_project_root, _constitution, project_config = _load_project()
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2084
|
+
try:
|
|
2085
|
+
frameworks, level, resolution, rollout_mode, canary_percent = _resolve_compliance_context(
|
|
2086
|
+
project_config=project_config,
|
|
2087
|
+
cli_frameworks=compliance_framework,
|
|
2088
|
+
cli_level=compliance_level,
|
|
2089
|
+
cli_rollout=compliance_rollout,
|
|
2090
|
+
cli_canary_percent=compliance_canary_percent,
|
|
2091
|
+
)
|
|
2092
|
+
except ComplianceSelectionError as exc:
|
|
2093
|
+
console.print(f"[red]compliance: invalid selection:[/red] {exc}")
|
|
2094
|
+
raise typer.Exit(code=2) from exc
|
|
2095
|
+
except CompliancePackError as exc:
|
|
2096
|
+
console.print(f"[red]compliance: pack resolution failed:[/red] {exc}")
|
|
2097
|
+
raise typer.Exit(code=1) from exc
|
|
2061
2098
|
mode = str(action or "show").strip().lower()
|
|
2062
2099
|
if mode not in {"status", "show", "coverage", "explain", "export"}:
|
|
2063
2100
|
console.print(f"[red]Unknown compliance action:[/red] {action}")
|
|
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
|
{refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli/commands/runtime_proxy_cmds.py
RENAMED
|
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
|
{refactorai_cli-0.2.17 → refactorai_cli-0.2.19}/refactorai_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|