# This file was generated by Nuitka

# Stubs included by default
from __future__ import annotations
from pathlib import Path
from typing import Any, Dict, List, Optional
import json
import logging
import time

RULES = {'test_coverage': {'threshold_key': 'line_coverage', 'threshold': 80, 'comparison': 'below', 'ledger_title': 'Test coverage below {threshold}% — currently {value}%', 'ledger_type': 'fix', 'ledger_priority': 'P1'}, 'security_audit': {'trigger_key': 'vulnerabilities', 'trigger_if_nonempty': True, 'ledger_title': 'Security: {count} vulnerabilities found', 'ledger_type': 'fix', 'ledger_priority': 'P0'}, 'security_scan': {'trigger_key': 'vulnerabilities', 'trigger_if_nonempty': True, 'ledger_title': 'Security scan: {count} issues detected', 'ledger_type': 'fix', 'ledger_priority': 'P0'}, 'lint': {'trigger_key': 'violations', 'trigger_if_nonempty': True, 'ledger_title': 'API lint: {count} violations found', 'ledger_type': 'fix', 'ledger_priority': 'P1'}, 'deliberate': {'trigger_key': 'unanimous', 'trigger_if_true': True, 'extract_actions': True, 'ledger_title': 'Deliberation consensus reached — action items pending', 'ledger_type': 'strategy', 'ledger_priority': 'P1'}, 'gov_health': {'trigger_key': 'status', 'trigger_values': ['not_initialized', 'degraded'], 'ledger_title': 'Governance health: {value} — needs attention', 'ledger_type': 'fix', 'ledger_priority': 'P1'}, 'docs_validate': {'threshold_key': 'coverage_percent', 'threshold': 50, 'comparison': 'below', 'ledger_title': 'Documentation coverage below {threshold}% — currently {value}%', 'ledger_type': 'task', 'ledger_priority': 'P2'}}
MILESTONES = {'deploy_site': {'trigger_key': 'status', 'trigger_values': ['deployed'], 'ledger_title': 'Deployed: {project}', 'ledger_type': 'feat', 'ledger_priority': 'P1', 'auto_done': True}, 'deploy_npm': {'trigger_key': 'status', 'trigger_values': ['published'], 'ledger_title': 'Published: {package}@{new_version}', 'ledger_type': 'feat', 'ledger_priority': 'P1', 'auto_done': True}, 'deliberate': {'trigger_key': 'status', 'trigger_values': ['unanimous'], 'ledger_title': 'Consensus reached: {question_short}', 'ledger_type': 'strategy', 'ledger_priority': 'P1', 'auto_done': True}, 'test_generate': {'threshold_key': 'tests_generated', 'threshold': 10, 'comparison': 'above', 'ledger_title': 'Generated {value} tests', 'ledger_type': 'feat', 'ledger_priority': 'P2', 'auto_done': True}, 'sensor_github_issue': {'trigger_key': 'has_new_activity', 'trigger_if_true': True, 'ledger_title': 'Outreach response: new activity detected', 'ledger_type': 'task', 'ledger_priority': 'P1', 'auto_done': False}, 'zero_spec': {'trigger_key': 'success', 'trigger_if_true': True, 'ledger_title': 'Zero-spec extracted: {framework} ({paths_count} paths)', 'ledger_type': 'feat', 'ledger_priority': 'P2', 'auto_done': True}}
NEXT_STEPS = {'lint': [{'tool': 'delimit_explain', 'reason': 'Get migration guide for violations', 'premium': False}, {'tool': 'delimit_semver', 'reason': 'Classify the version bump', 'premium': False}], 'diff': [{'tool': 'delimit_semver', 'reason': 'Classify changes as MAJOR/MINOR/PATCH', 'premium': False}, {'tool': 'delimit_policy', 'reason': 'Check against governance policies', 'premium': False}], 'semver': [{'tool': 'delimit_explain', 'reason': 'Generate human-readable changelog', 'premium': False}, {'tool': 'delimit_deploy_npm', 'reason': 'Publish the new version to npm', 'premium': False}], 'init': [{'tool': 'delimit_gov_health', 'reason': 'Verify governance is set up correctly', 'premium': True}, {'tool': 'delimit_diagnose', 'reason': 'Check for any issues', 'premium': False}], 'deploy_site': [{'tool': 'delimit_deploy_npm', 'reason': 'Publish npm package if applicable', 'premium': False}, {'tool': 'delimit_ledger_context', 'reason': 'Check what else needs deploying', 'premium': False}], 'test_coverage': [{'tool': 'delimit_test_generate', 'reason': 'Generate tests for uncovered files', 'premium': False}], 'security_audit': [{'tool': 'delimit_evidence_collect', 'reason': 'Collect evidence of findings', 'premium': True}], 'gov_health': [{'tool': 'delimit_gov_status', 'reason': 'See detailed governance status', 'premium': True}, {'tool': 'delimit_repo_analyze', 'reason': 'Full repo health report', 'premium': True}], 'deploy_npm': [{'tool': 'delimit_deploy_verify', 'reason': 'Verify the published package', 'premium': True}], 'deploy_plan': [{'tool': 'delimit_deploy_build', 'reason': 'Build the deployment', 'premium': True}], 'deploy_build': [{'tool': 'delimit_deploy_publish', 'reason': 'Publish the build', 'premium': True}], 'deploy_publish': [{'tool': 'delimit_deploy_verify', 'reason': 'Verify the deployment', 'premium': True}], 'deploy_verify': [{'tool': 'delimit_deploy_rollback', 'reason': 'Rollback if unhealthy', 'premium': True}], 'repo_analyze': [{'tool': 'delimit_security_audit', 'reason': 'Scan for security issues', 'premium': False}, {'tool': 'delimit_gov_health', 'reason': 'Check governance status', 'premium': True}], 'deliberate': [{'tool': 'delimit_ledger_context', 'reason': "Review what's on the ledger after consensus", 'premium': False}], 'ledger_add': [{'tool': 'delimit_ledger_context', 'reason': 'See updated ledger state', 'premium': False}], 'diagnose': [{'tool': 'delimit_init', 'reason': 'Initialize governance if not set up', 'premium': False}]}
def govern(tool_name: str, result: Dict[str, Any], project_path: str) -> Dict[str, Any]:
    ...

def _deep_get(d: Dict, key: str) -> Any:
    ...


__name__ = ...



# Modules used internally, to allow implicit dependencies to be seen:
import json
import logging
import time
import pathlib
import typing
import ai
import ai.ledger_manager