auto-sync: tudo-para-ia-mais-humana 2026-05-02 02:34:18
This commit is contained in:
@@ -264,6 +264,9 @@ def command_repo_mesh(args: argparse.Namespace) -> int:
|
||||
try:
|
||||
for folder_name in ("reports", "indexes", "audit", "status"):
|
||||
(central_for_write / folder_name).mkdir(parents=True, exist_ok=True)
|
||||
probe_path = central_for_write / "reports" / ".repository_mesh_write_probe.tmp"
|
||||
probe_path.write_text("repository mesh write probe\n", encoding="utf-8")
|
||||
probe_path.unlink(missing_ok=True)
|
||||
except OSError as exc:
|
||||
central_write_error = f"{type(exc).__name__}: {exc}"
|
||||
central_for_write = None
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -46,6 +46,7 @@ class McpContractKind(str, Enum):
|
||||
UI_SCREEN = "ui_screen"
|
||||
REPORT_MODEL = "report_model"
|
||||
TRANSIT_POLICY = "transit_policy"
|
||||
ADMINISTRATION_ROUTE = "administration_route"
|
||||
REDACTION_POLICY = "redaction_policy"
|
||||
ACCESS_POLICY = "access_policy"
|
||||
DOCS_EXCEPTION = "docs_exception"
|
||||
@@ -309,6 +310,56 @@ def contracts_for_profile(profile_id: str) -> tuple[McpControlContract, ...]:
|
||||
return tuple(contract for contract in iter_contracts() if contract.profile_id == profile_id)
|
||||
|
||||
|
||||
def administration_route_contracts(
|
||||
*,
|
||||
platform_id: str | None = None,
|
||||
profile_id: str | None = None,
|
||||
) -> tuple[McpControlContract, ...]:
|
||||
"""Return MCP-only administration route contracts, optionally filtered."""
|
||||
|
||||
contracts = contracts_for_kind(McpContractKind.ADMINISTRATION_ROUTE)
|
||||
if platform_id is not None:
|
||||
contracts = tuple(contract for contract in contracts if contract.platform_id == platform_id)
|
||||
if profile_id is not None:
|
||||
contracts = tuple(contract for contract in contracts if contract.profile_id == profile_id)
|
||||
return contracts
|
||||
|
||||
|
||||
def administration_route_readiness_payload(
|
||||
*,
|
||||
platform_id: str | None = None,
|
||||
profile_id: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Build a compact readiness payload for MCP administration coverage."""
|
||||
|
||||
contracts = administration_route_contracts(platform_id=platform_id, profile_id=profile_id)
|
||||
operation_counts: dict[str, int] = {}
|
||||
platform_counts: dict[str, int] = {}
|
||||
profile_counts: dict[str, int] = {}
|
||||
blocked: list[str] = []
|
||||
for contract in contracts:
|
||||
operation = contract.contract_id.split(".")[-2] if contract.contract_id.count(".") >= 2 else contract.contract_id
|
||||
operation_counts[operation] = operation_counts.get(operation, 0) + 1
|
||||
platform_counts[contract.platform_id] = platform_counts.get(contract.platform_id, 0) + 1
|
||||
profile_counts[contract.profile_id] = profile_counts.get(contract.profile_id, 0) + 1
|
||||
if not contract.same_source_ready:
|
||||
blocked.append(contract.contract_id)
|
||||
return {
|
||||
"providerId": PROVIDER_ID,
|
||||
"controlPlaneId": MCP_CONTROL_PLANE_ID,
|
||||
"kind": McpContractKind.ADMINISTRATION_ROUTE.value,
|
||||
"contractsCount": len(contracts),
|
||||
"platformsCount": len(platform_counts),
|
||||
"profilesCount": len(profile_counts),
|
||||
"operations": dict(sorted(operation_counts.items())),
|
||||
"platforms": dict(sorted(platform_counts.items())),
|
||||
"profiles": dict(sorted(profile_counts.items())),
|
||||
"allRoutesSameSourceReady": not blocked and bool(contracts),
|
||||
"blockedRoutes": blocked[:40],
|
||||
"evidenceId": f"evidence-{stable_hash({'adminRoutes': [contract.source_records_hash for contract in contracts]})[:24]}",
|
||||
}
|
||||
|
||||
|
||||
def _rulebook_platform_truth(rulebook: RulebookReport | None) -> dict[str, TruthState]:
|
||||
if rulebook is None:
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user