core-runtime-engine 11.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. core_runtime/__init__.py +10 -0
  2. core_runtime/__version__.py +17 -0
  3. core_runtime/cli/__init__.py +7 -0
  4. core_runtime/cli/__main__.py +22 -0
  5. core_runtime/cli/bump_version.py +176 -0
  6. core_runtime/cli/contract_preflight.py +69 -0
  7. core_runtime/cli/create_domain.py +66 -0
  8. core_runtime/cli/doctor.py +44 -0
  9. core_runtime/cli/inventory.py +85 -0
  10. core_runtime/cli/lint.py +8 -0
  11. core_runtime/cli/main.py +579 -0
  12. core_runtime/cli/release_check.py +65 -0
  13. core_runtime/cli/repair_artifact_paths.py +48 -0
  14. core_runtime/cli/sync_template.py +67 -0
  15. core_runtime/cli/validate.py +73 -0
  16. core_runtime/core/__init__.py +34 -0
  17. core_runtime/core/audit_event.py +760 -0
  18. core_runtime/core/audit_trail_index.py +100 -0
  19. core_runtime/core/canonicalization.py +55 -0
  20. core_runtime/core/contract_evaluator.py +945 -0
  21. core_runtime/core/contract_executability.py +307 -0
  22. core_runtime/core/contract_loader.py +57 -0
  23. core_runtime/core/contract_probes.py +630 -0
  24. core_runtime/core/contract_program.py +131 -0
  25. core_runtime/core/contract_program_registry.py +104 -0
  26. core_runtime/core/contract_program_v2.py +126 -0
  27. core_runtime/core/dsk_v3.py +142 -0
  28. core_runtime/core/explainability.py +2115 -0
  29. core_runtime/core/numeric_normalization.py +120 -0
  30. core_runtime/core/rule_anchor.py +1388 -0
  31. core_runtime/core/schema_fingerprint.py +69 -0
  32. core_runtime/core/sensor_evidence.py +548 -0
  33. core_runtime/data/contracts/CoreAnchor.sol +109 -0
  34. core_runtime/data/contracts/CoreRuleAnchor.abi.json +111 -0
  35. core_runtime/data/contracts/CoreRuleAnchor.bin +1 -0
  36. core_runtime/data/contracts/CoreRuleAnchor.build.json +20 -0
  37. core_runtime/data/contracts/CoreRuleAnchor.runtime.bin +1 -0
  38. core_runtime/data/contracts/CoreRuleAnchor.sol +74 -0
  39. core_runtime/data/package_data_manifest.v1.json +173 -0
  40. core_runtime/data/schemas/core/causal_trace.v1.json +141 -0
  41. core_runtime/data/schemas/core/context_gate.v1.json +38 -0
  42. core_runtime/data/schemas/core/context_threshold.v1.json +46 -0
  43. core_runtime/data/schemas/core/contract_program.v1.json +186 -0
  44. core_runtime/data/schemas/core/contract_program.v2.json +187 -0
  45. core_runtime/data/schemas/core/control_decision.v1.json +114 -0
  46. core_runtime/data/schemas/core/dsk.v3.json +105 -0
  47. core_runtime/data/schemas/core/effect_result.v1.json +39 -0
  48. core_runtime/data/schemas/core/entropy_signal.v1.json +108 -0
  49. core_runtime/data/schemas/core/execution_receipt.v1.json +93 -0
  50. core_runtime/data/schemas/core/frozen_release_manifest.v1.json +87 -0
  51. core_runtime/data/schemas/core/frozen_release_manifest.v2.json +72 -0
  52. core_runtime/data/schemas/core/frozen_release_manifest.v3.json +38 -0
  53. core_runtime/data/schemas/core/frozen_release_manifest.v4.json +72 -0
  54. core_runtime/data/schemas/core/frozen_release_manifest.v5.json +38 -0
  55. core_runtime/data/schemas/core/frozen_release_manifest.v6.json +116 -0
  56. core_runtime/data/schemas/core/frozen_release_manifest.v7.json +37 -0
  57. core_runtime/data/schemas/core/frozen_release_manifest.v8.json +114 -0
  58. core_runtime/data/schemas/core/frozen_rule_set.v1.json +282 -0
  59. core_runtime/data/schemas/core/memory_artifact.v1.json +120 -0
  60. core_runtime/data/schemas/core/memory_generation_result.v1.json +37 -0
  61. core_runtime/data/schemas/core/operational_learning_event.v1.json +63 -0
  62. core_runtime/data/schemas/core/pattern_candidate.v1.json +114 -0
  63. core_runtime/data/schemas/core/physical_safety_assurance_case.v1.json +676 -0
  64. core_runtime/data/schemas/core/policy_lifecycle.v1.json +99 -0
  65. core_runtime/data/schemas/core/retention_manifest.v1.json +53 -0
  66. core_runtime/data/schemas/core/reversibility_policy.v1.json +107 -0
  67. core_runtime/data/schemas/core/rule_anchor_batch.v1.json +93 -0
  68. core_runtime/data/schemas/core/rule_anchor_chain_evidence.v1.json +56 -0
  69. core_runtime/data/schemas/core/rule_approval.v1.json +49 -0
  70. core_runtime/data/schemas/core/rule_approval_request.v1.json +42 -0
  71. core_runtime/data/schemas/core/state_transition.v1.json +115 -0
  72. core_runtime/data/schemas/core/task_closeout.v1.json +47 -0
  73. core_runtime/data/schemas/core/template_promotion_candidate.v1.json +83 -0
  74. core_runtime/data/schemas/core/unsigned_rule_anchor_deployment.v1.json +106 -0
  75. core_runtime/data/schemas/core/unsigned_rule_anchor_transaction.v1.json +116 -0
  76. core_runtime/tooling/__init__.py +48 -0
  77. core_runtime/tooling/bump_version.py +900 -0
  78. core_runtime/tooling/contract_preflight.py +293 -0
  79. core_runtime/tooling/create_domain.py +254 -0
  80. core_runtime/tooling/diagnostics.py +129 -0
  81. core_runtime/tooling/doctor.py +482 -0
  82. core_runtime/tooling/file_inventory.py +182 -0
  83. core_runtime/tooling/json_checks.py +100 -0
  84. core_runtime/tooling/release_check.py +1017 -0
  85. core_runtime/tooling/repair_artifact_paths.py +458 -0
  86. core_runtime/tooling/report_writer.py +176 -0
  87. core_runtime/tooling/repository_inventory.py +399 -0
  88. core_runtime/tooling/safety_checks.py +172 -0
  89. core_runtime/tooling/sync_template.py +303 -0
  90. core_runtime/tooling/validation.py +507 -0
  91. core_runtime/tooling/version_inventory.py +256 -0
  92. core_runtime_engine-11.5.1.dist-info/METADATA +35 -0
  93. core_runtime_engine-11.5.1.dist-info/RECORD +96 -0
  94. core_runtime_engine-11.5.1.dist-info/WHEEL +5 -0
  95. core_runtime_engine-11.5.1.dist-info/entry_points.txt +2 -0
  96. core_runtime_engine-11.5.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://core-runtime-engine.local/schemas/core/template_promotion_candidate.v1.json",
4
+ "title": "TemplatePromotionCandidate.v1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": [
8
+ "schema_version",
9
+ "type",
10
+ "template_candidate_id",
11
+ "source_pattern_id",
12
+ "required_inputs",
13
+ "output_contract",
14
+ "expected_evidence",
15
+ "risk_tier",
16
+ "stop_conditions",
17
+ "human_approval_required"
18
+ ],
19
+ "properties": {
20
+ "schema_version": {
21
+ "type": "string",
22
+ "const": "core.template_promotion_candidate.v1"
23
+ },
24
+ "type": {
25
+ "type": "string",
26
+ "const": "template_promotion_candidate"
27
+ },
28
+ "template_candidate_id": {
29
+ "type": "string",
30
+ "minLength": 1
31
+ },
32
+ "source_pattern_id": {
33
+ "type": "string",
34
+ "minLength": 1
35
+ },
36
+ "required_inputs": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string",
40
+ "minLength": 1
41
+ }
42
+ },
43
+ "output_contract": {
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "expected_evidence": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ }
53
+ },
54
+ "risk_tier": {
55
+ "type": "string",
56
+ "enum": ["low", "medium", "high"]
57
+ },
58
+ "stop_conditions": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ }
64
+ },
65
+ "human_approval_required": {
66
+ "type": "boolean"
67
+ },
68
+ "source_refs": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string",
72
+ "minLength": 1
73
+ }
74
+ },
75
+ "notes": {
76
+ "type": "array",
77
+ "items": {
78
+ "type": "string",
79
+ "minLength": 1
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://core.antillanca.dev/schemas/core/unsigned_rule_anchor_deployment.v1.json",
4
+ "title": "UnsignedRuleAnchorDeployment.v1",
5
+ "description": "An unsigned CoreRuleAnchor deployment request for external-wallet review.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "type",
11
+ "signing_mode",
12
+ "broadcast",
13
+ "contract_build_fingerprint",
14
+ "expected_runtime_bytecode_sha256",
15
+ "transaction",
16
+ "gas_reserve",
17
+ "readiness",
18
+ "warnings",
19
+ "fingerprint"
20
+ ],
21
+ "properties": {
22
+ "schema_version": {"const": "core.unsigned_rule_anchor_deployment.v1"},
23
+ "type": {"const": "unsigned_rule_anchor_deployment"},
24
+ "signing_mode": {"const": "external_wallet_only"},
25
+ "broadcast": {"const": false},
26
+ "contract_build_fingerprint": {"$ref": "#/definitions/fingerprint"},
27
+ "expected_runtime_bytecode_sha256": {"$ref": "#/definitions/fingerprint"},
28
+ "transaction": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": [
32
+ "from",
33
+ "to",
34
+ "chain_id",
35
+ "value_wei",
36
+ "data",
37
+ "nonce",
38
+ "gas_limit",
39
+ "max_fee_per_gas_wei",
40
+ "max_priority_fee_per_gas_wei",
41
+ "gas_price_wei"
42
+ ],
43
+ "properties": {
44
+ "from": {"$ref": "#/definitions/address"},
45
+ "to": {"type": "null"},
46
+ "chain_id": {"type": "integer", "minimum": 1},
47
+ "value_wei": {"const": 0},
48
+ "data": {"type": "string", "pattern": "^0x[a-f0-9]+$"},
49
+ "nonce": {"$ref": "#/definitions/nullable_integer"},
50
+ "gas_limit": {"$ref": "#/definitions/nullable_positive_integer"},
51
+ "max_fee_per_gas_wei": {"$ref": "#/definitions/nullable_integer"},
52
+ "max_priority_fee_per_gas_wei": {"$ref": "#/definitions/nullable_integer"},
53
+ "gas_price_wei": {"$ref": "#/definitions/nullable_integer"}
54
+ }
55
+ },
56
+ "gas_reserve": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "required": [
60
+ "unit",
61
+ "deployment_max_cost_wei",
62
+ "post_deployment_reserve_wei",
63
+ "required_balance_wei",
64
+ "observed_balance_wei",
65
+ "shortfall_wei",
66
+ "sufficient"
67
+ ],
68
+ "properties": {
69
+ "unit": {"const": "native_wei"},
70
+ "deployment_max_cost_wei": {"$ref": "#/definitions/nullable_integer"},
71
+ "post_deployment_reserve_wei": {"type": "integer", "minimum": 0},
72
+ "required_balance_wei": {"$ref": "#/definitions/nullable_integer"},
73
+ "observed_balance_wei": {"$ref": "#/definitions/nullable_integer"},
74
+ "shortfall_wei": {"$ref": "#/definitions/nullable_integer"},
75
+ "sufficient": {"type": ["boolean", "null"]}
76
+ }
77
+ },
78
+ "readiness": {
79
+ "enum": ["ready", "insufficient_balance", "offline_unpriced", "balance_unobserved"]
80
+ },
81
+ "warnings": {
82
+ "type": "array",
83
+ "minItems": 1,
84
+ "items": {"type": "string", "minLength": 1}
85
+ },
86
+ "fingerprint": {"$ref": "#/definitions/fingerprint"}
87
+ },
88
+ "definitions": {
89
+ "fingerprint": {
90
+ "type": "string",
91
+ "pattern": "^sha256:[a-f0-9]{64}$"
92
+ },
93
+ "address": {
94
+ "type": "string",
95
+ "pattern": "^0x[a-fA-F0-9]{40}$"
96
+ },
97
+ "nullable_integer": {
98
+ "type": ["integer", "null"],
99
+ "minimum": 0
100
+ },
101
+ "nullable_positive_integer": {
102
+ "type": ["integer", "null"],
103
+ "minimum": 1
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://core.antillanca.dev/schemas/core/unsigned_rule_anchor_transaction.v1.json",
4
+ "title": "UnsignedRuleAnchorTransaction.v1",
5
+ "description": "An unsigned transaction request for external-wallet review. It cannot contain wallet secrets and never broadcasts itself.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "type",
11
+ "signing_mode",
12
+ "broadcast",
13
+ "batch_manifest_fingerprint",
14
+ "rule_set_count",
15
+ "transaction",
16
+ "gas_reserve",
17
+ "contract_code_verified",
18
+ "readiness",
19
+ "warnings",
20
+ "fingerprint"
21
+ ],
22
+ "properties": {
23
+ "schema_version": {"const": "core.unsigned_rule_anchor_transaction.v1"},
24
+ "type": {"const": "unsigned_rule_anchor_transaction"},
25
+ "signing_mode": {"const": "external_wallet_only"},
26
+ "broadcast": {"const": false},
27
+ "batch_manifest_fingerprint": {"$ref": "#/definitions/fingerprint"},
28
+ "rule_set_count": {"type": "integer", "minimum": 1, "maximum": 4294967295},
29
+ "transaction": {"$ref": "#/definitions/transaction"},
30
+ "gas_reserve": {"$ref": "#/definitions/gas_reserve"},
31
+ "contract_code_verified": {"type": ["boolean", "null"]},
32
+ "readiness": {
33
+ "enum": [
34
+ "ready",
35
+ "insufficient_balance",
36
+ "contract_unverified",
37
+ "offline_unpriced",
38
+ "balance_unobserved"
39
+ ]
40
+ },
41
+ "warnings": {
42
+ "type": "array",
43
+ "minItems": 1,
44
+ "items": {"type": "string", "minLength": 1}
45
+ },
46
+ "fingerprint": {"$ref": "#/definitions/fingerprint"}
47
+ },
48
+ "definitions": {
49
+ "fingerprint": {
50
+ "type": "string",
51
+ "pattern": "^sha256:[a-f0-9]{64}$"
52
+ },
53
+ "address": {
54
+ "type": "string",
55
+ "pattern": "^0x[a-fA-F0-9]{40}$"
56
+ },
57
+ "nullable_integer": {
58
+ "type": ["integer", "null"],
59
+ "minimum": 0
60
+ },
61
+ "transaction": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": [
65
+ "from",
66
+ "to",
67
+ "chain_id",
68
+ "value_wei",
69
+ "data",
70
+ "nonce",
71
+ "gas_limit",
72
+ "max_fee_per_gas_wei",
73
+ "max_priority_fee_per_gas_wei",
74
+ "gas_price_wei"
75
+ ],
76
+ "properties": {
77
+ "from": {"$ref": "#/definitions/address"},
78
+ "to": {"$ref": "#/definitions/address"},
79
+ "chain_id": {"type": "integer", "minimum": 1},
80
+ "value_wei": {"const": 0},
81
+ "data": {"type": "string", "pattern": "^0x[a-f0-9]{264}$"},
82
+ "nonce": {"$ref": "#/definitions/nullable_integer"},
83
+ "gas_limit": {"$ref": "#/definitions/nullable_integer"},
84
+ "max_fee_per_gas_wei": {"$ref": "#/definitions/nullable_integer"},
85
+ "max_priority_fee_per_gas_wei": {"$ref": "#/definitions/nullable_integer"},
86
+ "gas_price_wei": {"$ref": "#/definitions/nullable_integer"}
87
+ }
88
+ },
89
+ "gas_reserve": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": [
93
+ "unit",
94
+ "reserve_batches",
95
+ "safety_multiplier_bps",
96
+ "per_batch_max_cost_wei",
97
+ "max_cost_per_rule_wei",
98
+ "required_balance_wei",
99
+ "observed_balance_wei",
100
+ "shortfall_wei",
101
+ "sufficient"
102
+ ],
103
+ "properties": {
104
+ "unit": {"const": "native_wei"},
105
+ "reserve_batches": {"type": "integer", "minimum": 1},
106
+ "safety_multiplier_bps": {"type": "integer", "minimum": 10000},
107
+ "per_batch_max_cost_wei": {"$ref": "#/definitions/nullable_integer"},
108
+ "max_cost_per_rule_wei": {"$ref": "#/definitions/nullable_integer"},
109
+ "required_balance_wei": {"$ref": "#/definitions/nullable_integer"},
110
+ "observed_balance_wei": {"$ref": "#/definitions/nullable_integer"},
111
+ "shortfall_wei": {"$ref": "#/definitions/nullable_integer"},
112
+ "sufficient": {"type": ["boolean", "null"]}
113
+ }
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,48 @@
1
+ """CORE Tooling - internal tooling package for CORE maintenance commands."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from core_runtime.tooling.bump_version import BumpVersionPlanner, PlannedChange, ReplacementRule
6
+ from core_runtime.tooling.diagnostics import (
7
+ Diagnostic,
8
+ DiagnosticCollection,
9
+ ExitCode,
10
+ Severity,
11
+ )
12
+ from core_runtime.tooling.file_inventory import FileInventory, REQUIRED_FILES, REQUIRED_DIRS
13
+ from core_runtime.tooling.json_checks import JSONChecks
14
+ from core_runtime.tooling.report_writer import ReportWriter
15
+ from core_runtime.tooling.release_check import (
16
+ ReleaseCheckReport,
17
+ ReleaseCheckRunner,
18
+ SubprocessCapture,
19
+ normalize_release_target,
20
+ release_target_argument,
21
+ validate_release_target,
22
+ )
23
+ from core_runtime.tooling.safety_checks import SafetyChecks
24
+ from core_runtime.tooling.version_inventory import VersionInventory, VersionSource
25
+
26
+ __all__ = [
27
+ "BumpVersionPlanner",
28
+ "Diagnostic",
29
+ "DiagnosticCollection",
30
+ "ExitCode",
31
+ "PlannedChange",
32
+ "ReplacementRule",
33
+ "Severity",
34
+ "FileInventory",
35
+ "REQUIRED_FILES",
36
+ "REQUIRED_DIRS",
37
+ "JSONChecks",
38
+ "ReleaseCheckReport",
39
+ "ReleaseCheckRunner",
40
+ "SubprocessCapture",
41
+ "ReportWriter",
42
+ "normalize_release_target",
43
+ "release_target_argument",
44
+ "validate_release_target",
45
+ "SafetyChecks",
46
+ "VersionInventory",
47
+ "VersionSource",
48
+ ]