yamlr 0.1.0__tar.gz

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 (369) hide show
  1. yamlr-0.1.0/LICENSE +45 -0
  2. yamlr-0.1.0/PKG-INFO +218 -0
  3. yamlr-0.1.0/README.md +175 -0
  4. yamlr-0.1.0/native_core/Cargo.lock +2621 -0
  5. yamlr-0.1.0/native_core/Cargo.toml +76 -0
  6. yamlr-0.1.0/native_core/README.md +38 -0
  7. yamlr-0.1.0/native_core/__init__.py +1 -0
  8. yamlr-0.1.0/native_core/about.hbs +70 -0
  9. yamlr-0.1.0/native_core/about.toml +27 -0
  10. yamlr-0.1.0/native_core/benches/sharder_bench.rs +93 -0
  11. yamlr-0.1.0/native_core/catalog/cis_benchmark_mapping.json +90 -0
  12. yamlr-0.1.0/native_core/catalog/forensic_catalog.json +419 -0
  13. yamlr-0.1.0/native_core/catalog/k8s_deprecations.json +458 -0
  14. yamlr-0.1.0/native_core/deny.toml +30 -0
  15. yamlr-0.1.0/native_core/include/yamlr.h +54 -0
  16. yamlr-0.1.0/native_core/src/audit_catalog.rs +92 -0
  17. yamlr-0.1.0/native_core/src/audit_engine.rs +445 -0
  18. yamlr-0.1.0/native_core/src/audit_engine_tests.rs +120 -0
  19. yamlr-0.1.0/native_core/src/audit_registry.rs +390 -0
  20. yamlr-0.1.0/native_core/src/audit_registry_tests.rs +261 -0
  21. yamlr-0.1.0/native_core/src/auditors/gitops_auditor.rs +172 -0
  22. yamlr-0.1.0/native_core/src/auditors/mod.rs +2 -0
  23. yamlr-0.1.0/native_core/src/bin/inspect_shards.rs +23 -0
  24. yamlr-0.1.0/native_core/src/bin/inspect_tree.rs +44 -0
  25. yamlr-0.1.0/native_core/src/bin/main.rs +29 -0
  26. yamlr-0.1.0/native_core/src/cache/mod.rs +257 -0
  27. yamlr-0.1.0/native_core/src/cel/evaluator.rs +381 -0
  28. yamlr-0.1.0/native_core/src/cel/k8s_validator.rs +299 -0
  29. yamlr-0.1.0/native_core/src/cel/mod.rs +12 -0
  30. yamlr-0.1.0/native_core/src/cli/admin_cmd.rs +130 -0
  31. yamlr-0.1.0/native_core/src/cli/audit_cmd.rs +502 -0
  32. yamlr-0.1.0/native_core/src/cli/baseline_cmd.rs +304 -0
  33. yamlr-0.1.0/native_core/src/cli/check_cmd.rs +322 -0
  34. yamlr-0.1.0/native_core/src/cli/completion_cmd.rs +146 -0
  35. yamlr-0.1.0/native_core/src/cli/demo_cmd.rs +68 -0
  36. yamlr-0.1.0/native_core/src/cli/diff_viewer.rs +433 -0
  37. yamlr-0.1.0/native_core/src/cli/dispatch.rs +445 -0
  38. yamlr-0.1.0/native_core/src/cli/dna_cmd.rs +205 -0
  39. yamlr-0.1.0/native_core/src/cli/doctor_cmd.rs +163 -0
  40. yamlr-0.1.0/native_core/src/cli/evidence_cmd.rs +187 -0
  41. yamlr-0.1.0/native_core/src/cli/explain_cmd.rs +140 -0
  42. yamlr-0.1.0/native_core/src/cli/features_cmd.rs +201 -0
  43. yamlr-0.1.0/native_core/src/cli/fleet_cmd.rs +436 -0
  44. yamlr-0.1.0/native_core/src/cli/fmt_cmd.rs +419 -0
  45. yamlr-0.1.0/native_core/src/cli/graph_cmd.rs +161 -0
  46. yamlr-0.1.0/native_core/src/cli/guide_cmd.rs +132 -0
  47. yamlr-0.1.0/native_core/src/cli/heal_adapters.rs +305 -0
  48. yamlr-0.1.0/native_core/src/cli/heal_args.rs +89 -0
  49. yamlr-0.1.0/native_core/src/cli/heal_cmd.rs +518 -0
  50. yamlr-0.1.0/native_core/src/cli/heal_cmd_tests.rs +414 -0
  51. yamlr-0.1.0/native_core/src/cli/heal_document.rs +203 -0
  52. yamlr-0.1.0/native_core/src/cli/heal_gates.rs +400 -0
  53. yamlr-0.1.0/native_core/src/cli/heal_reporting.rs +54 -0
  54. yamlr-0.1.0/native_core/src/cli/heal_topology.rs +75 -0
  55. yamlr-0.1.0/native_core/src/cli/heal_writer.rs +347 -0
  56. yamlr-0.1.0/native_core/src/cli/idp_export_cmd.rs +267 -0
  57. yamlr-0.1.0/native_core/src/cli/init_cmd.rs +149 -0
  58. yamlr-0.1.0/native_core/src/cli/lsp_handlers.rs +175 -0
  59. yamlr-0.1.0/native_core/src/cli/lsp_server.rs +343 -0
  60. yamlr-0.1.0/native_core/src/cli/lsp_server_tests.rs +123 -0
  61. yamlr-0.1.0/native_core/src/cli/mcp_server.rs +234 -0
  62. yamlr-0.1.0/native_core/src/cli/metrics_cmd.rs +149 -0
  63. yamlr-0.1.0/native_core/src/cli/migrate_cmd.rs +465 -0
  64. yamlr-0.1.0/native_core/src/cli/migrate_cmd_tests.rs +119 -0
  65. yamlr-0.1.0/native_core/src/cli/mod.rs +244 -0
  66. yamlr-0.1.0/native_core/src/cli/rollback_cmd.rs +91 -0
  67. yamlr-0.1.0/native_core/src/cli/scan_args.rs +149 -0
  68. yamlr-0.1.0/native_core/src/cli/scan_cmd.rs +508 -0
  69. yamlr-0.1.0/native_core/src/cli/scan_cmd_e2e_tests.rs +314 -0
  70. yamlr-0.1.0/native_core/src/cli/scan_cmd_tests.rs +282 -0
  71. yamlr-0.1.0/native_core/src/cli/scan_crd.rs +317 -0
  72. yamlr-0.1.0/native_core/src/cli/scan_fail_on.rs +84 -0
  73. yamlr-0.1.0/native_core/src/cli/scan_file.rs +442 -0
  74. yamlr-0.1.0/native_core/src/cli/scan_input.rs +119 -0
  75. yamlr-0.1.0/native_core/src/cli/scan_manifest.rs +429 -0
  76. yamlr-0.1.0/native_core/src/cli/scan_oci.rs +131 -0
  77. yamlr-0.1.0/native_core/src/cli/scan_output.rs +193 -0
  78. yamlr-0.1.0/native_core/src/cli/scan_record.rs +11 -0
  79. yamlr-0.1.0/native_core/src/cli/scan_render.rs +158 -0
  80. yamlr-0.1.0/native_core/src/cli/scan_stdin.rs +130 -0
  81. yamlr-0.1.0/native_core/src/cli/scan_telemetry.rs +122 -0
  82. yamlr-0.1.0/native_core/src/cli/scan_walk.rs +160 -0
  83. yamlr-0.1.0/native_core/src/cli/schema_cmd.rs +340 -0
  84. yamlr-0.1.0/native_core/src/cli/schema_gate.rs +532 -0
  85. yamlr-0.1.0/native_core/src/cli/schema_gate_tests.rs +330 -0
  86. yamlr-0.1.0/native_core/src/cli/secure_cmd.rs +252 -0
  87. yamlr-0.1.0/native_core/src/cli/sign_cmd.rs +206 -0
  88. yamlr-0.1.0/native_core/src/cli/status_cmd.rs +81 -0
  89. yamlr-0.1.0/native_core/src/cli/subscription_cmd.rs +180 -0
  90. yamlr-0.1.0/native_core/src/cli/support_contract.rs +348 -0
  91. yamlr-0.1.0/native_core/src/cli/utility_cmds.rs +251 -0
  92. yamlr-0.1.0/native_core/src/cli/vap_cmd.rs +391 -0
  93. yamlr-0.1.0/native_core/src/cli/watch.rs +270 -0
  94. yamlr-0.1.0/native_core/src/cli/webhook_cmd.rs +376 -0
  95. yamlr-0.1.0/native_core/src/cluster/mod.rs +120 -0
  96. yamlr-0.1.0/native_core/src/cluster/tls_config.rs +217 -0
  97. yamlr-0.1.0/native_core/src/cluster/webhook.rs +479 -0
  98. yamlr-0.1.0/native_core/src/discovery/analyzers.rs +252 -0
  99. yamlr-0.1.0/native_core/src/discovery/blast_radius.rs +156 -0
  100. yamlr-0.1.0/native_core/src/discovery/builder.rs +427 -0
  101. yamlr-0.1.0/native_core/src/discovery/mod.rs +21 -0
  102. yamlr-0.1.0/native_core/src/discovery/scanner.rs +170 -0
  103. yamlr-0.1.0/native_core/src/discovery/tests.rs +326 -0
  104. yamlr-0.1.0/native_core/src/ffi.rs +186 -0
  105. yamlr-0.1.0/native_core/src/grpc/mod.rs +14 -0
  106. yamlr-0.1.0/native_core/src/grpc/server.rs +218 -0
  107. yamlr-0.1.0/native_core/src/grpc/service.rs +356 -0
  108. yamlr-0.1.0/native_core/src/healers/anchor_declaration_healer.rs +131 -0
  109. yamlr-0.1.0/native_core/src/healers/annotation_contract_healer.rs +378 -0
  110. yamlr-0.1.0/native_core/src/healers/api_deprecation_healer.rs +433 -0
  111. yamlr-0.1.0/native_core/src/healers/api_deprecation_healer_tests.rs +192 -0
  112. yamlr-0.1.0/native_core/src/healers/api_infer_healer.rs +327 -0
  113. yamlr-0.1.0/native_core/src/healers/app_protocol_healer.rs +340 -0
  114. yamlr-0.1.0/native_core/src/healers/autoscaler_arbitration_healer.rs +262 -0
  115. yamlr-0.1.0/native_core/src/healers/autoscaler_arbitration_healer_tests.rs +258 -0
  116. yamlr-0.1.0/native_core/src/healers/block_scalar_healer.rs +211 -0
  117. yamlr-0.1.0/native_core/src/healers/cert_manager_healer.rs +248 -0
  118. yamlr-0.1.0/native_core/src/healers/cis_security_healer.rs +369 -0
  119. yamlr-0.1.0/native_core/src/healers/cluster_dump_healer.rs +232 -0
  120. yamlr-0.1.0/native_core/src/healers/configmap_healer.rs +254 -0
  121. yamlr-0.1.0/native_core/src/healers/configmap_secret_healer.rs +98 -0
  122. yamlr-0.1.0/native_core/src/healers/crb_subject_healer.rs +315 -0
  123. yamlr-0.1.0/native_core/src/healers/crd_healer.rs +386 -0
  124. yamlr-0.1.0/native_core/src/healers/cronjob_schedule_healer.rs +144 -0
  125. yamlr-0.1.0/native_core/src/healers/crossplane_healer.rs +226 -0
  126. yamlr-0.1.0/native_core/src/healers/daemonset_update_healer.rs +194 -0
  127. yamlr-0.1.0/native_core/src/healers/dangling_key_healer.rs +141 -0
  128. yamlr-0.1.0/native_core/src/healers/data_key_healer.rs +455 -0
  129. yamlr-0.1.0/native_core/src/healers/deployment_revision_healer.rs +155 -0
  130. yamlr-0.1.0/native_core/src/healers/dna_healer.rs +257 -0
  131. yamlr-0.1.0/native_core/src/healers/dns_network_healer.rs +288 -0
  132. yamlr-0.1.0/native_core/src/healers/downward_api_healer.rs +253 -0
  133. yamlr-0.1.0/native_core/src/healers/dra_healer.rs +182 -0
  134. yamlr-0.1.0/native_core/src/healers/dual_stack_healer.rs +411 -0
  135. yamlr-0.1.0/native_core/src/healers/encoding_transcoder_healer.rs +107 -0
  136. yamlr-0.1.0/native_core/src/healers/enum_healer.rs +323 -0
  137. yamlr-0.1.0/native_core/src/healers/ephemeral_container_healer.rs +270 -0
  138. yamlr-0.1.0/native_core/src/healers/external_secret_healer.rs +227 -0
  139. yamlr-0.1.0/native_core/src/healers/federation_healer.rs +232 -0
  140. yamlr-0.1.0/native_core/src/healers/gateway_api_healer.rs +338 -0
  141. yamlr-0.1.0/native_core/src/healers/gateway_route_healer.rs +384 -0
  142. yamlr-0.1.0/native_core/src/healers/gateway_tls_healer.rs +339 -0
  143. yamlr-0.1.0/native_core/src/healers/gitops_healer.rs +498 -0
  144. yamlr-0.1.0/native_core/src/healers/graceful_rollout_healer.rs +238 -0
  145. yamlr-0.1.0/native_core/src/healers/hpa_migration_companion.rs +323 -0
  146. yamlr-0.1.0/native_core/src/healers/hpa_target_healer.rs +346 -0
  147. yamlr-0.1.0/native_core/src/healers/image_pull_healer.rs +160 -0
  148. yamlr-0.1.0/native_core/src/healers/indentation_disambiguator.rs +166 -0
  149. yamlr-0.1.0/native_core/src/healers/ingress_annotation_healer.rs +401 -0
  150. yamlr-0.1.0/native_core/src/healers/ingress_port_healer.rs +504 -0
  151. yamlr-0.1.0/native_core/src/healers/ingress_shadow_healer.rs +154 -0
  152. yamlr-0.1.0/native_core/src/healers/ingress_shadow_healer_tests.rs +389 -0
  153. yamlr-0.1.0/native_core/src/healers/ingress_snippet_healer.rs +477 -0
  154. yamlr-0.1.0/native_core/src/healers/ingress_tls_healer.rs +210 -0
  155. yamlr-0.1.0/native_core/src/healers/istio_healer.rs +384 -0
  156. yamlr-0.1.0/native_core/src/healers/job_contract_healer.rs +401 -0
  157. yamlr-0.1.0/native_core/src/healers/key_sorter.rs +134 -0
  158. yamlr-0.1.0/native_core/src/healers/kustomize_healer.rs +186 -0
  159. yamlr-0.1.0/native_core/src/healers/lifecycle_healer.rs +283 -0
  160. yamlr-0.1.0/native_core/src/healers/linkerd_healer.rs +251 -0
  161. yamlr-0.1.0/native_core/src/healers/match_expressions_healer.rs +188 -0
  162. yamlr-0.1.0/native_core/src/healers/memory_unit_healer.rs +163 -0
  163. yamlr-0.1.0/native_core/src/healers/mod.rs +103 -0
  164. yamlr-0.1.0/native_core/src/healers/network_policy_egress_healer.rs +367 -0
  165. yamlr-0.1.0/native_core/src/healers/network_policy_healer.rs +113 -0
  166. yamlr-0.1.0/native_core/src/healers/node_selector_healer.rs +196 -0
  167. yamlr-0.1.0/native_core/src/healers/numeric_type_healer.rs +191 -0
  168. yamlr-0.1.0/native_core/src/healers/orphaned_indent_healer.rs +204 -0
  169. yamlr-0.1.0/native_core/src/healers/pdb_healer.rs +425 -0
  170. yamlr-0.1.0/native_core/src/healers/pdb_max_unavailable_healer.rs +131 -0
  171. yamlr-0.1.0/native_core/src/healers/pipeline_healer.rs +315 -0
  172. yamlr-0.1.0/native_core/src/healers/port_healer.rs +397 -0
  173. yamlr-0.1.0/native_core/src/healers/probe_healer.rs +412 -0
  174. yamlr-0.1.0/native_core/src/healers/probe_healer_tests.rs +167 -0
  175. yamlr-0.1.0/native_core/src/healers/protocol_contract_healer.rs +263 -0
  176. yamlr-0.1.0/native_core/src/healers/protocol_contract_healer_tests.rs +247 -0
  177. yamlr-0.1.0/native_core/src/healers/pvc_healer.rs +323 -0
  178. yamlr-0.1.0/native_core/src/healers/qos_healer.rs +290 -0
  179. yamlr-0.1.0/native_core/src/healers/qos_healer_tests.rs +210 -0
  180. yamlr-0.1.0/native_core/src/healers/rb_subject_healer.rs +246 -0
  181. yamlr-0.1.0/native_core/src/healers/rbac_healer.rs +404 -0
  182. yamlr-0.1.0/native_core/src/healers/reference_utils.rs +249 -0
  183. yamlr-0.1.0/native_core/src/healers/referential_healer.rs +404 -0
  184. yamlr-0.1.0/native_core/src/healers/referential_healer_tests.rs +200 -0
  185. yamlr-0.1.0/native_core/src/healers/resource_sanitizer.rs +433 -0
  186. yamlr-0.1.0/native_core/src/healers/secret_healer.rs +377 -0
  187. yamlr-0.1.0/native_core/src/healers/secret_healer_tests.rs +236 -0
  188. yamlr-0.1.0/native_core/src/healers/secret_store_healer.rs +291 -0
  189. yamlr-0.1.0/native_core/src/healers/security_context_healer.rs +345 -0
  190. yamlr-0.1.0/native_core/src/healers/security_context_healer_tests.rs +223 -0
  191. yamlr-0.1.0/native_core/src/healers/selector_healer.rs +504 -0
  192. yamlr-0.1.0/native_core/src/healers/sequence_indent_healer.rs +162 -0
  193. yamlr-0.1.0/native_core/src/healers/service_account_healer.rs +160 -0
  194. yamlr-0.1.0/native_core/src/healers/service_dns_healer.rs +379 -0
  195. yamlr-0.1.0/native_core/src/healers/service_network_contract_healer.rs +269 -0
  196. yamlr-0.1.0/native_core/src/healers/service_target_port_healer.rs +282 -0
  197. yamlr-0.1.0/native_core/src/healers/session_affinity_healer.rs +280 -0
  198. yamlr-0.1.0/native_core/src/healers/sidecar_healer.rs +317 -0
  199. yamlr-0.1.0/native_core/src/healers/statefulset_immutability_healer.rs +446 -0
  200. yamlr-0.1.0/native_core/src/healers/storage_emptydir_healer.rs +258 -0
  201. yamlr-0.1.0/native_core/src/healers/storage_ops_healer.rs +432 -0
  202. yamlr-0.1.0/native_core/src/healers/structural_healer.rs +432 -0
  203. yamlr-0.1.0/native_core/src/healers/structural_healer_tests.rs +135 -0
  204. yamlr-0.1.0/native_core/src/healers/stub_healer.rs +162 -0
  205. yamlr-0.1.0/native_core/src/healers/template_masker.rs +274 -0
  206. yamlr-0.1.0/native_core/src/healers/topology_key_healer.rs +264 -0
  207. yamlr-0.1.0/native_core/src/healers/topology_spread_healer.rs +327 -0
  208. yamlr-0.1.0/native_core/src/healers/topology_spread_healer_tests.rs +249 -0
  209. yamlr-0.1.0/native_core/src/healers/typo_dictionaries.rs +294 -0
  210. yamlr-0.1.0/native_core/src/healers/typo_healer.rs +382 -0
  211. yamlr-0.1.0/native_core/src/healers/typo_healer_tests.rs +435 -0
  212. yamlr-0.1.0/native_core/src/healers/velero_healer.rs +249 -0
  213. yamlr-0.1.0/native_core/src/healers/violation_remediator.rs +307 -0
  214. yamlr-0.1.0/native_core/src/healers/volume_contract_healer.rs +209 -0
  215. yamlr-0.1.0/native_core/src/healing.rs +94 -0
  216. yamlr-0.1.0/native_core/src/healing_cross_resource.rs +324 -0
  217. yamlr-0.1.0/native_core/src/healing_in_manifest.rs +399 -0
  218. yamlr-0.1.0/native_core/src/healing_tests.rs +264 -0
  219. yamlr-0.1.0/native_core/src/identity/extractors/annotations.rs +56 -0
  220. yamlr-0.1.0/native_core/src/identity/extractors/cluster_role_bindings.rs +198 -0
  221. yamlr-0.1.0/native_core/src/identity/extractors/configmap_refs.rs +71 -0
  222. yamlr-0.1.0/native_core/src/identity/extractors/container_env.rs +107 -0
  223. yamlr-0.1.0/native_core/src/identity/extractors/container_images.rs +51 -0
  224. yamlr-0.1.0/native_core/src/identity/extractors/container_ports.rs +110 -0
  225. yamlr-0.1.0/native_core/src/identity/extractors/daemonset_selectors.rs +55 -0
  226. yamlr-0.1.0/native_core/src/identity/extractors/data_keys.rs +91 -0
  227. yamlr-0.1.0/native_core/src/identity/extractors/deployment_selectors.rs +64 -0
  228. yamlr-0.1.0/native_core/src/identity/extractors/ingress_backends.rs +73 -0
  229. yamlr-0.1.0/native_core/src/identity/extractors/ingress_tls.rs +69 -0
  230. yamlr-0.1.0/native_core/src/identity/extractors/job_selectors.rs +86 -0
  231. yamlr-0.1.0/native_core/src/identity/extractors/mod.rs +150 -0
  232. yamlr-0.1.0/native_core/src/identity/extractors/namespaces.rs +103 -0
  233. yamlr-0.1.0/native_core/src/identity/extractors/owner_refs.rs +101 -0
  234. yamlr-0.1.0/native_core/src/identity/extractors/pod_security.rs +71 -0
  235. yamlr-0.1.0/native_core/src/identity/extractors/pvc_refs.rs +89 -0
  236. yamlr-0.1.0/native_core/src/identity/extractors/role_bindings.rs +206 -0
  237. yamlr-0.1.0/native_core/src/identity/extractors/secret_refs.rs +83 -0
  238. yamlr-0.1.0/native_core/src/identity/extractors/service_accounts.rs +68 -0
  239. yamlr-0.1.0/native_core/src/identity/extractors/service_ports.rs +134 -0
  240. yamlr-0.1.0/native_core/src/identity/extractors/service_selectors.rs +71 -0
  241. yamlr-0.1.0/native_core/src/identity/extractors/statefulset_selectors.rs +100 -0
  242. yamlr-0.1.0/native_core/src/identity/extractors/vpa_targets.rs +82 -0
  243. yamlr-0.1.0/native_core/src/identity.rs +355 -0
  244. yamlr-0.1.0/native_core/src/lib.rs +462 -0
  245. yamlr-0.1.0/native_core/src/lib_wrappers.rs +270 -0
  246. yamlr-0.1.0/native_core/src/models.rs +421 -0
  247. yamlr-0.1.0/native_core/src/models_reports.rs +351 -0
  248. yamlr-0.1.0/native_core/src/otel_exporter.rs +92 -0
  249. yamlr-0.1.0/native_core/src/parsers/anchor_resolver.rs +231 -0
  250. yamlr-0.1.0/native_core/src/parsers/helm/expander.rs +499 -0
  251. yamlr-0.1.0/native_core/src/parsers/helm/oci.rs +415 -0
  252. yamlr-0.1.0/native_core/src/parsers/helm/rules.rs +122 -0
  253. yamlr-0.1.0/native_core/src/parsers/helm/schema_validator.rs +248 -0
  254. yamlr-0.1.0/native_core/src/parsers/helm/sprig.rs +272 -0
  255. yamlr-0.1.0/native_core/src/parsers/helm/tests.rs +179 -0
  256. yamlr-0.1.0/native_core/src/parsers/helm/umbrella.rs +132 -0
  257. yamlr-0.1.0/native_core/src/parsers/helm/values.rs +384 -0
  258. yamlr-0.1.0/native_core/src/parsers/helm.rs +46 -0
  259. yamlr-0.1.0/native_core/src/parsers/heuristics/block_scalar_indentation.rs +97 -0
  260. yamlr-0.1.0/native_core/src/parsers/heuristics/boolean_guard.rs +135 -0
  261. yamlr-0.1.0/native_core/src/parsers/heuristics/flow_sanitizer.rs +182 -0
  262. yamlr-0.1.0/native_core/src/parsers/heuristics/indentation.rs +104 -0
  263. yamlr-0.1.0/native_core/src/parsers/heuristics/keywords.rs +163 -0
  264. yamlr-0.1.0/native_core/src/parsers/heuristics/legacy.rs +53 -0
  265. yamlr-0.1.0/native_core/src/parsers/heuristics/list_indentation.rs +76 -0
  266. yamlr-0.1.0/native_core/src/parsers/heuristics/mod.rs +202 -0
  267. yamlr-0.1.0/native_core/src/parsers/heuristics/punctuation.rs +529 -0
  268. yamlr-0.1.0/native_core/src/parsers/heuristics/punctuation_constants.rs +110 -0
  269. yamlr-0.1.0/native_core/src/parsers/heuristics/punctuation_tests.rs +259 -0
  270. yamlr-0.1.0/native_core/src/parsers/heuristics/sequence.rs +176 -0
  271. yamlr-0.1.0/native_core/src/parsers/heuristics/table_continuation.rs +34 -0
  272. yamlr-0.1.0/native_core/src/parsers/heuristics/template_safety.rs +96 -0
  273. yamlr-0.1.0/native_core/src/parsers/interner.rs +303 -0
  274. yamlr-0.1.0/native_core/src/parsers/kustomize/directory_renderer.rs +225 -0
  275. yamlr-0.1.0/native_core/src/parsers/kustomize/merge_matrix.rs +305 -0
  276. yamlr-0.1.0/native_core/src/parsers/kustomize/merge_matrix_tests.rs +224 -0
  277. yamlr-0.1.0/native_core/src/parsers/kustomize/mod.rs +16 -0
  278. yamlr-0.1.0/native_core/src/parsers/kustomize/renderer.rs +390 -0
  279. yamlr-0.1.0/native_core/src/parsers/layout_grafter.rs +476 -0
  280. yamlr-0.1.0/native_core/src/parsers/mod.rs +29 -0
  281. yamlr-0.1.0/native_core/src/parsers/reconstructor.rs +340 -0
  282. yamlr-0.1.0/native_core/src/parsers/shard_finder.rs +96 -0
  283. yamlr-0.1.0/native_core/src/parsers/streaming.rs +260 -0
  284. yamlr-0.1.0/native_core/src/parsers/terraform.rs +20 -0
  285. yamlr-0.1.0/native_core/src/path_utils.rs +139 -0
  286. yamlr-0.1.0/native_core/src/pipeline.rs +284 -0
  287. yamlr-0.1.0/native_core/src/rego/compiler.rs +427 -0
  288. yamlr-0.1.0/native_core/src/rego/mod.rs +2 -0
  289. yamlr-0.1.0/native_core/src/remediation_io/gitops.rs +178 -0
  290. yamlr-0.1.0/native_core/src/remediation_io/journal.rs +365 -0
  291. yamlr-0.1.0/native_core/src/remediation_io/policy_adapter.rs +284 -0
  292. yamlr-0.1.0/native_core/src/remediation_io/rollback.rs +153 -0
  293. yamlr-0.1.0/native_core/src/remediation_io/tests.rs +232 -0
  294. yamlr-0.1.0/native_core/src/remediation_io/vault.rs +192 -0
  295. yamlr-0.1.0/native_core/src/remediation_io.rs +17 -0
  296. yamlr-0.1.0/native_core/src/sarif/code_flows.rs +281 -0
  297. yamlr-0.1.0/native_core/src/sarif/mod.rs +8 -0
  298. yamlr-0.1.0/native_core/src/schemas/bundler.rs +418 -0
  299. yamlr-0.1.0/native_core/src/schemas/cncf_crds_distilled.json.zst +0 -0
  300. yamlr-0.1.0/native_core/src/schemas/constraints.rs +496 -0
  301. yamlr-0.1.0/native_core/src/schemas/crd_validator.rs +432 -0
  302. yamlr-0.1.0/native_core/src/schemas/distiller.rs +399 -0
  303. yamlr-0.1.0/native_core/src/schemas/fetcher.rs +363 -0
  304. yamlr-0.1.0/native_core/src/schemas/k8s_v1.21_distilled.json.zst +0 -0
  305. yamlr-0.1.0/native_core/src/schemas/k8s_v1.22_distilled.json.zst +0 -0
  306. yamlr-0.1.0/native_core/src/schemas/k8s_v1.23_distilled.json.zst +0 -0
  307. yamlr-0.1.0/native_core/src/schemas/k8s_v1.24_distilled.json.zst +0 -0
  308. yamlr-0.1.0/native_core/src/schemas/k8s_v1.25_distilled.json.zst +0 -0
  309. yamlr-0.1.0/native_core/src/schemas/k8s_v1.26_distilled.json.zst +0 -0
  310. yamlr-0.1.0/native_core/src/schemas/k8s_v1.27_distilled.json.zst +0 -0
  311. yamlr-0.1.0/native_core/src/schemas/k8s_v1.28_distilled.json.zst +0 -0
  312. yamlr-0.1.0/native_core/src/schemas/k8s_v1.29_distilled.json.zst +0 -0
  313. yamlr-0.1.0/native_core/src/schemas/k8s_v1.30_distilled.json.zst +0 -0
  314. yamlr-0.1.0/native_core/src/schemas/k8s_v1.31_distilled.json.zst +0 -0
  315. yamlr-0.1.0/native_core/src/schemas/k8s_v1.32_distilled.json.zst +0 -0
  316. yamlr-0.1.0/native_core/src/schemas/k8s_v1.33_distilled.json.zst +0 -0
  317. yamlr-0.1.0/native_core/src/schemas/k8s_v1.34_distilled.json.zst +0 -0
  318. yamlr-0.1.0/native_core/src/schemas/k8s_v1.35_distilled.json.zst +0 -0
  319. yamlr-0.1.0/native_core/src/schemas/k8s_v1.36_distilled.json.zst +0 -0
  320. yamlr-0.1.0/native_core/src/schemas/k8s_v1.37_distilled.json.zst +0 -0
  321. yamlr-0.1.0/native_core/src/schemas/nested.rs +508 -0
  322. yamlr-0.1.0/native_core/src/schemas/tests.rs +388 -0
  323. yamlr-0.1.0/native_core/src/schemas/unknown_fields.rs +323 -0
  324. yamlr-0.1.0/native_core/src/schemas/validator.rs +451 -0
  325. yamlr-0.1.0/native_core/src/schemas.rs +45 -0
  326. yamlr-0.1.0/native_core/src/security/attestation.rs +422 -0
  327. yamlr-0.1.0/native_core/src/security/entitlements.rs +352 -0
  328. yamlr-0.1.0/native_core/src/security/entitlements_tests.rs +268 -0
  329. yamlr-0.1.0/native_core/src/security/hardening.rs +498 -0
  330. yamlr-0.1.0/native_core/src/security/licensing.rs +294 -0
  331. yamlr-0.1.0/native_core/src/security/licensing_tests.rs +220 -0
  332. yamlr-0.1.0/native_core/src/security/public_key.pem +9 -0
  333. yamlr-0.1.0/native_core/src/security/signature.rs +217 -0
  334. yamlr-0.1.0/native_core/src/security/suppression.rs +148 -0
  335. yamlr-0.1.0/native_core/src/security/team_refresh.rs +297 -0
  336. yamlr-0.1.0/native_core/src/security/tests.rs +225 -0
  337. yamlr-0.1.0/native_core/src/security.rs +24 -0
  338. yamlr-0.1.0/native_core/src/sharder.rs +507 -0
  339. yamlr-0.1.0/native_core/src/sharder_guardrails.rs +100 -0
  340. yamlr-0.1.0/native_core/src/sharder_keys.rs +119 -0
  341. yamlr-0.1.0/native_core/src/sharder_scanner.rs +119 -0
  342. yamlr-0.1.0/native_core/src/sharder_tests.rs +205 -0
  343. yamlr-0.1.0/native_core/src/shield.rs +296 -0
  344. yamlr-0.1.0/native_core/src/structurer.rs +411 -0
  345. yamlr-0.1.0/native_core/src/telemetry.rs +111 -0
  346. yamlr-0.1.0/native_core/src/telemetry_gate.rs +72 -0
  347. yamlr-0.1.0/native_core/src/wasm.rs +247 -0
  348. yamlr-0.1.0/native_core/tests/adversarial_sre_invariants.rs +195 -0
  349. yamlr-0.1.0/native_core/tests/crash_consistency_test.rs +182 -0
  350. yamlr-0.1.0/native_core/tests/fixtures/licensing_test_private.pem +28 -0
  351. yamlr-0.1.0/native_core/tests/fixtures/licensing_test_public.pem +9 -0
  352. yamlr-0.1.0/native_core/tests/golden_bundle_e2e.rs +77 -0
  353. yamlr-0.1.0/native_core/tests/golden_corpus_invariants.rs +340 -0
  354. yamlr-0.1.0/native_core/tests/human_error_healers_e2e.rs +102 -0
  355. yamlr-0.1.0/native_core/tests/k8s_conformance_oracle.rs +195 -0
  356. yamlr-0.1.0/native_core/tests/k8s_version_contract_test.rs +89 -0
  357. yamlr-0.1.0/native_core/tests/nightmare_healers_e2e.rs +209 -0
  358. yamlr-0.1.0/native_core/tests/regression_data_loss_fixes.rs +825 -0
  359. yamlr-0.1.0/native_core/tests/rule_uniqueness_test.rs +233 -0
  360. yamlr-0.1.0/native_core/tests/schema_gate_fault_injection_tests.rs +176 -0
  361. yamlr-0.1.0/native_core/tests/traps_35_to_46_e2e.rs +509 -0
  362. yamlr-0.1.0/native_core/tests/unbreakable_hardening_e2e.rs +335 -0
  363. yamlr-0.1.0/pyproject.toml +83 -0
  364. yamlr-0.1.0/src/yamlr/__init__.py +120 -0
  365. yamlr-0.1.0/src/yamlr/__main__.py +77 -0
  366. yamlr-0.1.0/src/yamlr/_find_bin.py +76 -0
  367. yamlr-0.1.0/src/yamlr/version.py +10 -0
  368. yamlr-0.1.0/src/yamlr_native/__init__.py +7 -0
  369. yamlr-0.1.0/src/yamlr_native/__init__.pyi +71 -0
yamlr-0.1.0/LICENSE ADDED
@@ -0,0 +1,45 @@
1
+ YAMLR PROPRIETARY & COMMERCIAL SOFTWARE LICENSE
2
+ (All Rights Reserved)
3
+
4
+ Copyright (c) 2026 Timonel Labs. All Rights Reserved.
5
+
6
+ IMPORTANT: PLEASE READ THIS SOFTWARE LICENSE AGREEMENT CAREFULLY BEFORE DOWNLOADING,
7
+ INSTALLING, COPYING, OR USING THIS SOFTWARE.
8
+
9
+ 1. PROPRIETARY RIGHTS AND OWNERSHIP
10
+ This software ("Yamlr"), including its source code, object code, documentation,
11
+ architecture, data models, algorithms, and interface designs, is the proprietary
12
+ and confidential intellectual property of Timonel Labs ("Licensor").
13
+ Yamlr is protected by international copyright laws and applicable trade secret laws.
14
+
15
+ 2. GRANT OF LICENSE
16
+ Subject to the terms of this Agreement:
17
+ a) Evaluation / Community Use: You are granted a limited, personal, non-exclusive,
18
+ non-transferable, revocable license to install and execute the community tier of
19
+ Yamlr solely for internal evaluation and non-commercial development purposes.
20
+ b) Commercial / Enterprise Use: Any production deployment, automated CI/CD pipeline
21
+ execution across multi-node or enterprise infrastructure, or commercial use
22
+ requires a valid, active commercial license issued by the Licensor.
23
+
24
+ 3. RESTRICTIONS
25
+ You may NOT:
26
+ a) Decompile, reverse engineer, disassemble, or attempt to derive the underlying
27
+ source code of compiled native components or cryptographic services.
28
+ b) Sub-license, lease, rent, sell, distribute, or host Yamlr as a managed service
29
+ or SaaS offering without prior written authorization from the Licensor.
30
+ c) Remove, alter, or obscure any proprietary notices, copyright marks, or license
31
+ identifiers contained within Yamlr or its documentation.
32
+ d) Bypass, disable, or circumvent any license validation or cryptographic verification
33
+ mechanisms.
34
+
35
+ 4. DISCLAIMER OF WARRANTIES
36
+ YAMLR IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
37
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
38
+ PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE LICENSOR BE LIABLE
39
+ FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT,
40
+ OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE.
41
+
42
+ 5. TERMINATION
43
+ This license is effective until terminated. Your rights under this license will
44
+ terminate automatically without notice from the Licensor if you fail to comply with
45
+ any term(s) of this Agreement.
yamlr-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: yamlr
3
+ Version: 0.1.0
4
+ Classifier: Programming Language :: Python :: 3
5
+ Classifier: License :: Other/Proprietary License
6
+ Classifier: Operating System :: OS Independent
7
+ Requires-Dist: pyinstaller>=6.4.0 ; extra == 'build'
8
+ Requires-Dist: pytest>=7.0 ; extra == 'dev'
9
+ Requires-Dist: pytest-cov>=4.0 ; extra == 'dev'
10
+ Requires-Dist: black>=22.0 ; extra == 'dev'
11
+ Requires-Dist: mypy>=1.0 ; extra == 'dev'
12
+ Requires-Dist: sphinx>=7.0 ; extra == 'dev'
13
+ Requires-Dist: sphinx-rtd-theme>=1.3 ; extra == 'dev'
14
+ Requires-Dist: myst-parser>=2.0 ; extra == 'dev'
15
+ Requires-Dist: pylint>=3.0 ; extra == 'dev'
16
+ Requires-Dist: ruamel-yaml>=0.17.0 ; extra == 'legacy'
17
+ Requires-Dist: rich>=12.0.0 ; extra == 'legacy'
18
+ Requires-Dist: jsonschema>=4.0.0 ; extra == 'legacy'
19
+ Requires-Dist: pyyaml>=6.0 ; extra == 'legacy'
20
+ Requires-Dist: pydantic>=2.0.0 ; extra == 'legacy'
21
+ Requires-Dist: portalocker>=2.0.0 ; extra == 'legacy'
22
+ Requires-Dist: pyjwt>=2.8.0 ; extra == 'legacy'
23
+ Requires-Dist: cryptography>=42.0.0 ; extra == 'legacy'
24
+ Requires-Dist: joblib>=1.3.0 ; extra == 'legacy'
25
+ Requires-Dist: keyring>=24.0.0 ; extra == 'legacy'
26
+ Requires-Dist: mcp>=0.9.1 ; extra == 'legacy'
27
+ Requires-Dist: reportlab>=4.0.0 ; extra == 'reporting'
28
+ Provides-Extra: build
29
+ Provides-Extra: dev
30
+ Provides-Extra: legacy
31
+ Provides-Extra: reporting
32
+ License-File: LICENSE
33
+ Summary: yamlr — Kubernetes manifest safety & healing engine (Python SDK & Automation Plane)
34
+ Keywords: kubernetes,yaml,devops,sre,yamlr,manifest-healing
35
+ Author-email: Yamlr Team <contact@yamlr.dev>
36
+ License: Proprietary
37
+ Requires-Python: >=3.10
38
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
39
+ Project-URL: Homepage, https://yamlr.dev
40
+ Project-URL: Issues, https://github.com/yamlr/yamlr/issues
41
+ Project-URL: Repository, https://github.com/yamlr/yamlr.git
42
+
43
+ # Yamlr: The Kubernetes Configuration Resolution Plane
44
+
45
+ > Reconcile and repair Kubernetes configurations before deployment.
46
+
47
+ [![CI Matrix](https://github.com/yamlr/yamlr/actions/workflows/release-binaries.yml/badge.svg)](https://github.com/yamlr/yamlr/actions)
48
+ [![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macos%20%7C%20windows-blue)](https://get.yamlr.dev)
49
+ [![License](https://img.shields.io/badge/license-Proprietary-blue.svg)](LICENSE)
50
+
51
+ Yamlr resolves schema deviations, cross-resource dependencies, and deprecated APIs before manifests reach the cluster. Built with a high-performance native core, it validates configurations offline against official schemas, preserves every human comment and layout detail, and delivers deterministic idempotent repairs.
52
+
53
+ ---
54
+
55
+ ## Quick Install
56
+
57
+ ### Homebrew (macOS & Linux)
58
+ ```bash
59
+ brew install yamlr/tap/yamlr
60
+ ```
61
+
62
+ ### One-Line Install Script
63
+ **Linux & macOS:**
64
+ ```bash
65
+ curl -fsSL https://get.yamlr.dev/install.sh | sh
66
+ ```
67
+
68
+ **Windows (PowerShell):**
69
+ ```powershell
70
+ irm https://get.yamlr.dev/install.ps1 | iex
71
+ ```
72
+
73
+ ### Pre-Built Binaries
74
+ Static binaries are published with every release on [GitHub Releases](https://get.yamlr.dev):
75
+ - **Linux:** `x86_64` (glibc / musl), `aarch64` (ARM64)
76
+ - **macOS:** Apple Silicon (`aarch64`), Intel (`x86_64`)
77
+ - **Windows:** `x86_64` (`yamlr.exe`)
78
+
79
+ ---
80
+
81
+ ## 5-Minute Quickstart
82
+
83
+ ### 1. Audit manifests against embedded Kubernetes schemas
84
+ ```bash
85
+ yamlr scan ./k8s
86
+ ```
87
+ *Validates offline against pre-compiled Kubernetes OpenAPI schemas (`v1.21` through `v1.37`), with forward-compatible baseline fallback and dynamic fetch for `v1.38+`.*
88
+
89
+ ### 2. Preview proposed repairs in unified color diff
90
+ ```bash
91
+ yamlr heal ./k8s --diff
92
+ ```
93
+ *Inspect exact changes before writing anything to disk.*
94
+
95
+ ### 3. Apply repairs in-place (preserves comments and formatting)
96
+ ```bash
97
+ yamlr heal ./k8s --apply
98
+ ```
99
+ *Fixes broken selectors, typo fields, ports, deprecated API versions, and RBAC bindings.*
100
+
101
+ ### 4. Format manifests according to official Kubernetes schema hierarchy
102
+ ```bash
103
+ yamlr fmt -w ./k8s
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Integrations
109
+
110
+ ### Pre-Commit Hook
111
+ Enforce clean, self-healed manifests before every git commit:
112
+
113
+ ```yaml
114
+ # .pre-commit-config.yaml
115
+ repos:
116
+ - repo: https://github.com/yamlr/yamlr
117
+ rev: v0.1.0
118
+ hooks:
119
+ # Safe read-only preview (blocks commit and displays diff if repairs needed)
120
+ - id: yamlr-heal
121
+ # To auto-repair manifests in-place instead, use yamlr-heal-apply:
122
+ # - id: yamlr-heal-apply
123
+ - id: yamlr-scan
124
+ args: ["--fail-on", "error"]
125
+ ```
126
+
127
+ ### GitHub Actions CI
128
+ Run schema audits and upload native SARIF reports to GitHub Code Scanning:
129
+
130
+ ```yaml
131
+ name: Manifest Gate
132
+ on: [push, pull_request]
133
+
134
+ jobs:
135
+ yamlr:
136
+ runs-on: ubuntu-latest
137
+ steps:
138
+ - uses: actions/checkout@v4
139
+ - name: Audit Manifests
140
+ uses: yamlr/yamlr/actions/scan@v1
141
+ with:
142
+ path: ./manifests
143
+ output-file: results.sarif
144
+ - name: Upload SARIF to GitHub Code Scanning
145
+ uses: github/codeql-action/upload-sarif@v3
146
+ with:
147
+ sarif_file: results.sarif
148
+ ```
149
+
150
+ ### VS Code Extension
151
+ Real-time keystroke diagnostics, schema hover tooltips, and one-click quick-fixes via the embedded Language Server:
152
+ 1. Search for `Yamlr` in the VS Code Marketplace or install [`yamlr.vsix`](https://get.yamlr.dev).
153
+ 2. The extension automatically invokes the native `yamlr lsp` background daemon.
154
+
155
+ ### GitOps: ArgoCD & Flux
156
+ - **ArgoCD CMP:** Deploy `yamlr-cmp.yaml` as a ConfigManagementPlugin sidecar to heal manifests prior to sync.
157
+ - **Flux:** Add `yamlr` as a Kustomize post-renderer to catch and repair broken manifests in the reconciliation loop.
158
+
159
+ ---
160
+
161
+ ## Empirical Fleet Proof
162
+
163
+ We test Yamlr against real-world production Kubernetes manifests across top CNCF projects. Every manifest must pass 5 strict invariant gates without exception:
164
+
165
+ 1. **Zero Dropped Comments:** Runtime pre-write gate strictly enforces zero comment loss (`healed_comments >= orig_comments`).
166
+ 2. **Kubernetes OpenAPI v3 Schema Validity:** All healed files validate against official Kubernetes OpenAPI schemas.
167
+ 3. **Mathematical Idempotency:** Applying healing twice produces zero diff: `h(h(x)) == h(x)`.
168
+ 4. **Headless `kubectl dry-run` Validation:** Clean pass through client dry-run verification.
169
+ 5. **Keyword Collision Immunity:** Field names matching reserved keywords (such as `type`, `status`, `port`) are parsed with correct contextual scope.
170
+
171
+ ### Fleet Validation & Invariant Testing (Category A: CNCF Ecosystem)
172
+ | Metric | Result |
173
+ | :--- | :--- |
174
+ | **CNCF Ecosystem Corpus Manifests** | **Evaluated across CNCF Golden Test Corpus** |
175
+ | **Automated Regression Suite** | **821 Automated Tests Passing (757 Unit + 64 Integration)** |
176
+ | **Production Architecture Traps Cataloged** | **79** |
177
+ | **Zero Spurious Mutations** | **100.0% Byte-for-Byte Unchanged on Fully Compliant Manifests** |
178
+ | **Single Document Healing Latency** | **Sub-50 ms typical (warm cache)** |
179
+
180
+ ---
181
+
182
+ ## The 79 Production Traps Handled by Yamlr
183
+
184
+ Yamlr isolates and automatically repairs 79 structural, semantic, and cross-resource production traps, including:
185
+
186
+ - **Cross-Resource Misalignment:** Mismatched `spec.selector.matchLabels` and `spec.template.metadata.labels`, broken Service `targetPort` names, orphaned ConfigMap/Secret volume mounts.
187
+ - **RBAC & Security Constraints:** Missing `ServiceAccount` declarations, malformed `RoleBinding` subjects, CIS Benchmark container security context defaults.
188
+ - **API Version Deprecations:** Automatic migration of retired Kubernetes APIs (`extensions/v1beta1`, `networking.k8s.io/v1beta1`) to active stable equivalents.
189
+ - **Syntax & Schema Traps:** Unquoted YAML octal numeric strings (e.g. `0777`), tab-polluted indentation, boolean scalar truncation (`yes`/`no`/`on`/`off`), and multiline block scalar formatting (`|`, `>`).
190
+ - **Resource Limits & Units:** Correction of legacy or invalid memory units (e.g. `1000M` vs `1000Mi`), probe timing conflicts (`periodSeconds` < `timeoutSeconds`), and PDB availability constraints.
191
+
192
+ ---
193
+
194
+ ## Model Context Protocol (MCP) Server
195
+
196
+ Yamlr includes a built-in Model Context Protocol server. AI coding agents and LLM orchestration frameworks can connect to Yamlr via standard I/O:
197
+
198
+ ```bash
199
+ yamlr mcp
200
+ ```
201
+
202
+ Agents use Yamlr as a deterministic, offline compiler to audit and heal generated Kubernetes infrastructure before submitting pull requests or applying manifests to clusters.
203
+
204
+ ---
205
+
206
+ ## Documentation
207
+
208
+ - [CLI Reference Guide](docs/CLI_REFERENCE.md)
209
+ - [Configuration Documentation](docs/CONFIGURATION.md)
210
+ - [Architecture Model](docs/ARCHITECTURE_MODEL.md)
211
+ - [Positioning & Architecture Strategy](docs/Yamlr_Positioning_Strategy.md)
212
+
213
+ ---
214
+
215
+ ## License
216
+
217
+ Yamlr is proprietary software owned by Timonel Labs. See [LICENSE](LICENSE) for commercial and evaluation terms.
218
+
yamlr-0.1.0/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # Yamlr: The Kubernetes Configuration Resolution Plane
2
+
3
+ > Reconcile and repair Kubernetes configurations before deployment.
4
+
5
+ [![CI Matrix](https://github.com/yamlr/yamlr/actions/workflows/release-binaries.yml/badge.svg)](https://github.com/yamlr/yamlr/actions)
6
+ [![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macos%20%7C%20windows-blue)](https://get.yamlr.dev)
7
+ [![License](https://img.shields.io/badge/license-Proprietary-blue.svg)](LICENSE)
8
+
9
+ Yamlr resolves schema deviations, cross-resource dependencies, and deprecated APIs before manifests reach the cluster. Built with a high-performance native core, it validates configurations offline against official schemas, preserves every human comment and layout detail, and delivers deterministic idempotent repairs.
10
+
11
+ ---
12
+
13
+ ## Quick Install
14
+
15
+ ### Homebrew (macOS & Linux)
16
+ ```bash
17
+ brew install yamlr/tap/yamlr
18
+ ```
19
+
20
+ ### One-Line Install Script
21
+ **Linux & macOS:**
22
+ ```bash
23
+ curl -fsSL https://get.yamlr.dev/install.sh | sh
24
+ ```
25
+
26
+ **Windows (PowerShell):**
27
+ ```powershell
28
+ irm https://get.yamlr.dev/install.ps1 | iex
29
+ ```
30
+
31
+ ### Pre-Built Binaries
32
+ Static binaries are published with every release on [GitHub Releases](https://get.yamlr.dev):
33
+ - **Linux:** `x86_64` (glibc / musl), `aarch64` (ARM64)
34
+ - **macOS:** Apple Silicon (`aarch64`), Intel (`x86_64`)
35
+ - **Windows:** `x86_64` (`yamlr.exe`)
36
+
37
+ ---
38
+
39
+ ## 5-Minute Quickstart
40
+
41
+ ### 1. Audit manifests against embedded Kubernetes schemas
42
+ ```bash
43
+ yamlr scan ./k8s
44
+ ```
45
+ *Validates offline against pre-compiled Kubernetes OpenAPI schemas (`v1.21` through `v1.37`), with forward-compatible baseline fallback and dynamic fetch for `v1.38+`.*
46
+
47
+ ### 2. Preview proposed repairs in unified color diff
48
+ ```bash
49
+ yamlr heal ./k8s --diff
50
+ ```
51
+ *Inspect exact changes before writing anything to disk.*
52
+
53
+ ### 3. Apply repairs in-place (preserves comments and formatting)
54
+ ```bash
55
+ yamlr heal ./k8s --apply
56
+ ```
57
+ *Fixes broken selectors, typo fields, ports, deprecated API versions, and RBAC bindings.*
58
+
59
+ ### 4. Format manifests according to official Kubernetes schema hierarchy
60
+ ```bash
61
+ yamlr fmt -w ./k8s
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Integrations
67
+
68
+ ### Pre-Commit Hook
69
+ Enforce clean, self-healed manifests before every git commit:
70
+
71
+ ```yaml
72
+ # .pre-commit-config.yaml
73
+ repos:
74
+ - repo: https://github.com/yamlr/yamlr
75
+ rev: v0.1.0
76
+ hooks:
77
+ # Safe read-only preview (blocks commit and displays diff if repairs needed)
78
+ - id: yamlr-heal
79
+ # To auto-repair manifests in-place instead, use yamlr-heal-apply:
80
+ # - id: yamlr-heal-apply
81
+ - id: yamlr-scan
82
+ args: ["--fail-on", "error"]
83
+ ```
84
+
85
+ ### GitHub Actions CI
86
+ Run schema audits and upload native SARIF reports to GitHub Code Scanning:
87
+
88
+ ```yaml
89
+ name: Manifest Gate
90
+ on: [push, pull_request]
91
+
92
+ jobs:
93
+ yamlr:
94
+ runs-on: ubuntu-latest
95
+ steps:
96
+ - uses: actions/checkout@v4
97
+ - name: Audit Manifests
98
+ uses: yamlr/yamlr/actions/scan@v1
99
+ with:
100
+ path: ./manifests
101
+ output-file: results.sarif
102
+ - name: Upload SARIF to GitHub Code Scanning
103
+ uses: github/codeql-action/upload-sarif@v3
104
+ with:
105
+ sarif_file: results.sarif
106
+ ```
107
+
108
+ ### VS Code Extension
109
+ Real-time keystroke diagnostics, schema hover tooltips, and one-click quick-fixes via the embedded Language Server:
110
+ 1. Search for `Yamlr` in the VS Code Marketplace or install [`yamlr.vsix`](https://get.yamlr.dev).
111
+ 2. The extension automatically invokes the native `yamlr lsp` background daemon.
112
+
113
+ ### GitOps: ArgoCD & Flux
114
+ - **ArgoCD CMP:** Deploy `yamlr-cmp.yaml` as a ConfigManagementPlugin sidecar to heal manifests prior to sync.
115
+ - **Flux:** Add `yamlr` as a Kustomize post-renderer to catch and repair broken manifests in the reconciliation loop.
116
+
117
+ ---
118
+
119
+ ## Empirical Fleet Proof
120
+
121
+ We test Yamlr against real-world production Kubernetes manifests across top CNCF projects. Every manifest must pass 5 strict invariant gates without exception:
122
+
123
+ 1. **Zero Dropped Comments:** Runtime pre-write gate strictly enforces zero comment loss (`healed_comments >= orig_comments`).
124
+ 2. **Kubernetes OpenAPI v3 Schema Validity:** All healed files validate against official Kubernetes OpenAPI schemas.
125
+ 3. **Mathematical Idempotency:** Applying healing twice produces zero diff: `h(h(x)) == h(x)`.
126
+ 4. **Headless `kubectl dry-run` Validation:** Clean pass through client dry-run verification.
127
+ 5. **Keyword Collision Immunity:** Field names matching reserved keywords (such as `type`, `status`, `port`) are parsed with correct contextual scope.
128
+
129
+ ### Fleet Validation & Invariant Testing (Category A: CNCF Ecosystem)
130
+ | Metric | Result |
131
+ | :--- | :--- |
132
+ | **CNCF Ecosystem Corpus Manifests** | **Evaluated across CNCF Golden Test Corpus** |
133
+ | **Automated Regression Suite** | **821 Automated Tests Passing (757 Unit + 64 Integration)** |
134
+ | **Production Architecture Traps Cataloged** | **79** |
135
+ | **Zero Spurious Mutations** | **100.0% Byte-for-Byte Unchanged on Fully Compliant Manifests** |
136
+ | **Single Document Healing Latency** | **Sub-50 ms typical (warm cache)** |
137
+
138
+ ---
139
+
140
+ ## The 79 Production Traps Handled by Yamlr
141
+
142
+ Yamlr isolates and automatically repairs 79 structural, semantic, and cross-resource production traps, including:
143
+
144
+ - **Cross-Resource Misalignment:** Mismatched `spec.selector.matchLabels` and `spec.template.metadata.labels`, broken Service `targetPort` names, orphaned ConfigMap/Secret volume mounts.
145
+ - **RBAC & Security Constraints:** Missing `ServiceAccount` declarations, malformed `RoleBinding` subjects, CIS Benchmark container security context defaults.
146
+ - **API Version Deprecations:** Automatic migration of retired Kubernetes APIs (`extensions/v1beta1`, `networking.k8s.io/v1beta1`) to active stable equivalents.
147
+ - **Syntax & Schema Traps:** Unquoted YAML octal numeric strings (e.g. `0777`), tab-polluted indentation, boolean scalar truncation (`yes`/`no`/`on`/`off`), and multiline block scalar formatting (`|`, `>`).
148
+ - **Resource Limits & Units:** Correction of legacy or invalid memory units (e.g. `1000M` vs `1000Mi`), probe timing conflicts (`periodSeconds` < `timeoutSeconds`), and PDB availability constraints.
149
+
150
+ ---
151
+
152
+ ## Model Context Protocol (MCP) Server
153
+
154
+ Yamlr includes a built-in Model Context Protocol server. AI coding agents and LLM orchestration frameworks can connect to Yamlr via standard I/O:
155
+
156
+ ```bash
157
+ yamlr mcp
158
+ ```
159
+
160
+ Agents use Yamlr as a deterministic, offline compiler to audit and heal generated Kubernetes infrastructure before submitting pull requests or applying manifests to clusters.
161
+
162
+ ---
163
+
164
+ ## Documentation
165
+
166
+ - [CLI Reference Guide](docs/CLI_REFERENCE.md)
167
+ - [Configuration Documentation](docs/CONFIGURATION.md)
168
+ - [Architecture Model](docs/ARCHITECTURE_MODEL.md)
169
+ - [Positioning & Architecture Strategy](docs/Yamlr_Positioning_Strategy.md)
170
+
171
+ ---
172
+
173
+ ## License
174
+
175
+ Yamlr is proprietary software owned by Timonel Labs. See [LICENSE](LICENSE) for commercial and evaluation terms.