kir-building 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 (407) hide show
  1. kir_building-0.1.0/LICENSE +191 -0
  2. kir_building-0.1.0/MANIFEST.in +8 -0
  3. kir_building-0.1.0/PKG-INFO +450 -0
  4. kir_building-0.1.0/README.md +417 -0
  5. kir_building-0.1.0/WHEEL_KEEP.json +35 -0
  6. kir_building-0.1.0/kir/__init__.py +39 -0
  7. kir_building-0.1.0/kir/a5_contract.py +381 -0
  8. kir_building-0.1.0/kir/a5_live.py +1094 -0
  9. kir_building-0.1.0/kir/a5_recovery.py +908 -0
  10. kir_building-0.1.0/kir/acceptance.py +1488 -0
  11. kir_building-0.1.0/kir/acceptance_evidence.py +855 -0
  12. kir_building-0.1.0/kir/acceptance_journal.py +748 -0
  13. kir_building-0.1.0/kir/acceptance_live.py +479 -0
  14. kir_building-0.1.0/kir/acceptance_mutation.py +1449 -0
  15. kir_building-0.1.0/kir/acceptance_probe.py +253 -0
  16. kir_building-0.1.0/kir/acceptance_runtime.py +563 -0
  17. kir_building-0.1.0/kir/adaptive_emit.py +218 -0
  18. kir_building-0.1.0/kir/address.py +336 -0
  19. kir_building-0.1.0/kir/agreements.py +1833 -0
  20. kir_building-0.1.0/kir/analysis_emit.py +710 -0
  21. kir_building-0.1.0/kir/arch_emit.py +524 -0
  22. kir_building-0.1.0/kir/assembly_view.py +1057 -0
  23. kir_building-0.1.0/kir/authoring.py +9944 -0
  24. kir_building-0.1.0/kir/authoring_validation.py +2501 -0
  25. kir_building-0.1.0/kir/boolean_emit.py +558 -0
  26. kir_building-0.1.0/kir/bridge/__init__.py +25 -0
  27. kir_building-0.1.0/kir/bridge/client.py +241 -0
  28. kir_building-0.1.0/kir/bridge/mock_server.py +120 -0
  29. kir_building-0.1.0/kir/bridge/models.py +283 -0
  30. kir_building-0.1.0/kir/bridge_result.py +116 -0
  31. kir_building-0.1.0/kir/building_index.py +468 -0
  32. kir_building-0.1.0/kir/built_verdict.py +1045 -0
  33. kir_building-0.1.0/kir/checker/__init__.py +0 -0
  34. kir_building-0.1.0/kir/checker/classify.py +395 -0
  35. kir_building-0.1.0/kir/checker/composition.py +217 -0
  36. kir_building-0.1.0/kir/checker/derive.py +617 -0
  37. kir_building-0.1.0/kir/checker/dwelling_invariants.py +243 -0
  38. kir_building-0.1.0/kir/checker/engine.py +1080 -0
  39. kir_building-0.1.0/kir/checker/extractor.cs +364 -0
  40. kir_building-0.1.0/kir/checker/extractor.py +392 -0
  41. kir_building-0.1.0/kir/checker/fixtures/__init__.py +0 -0
  42. kir_building-0.1.0/kir/checker/fixtures/builders.py +531 -0
  43. kir_building-0.1.0/kir/checker/flags.py +67 -0
  44. kir_building-0.1.0/kir/checker/function_provenance.py +129 -0
  45. kir_building-0.1.0/kir/checker/graph.py +517 -0
  46. kir_building-0.1.0/kir/checker/height_provenance.py +113 -0
  47. kir_building-0.1.0/kir/checker/report.py +103 -0
  48. kir_building-0.1.0/kir/checker/rules/__init__.py +0 -0
  49. kir_building-0.1.0/kir/checker/rules/clash.py +304 -0
  50. kir_building-0.1.0/kir/checker/rules/connectivity.py +307 -0
  51. kir_building-0.1.0/kir/checker/rules/consistency.py +381 -0
  52. kir_building-0.1.0/kir/checker/rules/dimensions.py +328 -0
  53. kir_building-0.1.0/kir/checker/rules/light.py +125 -0
  54. kir_building-0.1.0/kir/checker/rules/structure.py +137 -0
  55. kir_building-0.1.0/kir/checker/rules/vertical.py +246 -0
  56. kir_building-0.1.0/kir/checker/spatial_model.py +439 -0
  57. kir_building-0.1.0/kir/checker/stair_provenance.py +102 -0
  58. kir_building-0.1.0/kir/checker/thresholds.py +274 -0
  59. kir_building-0.1.0/kir/chunking.py +406 -0
  60. kir_building-0.1.0/kir/clash/__init__.py +1 -0
  61. kir_building-0.1.0/kir/clash/decompose.py +733 -0
  62. kir_building-0.1.0/kir/clash/detect.py +1805 -0
  63. kir_building-0.1.0/kir/clash/existing.py +762 -0
  64. kir_building-0.1.0/kir/clash/federation_transform.py +866 -0
  65. kir_building-0.1.0/kir/clash/geom.py +1059 -0
  66. kir_building-0.1.0/kir/clash/hulls.py +2470 -0
  67. kir_building-0.1.0/kir/clash/resolve.py +1031 -0
  68. kir_building-0.1.0/kir/clash/review.py +550 -0
  69. kir_building-0.1.0/kir/clash/snapshot.py +1143 -0
  70. kir_building-0.1.0/kir/clash/tests/fixtures/category_manifest.json +552 -0
  71. kir_building-0.1.0/kir/clash/tests/fixtures/floor_9981227_v11.json +159 -0
  72. kir_building-0.1.0/kir/clash/tests/fixtures/golden_report_v1.json +1 -0
  73. kir_building-0.1.0/kir/clash/tests/fixtures/golden_report_v2.json +1 -0
  74. kir_building-0.1.0/kir/clash/tests/golden_report.json +1 -0
  75. kir_building-0.1.0/kir/clash/tools/__init__.py +0 -0
  76. kir_building-0.1.0/kir/clash/tools/bundle_containment_gate.py +423 -0
  77. kir_building-0.1.0/kir/clash/tools/make_fixtures.py +162 -0
  78. kir_building-0.1.0/kir/clash/tools/wall_prism_gate.py +396 -0
  79. kir_building-0.1.0/kir/clash_bundle.py +3354 -0
  80. kir_building-0.1.0/kir/clash_judgement.py +1726 -0
  81. kir_building-0.1.0/kir/code_safety.py +578 -0
  82. kir_building-0.1.0/kir/compile_cache.py +352 -0
  83. kir_building-0.1.0/kir/compile_client.py +179 -0
  84. kir_building-0.1.0/kir/compiler.py +3319 -0
  85. kir_building-0.1.0/kir/connect.py +599 -0
  86. kir_building-0.1.0/kir/contour.py +1767 -0
  87. kir_building-0.1.0/kir/contracts.py +1200 -0
  88. kir_building-0.1.0/kir/corpus_catalog.py +871 -0
  89. kir_building-0.1.0/kir/course/__init__.py +2186 -0
  90. kir_building-0.1.0/kir/course/building.py +831 -0
  91. kir_building-0.1.0/kir/course/corpus.py +654 -0
  92. kir_building-0.1.0/kir/course/design.py +864 -0
  93. kir_building-0.1.0/kir/course/expressiveness.py +360 -0
  94. kir_building-0.1.0/kir/course/language.py +278 -0
  95. kir_building-0.1.0/kir/course/lessons.py +741 -0
  96. kir_building-0.1.0/kir/course/recipes.py +406 -0
  97. kir_building-0.1.0/kir/course/shape.py +305 -0
  98. kir_building-0.1.0/kir/coverage_feed.py +525 -0
  99. kir_building-0.1.0/kir/created_ledger.py +521 -0
  100. kir_building-0.1.0/kir/curveops.py +502 -0
  101. kir_building-0.1.0/kir/datum_emit.py +620 -0
  102. kir_building-0.1.0/kir/decompile/__init__.py +218 -0
  103. kir_building-0.1.0/kir/decompile/annotation_extract.py +626 -0
  104. kir_building-0.1.0/kir/decompile/axes_census.py +829 -0
  105. kir_building-0.1.0/kir/decompile/building_graph.py +2522 -0
  106. kir_building-0.1.0/kir/decompile/census.py +359 -0
  107. kir_building-0.1.0/kir/decompile/component.py +801 -0
  108. kir_building-0.1.0/kir/decompile/curtain_extract.py +2727 -0
  109. kir_building-0.1.0/kir/decompile/curve_extract.py +1077 -0
  110. kir_building-0.1.0/kir/decompile/dependencies.py +1122 -0
  111. kir_building-0.1.0/kir/decompile/dimension_extract.py +835 -0
  112. kir_building-0.1.0/kir/decompile/extract.py +4425 -0
  113. kir_building-0.1.0/kir/decompile/family_placement_extract.py +1581 -0
  114. kir_building-0.1.0/kir/decompile/family_recipe.py +2723 -0
  115. kir_building-0.1.0/kir/decompile/federated_clash_query.py +633 -0
  116. kir_building-0.1.0/kir/decompile/federation.py +1652 -0
  117. kir_building-0.1.0/kir/decompile/fold.py +2357 -0
  118. kir_building-0.1.0/kir/decompile/geom_alias.py +344 -0
  119. kir_building-0.1.0/kir/decompile/geom_extract.py +2402 -0
  120. kir_building-0.1.0/kir/decompile/geometry_acceptance.py +547 -0
  121. kir_building-0.1.0/kir/decompile/geometry_store.py +281 -0
  122. kir_building-0.1.0/kir/decompile/graph_adjacency.py +435 -0
  123. kir_building-0.1.0/kir/decompile/graph_clash_query.py +877 -0
  124. kir_building-0.1.0/kir/decompile/graph_store.py +417 -0
  125. kir_building-0.1.0/kir/decompile/group_extract.py +1128 -0
  126. kir_building-0.1.0/kir/decompile/group_relations.py +226 -0
  127. kir_building-0.1.0/kir/decompile/honesty.py +459 -0
  128. kir_building-0.1.0/kir/decompile/identity.py +512 -0
  129. kir_building-0.1.0/kir/decompile/join_extract.py +977 -0
  130. kir_building-0.1.0/kir/decompile/journal.py +471 -0
  131. kir_building-0.1.0/kir/decompile/journal_store.py +518 -0
  132. kir_building-0.1.0/kir/decompile/l1_schema.py +438 -0
  133. kir_building-0.1.0/kir/decompile/lift.py +5663 -0
  134. kir_building-0.1.0/kir/decompile/lift_cache.py +714 -0
  135. kir_building-0.1.0/kir/decompile/materialize.py +2770 -0
  136. kir_building-0.1.0/kir/decompile/mep_system_extract.py +454 -0
  137. kir_building-0.1.0/kir/decompile/merge3.py +420 -0
  138. kir_building-0.1.0/kir/decompile/merge_guard.py +184 -0
  139. kir_building-0.1.0/kir/decompile/merkle.py +1320 -0
  140. kir_building-0.1.0/kir/decompile/merkle_report.py +181 -0
  141. kir_building-0.1.0/kir/decompile/name.py +1216 -0
  142. kir_building-0.1.0/kir/decompile/native_group.py +281 -0
  143. kir_building-0.1.0/kir/decompile/orchestrator.py +274 -0
  144. kir_building-0.1.0/kir/decompile/param_route.py +1149 -0
  145. kir_building-0.1.0/kir/decompile/passport.py +2229 -0
  146. kir_building-0.1.0/kir/decompile/pipeline.py +2515 -0
  147. kir_building-0.1.0/kir/decompile/priors.py +596 -0
  148. kir_building-0.1.0/kir/decompile/program_source.py +1743 -0
  149. kir_building-0.1.0/kir/decompile/read_bodies.py +142 -0
  150. kir_building-0.1.0/kir/decompile/rebuild.py +362 -0
  151. kir_building-0.1.0/kir/decompile/rebuild_plan.py +254 -0
  152. kir_building-0.1.0/kir/decompile/recompile.py +2002 -0
  153. kir_building-0.1.0/kir/decompile/reextract.py +642 -0
  154. kir_building-0.1.0/kir/decompile/schema.py +2579 -0
  155. kir_building-0.1.0/kir/decompile/side_contract.py +990 -0
  156. kir_building-0.1.0/kir/decompile/sketch_extract.py +2313 -0
  157. kir_building-0.1.0/kir/decompile/snapshot_io.py +347 -0
  158. kir_building-0.1.0/kir/decompile/snapshot_pins.py +268 -0
  159. kir_building-0.1.0/kir/decompile/tag_extract.py +1005 -0
  160. kir_building-0.1.0/kir/decompile/tests/__init__.py +1 -0
  161. kir_building-0.1.0/kir/decompile/tests/conftest.py +37 -0
  162. kir_building-0.1.0/kir/decompile/tests/fixtures/component_overclaim_tower.json +1 -0
  163. kir_building-0.1.0/kir/decompile/tests/fixtures_decompile.py +467 -0
  164. kir_building-0.1.0/kir/decompile/tests/test_delta_carries_the_obligation.py +256 -0
  165. kir_building-0.1.0/kir/decompile/tests/test_merkle.py +933 -0
  166. kir_building-0.1.0/kir/decompile/tests/test_reverse_chain_to_csharp.py +191 -0
  167. kir_building-0.1.0/kir/decompile/tests/test_reverse_contract.py +544 -0
  168. kir_building-0.1.0/kir/decompile/verified.py +384 -0
  169. kir_building-0.1.0/kir/decompile/verify.py +638 -0
  170. kir_building-0.1.0/kir/design_check.py +4003 -0
  171. kir_building-0.1.0/kir/diag.py +362 -0
  172. kir_building-0.1.0/kir/docspace.py +157 -0
  173. kir_building-0.1.0/kir/document_guard.py +93 -0
  174. kir_building-0.1.0/kir/dsl.py +1451 -0
  175. kir_building-0.1.0/kir/effects.py +364 -0
  176. kir_building-0.1.0/kir/emit_model.py +438 -0
  177. kir_building-0.1.0/kir/emit_utils.py +412 -0
  178. kir_building-0.1.0/kir/env.py +127 -0
  179. kir_building-0.1.0/kir/envelope.py +727 -0
  180. kir_building-0.1.0/kir/faceref.py +507 -0
  181. kir_building-0.1.0/kir/family_author_emit.py +1193 -0
  182. kir_building-0.1.0/kir/family_transfer_emit.py +448 -0
  183. kir_building-0.1.0/kir/gate_runner.py +2159 -0
  184. kir_building-0.1.0/kir/geom.py +397 -0
  185. kir_building-0.1.0/kir/ground.py +2236 -0
  186. kir_building-0.1.0/kir/idempotence.py +1912 -0
  187. kir_building-0.1.0/kir/idempotence_contract.py +145 -0
  188. kir_building-0.1.0/kir/idempotence_report.py +384 -0
  189. kir_building-0.1.0/kir/install_paths.py +230 -0
  190. kir_building-0.1.0/kir/instruments/__init__.py +115 -0
  191. kir_building-0.1.0/kir/instruments/bounds_audit.py +1181 -0
  192. kir_building-0.1.0/kir/instruments/canon_state.py +609 -0
  193. kir_building-0.1.0/kir/instruments/capability_graph.py +1243 -0
  194. kir_building-0.1.0/kir/instruments/compile_gate_offline.py +521 -0
  195. kir_building-0.1.0/kir/instruments/content_coverage.py +1271 -0
  196. kir_building-0.1.0/kir/instruments/measure_header.py +117 -0
  197. kir_building-0.1.0/kir/instruments/relift_offline.py +573 -0
  198. kir_building-0.1.0/kir/instruments/scope_audit.py +244 -0
  199. kir_building-0.1.0/kir/instruments/snapshot_janitor.py +889 -0
  200. kir_building-0.1.0/kir/instruments/unwired_census.py +567 -0
  201. kir_building-0.1.0/kir/kir_plan.py +101 -0
  202. kir_building-0.1.0/kir/live/__init__.py +36 -0
  203. kir_building-0.1.0/kir/live/journal.py +824 -0
  204. kir_building-0.1.0/kir/live/journal_store.py +444 -0
  205. kir_building-0.1.0/kir/live/plan_stream.py +708 -0
  206. kir_building-0.1.0/kir/live/showroom.py +534 -0
  207. kir_building-0.1.0/kir/live/transfer.py +750 -0
  208. kir_building-0.1.0/kir/live/transfer_journal.py +152 -0
  209. kir_building-0.1.0/kir/live/verdict.py +836 -0
  210. kir_building-0.1.0/kir/macros.py +1114 -0
  211. kir_building-0.1.0/kir/mass_emit.py +385 -0
  212. kir_building-0.1.0/kir/mep_emit.py +300 -0
  213. kir_building-0.1.0/kir/mesh.py +902 -0
  214. kir_building-0.1.0/kir/midend.py +1362 -0
  215. kir_building-0.1.0/kir/op_contract.py +458 -0
  216. kir_building-0.1.0/kir/open_model.py +2336 -0
  217. kir_building-0.1.0/kir/opening_emit.py +629 -0
  218. kir_building-0.1.0/kir/operations/__init__.py +30 -0
  219. kir_building-0.1.0/kir/operations/effects.py +242 -0
  220. kir_building-0.1.0/kir/operations/protocol.py +405 -0
  221. kir_building-0.1.0/kir/operations/store.py +230 -0
  222. kir_building-0.1.0/kir/ops_adaptive.py +167 -0
  223. kir_building-0.1.0/kir/ops_analysis.py +367 -0
  224. kir_building-0.1.0/kir/ops_annotation.py +312 -0
  225. kir_building-0.1.0/kir/ops_arch.py +272 -0
  226. kir_building-0.1.0/kir/ops_authoring.py +1903 -0
  227. kir_building-0.1.0/kir/ops_boolean.py +666 -0
  228. kir_building-0.1.0/kir/ops_connect.py +240 -0
  229. kir_building-0.1.0/kir/ops_contour.py +66 -0
  230. kir_building-0.1.0/kir/ops_families.py +563 -0
  231. kir_building-0.1.0/kir/ops_mass.py +317 -0
  232. kir_building-0.1.0/kir/ops_mep.py +318 -0
  233. kir_building-0.1.0/kir/ops_opening.py +346 -0
  234. kir_building-0.1.0/kir/ops_room.py +394 -0
  235. kir_building-0.1.0/kir/ops_shape.py +213 -0
  236. kir_building-0.1.0/kir/ops_site.py +294 -0
  237. kir_building-0.1.0/kir/ops_solid.py +559 -0
  238. kir_building-0.1.0/kir/ops_struct.py +670 -0
  239. kir_building-0.1.0/kir/ops_surface.py +131 -0
  240. kir_building-0.1.0/kir/ops_sweep.py +268 -0
  241. kir_building-0.1.0/kir/outcome.py +222 -0
  242. kir_building-0.1.0/kir/plane.py +350 -0
  243. kir_building-0.1.0/kir/ports.py +297 -0
  244. kir_building-0.1.0/kir/preview.py +2765 -0
  245. kir_building-0.1.0/kir/receipt_fold.py +229 -0
  246. kir_building-0.1.0/kir/record_ratchet.py +292 -0
  247. kir_building-0.1.0/kir/registry_base.py +998 -0
  248. kir_building-0.1.0/kir/rehearsal.py +313 -0
  249. kir_building-0.1.0/kir/relate.py +1575 -0
  250. kir_building-0.1.0/kir/reverse_contract.py +1378 -0
  251. kir_building-0.1.0/kir/revit_read_helpers.py +100 -0
  252. kir_building-0.1.0/kir/revit_version.py +129 -0
  253. kir_building-0.1.0/kir/room_emit.py +526 -0
  254. kir_building-0.1.0/kir/route_mep.py +161 -0
  255. kir_building-0.1.0/kir/sandbox.py +3619 -0
  256. kir_building-0.1.0/kir/schema_dedup.py +388 -0
  257. kir_building-0.1.0/kir/schema_gen.py +1142 -0
  258. kir_building-0.1.0/kir/schema_transport.py +412 -0
  259. kir_building-0.1.0/kir/sdk.py +701 -0
  260. kir_building-0.1.0/kir/serving.py +8968 -0
  261. kir_building-0.1.0/kir/shadow.py +427 -0
  262. kir_building-0.1.0/kir/shape_emit.py +539 -0
  263. kir_building-0.1.0/kir/site_emit.py +625 -0
  264. kir_building-0.1.0/kir/skill.py +1231 -0
  265. kir_building-0.1.0/kir/solid_emit.py +1588 -0
  266. kir_building-0.1.0/kir/spec.py +1770 -0
  267. kir_building-0.1.0/kir/specs/KIR_DECOMPILE_SPEC.md +943 -0
  268. kir_building-0.1.0/kir/specs/PROD_OP_DISTRIBUTION.md +116 -0
  269. kir_building-0.1.0/kir/specs/SPEC_V1.md +501 -0
  270. kir_building-0.1.0/kir/stage_shape.py +207 -0
  271. kir_building-0.1.0/kir/stairs_landing_emit.py +594 -0
  272. kir_building-0.1.0/kir/stairs_run_emit.py +473 -0
  273. kir_building-0.1.0/kir/struct_emit.py +1210 -0
  274. kir_building-0.1.0/kir/surface.py +563 -0
  275. kir_building-0.1.0/kir/surface_emit.py +557 -0
  276. kir_building-0.1.0/kir/surface_query.py +330 -0
  277. kir_building-0.1.0/kir/sweep_emit.py +560 -0
  278. kir_building-0.1.0/kir/sweep_path.py +528 -0
  279. kir_building-0.1.0/kir/tests/__init__.py +0 -0
  280. kir_building-0.1.0/kir/tests/acceptance_fakes.py +230 -0
  281. kir_building-0.1.0/kir/tests/conftest.py +201 -0
  282. kir_building-0.1.0/kir/tests/emit_parity_fixtures/corpus_hashes.json +2327 -0
  283. kir_building-0.1.0/kir/tests/emit_parity_fixtures/generate_fixtures.py +1383 -0
  284. kir_building-0.1.0/kir/tests/envtools.py +38 -0
  285. kir_building-0.1.0/kir/tests/fixtures.py +252 -0
  286. kir_building-0.1.0/kir/tests/gate_fixture.py +90 -0
  287. kir_building-0.1.0/kir/tests/golden/analysis_loads.golden.cs +407 -0
  288. kir_building-0.1.0/kir/tests/golden/analysis_path_of_travel.golden.cs +200 -0
  289. kir_building-0.1.0/kir/tests/golden/annotation_explicit_types.golden.cs +743 -0
  290. kir_building-0.1.0/kir/tests/golden/annotation_full_set.golden.cs +702 -0
  291. kir_building-0.1.0/kir/tests/golden/arch_ceiling.golden.cs +337 -0
  292. kir_building-0.1.0/kir/tests/golden/arch_ceiling_contour.golden.cs +337 -0
  293. kir_building-0.1.0/kir/tests/golden/arch_railing_hosted.golden.cs +184 -0
  294. kir_building-0.1.0/kir/tests/golden/arch_railing_path.golden.cs +307 -0
  295. kir_building-0.1.0/kir/tests/golden/auth_annotation.golden.cs +702 -0
  296. kir_building-0.1.0/kir/tests/golden/auth_contour_l.golden.cs +333 -0
  297. kir_building-0.1.0/kir/tests/golden/auth_curtain_cell_named_type.golden.cs +548 -0
  298. kir_building-0.1.0/kir/tests/golden/auth_curtain_grid_lines.golden.cs +1141 -0
  299. kir_building-0.1.0/kir/tests/golden/auth_directshape_tower.golden.cs +313 -0
  300. kir_building-0.1.0/kir/tests/golden/auth_face_wall_existing_mass.golden.cs +297 -0
  301. kir_building-0.1.0/kir/tests/golden/auth_move_and_change_type.golden.cs +528 -0
  302. kir_building-0.1.0/kir/tests/golden/auth_pipe_system_chain.golden.cs +310 -0
  303. kir_building-0.1.0/kir/tests/golden/auth_solid_boolean_difference.golden.cs +280 -0
  304. kir_building-0.1.0/kir/tests/golden/auth_solid_boolean_prism_voids.golden.cs +317 -0
  305. kir_building-0.1.0/kir/tests/golden/authoring_stairs_landing.golden.cs +346 -0
  306. kir_building-0.1.0/kir/tests/golden/authoring_stairs_run.golden.cs +315 -0
  307. kir_building-0.1.0/kir/tests/golden/authoring_stairs_spiral.golden.cs +226 -0
  308. kir_building-0.1.0/kir/tests/golden/authoring_stairs_straight.golden.cs +206 -0
  309. kir_building-0.1.0/kir/tests/golden/authoring_wall_arc.golden.cs +230 -0
  310. kir_building-0.1.0/kir/tests/golden/authoring_wall_pipe_grid.golden.cs +308 -0
  311. kir_building-0.1.0/kir/tests/golden/datums_extrusion_roof.golden.cs +337 -0
  312. kir_building-0.1.0/kir/tests/golden/datums_multi_segment_grid.golden.cs +245 -0
  313. kir_building-0.1.0/kir/tests/golden/datums_multistory_stairs.golden.cs +211 -0
  314. kir_building-0.1.0/kir/tests/golden/detail_filled_region_doc_default.golden.cs +241 -0
  315. kir_building-0.1.0/kir/tests/golden/detail_filled_region_named_type.golden.cs +247 -0
  316. kir_building-0.1.0/kir/tests/golden/duct_min.golden.cs +214 -0
  317. kir_building-0.1.0/kir/tests/golden/families_create_type_full.golden.cs +199 -0
  318. kir_building-0.1.0/kir/tests/golden/families_load_family_whole.golden.cs +185 -0
  319. kir_building-0.1.0/kir/tests/golden/full_house_v1.golden.cs +580 -0
  320. kir_building-0.1.0/kir/tests/golden/hosted_door_flips.golden.cs +341 -0
  321. kir_building-0.1.0/kir/tests/golden/list_walls_level1.golden.cs +122 -0
  322. kir_building-0.1.0/kir/tests/golden/mep_conduit_and_placeholders.golden.cs +319 -0
  323. kir_building-0.1.0/kir/tests/golden/mep_flex_runs.golden.cs +285 -0
  324. kir_building-0.1.0/kir/tests/golden/mixed_program.golden.cs +163 -0
  325. kir_building-0.1.0/kir/tests/golden/modify_setparam_delete.golden.cs +199 -0
  326. kir_building-0.1.0/kir/tests/golden/native_group.golden.cs +393 -0
  327. kir_building-0.1.0/kir/tests/golden/opening_contour_perpendicular.golden.cs +219 -0
  328. kir_building-0.1.0/kir/tests/golden/opening_contour_vertical.golden.cs +222 -0
  329. kir_building-0.1.0/kir/tests/golden/opening_host_face_perpendicular.golden.cs +219 -0
  330. kir_building-0.1.0/kir/tests/golden/opening_host_face_vertical.golden.cs +219 -0
  331. kir_building-0.1.0/kir/tests/golden/opening_wall_rect.golden.cs +196 -0
  332. kir_building-0.1.0/kir/tests/golden/pdf_underlay_count.golden.cs +109 -0
  333. kir_building-0.1.0/kir/tests/golden/place_family_placement_kinds.golden.cs +370 -0
  334. kir_building-0.1.0/kir/tests/golden/place_family_point_and_curve.golden.cs +309 -0
  335. kir_building-0.1.0/kir/tests/golden/roof_gable_slopes.golden.cs +340 -0
  336. kir_building-0.1.0/kir/tests/golden/roof_min.golden.cs +321 -0
  337. kir_building-0.1.0/kir/tests/golden/room_separator.golden.cs +261 -0
  338. kir_building-0.1.0/kir/tests/golden/room_separator_then_room.golden.cs +299 -0
  339. kir_building-0.1.0/kir/tests/golden/route_duct_system_tee.golden.cs +359 -0
  340. kir_building-0.1.0/kir/tests/golden/route_pipe_system_riser_branch.golden.cs +330 -0
  341. kir_building-0.1.0/kir/tests/golden/site_building_pad.golden.cs +256 -0
  342. kir_building-0.1.0/kir/tests/golden/site_subregion_hosted.golden.cs +217 -0
  343. kir_building-0.1.0/kir/tests/golden/site_topography_surface.golden.cs +204 -0
  344. kir_building-0.1.0/kir/tests/golden/site_topography_toposolid.golden.cs +237 -0
  345. kir_building-0.1.0/kir/tests/golden/solid_extrusion_and_revolve.golden.cs +379 -0
  346. kir_building-0.1.0/kir/tests/golden/space_mep.golden.cs +330 -0
  347. kir_building-0.1.0/kir/tests/golden/stack_two_storeys.golden.cs +288 -0
  348. kir_building-0.1.0/kir/tests/golden/struct_area_reinforcement_slabs.golden.cs +525 -0
  349. kir_building-0.1.0/kir/tests/golden/struct_beam.golden.cs +225 -0
  350. kir_building-0.1.0/kir/tests/golden/struct_column_top_constrained.golden.cs +252 -0
  351. kir_building-0.1.0/kir/tests/golden/struct_foundation_isolated.golden.cs +214 -0
  352. kir_building-0.1.0/kir/tests/golden/struct_foundation_slab.golden.cs +341 -0
  353. kir_building-0.1.0/kir/tests/golden/struct_foundation_slab_two_holes.golden.cs +341 -0
  354. kir_building-0.1.0/kir/tests/golden/struct_framing_bay.golden.cs +729 -0
  355. kir_building-0.1.0/kir/tests/golden/struct_wall_foundation.golden.cs +308 -0
  356. kir_building-0.1.0/kir/tests/golden/sweep_slab_edge_bottom_ref.golden.cs +401 -0
  357. kir_building-0.1.0/kir/tests/golden/sweep_slab_edge_top.golden.cs +242 -0
  358. kir_building-0.1.0/kir/tests/golden/sweep_wall_horizontal.golden.cs +227 -0
  359. kir_building-0.1.0/kir/tests/golden/sweep_wall_vertical_ref.golden.cs +277 -0
  360. kir_building-0.1.0/kir/tests/golden/wall_base_offset.golden.cs +225 -0
  361. kir_building-0.1.0/kir/tests/golden/wall_top_attached.golden.cs +246 -0
  362. kir_building-0.1.0/kir/tests/test_a_reading_typo_does_not_erase_the_program.py +123 -0
  363. kir_building-0.1.0/kir/tests/test_an_overflowing_contract_keeps_its_tail.py +101 -0
  364. kir_building-0.1.0/kir/tests/test_annotation.py +1307 -0
  365. kir_building-0.1.0/kir/tests/test_author_geometry_constructors.py +475 -0
  366. kir_building-0.1.0/kir/tests/test_authoring.py +1409 -0
  367. kir_building-0.1.0/kir/tests/test_emission_guard_contract.py +595 -0
  368. kir_building-0.1.0/kir/tests/test_emit_model_byte_parity.py +132 -0
  369. kir_building-0.1.0/kir/tests/test_emitter_scope_contract.py +1466 -0
  370. kir_building-0.1.0/kir/tests/test_expressiveness_census.py +112 -0
  371. kir_building-0.1.0/kir/tests/test_gold_path_axes.py +383 -0
  372. kir_building-0.1.0/kir/tests/test_golden.py +2929 -0
  373. kir_building-0.1.0/kir/tests/test_golden_files_have_one_owner.py +247 -0
  374. kir_building-0.1.0/kir/tests/test_op_budget_seam.py +795 -0
  375. kir_building-0.1.0/kir/tests/test_pbt.py +144 -0
  376. kir_building-0.1.0/kir/tests/test_rehearsal_over_the_corpus.py +220 -0
  377. kir_building-0.1.0/kir/tests/test_shape_census.py +168 -0
  378. kir_building-0.1.0/kir/tests/test_tolerance_provenance.py +686 -0
  379. kir_building-0.1.0/kir/tests/test_tool_doc.py +238 -0
  380. kir_building-0.1.0/kir/tests/test_witness_vacuity.py +394 -0
  381. kir_building-0.1.0/kir/tests/version_fragile_gate_answer.json +60 -0
  382. kir_building-0.1.0/kir/tool_doc.py +1603 -0
  383. kir_building-0.1.0/kir/translation_cert.py +4754 -0
  384. kir_building-0.1.0/kir/viewer/__init__.py +32 -0
  385. kir_building-0.1.0/kir/viewer/advice.py +275 -0
  386. kir_building-0.1.0/kir/viewer/cache.py +514 -0
  387. kir_building-0.1.0/kir/viewer/codec.py +580 -0
  388. kir_building-0.1.0/kir/viewer/compilability.py +354 -0
  389. kir_building-0.1.0/kir/viewer/graph.py +375 -0
  390. kir_building-0.1.0/kir/viewer/history.py +205 -0
  391. kir_building-0.1.0/kir/viewer/honesty.py +415 -0
  392. kir_building-0.1.0/kir/viewer/live_scene.py +915 -0
  393. kir_building-0.1.0/kir/viewer/normcontrol.py +246 -0
  394. kir_building-0.1.0/kir/viewer/pull_request.py +277 -0
  395. kir_building-0.1.0/kir/viewer/push.py +213 -0
  396. kir_building-0.1.0/kir/viewer/reconcile.py +380 -0
  397. kir_building-0.1.0/kir/viewer/scene.py +444 -0
  398. kir_building-0.1.0/kir/witness_corpus.py +221 -0
  399. kir_building-0.1.0/kir/witness_feed.py +860 -0
  400. kir_building-0.1.0/kir_building.egg-info/PKG-INFO +450 -0
  401. kir_building-0.1.0/kir_building.egg-info/SOURCES.txt +405 -0
  402. kir_building-0.1.0/kir_building.egg-info/dependency_links.txt +1 -0
  403. kir_building-0.1.0/kir_building.egg-info/requires.txt +11 -0
  404. kir_building-0.1.0/kir_building.egg-info/top_level.txt +1 -0
  405. kir_building-0.1.0/pyproject.toml +88 -0
  406. kir_building-0.1.0/setup.cfg +4 -0
  407. kir_building-0.1.0/setup.py +41 -0
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 KUKAI
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
@@ -0,0 +1,8 @@
1
+ # 🔴 SDIST ОБЯЗАН БЫТЬ САМОДОСТАТОЧЕН, И ЭТО КУПЛЕНО ОТКАЗОМ 31.08.2026.
2
+ # `python -m build` собирает колесо ИЗ SDIST, а не из дерева. Без строки ниже
3
+ # сборка падала с `FileNotFoundError: WHEEL_KEEP.json`, и падала бы у КАЖДОГО,
4
+ # кто ставит из исходника (`pip install --no-binary`, или когда колесо не
5
+ # подошло). Прямая сборка `build --wheel` эту дыру НЕ ПОКАЗЫВАЕТ: она обходит
6
+ # круг через sdist, и потому «у меня собралось» здесь ничего не доказывает.
7
+ include WHEEL_KEEP.json
8
+ include LICENSE
@@ -0,0 +1,450 @@
1
+ Metadata-Version: 2.4
2
+ Name: kir-building
3
+ Version: 0.1.0
4
+ Summary: KIR — typed, verifiable IR for buildings. A building is a program.
5
+ Author: Dima
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/5vbkgsghhh-hash/kir
8
+ Project-URL: Source, https://github.com/5vbkgsghhh-hash/kir
9
+ Keywords: revit,bim,compiler,ir,buildings,cad,llm
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Classifier: Topic :: Software Development :: Compilers
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.12
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: shapely>=2.0
24
+ Requires-Dist: networkx<4.0,>=3.0
25
+ Requires-Dist: pydantic>=2.7.0
26
+ Requires-Dist: httpx>=0.27.0
27
+ Provides-Extra: bridge
28
+ Requires-Dist: fastapi>=0.115.0; extra == "bridge"
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=8.0; extra == "dev"
31
+ Requires-Dist: jsonschema>=4.0; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+
35
+ <p align="center">
36
+ <img src="assets/logo.png" width="256" alt="KIR building graph logo"/>
37
+ </p>
38
+
39
+ <h1 align="center">KIR</h1>
40
+
41
+ <p align="center">
42
+ <b>A building is a program.</b><br/>
43
+ Typed, verifiable IR for Autodesk Revit — Python brains, verified hands.
44
+ </p>
45
+
46
+ <p align="center">
47
+ <img alt="License Apache-2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue">
48
+ <img alt="Revit 2021-2026" src="https://img.shields.io/badge/Revit-2021%E2%80%932026-005386">
49
+ <img alt="Historical compile gate 1056 checks" src="https://img.shields.io/badge/historical%20compile%20gate-1056%20checks-brightgreen">
50
+ <img alt="82 ops registered" src="https://img.shields.io/badge/registry-82%20ops%20(77%20writing)-success">
51
+ <img alt="Python 3.12+" src="https://img.shields.io/badge/python-3.12%2B-blue">
52
+ </p>
53
+
54
+ <p align="center">
55
+ <a href="#install-and-run-it">Install</a> ·
56
+ <a href="#why">Why</a> ·
57
+ <a href="#the-idea-in-one-picture">The idea</a> ·
58
+ <a href="#show-me-code">Code</a> ·
59
+ <a href="#a-building-has-a-history">History</a> ·
60
+ <a href="#measured-not-promised">Measured results</a> ·
61
+ <a href="#the-five-laws">Invariants</a> ·
62
+ <a href="examples/README.md">Examples</a> ·
63
+ <a href="#repository-state">Repository state</a>
64
+ </p>
65
+
66
+ ---
67
+
68
+
69
+ <p align="center">
70
+ <img src="assets/tower-side-by-side.png" alt="The same tower twice in Revit" width="720"/>
71
+ </p>
72
+
73
+ The same building, held two ways. As the verified C# that KIR emits for a single Revit version,
74
+ the 60-storey tower from [`examples/tower_numpy.py`](examples/tower_numpy.py) weighs
75
+ **3 902 141 characters — roughly 1M tokens, beyond any model's context window**. As the typed
76
+ KIR program a model actually edits, it weighs **15 508 characters — roughly 4k tokens, 252×
77
+ less**. That is the difference between a model that can re-plan a floor or bend a facade with
78
+ every change verified, and a model that cannot even read the building it is asked to change.
79
+ *(Sizes re-measured 2026-08-31 by running the example in this repo — the KIR side has not moved
80
+ since 2026-07-28, the emitted C# has grown; the render is a visual companion, not the
81
+ measurement.)*
82
+
83
+ ## Install and run it
84
+
85
+ KIR is a Python package. Nothing below needs Revit, a licence, a service to stand up, or `sudo` —
86
+ only Python 3.12 or newer. From a clone of this repository:
87
+
88
+ ```bash
89
+ python3.12 -m venv .venv && . .venv/bin/activate
90
+ pip install .
91
+
92
+ python -c "from kir import spec, sdk; print(len(spec.OPS), len(sdk.builders()))"
93
+ python examples/tower_numpy.py
94
+ ```
95
+
96
+ The `python -c` line prints `82 82` — one generated builder per registered op. The example after it
97
+ builds a 60-storey twisted tower and compiles it for every supported Revit version, offline:
98
+
99
+ ```text
100
+ 100 строк питона → 6 опов написано → 840 после экспансии → 780 элементов (программ KIR: 3)
101
+ этажей 60, талия 30%, закрутка 120°
102
+ ломаная против синуса: 217 мм по радиусу
103
+ компиляция: 6/6 версий ['2021', '2022', '2023', '2024', '2025', '2026']
104
+ ```
105
+
106
+ *(Every command in this section was run verbatim on 2026-08-31 in a venv created from scratch:
107
+ `pip install .` pulled four direct and fifteen total dependencies, exit 0, nothing outside the venv
108
+ touched. The shipped examples currently print in Russian.)*
109
+
110
+ Writing into a live model additionally needs a Revit 2021–2026 installation, its API reference
111
+ assemblies, the .NET Roslyn compile service and a separately running bridge — none of which are
112
+ part of this repository.
113
+
114
+ ## Why
115
+
116
+ Language models write code well. They do not write buildings well, and the reason is structural
117
+ rather than a matter of training scale. A building does not fit in a context window — one of the
118
+ models we measure against holds **90 758 elements**. The work is stateful: a wall must exist before
119
+ a door can be hosted in it, and that state lives inside an application, not in a file you can diff.
120
+ It is re-entrant, because the same instruction issued twice must not produce two doors. And it is
121
+ versioned six ways: the same intent compiles differently against Revit 2021 and Revit 2026.
122
+
123
+ So the practice today is to have the model write Revit C# directly, and the arithmetic of that
124
+ practice is available to us. Across **85 374 production compile errors** logged over seven weeks,
125
+ two codes account for **48.4%** — `CS1061` (32.3%) and `CS0117` (16.1%) — and both are the same
126
+ failure: *a member of the Revit API that does not exist*. Another ~10% (`CS0104`/`CS0012`) are
127
+ namespace and assembly-reference problems. Roughly **60% of all production compile errors are spent
128
+ fighting the surface of an API**, not describing a building.
129
+
130
+ **KIR is an attempt to build it**: the model concentrates on
131
+ 3D, geometry and composition; units, transactions, API versions, hosts, witnesses and rollbacks
132
+ belong to a compiler.
133
+
134
+ ## The idea in one picture
135
+
136
+ ```mermaid
137
+ flowchart TB
138
+ subgraph FWD["FORWARD — intent becomes a building"]
139
+ direction LR
140
+ SDK["Python SDK<br/>numpy · shapely · the model"]
141
+ PROG["Typed program<br/>KIR JSON, ops + refs"]
142
+ REG["Registry<br/>one source of truth:<br/>schema · grammar · docs · emitters"]
143
+ GRND["ground<br/>symbolic selectors to ElementIds"]
144
+ PLAN["typecheck + plan<br/>mm only · DAG · txn partitions"]
145
+ EMIT["emit<br/>per-version C#"]
146
+ GATE["Roslyn gate<br/>2021–2026 · 1056 checks PASS"]
147
+ RUN["live Revit<br/>one TransactionGroup"]
148
+ SDK --> PROG --> REG --> GRND --> PLAN --> EMIT --> GATE --> RUN
149
+ end
150
+
151
+ RUN --> WIT["witness<br/>read the RESULT back, not the call"]
152
+ WIT --> OUT{"exactly two<br/>typed outcomes"}
153
+ OUT -->|ok| OKN["geometry_ok · semantic_ok · topology_ok"]
154
+ OUT -->|refused| REFN["diagnostics + candidates + route<br/>KIR-G/T/L/E/C/X/W codes"]
155
+ REFN -.->|"IR-level repair, max 3 rounds"| PROG
156
+
157
+ subgraph REV["REVERSE — a building becomes a program"]
158
+ direction LR
159
+ DOC["live model"]
160
+ L0["extract to L0<br/>48 categories · full-model census"]
161
+ L1["lift to typed ops<br/>or a typed ATOM with a reason"]
162
+ FOLD["fold to canon<br/>template-canon/4 · fidelity-canon/1"]
163
+ MAT["materialize<br/>chunked programs, host-atomic"]
164
+ DOC --> L0 --> L1 --> FOLD --> MAT
165
+ end
166
+
167
+ RUN -.-> DOC
168
+ MAT -.->|"rebuild · edit · diff"| PROG
169
+ ```
170
+
171
+ Two properties matter more than the boxes.
172
+
173
+ **Every call ends in exactly one of two typed outcomes** — an `ok` carrying a read-back proof, or a
174
+ machine-readable `refused` with candidates and a route to a fallback path. A silently-wrong answer
175
+ is the single forbidden state; `ok:true` wrapping a nested error is a permanent regression case with
176
+ its own test.
177
+
178
+ **The IR runs in both directions.** Anything the lifter cannot express becomes a *typed atom with a
179
+ reason code*, never a silent drop. That reverse direction is what turns "we can build" into "we can
180
+ edit what already exists".
181
+
182
+ A stage-by-stage account of both pipelines — the registry as one source of truth, isolation modes,
183
+ the census, fold, rebuild verification — lives in the language contracts under [`kir/specs/`](kir/specs/) (`SPEC_V1.md`, the decompile
184
+ spec) and the design specs under [`docs/laws/`](docs/laws/).
185
+
186
+ ## Repository layout
187
+
188
+ Everything here is the compiler and its instruments; the product that hosts them is a separate
189
+ repository. Revit is one target of several, and the package is agnostic about which one it emits for.
190
+
191
+ - `kir/` — the forward compiler: registry, typecheck, plan, per-version emitters, typed
192
+ diagnostics, witness/acceptance machinery;
193
+ - `kir/decompile/` — the reverse pipeline: extract, lift, fold, materialize, and the
194
+ version-control half (`merkle`, `journal`, `rebuild`, `merge3`);
195
+ - `kir/checker/`, `kir/clash/` — the judge and the clash pipeline;
196
+ - `kir/instruments/` — instruments that run offline, without Revit: `compile_gate_offline`,
197
+ `bounds_audit`, `unwired_census`, `scope_audit`, `snapshot_janitor`, `canon_state`, and others;
198
+ - `kir/course/`, `kir/skill.py` — the authoring course and the skill an LLM is handed;
199
+ - `kir/specs/` — the language contracts: `SPEC_V1.md`, the decompile spec;
200
+ - `kir/bridge/` — the client side of the bridge protocol, plus a mock server for offline runs;
201
+ - `kir/tests/` and `kir/*/tests/` — 621 test files: unit, contract, golden and property tests;
202
+ - `examples/` — small SDK programs that compile offline, before any Revit is connected;
203
+ - `docs/laws/` — the design specs behind the honesty, merkle and verified layers.
204
+
205
+ The Revit bridge itself, the .NET Roslyn compile service, the product's admin routes, runtime data,
206
+ credentials and logs are intentionally not part of this repository.
207
+
208
+ ## Show me code
209
+
210
+ A real program, printed verbatim from the SDK:
211
+
212
+ ```json
213
+ {
214
+ "ir_version": "1.0",
215
+ "intent": "one bay: wall + door + window",
216
+ "ops": [
217
+ {"op": "create_wall", "id": "wall1",
218
+ "p0_mm": [0, 0], "p1_mm": [6000, 0],
219
+ "level": {"by": "name", "value": "Level 1"}, "height_mm": 3300},
220
+ {"op": "create_door", "id": "door1",
221
+ "host": {"by": "ref", "value": "wall1"},
222
+ "offset_mm": 1200, "sill_mm": -100,
223
+ "symbol": {"by": "name", "value": "0915 x 2134mm"},
224
+ "mirrored": false, "hand_flipped": false, "facing_flipped": false}
225
+ ]
226
+ }
227
+ ```
228
+
229
+ Note what is *not* expressible. A door has no `xyz`: it is `host` + `offset_mm` along the host +
230
+ `sill_mm`. "A window floating in the air" is not a case we validate — it is a sentence the language
231
+ cannot form. Every length is millimetres; feet do not exist in the IR.
232
+
233
+ The Python surface is generated, not written: **82 builders are born from the registry at import
234
+ time, one per registry op** (`len(sdk.builders()) == len(spec.OPS)`, re-checked 2026-08-31), so a
235
+ signature cannot drift from the spec. The SDK adds no semantics of its own — it cannot express
236
+ anything the registry lacks, and it cannot hide a refusal.
237
+
238
+ ```python
239
+ import numpy as np
240
+ from kir import sdk
241
+
242
+ p = sdk.program(intent="tower with a waist")
243
+ with p.stack(levels=20, h_mm=3600,
244
+ transform=sdk.transform(scale_xy_top=[0.8, 0.8],
245
+ twist_deg_total=24)) as floor:
246
+ for a in np.linspace(0, 2 * np.pi, 12, endpoint=False):
247
+ floor.add(sdk.create_column(xy=[20000 * np.cos(a), 20000 * np.sin(a)],
248
+ level=sdk.BY_MACRO, symbol="К 300x300"))
249
+
250
+ p.stats() # {'ops_written': 1, 'ops_expanded': 260, 'elements': 240}
251
+ out = p.compile(version="2023", snapshot=snap)
252
+ ```
253
+
254
+ The shipped example goes further. In `tower_numpy.py`, numpy computes a sinusoidal waist and twist
255
+ and KIR repeats the storey — run on 2026-07-28:
256
+
257
+ ```text
258
+ 100 lines of Python -> 6 authored ops -> 840 after expansion -> 780 elements (3 KIR programs)
259
+ 60 storeys, 30% waist, 120 deg total twist
260
+ piecewise vs. true sine: 217 mm along the radius
261
+ compilation: 6/6 versions ['2021','2022','2023','2024','2025','2026']
262
+ ```
263
+
264
+ That third line is the point. `stack.transform` interpolates linearly; the requested curve is a
265
+ sine. Saying "sine" and building a polyline **without naming the divergence** would be a silently
266
+ wrong answer, so the example prints the error in millimetres.
267
+
268
+ Both demonstrations — the numpy tower and a shapely-cut curved floor plate — ship in
269
+ [**examples/**](examples/README.md) with their measured outputs.
270
+
271
+ ### What happens to one op
272
+
273
+ ```mermaid
274
+ sequenceDiagram
275
+ autonumber
276
+ participant M as Model — the LLM
277
+ participant K as KIR compiler
278
+ participant R as Revit — live document
279
+
280
+ M->>K: create_wall — p0, p1, level by name, height 3300 mm
281
+ K->>K: parse · typecheck · mm to feet · plan the DAG
282
+ K->>R: snapshot query — resolve selectors
283
+ R-->>K: level id, wall type pool
284
+
285
+ alt selector missing or ambiguous
286
+ K-->>M: refused KIR-G102 + candidates + route
287
+ else grounded
288
+ K->>K: emit C# for THIS Revit version
289
+ K->>R: TransactionGroup — Wall.Create, op_id stamped
290
+ R-->>K: new element id
291
+ K->>R: read the element BACK
292
+ R-->>K: LocationCurve, height param, level id
293
+ alt postconditions hold
294
+ K-->>M: ok + witness — geometry_ok, semantic_ok, topology_ok
295
+ else violated
296
+ K->>R: RollBack
297
+ K-->>M: refused KIR-X004 + which axis failed
298
+ end
299
+ end
300
+ ```
301
+
302
+ That stamp is why a retry is idempotent: op ids are written into the model inside the same
303
+ transaction, so re-running a program skips what is already stamped, and resume-from-op-K is simply
304
+ "skip what carries a stamp".
305
+
306
+ ## A building has a history
307
+
308
+ A single write is not the whole story. A real project gets read, edited, and read again dozens of
309
+ times, and for most of this project's life nothing here remembered that revision N and revision N+1
310
+ were the same building — every rebuild started from zero. Four modules close that gap, and together
311
+ they are exactly a version-control system, mapped onto concepts a reader already knows:
312
+
313
+ | git concept | KIR module | what it actually is |
314
+ |---|---|---|
315
+ | content-addressed object store | `merkle` | a Merkle DAG over the folded building tree — a repeated floor is one node, not N |
316
+ | a history you can replay | `journal` | append-only per-building revision log; replaying it reconstructs any past revision exactly |
317
+ | applying a diff | `rebuild` | materializes only the delta between two revisions instead of the whole building |
318
+ | three-way merge | `merge3` | base / current document / target revision, with a real `conflicting` verdict — never a silent overwrite |
319
+
320
+ It does not replace the addressed building graph shown above. The merged state is deliberately
321
+ identity-free — a canonical op carries no `ElementId` — which is exactly what makes it mergeable;
322
+ a program is still materialized from one concrete revision, never from the merge itself. The
323
+ routes that drive these four live against an open Revit document
324
+ (`/admin/kir/rebuild`, `/admin/kir/decompile`) are part of the private product and are not in this
325
+ open-core slice, but their offline half ships and runs right here, no bridge and no Revit needed:
326
+
327
+ ```text
328
+ pytest kir/decompile/tests/test_merkle.py kir/decompile/tests/test_rebuild.py \
329
+ kir/decompile/tests/test_journal.py kir/decompile/tests/test_merge3.py
330
+ 98 passed, 19 subtests passed -- run 2026-08-31, Python 3.12, this repository, no Revit
331
+ ```
332
+
333
+ ## Measured results
334
+
335
+ Everything below is derived from an instrument on the date shown, not from memory.
336
+
337
+ Every row below was produced by running the command in the right-hand column, on commit
338
+ `3211555`. Rows marked
339
+ *historical* are older runs whose instrument or corpus is not shipped here; they carry their date
340
+ and cannot be re-run from this repository alone.
341
+
342
+ | Fact | Value | Date / how |
343
+ |---|---|---|
344
+ | Ops in the registry | **82** — 77 writing, 5 query | 2026-08-31, `len(spec.OPS)` |
345
+ | Generated SDK builders | **82 — one per op** | 2026-08-31, `len(sdk.builders()) == len(spec.OPS)` |
346
+ | Source size | **274 production modules**, **621 test files** | 2026-08-31, `find kir -name '*.py'` |
347
+ | Python syntax check | **916 files parsed, 0 errors** | 2026-08-31, `ast.parse` over every `*.py` outside `build/` |
348
+ | Install into a clean venv | **PASS** — exit 0, 15 packages, no `sudo` | 2026-08-31, `pip install .` in a fresh `python3.12 -m venv` |
349
+ | Offline six-version compile of the shipped example | **PASS** — 3 programs, 840 ops, 780 elements, 6/6 versions | 2026-08-31, `python examples/tower_numpy.py` |
350
+ | Version-control half, offline | **98 passed, 19 subtests**, under 10 s | 2026-08-31, `pytest kir/decompile/tests/test_{merkle,rebuild,journal,merge3}.py` |
351
+ | Emitted C# for the 60-storey tower, one version | **3 902 141 characters** against **15 508** for the KIR program — **252×** | 2026-08-31, Revit 2023 |
352
+ | Historical live baseline | **31 of 31 writing ops** had a witnessed run — of the 31 that existed then | 2026-07-28 local telemetry; telemetry is not shipped here |
353
+ | Historical six-version compile gate | **1 056 Roslyn compilations, PASS** | 2026-07-28 local gate run |
354
+ | Historical reverse-direction coverage | **48 categories; 92.83% on the 90 758-element R2026 model** | 2026-07-27/28 local runs |
355
+ | Historical production compile errors structurally inexpressible in KIR | **≈60%** of 85 374 over seven weeks | local report; completeness caveats apply |
356
+
357
+ ## Checked invariants
358
+
359
+ The reverse pipeline enforces five checked invariants: full document coverage, a reason recorded for
360
+ every element it cannot express, witnesses that match the data actually read, contamination marking
361
+ for partial reads, and neutral identifiers. Each invariant is backed by a test or verification run;
362
+ a violation stops the build or run.
363
+
364
+ ```mermaid
365
+ flowchart LR
366
+ subgraph LAWS["§18 — five invariants"]
367
+ direction TB
368
+ L1["1 · CENSUS<br/>lifted + atoms + not_read<br/>= the whole document"]
369
+ L2["2 · RECEIPT<br/>every cut emits<br/>element_id + typed_reason"]
370
+ L3["3 · WITNESS AXIS<br/>sign only the axis<br/>you actually read"]
371
+ L4["4 · CONTAMINATION<br/>a partial read marks<br/>everything derived from it"]
372
+ L5["5 · NEUTRALITY<br/>no device ids, install paths,<br/>or locale-only keys"]
373
+ end
374
+
375
+ subgraph CORE["what they enclose"]
376
+ direction TB
377
+ C1["compile"] --> C2["execute in Revit"] --> C3["read back"] --> C4["publish a number"]
378
+ end
379
+
380
+ L1 -->|"run-fatal identity check + CI fixture"| CORE
381
+ L2 -->|"rows + failures contract on every side stage"| CORE
382
+ L3 -->|"certificate lint: kind to legal reader"| CORE
383
+ L4 -->|"header round-trip test + A5 gate on partial data"| CORE
384
+ L5 -->|"CI pattern lint"| CORE
385
+
386
+ CORE --> R1["built, with a witness"]
387
+ CORE --> R2["typed refusal, with a route"]
388
+ CORE -.->|forbidden by construction| R3["silently wrong"]
389
+ ```
390
+
391
+ Full account: **Five Conservation Laws of Honesty for an AI Agent in CAD**.
392
+
393
+ ## Read more
394
+
395
+ - **A Building Is a Program** — the long-form
396
+ technical case: what the IR expresses, why it runs in both directions, and the measured number
397
+ behind each claim.
398
+ - **Five Conservation Laws of Honesty for an AI Agent in CAD**
399
+ — the five laws, the catch behind each, and how each one is mechanically enforced.
400
+ - **A Day of Measured Revit API Traps** — fourteen Revit
401
+ API behaviours as symptom, wrong hypothesis, measurement, rule. Useful even if you never touch KIR.
402
+ - **One Day Inside an AI-led Compiler Team** — a
403
+ first-person account of one working day on this project.
404
+
405
+ <a id="repository-state"></a>
406
+ ## Repository state
407
+
408
+ The compiler, the reverse pipeline, the instruments, the authoring course and the whole test suite
409
+ live in this repository and run without Revit. To work against the tree instead of an installed
410
+ copy:
411
+
412
+ ```bash
413
+ python3.12 -m venv .venv && . .venv/bin/activate
414
+ pip install -e '.[dev]'
415
+ PYTHONPATH="$PWD" python -m pytest kir/decompile/tests -q
416
+ ```
417
+
418
+ Two traps worth naming, both bought by measurement rather than reasoning:
419
+
420
+ - **`PYTHONPATH` must be absolute.** A bare `PYTHONPATH=.` is shadowed by any stray `kir.py` beside
421
+ you, and the refusal then blames the wrong module.
422
+ - **Four direct dependencies, and `httpx` is one of them.** It looks like bridge-only machinery, but
423
+ `compile_client.py` sits in the package import chain; dropping it into an extra made `import kir`
424
+ fail in a clean venv. The dependency list is settled by a run, not by an argument.
425
+
426
+ Live execution additionally needs a Revit 2021–2026 installation, its API reference assemblies, the
427
+ .NET Roslyn compile service and a separately running bridge.
428
+
429
+ **Machine-specific paths: measured, not asserted.** An AST sweep over every string literal outside
430
+ docstrings finds **0** absolute machine paths in the 274 production modules. The test suite is a
431
+ different matter and is named rather than glossed: **17 test files pin absolute paths of the machine
432
+ they were measured on**, and the tests ship inside the built package. No credentials, keys or device
433
+ identifiers were found anywhere in the wheel.
434
+
435
+ ## For auditors
436
+
437
+ Beyond the compiler core in `kir/`:
438
+
439
+ - **Language contracts:** [`kir/specs/`](kir/specs/) — `SPEC_V1.md`, `KIR_DECOMPILE_SPEC.md`
440
+ - **Laws of honesty / verified / merkle:** [`docs/laws/`](docs/laws/)
441
+ - **LLM authoring skill + sandbox course:** `kir/skill.py`, [`kir/course/`](kir/course/)
442
+ - **CI evidence & secret boundary:** `.github/workflows/kir-evidence.yml`, `kir-security.yml`
443
+ - **Offline instruments, runnable with no Revit:** [`kir/instruments/`](kir/instruments/) — each one
444
+ is expected to name what it could not read rather than report a zero it never measured
445
+
446
+ ---
447
+
448
+ <p align="center">
449
+ <sub>Apache License 2.0 — see <a href="LICENSE">LICENSE</a>.</sub>
450
+ </p>