invar-tools 1.15.4__py3-none-any.whl → 1.15.6__py3-none-any.whl

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.
@@ -213,7 +213,10 @@ def _run_map_python(path: Path, top_n: int, json_output: bool) -> Result[None, s
213
213
  file_infos: list[FileInfo] = []
214
214
  sources: dict[str, str] = {}
215
215
 
216
- for py_file in discover_python_files(path):
216
+ # Convert generator to list to release directory handles immediately (DX-82)
217
+ python_files = list(discover_python_files(path))
218
+
219
+ for py_file in python_files:
217
220
  try:
218
221
  content = py_file.read_text(encoding="utf-8")
219
222
  rel_path = str(py_file.relative_to(path))
@@ -228,6 +231,9 @@ def _run_map_python(path: Path, top_n: int, json_output: bool) -> Result[None, s
228
231
  console.print(f"[yellow]Warning:[/yellow] {py_file}: {e}")
229
232
  continue
230
233
 
234
+ # Release file list to free memory (DX-82)
235
+ del python_files
236
+
231
237
  if not file_infos:
232
238
  return Failure(
233
239
  "No Python symbols found.\n\n"
@@ -141,7 +141,9 @@ const factory: CustomToolFactory = (pi) => {
141
141
  throw new Error("Sig command was cancelled");
142
142
  }
143
143
 
144
- if (result.exitCode !== 0) {
144
+ // Only treat as error if exitCode is explicitly non-zero
145
+ // (Pi's exec may return undefined/null for success)
146
+ if (result.exitCode && result.exitCode !== 0) {
145
147
  const errorMsg = result.stderr || result.stdout || "Unknown error";
146
148
  throw new Error(`Failed to get signatures: ${errorMsg}`);
147
149
  }
@@ -200,7 +202,8 @@ const factory: CustomToolFactory = (pi) => {
200
202
  throw new Error("Map command was cancelled");
201
203
  }
202
204
 
203
- if (result.exitCode !== 0) {
205
+ // Only treat as error if exitCode is explicitly non-zero
206
+ if (result.exitCode && result.exitCode !== 0) {
204
207
  const errorMsg = result.stderr || result.stdout || "Unknown error";
205
208
  throw new Error(`Failed to generate map: ${errorMsg}`);
206
209
  }
@@ -263,7 +266,8 @@ const factory: CustomToolFactory = (pi) => {
263
266
  throw new Error("Doc toc command was cancelled");
264
267
  }
265
268
 
266
- if (result.exitCode !== 0) {
269
+ // Only treat as error if exitCode is explicitly non-zero
270
+ if (result.exitCode && result.exitCode !== 0) {
267
271
  const errorMsg = result.stderr || result.stdout || "Unknown error";
268
272
  throw new Error(`Failed to extract TOC: ${errorMsg}`);
269
273
  }
@@ -330,7 +334,8 @@ const factory: CustomToolFactory = (pi) => {
330
334
  throw new Error("Doc read command was cancelled");
331
335
  }
332
336
 
333
- if (result.exitCode !== 0) {
337
+ // Only treat as error if exitCode is explicitly non-zero
338
+ if (result.exitCode && result.exitCode !== 0) {
334
339
  const errorMsg = result.stderr || result.stdout || "Unknown error";
335
340
  throw new Error(`Failed to read section: ${errorMsg}`);
336
341
  }
@@ -403,7 +408,8 @@ const factory: CustomToolFactory = (pi) => {
403
408
  throw new Error("Doc find command was cancelled");
404
409
  }
405
410
 
406
- if (result.exitCode !== 0) {
411
+ // Only treat as error if exitCode is explicitly non-zero
412
+ if (result.exitCode && result.exitCode !== 0) {
407
413
  const errorMsg = result.stderr || result.stdout || "Unknown error";
408
414
  throw new Error(`Failed to find sections: ${errorMsg}`);
409
415
  }
@@ -490,7 +496,8 @@ const factory: CustomToolFactory = (pi) => {
490
496
  throw new Error("Doc replace command was cancelled");
491
497
  }
492
498
 
493
- if (result.exitCode !== 0) {
499
+ // Only treat as error if exitCode is explicitly non-zero
500
+ if (result.exitCode && result.exitCode !== 0) {
494
501
  const errorMsg = result.stderr || result.stdout || "Unknown error";
495
502
  throw new Error(`Failed to replace section: ${errorMsg}`);
496
503
  }
@@ -586,7 +593,8 @@ const factory: CustomToolFactory = (pi) => {
586
593
  throw new Error("Doc insert command was cancelled");
587
594
  }
588
595
 
589
- if (result.exitCode !== 0) {
596
+ // Only treat as error if exitCode is explicitly non-zero
597
+ if (result.exitCode && result.exitCode !== 0) {
590
598
  const errorMsg = result.stderr || result.stdout || "Unknown error";
591
599
  throw new Error(`Failed to insert content: ${errorMsg}`);
592
600
  }
@@ -662,7 +670,8 @@ const factory: CustomToolFactory = (pi) => {
662
670
  throw new Error("Doc delete command was cancelled");
663
671
  }
664
672
 
665
- if (result.exitCode !== 0) {
673
+ // Only treat as error if exitCode is explicitly non-zero
674
+ if (result.exitCode && result.exitCode !== 0) {
666
675
  const errorMsg = result.stderr || result.stdout || "Unknown error";
667
676
  throw new Error(`Failed to delete section: ${errorMsg}`);
668
677
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: invar-tools
3
- Version: 1.15.4
3
+ Version: 1.15.6
4
4
  Summary: AI-native software engineering tools with design-by-contract verification
5
5
  Project-URL: Homepage, https://github.com/tefx/invar
6
6
  Project-URL: Documentation, https://github.com/tefx/invar#readme
@@ -89,7 +89,7 @@ invar/shell/commands/hooks.py,sha256=W-SOnT4VQyUvXwipozkJwgEYfiOJGz7wksrbcdWegUg
89
89
  invar/shell/commands/init.py,sha256=vaPo0p7xBm3Nfgu9ytcvAjgk4dQBKvyEhrz_Cg1URMQ,23557
90
90
  invar/shell/commands/merge.py,sha256=nuvKo8m32-OL-SCQlS4SLKmOZxQ3qj-1nGCx1Pgzifw,8183
91
91
  invar/shell/commands/mutate.py,sha256=GwemiO6LlbGCBEQsBFnzZuKhF-wIMEl79GAMnKUWc8U,5765
92
- invar/shell/commands/perception.py,sha256=HewSv6Kv8Gw2UQqkGY2rP5YKlnwyC3LBrQ2hFVXXw30,19304
92
+ invar/shell/commands/perception.py,sha256=Vl6zgxkqtS3QRXBat6U_utNhpViyPFoPh899-OtDLgQ,19493
93
93
  invar/shell/commands/skill.py,sha256=oKVyaxQ_LK28FpJhRpBDpXcpRdUBK3n6rC0qD77ax1M,5803
94
94
  invar/shell/commands/sync_self.py,sha256=nmqBry7V2_enKwy2zzHg8UoedZNicLe3yKDhjmBeZ68,3880
95
95
  invar/shell/commands/template_sync.py,sha256=aNWyFPMFT7pSwHrvwGCqcKAwb4dp7S9tvZzy9H4gAnw,16094
@@ -143,7 +143,7 @@ invar/templates/onboard/assessment.md.jinja,sha256=EzqF0VUcxJZG2bVJLxTOyQlAERRbh
143
143
  invar/templates/onboard/roadmap.md.jinja,sha256=gmvZk4Hdwe0l3qSFV15QGcsr-OPMhsc6-1K9F2SFSIQ,3939
144
144
  invar/templates/onboard/patterns/python.md,sha256=3wwucAcQz0DlggtpqYo-ZCnmrXgBQ0aBgUHN_EZ1VW0,8681
145
145
  invar/templates/onboard/patterns/typescript.md,sha256=yOVfHtdAdjKkWNh66_dR7z2xEA4sggbIcCKthW-fqac,11983
146
- invar/templates/pi-tools/invar/index.ts,sha256=RM6eFnxePEFkCgBD8B1IB21Zv5lwPI-rCxAZifsTjGM,23169
146
+ invar/templates/pi-tools/invar/index.ts,sha256=fLA7nOJRg7f8VjCYQ-B-AvWoc-E-cbJ7fP0os4AMN3c,23914
147
147
  invar/templates/protocol/INVAR.md.jinja,sha256=t2ZIQZJvzDTJMrRw_ijUo6ScZmeNK0-nV-H7ztTIyQQ,1464
148
148
  invar/templates/protocol/python/architecture-examples.md,sha256=O96LH9WFpk7G9MrhSbifLS5pyibTIDG-_EGFF7g3V4M,1175
149
149
  invar/templates/protocol/python/contracts-syntax.md,sha256=Q6supTQ3tChVrlN7xhcdb3Q8VGIESxQLA-mQvrNIZmo,1162
@@ -181,10 +181,10 @@ invar/templates/skills/invar-reflect/template.md,sha256=Rr5hvbllvmd8jSLf_0ZjyKt6
181
181
  invar/templates/skills/investigate/SKILL.md.jinja,sha256=cp6TBEixBYh1rLeeHOR1yqEnFqv1NZYePORMnavLkQI,3231
182
182
  invar/templates/skills/propose/SKILL.md.jinja,sha256=6BuKiCqO1AEu3VtzMHy1QWGqr_xqG9eJlhbsKT4jev4,3463
183
183
  invar/templates/skills/review/SKILL.md.jinja,sha256=ET5mbdSe_eKgJbi2LbgFC-z1aviKcHOBw7J5Q28fr4U,14105
184
- invar_tools-1.15.4.dist-info/METADATA,sha256=-jdBBcJq9LTcRLPSU378m_K6E9fEIPXncb2qcYDmXes,28595
185
- invar_tools-1.15.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
186
- invar_tools-1.15.4.dist-info/entry_points.txt,sha256=RwH_EhqgtFPsnO6RcrwrAb70Zyfb8Mh6uUtztWnUxGk,102
187
- invar_tools-1.15.4.dist-info/licenses/LICENSE,sha256=qeFksp4H4kfTgQxPCIu3OdagXyiZcgBlVfsQ6M5oFyk,10767
188
- invar_tools-1.15.4.dist-info/licenses/LICENSE-GPL,sha256=IvZfC6ZbP7CLjytoHVzvpDZpD-Z3R_qa1GdMdWlWQ6Q,35157
189
- invar_tools-1.15.4.dist-info/licenses/NOTICE,sha256=joEyMyFhFY8Vd8tTJ-a3SirI0m2Sd0WjzqYt3sdcglc,2561
190
- invar_tools-1.15.4.dist-info/RECORD,,
184
+ invar_tools-1.15.6.dist-info/METADATA,sha256=-aaDj9nhXLxzwN2p0mIcYojuY-gfj11YFvSepUs1Zkw,28595
185
+ invar_tools-1.15.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
186
+ invar_tools-1.15.6.dist-info/entry_points.txt,sha256=RwH_EhqgtFPsnO6RcrwrAb70Zyfb8Mh6uUtztWnUxGk,102
187
+ invar_tools-1.15.6.dist-info/licenses/LICENSE,sha256=qeFksp4H4kfTgQxPCIu3OdagXyiZcgBlVfsQ6M5oFyk,10767
188
+ invar_tools-1.15.6.dist-info/licenses/LICENSE-GPL,sha256=IvZfC6ZbP7CLjytoHVzvpDZpD-Z3R_qa1GdMdWlWQ6Q,35157
189
+ invar_tools-1.15.6.dist-info/licenses/NOTICE,sha256=joEyMyFhFY8Vd8tTJ-a3SirI0m2Sd0WjzqYt3sdcglc,2561
190
+ invar_tools-1.15.6.dist-info/RECORD,,