ambitgraph 0.9.5__tar.gz → 0.9.7__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 (121) hide show
  1. ambitgraph-0.9.7/LICENSE +202 -0
  2. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/MANIFEST.in +1 -2
  3. {ambitgraph-0.9.5/ambitgraph.egg-info → ambitgraph-0.9.7}/PKG-INFO +2 -2
  4. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_contracts/grant.py +11 -11
  5. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/ambit-mapllm-contract.md +82 -12
  6. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/daemon.py +7 -11
  7. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/dialects/contract.py +18 -17
  8. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/dialects/fastapi_pack.py +6 -6
  9. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/dialects/supabase_pack.py +1 -1
  10. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/langmirror.py +38 -76
  11. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/load.py +4 -7
  12. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/mapllm.py +22 -14
  13. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/model.py +3 -6
  14. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/orchestrate.py +75 -97
  15. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/registry.py +63 -93
  16. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/serve.py +36 -46
  17. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_telegraph/export.py +8 -12
  18. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_telegraph/ledger.py +35 -45
  19. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/WALKTHROUGH.md +1 -5
  20. ambitgraph-0.9.7/ambitgraph/_delimited.py +353 -0
  21. ambitgraph-0.9.7/ambitgraph/architecture.py +397 -0
  22. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/cli.py +158 -109
  23. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/codelib.py +60 -169
  24. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/config.py +37 -14
  25. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/design_tokens.py +1 -0
  26. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/duplication.py +30 -37
  27. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/edges.py +96 -100
  28. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/emit.py +54 -1
  29. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/estimate.py +55 -38
  30. ambitgraph-0.9.7/ambitgraph/explain_stage.py +2145 -0
  31. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/families.py +4 -4
  32. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/gate.py +21 -12
  33. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/gate_check.py +531 -92
  34. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/harvest.py +18 -15
  35. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/inventory.py +49 -37
  36. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/jscalls.py +108 -102
  37. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/jsobjects.py +4 -2
  38. ambitgraph-0.9.7/ambitgraph/jsonlines.py +74 -0
  39. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/langs.py +352 -156
  40. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/merge.py +207 -233
  41. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/merge_jsp.py +1 -1
  42. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/objects.py +177 -35
  43. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/__init__.py +98 -31
  44. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/graph.js +11 -17
  45. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/library.js +58 -40
  46. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/next_embed.css +2 -4
  47. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/paths.js +4 -5
  48. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/standalone.py +1 -1
  49. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/wholemap.js +5 -4
  50. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/parameterize.py +62 -80
  51. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/pipeline.py +95 -32
  52. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/portal.py +50 -23
  53. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/prompts.py +3 -4
  54. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/pyshapes.py +73 -36
  55. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/report.py +22 -28
  56. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/shell.py +333 -324
  57. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/symbols.py +2253 -1680
  58. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/tables.py +46 -7
  59. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/text_capture.py +27 -35
  60. {ambitgraph-0.9.5 → ambitgraph-0.9.7/ambitgraph.egg-info}/PKG-INFO +2 -2
  61. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph.egg-info/SOURCES.txt +2 -0
  62. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/pyproject.toml +5 -5
  63. ambitgraph-0.9.5/LICENSE +0 -25
  64. ambitgraph-0.9.5/ambitgraph/_delimited.py +0 -149
  65. ambitgraph-0.9.5/ambitgraph/explain_stage.py +0 -504
  66. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/README.md +0 -0
  67. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_contracts/__init__.py +0 -0
  68. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_contracts/edge.py +0 -0
  69. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_contracts/envelope.py +0 -0
  70. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_contracts/fields.py +0 -0
  71. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_contracts/household.py +0 -0
  72. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/__init__.py +0 -0
  73. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/__main__.py +0 -0
  74. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/ambit-map-enrich.md +0 -0
  75. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/assistant.py +0 -0
  76. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/cli.py +0 -0
  77. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/dialects/__init__.py +0 -0
  78. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/dialects/express_pack.py +0 -0
  79. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/dialects/flask_pack.py +0 -0
  80. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_map/dialects/nextjs_pack.py +0 -0
  81. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_telegraph/__init__.py +0 -0
  82. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_telegraph/cli.py +0 -0
  83. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_telegraph/responsibility.py +0 -0
  84. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambit_telegraph/store.py +0 -0
  85. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/__init__.py +0 -0
  86. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/__main__.py +0 -0
  87. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/cockpit.py +0 -0
  88. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/console.py +0 -0
  89. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/demo.py +0 -0
  90. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/docs_discovery.py +0 -0
  91. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/doctor.py +0 -0
  92. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/engine_identity.py +0 -0
  93. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/eval.py +0 -0
  94. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/explain.py +0 -0
  95. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/feeds.py +0 -0
  96. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/gate_server.py +0 -0
  97. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/html_safe.py +0 -0
  98. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/mds.py +0 -0
  99. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/_init_js.py +0 -0
  100. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/charts.js +0 -0
  101. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/classdiagram.js +0 -0
  102. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/escape.js +0 -0
  103. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/filterpanel.js +0 -0
  104. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/insideview.js +0 -0
  105. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/objectcard.js +0 -0
  106. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/search.js +0 -0
  107. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/omniscient_next/siderail.js +0 -0
  108. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/pycalls.py +0 -0
  109. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/ratify.py +0 -0
  110. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/reports.py +0 -0
  111. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/responsibility.py +0 -0
  112. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/sample.py +0 -0
  113. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/secretary.py +0 -0
  114. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/stages.py +0 -0
  115. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/tasks.py +0 -0
  116. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph/urcode.py +0 -0
  117. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph.egg-info/dependency_links.txt +0 -0
  118. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph.egg-info/entry_points.txt +0 -0
  119. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph.egg-info/requires.txt +0 -0
  120. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/ambitgraph.egg-info/top_level.txt +0 -0
  121. {ambitgraph-0.9.5 → ambitgraph-0.9.7}/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.
@@ -7,8 +7,7 @@ prune docs
7
7
  prune build
8
8
  prune dist
9
9
 
10
- # Development evidence directories (screenshots, transcripts, review notes).
11
- # Both spellings: the dated evidence-* folders and the single evidence/ folder they moved into.
10
+ # Development evidence folders, in both spellings, never ship.
12
11
  prune evidence-*
13
12
  prune evidence
14
13
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ambitgraph
3
- Version: 0.9.5
3
+ Version: 0.9.7
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
@@ -151,11 +151,10 @@ def grant_is_active(grant, now: datetime, *, tokens_spent: int = 0,
151
151
 
152
152
  # The closed vocabulary `grant_is_active`'s own off-path walk can honestly
153
153
  # produce -- 'active' plus the six OFF paths, in the exact order
154
- # `grant_is_active` checks them. A PURE ADDITION: the Telegraph's own two
155
- # extra verdicts ('ambiguous', 'meter-unreadable') do NOT belong here -- a
156
- # package that does no I/O can never know a file is torn or that a
157
- # registry holds two records sharing an id, so an enum value this module
158
- # can never honestly return would be a lie.
154
+ # `grant_is_active` checks them. The Telegraph's own extra verdict
155
+ # ('ambiguous') does NOT belong here -- a package that does no I/O can never
156
+ # know that a registry holds two records sharing an id, so an enum value
157
+ # this module can never honestly return would be a lie.
159
158
  GRANT_VERDICTS = (
160
159
  "active", "absent", "master-off", "revoked", "expired",
161
160
  "tokens-exhausted", "turns-exhausted",
@@ -165,12 +164,13 @@ GRANT_VERDICTS = (
165
164
  def grant_liveness(grant, now: datetime, *, tokens_spent: int = 0,
166
165
  turns_spent: int = 0, revoked_ids=(),
167
166
  master_off: bool = False) -> str:
168
- """The verdict twin of `grant_is_active` -- a PURE ADDITION, and
169
- `grant_is_active` itself is not touched by one character. The boolean is
170
- decided in exactly ONE place: this function calls `grant_is_active` with
171
- the identical arguments first, and returns 'active' the moment it says
172
- True. `grant_liveness` never re-derives the rule and can never disagree
173
- with the function that is actually executed in production.
167
+ """The verdict twin of `grant_is_active`: it returns 'active' or the
168
+ name of the first OFF path that holds, while `grant_is_active` stays
169
+ the boolean. The boolean is decided in exactly ONE place: this
170
+ function calls `grant_is_active` with the identical arguments first,
171
+ and returns 'active' the moment it says True. `grant_liveness` never
172
+ re-derives the rule and can never disagree with the function that
173
+ decides the boolean.
174
174
 
175
175
  Only on False does this function walk the off-paths -- and it walks
176
176
  them in `grant_is_active`'s OWN order (master off, revoked, expired,
@@ -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
 
@@ -195,12 +264,12 @@ A refused draft never renders as an empty or zero judged plane — a plane that
195
264
  counts as a plane that loaded empty. Every other field this document does not name is tolerated
196
265
  additively: an unrecognised key is ignored, never a reason to refuse the whole file.
197
266
 
198
- ## What the acceptance of a real repository taught
267
+ ## Six ways a conforming file can still mislead
199
268
 
200
- The rules above are the shapes; running a real assistant against a real, unmodified public
201
- repository end to end found six ways a conforming file — or the run that produces it — can still
202
- mislead a reader even while it parses cleanly. Each is a rule for the assistant writing these
203
- files directly, not a change to the shapes themselves.
269
+ The rules above are the shapes; beyond them there are
270
+ six ways a conforming file — or the run that produces it — can still mislead a reader even
271
+ while it parses cleanly. Each is a rule for the assistant
272
+ writing these files directly, not a change to the shapes themselves.
204
273
 
205
274
  - **`parent` is a verbatim anchor, or the empty string — never prose, and never an external
206
275
  framework's name.** It is the exact `file::hook` text some other unit's own `anchor` field
@@ -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
@@ -1070,17 +1070,13 @@ def launch(args, out_dir, repo, idle_minutes, budget_s=None,
1070
1070
  instead and never calls this function at all) from this module's own
1071
1071
  invocation_form() plus the literal " map", and passes it through.
1072
1072
  `cmd=None` (the default) is resolved HERE the same way, from THIS
1073
- process's own argv0/executable -- so a caller that never heard of
1074
- this parameter (an existing test, an older caller) still gets a
1075
- real, typeable stop instruction rather than a KeyError.
1076
-
1077
- `cmd_name`, new for mapllm support: threaded to child_argv()
1078
- unchanged (see its own docstring), and
1079
- used to resolve `cmd` itself when the caller leaves it None -- "map"
1080
- (the default, byte-unchanged) or "mapllm". Every existing caller
1081
- either passes `cmd` explicitly (cmd_map does) or never heard of
1082
- `cmd_name` at all, so this default resolution changes nothing for
1083
- them.
1073
+ process's own argv0/executable -- so a caller that leaves `cmd` out
1074
+ still gets a real, typeable stop instruction rather than a KeyError.
1075
+
1076
+ `cmd_name` is threaded to child_argv() unchanged (see its own
1077
+ docstring), and used to resolve `cmd` itself when the caller leaves
1078
+ it None -- "map" (the default) or "mapllm". A caller that passes
1079
+ `cmd` explicitly (cmd_map does) never reaches that resolution.
1084
1080
 
1085
1081
  Returns (exit_code, lines_to_print, url_to_open_or_None). cmd_map is a
1086
1082
  thin caller: print each line, then orch.open_browser(url, not
@@ -354,10 +354,10 @@ def literal_string_arg_and_rest(args_text):
354
354
  if i >= n or s[i] not in ('"', "'"):
355
355
  return None, "" # bare name, attribute, or no immediate quote at all
356
356
  if prefix.lower() not in ("", "r"):
357
- return None, "" # f/F/rf/fr/b/B/rb/br -- never a literal in v1
357
+ return None, "" # f/F/rf/fr/b/B/rb/br -- never read as a literal
358
358
  quote = s[i]
359
359
  if s[i:i + 3] == quote * 3:
360
- return None, "" # triple-quoted route paths are not supported in v1
360
+ return None, "" # triple-quoted route paths are not supported
361
361
  j = i + 1
362
362
  buf = []
363
363
  closed = False
@@ -571,7 +571,7 @@ def attribute_tail(text):
571
571
 
572
572
  def attribute_head(text):
573
573
  """The FIRST identifier in a simple dotted attribute chain
574
- (`members.router` -> "members", `a.b.c` -> "a") -- None on the exact
574
+ (`ledgers.router` -> "ledgers", `a.b.c` -> "a") -- None on the exact
575
575
  same grammar attribute_tail refuses (a bare name, a call, a
576
576
  subscript, or anything else that is not a plain dotted chain of
577
577
  identifiers). Exists so an attribute-form mount argument's own HEAD
@@ -598,7 +598,10 @@ def attribute_head(text):
598
598
  # already handed to it, matching every other helper in this module.
599
599
  # ---------------------------------------------------------------------------
600
600
 
601
- _PY_FROM_IMPORT_HEADER_RE = re.compile(r'(?m)^[ \t]*from[ \t]+(\.*)([\w.]*)[ \t]+import\b')
601
+ # The gap after "from" is the whole run of spaces and tabs when a dotted name follows it, else the run but its last
602
+ # character, which the blank before "import" then takes; possessive runs read a long gap once, never re-split.
603
+ _PY_FROM_IMPORT_HEADER_RE = re.compile(r'(?m)^[ \t]*from(?:[ \t]++(?=[\w.])|(?:[ \t](?=[ \t]))++)'
604
+ r'(\.*+)([\w.]*+)[ \t]+import\b')
602
605
  _PY_IMPORT_RE = re.compile(r'(?m)^[ \t]*import[ \t]+([\w.]+)(?:[ \t]+as[ \t]+([A-Za-z_]\w*))?')
603
606
  _PY_IMPORT_NAME_RE = re.compile(r'^[A-Za-z_]\w*$')
604
607
 
@@ -607,10 +610,9 @@ def _py_clause_span(text, import_kw_end):
607
610
  """(start, end) of a from-import clause -- the names between `import`
608
611
  and the end of the statement, in `text`. A parenthesized clause's
609
612
  span (balanced-paren scan) covers every physical line it spans --
610
- `from .routers import (\\n members,\\n ...\\n)` reads correctly
611
- as one clause, the corpus's own DOMINANT multi-line shape (a
612
- representative "ten aggregates, each contributing a router"
613
- file). A bare (non-parenthesized) clause runs to the end of its own
613
+ `from .routers import (\\n ledgers,\\n ...\\n)` reads correctly
614
+ as one clause, the common multi-line shape (one file importing
615
+ several router modules at once). A bare (non-parenthesized) clause runs to the end of its own
614
616
  physical line only -- a backslash line continuation on a bare clause
615
617
  is not followed, never guessed at past it. None for an unterminated
616
618
  `(` -- the whole clause is simply not read, never guessed at. BY-VALUE
@@ -666,9 +668,8 @@ def py_import_maps(blanked_text):
666
668
  name_imports, so module_spec stays "" downstream
667
669
  and the renderer's own never-guess path (legacy
668
670
  name-coincidence resolution, then the honest
669
- MOUNT_UNRESOLVED note) applies -- exactly the
670
- posture the pre-existing legacy path already took
671
- on this same input before this map existed. A
671
+ MOUNT_UNRESOLVED note) applies -- the legacy
672
+ path's own posture on this same input. A
672
673
  name bound to the SAME target more than once
673
674
  (`from .auth import bp` repeated, or reached via
674
675
  two equivalent clauses) is unaffected -- there is
@@ -676,18 +677,18 @@ def py_import_maps(blanked_text):
676
677
  module_imports -- bound_alias -> module_spec for every plain `import
677
678
  <module_spec> [as <bound_alias>]` -- e.g. `import
678
679
  routers.users as u` yields module_imports["u"] ==
679
- "routers.users"; `import members` (no alias, one
680
- segment) yields module_imports["members"] ==
681
- "members". A DOTTED plain import with no alias
680
+ "routers.users"; `import ledgers` (no alias, one
681
+ segment) yields module_imports["ledgers"] ==
682
+ "ledgers". A DOTTED plain import with no alias
682
683
  (`import routers.users`) binds only the top
683
684
  package name in real Python, one hop short of what
684
685
  a two-segment attribute mount needs -- never
685
686
  guessed at, so it contributes nothing.
686
687
 
687
688
  Together with attribute_head_module_spec (below), these cover the
688
- ATTRIBUTE-FORM mount head (`include_router(members.router, ...)`) --
689
- including the corpus's own dominant shape, `from .routers import
690
- (members, ...)` then `members.router`: Python's `from package import
689
+ ATTRIBUTE-FORM mount head (`include_router(ledgers.router, ...)`) --
690
+ including the common shape, `from .routers import
691
+ (ledgers, ...)` then `ledgers.router`: Python's `from package import
691
692
  name` is ambiguous between "name is an object inside package" and
692
693
  "name is a submodule of package"; attribute_head_module_spec resolves
693
694
  that ambiguity the only way an attribute-mount head CAN (the
@@ -146,9 +146,9 @@ def extract(files, model):
146
146
  # says so
147
147
  # The attribute's own HEAD resolves through this
148
148
  # file's own `import <module_spec> [as head]` or `from
149
- # <module_spec> import head` -- the corpus's own DOMINANT
150
- # shape (`from .routers import (members, ...)` then
151
- # `members.router`). declared_name is the attribute's
149
+ # <module_spec> import head` -- the common
150
+ # shape (`from .routers import (ledgers, ...)` then
151
+ # `ledgers.router`). declared_name is the attribute's
152
152
  # tail either way.
153
153
  head = contract.attribute_head(parts[0])
154
154
  mod = contract.attribute_head_module_spec(head, module_imports, name_imports)
@@ -162,9 +162,9 @@ def extract(files, model):
162
162
  if not found:
163
163
  # NO prefix= at all -- a REAL mount at the
164
164
  # application root (FastAPI's own default), not "nothing
165
- # to say" -- this is the DOMINANT shape on a real corpus
166
- # (`app.include_router(members.router)`, no prefix=
167
- # anywhere), which used to vanish here entirely.
165
+ # to say" -- this is the common shape
166
+ # (`app.include_router(ledgers.router)`, no prefix=
167
+ # anywhere), and it is recorded as a root mount.
168
168
  mounts.append(contract.Mount(prefix="", router_name=router_name, uid=uid, line=line,
169
169
  module_spec=module_spec, declared_name=declared_name,
170
170
  root=True))
@@ -51,7 +51,7 @@ _CHAIN_CONTINUES = ".),"
51
51
 
52
52
  # Realtime channel table refs --
53
53
  # `<client>.channel(...).on('postgres_changes', {..., table: 'name'})`.
54
- # JS/TS only in v1 (SUPABASE_BLIND_REALTIME says so) -- the Python client's
54
+ # JS/TS only (SUPABASE_BLIND_REALTIME says so) -- the Python client's
55
55
  # equivalent is a differently-named method (on_postgres_changes), not this
56
56
  # same call shape, and adding it is out of scope here.
57
57
  CHANNEL_RE = re.compile(r'\b([A-Za-z_$][\w$]*)\s*\.\s*channel\s*\(')