neurolisp 0.35.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 (173) hide show
  1. neurolisp-0.35.0/LICENSE +190 -0
  2. neurolisp-0.35.0/PKG-INFO +332 -0
  3. neurolisp-0.35.0/README.md +298 -0
  4. neurolisp-0.35.0/mcp_server/__init__.py +9 -0
  5. neurolisp-0.35.0/mcp_server/briefing.py +595 -0
  6. neurolisp-0.35.0/mcp_server/coverage_detector.py +156 -0
  7. neurolisp-0.35.0/mcp_server/plan_store.py +97 -0
  8. neurolisp-0.35.0/mcp_server/primitives_docs.py +828 -0
  9. neurolisp-0.35.0/mcp_server/profiles.py +280 -0
  10. neurolisp-0.35.0/mcp_server/queries.py +311 -0
  11. neurolisp-0.35.0/mcp_server/server.py +912 -0
  12. neurolisp-0.35.0/mcp_server/skills_watcher.py +89 -0
  13. neurolisp-0.35.0/mcp_server/state.py +3430 -0
  14. neurolisp-0.35.0/mcp_server/templates.py +255 -0
  15. neurolisp-0.35.0/mcp_server/workflow.py +921 -0
  16. neurolisp-0.35.0/neurolisp/__init__.py +29 -0
  17. neurolisp-0.35.0/neurolisp/agents.py +280 -0
  18. neurolisp-0.35.0/neurolisp/anti_unify.py +217 -0
  19. neurolisp-0.35.0/neurolisp/ast.py +130 -0
  20. neurolisp-0.35.0/neurolisp/canonical.py +251 -0
  21. neurolisp-0.35.0/neurolisp/compiler.py +328 -0
  22. neurolisp-0.35.0/neurolisp/corpus.py +389 -0
  23. neurolisp-0.35.0/neurolisp/crystallization.py +965 -0
  24. neurolisp-0.35.0/neurolisp/dialog.py +148 -0
  25. neurolisp-0.35.0/neurolisp/env.py +52 -0
  26. neurolisp-0.35.0/neurolisp/env_sync.py +105 -0
  27. neurolisp-0.35.0/neurolisp/eval.py +815 -0
  28. neurolisp-0.35.0/neurolisp/gap_prioritizer.py +179 -0
  29. neurolisp-0.35.0/neurolisp/grader.py +345 -0
  30. neurolisp-0.35.0/neurolisp/health.py +278 -0
  31. neurolisp-0.35.0/neurolisp/hedging_detector.py +94 -0
  32. neurolisp-0.35.0/neurolisp/macros_code_review.py +187 -0
  33. neurolisp-0.35.0/neurolisp/macros_comparison.py +180 -0
  34. neurolisp-0.35.0/neurolisp/macros_essay.py +198 -0
  35. neurolisp-0.35.0/neurolisp/meta_learn.py +518 -0
  36. neurolisp-0.35.0/neurolisp/meta_skills.py +67 -0
  37. neurolisp-0.35.0/neurolisp/parser.py +202 -0
  38. neurolisp-0.35.0/neurolisp/plan_mode.py +160 -0
  39. neurolisp-0.35.0/neurolisp/provider_anthropic.py +346 -0
  40. neurolisp-0.35.0/neurolisp/provider_deepseek.py +392 -0
  41. neurolisp-0.35.0/neurolisp/provider_openai.py +340 -0
  42. neurolisp-0.35.0/neurolisp/providers.py +454 -0
  43. neurolisp-0.35.0/neurolisp/self_optimize.py +401 -0
  44. neurolisp-0.35.0/neurolisp/sexpr_optimize.py +244 -0
  45. neurolisp-0.35.0/neurolisp/skill.py +283 -0
  46. neurolisp-0.35.0/neurolisp/skill_creator.py +156 -0
  47. neurolisp-0.35.0/neurolisp/skill_registry.py +132 -0
  48. neurolisp-0.35.0/neurolisp/stdlib.py +134 -0
  49. neurolisp-0.35.0/neurolisp.egg-info/PKG-INFO +332 -0
  50. neurolisp-0.35.0/neurolisp.egg-info/SOURCES.txt +171 -0
  51. neurolisp-0.35.0/neurolisp.egg-info/dependency_links.txt +1 -0
  52. neurolisp-0.35.0/neurolisp.egg-info/requires.txt +10 -0
  53. neurolisp-0.35.0/neurolisp.egg-info/top_level.txt +2 -0
  54. neurolisp-0.35.0/pyproject.toml +79 -0
  55. neurolisp-0.35.0/setup.cfg +4 -0
  56. neurolisp-0.35.0/tests/test_a2a_subagent_integration.py +290 -0
  57. neurolisp-0.35.0/tests/test_agent_sexpr_channel.py +93 -0
  58. neurolisp-0.35.0/tests/test_agents.py +197 -0
  59. neurolisp-0.35.0/tests/test_anti_unify.py +103 -0
  60. neurolisp-0.35.0/tests/test_anti_unify_primitive.py +58 -0
  61. neurolisp-0.35.0/tests/test_compiler.py +170 -0
  62. neurolisp-0.35.0/tests/test_corpus_compile_path.py +47 -0
  63. neurolisp-0.35.0/tests/test_corpus_extended.py +55 -0
  64. neurolisp-0.35.0/tests/test_deepseek.py +197 -0
  65. neurolisp-0.35.0/tests/test_dialog.py +218 -0
  66. neurolisp-0.35.0/tests/test_eval.py +318 -0
  67. neurolisp-0.35.0/tests/test_logprobs_confidence.py +179 -0
  68. neurolisp-0.35.0/tests/test_mcc60.py +215 -0
  69. neurolisp-0.35.0/tests/test_mcp_server.py +1363 -0
  70. neurolisp-0.35.0/tests/test_parser.py +103 -0
  71. neurolisp-0.35.0/tests/test_provider.py +98 -0
  72. neurolisp-0.35.0/tests/test_provider_anthropic.py +161 -0
  73. neurolisp-0.35.0/tests/test_provider_complete.py +97 -0
  74. neurolisp-0.35.0/tests/test_provider_openai.py +161 -0
  75. neurolisp-0.35.0/tests/test_sexpr_optimize.py +129 -0
  76. neurolisp-0.35.0/tests/test_skill.py +325 -0
  77. neurolisp-0.35.0/tests/test_skill_creator.py +200 -0
  78. neurolisp-0.35.0/tests/test_skill_registry.py +269 -0
  79. neurolisp-0.35.0/tests/test_skills_watcher.py +254 -0
  80. neurolisp-0.35.0/tests/test_v0_32_reflect_revise_sink.py +98 -0
  81. neurolisp-0.35.0/tests/test_v10_briefing_kit.py +394 -0
  82. neurolisp-0.35.0/tests/test_v11_lint_and_retry.py +240 -0
  83. neurolisp-0.35.0/tests/test_v20_briefing_budget.py +247 -0
  84. neurolisp-0.35.0/tests/test_v20_coverage_detector.py +246 -0
  85. neurolisp-0.35.0/tests/test_v20_detector_integration.py +154 -0
  86. neurolisp-0.35.0/tests/test_v20_tool_aliases.py +148 -0
  87. neurolisp-0.35.0/tests/test_v25_corpus_prelookup_guidance.py +61 -0
  88. neurolisp-0.35.0/tests/test_v25_essay_macro_pipeline.py +141 -0
  89. neurolisp-0.35.0/tests/test_v25_macro_expand.py +193 -0
  90. neurolisp-0.35.0/tests/test_v25c2_essay_pipeline_macro.py +175 -0
  91. neurolisp-0.35.0/tests/test_v25c3_code_review_macros.py +227 -0
  92. neurolisp-0.35.0/tests/test_v25c4_corpus_recall.py +165 -0
  93. neurolisp-0.35.0/tests/test_v25c5_1_audit_fixes.py +104 -0
  94. neurolisp-0.35.0/tests/test_v25c5_comparison_macros.py +124 -0
  95. neurolisp-0.35.0/tests/test_v26_10_bench_retry_smoke.py +125 -0
  96. neurolisp-0.35.0/tests/test_v26_11_sop_warnings_capture.py +80 -0
  97. neurolisp-0.35.0/tests/test_v26_12_auto_rule_collision_resistance.py +78 -0
  98. neurolisp-0.35.0/tests/test_v26_18_nl_get_sop_warnings.py +70 -0
  99. neurolisp-0.35.0/tests/test_v26_19_hash_cross_process_stability.py +67 -0
  100. neurolisp-0.35.0/tests/test_v26_1_scoped_macros.py +139 -0
  101. neurolisp-0.35.0/tests/test_v26_20_sop_warnings_bleed.py +83 -0
  102. neurolisp-0.35.0/tests/test_v26_21_invariant4_crystallize_threshold.py +128 -0
  103. neurolisp-0.35.0/tests/test_v26_23_scope_warning_symmetry.py +85 -0
  104. neurolisp-0.35.0/tests/test_v26_27_conftest_fixture.py +49 -0
  105. neurolisp-0.35.0/tests/test_v26_28_warn_helper_symmetry.py +84 -0
  106. neurolisp-0.35.0/tests/test_v26_29_dangling_parent_warn.py +85 -0
  107. neurolisp-0.35.0/tests/test_v26_2_briefing_robustness.py +70 -0
  108. neurolisp-0.35.0/tests/test_v26_30_comparison_team_profile.py +93 -0
  109. neurolisp-0.35.0/tests/test_v26_7_code_review_profile.py +88 -0
  110. neurolisp-0.35.0/tests/test_v26_8_profile_chain_depth.py +117 -0
  111. neurolisp-0.35.0/tests/test_v26_9_upstream_size_guard.py +112 -0
  112. neurolisp-0.35.0/tests/test_v26_node_profile.py +228 -0
  113. neurolisp-0.35.0/tests/test_v27_path_traversal.py +111 -0
  114. neurolisp-0.35.0/tests/test_v29_sink_dual_view.py +179 -0
  115. neurolisp-0.35.0/tests/test_v34_1_stakes_triage.py +282 -0
  116. neurolisp-0.35.0/tests/test_v34_2_health_check.py +109 -0
  117. neurolisp-0.35.0/tests/test_v34_routine_pipeline.py +112 -0
  118. neurolisp-0.35.0/tests/test_v35_canonical.py +214 -0
  119. neurolisp-0.35.0/tests/test_v5_homoiconicity.py +237 -0
  120. neurolisp-0.35.0/tests/test_v5_match.py +165 -0
  121. neurolisp-0.35.0/tests/test_v5_meta_programming.py +167 -0
  122. neurolisp-0.35.0/tests/test_v5_sexpr_tools.py +168 -0
  123. neurolisp-0.35.0/tests/test_v6_law2_competition.py +281 -0
  124. neurolisp-0.35.0/tests/test_v6_meta_learn.py +265 -0
  125. neurolisp-0.35.0/tests/test_v6_meta_skills.py +265 -0
  126. neurolisp-0.35.0/tests/test_v6_self_optimize.py +267 -0
  127. neurolisp-0.35.0/tests/test_v764_fork.py +532 -0
  128. neurolisp-0.35.0/tests/test_v7_ablation.py +211 -0
  129. neurolisp-0.35.0/tests/test_v7_active_learning.py +214 -0
  130. neurolisp-0.35.0/tests/test_v7_adversarial_robustness.py +187 -0
  131. neurolisp-0.35.0/tests/test_v7_auto_dispatch.py +212 -0
  132. neurolisp-0.35.0/tests/test_v7_budget_allocation.py +318 -0
  133. neurolisp-0.35.0/tests/test_v7_composite_speedup.py +393 -0
  134. neurolisp-0.35.0/tests/test_v7_compositional_error.py +269 -0
  135. neurolisp-0.35.0/tests/test_v7_corpus_namespace.py +147 -0
  136. neurolisp-0.35.0/tests/test_v7_corpus_primitives.py +141 -0
  137. neurolisp-0.35.0/tests/test_v7_corpus_stats.py +153 -0
  138. neurolisp-0.35.0/tests/test_v7_correction_cost.py +233 -0
  139. neurolisp-0.35.0/tests/test_v7_cost_roi.py +200 -0
  140. neurolisp-0.35.0/tests/test_v7_coverage_gaps.py +163 -0
  141. neurolisp-0.35.0/tests/test_v7_coverage_trajectory.py +143 -0
  142. neurolisp-0.35.0/tests/test_v7_cross_domain.py +329 -0
  143. neurolisp-0.35.0/tests/test_v7_crystallization.py +277 -0
  144. neurolisp-0.35.0/tests/test_v7_crystallization_history.py +216 -0
  145. neurolisp-0.35.0/tests/test_v7_crystallization_persistence.py +179 -0
  146. neurolisp-0.35.0/tests/test_v7_crystallization_roi.py +242 -0
  147. neurolisp-0.35.0/tests/test_v7_deferred_durable.py +237 -0
  148. neurolisp-0.35.0/tests/test_v7_domain_shift.py +198 -0
  149. neurolisp-0.35.0/tests/test_v7_gap_prioritizer.py +232 -0
  150. neurolisp-0.35.0/tests/test_v7_hierarchical_meta_learn.py +220 -0
  151. neurolisp-0.35.0/tests/test_v7_holdout_coverage.py +311 -0
  152. neurolisp-0.35.0/tests/test_v7_inconsistency_detection.py +163 -0
  153. neurolisp-0.35.0/tests/test_v7_incremental_crystallization.py +273 -0
  154. neurolisp-0.35.0/tests/test_v7_minocc_pareto.py +229 -0
  155. neurolisp-0.35.0/tests/test_v7_multi_provider.py +166 -0
  156. neurolisp-0.35.0/tests/test_v7_multi_round_evolution.py +260 -0
  157. neurolisp-0.35.0/tests/test_v7_multi_session.py +267 -0
  158. neurolisp-0.35.0/tests/test_v7_noise_sensitivity.py +158 -0
  159. neurolisp-0.35.0/tests/test_v7_outcomes.py +472 -0
  160. neurolisp-0.35.0/tests/test_v7_parameter_sensitivity.py +174 -0
  161. neurolisp-0.35.0/tests/test_v7_pattern_calculus.py +269 -0
  162. neurolisp-0.35.0/tests/test_v7_scale.py +276 -0
  163. neurolisp-0.35.0/tests/test_v7_selective_crystallization.py +262 -0
  164. neurolisp-0.35.0/tests/test_v7_staleness_detection.py +199 -0
  165. neurolisp-0.35.0/tests/test_v7_streaming_threshold.py +296 -0
  166. neurolisp-0.35.0/tests/test_v7_token_chain.py +213 -0
  167. neurolisp-0.35.0/tests/test_v7_token_durable.py +203 -0
  168. neurolisp-0.35.0/tests/test_v7_workflow_durable.py +387 -0
  169. neurolisp-0.35.0/tests/test_v7_workflow_generator.py +576 -0
  170. neurolisp-0.35.0/tests/test_v7_workflow_orchestrator.py +183 -0
  171. neurolisp-0.35.0/tests/test_v7_workflow_parallel_concurrent.py +186 -0
  172. neurolisp-0.35.0/tests/test_v7_workflow_patch.py +226 -0
  173. neurolisp-0.35.0/tests/test_v7_workflow_review.py +204 -0
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Bangcheng Wang and NeuroLisp contributors.
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,332 @@
1
+ Metadata-Version: 2.4
2
+ Name: neurolisp
3
+ Version: 0.35.0
4
+ Summary: Sexpr-native MCP server giving Claude Code and other MCP agents white-box workflow orchestration, durable corpus, auto-crystallization.
5
+ Author: Bangcheng Wang, NeuroLisp contributors
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/KevinBangbang/NeuroLisp
8
+ Project-URL: Documentation, https://github.com/KevinBangbang/NeuroLisp/blob/main/docs/README.md
9
+ Project-URL: Repository, https://github.com/KevinBangbang/NeuroLisp
10
+ Project-URL: Changelog, https://github.com/KevinBangbang/NeuroLisp/blob/main/CHANGELOG.md
11
+ Project-URL: Issues, https://github.com/KevinBangbang/NeuroLisp/issues
12
+ Keywords: mcp,lisp,agent,orchestration,claude-code,llm,workflow
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Interpreters
21
+ Classifier: Topic :: Software Development :: Libraries
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: mcp>=1.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=7.0; extra == "dev"
28
+ Requires-Dist: hypothesis>=6.0; extra == "dev"
29
+ Requires-Dist: ruff>=0.4; extra == "dev"
30
+ Requires-Dist: mypy>=1.10; extra == "dev"
31
+ Provides-Extra: pdf
32
+ Requires-Dist: pypdf>=4.0; extra == "pdf"
33
+ Dynamic: license-file
34
+
35
+ # NeuroLisp
36
+
37
+ **A white-box MCP server for Claude Code agent workflows.** Survive a `kill -9` mid-task. Read what your subagent did in plain text. Replay any step without rerunning the rest.
38
+
39
+ [![tests](https://github.com/KevinBangbang/NeuroLisp/actions/workflows/test.yml/badge.svg)](https://github.com/KevinBangbang/NeuroLisp/actions/workflows/test.yml)
40
+ [![python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/)
41
+ [![license](https://img.shields.io/badge/license-Apache%202.0-green)](LICENSE)
42
+ [![mcp](https://img.shields.io/badge/protocol-MCP-purple)](https://modelcontextprotocol.io/)
43
+
44
+ ---
45
+
46
+ ## Why does this exist
47
+
48
+ Claude Code is powerful in one session. The 4 things that break in production are paired with what NeuroLisp does about each:
49
+
50
+ | The pain | NeuroLisp's answer |
51
+ |---|---|
52
+ | You crash 8 hours in and lose all state. | Every step's cursor, prompt, and result lives in sqlite. Reconnect and `nl_workflow_replay`. |
53
+ | You cannot audit what your subagent did. LangGraph objects inspect to `<Node 0x...>`. | Every step is sexpr text in `workflow_runs.steps_sexpr`. Readable with `cat`. |
54
+ | Your patterns repeat but the agent forgets each time. | After 3 consistent observations, the pattern auto-crystallizes into a reusable named skill. |
55
+ | You want to fix one step without rerunning everything. | `nl_workflow_patch_step <id> <step> <new-prompt>`, then replay from that step only. |
56
+
57
+ The file you executed is the file you patch. The same sexpr is workflow, plan, template, and macroexpansion result. That is homoiconicity, and the value is concrete: you can read, diff, edit, and replay without ever leaving plain text.
58
+
59
+ ---
60
+
61
+ ## Why smaller models can do bigger work
62
+
63
+ `CLAUDE.md` and similar instruction files are an **interpretive runtime**. Every step, the model re-reads your rules, decides which skill to load, recalls past context, and improvises what to do next. That requires a very capable model. The cost grows with workflow complexity.
64
+
65
+ NeuroLisp's sexpr workflow is a **deterministic runtime**. Step order, tool whitelists, lexical scope, retry guards, pre-loaded skills, the briefing kit — all encoded in the sexpr **before** the model is invoked. The model only does the leaf work: draft this paragraph, classify this review, summarize these sources. The orchestration is the program, not the prompt.
66
+
67
+ ```
68
+ CLAUDE.md interpretation NeuroLisp deterministic orchestration
69
+ ───────────────────────── ────────────────────────────────────
70
+ Big model reads instructions Small model receives a fully-formed
71
+ Big model decides next step briefing for ONE leaf task
72
+ Big model loads context Workflow already loaded the context
73
+ Big model picks the tool Workflow already locked the tools
74
+ Big model improvises Sexpr executes deterministically
75
+ Cost scales with model + complexity Cost scales with leaf-task count only
76
+ ```
77
+
78
+ Practical effect: a 5-step essay pipeline that needs a top-tier model to coordinate via instruction-file interpretation runs on a smaller, cheaper model under NeuroLisp because the coordination is in the sexpr. Same output quality, often two orders of magnitude cheaper per LLM call:
79
+
80
+ ```
81
+ DeepSeek v4-flash $0.07 / 1M input tokens $0.27 / 1M output tokens
82
+ Claude Opus 4.x $15 / 1M input tokens $75 / 1M output tokens
83
+ ~214× input ~278× output
84
+ ```
85
+
86
+ Public list prices as of 2026-05. The 5-step essay benchmark in this repo lands at ~$0.003 per essay on DeepSeek v4-flash; the same workflow under a top-tier model would be in the $0.50 - $1.00 range.
87
+
88
+ This compounds. As you accumulate dozens of reusable pipelines and skills, you have a personal orchestration layer that any cheap model can drive. **The intelligence migrates from the model into your workflow library**, where it is inspectable, diff-able, and version-controlled.
89
+
90
+ ---
91
+
92
+ ## In 30 seconds
93
+
94
+ **Run a real workflow.** One macro expands into 5 LLM steps: planner → 2 parallel researchers → 2 writers → reflect-revise editor.
95
+
96
+ ```lisp
97
+ (essay-atom-pipeline-scoped "GraphQL vs REST in 2026" "research-team")
98
+ ;; → 4000+ word essay, ~$0.002-0.005 on DeepSeek v4-flash
99
+ ```
100
+
101
+ **Inspect what ran.** Workflow + steps are sqlite rows, not opaque objects.
102
+
103
+ ```bash
104
+ sqlite3 ~/.neurolisp_mcp.sqlite \
105
+ "SELECT id, status, cursor, length(steps_sexpr) FROM workflow_runs ORDER BY id DESC LIMIT 1"
106
+ # wf-9b2e... | complete | 5/5 | 842 chars of plain sexpr
107
+ ```
108
+
109
+ **Survive a crash.** Pull the plug at step 4 of 5. Reconnect Claude Code and ask it to:
110
+
111
+ ```
112
+ nl_workflow_replay(workflow_id="wf-9b2e...", from_step="draft-section-2")
113
+ # resumes at draft-section-2; outline + research-1 + research-2 reuse
114
+ # cached results from sqlite, cost: $0 for the first 3 steps
115
+ ```
116
+
117
+ **Hand-edit a step then replay.**
118
+
119
+ ```
120
+ nl_workflow_patch_step(workflow_id="wf-9b2e...",
121
+ step_name="reflect-revise",
122
+ new_prompt="Reflect using 7 quality dimensions, then revise.")
123
+ nl_workflow_replay(workflow_id="wf-9b2e...", from_step="reflect-revise")
124
+ ```
125
+
126
+ No framework rerun. No LangGraph rebuild. Patch the sexpr and go.
127
+
128
+ ---
129
+
130
+ ## How a complex workflow actually runs
131
+
132
+ Take the essay-atom-pipeline from the example above. It is intentionally complex enough to exercise every NeuroLisp mechanism: `:auto T` (server-side LLM), `:tools` deferred subagents (brain-side dispatch), a `parallel` group, a `:retry-validate` quality guard, a `:sink` length backstop, and `:scope` lexical-tool whitelisting through a NodeProfile. After the one-line macro call, here is what actually happens.
133
+
134
+ ### One user request, five MCP boundaries
135
+
136
+ ```
137
+ USER
138
+ │ "Write me an essay on GraphQL vs REST."
139
+
140
+ ┌──────────────────┐
141
+ │ Claude Code │ main agent in user's terminal
142
+ │ (the brain) │ decides to use NeuroLisp
143
+ └────────┬─────────┘
144
+
145
+ │ nl_eval_sexpr(
146
+ │ '(essay-atom-pipeline-scoped
147
+ │ "GraphQL vs REST in 2026"
148
+ │ "research-team")')
149
+
150
+ ┌──────────────────┐
151
+ │ NeuroLisp MCP │ parses sexpr, expands macro,
152
+ │ server │ walks workflow groups, persists
153
+ │ (Python) │ state to ~/.neurolisp_mcp.sqlite
154
+ └─┬────────────┬───┘
155
+ │ │
156
+ ┌────────────┘ └────────────┐
157
+ │ for :auto T steps for :tools │
158
+ │ server calls LLM server │
159
+ │ provider directly hands back │
160
+ ▼ deferred ▼
161
+ ┌─────────────────┐ token ┌────────────────┐
162
+ │ LLM provider │ │ Claude Code │
163
+ │ DeepSeek / │◀──────────────────────│ Agent tool │
164
+ │ OpenAI-compat / │ HTTP request │ dispatches a │
165
+ │ Anthropic │ includes briefing │ fresh subagent │
166
+ │ (urllib only) │ │ with the │
167
+ └────────┬────────┘ │ briefing kit │
168
+ │ text response └───────┬────────┘
169
+ ▼ │ subagent
170
+ apply :sink │ runs WebSearch
171
+ apply :retry-validate │ + WebFetch
172
+ write to wf.results │ + reasoning
173
+ write to corpus row in sqlite ▼
174
+ │ result text
175
+ │ ┌─────────────────────────┘
176
+ │ │ nl_resolve_subagent(token, result)
177
+ ▼ ▼
178
+ workflow advances cursor
179
+ next group fires
180
+ auto-chain runs all :auto steps in one server call
181
+
182
+
183
+ workflow status = complete
184
+ final result in wf.results["reflect-revise"]
185
+
186
+
187
+ ┌──────────────────┐
188
+ │ USER reads │
189
+ │ the essay │
190
+ └──────────────────┘
191
+ ```
192
+
193
+ ### Phase-by-phase trace
194
+
195
+ | # | Phase | Who acts | What actually happens |
196
+ |---|---|---|---|
197
+ | 1 | Macro expansion | Server | `(essay-atom-pipeline-scoped ...)` → 30-line `(workflow (quote ...) (quote (5 steps)))` AST in memory. No LLM yet. |
198
+ | 2 | Group 0: outline | Server + DeepSeek | `:auto T` planner step. Server builds briefing from `essay-outline-architect` skill + topic, HTTP-POSTs DeepSeek, gets 400-word outline, applies sink (none), writes `wf.results["outline"]` + corpus row `auto-step:planner`. |
199
+ | 3 | Group 1: research × 2 (parallel + deferred) | Brain → 2 subagents | `:tools (WebSearch WebFetch)` steps emit 2 deferred tokens. Brain receives `parallel_steps` payload, dispatches 2 Claude Code subagents via the `Agent` tool, each with its own briefing kit (Role / Task / Upstream Artifacts / SOP / Tools Available). Subagents call WebSearch + WebFetch independently. Brain receives 2 result strings, calls `nl_resolve_subagent(token, result)` twice. |
200
+ | 4 | Auto chain: groups 2-4 | Server + DeepSeek | After the 2nd resolve, server sees the next 3 groups (draft-section-1, draft-section-2, reflect-revise) are all `:auto T`. It runs them back-to-back in a single server-side loop (`auto chain`, v7.62), no brain round-trips. Each step's prompt references upstream step names which the env resolves to actual text. |
201
+ | 5 | Final guard | Server | reflect-revise has `:sink (cond ((< (string-length result) 2000) (str "WARNING short essay..." result)) (T result))`. If LLM truncates, the sink prepends a WARNING header before storing. `wf.summaries["reflect-revise"]` also stored for downstream brevity. |
202
+ | 6 | Return | Server → Brain → User | Server returns `{complete: true, results: {6 step keys}}`. Claude Code reads `results["reflect-revise"]` and shows the essay to the user. |
203
+
204
+ ### The boundary each layer enforces
205
+
206
+ - **The brain (Claude Code)** decides *what to ask for* and *whom to dispatch* (subagents). It never decides *how a step is written* — the workflow grammar already encodes that.
207
+ - **The server (NeuroLisp)** decides *how each step executes* (auto vs deferred), *what context that step sees* (briefing kit), and *what state persists* (sqlite). It never decides *whom to dispatch* — invariant 3.
208
+ - **The LLM provider** does *one leaf task* at a time. Briefing is fully assembled before the HTTP call, so the model is not asked to plan, only to produce.
209
+ - **The subagent** is a *one-shot* Claude Code instance: opens a fresh context, runs the tools listed in its briefing, returns one result string. It has no awareness of the broader workflow.
210
+
211
+ That separation is what lets a small, cheap leaf-model do the same end-to-end work that a single big-model session would otherwise need: every step is pre-decided in the sexpr, so the model is never asked to be smart about the plan.
212
+
213
+ ### What sqlite actually contains after one run
214
+
215
+ ```bash
216
+ sqlite3 ~/.neurolisp_mcp.sqlite "
217
+ SELECT primitive, success, length(output) AS out_chars, cost
218
+ FROM corpus
219
+ ORDER BY row_id DESC LIMIT 6"
220
+ ```
221
+
222
+ ```
223
+ invoke-subagent:editor | 1 | 4149 | 0.00097 -- reflect-revise (:auto T)
224
+ invoke-subagent:writer | 1 | 2104 | 0.00031 -- draft-section-2 (:auto T)
225
+ invoke-subagent:writer | 1 | 2087 | 0.00029 -- draft-section-1 (:auto T)
226
+ invoke-subagent:general-purpose | 1 | 1856 | 0.0 -- research-2 (:tools, brain-side)
227
+ invoke-subagent:general-purpose | 1 | 1734 | 0.0 -- research-1 (:tools, brain-side)
228
+ invoke-subagent:planner | 1 | 412 | 0.00018 -- outline (:auto T)
229
+ ```
230
+
231
+ Every step writes a row with primitive prefix `invoke-subagent:<agent>` regardless of execution path. `:auto T` rows carry the server-side LLM cost; `:tools` rows show `0.0` because the cost lives on the brain side (subagent dispatch). `:pure T` steps use a different prefix `pure-step:<agent>`.
232
+
233
+ ```bash
234
+ sqlite3 ~/.neurolisp_mcp.sqlite "
235
+ SELECT id, status, cursor, length(steps_sexpr) AS plan_chars
236
+ FROM workflow_runs ORDER BY rowid DESC LIMIT 1"
237
+ ```
238
+
239
+ ```
240
+ wf-9b2e... | complete | 5/5 | 842
241
+ ```
242
+
243
+ 6 corpus rows are append-only audit trail; the `workflow_runs` row is the resumable snapshot. Both are plain SQL. Both are diff-able. Nothing about this run is opaque.
244
+
245
+ ---
246
+
247
+ ## Get started
248
+
249
+ Install from source (works today):
250
+
251
+ ```bash
252
+ git clone https://github.com/KevinBangbang/NeuroLisp.git
253
+ cd NeuroLisp
254
+ pip install -e .
255
+ python -m neurolisp.health
256
+ ```
257
+
258
+ A PyPI release (`pip install neurolisp`) is staged for v0.35.0 and will be available shortly after the first public release tag.
259
+
260
+ Wire into Claude Code by editing `~/.claude.json`:
261
+
262
+ ```json
263
+ {
264
+ "mcpServers": {
265
+ "neurolisp": {
266
+ "command": "python",
267
+ "args": ["-m", "mcp_server.server"]
268
+ }
269
+ }
270
+ }
271
+ ```
272
+
273
+ Restart Claude Code, run `/mcp`. All 45 `nl_*` tools appear.
274
+
275
+ For real LLM steps, export an API key:
276
+
277
+ ```bash
278
+ export DEEPSEEK_API_KEY=sk-...
279
+ # or OPENAI_API_KEY / ANTHROPIC_API_KEY
280
+ ```
281
+
282
+ OpenAI-compatible endpoints (Groq, Together, Cerebras, local vLLM, etc.) are supported by swapping `base_url`. See [`docs/00_quickstart.md`](docs/00_quickstart.md) for the 10-minute walkthrough.
283
+
284
+ ---
285
+
286
+ ## What you can do
287
+
288
+ - **Resume any workflow at the exact step** after a crash, kernel panic, or `kill -9`. Step results live in sqlite, not RAM.
289
+ - **Audit every subagent invocation by `cat`-ing a sexpr.** The execution plan is the same file you can hand-edit.
290
+ - **Skip steps you have already paid for** with `nl_workflow_replay(workflow_id, from_step="step-name")`. Cached upstream results stay valid.
291
+ - **Patch one step then replay.** `nl_workflow_patch_step` updates the plan; the next replay picks up the change.
292
+ - **Crystallize a repeated pattern into a named skill** after 3 consistent observations. Reuse it from any future workflow.
293
+ - **Skip the heavyweight 5-step pipeline for low-stakes tasks** with `stakes-route`. Empirically 89% cheaper than the full pipeline (v0.34 routine vs full bench).
294
+ - **Swap LLM providers without changing the workflow.** DeepSeek, Anthropic, and any OpenAI-compatible endpoint (Groq, Together, Cerebras, local vLLM) all on stdlib `urllib`, no SDK lock-in.
295
+ - **Trust the test surface.** 1992 passing tests + 4 skipped on every commit across Ubuntu and Windows on Python 3.10 / 3.11 / 3.12.
296
+
297
+ ---
298
+
299
+ ## Documentation
300
+
301
+ | If you want to... | Read this |
302
+ |---|---|
303
+ | Try it in 10 minutes | [`docs/00_quickstart.md`](docs/00_quickstart.md) |
304
+ | Understand why each layer exists | [`docs/01_concepts/00_first_principles.md`](docs/01_concepts/00_first_principles.md) |
305
+ | Follow a build-up tutorial | [`docs/07_tutorial-book/`](docs/07_tutorial-book/) 17 chapters |
306
+ | Browse all 45 MCP tools | [`docs/02_reference/mcp-tools.md`](docs/02_reference/mcp-tools.md) |
307
+ | Read the 8 invariants and anti-goals | [`NORTH_STAR.md`](NORTH_STAR.md) |
308
+ | See empirical benchmarks | [`docs/BENCHMARKS.md`](docs/BENCHMARKS.md) |
309
+ | Run example scripts locally | [`examples/`](examples/) 3 standalone demos |
310
+ | Browse version history | [`CHANGELOG.md`](CHANGELOG.md) |
311
+
312
+ ---
313
+
314
+ ## Community
315
+
316
+ - [GitHub Discussions](https://github.com/KevinBangbang/NeuroLisp/discussions) for design questions, show-and-tell, RFCs
317
+ - [GitHub Issues](https://github.com/KevinBangbang/NeuroLisp/issues) for bug reports and feature requests
318
+ - Security disclosures: [`SECURITY.md`](SECURITY.md)
319
+
320
+ This is a 1-maintainer project. Realistic response time: a few days for bug reports with reproducers, longer for open-ended discussions.
321
+
322
+ ---
323
+
324
+ ## Contributing
325
+
326
+ NeuroLisp is small by design. We review every PR with Occam's razor. New atoms, modules, or workflows must pass real-LLM end-to-end A/B validation before landing on main. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for setup, conventions, and the in-scope / out-of-scope list.
327
+
328
+ ---
329
+
330
+ ## License
331
+
332
+ [Apache 2.0](LICENSE). Copyright Bangcheng Wang and NeuroLisp contributors.