Add evidence-based regression and schema compatibility checks
This commit is contained in:
@@ -387,6 +387,28 @@ def _print_preflight_sections(report: dict, prefix: str = "") -> None:
|
||||
f"{result.get('step', 'unknown')} — {result.get('detail', '')}"
|
||||
)
|
||||
|
||||
regression = report.get("regression") or {}
|
||||
if regression:
|
||||
marker = (
|
||||
"REGRESSION" if regression.get("has_regressions")
|
||||
else "REVIEW" if regression.get("contract_changed")
|
||||
else "STABLE"
|
||||
)
|
||||
print(
|
||||
f"{prefix}Regression comparison: {marker} — "
|
||||
f"{regression.get('summary', 'no changes')}"
|
||||
)
|
||||
|
||||
compatibility = report.get("compatibility") or []
|
||||
if compatibility:
|
||||
print(f"{prefix}ToolStep compatibility ({len(compatibility)}):")
|
||||
for finding in compatibility:
|
||||
print(
|
||||
f" {str(finding.get('state', 'unknown')).upper()}: "
|
||||
f"step {finding.get('step', '?')} -> "
|
||||
f"{finding.get('tool', 'unknown')} — {finding.get('detail', '')}"
|
||||
)
|
||||
|
||||
|
||||
def _print_registry_suggestions(suggestions: dict) -> None:
|
||||
"""Render registry-specific category, similarity, and scrutiny evidence."""
|
||||
@@ -494,8 +516,10 @@ def _cmd_registry_publish(args):
|
||||
from ..preflight import analyze_tool
|
||||
from ..tool import Tool
|
||||
try:
|
||||
local_tool = Tool.from_dict(data)
|
||||
local_tool.path = config_path
|
||||
local_report = analyze_tool(
|
||||
Tool.from_dict(data), include_contract_tests=True
|
||||
local_tool, include_contract_tests=True
|
||||
)
|
||||
except (KeyError, TypeError, ValueError) as exc:
|
||||
print(f"Local preflight error: {exc}", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user