Implement human operational rulebook

This commit is contained in:
Ami Soares
2026-04-30 07:40:25 -03:00
parent c9c1056193
commit 3d2748adf5
84 changed files with 88406 additions and 9115 deletions

View File

@@ -10,6 +10,7 @@ from .models import as_plain_data
from .matrix import build_global_recommendations, build_matrix, build_platform_reports
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
from .human_readiness_registry import build_readiness_registry
from .runtime_budget import build_round_line_budget
from .orders import build_exit_orders
@@ -41,6 +42,9 @@ def build_parser() -> argparse.ArgumentParser:
budget = sub.add_parser("line-budget", help="Print round line-budget JSON.")
budget.add_argument("--ecosystem-root", default="G:/_codex-git")
budget.add_argument("--project-root", default="G:/_codex-git/tudo-para-ia-mais-humana")
rulebook = sub.add_parser("rulebook", help="Print compact human-operational rulebook JSON.")
rulebook.add_argument("--ecosystem-root", default="G:/_codex-git")
rulebook.add_argument("--limit", type=int, default=0)
return parser
@@ -133,6 +137,15 @@ def command_line_budget(args: argparse.Namespace) -> int:
return 0
def command_rulebook(args: argparse.Namespace) -> int:
scans = scan_ecosystem(Path(args.ecosystem_root))
cells = build_matrix(scans)
reports = build_platform_reports(scans, cells)
report = evaluate_rulebook(reports, limit=args.limit or None)
print(json.dumps(rulebook_compact_json(report), ensure_ascii=False, indent=2))
return 0
def main(argv: list[str] | None = None) -> int:
parser = build_parser()
args = parser.parse_args(argv)
@@ -150,6 +163,8 @@ def main(argv: list[str] | None = None) -> int:
return command_governance(args)
if args.command == "line-budget":
return command_line_budget(args)
if args.command == "rulebook":
return command_rulebook(args)
parser.error(f"unknown command: {args.command}")
return 2