manual-sync: tudo-para-ia-mais-humana 2026-05-01_153128

This commit is contained in:
codex-gitea-sync
2026-05-01 15:34:39 -03:00
parent b79fdce99d
commit af5e86fcee
146 changed files with 70384 additions and 16599 deletions

View File

@@ -7,8 +7,11 @@ import json
from pathlib import Path
from .models import as_plain_data
from .central_consolidation import run_consolidated_report
from .matrix import build_global_recommendations, build_matrix, build_platform_reports
from .mcp_contract import build_mcp_contract_report, mcp_provider_compact_json, mcp_provider_payload
from .mcp_contract import build_mcp_contract_report, build_mcp_execute_probe, mcp_provider_compact_json, mcp_provider_payload
from .mcp_publication_gate import run_publication_gate
from .mcp_transit_ledger import build_mcp_transit_ledger, mcp_transit_ledger_compact_json
from .operational_dossier import build_execution_round_dossier
from .governance_engine import build_governance_portfolio, compact_governance_payload
from .human_rulebook import evaluate_rulebook, rulebook_compact_json
@@ -64,12 +67,35 @@ def build_parser() -> argparse.ArgumentParser:
mcp_provider.add_argument("--ecosystem-root", default="G:/_codex-git")
mcp_provider.add_argument("--limit", type=int, default=80)
mcp_provider.add_argument("--envelope", action="store_true")
mcp_probe = sub.add_parser("mcp-execute-probe", help="Print a safe /v1/execute probe for the Mais Humana provider.")
mcp_probe.add_argument("--ecosystem-root", default="G:/_codex-git")
mcp_probe.add_argument("--limit", type=int, default=20)
mcp_probe.add_argument("--observed-status", default="not_executed")
mcp_probe.add_argument("--observed-note", default="request prepared; live execution must record the HTTP status separately")
mcp_transit = sub.add_parser("mcp-transit-ledger", help="Print compact MCP transit ledger for Mais Humana contracts.")
mcp_transit.add_argument("--ecosystem-root", default="G:/_codex-git")
mcp_transit.add_argument("--limit", type=int, default=80)
repo_mesh = sub.add_parser("repo-mesh", help="Inventory repository mirrors and write safe synchronization artifacts.")
repo_mesh.add_argument("--ecosystem-root", default="G:/_codex-git")
repo_mesh.add_argument("--project-root", default="G:/_codex-git/tudo-para-ia-mais-humana-plataform")
repo_mesh.add_argument("--project-root", default="G:/_codex-git/tudo-para-ia-mais-humana")
repo_mesh.add_argument("--central-platform-folder", default="")
repo_mesh.add_argument("--fetch", action="store_true")
repo_mesh.add_argument("--plugin-auth-attempt", default="")
consolidated = sub.add_parser("consolidated-report", help="Write consolidated administrative pending report across central projects.")
consolidated.add_argument("--central-projects-root", default="G:/_codex-git/nucleo-gestao-operacional/central-de-ordem-de-servico/projects")
consolidated.add_argument("--project-root", default="G:/_codex-git/tudo-para-ia-mais-humana")
consolidated.add_argument("--central-platform-folder", default="")
consolidated.add_argument("--plugin-auth-attempt", default="")
consolidated.add_argument("--git-sync-status", default="")
publication = sub.add_parser("mcp-publication-gate", help="Write the Mais Humana MCP publication gate artifacts.")
publication.add_argument("--project-root", default="G:/_codex-git/tudo-para-ia-mais-humana")
publication.add_argument("--mcp-repo-root", default="G:/_codex-git/tudo-para-ia-mcps-internos-plataform")
publication.add_argument("--central-platform-folder", default="")
publication.add_argument("--wrangler-summary", default="")
publication.add_argument("--git-sync-status", default="")
publication.add_argument("--repo-remote", default="")
publication.add_argument("--bearer", default="")
publication.add_argument("--live-probe", action="store_true")
return parser
@@ -186,6 +212,33 @@ def command_mcp_provider(args: argparse.Namespace) -> int:
return 0
def command_mcp_execute_probe(args: argparse.Namespace) -> int:
scans = scan_ecosystem(Path(args.ecosystem_root))
cells = build_matrix(scans)
reports = build_platform_reports(scans, cells)
rulebook = evaluate_rulebook(reports)
contracts = build_mcp_contract_report(rulebook)
probe = build_mcp_execute_probe(
contracts,
limit=args.limit,
observed_status=args.observed_status,
observed_note=args.observed_note,
)
print(json.dumps(as_plain_data(probe), ensure_ascii=False, indent=2))
return 0
def command_mcp_transit_ledger(args: argparse.Namespace) -> int:
scans = scan_ecosystem(Path(args.ecosystem_root))
cells = build_matrix(scans)
reports = build_platform_reports(scans, cells)
rulebook = evaluate_rulebook(reports)
contracts = build_mcp_contract_report(rulebook)
ledger = build_mcp_transit_ledger(contracts)
print(json.dumps(mcp_transit_ledger_compact_json(ledger, limit=args.limit), ensure_ascii=False, indent=2))
return 0
def command_repo_mesh(args: argparse.Namespace) -> int:
central = Path(args.central_platform_folder) if args.central_platform_folder else None
central_write_error = ""
@@ -302,6 +355,43 @@ def command_repo_mesh(args: argparse.Namespace) -> int:
return 0
def command_consolidated_report(args: argparse.Namespace) -> int:
central_platform_folder = Path(args.central_platform_folder) if args.central_platform_folder else None
report, records = run_consolidated_report(
Path(args.central_projects_root),
Path(args.project_root),
central_platform_folder=central_platform_folder,
plugin_auth_attempt=args.plugin_auth_attempt,
git_sync_status=args.git_sync_status,
)
payload = {
"report": report.to_dict(),
"generatedFiles": [record.path for record in records],
}
print(json.dumps(payload, ensure_ascii=False, indent=2))
return 0
def command_mcp_publication_gate(args: argparse.Namespace) -> int:
central_platform_folder = Path(args.central_platform_folder) if args.central_platform_folder else None
report, records = run_publication_gate(
project_root=Path(args.project_root),
mcp_repo_root=Path(args.mcp_repo_root),
central_platform_folder=central_platform_folder,
wrangler_raw_summary=args.wrangler_summary,
git_sync_status=args.git_sync_status,
repo_remote=args.repo_remote,
bearer=args.bearer,
live_probe=bool(args.live_probe),
)
payload = {
"report": report.to_dict(),
"generatedFiles": [record.path for record in records],
}
print(json.dumps(payload, ensure_ascii=False, indent=2))
return 0
def main(argv: list[str] | None = None) -> int:
parser = build_parser()
args = parser.parse_args(argv)
@@ -323,8 +413,16 @@ def main(argv: list[str] | None = None) -> int:
return command_rulebook(args)
if args.command == "mcp-provider":
return command_mcp_provider(args)
if args.command == "mcp-execute-probe":
return command_mcp_execute_probe(args)
if args.command == "mcp-transit-ledger":
return command_mcp_transit_ledger(args)
if args.command == "repo-mesh":
return command_repo_mesh(args)
if args.command == "consolidated-report":
return command_consolidated_report(args)
if args.command == "mcp-publication-gate":
return command_mcp_publication_gate(args)
parser.error(f"unknown command: {args.command}")
return 2