ambitgraph 0.9.4__tar.gz → 0.9.6__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 (120) hide show
  1. ambitgraph-0.9.6/LICENSE +202 -0
  2. {ambitgraph-0.9.4/ambitgraph.egg-info → ambitgraph-0.9.6}/PKG-INFO +2 -2
  3. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/ambit-mapllm-contract.md +77 -7
  4. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/mapllm.py +21 -13
  5. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/orchestrate.py +30 -10
  6. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/WALKTHROUGH.md +1 -5
  7. ambitgraph-0.9.6/ambitgraph/_delimited.py +257 -0
  8. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/cli.py +119 -50
  9. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/codelib.py +2 -2
  10. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/config.py +28 -6
  11. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/duplication.py +11 -12
  12. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/edges.py +65 -9
  13. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/emit.py +54 -1
  14. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/estimate.py +28 -8
  15. ambitgraph-0.9.6/ambitgraph/explain_stage.py +2132 -0
  16. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/gate.py +11 -1
  17. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/gate_check.py +529 -89
  18. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/harvest.py +18 -15
  19. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/inventory.py +1 -1
  20. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/jscalls.py +22 -18
  21. ambitgraph-0.9.6/ambitgraph/jsonlines.py +74 -0
  22. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/langs.py +247 -48
  23. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/merge.py +22 -25
  24. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/__init__.py +76 -0
  25. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/graph.js +1 -1
  26. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/library.js +93 -49
  27. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/next_embed.css +3 -4
  28. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/wholemap.js +5 -4
  29. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/parameterize.py +1 -1
  30. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/pipeline.py +63 -18
  31. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/portal.py +45 -18
  32. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/prompts.py +1 -1
  33. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/shell.py +105 -123
  34. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/symbols.py +777 -447
  35. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/tables.py +83 -1
  36. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/text_capture.py +24 -17
  37. {ambitgraph-0.9.4 → ambitgraph-0.9.6/ambitgraph.egg-info}/PKG-INFO +2 -2
  38. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph.egg-info/SOURCES.txt +1 -0
  39. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/pyproject.toml +5 -5
  40. ambitgraph-0.9.4/LICENSE +0 -25
  41. ambitgraph-0.9.4/ambitgraph/_delimited.py +0 -128
  42. ambitgraph-0.9.4/ambitgraph/explain_stage.py +0 -504
  43. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/MANIFEST.in +0 -0
  44. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/README.md +0 -0
  45. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_contracts/__init__.py +0 -0
  46. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_contracts/edge.py +0 -0
  47. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_contracts/envelope.py +0 -0
  48. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_contracts/fields.py +0 -0
  49. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_contracts/grant.py +0 -0
  50. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_contracts/household.py +0 -0
  51. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/__init__.py +0 -0
  52. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/__main__.py +0 -0
  53. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/ambit-map-enrich.md +0 -0
  54. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/assistant.py +0 -0
  55. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/cli.py +0 -0
  56. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/daemon.py +0 -0
  57. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/dialects/__init__.py +0 -0
  58. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/dialects/contract.py +0 -0
  59. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/dialects/express_pack.py +0 -0
  60. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/dialects/fastapi_pack.py +0 -0
  61. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/dialects/flask_pack.py +0 -0
  62. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/dialects/nextjs_pack.py +0 -0
  63. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/dialects/supabase_pack.py +0 -0
  64. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/langmirror.py +0 -0
  65. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/load.py +0 -0
  66. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/model.py +0 -0
  67. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/registry.py +0 -0
  68. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_map/serve.py +0 -0
  69. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_telegraph/__init__.py +0 -0
  70. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_telegraph/cli.py +0 -0
  71. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_telegraph/export.py +0 -0
  72. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_telegraph/ledger.py +0 -0
  73. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_telegraph/responsibility.py +0 -0
  74. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambit_telegraph/store.py +0 -0
  75. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/__init__.py +0 -0
  76. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/__main__.py +0 -0
  77. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/cockpit.py +0 -0
  78. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/console.py +0 -0
  79. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/demo.py +0 -0
  80. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/design_tokens.py +0 -0
  81. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/docs_discovery.py +0 -0
  82. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/doctor.py +0 -0
  83. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/engine_identity.py +0 -0
  84. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/eval.py +0 -0
  85. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/explain.py +0 -0
  86. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/families.py +0 -0
  87. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/feeds.py +0 -0
  88. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/gate_server.py +0 -0
  89. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/html_safe.py +0 -0
  90. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/jsobjects.py +0 -0
  91. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/mds.py +0 -0
  92. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/merge_jsp.py +0 -0
  93. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/objects.py +0 -0
  94. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/_init_js.py +0 -0
  95. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/charts.js +0 -0
  96. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/classdiagram.js +0 -0
  97. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/escape.js +0 -0
  98. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/filterpanel.js +0 -0
  99. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/insideview.js +0 -0
  100. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/objectcard.js +0 -0
  101. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/paths.js +0 -0
  102. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/search.js +0 -0
  103. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/siderail.js +0 -0
  104. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/omniscient_next/standalone.py +0 -0
  105. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/pycalls.py +0 -0
  106. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/pyshapes.py +0 -0
  107. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/ratify.py +0 -0
  108. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/report.py +0 -0
  109. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/reports.py +0 -0
  110. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/responsibility.py +0 -0
  111. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/sample.py +0 -0
  112. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/secretary.py +0 -0
  113. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/stages.py +0 -0
  114. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/tasks.py +0 -0
  115. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph/urcode.py +0 -0
  116. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph.egg-info/dependency_links.txt +0 -0
  117. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph.egg-info/entry_points.txt +0 -0
  118. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph.egg-info/requires.txt +0 -0
  119. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/ambitgraph.egg-info/top_level.txt +0 -0
  120. {ambitgraph-0.9.4 → ambitgraph-0.9.6}/setup.cfg +0 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ambitgraph
3
- Version: 0.9.4
3
+ Version: 0.9.6
4
4
  Summary: Read-only codebase scan: reusable units, families, roles, ownership candidates, duplication.
5
5
  Author: AmbitGraph
6
- License: Proprietary
6
+ License-Expression: Apache-2.0
7
7
  Keywords: codebase,scan,audit,duplication,refactoring,reuse
8
8
  Classifier: Development Status :: 3 - Alpha
9
9
  Classifier: Intended Audience :: Developers
@@ -10,8 +10,10 @@ The law stated plainly, again, because it never changes: everything in this docu
10
10
  *judgment*, not measurement. Nothing here is read, parsed, or counted by the deterministic scan.
11
11
  The map keeps the two vocabularies visibly apart — a judged note always renders inside the
12
12
  collapsed "Judged by your assistant" block, always carries the `judged` chip, and no judged
13
- number is ever added to a measured number. A plane built from this contract DECORATES the map;
14
- it never becomes authoritative over anything the scan itself measured.
13
+ number is ever added to a measured number. The `explain` stage's lines are the one exception to
14
+ where they render — each under its own EXPLAINED mark, never counted as the code's own words (see
15
+ that stage below). A plane built from this contract DECORATES the map; it never becomes
16
+ authoritative over anything the scan itself measured.
15
17
 
16
18
  ## Two ways to produce these files
17
19
 
@@ -31,9 +33,76 @@ scan command against the same output directory picks up from there.
31
33
 
32
34
  ## The stage results files
33
35
 
34
- Every stage below is optional except `extract`, `cluster`, and `roles` — `vocab` and `ownership`
35
- run only when the scan config declares a vocabulary or ownership areas; `suggest` runs only when
36
- the draft has ambiguous units queued for a human's ruling.
36
+ Every stage below is optional except `extract`, `cluster`, and `roles` — `explain` runs only when
37
+ the scan config turns `explain_capture` on, as `ambit mapllm` does; `vocab` and `ownership` run
38
+ only when the scan config declares a vocabulary or ownership areas; `suggest` runs only when the
39
+ draft has ambiguous units queued for a human's ruling.
40
+
41
+ ### The `explain` stage — `results/<stage>.json`
42
+
43
+ Runs only when the scan config turns `explain_capture` on — `ambit mapllm` does, with wider
44
+ excerpt bounds (`capture_bounds`, recorded in the run's `scan.json`); a plain `ambit map` or
45
+ `ambit scan` leaves it off and never pauses here. When it runs it is the FIRST paid stage,
46
+ straight after the free deterministic plane and before `extract`, and the cost band prints there.
47
+
48
+ It writes, under the run's `pending/` folder, one instruction file named `explain.task.md`, one
49
+ file per batch of units beside it (`explain.batch-*.md`), and the workflow script
50
+ `pending/<stage>.workflow.js`. A file whose current bytes already hold a cached answer is never put
51
+ in a task again; when every file's do, the run writes its own `results/<stage>.json` from the
52
+ cache and the stage costs nothing.
53
+
54
+ Each batch's agent returns one answer per file:
55
+
56
+ ```json
57
+ {"answers": [
58
+ {"uid": "helpers.py", "sha1": "a1b2c3d4e5f6",
59
+ "purpose": "why the file exists", "does": "what it does when it runs",
60
+ "must_not": "what it must never be used for", "card": "one line a reader can scan",
61
+ "names": ["shout"],
62
+ "definitions": [{"key": "shout@3", "line": "Turns a message into its loudest form."}]}
63
+ ]}
64
+ ```
65
+
66
+ `definitions` is a list — never a map — so two lines for one key stay visible and are both
67
+ refused. Its keys are `name@line`, exactly as the batch file gives them. The results file
68
+ `ambit harvest explain` writes, and the one the direct-results door writes, has this shape:
69
+
70
+ ```json
71
+ {
72
+ "v": 2,
73
+ "explanations": {"helpers.py": {"uid": "helpers.py", "sha1": "a1b2c3d4e5f6",
74
+ "purpose": "…", "does": "…", "must_not": "…",
75
+ "card": "…", "names": ["shout"]}},
76
+ "missing": [],
77
+ "invalid": [],
78
+ "definitions": {
79
+ "explained": {"helpers.py": {"sha1": "a1b2c3d4e5f6",
80
+ "lines": {"shout@3": "Turns a message into its loudest form."}}},
81
+ "invalid": [],
82
+ "missing": []
83
+ }
84
+ }
85
+ ```
86
+
87
+ A card and every definition line are shown on the map, so each is refused whole — never edited —
88
+ unless it is one sentence on one line of at most 120 characters with no digit, no number word, no
89
+ code-shaped word (an underscore, a bracket, a slash, a colon, a dotted or camel-cased name, a word
90
+ opening with a hyphen or holding two), no capital after the first word, no acronym, and none of
91
+ the names the file defines or reaches. A refused line goes to `invalid` with its reason and is
92
+ never shown; a line for a key nobody asked is refused as `unknown-key`.
93
+
94
+ Unlike every other stage here, these lines are not judged notes: the map shows a definition's line
95
+ in that definition's own entry, and a file's card as its brief, each under an EXPLAINED mark
96
+ naming the producer recorded for that file. A line is never counted as the code's own words and
97
+ never shown where the code carries its own.
98
+
99
+ **The map never shows this stage's results file as it stands.** Every scan re-checks every line
100
+ the run holds — its own results file, by either door, and the accepted answers kept in
101
+ `explain-cache.json` beside the run directories, which run rotation never deletes — against the
102
+ current rules and the current graph, and writes the result to the run's carried file,
103
+ `explain.carried.json` in its `results` folder. That checked file is the only one the map reads,
104
+ and it names each file's own producer under `producers`. A line written against bytes that have since changed is refused as `stale-sha1` until
105
+ the file is answered again.
37
106
 
38
107
  ### The `extract` stage — `results/<stage>.json`
39
108
 
@@ -229,8 +298,9 @@ files directly, not a change to the shapes themselves.
229
298
  and is simply false there. State only what this pass itself observed inside the files it was
230
299
  actually given.
231
300
  - **The number of stages a run produces is repository-dependent — never a fixed count to
232
- expect.** `vocab` and `ownership` run only when the scan's own config declares them (see "The
233
- stage results files" above); `suggest` runs only when at least one unit could not be accepted
301
+ expect.** `explain` runs only when the scan's own config turns its capture on; `vocab` and
302
+ `ownership` run only when the scan's own config declares them (see "The stage results files"
303
+ above); `suggest` runs only when at least one unit could not be accepted
234
304
  in bulk (the next rule names every reason that can queue one). Watch until the conductor's own
235
305
  exit; never assume in advance how many stages a given run will produce.
236
306
  - **The `suggest` queue is every unit the draft could not accept in bulk, and each entry's own
@@ -1,8 +1,12 @@
1
1
  """ambit_map/mapllm.py -- `ambit mapllm <repo>`: the LLM-assisted map for
2
2
  languages the deterministic readers don't parse yet -- THE CONDUCTOR.
3
- One command that closes the manual six-stage
3
+ One command that closes the manual
4
4
  scan/harvest loop -- scan, present ONE instruction, watch for the result,
5
- harvest, advance, repeat -- then serves exactly as `ambit map` does.
5
+ harvest, advance, repeat -- then serves exactly as `ambit map` does. Its
6
+ generated config turns the explain capture on, so the loop's first stage is
7
+ `explain` (one line per definition with no words of its own) and the six map
8
+ stages follow; every stage takes the same pending-marker, harvest-child and
9
+ direct-results door.
6
10
 
7
11
  THE TRANSMISSION BOUNDARY IS KEPT VERBATIM: this
8
12
  module executes nothing of the user's own LLM and holds no key. It spawns
@@ -329,7 +333,7 @@ def _advance_from(plan, run_dir, initial_result=None, run_scan=None, spawn_harve
329
333
 
330
334
  def bootstrap_mapllm(plan, run_scan=None, spawn_harvest=None, sleep=None,
331
335
  print_fn=print, poll_interval_s=MAPLLM_POLL_INTERVAL_SECONDS):
332
- """Drive `plan` through the six-stage scan/harvest loop and return once it completes.
336
+ """Drive `plan` through the scan/harvest loop and return once it completes.
333
337
  Logic: marks plan's stranger-language groups once, then shares its advancing loop
334
338
  with _advance_from (the same mechanism cmd_mapllm's --foreground path uses, there
335
339
  for an existing run_dir; here for a fresh one). --once has no server to bind, so
@@ -384,7 +388,7 @@ def _conduct_in_background(plan, run_dir, initial_result, run_scan=None,
384
388
 
385
389
 
386
390
  def cmd_mapllm(args) -> int:
387
- """`ambit mapllm <repo>`: run the six-stage scan/harvest loop automatically, then serve
391
+ """`ambit mapllm <repo>`: run the scan/harvest loop automatically, then serve
388
392
  the result -- THE CONDUCTOR, the same --once/detached-launch/--foreground three-branch
389
393
  shape as cmd_map.
390
394
  Logic: --foreground binds and serves on ONE scan immediately (SERVE FIRST) and advances
@@ -426,11 +430,13 @@ def cmd_mapllm(args) -> int:
426
430
  try:
427
431
  # flavor="mapllm" keeps this run's out-dir and serve record separate from a
428
432
  # `map` server for the same repo; extra_include_ext admits the stranger-language
429
- # files orch.plan's GENERATED config would otherwise exclude (an explicit
430
- # --config stays untouched)
433
+ # files orch.plan's GENERATED config would otherwise exclude; explain_capture
434
+ # turns the explain capture on in that same generated config, so the loop's
435
+ # first stage is explain (an explicit --config stays untouched by either)
431
436
  plan = orch.plan(args.repo, out=args.out, config=args.config,
432
437
  budget=budget, flavor="mapllm",
433
- extra_include_ext=orch.MAPLLM_EXTRA_INCLUDE_EXT)
438
+ extra_include_ext=orch.MAPLLM_EXTRA_INCLUDE_EXT,
439
+ explain_capture=True)
434
440
  result, model = bootstrap_mapllm(plan) # result: this run's ScanResult; model: its MapModel
435
441
  except (orch.OutInsideRepo, orch.ScanFailed, MapllmProtocolError,
436
442
  MapllmHarvestFailed) as exc:
@@ -449,11 +455,12 @@ def cmd_mapllm(args) -> int:
449
455
  # <repo> --foreground --no-open ...`, via cmd_name="mapllm") that
450
456
  # runs the full conductor loop and serves, then returns.
451
457
  try:
452
- # flavor/extra_include_ext: isolates this server from a `map` server and
453
- # admits stranger files (as above)
458
+ # flavor/extra_include_ext/explain_capture: isolates this server from a `map`
459
+ # server, admits stranger files and turns the explain capture on (as above)
454
460
  plan = orch.plan(args.repo, out=args.out, config=args.config,
455
461
  budget=budget, flavor="mapllm",
456
- extra_include_ext=orch.MAPLLM_EXTRA_INCLUDE_EXT)
462
+ extra_include_ext=orch.MAPLLM_EXTRA_INCLUDE_EXT,
463
+ explain_capture=True)
457
464
  except orch.OutInsideRepo as exc:
458
465
  print(str(exc))
459
466
  return 2
@@ -481,11 +488,12 @@ def cmd_mapllm(args) -> int:
481
488
  # advancing that SAME run_dir in a background thread.
482
489
  from . import serve as srv
483
490
  try:
484
- # flavor/extra_include_ext: isolates this server from a `map` server and
485
- # admits stranger files (as above)
491
+ # flavor/extra_include_ext/explain_capture: isolates this server from a `map`
492
+ # server, admits stranger files and turns the explain capture on (as above)
486
493
  plan = orch.plan(args.repo, out=args.out, config=args.config,
487
494
  budget=budget, flavor="mapllm",
488
- extra_include_ext=orch.MAPLLM_EXTRA_INCLUDE_EXT)
495
+ extra_include_ext=orch.MAPLLM_EXTRA_INCLUDE_EXT,
496
+ explain_capture=True)
489
497
  except orch.OutInsideRepo as exc:
490
498
  print(str(exc))
491
499
  return 2
@@ -178,6 +178,11 @@ ENGINE_DEFAULT_INCLUDE_EXT = langm.ENGINE_DEFAULT_INCLUDE_EXT
178
178
  # never ENGINE_DEFAULT_INCLUDE_EXT itself. sourced from langmirror.py,
179
179
  # same posture as the admission tuple above.
180
180
  MAPLLM_EXTRA_INCLUDE_EXT = langm.MAPLLM_EXTRA_INCLUDE_EXT
181
+ # the per-file excerpt bounds a mapllm run's generated config sets beside the
182
+ # explain capture switch: wider than the engine's default, so a definition deep
183
+ # in a long file is still inside the text the explain task can quote. The
184
+ # engine records the pair in each run's scan.json.
185
+ MAPLLM_CAPTURE_BOUNDS = {"lines": 3000, "chars": 150000}
181
186
  FAIL_TAIL_CHARS = 1200
182
187
  DIALECT_FILENAME = "product-dialect.json"
183
188
  _DIALECT_ROOT_FILES = ("package.json", "requirements.txt", "pyproject.toml")
@@ -463,7 +468,7 @@ def default_out_dir(repo, platform=None, env=None, flavor=None) -> Path:
463
468
 
464
469
 
465
470
  def plan(repo, out=None, config=None, budget=ENGINE_BUDGET_SECONDS, flavor=None,
466
- extra_include_ext=()) -> Plan:
471
+ extra_include_ext=(), explain_capture=False) -> Plan:
467
472
  """`flavor` (the serve flavor) only
468
473
  ever affects the COMPUTED default out dir -- an explicit `out` is
469
474
  still honoured VERBATIM, exactly as before this feature, so a caller who
@@ -477,7 +482,12 @@ def plan(repo, out=None, config=None, budget=ENGINE_BUDGET_SECONDS, flavor=None,
477
482
  config the caller already controls. `extra_include_ext=()` (the
478
483
  default, `ambit map`'s own posture) is byte-unchanged from before
479
484
  this parameter existed -- see product_config()'s own docstring for
480
- what a non-empty value does."""
485
+ what a non-empty value does.
486
+
487
+ `explain_capture` (the mapllm explain stage): threaded, like
488
+ extra_include_ext, ONLY to the generated product config -- a
489
+ caller-supplied `config` is never rewritten. False (the default) leaves
490
+ the generated config without it."""
481
491
  repo_p = Path(repo).resolve()
482
492
  out_p = Path(out).resolve() if out else default_out_dir(repo_p, flavor=flavor)
483
493
  # duplicated BY VALUE from ambitgraph/pipeline.py:164-170 -- refuse HERE so
@@ -488,7 +498,8 @@ def plan(repo, out=None, config=None, budget=ENGINE_BUDGET_SECONDS, flavor=None,
488
498
  if config:
489
499
  cfg_path, generated = Path(config), False # VERBATIM, untouched
490
500
  else:
491
- cfg_path, generated = write_product_config(out_p, extra_include_ext), True
501
+ cfg_path, generated = write_product_config(
502
+ out_p, extra_include_ext, explain_capture), True
492
503
  return Plan(repo_p, out_p, cfg_path, generated,
493
504
  _exclude_dirs_from_config(cfg_path, generated),
494
505
  _include_ext_from_config(cfg_path, generated, extra_include_ext),
@@ -500,7 +511,7 @@ def plan(repo, out=None, config=None, budget=ENGINE_BUDGET_SECONDS, flavor=None,
500
511
  # ---------------------------------------------------------------------------
501
512
 
502
513
 
503
- def product_config(extra_include_ext=()) -> dict:
514
+ def product_config(extra_include_ext=(), explain_capture=False) -> dict:
504
515
  """ONLY the keys we override. ScanConfig.load (config.py:114-127) starts
505
516
  from every engine default and applies just what the file names, so one
506
517
  key here IS 'the engine's defaults plus ours'.
@@ -511,21 +522,30 @@ def product_config(extra_include_ext=()) -> dict:
511
522
  widens the admitted extensions for THIS generated config alone.
512
523
  Empty (the `map`/`scan` default, and every call site before this
513
524
  feature) -> the returned dict is byte-identical to before this parameter
514
- existed; ENGINE_DEFAULT_INCLUDE_EXT itself is never touched."""
525
+ existed; ENGINE_DEFAULT_INCLUDE_EXT itself is never touched.
526
+
527
+ `explain_capture` (the mapllm explain stage): when True, ALSO turns the
528
+ engine's `explain_capture` on with MAPLLM_CAPTURE_BOUNDS, so the scan keeps
529
+ each file's text and pauses for the explain stage. False adds nothing."""
515
530
  cfg = {"exclude_dirs": list(DEFAULT_EXCLUDE_DIRS)}
516
531
  if extra_include_ext:
517
532
  cfg["include_ext"] = list(ENGINE_DEFAULT_INCLUDE_EXT) + list(extra_include_ext)
533
+ if explain_capture:
534
+ cfg["explain_capture"] = True
535
+ # a fresh copy each call, so no caller can edit the shared bounds
536
+ cfg["capture_bounds"] = dict(MAPLLM_CAPTURE_BOUNDS)
518
537
  return cfg
519
538
 
520
539
 
521
- def write_product_config(out_dir, extra_include_ext=()) -> Path:
540
+ def write_product_config(out_dir, extra_include_ext=(), explain_capture=False) -> Path:
522
541
  """Written into the OUT dir, never the repo -- the map writes nothing
523
542
  into the code it reads. Overwritten each plan() so a version bump of the
524
- exclusion list reaches an existing install. `extra_include_ext` is
525
- threaded straight through to product_config() -- see its own
526
- docstring."""
543
+ exclusion list reaches an existing install. `extra_include_ext` and
544
+ `explain_capture` are threaded straight through to product_config() --
545
+ see its own docstring."""
527
546
  p = Path(out_dir) / CONFIG_FILENAME
528
- p.write_text(json.dumps(product_config(extra_include_ext), indent=1) + "\n",
547
+ p.write_text(json.dumps(product_config(extra_include_ext, explain_capture),
548
+ indent=1) + "\n",
529
549
  encoding="utf-8", newline="\n")
530
550
  return p
531
551
 
@@ -154,11 +154,7 @@ you a silent production bug. Refusing it *is* the product."
154
154
  `async def`, whole class, class method — the four-step sequence reaching
155
155
  green is proven on a FIXTURE built to that shape. The corpus above holds no
156
156
  real example that qualifies, and we say that rather than let a green fixture
157
- imply one. **BUILT and measured, once, in production:** a consolidation under
158
- this same four-step sequence has landed in a real production codebase — cluster
159
- dup019 — with the receipt recorded against its merge record. That landing was
160
- on a different language's surface, not one of the Python shapes above, and it
161
- happened once. Once is not routine, and we say so.
157
+ imply one.
162
158
 
163
159
  **And the one thing we do not claim:** "consolidates real-world Python"
164
160
  awaits the parameterized motion — designed and specified, awaiting its