@mrclrchtr/supi-code-intelligence 11.0.0 → 11.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 (100) hide show
  1. package/README.md +41 -4
  2. package/gradle-helper/README.md +48 -0
  3. package/gradle-helper/build.sh +73 -0
  4. package/gradle-helper/lib/gradle-tooling-api-9.4.0.jar +0 -0
  5. package/gradle-helper/lib/slf4j-api-2.0.17.jar +0 -0
  6. package/gradle-helper/lib/slf4j-simple-2.0.17.jar +0 -0
  7. package/gradle-helper/lib/supi-gradle-observation.jar +0 -0
  8. package/gradle-helper/licenses/DEPENDENCIES.md +11 -0
  9. package/gradle-helper/licenses/LICENSE-gradle-tooling-api.txt +422 -0
  10. package/gradle-helper/licenses/LICENSE-slf4j.txt +21 -0
  11. package/gradle-helper/licenses/NOTICE-gradle.txt +21 -0
  12. package/gradle-helper/src/GradleObservation.java +597 -0
  13. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  14. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  15. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
  16. package/node_modules/@mrclrchtr/supi-lsp/README.md +1 -1
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/README.md +5 -0
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/browser/ril.js +8 -0
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/common/connection.js +7 -2
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/common/ral.d.ts +8 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/main.d.ts +14 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/main.js +6 -4
  26. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/ril.js +5 -1
  27. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/package.json +4 -2
  28. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/package.json +4 -3
  29. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/esm/main.js +2 -2
  30. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/umd/main.js +2 -2
  31. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/package.json +2 -1
  32. package/node_modules/@mrclrchtr/supi-lsp/package.json +6 -6
  33. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +21 -0
  34. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +1 -1
  35. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +1 -0
  36. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  37. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  38. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
  39. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -3
  40. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/LICENSE +21 -0
  41. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm +0 -0
  42. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +19 -2
  43. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/LICENSE +21 -0
  44. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm +0 -0
  45. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +19 -2
  46. package/node_modules/ignore/README.md +95 -14
  47. package/node_modules/ignore/index.d.ts +56 -20
  48. package/node_modules/ignore/index.js +150 -120
  49. package/node_modules/ignore/legacy.js +159 -131
  50. package/node_modules/ignore/package.json +1 -1
  51. package/package.json +11 -6
  52. package/src/analysis/gradle/query.ts +273 -0
  53. package/src/analysis/gradle/runtime.ts +173 -0
  54. package/src/analysis/gradle/types.ts +65 -0
  55. package/src/analysis/read-next.ts +1 -4
  56. package/src/analysis/refactor/apply.ts +2 -2
  57. package/src/analysis/refactor/mutation-authority.ts +4 -1
  58. package/src/analysis/search/ast-scan.ts +143 -18
  59. package/src/analysis/workspace/safe-path.ts +14 -2
  60. package/src/analysis/workspace/types.ts +2 -0
  61. package/src/extension.ts +10 -1
  62. package/src/gradle/consent.ts +279 -0
  63. package/src/headless.ts +3 -0
  64. package/src/overview/collect.ts +11 -3
  65. package/src/session/orientation/workspace-context.ts +49 -28
  66. package/src/session/orientation-types.ts +11 -1
  67. package/src/session/orientation-workflow.ts +2 -0
  68. package/src/session/session.ts +8 -0
  69. package/src/tool/code_find/execute.ts +1 -1
  70. package/src/tool/code_find/markdown.ts +24 -17
  71. package/src/tool/code_find/result.ts +18 -5
  72. package/src/tool/code_find/spec.ts +2 -0
  73. package/src/tool/code_find/structured.ts +161 -0
  74. package/src/tool/code_graph/result.ts +32 -15
  75. package/src/tool/code_graph/spec.ts +2 -0
  76. package/src/tool/code_graph/structured.ts +142 -0
  77. package/src/tool/code_health/markdown.ts +5 -15
  78. package/src/tool/code_inspect/markdown.ts +19 -11
  79. package/src/tool/code_inspect/result.ts +1 -0
  80. package/src/tool/code_orientation/directory-navigation.ts +66 -0
  81. package/src/tool/code_orientation/gradle-sections.ts +68 -0
  82. package/src/tool/code_orientation/markdown.ts +19 -8
  83. package/src/tool/code_orientation/result.ts +89 -11
  84. package/src/tool/code_orientation/workspace-format.ts +2 -1
  85. package/src/tool/code_orientation/workspace-output.ts +40 -13
  86. package/src/tool/code_orientation/workspace-projects.ts +170 -50
  87. package/src/tool/code_orientation/workspace-sections.ts +3 -1
  88. package/src/tool/code_resolve/markdown.ts +4 -10
  89. package/src/tool/code_resolve/result.ts +2 -0
  90. package/src/tool/code_resolve/spec.ts +2 -0
  91. package/src/tool/code_resolve/structured.ts +103 -0
  92. package/src/tool/infra/truncate.ts +12 -4
  93. package/src/tool/register.ts +10 -6
  94. package/src/tool/result/display.ts +17 -0
  95. package/src/tool/result/model-budget.ts +195 -0
  96. package/src/tool/result/structured.ts +62 -0
  97. package/src/tool/result/types.ts +10 -2
  98. package/src/tool/specs.ts +2 -0
  99. package/src/types/execution.ts +5 -1
  100. package/src/ui/tui/display.ts +10 -4
package/README.md CHANGED
@@ -83,6 +83,25 @@ Important tool rules:
83
83
 
84
84
  `code_health({ refresh: true })` retries failed startup and exhausted process-crash routes in scope, with at most one attempt per route per call. It collects fresh diagnostic evidence and reports recovery separately from diagnostic confirmation. A broad maintenance attempt can include active tracked files outside a requested directory, but the diagnostic result keeps the requested directory and tracked-file boundary. The report labels maintenance evidence separately from result coverage. A later refresh can retry a failed route. Reports show up to 16 route entries per recovery list and disclose omitted entries. Use an exact file scope when a route reports `use-exact-file`.
85
85
 
86
+ ### Structured codemode results
87
+
88
+ `code_resolve`, `code_find`, and `code_graph` declare output schemas. Direct calls retain compact text; codemode receives JSON instead of Markdown. Resolve returns `targets` with reusable `handle` values; Find returns bounded `matches`; Graph returns per-relation `sections` with bounded `items`. UI details and internal target-store entries are not exposed.
89
+
90
+ Check `kind` before consuming evidence. Invalid input and candidate selection return recovery data; whole-tool capability failures still throw. `evidenceLists` (and Graph's per-section `evidence`) retain exact or unknown totals, shown/omitted counts, partial reasons, and invalid-location counts. AST results retain their scan policy, exclusions, limitations, and failures. Coordinates are one-based UTF-16 except zero-based recovery error ranges.
91
+
92
+ Example codemode script that returns counts rather than every reference:
93
+
94
+ ```javascript
95
+ const graph = await tools.code_graph({
96
+ target: { symbol: { query: "PaymentProvider", scope: "packages/api" } },
97
+ relations: ["references"],
98
+ });
99
+ return graph.kind === "completed"
100
+ ? graph.sections.map(({ relation, source, status, evidence, message }) =>
101
+ ({ relation, source, status, evidence, message }))
102
+ : graph;
103
+ ```
104
+
86
105
  ### Workspace and directory observations
87
106
 
88
107
  Automatic collection stays within the session working directory. Ancestor Git roots and workspace manifests do not expand that boundary. An explicit directory focus can select a different root. Each tool call makes a new observation; its output does not depend on an earlier overview.
@@ -92,12 +111,27 @@ Automatic collection stays within the session working directory. Ancestor Git ro
92
111
  - Symbolic links are recorded, not followed. An explicit ignored or excluded directory can be observed separately. This does not change automatic inclusion elsewhere.
93
112
  - Metadata readers cover Node `package.json` and workspace declarations, Python `[project]` in `pyproject.toml`, Rust `Cargo.toml`, and Go `go.mod` / `go.work`. They do not run build tools or project code.
94
113
  - Unsupported, dynamic, inherited, malformed, and unresolved declarations are disclosed. Go replacement directives and unsupported quoted-string escapes are not interpreted. Native project kinds remain separate; nearby Python or Rust projects do not become Node workspace members.
95
- - Directory diagrams retain separate dependency categories and declared values. Unique declared-name matches do not prove installed dependency resolution or runtime architecture.
114
+ - Project declaration groups share their observed kind and project-relative identity source. Identical membership declarations share their native kind, source field, and value. List limits and omission counts still apply to individual declarations and memberships, not groups. A membership group refers to listed projects only when their identities match exactly; otherwise it lists member paths.
115
+ - Explicit directory results keep project identity, direct directories/files, applicable instructions, and collection problems inline. Complete ancillary sections (extension counts, nested declarations, memberships, declared paths, and dependency topology) move to captured details with an omission summary. Incomplete ancillary observations remain inline. Root-focused Orientation also keeps project declarations and memberships inline for workspace navigation.
116
+ - Captured directory diagrams retain separate dependency categories and declared values. Unique declared-name matches do not prove installed dependency resolution or runtime architecture.
96
117
  - The inventory retains at most 10,000 entries. An explicit in-root directory is collected before unrelated paths use that budget. External directory focus uses its own observation. Metadata files have a 1 MiB read limit. The first-turn collector has a 10-second deadline; tool calls use their request control. Results disclose incomplete collection.
97
118
 
98
119
  Estimated tokens are `ceil(characters / 4)`. The overview warns above 1,000 and has a 2,000-token hard cap. Workspace and directory navigation warn above 2,000 and have a 4,000-token hard cap. Warnings go to UI and debug only. `maxResults` can reduce a list, but cannot bypass the total cap.
99
120
 
100
- Captured-result files contain the complete collected observation, not just the selected rows. Reading them does not refresh facts or establish that every possible fact was collected. Instruction snippets have a separate budget and still respect Pi's final output safety limit. Unread instruction text is identified and is not recorded as supplied. File- and symbol-focused navigation retain their existing output.
121
+ The overview links captured details only when navigation rows or descriptions are omitted. Explicit workspace/directory Orientation also preserves raw inventory evidence. Captured-result files contain the complete collected observation, not just the selected rows. Reading them does not refresh facts or establish that every possible fact was collected. Instruction snippets have a separate budget and still respect Pi's final output safety limit. Unread instruction text is identified and is not recorded as supplied. File- and symbol-focused navigation retain their existing output.
122
+
123
+ ### Consent-gated Gradle observations
124
+
125
+ Overview and workspace/directory Orientation can add a **Gradle model observation** for one selected Gradle 9 build. Overview selects the session working directory; an explicit directory focus selects that exact directory. A regular `settings.gradle` or `settings.gradle.kts` is required there. No ancestors or independent nested builds are queried automatically. File, module, and symbol focuses do not select additional builds.
126
+
127
+ - Permission is project-only: `code-intelligence.gradleObservation` is `"allow"`, `"deny"`, or absent in `.pi/supi/config.json`. Global values are ignored. Eligible interactive startup asks when unset; Cancel does not persist. Without UI, unset never executes.
128
+ - Allow also requires Pi's actual project-trust gate: a trusted startup with protected project resources, or a saved Pi trust approval. Pi implicitly trusts directories without protected resources, so a bare SuPi config containing Allow is insufficient. Use `/trust` and reload in that case. Explicit external roots require their own saved trust approval; permission remains owned by the session project.
129
+ - `/supi-settings` → Code Intelligence → Gradle observations changes the next query. Reset removes the project value and restores asking at the next eligible startup. Deny/reset request cancellation of owned in-flight helpers. Cancellation cannot undo side effects or stop unrelated Gradle daemons.
130
+ - **Execution risk:** Gradle initializes settings and plugins. They may execute arbitrary code, download distributions/dependencies, write caches, and access files/services outside the reporting root. Reporting bounds are not a sandbox. Only `BuildEnvironment` and `GradleBuild` / `BasicGradleProject` models are requested; SuPi schedules no build/test tasks and requests no dependency, task, source-set, or IDE models.
131
+ - Wrapper properties select their declared distribution, never the Tooling API client's version. Conventional `gradle-9.x[-qualifier]-(bin|all).zip` URLs are required to establish the major before querying; unidentifiable/custom archive names fail closed. Relative file URLs resolve against the wrapper properties. When properties are absent, the first executable Gradle on PATH must resolve through symlinks to an installation with `bin/gradle` and a single `lib/gradle-launcher-9.*.jar`. SDKMAN-style symlinks and direct version-manager installation paths work; opaque mise/asdf shims are not executed. Put the selected installation's `bin` directory on PATH. Unsupported wrappers and unresolved installations are disclosed without fallback.
132
+ - Java is selected from existing `JAVA_HOME/bin/java`, then PATH. Java 17–24 is the conservative compatible range for Gradle 9; no JDK is installed. The helper pins the model request to its own Java home. Actual qualification is narrower; see the [helper qualification and dependency notices](gradle-helper/README.md).
133
+ - Projects retain build-root identity plus logical path, name, parent path, and Gradle-reported actual directory. Duplicate names remain distinct. Included builds are references only, not recursively expanded trees. External directories are attributed references; inventory never expands to them. No declaration fields/ranges, source ownership, dependency resolution, or architecture are inferred.
134
+ - The existing 10-second Overview deadline, request cancellation/deadlines, navigation budgets, captures, and untrusted-evidence handling still apply. Helper output is capped at 1 MiB and 10,000 projects. Missing prerequisites, unsupported versions, initialization failure, cancellation, expiry, and oversized results are explicit limitations, never “no projects.” There are no automatic retries, console-report fallback, or stale-model reuse.
101
135
 
102
136
  ### Transcript failures
103
137
 
@@ -175,10 +209,12 @@ Developers run `pnpm test:language-baseline:acceptance` with the pinned prerequi
175
209
  ### Search and output limits
176
210
 
177
211
  - An AST search has a 5,000 eligible-file limit and a 10-second deadline shared by file enumeration and analysis. These are not tool-call settings.
178
- - Below directory roots, AST search excludes hidden entries, dependency/build/cache directories, symlinks, non-regular files, configured `code-intelligence.exclude` paths, and files unsupported by the requested operation. It does **not** read `.gitignore`. Explicit roots are resolved and honored, including excluded paths and symlink roots. See the [scan policy](src/analysis/search/ast-scan.ts) for the exact directory list.
212
+ - Below directory roots, AST search excludes hidden entries, dependency/build/cache directories, symlinks, non-regular files, configured `code-intelligence.exclude` paths, paths ignored by `.gitignore`, and files unsupported by the requested operation. It reads regular, non-symlink workspace-root and nested `.gitignore` files, with directory-relative rules and negation; it does not use global Git ignores or `.git/info/exclude`. Explicit roots are resolved and honored, including ignored paths and symlink roots. An explicitly selected ignored directory overrides ancestor ignore rules, but still applies its own and nested `.gitignore` files. See the [scan policy](src/analysis/search/ast-scan.ts) for the exact directory list.
213
+ - AST scan details report `policy.ignoreFiles: true` and ignored-path counts/examples under the `gitignore` exclusion reason. Each exclusion summary includes `scopeRoot`, the canonical requested root displayed relative to cwd when inside it. Counts describe encountered traversal skips per scope and reason, not distinct files absent from the combined result: another explicit scope may include a skipped path. An excluded directory counts as one skip, not as a count of its unvisited descendants. Ignore-file read failures make the scan incomplete; the warning includes bounded examples of unreadable paths.
179
214
  - An exact file that does not support the requested AST operation is invalid. Results disclose policy exclusions, interrupted scans, provider limits, and omitted matches. No matches do not mean that unsupported files were searched.
180
215
  - Syntax recovery retains usable evidence as partial and reports the affected file and available error ranges. Scan limits separate recovered syntax from provider failures, with counts and file examples for each. Partial scans have unknown match totals. A recovered parse does not establish complete absence.
181
- - Tool text is truncated at Pi's default 2,000 lines or 50 KB. When this occurs, the full text is written to a temporary file and its path is returned. Result-list limits still apply to that full text.
216
+ - Tool text has an economic inline budget of 8,000 characters (approximately 2,000 tokens). Oversized results prioritize status, evidence counts, limitations, and diagnostic snippets before an explicitly incomplete text excerpt. The complete returned text is saved to a temporary file, linked before the excerpt. Counts describe the returned result, not the shortened preview. UI details and structured codemode evidence are not truncated by this budget.
217
+ - Workspace/directory navigation and instruction delivery retain their separate budgets above. Pi's default 2,000-line / 50 KB safety limit still applies to every tool. Result-list limits also apply to saved text: a spill file does not recover evidence omitted by `maxResults`.
182
218
 
183
219
  ## Status and settings
184
220
 
@@ -203,6 +239,7 @@ Project values override global values, which override defaults. Project configur
203
239
  |---|---|---|
204
240
  | `code-intelligence.overviewEnabled` | `true` | Add the hidden overview; the choice is fixed for the session |
205
241
  | `code-intelligence.instructionFileNames` | `["CLAUDE.md", "AGENTS.md"]` | Ordered plain filenames for directory instruction discovery |
242
+ | `code-intelligence.gradleObservation` | unset | Project-only `"allow"` / `"deny"`; actual Pi project trust also required; changes apply to the next query |
206
243
  | `code-intelligence.exclude` | `[]` | Gitignore-style patterns for automatic workspace navigation, LSP work, and broad AST searches; not an access control |
207
244
  | `code-intelligence.fileAssociations` | `[]` | Ordered C/C++ language rules in trusted project configuration only; edit the JSON file directly |
208
245
  | `lsp.servers.<language>.enabled` | Enabled unless `false` | Disable a language server |
@@ -0,0 +1,48 @@
1
+ # Gradle workspace observation helper
2
+
3
+ This standalone Java 17 process uses the pinned Gradle Tooling API 9.4.0. It accepts four arguments:
4
+
5
+ ```text
6
+ GradleObservation <selected-root> <distribution|installation> <URI|installation-path> <deadline-epoch-milliseconds>
7
+ ```
8
+
9
+ The parent chooses the Gradle runtime, performs consent/trust policy, and passes the runtime in. The helper does not resolve a wrapper or make policy decisions. `distribution` passes the given URI to `GradleConnector.useDistribution`; `installation` passes the given directory to `useInstallation`. The helper pins the Tooling API request JVM to its current `java.home`.
10
+
11
+ The helper requests `BuildEnvironment` first and accepts only Gradle 9 before asking for `GradleBuild`. It traverses the root build's `BasicGradleProject` children and reports only included-build root references. It does not query task, dependency, or IDE models. Output is one UTF-8 JSON object on stdout, limited to 1 MiB and 10,000 root-build projects. Gradle and process logs are redirected to stderr through a 64 KiB cap. Failure objects have one of these statuses: `unavailable`, `unsupported`, `failed`, `interrupted`, `timeout`, or `oversized`.
12
+
13
+ Build/settings failures use `failed`; connection failures use `unavailable`. Failure reasons retain a deduplicated cause chain, deepest available cause first, limited to eight causes and 500 characters of single-line text; an ellipsis marks truncated messages. They do not include stack traces or raw process logs. Failure objects also retain `gradleVersion` when `BuildEnvironment` reported it before failure; the declared distribution version is not substituted.
14
+
15
+ Helper failures include `stage: "prerequisites" | "query"`, recorded before any Tooling API model request and when the first request is attempted, respectively. A missing settings file detected inside the helper remains a prerequisite failure. The parent preserves this stage, records authorization failures itself, and treats an expired deadline before helper launch as a prerequisite failure. Authorization and prerequisite results use configuration provenance and explicitly state that the model query was not run. Confirmed attempted queries use runtime provenance; a failed query is not a returned project model. If the helper starts but exits, is interrupted, exceeds output bounds, or times out without returning a stage, the parent records `unknown` and explicitly discloses that model-query execution is unknown. A JVM launch alone does not establish a Tooling API request. Orientation renders the reason once as single-line literal code, using backtick delimiters longer than any embedded run so links, images, emphasis, and HTML remain diagnostic text. Captures retain the collected diagnostic.
16
+
17
+ A line containing `cancel` on stdin requests Tooling API cancellation and produces an `interrupted` result. The deadline is an absolute Unix epoch timestamp in milliseconds; its watchdog requests token cancellation and produces `timeout`. Cancellation terminates this helper process after writing its JSON response so a parent process can use its own kill-after-grace policy if Tooling API shutdown stalls.
18
+
19
+ Build the reproducible helper and verify/download its pinned dependencies with:
20
+
21
+ ```bash
22
+ ./packages/supi-code-intelligence/gradle-helper/build.sh
23
+ ```
24
+
25
+ The resulting helper JAR is `lib/supi-gradle-observation.jar`; the standalone Maven Tooling API and SLF4J artifacts remain adjacent in `lib/`. Fixed JAR entry ordering and timestamps make the helper artifact reproducible for a fixed Java compiler. Artifact URLs, SHA-256 values, and license notices are in `licenses/DEPENDENCIES.md`.
26
+
27
+ ## Qualification
28
+
29
+ | Gradle distribution | Helper/client | Installed JVM | Platform | Verified cases |
30
+ | --- | --- | --- | --- | --- |
31
+ | 9.4.0 (`all`, pinned wrapper URL and SHA-256) | Tooling API 9.4.0, Java 17 bytecode | Eclipse Temurin 21.0.13+9 LTS | macOS arm64 | Groovy distribution selection; Kotlin installation selection; nested paths, renamed projects, duplicate leaf names, custom directories, external included reference; initialization failure, cancellation, expired deadline |
32
+ | 9.4.0 (`all`, same pin) | Same bundled helper | Amazon Corretto 21.0.9.10.1 | macOS arm64 | Same cases |
33
+
34
+ The TypeScript process adapter was also exercised against the real Groovy fixture: 8 projects and 1 included reference. Ordinary Vitest coverage controls the process boundary for missing Java, oversized output, active deadline expiry, trust/consent, live revocation, selection, result/capture consistency, and output budgets. These combinations do not establish qualification for every Gradle 9/JVM/platform combination. Java 17–24 is the conservative runtime-family intersection; actual qualification is limited to the rows above. Linux, Windows, other JVMs, and other Gradle 9 releases have not been qualified by this record.
35
+
36
+ The pinned fixtures contain no wrapper executable: the Tooling API selects the declared archive itself. `test-fixtures.py` copies both the build and its included sibling into temporary directories, exercises distribution mode first (which may download/cache the archive), then uses the resulting 9.4.0 installation. No independent included-build query is launched.
37
+
38
+ ## Packaging and verification
39
+
40
+ The package's `files` list explicitly includes the helper JAR, standalone Maven Tooling API, SLF4J API/provider, source, rebuild script, and licenses. Runtime users need Java, not `javac` or a build step. `scripts/verify-tarball.mjs` checks these assets in both direct and transitively bundled Code Intelligence packages during `pnpm verify:ai`. The helper is compiled with `javac --release 17`; rebuilding requires an installed JDK and `curl`. Dependencies are checksum-verified, with no runtime dependency fetch by the helper launcher. Gradle itself may download its selected distribution or plugins after authorization.
41
+
42
+ Tooling API's standalone archive shades additional classes (Guava, Error Prone/JSpecify/JSR-305 annotations, `javax.inject`, Apache Commons, and ASM). The upstream complete Gradle LICENSE and NOTICE are retained alongside SLF4J's MIT license; not every component in the distribution-wide notice is used by this helper. See [dependency coordinates and checksums](licenses/DEPENDENCIES.md). No JVM or Gradle engine distribution is shipped.
43
+
44
+ Run the real pinned Groovy/Kotlin fixture acceptance test with:
45
+
46
+ ```bash
47
+ python3 scripts/gradle-observation/test-fixtures.py
48
+ ```
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+ LIB_DIR="$HERE/lib"
6
+ SOURCE="$HERE/src/GradleObservation.java"
7
+ mkdir -p "$LIB_DIR"
8
+
9
+ sha256() {
10
+ if command -v sha256sum >/dev/null 2>&1; then
11
+ sha256sum "$1" | awk '{print $1}'
12
+ else
13
+ shasum -a 256 "$1" | awk '{print $1}'
14
+ fi
15
+ }
16
+
17
+ download_verified() {
18
+ local filename="$1" expected="$2" url="$3" destination="$LIB_DIR/$1"
19
+ local current temporary actual
20
+ if [[ -f "$destination" ]]; then
21
+ current="$(sha256 "$destination")"
22
+ if [[ "$current" == "$expected" ]]; then
23
+ chmod 644 "$destination"
24
+ return
25
+ fi
26
+ printf 'Checksum mismatch for cached %s; downloading a fresh copy.\n' "$filename" >&2
27
+ fi
28
+ temporary="$(mktemp "$LIB_DIR/.${filename}.XXXXXX")"
29
+ trap 'rm -f "$temporary"' RETURN
30
+ curl --fail --location --silent --show-error "$url" --output "$temporary"
31
+ actual="$(sha256 "$temporary")"
32
+ if [[ "$actual" != "$expected" ]]; then
33
+ printf 'SHA-256 mismatch for %s: expected %s, got %s\n' "$filename" "$expected" "$actual" >&2
34
+ return 1
35
+ fi
36
+ chmod 644 "$temporary"
37
+ mv "$temporary" "$destination"
38
+ trap - RETURN
39
+ }
40
+
41
+ REPOSITORY=https://repo.gradle.org/gradle/libs-releases
42
+ download_verified \
43
+ gradle-tooling-api-9.4.0.jar \
44
+ 18e900ab3fcdf77a8076ccee1897b89789f1eac654585ec33b308619b9d3f1ef \
45
+ "$REPOSITORY/org/gradle/gradle-tooling-api/9.4.0/gradle-tooling-api-9.4.0.jar"
46
+ download_verified \
47
+ slf4j-api-2.0.17.jar \
48
+ 7b751d952061954d5abfed7181c1f645d336091b679891591d63329c622eb832 \
49
+ "$REPOSITORY/org/slf4j/slf4j-api/2.0.17/slf4j-api-2.0.17.jar"
50
+ download_verified \
51
+ slf4j-simple-2.0.17.jar \
52
+ ddfea59ac074c6d3e24ac2c38622d2d963895e17f70b38ed4bdae4d780be6964 \
53
+ "$REPOSITORY/org/slf4j/slf4j-simple/2.0.17/slf4j-simple-2.0.17.jar"
54
+
55
+ BUILD_DIR="$(mktemp -d "$HERE/.build.XXXXXX")"
56
+ trap 'rm -rf "$BUILD_DIR"' EXIT
57
+ mkdir -p "$BUILD_DIR/classes"
58
+ javac --release 17 -encoding UTF-8 -classpath "$LIB_DIR/*" -d "$BUILD_DIR/classes" "$SOURCE"
59
+ printf 'Manifest-Version: 1.0\nMain-Class: GradleObservation\n\n' > "$BUILD_DIR/MANIFEST.MF"
60
+
61
+ set --
62
+ while IFS= read -r class_file; do
63
+ set -- "$@" -C "$BUILD_DIR/classes" "${class_file#./}"
64
+ done < <(cd "$BUILD_DIR/classes" && find . -type f -print | LC_ALL=C sort)
65
+ jar --create \
66
+ --file "$BUILD_DIR/supi-gradle-observation.jar" \
67
+ --date=2020-01-01T00:00:00Z \
68
+ --manifest "$BUILD_DIR/MANIFEST.MF" \
69
+ "$@"
70
+ chmod 644 "$BUILD_DIR/supi-gradle-observation.jar"
71
+ mv "$BUILD_DIR/supi-gradle-observation.jar" "$LIB_DIR/supi-gradle-observation.jar"
72
+ printf 'Built Java 17 helper: %s\n' "$LIB_DIR/supi-gradle-observation.jar"
73
+ printf 'SHA-256: %s\n' "$(sha256 "$LIB_DIR/supi-gradle-observation.jar")"
@@ -0,0 +1,11 @@
1
+ # Bundled JVM dependency notices
2
+
3
+ | Artifact | Source | SHA-256 | License |
4
+ | --- | --- | --- | --- |
5
+ | `org.gradle:gradle-tooling-api:9.4.0` | [repo.gradle.org](https://repo.gradle.org/gradle/libs-releases/org/gradle/gradle-tooling-api/9.4.0/gradle-tooling-api-9.4.0.jar) | `18e900ab3fcdf77a8076ccee1897b89789f1eac654585ec33b308619b9d3f1ef` | Apache-2.0; see [LICENSE-gradle-tooling-api.txt](LICENSE-gradle-tooling-api.txt) |
6
+ | `org.slf4j:slf4j-api:2.0.17` | [repo.gradle.org](https://repo.gradle.org/gradle/libs-releases/org/slf4j/slf4j-api/2.0.17/slf4j-api-2.0.17.jar) | `7b751d952061954d5abfed7181c1f645d336091b679891591d63329c622eb832` | MIT; see [LICENSE-slf4j.txt](LICENSE-slf4j.txt) |
7
+ | `org.slf4j:slf4j-simple:2.0.17` | [repo.gradle.org](https://repo.gradle.org/gradle/libs-releases/org/slf4j/slf4j-simple/2.0.17/slf4j-simple-2.0.17.jar) | `ddfea59ac074c6d3e24ac2c38622d2d963895e17f70b38ed4bdae4d780be6964` | MIT; see [LICENSE-slf4j.txt](LICENSE-slf4j.txt) |
8
+
9
+ The Tooling API archive shades additional dependencies. [The upstream complete Gradle LICENSE](LICENSE-gradle-tooling-api.txt) and [NOTICE](NOTICE-gradle.txt) retain their notices, including ASM's BSD terms and the distribution's JSR-305 attribution. These distribution-wide files also mention components not shipped here.
10
+
11
+ The Gradle Tooling API POM declares `slf4j-api` 2.0.17. `slf4j-simple` 2.0.17 supplies the SLF4J provider, with `slf4j-api` included explicitly as its runtime dependency. No Gradle distribution-internal Tooling API JAR is bundled: the Maven artifact above is the standalone 3 MB-class artifact.