@opensip-cli/graph-rust 0.1.0

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 (72) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/cache-key.test.d.ts +9 -0
  5. package/dist/__tests__/cache-key.test.d.ts.map +1 -0
  6. package/dist/__tests__/cache-key.test.js +49 -0
  7. package/dist/__tests__/cache-key.test.js.map +1 -0
  8. package/dist/__tests__/depends-on-emission.test.d.ts +15 -0
  9. package/dist/__tests__/depends-on-emission.test.d.ts.map +1 -0
  10. package/dist/__tests__/depends-on-emission.test.js +266 -0
  11. package/dist/__tests__/depends-on-emission.test.js.map +1 -0
  12. package/dist/__tests__/discover.test.d.ts +8 -0
  13. package/dist/__tests__/discover.test.d.ts.map +1 -0
  14. package/dist/__tests__/discover.test.js +65 -0
  15. package/dist/__tests__/discover.test.js.map +1 -0
  16. package/dist/__tests__/parse.test.d.ts +8 -0
  17. package/dist/__tests__/parse.test.d.ts.map +1 -0
  18. package/dist/__tests__/parse.test.js +64 -0
  19. package/dist/__tests__/parse.test.js.map +1 -0
  20. package/dist/__tests__/resolve-dependencies-branches.test.d.ts +18 -0
  21. package/dist/__tests__/resolve-dependencies-branches.test.d.ts.map +1 -0
  22. package/dist/__tests__/resolve-dependencies-branches.test.js +194 -0
  23. package/dist/__tests__/resolve-dependencies-branches.test.js.map +1 -0
  24. package/dist/__tests__/resolve.test.d.ts +23 -0
  25. package/dist/__tests__/resolve.test.d.ts.map +1 -0
  26. package/dist/__tests__/resolve.test.js +476 -0
  27. package/dist/__tests__/resolve.test.js.map +1 -0
  28. package/dist/__tests__/walk-branches.test.d.ts +13 -0
  29. package/dist/__tests__/walk-branches.test.d.ts.map +1 -0
  30. package/dist/__tests__/walk-branches.test.js +124 -0
  31. package/dist/__tests__/walk-branches.test.js.map +1 -0
  32. package/dist/__tests__/walk.test.d.ts +11 -0
  33. package/dist/__tests__/walk.test.d.ts.map +1 -0
  34. package/dist/__tests__/walk.test.js +324 -0
  35. package/dist/__tests__/walk.test.js.map +1 -0
  36. package/dist/body-digest.d.ts +31 -0
  37. package/dist/body-digest.d.ts.map +1 -0
  38. package/dist/body-digest.js +136 -0
  39. package/dist/body-digest.js.map +1 -0
  40. package/dist/cache-key.d.ts +19 -0
  41. package/dist/cache-key.d.ts.map +1 -0
  42. package/dist/cache-key.js +20 -0
  43. package/dist/cache-key.js.map +1 -0
  44. package/dist/discover.d.ts +22 -0
  45. package/dist/discover.d.ts.map +1 -0
  46. package/dist/discover.js +33 -0
  47. package/dist/discover.js.map +1 -0
  48. package/dist/index.d.ts +53 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +56 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/parse.d.ts +17 -0
  53. package/dist/parse.d.ts.map +1 -0
  54. package/dist/parse.js +14 -0
  55. package/dist/parse.js.map +1 -0
  56. package/dist/resolve-dependencies.d.ts +13 -0
  57. package/dist/resolve-dependencies.d.ts.map +1 -0
  58. package/dist/resolve-dependencies.js +261 -0
  59. package/dist/resolve-dependencies.js.map +1 -0
  60. package/dist/resolve.d.ts +45 -0
  61. package/dist/resolve.d.ts.map +1 -0
  62. package/dist/resolve.js +262 -0
  63. package/dist/resolve.js.map +1 -0
  64. package/dist/rule-hints.d.ts +16 -0
  65. package/dist/rule-hints.d.ts.map +1 -0
  66. package/dist/rule-hints.js +50 -0
  67. package/dist/rule-hints.js.map +1 -0
  68. package/dist/walk.d.ts +47 -0
  69. package/dist/walk.d.ts.map +1 -0
  70. package/dist/walk.js +564 -0
  71. package/dist/walk.js.map +1 -0
  72. package/package.json +54 -0
package/LICENSE ADDED
@@ -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.
package/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ OpenSIP CLI
2
+ Copyright 2026 opensip-ai
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
+ this software except in compliance with the License. A copy of the License is
6
+ included in the LICENSE file and is also available at:
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ <!-- Generated by scripts/build-package-readmes.mjs — do not edit by hand.
2
+ Change the package's "description" (or the generator template) and run
3
+ `pnpm docs:readmes`. CI enforces sync via `pnpm docs:readmes:check`. -->
4
+
5
+ # @opensip-cli/graph-rust
6
+
7
+ > Rust language adapter for the opensip graph engine
8
+
9
+ This is a **graph language adapter**. Install it alongside the CLI to add language support to `opensip graph`.
10
+
11
+ Part of [**opensip-cli**](https://github.com/opensip-ai/opensip-cli) — an open-source codebase-analysis toolkit: fitness checks (`fit`), static call-graph analysis (`graph`), and simulation (`sim`).
12
+
13
+ ## Install
14
+
15
+ Most users install the CLI, which bundles the first-party tools:
16
+
17
+ ```bash
18
+ curl -fsSL https://opensip.ai/cli/install.sh | bash
19
+ ```
20
+
21
+ This package is published for the CLI and advanced plugin authors; most users should not install `@opensip-cli/graph-rust` directly.
22
+
23
+ ## Documentation
24
+
25
+ - 📚 Project docs: https://opensip.ai/docs/opensip-cli/
26
+ - 🧭 Package catalog (what every package does): https://github.com/opensip-ai/opensip-cli/blob/v0.1.0/docs/public/70-reference/02-package-catalog.md
27
+ - 📦 Source: https://github.com/opensip-ai/opensip-cli/tree/v0.1.0/packages/graph/graph-rust
28
+
29
+ ## License
30
+
31
+ Apache-2.0 © opensip-ai
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Branch-coverage tests for lang-rust/cache-key.ts.
3
+ *
4
+ * Exercises the four config-path branches: undefined / empty,
5
+ * non-existent path, valid file, and the deterministic hash for
6
+ * repeated calls.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=cache-key.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-key.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/cache-key.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Branch-coverage tests for lang-rust/cache-key.ts.
3
+ *
4
+ * Exercises the four config-path branches: undefined / empty,
5
+ * non-existent path, valid file, and the deterministic hash for
6
+ * repeated calls.
7
+ */
8
+ import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
9
+ import { tmpdir } from 'node:os';
10
+ import { join } from 'node:path';
11
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
12
+ import { cacheKey } from '../cache-key.js';
13
+ describe('lang-rust cacheKey — branches', () => {
14
+ let dir;
15
+ beforeEach(() => {
16
+ dir = mkdtempSync(join(tmpdir(), 'graph-rust-cachekey-'));
17
+ });
18
+ afterEach(() => {
19
+ rmSync(dir, { recursive: true, force: true });
20
+ });
21
+ it('returns rs-no-config when configPathAbs is undefined', () => {
22
+ expect(cacheKey({ projectDirAbs: dir, resolutionMode: 'exact' })).toBe('rs-no-config');
23
+ });
24
+ it('returns rs-no-config when configPathAbs is empty string', () => {
25
+ expect(cacheKey({ projectDirAbs: dir, configPathAbs: '', resolutionMode: 'exact' })).toBe('rs-no-config');
26
+ });
27
+ it('returns rs-missing:<path> when the config file does not exist', () => {
28
+ const fake = join(dir, 'no-such-file.toml');
29
+ expect(cacheKey({ projectDirAbs: dir, configPathAbs: fake, resolutionMode: 'exact' })).toContain('missing:');
30
+ });
31
+ it('returns a stable rs-<hash> when the config file is readable', () => {
32
+ const file = join(dir, 'Cargo.toml');
33
+ writeFileSync(file, '[package]\nname = "x"\n', 'utf8');
34
+ const a = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
35
+ const b = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
36
+ expect(a).toBe(b);
37
+ expect(a.startsWith('rs-')).toBe(true);
38
+ expect(a).not.toBe('rs-no-config');
39
+ });
40
+ it('changes when the config file content changes', () => {
41
+ const file = join(dir, 'Cargo.toml');
42
+ writeFileSync(file, '[package]\nname = "a"\n', 'utf8');
43
+ const a = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
44
+ writeFileSync(file, '[package]\nname = "b"\n', 'utf8');
45
+ const b = cacheKey({ projectDirAbs: dir, configPathAbs: file, resolutionMode: 'exact' });
46
+ expect(a).not.toBe(b);
47
+ });
48
+ });
49
+ //# sourceMappingURL=cache-key.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-key.test.js","sourceRoot":"","sources":["../../src/__tests__/cache-key.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,IAAI,GAAW,CAAC;IAEhB,UAAU,CAAC,GAAG,EAAE;QACd,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAA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AAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACrC,aAAa,CAAC,IAAI,EAAE,yBAAyB,EAAE,MAAM,CAAC,CAAC;QACvD,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;QACzF,aAAa,CAAC,IAAI,EAAE,yBAAyB,EAAE,MAAM,CAAC,CAAC;QACvD,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;QACzF,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Tests for the Rust adapter's module-level depends_on edge emission.
3
+ * Phase 4 Task 4.5 of opensip's substrate consolidation (opensip DEC-498).
4
+ *
5
+ * Exercises the full adapter contract surface (discoverFiles →
6
+ * parseProject → walkProject → resolveCallSites) against small fixtures
7
+ * covering the Rust `use`-declaration matrix: absolute `crate::` paths,
8
+ * `super::` / `self::` relative paths, grouped imports, aliased imports,
9
+ * globs, stdlib + third-party paths, missing Cargo.toml, and
10
+ * declaration-free files.
11
+ *
12
+ * Mirrors the Go adapter's Task 4.4 test layout.
13
+ */
14
+ export {};
15
+ //# sourceMappingURL=depends-on-emission.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depends-on-emission.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/depends-on-emission.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
@@ -0,0 +1,266 @@
1
+ /**
2
+ * Tests for the Rust adapter's module-level depends_on edge emission.
3
+ * Phase 4 Task 4.5 of opensip's substrate consolidation (opensip DEC-498).
4
+ *
5
+ * Exercises the full adapter contract surface (discoverFiles →
6
+ * parseProject → walkProject → resolveCallSites) against small fixtures
7
+ * covering the Rust `use`-declaration matrix: absolute `crate::` paths,
8
+ * `super::` / `self::` relative paths, grouped imports, aliased imports,
9
+ * globs, stdlib + third-party paths, missing Cargo.toml, and
10
+ * declaration-free files.
11
+ *
12
+ * Mirrors the Go adapter's Task 4.4 test layout.
13
+ */
14
+ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
15
+ import { tmpdir } from 'node:os';
16
+ import { join } from 'node:path';
17
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
18
+ import { rustGraphAdapter } from '../index.js';
19
+ let fixtureRoot;
20
+ beforeEach(() => {
21
+ fixtureRoot = mkdtempSync(join(tmpdir(), 'graph-rust-depends-on-'));
22
+ });
23
+ afterEach(() => {
24
+ rmSync(fixtureRoot, { recursive: true, force: true });
25
+ });
26
+ function writeFile(rel, content) {
27
+ const abs = join(fixtureRoot, rel);
28
+ mkdirSync(join(abs, '..'), { recursive: true });
29
+ writeFileSync(abs, content, 'utf8');
30
+ }
31
+ function findModuleInit(catalog, filePath) {
32
+ for (const occs of Object.values(catalog.functions)) {
33
+ for (const o of occs) {
34
+ if (o.kind === 'module-init' && o.filePath === filePath)
35
+ return o;
36
+ }
37
+ }
38
+ return undefined;
39
+ }
40
+ function runAdapter() {
41
+ const discovery = rustGraphAdapter.discoverFiles({ cwd: fixtureRoot });
42
+ const parsed = rustGraphAdapter.parseProject({
43
+ projectDirAbs: discovery.projectDirAbs,
44
+ files: discovery.files,
45
+ compilerOptions: discovery.compilerOptions,
46
+ resolutionMode: 'exact',
47
+ });
48
+ const walked = rustGraphAdapter.walkProject({
49
+ project: parsed.project,
50
+ projectDirAbs: discovery.projectDirAbs,
51
+ files: discovery.files,
52
+ });
53
+ const initialCatalog = {
54
+ version: '3.0',
55
+ tool: 'graph',
56
+ language: 'rust',
57
+ builtAt: new Date().toISOString(),
58
+ cacheKey: 'test',
59
+ functions: walked.occurrences,
60
+ };
61
+ const resolved = rustGraphAdapter.resolveCallSites({
62
+ project: parsed.project,
63
+ catalog: initialCatalog,
64
+ callSites: walked.callSites,
65
+ dependencySites: walked.dependencySites,
66
+ projectDirAbs: discovery.projectDirAbs,
67
+ resolutionMode: 'exact',
68
+ });
69
+ return { catalog: initialCatalog, dependenciesByOwner: resolved.dependenciesByOwner };
70
+ }
71
+ const CARGO_TOML = `[package]\nname = "myproj"\nversion = "0.1.0"\nedition = "2021"\n`;
72
+ describe('Rust adapter — depends_on emission (Phase 4)', () => {
73
+ it('resolves a simple absolute `crate::` import to the target module-init', () => {
74
+ writeFile('Cargo.toml', CARGO_TOML);
75
+ writeFile('src/lib.rs', `pub mod foo;\n\nuse crate::foo::bar;\n\npub fn run() {}\n`);
76
+ writeFile('src/foo.rs', `pub fn bar() -> i32 { 1 }\n`);
77
+ const { catalog, dependenciesByOwner } = runAdapter();
78
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
79
+ const fooInit = findModuleInit(catalog, 'src/foo.rs');
80
+ expect(libInit, 'lib module-init').toBeDefined();
81
+ expect(fooInit, 'foo module-init').toBeDefined();
82
+ expect(dependenciesByOwner, 'dependenciesByOwner').toBeDefined();
83
+ const libDeps = dependenciesByOwner.get(libInit.bodyHash);
84
+ expect(libDeps, 'lib has dependency edges').toHaveLength(1);
85
+ expect(libDeps[0].specifier).toBe('crate::foo::bar');
86
+ // `crate::foo::bar` — `bar` is an item, not a module, so resolution
87
+ // walks back to `crate::foo`.
88
+ expect(libDeps[0].to).toEqual([fooInit.bodyHash]);
89
+ });
90
+ it('resolves a nested module import — `crate::foo::sub`', () => {
91
+ writeFile('Cargo.toml', CARGO_TOML);
92
+ writeFile('src/lib.rs', `pub mod foo;\n\nuse crate::foo::sub::Item;\n\nfn _use(_: Item) {}\n`);
93
+ writeFile('src/foo.rs', `pub mod sub;\n`);
94
+ writeFile('src/foo/sub.rs', `pub struct Item;\n`);
95
+ const { catalog, dependenciesByOwner } = runAdapter();
96
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
97
+ const subInit = findModuleInit(catalog, 'src/foo/sub.rs');
98
+ expect(libInit).toBeDefined();
99
+ expect(subInit).toBeDefined();
100
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
101
+ expect(deps).toHaveLength(1);
102
+ expect(deps[0].specifier).toBe('crate::foo::sub::Item');
103
+ expect(deps[0].to).toEqual([subInit.bodyHash]);
104
+ });
105
+ it('resolves `super::sibling` from a nested module', () => {
106
+ writeFile('Cargo.toml', CARGO_TOML);
107
+ writeFile('src/lib.rs', `pub mod a;\n`);
108
+ writeFile('src/a/mod.rs', `pub mod b;\npub mod sibling;\n`);
109
+ writeFile('src/a/b.rs', `use super::sibling::Thing;\n\nfn _use(_: Thing) {}\n`);
110
+ writeFile('src/a/sibling.rs', `pub struct Thing;\n`);
111
+ const { catalog, dependenciesByOwner } = runAdapter();
112
+ const bInit = findModuleInit(catalog, 'src/a/b.rs');
113
+ const siblingInit = findModuleInit(catalog, 'src/a/sibling.rs');
114
+ expect(bInit).toBeDefined();
115
+ expect(siblingInit).toBeDefined();
116
+ const deps = dependenciesByOwner.get(bInit.bodyHash);
117
+ expect(deps).toHaveLength(1);
118
+ expect(deps[0].specifier).toBe('super::sibling::Thing');
119
+ expect(deps[0].to).toEqual([siblingInit.bodyHash]);
120
+ });
121
+ it('resolves `self::child` from a parent module file', () => {
122
+ writeFile('Cargo.toml', CARGO_TOML);
123
+ writeFile('src/lib.rs', `pub mod a;\n`);
124
+ writeFile('src/a/mod.rs', `pub mod child;\n\nuse self::child::Thing;\n\nfn _use(_: Thing) {}\n`);
125
+ writeFile('src/a/child.rs', `pub struct Thing;\n`);
126
+ const { catalog, dependenciesByOwner } = runAdapter();
127
+ const aInit = findModuleInit(catalog, 'src/a/mod.rs');
128
+ const childInit = findModuleInit(catalog, 'src/a/child.rs');
129
+ expect(aInit).toBeDefined();
130
+ expect(childInit).toBeDefined();
131
+ const deps = dependenciesByOwner.get(aInit.bodyHash);
132
+ expect(deps).toHaveLength(1);
133
+ expect(deps[0].specifier).toBe('self::child::Thing');
134
+ expect(deps[0].to).toEqual([childInit.bodyHash]);
135
+ });
136
+ it('emits unresolved edges for stdlib imports', () => {
137
+ writeFile('Cargo.toml', CARGO_TOML);
138
+ writeFile('src/lib.rs', `use std::collections::HashMap;\n\npub fn run(_: HashMap<i32, i32>) {}\n`);
139
+ const { catalog, dependenciesByOwner } = runAdapter();
140
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
141
+ expect(libInit).toBeDefined();
142
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
143
+ expect(deps).toHaveLength(1);
144
+ expect(deps[0].specifier).toBe('std::collections::HashMap');
145
+ expect(deps[0].to).toEqual([]);
146
+ });
147
+ it('emits unresolved edges for third-party imports', () => {
148
+ writeFile('Cargo.toml', CARGO_TOML);
149
+ writeFile('src/lib.rs', `use serde::Deserialize;\n\npub fn run() {}\n`);
150
+ const { catalog, dependenciesByOwner } = runAdapter();
151
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
152
+ expect(libInit).toBeDefined();
153
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
154
+ expect(deps).toHaveLength(1);
155
+ expect(deps[0].specifier).toBe('serde::Deserialize');
156
+ expect(deps[0].to).toEqual([]);
157
+ });
158
+ it('handles grouped imports — emits one dep site per terminal path', () => {
159
+ writeFile('Cargo.toml', CARGO_TOML);
160
+ writeFile('src/lib.rs', `use std::{io::Read, fs::File};\n\npub fn run() {}\n`);
161
+ const { catalog, dependenciesByOwner } = runAdapter();
162
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
163
+ expect(libInit).toBeDefined();
164
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
165
+ expect(deps).toHaveLength(2);
166
+ const specifiers = deps.map((d) => d.specifier).sort();
167
+ expect(specifiers).toEqual(['std::fs::File', 'std::io::Read']);
168
+ for (const d of deps) {
169
+ expect(d.to).toEqual([]);
170
+ }
171
+ });
172
+ it('treats `self` inside a group as a reference to the parent path', () => {
173
+ writeFile('Cargo.toml', CARGO_TOML);
174
+ writeFile('src/lib.rs', `use std::io::{self, Read};\n\npub fn run() {}\n`);
175
+ const { catalog, dependenciesByOwner } = runAdapter();
176
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
177
+ expect(libInit).toBeDefined();
178
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
179
+ expect(deps).toHaveLength(2);
180
+ const specifiers = deps.map((d) => d.specifier).sort();
181
+ expect(specifiers).toEqual(['std::io', 'std::io::Read']);
182
+ for (const d of deps) {
183
+ expect(d.to).toEqual([]);
184
+ }
185
+ });
186
+ it('treats aliased imports the same as unaliased (alias does not change specifier)', () => {
187
+ writeFile('Cargo.toml', CARGO_TOML);
188
+ writeFile('src/lib.rs', `pub mod foo;\n\nuse crate::foo::Bar as Baz;\n\nfn _use(_: Baz) {}\n`);
189
+ writeFile('src/foo.rs', `pub struct Bar;\n`);
190
+ const { catalog, dependenciesByOwner } = runAdapter();
191
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
192
+ const fooInit = findModuleInit(catalog, 'src/foo.rs');
193
+ expect(libInit).toBeDefined();
194
+ expect(fooInit).toBeDefined();
195
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
196
+ expect(deps).toHaveLength(1);
197
+ expect(deps[0].specifier).toBe('crate::foo::Bar');
198
+ expect(deps[0].to).toEqual([fooInit.bodyHash]);
199
+ });
200
+ it('emits a glob dep site with trailing `*`; resolver leaves it unresolved (v1 limitation)', () => {
201
+ writeFile('Cargo.toml', CARGO_TOML);
202
+ writeFile('src/lib.rs', `pub mod foo;\n\nuse crate::foo::*;\n\npub fn run() {}\n`);
203
+ writeFile('src/foo.rs', `pub struct A;\npub struct B;\n`);
204
+ const { catalog, dependenciesByOwner } = runAdapter();
205
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
206
+ expect(libInit).toBeDefined();
207
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
208
+ expect(deps).toHaveLength(1);
209
+ expect(deps[0].specifier).toBe('crate::foo::*');
210
+ expect(deps[0].to).toEqual([]);
211
+ });
212
+ it('treats `<package-name>::…` as equivalent to `crate::…`', () => {
213
+ writeFile('Cargo.toml', CARGO_TOML);
214
+ writeFile('src/lib.rs', `pub mod foo;\n\nuse myproj::foo::Bar;\n\nfn _use(_: Bar) {}\n`);
215
+ writeFile('src/foo.rs', `pub struct Bar;\n`);
216
+ const { catalog, dependenciesByOwner } = runAdapter();
217
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
218
+ const fooInit = findModuleInit(catalog, 'src/foo.rs');
219
+ expect(libInit).toBeDefined();
220
+ expect(fooInit).toBeDefined();
221
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
222
+ expect(deps).toHaveLength(1);
223
+ expect(deps[0].specifier).toBe('myproj::foo::Bar');
224
+ expect(deps[0].to).toEqual([fooInit.bodyHash]);
225
+ });
226
+ it('treats all `crate::` imports as unresolved when Cargo.toml is missing', () => {
227
+ // No Cargo.toml — package name unknown, `crate::…` cannot anchor.
228
+ writeFile('src/lib.rs', `pub mod foo;\n\nuse crate::foo::Bar;\n\nfn _use(_: Bar) {}\n`);
229
+ writeFile('src/foo.rs', `pub struct Bar;\n`);
230
+ const { catalog, dependenciesByOwner } = runAdapter();
231
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
232
+ expect(libInit).toBeDefined();
233
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
234
+ // Even without Cargo.toml, `crate::` still anchors against the
235
+ // module-path map derived from `src/` layout (no need for the
236
+ // package name). The resolver does NOT require Cargo.toml for
237
+ // `crate::` resolution — only for the `<package-name>::` alias.
238
+ // Document this behavior here:
239
+ expect(deps).toHaveLength(1);
240
+ expect(deps[0].specifier).toBe('crate::foo::Bar');
241
+ expect(deps[0].to).toEqual([findModuleInit(catalog, 'src/foo.rs').bodyHash]);
242
+ });
243
+ it('treats `<package-name>::…` as unresolved when Cargo.toml is missing', () => {
244
+ // Without Cargo.toml, the package-name alias is the only path we
245
+ // genuinely lose; verify that surfaces as unresolved.
246
+ writeFile('src/lib.rs', `pub mod foo;\n\nuse myproj::foo::Bar;\n\nfn _use(_: Bar) {}\n`);
247
+ writeFile('src/foo.rs', `pub struct Bar;\n`);
248
+ const { catalog, dependenciesByOwner } = runAdapter();
249
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
250
+ expect(libInit).toBeDefined();
251
+ const deps = dependenciesByOwner.get(libInit.bodyHash);
252
+ expect(deps).toHaveLength(1);
253
+ expect(deps[0].specifier).toBe('myproj::foo::Bar');
254
+ expect(deps[0].to).toEqual([]);
255
+ });
256
+ it('produces no dependency edges for a file with no `use` declarations', () => {
257
+ writeFile('Cargo.toml', CARGO_TOML);
258
+ writeFile('src/lib.rs', `pub fn standalone() -> i32 { 42 }\n`);
259
+ const { catalog, dependenciesByOwner } = runAdapter();
260
+ const libInit = findModuleInit(catalog, 'src/lib.rs');
261
+ expect(libInit).toBeDefined();
262
+ const deps = dependenciesByOwner?.get(libInit.bodyHash);
263
+ expect(deps).toBeUndefined();
264
+ });
265
+ });
266
+ //# sourceMappingURL=depends-on-emission.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depends-on-emission.test.js","sourceRoot":"","sources":["../../src/__tests__/depends-on-emission.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,gBAAgB,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OAAO,EAAE,mBAAmB,EAAE,GAAG,UAAU,EAAE,CAAC;QACtD,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACtD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QAE9B,MAAM,IAAI,GAAG,mBAAmB,EAAE,GAAG,CAAC,OAAQ,CAAC,QAAQ,CAAC,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Branch-coverage tests for lang-rust/discover.ts.
3
+ *
4
+ * Exercises the configPath resolution branches (override, Cargo.lock,
5
+ * Cargo.toml, none) and the file-collection logic.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=discover.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/discover.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}