intentumdiff-python 0.0.1__py3-none-win_arm64.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 (165) hide show
  1. intentumdiff/__init__.py +134 -0
  2. intentumdiff/_differ_gate.py +210 -0
  3. intentumdiff/_differ_presentation.py +786 -0
  4. intentumdiff/_differ_runtime.py +320 -0
  5. intentumdiff/analysis/__init__.py +1 -0
  6. intentumdiff/analysis/compile_commands.py +151 -0
  7. intentumdiff/analysis/cross_file.py +71 -0
  8. intentumdiff/analysis/diagnostics.py +309 -0
  9. intentumdiff/analysis/guardrail_reports.py +254 -0
  10. intentumdiff/analysis/guardrails.py +318 -0
  11. intentumdiff/analysis/invariances.py +1207 -0
  12. intentumdiff/analysis/keyed_profiles.py +25 -0
  13. intentumdiff/analysis/resource_profiles.py +14 -0
  14. intentumdiff/analysis/schema_resolver.py +816 -0
  15. intentumdiff/analysis/text_review.py +46 -0
  16. intentumdiff/analysis/user_schemas.py +430 -0
  17. intentumdiff/assets.py +45 -0
  18. intentumdiff/cache/__init__.py +37 -0
  19. intentumdiff/cache/duckdb_store.py +98 -0
  20. intentumdiff/cache/sqlite_store.py +149 -0
  21. intentumdiff/cache/store.py +190 -0
  22. intentumdiff/cli/__init__.py +199 -0
  23. intentumdiff/cli/_commands.py +2141 -0
  24. intentumdiff/cli/_parser.py +1061 -0
  25. intentumdiff/cli/_shared.py +644 -0
  26. intentumdiff/content_type.py +59 -0
  27. intentumdiff/core/__init__.py +1 -0
  28. intentumdiff/core/commit_differ.py +599 -0
  29. intentumdiff/core/config.py +51 -0
  30. intentumdiff/core/cst_serializer.py +101 -0
  31. intentumdiff/core/diffignore.py +87 -0
  32. intentumdiff/core/index.py +189 -0
  33. intentumdiff/core/indexer.py +792 -0
  34. intentumdiff/core/models.py +837 -0
  35. intentumdiff/differ.py +2195 -0
  36. intentumdiff/github_app.py +287 -0
  37. intentumdiff/intentumdiff_rust_core/__init__.py +7 -0
  38. intentumdiff/intentumdiff_rust_core/ffi.py +8 -0
  39. intentumdiff/intentumdiff_rust_core/intentumdiff_rust_core.dll +0 -0
  40. intentumdiff/invariances/__init__.py +2 -0
  41. intentumdiff/invariances/rules.schema.json +283 -0
  42. intentumdiff/invariances/rules.yaml +349 -0
  43. intentumdiff/live_server.py +1314 -0
  44. intentumdiff/lsp/__init__.py +67 -0
  45. intentumdiff/lsp/client.py +544 -0
  46. intentumdiff/lsp/config.py +96 -0
  47. intentumdiff/lsp/enricher.py +227 -0
  48. intentumdiff/lsp/exceptions.py +27 -0
  49. intentumdiff/lsp/launcher.py +273 -0
  50. intentumdiff/lsp/servers.py +356 -0
  51. intentumdiff/lsp_server/__init__.py +14 -0
  52. intentumdiff/lsp_server/_codelens.py +67 -0
  53. intentumdiff/lsp_server/_diagnostics.py +62 -0
  54. intentumdiff/lsp_server/_handlers.py +175 -0
  55. intentumdiff/lsp_server/server.py +205 -0
  56. intentumdiff/plugins/__init__.py +1 -0
  57. intentumdiff/plugins/adapter.py +397 -0
  58. intentumdiff/plugins/builtins.py +323 -0
  59. intentumdiff/plugins/exceptions.py +93 -0
  60. intentumdiff/plugins/hub.py +1155 -0
  61. intentumdiff/plugins/language_metadata.py +250 -0
  62. intentumdiff/plugins/loader.py +1252 -0
  63. intentumdiff/plugins/registry.py +1079 -0
  64. intentumdiff/plugins/registry.schema.json +99 -0
  65. intentumdiff/plugins/registry_schema.py +280 -0
  66. intentumdiff/plugins/wit/plugin.wit +351 -0
  67. intentumdiff/rust_core.py +2370 -0
  68. intentumdiff/serve/__init__.py +19 -0
  69. intentumdiff/serve/_app.py +485 -0
  70. intentumdiff/serve/_static/index.html +326 -0
  71. intentumdiff/serve/_static/playground.js +567 -0
  72. intentumdiff/sources/__init__.py +1 -0
  73. intentumdiff/sources/base.py +28 -0
  74. intentumdiff/sources/file_source.py +48 -0
  75. intentumdiff/sources/git_source.py +375 -0
  76. intentumdiff/sources/live_buffer_source.py +113 -0
  77. intentumdiff/sources/patch_source.py +126 -0
  78. intentumdiff/sources/string_source.py +44 -0
  79. intentumdiff/testing.py +165 -0
  80. intentumdiff/vcs/__init__.py +37 -0
  81. intentumdiff/vcs/_safe_path.py +50 -0
  82. intentumdiff/vcs/base.py +136 -0
  83. intentumdiff/vcs/git_backend.py +97 -0
  84. intentumdiff/vcs/git_cli.py +100 -0
  85. intentumdiff/vcs/hg_backend.py +94 -0
  86. intentumdiff/vcs/perforce_backend.py +109 -0
  87. intentumdiff/vcs/svn_backend.py +105 -0
  88. intentumdiff/wasm/.gitkeep +2 -0
  89. intentumdiff/wasm/abap_parser.wasm +0 -0
  90. intentumdiff/wasm/adf_parser.wasm +0 -0
  91. intentumdiff/wasm/asciidoc_parser.wasm +0 -0
  92. intentumdiff/wasm/asm_parser.wasm +0 -0
  93. intentumdiff/wasm/assemblyscript_parser.wasm +0 -0
  94. intentumdiff/wasm/astro_parser.wasm +0 -0
  95. intentumdiff/wasm/bash_parser.wasm +0 -0
  96. intentumdiff/wasm/clojure_parser.wasm +0 -0
  97. intentumdiff/wasm/cmake_parser.wasm +0 -0
  98. intentumdiff/wasm/cpp_parser.wasm +0 -0
  99. intentumdiff/wasm/csharp_parser.wasm +0 -0
  100. intentumdiff/wasm/css_parser.wasm +0 -0
  101. intentumdiff/wasm/dart_parser.wasm +0 -0
  102. intentumdiff/wasm/databricks_parser.wasm +0 -0
  103. intentumdiff/wasm/dax_parser.wasm +0 -0
  104. intentumdiff/wasm/delphi_parser.wasm +0 -0
  105. intentumdiff/wasm/dockerfile_parser.wasm +0 -0
  106. intentumdiff/wasm/elixir_parser.wasm +0 -0
  107. intentumdiff/wasm/freebasic_parser.wasm +0 -0
  108. intentumdiff/wasm/generic_parser.wasm +0 -0
  109. intentumdiff/wasm/gitignore_parser.wasm +0 -0
  110. intentumdiff/wasm/go_parser.wasm +0 -0
  111. intentumdiff/wasm/gomod_parser.wasm +0 -0
  112. intentumdiff/wasm/graphql_parser.wasm +0 -0
  113. intentumdiff/wasm/groovy_parser.wasm +0 -0
  114. intentumdiff/wasm/haskell_parser.wasm +0 -0
  115. intentumdiff/wasm/html_parser.wasm +0 -0
  116. intentumdiff/wasm/ini_parser.wasm +0 -0
  117. intentumdiff/wasm/java_parser.wasm +0 -0
  118. intentumdiff/wasm/js_ts_parser.wasm +0 -0
  119. intentumdiff/wasm/json_parser.wasm +0 -0
  120. intentumdiff/wasm/kotlin_parser.wasm +0 -0
  121. intentumdiff/wasm/latex_parser.wasm +0 -0
  122. intentumdiff/wasm/lua_parser.wasm +0 -0
  123. intentumdiff/wasm/make_parser.wasm +0 -0
  124. intentumdiff/wasm/markdown_parser.wasm +0 -0
  125. intentumdiff/wasm/mdx_parser.wasm +0 -0
  126. intentumdiff/wasm/ocaml_parser.wasm +0 -0
  127. intentumdiff/wasm/odin_parser.wasm +0 -0
  128. intentumdiff/wasm/parser_manifest.json +590 -0
  129. intentumdiff/wasm/perl_parser.wasm +0 -0
  130. intentumdiff/wasm/php_parser.wasm +0 -0
  131. intentumdiff/wasm/plsql_parser.wasm +0 -0
  132. intentumdiff/wasm/po_parser.wasm +0 -0
  133. intentumdiff/wasm/postscript_parser.wasm +0 -0
  134. intentumdiff/wasm/powershell_parser.wasm +0 -0
  135. intentumdiff/wasm/proto_parser.wasm +0 -0
  136. intentumdiff/wasm/puppet_parser.wasm +0 -0
  137. intentumdiff/wasm/python_parser.wasm +0 -0
  138. intentumdiff/wasm/qsharp_parser.wasm +0 -0
  139. intentumdiff/wasm/r_parser.wasm +0 -0
  140. intentumdiff/wasm/reasonml_parser.wasm +0 -0
  141. intentumdiff/wasm/ruby_parser.wasm +0 -0
  142. intentumdiff/wasm/rust_parser.wasm +0 -0
  143. intentumdiff/wasm/sas_parser.wasm +0 -0
  144. intentumdiff/wasm/scala_parser.wasm +0 -0
  145. intentumdiff/wasm/scss_parser.wasm +0 -0
  146. intentumdiff/wasm/sql_parser.wasm +0 -0
  147. intentumdiff/wasm/squirrel_parser.wasm +0 -0
  148. intentumdiff/wasm/svelte_parser.wasm +0 -0
  149. intentumdiff/wasm/swift_parser.wasm +0 -0
  150. intentumdiff/wasm/terraform_parser.wasm +0 -0
  151. intentumdiff/wasm/toml_parser.wasm +0 -0
  152. intentumdiff/wasm/tsql_parser.wasm +0 -0
  153. intentumdiff/wasm/vbnet_parser.wasm +0 -0
  154. intentumdiff/wasm/vue_parser.wasm +0 -0
  155. intentumdiff/wasm/wat_parser.wasm +0 -0
  156. intentumdiff/wasm/xml_parser.wasm +0 -0
  157. intentumdiff/wasm/yaml_parser.wasm +0 -0
  158. intentumdiff/wasm/zig_parser.wasm +0 -0
  159. intentumdiff/watcher.py +259 -0
  160. intentumdiff_python-0.0.1.dist-info/METADATA +112 -0
  161. intentumdiff_python-0.0.1.dist-info/RECORD +165 -0
  162. intentumdiff_python-0.0.1.dist-info/WHEEL +4 -0
  163. intentumdiff_python-0.0.1.dist-info/entry_points.txt +80 -0
  164. intentumdiff_python-0.0.1.dist-info/licenses/LICENSE +21 -0
  165. intentumdiff_python-0.0.1.dist-info/sboms/intentumdiff-rust-core.cyclonedx.json +10968 -0
@@ -0,0 +1,109 @@
1
+ """
2
+ intentumdiff.vcs.perforce_backend
3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Perforce (Helix Core) VCS backend — a thin wrapper over the shared Rust VCS module
6
+ (#98, A2.4.4).
7
+
8
+ The Perforce operations (client-root discovery, blob read, changed-file listing, opened-file
9
+ status) live in the Rust core (``crates/rust-core-host/src/vcs_backend.rs``), which shells the
10
+ ``p4`` CLI with tagged (``-ztag``) output; this class only marshals to/from the
11
+ :class:`ChangedFile` DTO. p4python is no longer used — the core is the single implementation
12
+ shared by every binding.
13
+
14
+ .. note:: **Breaking change (A2.4.4).** This backend previously took an injected, pre-connected
15
+ ``P4`` object (p4python). It now shells the ``p4`` CLI, which resolves its connection the
16
+ standard Perforce way — from the environment (``P4PORT`` / ``P4USER`` / ``P4CLIENT``) or a
17
+ ``P4CONFIG`` file discovered from the working directory — matching how the git/hg/svn
18
+ backends resolve their connection. The constructor no longer accepts a ``P4`` object.
19
+
20
+ Ref syntax
21
+ ----------
22
+ ``ref`` strings map to Perforce changelist numbers (as strings, e.g. ``"12345"``) or label
23
+ specs (e.g. ``"rel-1.0"``); depot paths (``//depot/...``) are validated in the core, which
24
+ rejects embedded ``@``/``#`` revision specifiers (an #88 filespec-injection control).
25
+ """
26
+
27
+ from __future__ import annotations
28
+
29
+ import os
30
+ from pathlib import Path
31
+
32
+ from intentumdiff.vcs._safe_path import safe_working_tree_path
33
+ from intentumdiff.vcs.base import ChangedFile, VcsBackend
34
+
35
+
36
+ class PerforceVcsBackend(VcsBackend):
37
+ """Perforce VCS backend — thin wrapper over the Rust ``vcs_backend`` (p4 dialect).
38
+
39
+ Parameters
40
+ ----------
41
+ repo_path:
42
+ Path to any directory inside the Perforce client workspace; the client root is
43
+ resolved by the core (``p4 info``) unless *client_root* is given. The ``p4`` CLI
44
+ resolves the server connection from the environment / ``P4CONFIG``.
45
+ client_root:
46
+ The local workspace (client) root path. When ``None``, resolved from ``p4 info``.
47
+ """
48
+
49
+ _VCS = "p4"
50
+
51
+ def __init__(
52
+ self,
53
+ repo_path: str | os.PathLike[str] = ".",
54
+ client_root: str | os.PathLike[str] | None = None,
55
+ ) -> None:
56
+ from intentumdiff import rust_core
57
+
58
+ if client_root is not None:
59
+ self._root = os.fspath(client_root)
60
+ else:
61
+ self._root = rust_core.vcs_backend_resolve_root(self._VCS, os.fspath(repo_path))
62
+
63
+ # ------------------------------------------------------------------
64
+ # VcsBackend implementation
65
+ # ------------------------------------------------------------------
66
+
67
+ def get_blob(self, path: str, ref: str) -> str:
68
+ """Return file content at Perforce changelist/label *ref* ("" when absent).
69
+
70
+ *path* is a depot path (e.g. ``//depot/main/src/foo.py``); the core joins it with the
71
+ ``@ref`` revision specifier and runs ``p4 print``.
72
+ """
73
+ from intentumdiff import rust_core
74
+
75
+ return rust_core.vcs_backend_get_blob(self._VCS, self._root, path, ref)
76
+
77
+ def list_changed_files(self, ref_a: str, ref_b: str) -> list[ChangedFile]:
78
+ """Return files changed between Perforce changelists *ref_a* and *ref_b*."""
79
+ from intentumdiff import rust_core
80
+
81
+ return [
82
+ ChangedFile(**row)
83
+ for row in rust_core.vcs_backend_changed_files(
84
+ self._VCS, self._root, ref_a, ref_b
85
+ )
86
+ ]
87
+
88
+ def get_working_file(self, path: str) -> str:
89
+ """Return on-disk content of *path* (relative to the workspace root)."""
90
+ full_path = safe_working_tree_path(self._root, path)
91
+ try:
92
+ return full_path.read_text(encoding="utf-8", errors="replace")
93
+ except FileNotFoundError:
94
+ return ""
95
+
96
+ def list_working_tree_changes(self, ref: str = "default") -> list[ChangedFile]:
97
+ """Return files opened in the default pending changelist (``p4 opened``)."""
98
+ from intentumdiff import rust_core
99
+
100
+ return [
101
+ ChangedFile(**row)
102
+ for row in rust_core.vcs_backend_working_tree_changes(
103
+ self._VCS, self._root, ref
104
+ )
105
+ ]
106
+
107
+ def resolve_root(self) -> Path:
108
+ """Return the Perforce workspace (client) root path."""
109
+ return Path(self._root)
@@ -0,0 +1,105 @@
1
+ """
2
+ intentumdiff.vcs.svn_backend
3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Subversion VCS backend — a thin wrapper over the shared Rust VCS module (#98, A2.4.4).
6
+
7
+ The Subversion operations (root discovery, blob read, changed-file listing, ``svn --xml``
8
+ parsing) live in the Rust core (``crates/rust-core-host/src/vcs_backend.rs``), which shells the
9
+ ``svn`` CLI directly; this class only marshals to/from the :class:`ChangedFile` DTO. The XML
10
+ parsing that used to run here (defusedxml) is gone — the core is the single implementation
11
+ shared by every binding. The working-tree file read stays here (plain disk I/O, not VCS logic).
12
+
13
+ Ref syntax
14
+ ----------
15
+ ``ref`` strings map directly to SVN revision syntax: ``"HEAD"``, ``"BASE"``, ``"PREV"``, or an
16
+ integer revision number as a string (e.g. ``"42"``). Revision inputs are validated in the core
17
+ (an #88 control).
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ import os
23
+ from pathlib import Path
24
+
25
+ from intentumdiff.vcs._safe_path import safe_relative_path, safe_working_tree_path
26
+ from intentumdiff.vcs.base import ChangedFile, VcsBackend
27
+
28
+
29
+ class SvnVcsBackend(VcsBackend):
30
+ """Subversion VCS backend — thin wrapper over the Rust ``vcs_backend`` (svn dialect).
31
+
32
+ Parameters
33
+ ----------
34
+ working_copy:
35
+ Path to the SVN working copy root.
36
+ repo_url:
37
+ Repository URL (e.g. ``svn+ssh://svn.example.com/repos/proj``). When provided,
38
+ :meth:`get_blob` and :meth:`list_changed_files` target the repository URL directly (via
39
+ the core) and do not require the working copy to have the file checked out at that
40
+ revision.
41
+ """
42
+
43
+ _VCS = "svn"
44
+
45
+ def __init__(
46
+ self,
47
+ working_copy: str | os.PathLike[str],
48
+ repo_url: str | None = None,
49
+ ) -> None:
50
+ # The caller supplies the working-copy root; the core resolves the true wc-root on
51
+ # demand (resolve_root) rather than eagerly, so a bare path is accepted here.
52
+ self._root = os.fspath(working_copy)
53
+ self._repo_url = repo_url
54
+
55
+ # ------------------------------------------------------------------
56
+ # VcsBackend implementation
57
+ # ------------------------------------------------------------------
58
+
59
+ def get_blob(self, path: str, ref: str) -> str:
60
+ """Return file content at SVN revision *ref* ("" when absent)."""
61
+ from intentumdiff import rust_core
62
+
63
+ return rust_core.vcs_backend_get_blob(
64
+ self._VCS, self._root, safe_relative_path(path), ref, self._repo_url
65
+ )
66
+
67
+ def list_changed_files(self, ref_a: str, ref_b: str) -> list[ChangedFile]:
68
+ """Return files changed between SVN revisions *ref_a* and *ref_b*."""
69
+ from intentumdiff import rust_core
70
+
71
+ return [
72
+ ChangedFile(**row)
73
+ for row in rust_core.vcs_backend_changed_files(
74
+ self._VCS, self._root, ref_a, ref_b, self._repo_url
75
+ )
76
+ ]
77
+
78
+ def get_working_file(self, path: str) -> str:
79
+ """Return on-disk content of *path* in the SVN working copy."""
80
+ full_path = safe_working_tree_path(self._root, path)
81
+ try:
82
+ return full_path.read_text(encoding="utf-8", errors="replace")
83
+ except FileNotFoundError:
84
+ return ""
85
+
86
+ def list_working_tree_changes(self, ref: str = "BASE") -> list[ChangedFile]:
87
+ """Return uncommitted local modifications (``svn status --xml``).
88
+
89
+ The default *ref* value ``"BASE"`` is the SVN equivalent of ``HEAD``; ``svn status``
90
+ always compares against ``BASE``, so *ref* is accepted only for interface compatibility.
91
+ """
92
+ from intentumdiff import rust_core
93
+
94
+ return [
95
+ ChangedFile(**row)
96
+ for row in rust_core.vcs_backend_working_tree_changes(
97
+ self._VCS, self._root, ref
98
+ )
99
+ ]
100
+
101
+ def resolve_root(self) -> Path:
102
+ """Return the SVN working-copy root path (``svn info --show-item wc-root``)."""
103
+ from intentumdiff import rust_core
104
+
105
+ return Path(rust_core.vcs_backend_resolve_root(self._VCS, self._root))
@@ -0,0 +1,2 @@
1
+ # Placeholder — wasm/ is populated at build time by build.py
2
+ # The .gitignore excludes *.wasm from this directory.
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