intentumdiff-python 0.0.1__py3-none-win_amd64.whl → 0.0.2b2__py3-none-win_amd64.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.
Files changed (139) hide show
  1. intentumdiff/__init__.py +2 -0
  2. intentumdiff/__main__.py +12 -0
  3. intentumdiff/_differ_presentation.py +35 -682
  4. intentumdiff/_differ_runtime.py +13 -47
  5. intentumdiff/analysis/compile_commands.py +26 -141
  6. intentumdiff/analysis/cross_file.py +2 -4
  7. intentumdiff/analysis/guardrail_reports.py +7 -5
  8. intentumdiff/analysis/guardrails.py +110 -122
  9. intentumdiff/analysis/invariances.py +4 -1003
  10. intentumdiff/analysis/schema_resolver.py +49 -273
  11. intentumdiff/analysis/text_review.py +4 -3
  12. intentumdiff/analysis/user_schemas.py +55 -237
  13. intentumdiff/api.py +21 -0
  14. intentumdiff/cache/sqlite_store.py +5 -23
  15. intentumdiff/cli/__init__.py +59 -0
  16. intentumdiff/cli/_commands.py +174 -67
  17. intentumdiff/cli/_parser.py +11 -1
  18. intentumdiff/cli/_shared.py +96 -112
  19. intentumdiff/content_type.py +13 -30
  20. intentumdiff/core/commit_differ.py +105 -220
  21. intentumdiff/core/diffignore.py +28 -34
  22. intentumdiff/core/index.py +16 -18
  23. intentumdiff/core/indexer.py +148 -168
  24. intentumdiff/core/models.py +53 -14
  25. intentumdiff/differ.py +278 -605
  26. intentumdiff/github_app.py +35 -19
  27. intentumdiff/intentumdiff_rust_core/intentumdiff_rust_core.dll +0 -0
  28. intentumdiff/live_server.py +180 -17
  29. intentumdiff/lsp/client.py +7 -1
  30. intentumdiff/lsp/enricher.py +19 -119
  31. intentumdiff/lsp/exceptions.py +6 -7
  32. intentumdiff/lsp_server/_codelens.py +24 -57
  33. intentumdiff/lsp_server/_diagnostics.py +23 -51
  34. intentumdiff/lsp_server/_handlers.py +66 -8
  35. intentumdiff/lsp_server/server.py +28 -7
  36. intentumdiff/plugins/adapter.py +5 -0
  37. intentumdiff/plugins/builtins.py +7 -14
  38. intentumdiff/plugins/exceptions.py +4 -0
  39. intentumdiff/plugins/hub.py +1 -2
  40. intentumdiff/plugins/loader.py +229 -215
  41. intentumdiff/plugins/registry.py +249 -197
  42. intentumdiff/rust_core.py +744 -784
  43. intentumdiff/serve/_app.py +3 -10
  44. intentumdiff/sources/base.py +24 -0
  45. intentumdiff/sources/file_source.py +15 -2
  46. intentumdiff/sources/git_source.py +120 -58
  47. intentumdiff/sources/live_buffer_source.py +45 -5
  48. intentumdiff/sources/patch_source.py +36 -109
  49. intentumdiff/vcs/_safe_path.py +7 -0
  50. intentumdiff/vcs/base.py +6 -0
  51. intentumdiff/vcs/git_backend.py +1 -1
  52. intentumdiff/vcs/git_cli.py +38 -18
  53. intentumdiff/vcs/hg_backend.py +1 -1
  54. intentumdiff/vcs/perforce_backend.py +7 -1
  55. intentumdiff/vcs/svn_backend.py +1 -1
  56. intentumdiff/wasm/abap_parser.wasm +0 -0
  57. intentumdiff/wasm/adf_parser.wasm +0 -0
  58. intentumdiff/wasm/asciidoc_parser.wasm +0 -0
  59. intentumdiff/wasm/asm_parser.wasm +0 -0
  60. intentumdiff/wasm/assemblyscript_parser.wasm +0 -0
  61. intentumdiff/wasm/astro_parser.wasm +0 -0
  62. intentumdiff/wasm/bash_parser.wasm +0 -0
  63. intentumdiff/wasm/clojure_parser.wasm +0 -0
  64. intentumdiff/wasm/cmake_parser.wasm +0 -0
  65. intentumdiff/wasm/cpp_parser.wasm +0 -0
  66. intentumdiff/wasm/csharp_parser.wasm +0 -0
  67. intentumdiff/wasm/css_parser.wasm +0 -0
  68. intentumdiff/wasm/dart_parser.wasm +0 -0
  69. intentumdiff/wasm/databricks_parser.wasm +0 -0
  70. intentumdiff/wasm/dax_parser.wasm +0 -0
  71. intentumdiff/wasm/delphi_parser.wasm +0 -0
  72. intentumdiff/wasm/dockerfile_parser.wasm +0 -0
  73. intentumdiff/wasm/elixir_parser.wasm +0 -0
  74. intentumdiff/wasm/freebasic_parser.wasm +0 -0
  75. intentumdiff/wasm/generic_parser.wasm +0 -0
  76. intentumdiff/wasm/gitignore_parser.wasm +0 -0
  77. intentumdiff/wasm/go_parser.wasm +0 -0
  78. intentumdiff/wasm/gomod_parser.wasm +0 -0
  79. intentumdiff/wasm/graphql_parser.wasm +0 -0
  80. intentumdiff/wasm/groovy_parser.wasm +0 -0
  81. intentumdiff/wasm/haskell_parser.wasm +0 -0
  82. intentumdiff/wasm/html_parser.wasm +0 -0
  83. intentumdiff/wasm/html_renderer.wasm +0 -0
  84. intentumdiff/wasm/ini_parser.wasm +0 -0
  85. intentumdiff/wasm/java_parser.wasm +0 -0
  86. intentumdiff/wasm/js_ts_parser.wasm +0 -0
  87. intentumdiff/wasm/json_parser.wasm +0 -0
  88. intentumdiff/wasm/kotlin_parser.wasm +0 -0
  89. intentumdiff/wasm/latex_parser.wasm +0 -0
  90. intentumdiff/wasm/llm_renderer.wasm +0 -0
  91. intentumdiff/wasm/lua_parser.wasm +0 -0
  92. intentumdiff/wasm/make_parser.wasm +0 -0
  93. intentumdiff/wasm/markdown_parser.wasm +0 -0
  94. intentumdiff/wasm/mdx_parser.wasm +0 -0
  95. intentumdiff/wasm/ocaml_parser.wasm +0 -0
  96. intentumdiff/wasm/odin_parser.wasm +0 -0
  97. intentumdiff/wasm/parser_manifest.json +81 -2
  98. intentumdiff/wasm/patch_renderer.wasm +0 -0
  99. intentumdiff/wasm/perl_parser.wasm +0 -0
  100. intentumdiff/wasm/php_parser.wasm +0 -0
  101. intentumdiff/wasm/plsql_parser.wasm +0 -0
  102. intentumdiff/wasm/po_parser.wasm +0 -0
  103. intentumdiff/wasm/postscript_parser.wasm +0 -0
  104. intentumdiff/wasm/powershell_parser.wasm +0 -0
  105. intentumdiff/wasm/proto_parser.wasm +0 -0
  106. intentumdiff/wasm/puppet_parser.wasm +0 -0
  107. intentumdiff/wasm/python_parser.wasm +0 -0
  108. intentumdiff/wasm/qsharp_parser.wasm +0 -0
  109. intentumdiff/wasm/r_parser.wasm +0 -0
  110. intentumdiff/wasm/reasonml_parser.wasm +0 -0
  111. intentumdiff/wasm/ruby_parser.wasm +0 -0
  112. intentumdiff/wasm/rust_parser.wasm +0 -0
  113. intentumdiff/wasm/sas_parser.wasm +0 -0
  114. intentumdiff/wasm/scala_parser.wasm +0 -0
  115. intentumdiff/wasm/scss_parser.wasm +0 -0
  116. intentumdiff/wasm/sql_parser.wasm +0 -0
  117. intentumdiff/wasm/squirrel_parser.wasm +0 -0
  118. intentumdiff/wasm/svelte_parser.wasm +0 -0
  119. intentumdiff/wasm/swift_parser.wasm +0 -0
  120. intentumdiff/wasm/terminal_renderer.wasm +0 -0
  121. intentumdiff/wasm/terraform_parser.wasm +0 -0
  122. intentumdiff/wasm/toml_parser.wasm +0 -0
  123. intentumdiff/wasm/tsql_parser.wasm +0 -0
  124. intentumdiff/wasm/vbnet_parser.wasm +0 -0
  125. intentumdiff/wasm/vue_parser.wasm +0 -0
  126. intentumdiff/wasm/wasm_provenance.json +884 -0
  127. intentumdiff/wasm/wat_parser.wasm +0 -0
  128. intentumdiff/wasm/xml_parser.wasm +0 -0
  129. intentumdiff/wasm/yaml_parser.wasm +0 -0
  130. intentumdiff/wasm/zig_parser.wasm +0 -0
  131. intentumdiff_python-0.0.2b2.dist-info/METADATA +156 -0
  132. intentumdiff_python-0.0.2b2.dist-info/RECORD +171 -0
  133. {intentumdiff_python-0.0.1.dist-info → intentumdiff_python-0.0.2b2.dist-info}/WHEEL +1 -1
  134. {intentumdiff_python-0.0.1.dist-info → intentumdiff_python-0.0.2b2.dist-info}/sboms/intentumdiff-rust-core.cyclonedx.json +905 -379
  135. intentumdiff/core/cst_serializer.py +0 -101
  136. intentumdiff_python-0.0.1.dist-info/METADATA +0 -112
  137. intentumdiff_python-0.0.1.dist-info/RECORD +0 -165
  138. {intentumdiff_python-0.0.1.dist-info → intentumdiff_python-0.0.2b2.dist-info}/entry_points.txt +0 -0
  139. {intentumdiff_python-0.0.1.dist-info → intentumdiff_python-0.0.2b2.dist-info}/licenses/LICENSE +0 -0
@@ -72,29 +72,49 @@ def run_git_bytes(
72
72
 
73
73
 
74
74
  def parse_name_status_z(data: bytes) -> "list[tuple[str, str, str]]":
75
- """Parse ``git diff --name-status -z`` output into ``(code, old_path, new_path)``.
75
+ """Decode a complete Git name-status -z stream without losing file identities.
76
76
 
77
- For Add/Delete/Modify a single path follows the status; for Rename/Copy two
78
- paths follow (old then new). Paths are NUL-separated (``-z``).
77
+ Git uses NUL terminators to delimit status tokens and raw pathname bytes.
78
+ A malformed stream or an undecodable path is an integrity failure, never a
79
+ successful partial change inventory (Python #240).
79
80
  """
80
- tokens = [t for t in data.split(b"\0") if t]
81
+ if not data:
82
+ return []
83
+ if not data.endswith(b"\0"):
84
+ raise RuntimeError("Incomplete git name-status -z: missing NUL terminator")
85
+
86
+ tokens = data[:-1].split(b"\0")
81
87
  entries: list[tuple[str, str, str]] = []
82
88
  idx = 0
83
89
  while idx < len(tokens):
84
- status = tokens[idx].decode("ascii", errors="replace")
90
+ try:
91
+ status = tokens[idx].decode("ascii", errors="strict")
92
+ except UnicodeDecodeError as exc:
93
+ raise UnicodeError("Invalid ASCII Git change status") from exc
85
94
  idx += 1
86
- code = status[:1]
87
- if code in {"R", "C"}:
88
- if idx + 1 >= len(tokens):
89
- break
90
- old_path = tokens[idx].decode("utf-8", errors="replace")
91
- new_path = tokens[idx + 1].decode("utf-8", errors="replace")
92
- idx += 2
93
- else:
94
- if idx >= len(tokens):
95
- break
96
- old_path = tokens[idx].decode("utf-8", errors="replace")
97
- new_path = old_path
98
- idx += 1
95
+ if (
96
+ not status
97
+ or status[0] not in "ACDMRTUXB"
98
+ or (len(status) > 1 and (status[0] not in "RC" or not status[1:].isdigit()))
99
+ ):
100
+ raise RuntimeError(f"Invalid git name-status code: {status!r}")
101
+
102
+ code = status[0]
103
+ needed = 2 if code in {"R", "C"} else 1
104
+ if len(tokens) - idx < needed:
105
+ raise RuntimeError(
106
+ f"Truncated git name-status -z: {code!r} requires {needed} path(s)"
107
+ )
108
+
109
+ raw_paths = tokens[idx : idx + needed]
110
+ idx += needed
111
+ if any(not path for path in raw_paths):
112
+ raise RuntimeError("Empty filename in git name-status -z")
113
+ try:
114
+ paths = [path.decode("utf-8", errors="strict") for path in raw_paths]
115
+ except UnicodeDecodeError as exc:
116
+ raise UnicodeError("Invalid UTF-8 in Git change filename") from exc
117
+ old_path = paths[0]
118
+ new_path = paths[1] if needed == 2 else old_path
99
119
  entries.append((code, old_path, new_path))
100
120
  return entries
@@ -70,7 +70,7 @@ class HgVcsBackend(VcsBackend):
70
70
  """Return on-disk content of *path* in the Mercurial working directory."""
71
71
  full_path = safe_working_tree_path(self._root, path)
72
72
  try:
73
- return full_path.read_text(encoding="utf-8", errors="replace")
73
+ return full_path.read_text(encoding="utf-8", errors="strict")
74
74
  except FileNotFoundError:
75
75
  return ""
76
76
 
@@ -89,7 +89,7 @@ class PerforceVcsBackend(VcsBackend):
89
89
  """Return on-disk content of *path* (relative to the workspace root)."""
90
90
  full_path = safe_working_tree_path(self._root, path)
91
91
  try:
92
- return full_path.read_text(encoding="utf-8", errors="replace")
92
+ return full_path.read_text(encoding="utf-8", errors="strict")
93
93
  except FileNotFoundError:
94
94
  return ""
95
95
 
@@ -107,3 +107,9 @@ class PerforceVcsBackend(VcsBackend):
107
107
  def resolve_root(self) -> Path:
108
108
  """Return the Perforce workspace (client) root path."""
109
109
  return Path(self._root)
110
+
111
+ def guardrail_policy_path(self, path: str) -> str:
112
+ """Use Rust's authoritative client-view mapping for a depot identity."""
113
+ from intentumdiff import rust_core
114
+
115
+ return rust_core.p4_policy_path(self._root, path)
@@ -79,7 +79,7 @@ class SvnVcsBackend(VcsBackend):
79
79
  """Return on-disk content of *path* in the SVN working copy."""
80
80
  full_path = safe_working_tree_path(self._root, path)
81
81
  try:
82
- return full_path.read_text(encoding="utf-8", errors="replace")
82
+ return full_path.read_text(encoding="utf-8", errors="strict")
83
83
  except FileNotFoundError:
84
84
  return ""
85
85
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -8,8 +8,11 @@
8
8
  ".asm": "asm",
9
9
  ".astro": "astro",
10
10
  ".c": "c",
11
+ ".cfg": "ini",
11
12
  ".cjs": "javascript",
12
13
  ".clj": "clojure",
14
+ ".cmake": "cmake",
15
+ ".conf": "ini",
13
16
  ".cpp": "cpp",
14
17
  ".cs": "csharp",
15
18
  ".css": "css",
@@ -20,9 +23,11 @@
20
23
  ".ddl": "sql",
21
24
  ".dml": "sql",
22
25
  ".dockerignore": "gitignore",
26
+ ".editorconfig": "ini",
23
27
  ".eslintignore": "gitignore",
24
28
  ".ex": "elixir",
25
29
  ".gcloudignore": "gitignore",
30
+ ".gitconfig": "ini",
26
31
  ".gitignore": "gitignore",
27
32
  ".go": "go",
28
33
  ".gql": "graphql",
@@ -33,6 +38,7 @@
33
38
  ".hs": "haskell",
34
39
  ".htm": "html",
35
40
  ".html": "html",
41
+ ".ini": "ini",
36
42
  ".java": "java",
37
43
  ".js": "javascript",
38
44
  ".json": "json",
@@ -41,11 +47,13 @@
41
47
  ".latex": "latex",
42
48
  ".lua": "lua",
43
49
  ".m": "m",
50
+ ".make": "make",
44
51
  ".markdown": "markdown",
45
52
  ".md": "markdown",
46
53
  ".mdown": "markdown",
47
54
  ".mdx": "mdx",
48
55
  ".mjs": "javascript",
56
+ ".mk": "make",
49
57
  ".mkd": "markdown",
50
58
  ".mkdn": "markdown",
51
59
  ".ml": "ocaml",
@@ -61,6 +69,7 @@
61
69
  ".pot": "po",
62
70
  ".pp": "puppet",
63
71
  ".prettierignore": "gitignore",
72
+ ".proto": "proto",
64
73
  ".ps": "postscript",
65
74
  ".ps1": "powershell",
66
75
  ".py": "python",
@@ -79,6 +88,8 @@
79
88
  ".svelte": "svelte",
80
89
  ".swift": "swift",
81
90
  ".tex": "latex",
91
+ ".tf": "hcl",
92
+ ".toml": "toml",
82
93
  ".ts": "typescript",
83
94
  ".tsql": "tsql",
84
95
  ".tsx": "tsx",
@@ -86,12 +97,17 @@
86
97
  ".vb": "vbnet",
87
98
  ".vscodeignore": "gitignore",
88
99
  ".vue": "vue",
100
+ ".wast": "wast",
89
101
  ".wat": "wat",
90
102
  ".xml": "xml",
91
103
  ".yaml": "yaml",
92
104
  ".yml": "yaml",
93
105
  ".zig": "zig",
94
- "Dockerfile": "dockerfile"
106
+ "CMakeLists.txt": "cmake",
107
+ "Dockerfile": "dockerfile",
108
+ "GNUmakefile": "make",
109
+ "Makefile": "make",
110
+ "go.mod": "gomod"
95
111
  },
96
112
  "parsers": {
97
113
  "abap": {
@@ -159,6 +175,14 @@
159
175
  "plugin_id": "clojure",
160
176
  "wasm": "clojure_parser.wasm"
161
177
  },
178
+ "cmake": {
179
+ "extensions": [
180
+ "CMakeLists.txt",
181
+ ".cmake"
182
+ ],
183
+ "plugin_id": "cmake",
184
+ "wasm": "cmake_parser.wasm"
185
+ },
162
186
  "cpp": {
163
187
  "extensions": [
164
188
  ".cpp"
@@ -187,6 +211,11 @@
187
211
  "plugin_id": "dart",
188
212
  "wasm": "dart_parser.wasm"
189
213
  },
214
+ "databricks": {
215
+ "extensions": [],
216
+ "plugin_id": "databricks-workflow",
217
+ "wasm": "databricks_parser.wasm"
218
+ },
190
219
  "databricks-workflow": {
191
220
  "extensions": [
192
221
  ".yml"
@@ -251,6 +280,13 @@
251
280
  "plugin_id": "go",
252
281
  "wasm": "go_parser.wasm"
253
282
  },
283
+ "gomod": {
284
+ "extensions": [
285
+ "go.mod"
286
+ ],
287
+ "plugin_id": "gomod",
288
+ "wasm": "gomod_parser.wasm"
289
+ },
254
290
  "graphql": {
255
291
  "extensions": [
256
292
  ".gql",
@@ -275,7 +311,8 @@
275
311
  },
276
312
  "hcl": {
277
313
  "extensions": [
278
- ".hcl"
314
+ ".hcl",
315
+ ".tf"
279
316
  ],
280
317
  "plugin_id": "hcl",
281
318
  "wasm": "terraform_parser.wasm"
@@ -288,6 +325,17 @@
288
325
  "plugin_id": "html",
289
326
  "wasm": "html_parser.wasm"
290
327
  },
328
+ "ini": {
329
+ "extensions": [
330
+ ".ini",
331
+ ".cfg",
332
+ ".conf",
333
+ ".editorconfig",
334
+ ".gitconfig"
335
+ ],
336
+ "plugin_id": "ini",
337
+ "wasm": "ini_parser.wasm"
338
+ },
291
339
  "java": {
292
340
  "extensions": [
293
341
  ".java"
@@ -341,6 +389,16 @@
341
389
  "plugin_id": "m",
342
390
  "wasm": "dax_parser.wasm"
343
391
  },
392
+ "make": {
393
+ "extensions": [
394
+ "Makefile",
395
+ "GNUmakefile",
396
+ ".mk",
397
+ ".make"
398
+ ],
399
+ "plugin_id": "make",
400
+ "wasm": "make_parser.wasm"
401
+ },
344
402
  "markdown": {
345
403
  "extensions": [
346
404
  ".markdown",
@@ -417,6 +475,13 @@
417
475
  "plugin_id": "powershell",
418
476
  "wasm": "powershell_parser.wasm"
419
477
  },
478
+ "proto": {
479
+ "extensions": [
480
+ ".proto"
481
+ ],
482
+ "plugin_id": "proto",
483
+ "wasm": "proto_parser.wasm"
484
+ },
420
485
  "puppet": {
421
486
  "extensions": [
422
487
  ".pp"
@@ -519,6 +584,13 @@
519
584
  "plugin_id": "swift",
520
585
  "wasm": "swift_parser.wasm"
521
586
  },
587
+ "toml": {
588
+ "extensions": [
589
+ ".toml"
590
+ ],
591
+ "plugin_id": "toml",
592
+ "wasm": "toml_parser.wasm"
593
+ },
522
594
  "tsql": {
523
595
  "extensions": [
524
596
  ".tsql"
@@ -556,6 +628,13 @@
556
628
  "plugin_id": "vue",
557
629
  "wasm": "vue_parser.wasm"
558
630
  },
631
+ "wast": {
632
+ "extensions": [
633
+ ".wast"
634
+ ],
635
+ "plugin_id": "wat",
636
+ "wasm": "wat_parser.wasm"
637
+ },
559
638
  "wat": {
560
639
  "extensions": [
561
640
  ".wat"
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file