lclang 0.3.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. lclang-0.3.0/.gitignore +11 -0
  2. lclang-0.3.0/AGENTS.md +66 -0
  3. lclang-0.3.0/CHANGELOG.md +125 -0
  4. lclang-0.3.0/LICENSE +21 -0
  5. lclang-0.3.0/PKG-INFO +187 -0
  6. lclang-0.3.0/README.md +168 -0
  7. lclang-0.3.0/README_cn.md +145 -0
  8. lclang-0.3.0/doc_cn/README_cn.md +10 -0
  9. lclang-0.3.0/doc_cn/cli_cn.md +247 -0
  10. lclang-0.3.0/doc_cn/configuration_cn.md +83 -0
  11. lclang-0.3.0/doc_cn/runtime-api_cn.md +108 -0
  12. lclang-0.3.0/docs/README.md +20 -0
  13. lclang-0.3.0/docs/architecture/README.md +6 -0
  14. lclang-0.3.0/docs/architecture/module-layout.md +64 -0
  15. lclang-0.3.0/docs/architecture/python-file-name-audit.md +267 -0
  16. lclang-0.3.0/docs/configuration.md +103 -0
  17. lclang-0.3.0/docs/lcl-lang.md +482 -0
  18. lclang-0.3.0/docs/reference/runtime-api.md +175 -0
  19. lclang-0.3.0/docs/specs/M001-product-and-architecture.md +46 -0
  20. lclang-0.3.0/docs/specs/M002-packaging.md +18 -0
  21. lclang-0.3.0/docs/specs/M003-quality-tooling.md +25 -0
  22. lclang-0.3.0/docs/specs/M004-portable-scripts.md +19 -0
  23. lclang-0.3.0/docs/specs/M005-documentation-layout.md +18 -0
  24. lclang-0.3.0/docs/specs/M006-foundation-release-gate.md +19 -0
  25. lclang-0.3.0/docs/specs/M007-rst-docstrings.md +39 -0
  26. lclang-0.3.0/docs/specs/M008-lclang-identity-and-src-layout.md +29 -0
  27. lclang-0.3.0/docs/specs/M010-types-and-sources.md +36 -0
  28. lclang-0.3.0/docs/specs/M011-errors.md +30 -0
  29. lclang-0.3.0/docs/specs/M012-ast-base.md +27 -0
  30. lclang-0.3.0/docs/specs/M013-core-lexer.md +39 -0
  31. lclang-0.3.0/docs/specs/M014-literals.md +41 -0
  32. lclang-0.3.0/docs/specs/M015-fstrings.md +40 -0
  33. lclang-0.3.0/docs/specs/M016-expression-ast.md +40 -0
  34. lclang-0.3.0/docs/specs/M017-pratt-core.md +41 -0
  35. lclang-0.3.0/docs/specs/M018-parser-primaries.md +35 -0
  36. lclang-0.3.0/docs/specs/M019-parser-displays.md +37 -0
  37. lclang-0.3.0/docs/specs/M020-logical-parser.md +36 -0
  38. lclang-0.3.0/docs/specs/M021-comprehensions.md +41 -0
  39. lclang-0.3.0/docs/specs/M022-function-error-forms.md +47 -0
  40. lclang-0.3.0/docs/specs/M023-control-forms.md +44 -0
  41. lclang-0.3.0/docs/specs/M024-canonical-printer.md +39 -0
  42. lclang-0.3.0/docs/specs/M025-parser-api.md +40 -0
  43. lclang-0.3.0/docs/specs/M026-evaluator-core.md +44 -0
  44. lclang-0.3.0/docs/specs/M027-operations.md +38 -0
  45. lclang-0.3.0/docs/specs/M028-logical-evaluation.md +36 -0
  46. lclang-0.3.0/docs/specs/M029-collections.md +56 -0
  47. lclang-0.3.0/docs/specs/M030-primaries-and-calls.md +42 -0
  48. lclang-0.3.0/docs/specs/M031-functions.md +45 -0
  49. lclang-0.3.0/docs/specs/M032-error-control.md +47 -0
  50. lclang-0.3.0/docs/specs/M033-context-managers.md +48 -0
  51. lclang-0.3.0/docs/specs/M034-fstrings-and-evaluator-api.md +47 -0
  52. lclang-0.3.0/docs/specs/M035-frame-cache.md +42 -0
  53. lclang-0.3.0/docs/specs/M036-parent-lookup.md +35 -0
  54. lclang-0.3.0/docs/specs/M037-single-flight.md +37 -0
  55. lclang-0.3.0/docs/specs/M038-cancellation.md +35 -0
  56. lclang-0.3.0/docs/specs/M039-recalculation.md +45 -0
  57. lclang-0.3.0/docs/specs/M040-evaluation-limits.md +56 -0
  58. lclang-0.3.0/docs/specs/M041-frame-close.md +50 -0
  59. lclang-0.3.0/docs/specs/M042-static-dependencies.md +51 -0
  60. lclang-0.3.0/docs/specs/M043-dependency-graph.md +52 -0
  61. lclang-0.3.0/docs/specs/M044-dynamic-dependencies.md +61 -0
  62. lclang-0.3.0/docs/specs/M045-frame-dependencies.md +60 -0
  63. lclang-0.3.0/docs/specs/M046-presets-and-factories.md +52 -0
  64. lclang-0.3.0/docs/specs/M047-stdlib-manifests.md +49 -0
  65. lclang-0.3.0/docs/specs/M048-stdlib-helpers.md +52 -0
  66. lclang-0.3.0/docs/specs/M049-runtime-public-api.md +45 -0
  67. lclang-0.3.0/docs/specs/M050-runtime-documentation.md +47 -0
  68. lclang-0.3.0/docs/specs/M051-runtime-release.md +178 -0
  69. lclang-0.3.0/docs/specs/M052-jihulab-ci-pipeline.md +49 -0
  70. lclang-0.3.0/docs/specs/M052-recursive-functional-programs.md +46 -0
  71. lclang-0.3.0/docs/specs/M053-frame-hierarchy-shortcuts.md +104 -0
  72. lclang-0.3.0/docs/specs/M054-definition-context-dates-frame-graph.md +94 -0
  73. lclang-0.3.0/docs/specs/M055-api-ergonomics-module-layout.md +90 -0
  74. lclang-0.3.0/docs/specs/M056-frame-inspection-package.md +98 -0
  75. lclang-0.3.0/docs/specs/M057-inspection-dependency-deduplication.md +41 -0
  76. lclang-0.3.0/docs/specs/M058-inspection-representation.md +59 -0
  77. lclang-0.3.0/docs/specs/M060-config-model.md +45 -0
  78. lclang-0.3.0/docs/specs/M061-config-lines.md +45 -0
  79. lclang-0.3.0/docs/specs/M062-config-comments.md +41 -0
  80. lclang-0.3.0/docs/specs/M063-config-definitions.md +47 -0
  81. lclang-0.3.0/docs/specs/M064-config-memory-sources.md +47 -0
  82. lclang-0.3.0/docs/specs/M065-config-includes.md +47 -0
  83. lclang-0.3.0/docs/specs/M066-config-precedence.md +46 -0
  84. lclang-0.3.0/docs/specs/M067-config-origins.md +48 -0
  85. lclang-0.3.0/docs/specs/M068-config-include-cycles.md +43 -0
  86. lclang-0.3.0/docs/specs/M069-config-versions-diagnostics.md +46 -0
  87. lclang-0.3.0/docs/specs/M070-config-public-api.md +46 -0
  88. lclang-0.3.0/docs/specs/M071-config-stress.md +43 -0
  89. lclang-0.3.0/docs/specs/M072-config-release.md +60 -0
  90. lclang-0.3.0/docs/specs/M080-cli-contract.md +48 -0
  91. lclang-0.3.0/docs/specs/M081-cli-context.md +46 -0
  92. lclang-0.3.0/docs/specs/M082-cli-entrances.md +47 -0
  93. lclang-0.3.0/docs/specs/M083-cli-fixed-arity.md +51 -0
  94. lclang-0.3.0/docs/specs/M084-cli-routing.md +43 -0
  95. lclang-0.3.0/docs/specs/M085-cli-help.md +46 -0
  96. lclang-0.3.0/docs/specs/M086-cli-frame-construction.md +52 -0
  97. lclang-0.3.0/docs/specs/M087-cli-run.md +51 -0
  98. lclang-0.3.0/docs/specs/M088-cli-dry-run.md +41 -0
  99. lclang-0.3.0/docs/specs/M089-cli-builtins.md +41 -0
  100. lclang-0.3.0/docs/specs/M090-cli-entry-points.md +41 -0
  101. lclang-0.3.0/docs/specs/M091-cli-platform-tests.md +47 -0
  102. lclang-0.3.0/docs/specs/M092-cli-release.md +62 -0
  103. lclang-0.3.0/docs/specs/M093-cli-module-commands.md +65 -0
  104. lclang-0.3.0/docs/specs/M094-cli-literal-host-overrides.md +53 -0
  105. lclang-0.3.0/docs/specs/M095-native-inspection-values.md +64 -0
  106. lclang-0.3.0/docs/specs/M096-builtin-repr-evaluation-stack.md +75 -0
  107. lclang-0.3.0/docs/specs/M097-boolean-overrides-evaluated-inspection.md +62 -0
  108. lclang-0.3.0/docs/specs/M098-ast-value-inspection-repr.md +63 -0
  109. lclang-0.3.0/docs/specs/M099-cli-builtins-command.md +50 -0
  110. lclang-0.3.0/docs/specs/M601-execution-status.md +75 -0
  111. lclang-0.3.0/docs/specs/M602-scoped-steps.md +56 -0
  112. lclang-0.3.0/docs/specs/TEMPLATE.md +24 -0
  113. lclang-0.3.0/docs/tutorials/README.md +105 -0
  114. lclang-0.3.0/docs/tutorials/cli.md +300 -0
  115. lclang-0.3.0/docs/tutorials/config_file.md +248 -0
  116. lclang-0.3.0/docs/tutorials/dependency-analytics.md +287 -0
  117. lclang-0.3.0/docs/tutorials/lcl_examples.md +485 -0
  118. lclang-0.3.0/docs/tutorials/runtime.md +401 -0
  119. lclang-0.3.0/docs/tutorials/workflow-status.md +127 -0
  120. lclang-0.3.0/progress.md +456 -0
  121. lclang-0.3.0/pyproject.toml +100 -0
  122. lclang-0.3.0/src/lclang/__init__.py +80 -0
  123. lclang-0.3.0/src/lclang/_version.py +3 -0
  124. lclang-0.3.0/src/lclang/api.py +155 -0
  125. lclang-0.3.0/src/lclang/ast/__init__.py +83 -0
  126. lclang-0.3.0/src/lclang/ast/atoms.py +69 -0
  127. lclang-0.3.0/src/lclang/ast/base.py +76 -0
  128. lclang-0.3.0/src/lclang/ast/call_arguments.py +119 -0
  129. lclang-0.3.0/src/lclang/ast/comprehensions.py +140 -0
  130. lclang-0.3.0/src/lclang/ast/control_forms.py +155 -0
  131. lclang-0.3.0/src/lclang/ast/displays.py +150 -0
  132. lclang-0.3.0/src/lclang/ast/expressions.py +187 -0
  133. lclang-0.3.0/src/lclang/ast/forms.py +138 -0
  134. lclang-0.3.0/src/lclang/ast/fstrings.py +95 -0
  135. lclang-0.3.0/src/lclang/ast/operators.py +68 -0
  136. lclang-0.3.0/src/lclang/ast/primaries.py +154 -0
  137. lclang-0.3.0/src/lclang/cli/__init__.py +28 -0
  138. lclang-0.3.0/src/lclang/cli/__main__.py +8 -0
  139. lclang-0.3.0/src/lclang/cli/application.py +78 -0
  140. lclang-0.3.0/src/lclang/cli/binding.py +160 -0
  141. lclang-0.3.0/src/lclang/cli/builtin_docs.py +115 -0
  142. lclang-0.3.0/src/lclang/cli/commands.py +193 -0
  143. lclang-0.3.0/src/lclang/cli/context.py +45 -0
  144. lclang-0.3.0/src/lclang/cli/entrance.py +49 -0
  145. lclang-0.3.0/src/lclang/cli/help.py +120 -0
  146. lclang-0.3.0/src/lclang/cli/logging.py +97 -0
  147. lclang-0.3.0/src/lclang/cli/models.py +210 -0
  148. lclang-0.3.0/src/lclang/cli/parser.py +207 -0
  149. lclang-0.3.0/src/lclang/cli/process.py +48 -0
  150. lclang-0.3.0/src/lclang/cli/routing.py +104 -0
  151. lclang-0.3.0/src/lclang/cli/run.py +197 -0
  152. lclang-0.3.0/src/lclang/cli/validation.py +92 -0
  153. lclang-0.3.0/src/lclang/config/__init__.py +43 -0
  154. lclang-0.3.0/src/lclang/config/api.py +74 -0
  155. lclang-0.3.0/src/lclang/config/declarations.py +124 -0
  156. lclang-0.3.0/src/lclang/config/errors.py +63 -0
  157. lclang-0.3.0/src/lclang/config/expressions.py +123 -0
  158. lclang-0.3.0/src/lclang/config/files.py +79 -0
  159. lclang-0.3.0/src/lclang/config/limits.py +41 -0
  160. lclang-0.3.0/src/lclang/config/lines.py +160 -0
  161. lclang-0.3.0/src/lclang/config/loader.py +196 -0
  162. lclang-0.3.0/src/lclang/config/model.py +114 -0
  163. lclang-0.3.0/src/lclang/config/parser.py +137 -0
  164. lclang-0.3.0/src/lclang/config/positions.py +79 -0
  165. lclang-0.3.0/src/lclang/config/protocols.py +34 -0
  166. lclang-0.3.0/src/lclang/config/result.py +91 -0
  167. lclang-0.3.0/src/lclang/config/sources.py +109 -0
  168. lclang-0.3.0/src/lclang/errors.py +172 -0
  169. lclang-0.3.0/src/lclang/lang/__init__.py +16 -0
  170. lclang-0.3.0/src/lclang/lang/evaluator/__init__.py +15 -0
  171. lclang-0.3.0/src/lclang/lang/evaluator/_types.py +8 -0
  172. lclang-0.3.0/src/lclang/lang/evaluator/awaitables.py +23 -0
  173. lclang-0.3.0/src/lclang/lang/evaluator/budget.py +137 -0
  174. lclang-0.3.0/src/lclang/lang/evaluator/calls.py +93 -0
  175. lclang-0.3.0/src/lclang/lang/evaluator/comprehensions.py +164 -0
  176. lclang-0.3.0/src/lclang/lang/evaluator/context.py +90 -0
  177. lclang-0.3.0/src/lclang/lang/evaluator/contexts.py +108 -0
  178. lclang-0.3.0/src/lclang/lang/evaluator/definition_context.py +76 -0
  179. lclang-0.3.0/src/lclang/lang/evaluator/dispatch.py +180 -0
  180. lclang-0.3.0/src/lclang/lang/evaluator/displays.py +107 -0
  181. lclang-0.3.0/src/lclang/lang/evaluator/errors.py +157 -0
  182. lclang-0.3.0/src/lclang/lang/evaluator/fstrings.py +69 -0
  183. lclang-0.3.0/src/lclang/lang/evaluator/function_arguments.py +138 -0
  184. lclang-0.3.0/src/lclang/lang/evaluator/functions.py +115 -0
  185. lclang-0.3.0/src/lclang/lang/evaluator/iteration.py +27 -0
  186. lclang-0.3.0/src/lclang/lang/evaluator/logical.py +71 -0
  187. lclang-0.3.0/src/lclang/lang/evaluator/operations.py +105 -0
  188. lclang-0.3.0/src/lclang/lang/evaluator/primaries.py +70 -0
  189. lclang-0.3.0/src/lclang/lang/evaluator/sync.py +32 -0
  190. lclang-0.3.0/src/lclang/lang/lexer/__init__.py +6 -0
  191. lclang-0.3.0/src/lclang/lang/lexer/escapes.py +191 -0
  192. lclang-0.3.0/src/lclang/lang/lexer/fstring_values.py +67 -0
  193. lclang-0.3.0/src/lclang/lang/lexer/fstrings.py +301 -0
  194. lclang-0.3.0/src/lclang/lang/lexer/literals.py +200 -0
  195. lclang-0.3.0/src/lclang/lang/lexer/scanner.py +290 -0
  196. lclang-0.3.0/src/lclang/lang/lexer/tokens.py +95 -0
  197. lclang-0.3.0/src/lclang/lang/parser/__init__.py +5 -0
  198. lclang-0.3.0/src/lclang/lang/parser/atoms.py +101 -0
  199. lclang-0.3.0/src/lclang/lang/parser/bindings.py +21 -0
  200. lclang-0.3.0/src/lclang/lang/parser/comprehensions.py +112 -0
  201. lclang-0.3.0/src/lclang/lang/parser/control_forms.py +191 -0
  202. lclang-0.3.0/src/lclang/lang/parser/displays.py +311 -0
  203. lclang-0.3.0/src/lclang/lang/parser/forms.py +230 -0
  204. lclang-0.3.0/src/lclang/lang/parser/fstrings.py +97 -0
  205. lclang-0.3.0/src/lclang/lang/parser/logical.py +268 -0
  206. lclang-0.3.0/src/lclang/lang/parser/pratt.py +222 -0
  207. lclang-0.3.0/src/lclang/lang/parser/primaries.py +294 -0
  208. lclang-0.3.0/src/lclang/lang/parser/stream.py +100 -0
  209. lclang-0.3.0/src/lclang/lang/printer/__init__.py +5 -0
  210. lclang-0.3.0/src/lclang/lang/printer/_types.py +8 -0
  211. lclang-0.3.0/src/lclang/lang/printer/atoms.py +105 -0
  212. lclang-0.3.0/src/lclang/lang/printer/collections.py +133 -0
  213. lclang-0.3.0/src/lclang/lang/printer/dispatch.py +56 -0
  214. lclang-0.3.0/src/lclang/lang/printer/expressions.py +102 -0
  215. lclang-0.3.0/src/lclang/lang/printer/forms.py +114 -0
  216. lclang-0.3.0/src/lclang/lang/printer/primaries.py +104 -0
  217. lclang-0.3.0/src/lclang/py.typed +1 -0
  218. lclang-0.3.0/src/lclang/runtime/__init__.py +57 -0
  219. lclang-0.3.0/src/lclang/runtime/dependency/__init__.py +1 -0
  220. lclang-0.3.0/src/lclang/runtime/dependency/analysis.py +201 -0
  221. lclang-0.3.0/src/lclang/runtime/dependency/frame/__init__.py +1 -0
  222. lclang-0.3.0/src/lclang/runtime/dependency/frame/builder.py +144 -0
  223. lclang-0.3.0/src/lclang/runtime/dependency/frame/model.py +199 -0
  224. lclang-0.3.0/src/lclang/runtime/dependency/frame/resolution.py +83 -0
  225. lclang-0.3.0/src/lclang/runtime/dependency/graph.py +185 -0
  226. lclang-0.3.0/src/lclang/runtime/dependency/model.py +80 -0
  227. lclang-0.3.0/src/lclang/runtime/dependency/ordering.py +120 -0
  228. lclang-0.3.0/src/lclang/runtime/dependency/reconciliation.py +64 -0
  229. lclang-0.3.0/src/lclang/runtime/dependency/snapshot.py +46 -0
  230. lclang-0.3.0/src/lclang/runtime/dependency/tracing.py +97 -0
  231. lclang-0.3.0/src/lclang/runtime/frame/__init__.py +17 -0
  232. lclang-0.3.0/src/lclang/runtime/frame/closing.py +48 -0
  233. lclang-0.3.0/src/lclang/runtime/frame/core.py +135 -0
  234. lclang-0.3.0/src/lclang/runtime/frame/dependencies.py +129 -0
  235. lclang-0.3.0/src/lclang/runtime/frame/derivation.py +49 -0
  236. lclang-0.3.0/src/lclang/runtime/frame/evaluation.py +144 -0
  237. lclang-0.3.0/src/lclang/runtime/frame/factory.py +103 -0
  238. lclang-0.3.0/src/lclang/runtime/frame/flights.py +54 -0
  239. lclang-0.3.0/src/lclang/runtime/frame/inspection.py +169 -0
  240. lclang-0.3.0/src/lclang/runtime/frame/inspector.py +190 -0
  241. lclang-0.3.0/src/lclang/runtime/frame/lifecycle.py +144 -0
  242. lclang-0.3.0/src/lclang/runtime/frame/limits.py +87 -0
  243. lclang-0.3.0/src/lclang/runtime/frame/lookup.py +81 -0
  244. lclang-0.3.0/src/lclang/runtime/frame/recalculation.py +60 -0
  245. lclang-0.3.0/src/lclang/runtime/frame/values.py +68 -0
  246. lclang-0.3.0/src/lclang/runtime/modules.py +38 -0
  247. lclang-0.3.0/src/lclang/runtime/presets.py +56 -0
  248. lclang-0.3.0/src/lclang/source.py +93 -0
  249. lclang-0.3.0/src/lclang/stdlib/__init__.py +29 -0
  250. lclang-0.3.0/src/lclang/stdlib/builtins.py +45 -0
  251. lclang-0.3.0/src/lclang/stdlib/data.py +41 -0
  252. lclang-0.3.0/src/lclang/stdlib/dates.py +36 -0
  253. lclang-0.3.0/src/lclang/stdlib/iterables.py +34 -0
  254. lclang-0.3.0/src/lclang/stdlib/json_values.py +41 -0
  255. lclang-0.3.0/src/lclang/stdlib/manifest.py +89 -0
  256. lclang-0.3.0/src/lclang/stdlib/namespaces.py +106 -0
  257. lclang-0.3.0/src/lclang/stdlib/recursion.py +64 -0
  258. lclang-0.3.0/src/lclang/stdlib/text.py +44 -0
  259. lclang-0.3.0/src/lclang/types.py +15 -0
  260. lclang-0.3.0/src/lclang/version.py +17 -0
  261. lclang-0.3.0/src/lclang/workflow/__init__.py +13 -0
  262. lclang-0.3.0/src/lclang/workflow/finalization.py +107 -0
  263. lclang-0.3.0/src/lclang/workflow/manager.py +164 -0
  264. lclang-0.3.0/src/lclang/workflow/models.py +125 -0
  265. lclang-0.3.0/src/lclang/workflow/steps.py +102 -0
  266. lclang-0.3.0/tests/__init__.py +1 -0
  267. lclang-0.3.0/tests/ast/__init__.py +1 -0
  268. lclang-0.3.0/tests/ast/test_base.py +46 -0
  269. lclang-0.3.0/tests/ast/test_call_arguments.py +40 -0
  270. lclang-0.3.0/tests/ast/test_comprehensions.py +56 -0
  271. lclang-0.3.0/tests/ast/test_control_forms.py +52 -0
  272. lclang-0.3.0/tests/ast/test_displays.py +33 -0
  273. lclang-0.3.0/tests/ast/test_expressions.py +57 -0
  274. lclang-0.3.0/tests/ast/test_forms.py +41 -0
  275. lclang-0.3.0/tests/ast/test_fstrings.py +37 -0
  276. lclang-0.3.0/tests/ast/test_operators.py +17 -0
  277. lclang-0.3.0/tests/ast/test_primaries.py +30 -0
  278. lclang-0.3.0/tests/cli/__init__.py +1 -0
  279. lclang-0.3.0/tests/cli/platform_support.py +69 -0
  280. lclang-0.3.0/tests/cli/test_binding.py +148 -0
  281. lclang-0.3.0/tests/cli/test_builtin_docs.py +88 -0
  282. lclang-0.3.0/tests/cli/test_commands.py +163 -0
  283. lclang-0.3.0/tests/cli/test_context_entrance.py +68 -0
  284. lclang-0.3.0/tests/cli/test_logging.py +47 -0
  285. lclang-0.3.0/tests/cli/test_models.py +98 -0
  286. lclang-0.3.0/tests/cli/test_module_entrance.py +351 -0
  287. lclang-0.3.0/tests/cli/test_parser.py +141 -0
  288. lclang-0.3.0/tests/cli/test_platform.py +97 -0
  289. lclang-0.3.0/tests/cli/test_process.py +32 -0
  290. lclang-0.3.0/tests/cli/test_public_api.py +25 -0
  291. lclang-0.3.0/tests/cli/test_routing_help.py +91 -0
  292. lclang-0.3.0/tests/cli/test_run.py +343 -0
  293. lclang-0.3.0/tests/cli/test_tutorial.py +35 -0
  294. lclang-0.3.0/tests/cli/test_validation.py +24 -0
  295. lclang-0.3.0/tests/config/support.py +43 -0
  296. lclang-0.3.0/tests/config/test_api.py +99 -0
  297. lclang-0.3.0/tests/config/test_documentation.py +42 -0
  298. lclang-0.3.0/tests/config/test_files.py +29 -0
  299. lclang-0.3.0/tests/config/test_limits.py +12 -0
  300. lclang-0.3.0/tests/config/test_lines.py +39 -0
  301. lclang-0.3.0/tests/config/test_loader.py +309 -0
  302. lclang-0.3.0/tests/config/test_model.py +33 -0
  303. lclang-0.3.0/tests/config/test_parser.py +126 -0
  304. lclang-0.3.0/tests/config/test_sources.py +43 -0
  305. lclang-0.3.0/tests/config/test_stress.py +83 -0
  306. lclang-0.3.0/tests/lang/__init__.py +1 -0
  307. lclang-0.3.0/tests/lang/evaluator/__init__.py +1 -0
  308. lclang-0.3.0/tests/lang/evaluator/context_support.py +81 -0
  309. lclang-0.3.0/tests/lang/evaluator/test_awaitables.py +25 -0
  310. lclang-0.3.0/tests/lang/evaluator/test_budget.py +16 -0
  311. lclang-0.3.0/tests/lang/evaluator/test_calls.py +139 -0
  312. lclang-0.3.0/tests/lang/evaluator/test_comprehensions.py +184 -0
  313. lclang-0.3.0/tests/lang/evaluator/test_context.py +40 -0
  314. lclang-0.3.0/tests/lang/evaluator/test_contexts.py +143 -0
  315. lclang-0.3.0/tests/lang/evaluator/test_definition_context.py +83 -0
  316. lclang-0.3.0/tests/lang/evaluator/test_dispatch.py +84 -0
  317. lclang-0.3.0/tests/lang/evaluator/test_displays.py +85 -0
  318. lclang-0.3.0/tests/lang/evaluator/test_errors.py +188 -0
  319. lclang-0.3.0/tests/lang/evaluator/test_fstrings.py +73 -0
  320. lclang-0.3.0/tests/lang/evaluator/test_function_arguments.py +63 -0
  321. lclang-0.3.0/tests/lang/evaluator/test_functions.py +164 -0
  322. lclang-0.3.0/tests/lang/evaluator/test_iteration.py +75 -0
  323. lclang-0.3.0/tests/lang/evaluator/test_logical.py +104 -0
  324. lclang-0.3.0/tests/lang/evaluator/test_operations.py +139 -0
  325. lclang-0.3.0/tests/lang/evaluator/test_primaries.py +72 -0
  326. lclang-0.3.0/tests/lang/evaluator/test_sync.py +32 -0
  327. lclang-0.3.0/tests/lang/lexer/__init__.py +1 -0
  328. lclang-0.3.0/tests/lang/lexer/test_escapes.py +21 -0
  329. lclang-0.3.0/tests/lang/lexer/test_fstring_values.py +15 -0
  330. lclang-0.3.0/tests/lang/lexer/test_fstrings.py +111 -0
  331. lclang-0.3.0/tests/lang/lexer/test_literals.py +135 -0
  332. lclang-0.3.0/tests/lang/lexer/test_scanner.py +126 -0
  333. lclang-0.3.0/tests/lang/lexer/test_tokens.py +26 -0
  334. lclang-0.3.0/tests/lang/parser/__init__.py +1 -0
  335. lclang-0.3.0/tests/lang/parser/test_atoms.py +56 -0
  336. lclang-0.3.0/tests/lang/parser/test_comprehensions.py +113 -0
  337. lclang-0.3.0/tests/lang/parser/test_control_forms.py +86 -0
  338. lclang-0.3.0/tests/lang/parser/test_displays.py +91 -0
  339. lclang-0.3.0/tests/lang/parser/test_forms.py +87 -0
  340. lclang-0.3.0/tests/lang/parser/test_fstrings.py +69 -0
  341. lclang-0.3.0/tests/lang/parser/test_logical.py +97 -0
  342. lclang-0.3.0/tests/lang/parser/test_pratt.py +86 -0
  343. lclang-0.3.0/tests/lang/parser/test_primaries.py +107 -0
  344. lclang-0.3.0/tests/lang/parser/test_stream.py +52 -0
  345. lclang-0.3.0/tests/lang/printer/__init__.py +1 -0
  346. lclang-0.3.0/tests/lang/printer/test_atoms.py +59 -0
  347. lclang-0.3.0/tests/lang/printer/test_collections.py +34 -0
  348. lclang-0.3.0/tests/lang/printer/test_dispatch.py +28 -0
  349. lclang-0.3.0/tests/lang/printer/test_expressions.py +27 -0
  350. lclang-0.3.0/tests/lang/printer/test_forms.py +30 -0
  351. lclang-0.3.0/tests/lang/printer/test_primaries.py +43 -0
  352. lclang-0.3.0/tests/release/__init__.py +1 -0
  353. lclang-0.3.0/tests/release/support.py +60 -0
  354. lclang-0.3.0/tests/release/test_artifacts.py +49 -0
  355. lclang-0.3.0/tests/release/test_clean_install.py +26 -0
  356. lclang-0.3.0/tests/release/test_release_candidate.py +39 -0
  357. lclang-0.3.0/tests/runtime/__init__.py +1 -0
  358. lclang-0.3.0/tests/runtime/dependency/__init__.py +1 -0
  359. lclang-0.3.0/tests/runtime/dependency/frame/__init__.py +1 -0
  360. lclang-0.3.0/tests/runtime/dependency/frame/test_builder.py +144 -0
  361. lclang-0.3.0/tests/runtime/dependency/frame/test_model.py +138 -0
  362. lclang-0.3.0/tests/runtime/dependency/test_analysis.py +125 -0
  363. lclang-0.3.0/tests/runtime/dependency/test_graph.py +74 -0
  364. lclang-0.3.0/tests/runtime/dependency/test_model.py +55 -0
  365. lclang-0.3.0/tests/runtime/dependency/test_ordering.py +76 -0
  366. lclang-0.3.0/tests/runtime/dependency/test_reconciliation.py +72 -0
  367. lclang-0.3.0/tests/runtime/dependency/test_snapshot.py +55 -0
  368. lclang-0.3.0/tests/runtime/dependency/test_tracing.py +71 -0
  369. lclang-0.3.0/tests/runtime/frame/__init__.py +1 -0
  370. lclang-0.3.0/tests/runtime/frame/lifecycle_support.py +71 -0
  371. lclang-0.3.0/tests/runtime/frame/test_cancellation.py +58 -0
  372. lclang-0.3.0/tests/runtime/frame/test_core.py +200 -0
  373. lclang-0.3.0/tests/runtime/frame/test_dependencies.py +146 -0
  374. lclang-0.3.0/tests/runtime/frame/test_derivation.py +76 -0
  375. lclang-0.3.0/tests/runtime/frame/test_factory.py +117 -0
  376. lclang-0.3.0/tests/runtime/frame/test_flights.py +138 -0
  377. lclang-0.3.0/tests/runtime/frame/test_inspection.py +459 -0
  378. lclang-0.3.0/tests/runtime/frame/test_integration_comprehensions.py +32 -0
  379. lclang-0.3.0/tests/runtime/frame/test_lifecycle.py +171 -0
  380. lclang-0.3.0/tests/runtime/frame/test_limits.py +119 -0
  381. lclang-0.3.0/tests/runtime/frame/test_lookup.py +67 -0
  382. lclang-0.3.0/tests/runtime/frame/test_recalculation.py +152 -0
  383. lclang-0.3.0/tests/runtime/frame/test_recalculation_flights.py +104 -0
  384. lclang-0.3.0/tests/runtime/frame/test_values.py +78 -0
  385. lclang-0.3.0/tests/runtime/test_modules.py +36 -0
  386. lclang-0.3.0/tests/runtime/test_presets.py +56 -0
  387. lclang-0.3.0/tests/stdlib/test_builtins.py +61 -0
  388. lclang-0.3.0/tests/stdlib/test_data.py +35 -0
  389. lclang-0.3.0/tests/stdlib/test_dates.py +52 -0
  390. lclang-0.3.0/tests/stdlib/test_iterables.py +64 -0
  391. lclang-0.3.0/tests/stdlib/test_json_values.py +24 -0
  392. lclang-0.3.0/tests/stdlib/test_manifest.py +46 -0
  393. lclang-0.3.0/tests/stdlib/test_namespaces.py +92 -0
  394. lclang-0.3.0/tests/stdlib/test_recursion.py +99 -0
  395. lclang-0.3.0/tests/stdlib/test_text.py +38 -0
  396. lclang-0.3.0/tests/test_api.py +167 -0
  397. lclang-0.3.0/tests/test_errors.py +67 -0
  398. lclang-0.3.0/tests/test_package_metadata.py +48 -0
  399. lclang-0.3.0/tests/test_public_api.py +20 -0
  400. lclang-0.3.0/tests/test_quality_configuration.py +90 -0
  401. lclang-0.3.0/tests/test_quality_script.py +127 -0
  402. lclang-0.3.0/tests/test_runtime_public_api.py +69 -0
  403. lclang-0.3.0/tests/test_types_and_sources.py +61 -0
  404. lclang-0.3.0/tests/workflow/test_public_api.py +14 -0
  405. lclang-0.3.0/tests/workflow/test_status.py +218 -0
  406. lclang-0.3.0/tests/workflow/test_step_scope.py +110 -0
  407. lclang-0.3.0/tests/workflow/test_tutorial.py +29 -0
@@ -0,0 +1,11 @@
1
+ /.coverage
2
+ /.mypy_cache/
3
+ /.pytest_cache/
4
+ /pytest-cache-files-*/
5
+ /.ruff_cache/
6
+ /build/
7
+ /dist/
8
+ /*.egg-info/
9
+ **/__pycache__/
10
+ *.py[cod]
11
+ /.codex_tmp/
lclang-0.3.0/AGENTS.md ADDED
@@ -0,0 +1,66 @@
1
+ # lclang Agent Handoff
2
+
3
+ Read this file, `progress.md`, the active milestone specification, and both
4
+ README files before changing the project.
5
+
6
+ ## Project identity
7
+
8
+ - Distribution and import name: `lclang`.
9
+ - Production package root: `src/lclang`.
10
+ - Runtime: Python 3.14 or newer; no third-party runtime dependencies.
11
+ - License: MIT.
12
+ - Target: complete and verify the 0.4 release described in `progress.md`.
13
+ - Security model: trusted configuration language, not a hostile-code sandbox.
14
+
15
+ ## Non-negotiable architecture
16
+
17
+ - The parser is a pure-Python lexer plus Pratt/recursive-descent parser.
18
+ - Execution uses the custom AST interpreter only. Do not add ANTLR, Java,
19
+ `eval`, `exec`, Python-AST compilation, or a bytecode backend.
20
+ - Public evaluation is async-first. `evaluate_sync` is the only synchronous
21
+ convenience boundary.
22
+ - No class or function name can start with an underscore.
23
+ - A `Frame` is safe for concurrent tasks in one event loop, not across loops.
24
+ - Cached values are snapshots. Recalculation never invalidates dependants.
25
+ - Source files must stay below 200 lines, excluding docstrings and imports. Split modules by responsibility.
26
+ - Every production docstring is English rST. All functions and methods (including private ones)
27
+ document how it works, and every parameter with `:param name:`, their result with `:returns:` unless no return or `None`,
28
+ every intentional exception with `:raises Type:`, and genuinely useful special
29
+ behaviour with an rST `.. note::`. Do not add notes that merely restate the
30
+ declaration, owning subsystem, or ordinary lifecycle. All value classes
31
+ (including private ones) document constructor fields
32
+ and edge cases with the same conventions.
33
+ - A Comment for each constant values to describe it.
34
+ - In unittest, mock any external connectivities, and use separated TemporaryDirectory to hold file input and outputs.
35
+ - CLI unittest configuration sources are static fixtures declared with their test
36
+ cases. Every enabled log file is rooted in a per-test temporary directory that
37
+ is cleaned automatically.
38
+
39
+ Runtime packages and tests follow `docs/architecture/module-layout.md`. Tests
40
+ mirror production subsystem boundaries; reusable fixtures live in dedicated
41
+ support modules rather than unrelated test files.
42
+
43
+ ## Required workflow
44
+
45
+ For every implementation milestone:
46
+
47
+ 1. Write or update its English specification in `docs/specs/`.
48
+ 2. Add a behavioural test and run it to prove RED, test must include practical and meaningful sunny, rainy, composite-complex cases.
49
+ 3. Implement the smallest correct behaviour and prove GREEN.
50
+ 4. Refactor, then run milestone and full quality checks.
51
+ 5. Update `README.md`, `README_cn.md`, and `progress.md`.
52
+ 6. Mark `DONE` only with commands and evidence recorded in `progress.md`.
53
+
54
+ For a bug, reproduce it with a failing test before fixing it. Documentation-only
55
+ milestones use link, metadata, or structural checks rather than artificial unit
56
+ test failures.
57
+
58
+ ## Sources of truth
59
+
60
+ - `progress.md`: current work, status, evidence, and release gates.
61
+ - `docs/specs/`: behaviour and public contracts.
62
+ - `README.md` and `README_cn.md`: user-visible implemented capability only.
63
+ - `pyproject.toml`: supported Python and tool configuration.
64
+
65
+ Do not advertise planned behaviour as implemented. Preserve unrelated user
66
+ changes. Update this file only when durable architecture or workflow changes.
@@ -0,0 +1,125 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ - Renamed the distribution and import package to `lclang`, moved production
6
+ code to `src/lclang`, and migrated packaging, CI, tests, and documentation.
7
+ - Added ordered workflow execution-status trees, shared sub-task manager cursors,
8
+ deterministic parent aggregation, subtree locking, and synchronous scoped
9
+ finalization that records exceptions without suppressing them.
10
+ - Added scoped step handles that begin running, accept atomic description/status
11
+ updates, succeed on clean exit, and record errors without suppressing them.
12
+ - Raised the enforced project gate to 100% branch coverage and added behavioral
13
+ assertions for every previously uncovered statement and branch.
14
+ - Manually malformed call, dictionary-display, and dictionary-comprehension AST
15
+ wrapper values now fail explicitly instead of being silently ignored.
16
+
17
+ ## 0.3.0 release candidate — 2026-08-09
18
+
19
+ - Added immutable CLI parameters, results, contexts, and logging configuration
20
+ through the focused `lclang.cli` public API without expanding the package root.
21
+ - Added exact async command decorators, nested snake_case groups, full Python
22
+ executable/script argv parsing, command routing, and dependency-free structured help.
23
+ - Added lazy preset/default/config/override/runtime Frame layering, strict as-of
24
+ dates, literal and deferred `LCL[...]` overrides, required presence checks,
25
+ handler-owned dryrun behavior, isolated UTF-8 logging, and deterministic cleanup.
26
+ - Added executable English and Chinese Python-script CLI tutorials, static config
27
+ fixture guidance, temporary-log testing, platform cases, and clean-install CLI smokes.
28
+ - Added `CliResult.success`/`fail` shortcuts and executable `python -m lclang.cli`
29
+ commands for non-evaluating `RESULT` inspection and lazy result evaluation.
30
+ - Literal and malformed-marker CLI overrides now remain external-provided string
31
+ bindings; only successfully parsed `LCL[...]` values become lazy definitions.
32
+ - Dependency inspection now classifies canonical reviewed builtins/namespaces as
33
+ `NativeProvided`, with stable address-free callable and concise namespace reprs.
34
+ - Native inspection payloads now use uniform `Builtin Function: name` and
35
+ `Builtin Namespace: name` syntax. Structured evaluation failures include the
36
+ direct-to-failing variable owner stack, including lexical LCL function calls.
37
+ - Valueless `-o/--override KEY` now stores boolean `True`, and a following
38
+ override option can no longer be consumed as a value. `parse_lcl -o EVAL`
39
+ evaluates `RESULT` first and renders either its successful or failed cache tree.
40
+ - Dependency-tree values that are supported `LclAstNode` objects or evaluated
41
+ LCL function closures now render with canonical LCL expressions instead of
42
+ nested dataclass, closure, resolver, evaluator, and source-span reprs.
43
+ - Added the native `recursive(builder)` builtin, a Python variadic eager Z
44
+ combinator for defining recursive LCL functions without supplying an LCL
45
+ combinator; its results use stable `Recursive Function: <source-or-name>`
46
+ reprs, and the original LCL Y/Z examples remain supported and documented.
47
+ - Added `python -m lclang.cli builtins` with sorted one-line descriptions and
48
+ manifest-ordered, two-space-indented methods beneath builtin namespaces.
49
+ - Iterable items are now recursively awaited at the shared sync/async iteration
50
+ boundary, fixing Python `map` with async LCL functions in starred displays,
51
+ comprehensions, call expansion, and reviewed iterable helpers.
52
+
53
+ ## 0.2.0 release candidate — 2026-08-08
54
+
55
+ - `Frame` now accepts a string or omitted ID, defaulting direct construction to
56
+ `frame-<module name>`, and the complete subsystem now lives under
57
+ `lclang.runtime.frame`.
58
+ - Added side-effect-free `Frame.inspect_variable()` trees with cache/host state,
59
+ selected definitions, exact lookup paths, owners, dependency branches,
60
+ finite cycle rendering, compact reprs, and markdown-style lines.
61
+ - Inspection trees now collapse repeated direct dependency names in first-seen
62
+ order while retaining the same variable independently on separate branches;
63
+ graphs, traces, and snapshots remain occurrence-preserving.
64
+ - Refined inspection's source-oriented repr to
65
+ `name@frame/path: [definition ](Status) typed-payload`: ASTs have clear status
66
+ spacing, external values omit definition text, values render as `type: repr`,
67
+ and errors render as `ErrorType: message`.
68
+ - Made `lhs()` lexical inside LCL function values, so call arguments retain the
69
+ caller owner while function bodies retain their defining variable name.
70
+ - `evaluate_sync` now accepts expression source text directly, and
71
+ `FrameFactory.create()` defaults its ID to `frame-<module name>`.
72
+ - Added a complete dependency analytics tutorial and reorganized internal
73
+ analytics into `runtime/dependency/`, including nested Frame graph modules;
74
+ redundant evaluator/printer/config filenames now describe their contents.
75
+
76
+ - Added definition-scoped `lhs()` in `LCL_ROOT` and strict locale-independent
77
+ `parse_ymd`/`to_ymd` calendar conversion in `LCL_BUILTINS`.
78
+ - Extended dependency graph construction to accept a Frame and report qualified
79
+ definition/value bindings, exact lookup paths, and unresolved references
80
+ without evaluating or touching runtime traces.
81
+ - Added reusable default-parent policy to `FrameFactory`; configuration-created
82
+ Frames now use the canonical root/builtin hierarchy by default.
83
+
84
+ - Replaced the oversized user cheatsheet and legacy runtime quickstarts with an
85
+ English tutorial path covering installation, Modules and Frames, the complete
86
+ LCL feature gallery, fixed-point recursion, quicksort, and `.lclcfg`
87
+ integration through executable examples.
88
+
89
+ - Added UTF-8 `.lclcfg` parsing with optional version metadata, colon
90
+ definitions, comments, explicit backslash continuation, and eager
91
+ source-file magic constants.
92
+ - Added async path-backed `using` expansion with deterministic later-wins
93
+ precedence, complete shadow history, cycle detection, loading limits,
94
+ single-flight caching, cancellation isolation, and filesystem containment.
95
+ - Added the curated `lclang.config` parsing/loading API and runtime Module,
96
+ FrameFactory, and guaranteed-cleanup evaluation bridge.
97
+
98
+ - Added the preferred `define_module` and `define_frame` construction shortcuts
99
+ with the explicit `LCL_ROOT -> LCL_BUILTINS -> LCL_RUNTIME -> LCL_IMPORTS ->
100
+ user module` lookup hierarchy.
101
+ - Added non-evaluating `Frame.has` and `Frame.get_definition` inspection backed
102
+ by the same recursive owner-selection rule as `Frame.get`.
103
+ - Added `Frame.derive` as the preferred concise constructor for independent
104
+ child Frames with detached local values.
105
+ - Added atomic right-biased `Frame.mixin` host-value updates while preserving
106
+ cached definition snapshots until explicit recalculation.
107
+
108
+ ## 0.1.0 release candidate — 2026-08-06
109
+
110
+ The first released `lclang` language/runtime surface includes:
111
+
112
+ - a pure-Python, versioned expression grammar with immutable AST values,
113
+ canonical printing, comprehensions, functions, closures, errors, and context
114
+ management;
115
+ - an async-first evaluator with a synchronous convenience boundary, hierarchical
116
+ Frame caching, dependency inspection, recalculation, limits, cancellation
117
+ isolation, and deterministic cleanup;
118
+ - immutable modules, presets, reusable Frame factories, dependency graphs, and
119
+ a reviewed standard preset with `iter`, `text`, `data`, and `json` namespaces;
120
+ - bilingual tutorials, API guidance, and executable examples;
121
+ - zero-dependency runtime packaging for Python 3.14+ with a platform-independent
122
+ wheel and source distribution release gate.
123
+
124
+ `lclang` is intended for trusted application configuration. It is not a hostile-
125
+ code sandbox; host-provided values and callables retain ordinary Python powers.
lclang-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 lclang contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
lclang-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.4
2
+ Name: lclang
3
+ Version: 0.3.0
4
+ Summary: A typed, async-first configuration expression language
5
+ Project-URL: Documentation, https://jihulab.com/midnightprotocol/lclang/-/tree/main/docs
6
+ Project-URL: Issues, https://jihulab.com/midnightprotocol/lclang/-/work_items
7
+ Project-URL: Source, https://jihulab.com/midnightprotocol/lclang
8
+ Author: RuntimeRomance
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.14
18
+ Description-Content-Type: text/markdown
19
+
20
+ # lclang
21
+
22
+ [中文说明](README_cn.md)
23
+
24
+ `lclang` is a pure-Python, async-first configuration expression language for
25
+ Python 3.14+. The 0.3.0 language, runtime, `.lclcfg`, and typed CLI release candidate is
26
+ verified; publication is a separate maintainer action. See
27
+ [CHANGELOG.md](CHANGELOG.md).
28
+
29
+ The distribution and import name is `lclang`; production code lives under
30
+ `src/lclang`.
31
+
32
+ ## Project status
33
+
34
+ - Target: 0.4.0 development release
35
+ - Latest completed milestone: M008 — `lclang` identity and `src` package layout
36
+ - Next planned milestone: M100 — trusted-input security boundary audit
37
+ - Implemented: foundation, enforced English rST API docs, source-aware lexer,
38
+ immutable AST, complete expression/comprehension parsing, all planned V1
39
+ expression forms, deterministic AST-to-source rendering, semantic f-string
40
+ parsing, stable root parse/print APIs, async expression evaluation with
41
+ recursively awaited sync/async iterable items, lexical
42
+ closures, structured failures, assertions, try recovery, finalization, and
43
+ synchronous/asynchronous context management, semantic f-string evaluation,
44
+ immutable runtime modules, and hierarchical single-flight Frame caching with
45
+ structured cycle detection, cancellation isolation, and atomic targeted
46
+ recalculation without dependant invalidation, plus task-local depth, work, and
47
+ materialized-collection limits, deterministic Frame close/resource cleanup,
48
+ scope-aware eager/conditional/deferred dependency analysis, immutable module
49
+ dependency graphs, filtered queries, deterministic topological ordering,
50
+ bounded runtime lookup tracing, static/dynamic edge reconciliation, and
51
+ owner-aware immutable Frame dependency snapshots with atomic refresh semantics,
52
+ plus shallow immutable host presets, reusable independent Frame factories,
53
+ manifest-driven read-only attribute namespaces, and reviewed async iterable,
54
+ text, immutable data, and strict JSON helpers in a standard preset, exposed
55
+ through a focused root API for the complete runtime workflow, plus preferred
56
+ source-string `define_module`/`define_frame` shortcuts and the canonical
57
+ `LCL_ROOT -> LCL_BUILTINS -> LCL_RUNTIME -> LCL_IMPORTS -> user` hierarchy,
58
+ preferred `Frame.derive` child construction, non-evaluating `has` and
59
+ `get_definition` lookup inspection, side-effect-free `inspect_variable`
60
+ dependency trees with first-seen direct-name deduplication and source-oriented
61
+ one-line representations with typed value/error payloads, including canonical
62
+ `<node-type>: <LCL expression>` payloads for AST values and canonical source
63
+ reprs for evaluated LCL function closures, plus controlled
64
+ right-biased `Frame.mixin`
65
+ host-value updates, definition-scoped `lhs()`, strict `YYYYMMDD` date builtins,
66
+ the native variadic fixed-point builtin `recursive`,
67
+ and non-evaluating Frame-qualified dependency graphs with value terminals and
68
+ lookup paths, lexical closure ownership for `lhs()`, source-string
69
+ `evaluate_sync`, deterministic direct/FrameFactory IDs, and a dependency
70
+ analytics tutorial backed by audited nested dependency and Frame packages,
71
+ plus immutable CLI values, exact async command decorators, nested snake_case
72
+ groups, full-argv parsing, structured help, lazy preset/default/config/override
73
+ Frame layering, handler-owned dryrun, isolated logging, result/cleanup mapping,
74
+ concise `CliResult.success`/`fail` constructors, valueless override keys as
75
+ boolean `True`, and built-in `parse_lcl` with optional evaluated inspection,
76
+ lazy `eval_lcl`, and deterministic nested `builtins` module commands, with canonical lclang
77
+ builtins and standard namespaces identified as `NativeProvided` and rendered
78
+ uniformly as `Builtin Function` or `Builtin Namespace`, plus structured
79
+ failures carrying direct-to-failing variable evaluation stacks, plus ordered
80
+ workflow execution-status trees, shared sub-task manager cursors, deterministic
81
+ parent aggregation, subtree locking, exception-transparent `with` finalization,
82
+ and scoped steps with atomic description/status updates and clean auto-success,
83
+ packaged with the `lclang` identity from the `src/lclang` source tree
84
+ - Test status: 844 tests pass at 100.00% branch coverage; strict mypy, Ruff,
85
+ exhaustive source/docstring policy, executable documentation, and artifact
86
+ gates pass
87
+
88
+ The authoritative milestone ledger is in [progress.md](progress.md). Planned
89
+ features are deliberately not presented as implemented features.
90
+
91
+ ## Quickstart
92
+
93
+ Run from a checkout with its development environment installed. The example is
94
+ extracted and executed by the test suite.
95
+
96
+ ```python
97
+ import asyncio
98
+
99
+ import lclang
100
+
101
+
102
+ async def main() -> None:
103
+ module = lclang.define_module(
104
+ "quickstart",
105
+ {"result": 'json.encode({"message": "hello lclang"})'},
106
+ )
107
+ frame = lclang.define_frame(module)
108
+ try:
109
+ print(await frame.get("result"))
110
+ snapshot = frame.dependency_snapshot("result")
111
+ print(",".join(str(edge.target) for edge in snapshot.dynamic_edges))
112
+ finally:
113
+ await frame.close()
114
+
115
+
116
+ asyncio.run(main())
117
+ ```
118
+
119
+ Inspect an override-defined result without evaluating it, or evaluate it through
120
+ the same lazy Frame pipeline:
121
+
122
+ ```console
123
+ python -m lclang.cli builtins
124
+ python -m lclang.cli parse_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
125
+ python -m lclang.cli eval_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
126
+ ```
127
+
128
+ The first command lists canonical builtins and nested namespace methods. The
129
+ second prints the static `RESULT -> a, b` inspection tree. The third prints
130
+ `100200` because ordinary CLI override values are literal strings.
131
+
132
+ Continue with the [tutorial index](docs/tutorials/README.md), then choose the
133
+ [runtime guide](docs/tutorials/runtime.md),
134
+ [LCL examples gallery](docs/tutorials/lcl_examples.md), or
135
+ [configuration-file guide](docs/tutorials/config_file.md). Use the
136
+ [dependency analytics tutorial](docs/tutorials/dependency-analytics.md) for
137
+ static graphs, Frame paths, runtime traces, and reconciliation. The
138
+ [CLI tutorial](docs/tutorials/cli.md) shows how to build a configuration-driven
139
+ Python script. The [workflow-status tutorial](docs/tutorials/workflow-status.md)
140
+ explains task/step trees, aggregation, descriptions, locking, and scoped error
141
+ capture for both tasks and steps. The
142
+ [runtime API guide](docs/reference/runtime-api.md) remains the detailed
143
+ reference.
144
+
145
+ ## Intended capability
146
+
147
+ The 0.4 target comprises:
148
+
149
+ - a versioned Python-like expression grammar with a custom AST;
150
+ - an async-first interpreter and cached hierarchical runtime frames;
151
+ - dependency analysis with eager, conditional, deferred, and dynamic edges;
152
+ - UTF-8 `.lclcfg` files with versioned `using` expansion and source-aware diagnostics;
153
+ - a typed framework for building configuration-driven command-line tools;
154
+ - strict typing, branch coverage, parser differential tests, stress tests,
155
+ memory-leak checks, and portable package verification.
156
+
157
+ ## Engineering policy
158
+
159
+ Development is documentation-first and test-driven. Every implementation
160
+ milestone starts with an executable behavioural contract, demonstrates a
161
+ failing test, implements the behaviour, passes the complete quality gate, and
162
+ then updates both README files and the progress ledger. Production and unit-test
163
+ submodules mirror one another as defined in
164
+ [the module-layout specification](docs/architecture/module-layout.md).
165
+
166
+ The language is intended for trusted application configuration. It is not a
167
+ security sandbox for hostile expressions.
168
+
169
+ ## Documentation
170
+
171
+ - Durable development rules: [AGENTS.md](AGENTS.md)
172
+ - Progress and verification evidence: [progress.md](progress.md)
173
+ - English specifications: `docs/specs/`
174
+ - Complete LCL syntax: [docs/lcl-lang.md](docs/lcl-lang.md)
175
+ - English tutorial index: [docs/tutorials/README.md](docs/tutorials/README.md)
176
+ - Runtime tutorial: [docs/tutorials/runtime.md](docs/tutorials/runtime.md)
177
+ - LCL examples gallery: [docs/tutorials/lcl_examples.md](docs/tutorials/lcl_examples.md)
178
+ - Configuration-file tutorial: [docs/tutorials/config_file.md](docs/tutorials/config_file.md)
179
+ - Dependency analytics tutorial: [docs/tutorials/dependency-analytics.md](docs/tutorials/dependency-analytics.md)
180
+ - Python-script CLI tutorial: [docs/tutorials/cli.md](docs/tutorials/cli.md)
181
+ - Workflow-status tutorial: [docs/tutorials/workflow-status.md](docs/tutorials/workflow-status.md)
182
+ - Chinese CLI tutorial: [doc_cn/cli_cn.md](doc_cn/cli_cn.md)
183
+ - Chinese tutorials: `doc_cn/`
184
+
185
+ ## License
186
+
187
+ MIT. Version 0.3.0 requires Python 3.14+ and has no runtime dependencies.
lclang-0.3.0/README.md ADDED
@@ -0,0 +1,168 @@
1
+ # lclang
2
+
3
+ [中文说明](README_cn.md)
4
+
5
+ `lclang` is a pure-Python, async-first configuration expression language for
6
+ Python 3.14+. The 0.3.0 language, runtime, `.lclcfg`, and typed CLI release candidate is
7
+ verified; publication is a separate maintainer action. See
8
+ [CHANGELOG.md](CHANGELOG.md).
9
+
10
+ The distribution and import name is `lclang`; production code lives under
11
+ `src/lclang`.
12
+
13
+ ## Project status
14
+
15
+ - Target: 0.4.0 development release
16
+ - Latest completed milestone: M008 — `lclang` identity and `src` package layout
17
+ - Next planned milestone: M100 — trusted-input security boundary audit
18
+ - Implemented: foundation, enforced English rST API docs, source-aware lexer,
19
+ immutable AST, complete expression/comprehension parsing, all planned V1
20
+ expression forms, deterministic AST-to-source rendering, semantic f-string
21
+ parsing, stable root parse/print APIs, async expression evaluation with
22
+ recursively awaited sync/async iterable items, lexical
23
+ closures, structured failures, assertions, try recovery, finalization, and
24
+ synchronous/asynchronous context management, semantic f-string evaluation,
25
+ immutable runtime modules, and hierarchical single-flight Frame caching with
26
+ structured cycle detection, cancellation isolation, and atomic targeted
27
+ recalculation without dependant invalidation, plus task-local depth, work, and
28
+ materialized-collection limits, deterministic Frame close/resource cleanup,
29
+ scope-aware eager/conditional/deferred dependency analysis, immutable module
30
+ dependency graphs, filtered queries, deterministic topological ordering,
31
+ bounded runtime lookup tracing, static/dynamic edge reconciliation, and
32
+ owner-aware immutable Frame dependency snapshots with atomic refresh semantics,
33
+ plus shallow immutable host presets, reusable independent Frame factories,
34
+ manifest-driven read-only attribute namespaces, and reviewed async iterable,
35
+ text, immutable data, and strict JSON helpers in a standard preset, exposed
36
+ through a focused root API for the complete runtime workflow, plus preferred
37
+ source-string `define_module`/`define_frame` shortcuts and the canonical
38
+ `LCL_ROOT -> LCL_BUILTINS -> LCL_RUNTIME -> LCL_IMPORTS -> user` hierarchy,
39
+ preferred `Frame.derive` child construction, non-evaluating `has` and
40
+ `get_definition` lookup inspection, side-effect-free `inspect_variable`
41
+ dependency trees with first-seen direct-name deduplication and source-oriented
42
+ one-line representations with typed value/error payloads, including canonical
43
+ `<node-type>: <LCL expression>` payloads for AST values and canonical source
44
+ reprs for evaluated LCL function closures, plus controlled
45
+ right-biased `Frame.mixin`
46
+ host-value updates, definition-scoped `lhs()`, strict `YYYYMMDD` date builtins,
47
+ the native variadic fixed-point builtin `recursive`,
48
+ and non-evaluating Frame-qualified dependency graphs with value terminals and
49
+ lookup paths, lexical closure ownership for `lhs()`, source-string
50
+ `evaluate_sync`, deterministic direct/FrameFactory IDs, and a dependency
51
+ analytics tutorial backed by audited nested dependency and Frame packages,
52
+ plus immutable CLI values, exact async command decorators, nested snake_case
53
+ groups, full-argv parsing, structured help, lazy preset/default/config/override
54
+ Frame layering, handler-owned dryrun, isolated logging, result/cleanup mapping,
55
+ concise `CliResult.success`/`fail` constructors, valueless override keys as
56
+ boolean `True`, and built-in `parse_lcl` with optional evaluated inspection,
57
+ lazy `eval_lcl`, and deterministic nested `builtins` module commands, with canonical lclang
58
+ builtins and standard namespaces identified as `NativeProvided` and rendered
59
+ uniformly as `Builtin Function` or `Builtin Namespace`, plus structured
60
+ failures carrying direct-to-failing variable evaluation stacks, plus ordered
61
+ workflow execution-status trees, shared sub-task manager cursors, deterministic
62
+ parent aggregation, subtree locking, exception-transparent `with` finalization,
63
+ and scoped steps with atomic description/status updates and clean auto-success,
64
+ packaged with the `lclang` identity from the `src/lclang` source tree
65
+ - Test status: 844 tests pass at 100.00% branch coverage; strict mypy, Ruff,
66
+ exhaustive source/docstring policy, executable documentation, and artifact
67
+ gates pass
68
+
69
+ The authoritative milestone ledger is in [progress.md](progress.md). Planned
70
+ features are deliberately not presented as implemented features.
71
+
72
+ ## Quickstart
73
+
74
+ Run from a checkout with its development environment installed. The example is
75
+ extracted and executed by the test suite.
76
+
77
+ ```python
78
+ import asyncio
79
+
80
+ import lclang
81
+
82
+
83
+ async def main() -> None:
84
+ module = lclang.define_module(
85
+ "quickstart",
86
+ {"result": 'json.encode({"message": "hello lclang"})'},
87
+ )
88
+ frame = lclang.define_frame(module)
89
+ try:
90
+ print(await frame.get("result"))
91
+ snapshot = frame.dependency_snapshot("result")
92
+ print(",".join(str(edge.target) for edge in snapshot.dynamic_edges))
93
+ finally:
94
+ await frame.close()
95
+
96
+
97
+ asyncio.run(main())
98
+ ```
99
+
100
+ Inspect an override-defined result without evaluating it, or evaluate it through
101
+ the same lazy Frame pipeline:
102
+
103
+ ```console
104
+ python -m lclang.cli builtins
105
+ python -m lclang.cli parse_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
106
+ python -m lclang.cli eval_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
107
+ ```
108
+
109
+ The first command lists canonical builtins and nested namespace methods. The
110
+ second prints the static `RESULT -> a, b` inspection tree. The third prints
111
+ `100200` because ordinary CLI override values are literal strings.
112
+
113
+ Continue with the [tutorial index](docs/tutorials/README.md), then choose the
114
+ [runtime guide](docs/tutorials/runtime.md),
115
+ [LCL examples gallery](docs/tutorials/lcl_examples.md), or
116
+ [configuration-file guide](docs/tutorials/config_file.md). Use the
117
+ [dependency analytics tutorial](docs/tutorials/dependency-analytics.md) for
118
+ static graphs, Frame paths, runtime traces, and reconciliation. The
119
+ [CLI tutorial](docs/tutorials/cli.md) shows how to build a configuration-driven
120
+ Python script. The [workflow-status tutorial](docs/tutorials/workflow-status.md)
121
+ explains task/step trees, aggregation, descriptions, locking, and scoped error
122
+ capture for both tasks and steps. The
123
+ [runtime API guide](docs/reference/runtime-api.md) remains the detailed
124
+ reference.
125
+
126
+ ## Intended capability
127
+
128
+ The 0.4 target comprises:
129
+
130
+ - a versioned Python-like expression grammar with a custom AST;
131
+ - an async-first interpreter and cached hierarchical runtime frames;
132
+ - dependency analysis with eager, conditional, deferred, and dynamic edges;
133
+ - UTF-8 `.lclcfg` files with versioned `using` expansion and source-aware diagnostics;
134
+ - a typed framework for building configuration-driven command-line tools;
135
+ - strict typing, branch coverage, parser differential tests, stress tests,
136
+ memory-leak checks, and portable package verification.
137
+
138
+ ## Engineering policy
139
+
140
+ Development is documentation-first and test-driven. Every implementation
141
+ milestone starts with an executable behavioural contract, demonstrates a
142
+ failing test, implements the behaviour, passes the complete quality gate, and
143
+ then updates both README files and the progress ledger. Production and unit-test
144
+ submodules mirror one another as defined in
145
+ [the module-layout specification](docs/architecture/module-layout.md).
146
+
147
+ The language is intended for trusted application configuration. It is not a
148
+ security sandbox for hostile expressions.
149
+
150
+ ## Documentation
151
+
152
+ - Durable development rules: [AGENTS.md](AGENTS.md)
153
+ - Progress and verification evidence: [progress.md](progress.md)
154
+ - English specifications: `docs/specs/`
155
+ - Complete LCL syntax: [docs/lcl-lang.md](docs/lcl-lang.md)
156
+ - English tutorial index: [docs/tutorials/README.md](docs/tutorials/README.md)
157
+ - Runtime tutorial: [docs/tutorials/runtime.md](docs/tutorials/runtime.md)
158
+ - LCL examples gallery: [docs/tutorials/lcl_examples.md](docs/tutorials/lcl_examples.md)
159
+ - Configuration-file tutorial: [docs/tutorials/config_file.md](docs/tutorials/config_file.md)
160
+ - Dependency analytics tutorial: [docs/tutorials/dependency-analytics.md](docs/tutorials/dependency-analytics.md)
161
+ - Python-script CLI tutorial: [docs/tutorials/cli.md](docs/tutorials/cli.md)
162
+ - Workflow-status tutorial: [docs/tutorials/workflow-status.md](docs/tutorials/workflow-status.md)
163
+ - Chinese CLI tutorial: [doc_cn/cli_cn.md](doc_cn/cli_cn.md)
164
+ - Chinese tutorials: `doc_cn/`
165
+
166
+ ## License
167
+
168
+ MIT. Version 0.3.0 requires Python 3.14+ and has no runtime dependencies.