Skip to content

Conversation

@kamiazya
Copy link
Owner

@kamiazya kamiazya commented Oct 25, 2025

Summary

Complete migration from platform-specific native binaries to universal JAR bundle distribution.

This PR implements the migration strategy documented in ADR-0017, replacing GraalVM Native Image compilation with a universal JAR distribution approach.

Breaking Changes

⚠️ Distribution format changed: Users now need Java 21+ instead of platform-specific native binaries.

Before (Native Image)

  • 6 platform-specific binaries (linux-x64, darwin-x64, darwin-arm64, win32-x64, win32-arm64, linux-arm64)
  • Total download size: ~260MB
  • No runtime dependencies
  • Platform-specific build issues

After (JAR Distribution)

  • Single universal JAR bundle
  • Download size: ~20MB
  • Requires Java 21+ runtime
  • Platform-agnostic with wrapper scripts

Major Changes

Distribution

  • ✅ Single JAR bundle (~20MB) replacing 6 platform binaries (~260MB)
  • ✅ Universal wrapper scripts (bash, batch, PowerShell) for all platforms
  • ✅ Dual SBOM approach (source-level + binary-level)

Build System

  • ✅ Shadow JAR plugin replaces GraalVM Native Image plugin
  • ✅ Removed GraalVM-specific configuration files
  • ✅ Simplified CI/CD workflow (single build job instead of 6)

Documentation

  • ✅ Created ADR-0017 documenting migration rationale
  • ✅ Added Java setup guide (docs/explanation/setup/java-setup.md)
  • ✅ Updated all security verification guides
  • ✅ Renamed install-jar.ps1 → install.ps1 for consistency
  • ✅ Removed obsolete native binary documentation

Security & Verification

  • ✅ SLSA Level 3 provenance maintained
  • ✅ Source-level SBOM: sbom/scopes-sbom.json (CycloneDX from Gradle dependencies)
  • ✅ Binary-level SBOM: sbom/scopes-binary-sbom.json (Syft scan of compiled JAR)
  • ✅ Grype vulnerability scanning integrated
  • ✅ All security verification workflows updated

Benefits

For Users

  • 🚀 Smaller downloads: ~20MB vs ~260MB
  • Faster startup: JVM optimizations benefit long-running processes
  • 🔧 Better debugging: Standard JVM tools (jstack, jmap, etc.)
  • 🌐 Universal: Same JAR works on all platforms

For Developers

  • 🏗️ Simpler builds: No platform-specific compilation
  • 🐛 Easier debugging: No native image issues
  • 📦 Faster CI/CD: Single build job instead of 6
  • 🔍 Better profiling: Standard JVM profilers work out of the box

Migration Guide

For End Users

  1. Ensure Java 21+ is installed (Java Setup Guide)
  2. Download JAR bundle instead of platform-specific binary
  3. Run installer script (install.sh or install.ps1)
  4. Wrapper scripts handle JAR execution automatically

For CI/CD

  • Update download URLs from platform-specific to jar-bundle
  • Ensure Java 21+ is available in build environment
  • Update SBOM file paths (sbom-{platform}.json → sbom/scopes-*.json)

Testing

  • ✅ JAR builds successfully
  • ✅ Wrapper scripts work on Linux/macOS/Windows
  • ✅ Installation scripts function correctly
  • ✅ All documentation links verified
  • ✅ Security verification workflows validated

Changeset

This PR includes a changeset for patch release (0.0.5) documenting the migration.

Related

  • Resolves #XXX (if applicable)
  • ADR-0017: JVM JAR Distribution Strategy

Test Plan

  1. Build JAR: ./gradlew clean :apps-scopes:shadowJar
  2. Test wrapper scripts on each platform
  3. Verify SBOM generation
  4. Test installation scripts
  5. Validate security verification workflows

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Summary by CodeRabbit

  • Breaking Changes

    • Distribution now a single universal JAR (~20MB); Java 21+ required; platform-specific native binaries removed.
    • Installation flow updated to use wrapper scripts and JAR bundle installers.
  • New Features

    • Cross-platform wrapper scripts and an installer for easy run/install of the JAR bundle.
    • SHA256 + SLSA-based verification surfaced in installers.
  • Documentation

    • Guides updated for JAR distribution, Java setup, and verification.
  • Chores

    • Migration from GraalVM native image to fat JAR distribution completed.

Complete migration from platform-specific native binaries to universal JAR bundle distribution.

Major Changes:
- Distribution: Single JAR bundle (~20MB) replacing 6 platform binaries (~260MB)
- Runtime: Now requires Java 21+ instead of platform-specific native executables
- Build: Shadow JAR plugin replaces GraalVM Native Image compilation
- CI/CD: Simplified workflow building universal JAR instead of multi-platform binaries
- SBOM: Dual-level approach (source + binary SBOMs)

Documentation Updates:
- Renamed install-jar.ps1 → install.ps1 for consistency
- Removed obsolete native binary docs (install/README.md, install/verify-README.md)
- Updated SBOM verification guide for JAR bundle structure
- Updated security verification guides with JAR-specific instructions
- Created ADR-0017 documenting migration rationale

Technical Cleanup:
- Removed GraalVM Native Image configuration files
- Removed platform-specific build workflows
- Cleaned up obsolete environment variables
- Updated all documentation references

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Oct 25, 2025

🦋 Changeset detected

Latest commit: 021df9c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
scopes Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 25, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Migrates the project from GraalVM Native Image to a universal Shadow fat JAR distribution. Removes GraalVM native-image plugins, configs, and multi‑platform CI jobs; adds Shadow JAR build, wrapper scripts (Unix/Windows/PowerShell), JAR-focused release workflow, installers, and documentation requiring Java 21+.

Changes

Cohort / File(s) Summary
CI Workflow Removal
\.github/workflows/build.yml
Deleted the multi‑platform native-image build workflow including matrix builds, SBOM generation, security scans, and per-platform artifact uploads.
Release Workflow Refactor
\.github/workflows/release.yml
Replaced matrix native release with a single JAR-focused flow: build-releasebuild-jar, hashesjar_hash, simplified artifact/SLSA/hash handling and upload paths.
Build & Plugin Changes
apps/scopes/build.gradle.kts, build.gradle.kts, gradle/libs.versions.toml
Removed GraalVM native plugin and graal-sdk; added Shadow plugin and shadowJar task; removed checkGraalVM task; updated Spotless exclusions and version catalog.
GraalVM Native Config Removal
apps/scopes/src/main/resources/META-INF/native-image/..., apps/scopes/src/main/resources/logback-native.xml, apps/scopes/src/main/java/org/sqlite/nativeimage/SqliteJdbcFeature.java
Deleted native-image configs (jni/reflect/resource/native-image.properties), native logback config, and native-image shim class.
Wrapper Scripts (new)
bin/scopes, bin/scopes.bat, bin/scopes.ps1
Added cross‑platform wrapper scripts that locate scopes.jar, verify Java 21+, load JAVA options, and launch the JAR.
Installers & Install Docs
install/install.sh, install/install.ps1, install/offline/install.sh, install/README.md, install/offline/README.md, install/verify-README.md
Added a new Bash installer, refactored PowerShell installer to local-JAR install, and removed legacy offline installer and several install READMEs.
Documentation & ADR
docs/explanation/adr/0017-jvm-jar-distribution-strategy.md, docs/explanation/adr/README.md, docs/explanation/setup/java-setup.md, docs/explanation/setup/graalvm-setup.md
Added ADR‑0017 and Java setup guide; removed GraalVM setup doc; updated ADR index.
User Guides & Tutorials
docs/tutorials/getting-started.md, docs/explanation/user-stories/0007-secure-manual-installation.md, docs/explanation/automated-release-process.md
Converted getting-started and install/user-story content to JAR-bundle model; updated release-process diagrams to JAR-centric flow.
Security & SBOM Docs
SECURITY.md, docs/explanation/security/*.md
Shifted security verification and SBOM guidance from platform binaries to JAR distributions; added SHA256 + SLSA verification emphasis and unified SBOM naming.
Misc / Tooling
.changeset/jar-distribution-docs-update.md, .github/ISSUE_TEMPLATE/graalvm-config-cache-issue.md, .gitignore, scripts/clean-gradle-cache.sh
Added changeset, deprecated GraalVM issue template, ignore rule for .gradle-local/, and new script to clean Gradle caches/ build dirs.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant W as Wrapper (bin/scopes)
    participant J as scopes.jar
    participant JVM as Java Runtime

    U->>W: run scopes [args]
    activate W
    W->>W: locate scopes.jar
    W->>W: verify Java installed & version >= 21
    W->>W: load SCOPES_JAVA_OPTS / JAVA_OPTS / config
    W->>JVM: java [opts] -jar scopes.jar [args]
    deactivate W
    activate J
    J->>JVM: application runs
    JVM-->>U: stdout / exit code
Loading
sequenceDiagram
    participant Build as build-jar
    participant Hash as collect-hashes
    participant Prov as provenance
    participant Dist as create-jar-distribution
    participant Rel as create-release

    Build->>Build: compile & shadowJar -> scopes.jar
    Build->>Hash: emit jar_hash
    par
        Prov->>Prov: generate SLSA provenance for scopes.jar
        Hash->>Hash: collect/encode jar_hash
    end
    Dist->>Dist: bundle scopes.jar + wrappers + SBOMs + checksums
    Dist-->>Rel: upload jar-distribution-bundles
    Prov-->>Rel: upload provenance.json
    Hash-->>Rel: provide hash for SLSA
    Rel->>Rel: publish GitHub release with artifacts
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Focus review on: .github/workflows/release.yml (job deps, outputs, provenance/hash integration), apps/scopes/build.gradle.kts (shadowJar manifest/exclusions), bin/scopes.ps1 (robust Java parsing and config discovery), and install/install.sh (cross-shell installer flows).
  • Also verify removal impacts: native-image configs and any remaining references in docs or CI.

Possibly related PRs

Suggested labels

enhancement, github-actions, documentation

Poem

🐇 I swapped bulky bins for a nimble jar bright,
One JAR to rule platforms, snug and light,
Java twenty‑one hums under the hood,
Wrappers guide users to run what is good,
Hooray — a smaller hop into night!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "feat: migrate from GraalVM Native Image to JAR distribution" accurately and clearly summarizes the primary change in the changeset. It directly describes the core migration from platform-specific GraalVM native binaries to a universal JAR distribution format, which is the central objective of all the modifications across the build configuration, CI/CD workflows, documentation, and installation scripts. The title is concise, specific, and avoids generic terminology or noise. A teammate scanning the commit history would immediately understand the significance of this change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/jar-distribution-migration

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d6ad37 and 021df9c.

📒 Files selected for processing (13)
  • .gitignore (1 hunks)
  • apps/scopes/src/main/java/org/sqlite/nativeimage/SqliteJdbcFeature.java (0 hunks)
  • bin/scopes (1 hunks)
  • bin/scopes.bat (1 hunks)
  • bin/scopes.ps1 (1 hunks)
  • build.gradle.kts (3 hunks)
  • docs/explanation/adr/0017-jvm-jar-distribution-strategy.md (1 hunks)
  • docs/explanation/security/sbom-verification.md (5 hunks)
  • docs/reference/jni-config.md (0 hunks)
  • docs/tutorials/getting-started.md (1 hunks)
  • install/install.ps1 (1 hunks)
  • install/install.sh (1 hunks)
  • scripts/clean-gradle-cache.sh (1 hunks)
💤 Files with no reviewable changes (2)
  • docs/reference/jni-config.md
  • apps/scopes/src/main/java/org/sqlite/nativeimage/SqliteJdbcFeature.java
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (2)
  • bin/scopes
  • install/install.sh
🧰 Additional context used
📓 Path-based instructions (5)
docs/**

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Documentation under docs/ should follow the Diátaxis framework structure

Files:

  • docs/explanation/adr/0017-jvm-jar-distribution-strategy.md
  • docs/tutorials/getting-started.md
  • docs/explanation/security/sbom-verification.md
docs/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Write documentation in English (project’s official language)

Files:

  • docs/explanation/adr/0017-jvm-jar-distribution-strategy.md
  • docs/tutorials/getting-started.md
  • docs/explanation/security/sbom-verification.md
**/*.{kt,kts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{kt,kts}: Adhere to ktlint formatting rules for all Kotlin source and script files; run ktlintFormat before committing
Code must pass Detekt static analysis; avoid suppressing rules without clear justification

Files:

  • build.gradle.kts
{gradle/libs.versions.toml,settings.gradle.kts,**/build.gradle.kts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not modify dependencies to work around the JitPack/kulid resolution issue; keep declared dependencies unchanged until connectivity is restored

Files:

  • build.gradle.kts
{**/build.gradle.kts,gradle.properties}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Keep the project targeting Java 21 in Gradle configuration; do not downgrade the toolchain

Files:

  • build.gradle.kts
🧠 Learnings (1)
📚 Learning: 2025-08-25T14:25:43.702Z
Learnt from: CR
PR: kamiazya/scopes#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-25T14:25:43.702Z
Learning: Applies to **/*.{kt,kts} : Adhere to ktlint formatting rules for all Kotlin source and script files; run ktlintFormat before committing

Applied to files:

  • build.gradle.kts
🪛 Gitleaks (8.28.0)
docs/explanation/security/sbom-verification.md

[high] 122-123: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.

(curl-auth-header)

🪛 LanguageTool
docs/explanation/adr/0017-jvm-jar-distribution-strategy.md

[grammar] ~253-~253: Ensure spelling is correct
Context: ...ired) - Faster build times (30s vs 2-5min per platform) - Easier debugging (st...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~260-~260: Consider an alternative to avoid wordiness and to strengthen your wording.
Context: ... - Standard JVM networking libraries work without issues - Future IPC implementations unblock...

(WORKS_WITHOUT_PROBLEMS)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (29)
scripts/clean-gradle-cache.sh (3)

1-10: Well-documented and correct error handling setup.

The shebang, documentation, and strict Bash options (set -euo pipefail) follow best practices. The usage example is clear and helpful.


12-13: Robust directory resolution.

The path resolution correctly handles symlinks and uses proper quoting. This approach reliably determines the project root from the script location.


18-41: Code is sound; .gradle-local usage is justified and script serves as appropriate manual utility.

Verification confirms .gradle-local is actively used in the build configuration (referenced in build.gradle.kts targetExclude patterns and listed in .gitignore), addressing the first concern. The script appears to function as an optional manual cleanup utility rather than an auto-invoked CI/CD step—no invocation points were found in the codebase. The cleanup scope appropriately covers .gradle-local, .gradle, .kotlin, and nested build/ directories, which encompasses standard Gradle and Kotlin plugin caches. Error handling with conditional checks and || true fallback is appropriate.

bin/scopes.bat (3)

47-73: LGTM! Java version parsing is now safely guarded.

The version parsing logic correctly handles cases where the version cannot be determined (lines 54-62) and guards the version comparison (line 64). This resolves the previous critical issue where undefined variables could cause script crashes.


75-108: Config file support implemented as requested.

The batch script now reads JAVA_OPTS from config files at standard locations (%APPDATA%\scopes\scopes.conf and %USERPROFILE%\.scopes\scopes.conf), maintaining the correct priority order: SCOPES_JAVA_OPTS > JAVA_OPTS > config file. This addresses the previous review request for feature parity with Unix and PowerShell wrappers.


110-116: LGTM! JAR execution logic is correct.

The script properly passes Java options when defined and forwards all arguments to the JAR, exiting with the Java process exit code.

bin/scopes.ps1 (3)

55-85: LGTM! Robust Java version detection.

The version parsing uses regex to extract the major version, handles both old (1.8) and new (21.x) formats, and gracefully degrades with warnings if the version cannot be determined. The implementation is defensive and handles edge cases well.


87-120: LGTM! Config file support is well-implemented.

The PowerShell script reads config files from standard locations with proper parsing using regex, handles quote removal, and respects the correct priority order for Java options.


122-130: LGTM! JAR execution with proper argument handling.

The script uses PowerShell splatting to properly pass Java options and arguments to the Java process, and exits with the correct exit code.

docs/explanation/security/sbom-verification.md (3)

85-88: LGTM! SLSA verification path corrected.

The SLSA verification command now correctly references verification/multiple.intoto.jsonl with the proper path prefix, resolving the previous review concern.


91-146: LGTM! Security tooling commands updated for JAR distribution.

The vulnerability scanning, license compliance, and security tool integration commands are properly updated to reference the new SBOM paths (sbom/scopes-sbom.json for source and sbom/scopes-binary-sbom.json for binary analysis).


148-173: LGTM! Continuous monitoring updated for JAR bundle workflow.

The GitHub Actions workflow example correctly demonstrates downloading and extracting the JAR bundle, with proper SBOM scanning commands. The example is consistent with the new distribution structure.

build.gradle.kts (2)

1-10: LGTM! Plugin configuration updated for JAR distribution.

The plugins block correctly removes the GraalVM Native Image plugin and retains the essential plugins for the JAR-based build. This aligns with the migration strategy documented in ADR-0017.


114-171: LGTM! Spotless exclusions expanded appropriately.

The addition of .gradle-local/** exclusions across all format targets (Kotlin, Kotlin Gradle scripts, JSON, YAML, Markdown) is reasonable for excluding local/development artifacts from formatting. The package.json exclusion is also appropriate.

install/install.ps1 (4)

71-104: LGTM! Help text correctly references install.ps1.

All usage examples and help text properly reference install.ps1, resolving the previous review concern about outdated script name references.


234-256: LGTM! SHA256 verification correctly implemented.

The hash verification now properly extracts only the first field from the checksum file (line 240) and performs a case-insensitive comparison (line 245). This resolves the previous critical issue where the entire line (including filename) was compared to the hash digest, causing verification to always fail.


110-157: LGTM! Java version detection is robust.

The Java version parsing handles both old (1.x) and new (21+) version formats, provides clear error messages for insufficient versions, and gracefully handles unparseable version strings with warnings.


159-221: LGTM! File detection logic is thorough.

The function searches multiple locations for the JAR and wrapper scripts, providing clear error messages if any required files are missing. This supports the local installation workflow from an extracted bundle.

docs/tutorials/getting-started.md (4)

14-24: LGTM! Prerequisites clearly state Java requirement.

The tutorial explicitly mentions the Java 21+ requirement and provides a link to the Java setup guide, ensuring users understand the prerequisite before attempting installation.


25-59: LGTM! Installation instructions use consistent placeholders and document the intended workflow.

The quick install sections for Linux/macOS and Windows use consistent vX.X.X version placeholders and properly document the JAR bundle installation workflow. The guidance to "Check latest release" helps users find the actual version. This documentation is appropriate for the migration being introduced in this PR.


61-112: LGTM! Manual installation instructions are comprehensive.

The manual installation sections provide detailed steps for both automated (using install scripts with custom directories) and fully manual (copying files) installation methods. The commands reference the proper wrapper scripts and paths for the JAR bundle distribution.


114-127: LGTM! Installation verification is clear.

The verification step demonstrates the expected scopes --version command and output, helping users confirm successful installation.

docs/explanation/adr/0017-jvm-jar-distribution-strategy.md (7)

1-68: LGTM! Context thoroughly documents the migration rationale.

The ADR provides comprehensive context explaining the issues with GraalVM Native Image (gRPC incompatibility, build complexity, development friction) and establishes the industry-standard JVM distribution approaches. This clearly justifies the migration decision.


69-151: LGTM! Distribution strategy is well-defined.

The decision to use Fat JAR with platform-specific wrapper scripts is clearly documented, with concrete examples and a phased migration plan. The Java 21 minimum requirement aligns with project configuration and coding guidelines.


188-210: LGTM! Package structure code block has language identifier.

The distribution package structure code block now includes the text language identifier (line 190), resolving the previous Markdown linter warning. The structure clearly documents the intended bundle layout.


212-246: LGTM! Security and documentation requirements are comprehensive.

The security considerations properly address JAR verification, wrapper script security, and Java runtime security. The documentation update requirements align with the observed changes across the PR.


247-375: LGTM! Consequences are balanced and realistic.

The ADR provides a balanced view of positive consequences (simplified development, gRPC enablement, reduced complexity) and negative consequences (Java dependency, startup performance). The implementation notes and testing requirements are comprehensive.


395-411: LGTM! Modular structure code block has language identifier.

The proposed modular structure code block now includes the text language identifier (line 397), resolving the previous Markdown linter warning. The future enhancement section provides useful forward planning for when the daemon is implemented.


525-537: LGTM! References and related ADRs are appropriate.

The ADR properly references related architectural decisions (ADR-0003, ADR-0005) and links to relevant documentation for tools and concepts mentioned in the decision.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 25, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 021df9c.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 08c6903cd8c0fde910a37f88322edcfb5dd907a8 🟢 6.7
Details
CheckScoreReason
Maintained🟢 56 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Signed-Releases⚠️ -1no releases found
Packaging⚠️ -1packaging workflow not detected
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ -1internal error: error during GetBranch(releases/v2): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST🟢 8SAST tool detected but not run on all commits
actions/actions/download-artifact 634f93cb2916e3fdff6788551b99b062d0335ce0 🟢 5.6
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
Maintained🟢 1013 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST🟢 9SAST tool detected but not run on all commits
Vulnerabilities⚠️ 011 existing vulnerabilities detected
actions/actions/setup-java 7a6d8a8234af8eb26422e24e3006232cccaa061b 🟢 6
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 57 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST🟢 10SAST tool is run on all commits
actions/actions/upload-artifact ea165f8d65b6e75b540449e92b4886f43607fa02 🟢 4.8
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained⚠️ 12 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST🟢 9SAST tool detected but not run on all commits
Vulnerabilities⚠️ 19 existing vulnerabilities detected
actions/gradle/actions/setup-gradle ed408507eac070d1f99cc633dbcf757c94c7933a 🟢 7.9
Details
CheckScoreReason
Dependency-Update-Tool🟢 10update tool detected
Code-Review🟢 4Found 4/10 approved changesets -- score normalized to 4
Maintained🟢 1030 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies🟢 10all dependencies are pinned
Vulnerabilities🟢 82 existing vulnerabilities detected
SAST🟢 9SAST tool detected but not run on all commits
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 10security policy file detected
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
CI-Tests🟢 811 out of 13 merged PRs checked by a CI test -- score normalized to 8
Contributors🟢 10project has 7 contributing companies or organizations
actions/slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml f7dd8c54c2067bafc12ca7a55595d5ee9b75204a 🟢 7.7
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 101 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10
Dependency-Update-Tool🟢 10update tool detected
Security-Policy🟢 10security policy file detected
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
CII-Best-Practices🟢 5badge detected: Passing
Pinned-Dependencies🟢 4dependency not pinned by hash detected -- score normalized to 4
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases🟢 105 out of the last 5 releases have a total of 5 signed artifacts.
SAST🟢 10SAST tool is run on all commits
Branch-Protection⚠️ 2branch protection is not maximal on development and all release branches
CI-Tests🟢 1028 out of 28 merged PRs checked by a CI test -- score normalized to 10
Vulnerabilities⚠️ 018 existing vulnerabilities detected
Contributors🟢 10project has 29 contributing companies or organizations
actions/step-security/harden-runner f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a 🟢 8.7
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
CI-Tests🟢 108 out of 8 merged PRs checked by a CI test -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Code-Review🟢 10all changesets reviewed
Contributors🟢 6project has 2 contributing companies or organizations -- score normalized to 6
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Dependency-Update-Tool🟢 10update tool detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Maintained🟢 1016 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 6dependency not pinned by hash detected -- score normalized to 6
SAST🟢 9SAST tool detected but not run on all commits
Security-Policy🟢 10security policy file detected
Signed-Releases⚠️ -1no releases found
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Vulnerabilities🟢 100 existing vulnerabilities detected

Scanned Files

  • .github/workflows/build.yml
  • .github/workflows/release.yml

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kamiazya, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request completes the strategic migration from platform-specific GraalVM Native Image binaries to a universal JAR distribution, as outlined in ADR-0017. This change simplifies the build system, reduces distribution size, and enhances the user and developer experience by leveraging standard JVM capabilities, albeit introducing a Java 21+ runtime dependency. This move unblocks future gRPC-based daemon communication and aligns the project with industry-standard JVM distribution practices.

Highlights

  • Distribution Migration: Fully transitioned from platform-specific GraalVM Native Image binaries to a single, universal JAR bundle distribution, significantly reducing overall download size and simplifying deployment.
  • Runtime Requirement: Users now require Java 21+ to run the application, replacing the previous no-runtime-dependency model of native binaries. Comprehensive setup guides for Java have been added.
  • Build System Simplification: The build process has been streamlined by replacing the GraalVM Native Image plugin with the Shadow JAR plugin, removing complex native image configurations, and simplifying CI/CD workflows.
  • Enhanced User Experience: Benefits include significantly smaller download sizes (~20MB vs ~260MB total for all platforms), faster startup times due to JVM optimizations, and improved debugging capabilities with standard JVM tools.
  • Comprehensive Documentation Updates: All relevant documentation, including security guides, installation instructions, and Architecture Decision Records (ADRs), has been updated to reflect the new JAR distribution strategy and Java runtime requirements.
  • Security Verification: Maintained SLSA Level 3 provenance and dual SBOM (source-level and binary-level) for robust supply chain security, with updated verification steps tailored for the JAR format.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/build.yml
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 191 to 208
# Check if hash file exists
HASH_FILE="$SCRIPT_DIR/verification/scopes.jar.sha256"
if [ ! -f "$HASH_FILE" ]; then
print_warning "Hash file not found, skipping verification"
return
fi

print_status "Verifying SHA256 hash..."

# Verify hash
if command -v sha256sum &> /dev/null; then
echo "$(cat "$HASH_FILE") $JAR_FILE" | sha256sum -c - || {
print_error "Hash verification failed"
exit 1
}
elif command -v shasum &> /dev/null; then
echo "$(cat "$HASH_FILE") $JAR_FILE" | shasum -a 256 -c - || {
print_error "Hash verification failed"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Checksum verification uses malformed sha256sum input

In the new JAR installer the integrity check builds the command with echo "$(cat "$HASH_FILE") $JAR_FILE" | sha256sum -c -. Because the hash file already contains "<digest> scopes.jar", appending the absolute JAR path produces a line like "<digest> scopes.jar /usr/local/lib/scopes.jar" which sha256sum/shasum reject as improperly formatted. On systems that have these tools (the default on most Linux/macOS installs) the script exits before copying files, so installation always fails despite a valid JAR. The command needs to substitute the filename in the checksum record with the target path instead of appending a second token.

Useful? React with 👍 / 👎.

Comment on lines 223 to 243
# Verify installation
function Test-InstallationFiles {
Write-Header "Verifying Installation"

$binaryPath = Join-Path $InstallDir "scopes.exe"

if (-not (Test-Path $binaryPath)) {
Write-ErrorMsg "Installation verification failed: binary not found at $binaryPath"
return $false

# Check if hash file exists
$hashFile = Join-Path $ScriptDir "verification\scopes.jar.sha256"
if (-not (Test-Path $hashFile)) {
Write-Warn "Hash file not found, skipping verification"
return
}

Write-Status "Verifying SHA256 hash..."

try {
$expectedHash = (Get-Content $hashFile).Trim()
$actualHash = (Get-FileHash -Path $JarFile -Algorithm SHA256).Hash

if ($actualHash -ne $expectedHash) {
Write-Err "Hash verification failed"
Write-Host "Expected: $expectedHash"
Write-Host "Actual: $actualHash"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge PowerShell installer compares entire checksum line instead of digest

Test-InstallationFiles reads scopes.jar.sha256 with Get-Content and compares the raw line to the digest from Get-FileHash. A checksum file created with sha256sum includes the filename after the hash (e.g. "<digest> scopes.jar"), so $expectedHash contains both fields and can never equal the digest string returned by Get-FileHash. Whenever the verification file exists the script reports "Hash verification failed" and aborts installation even for valid artifacts. The code should parse just the first whitespace-separated field from the checksum file before doing the comparison.

Useful? React with 👍 / 👎.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is a significant and well-executed migration from GraalVM native images to a standard JAR distribution. The changes are comprehensive, covering the build system, adding cross-platform wrapper scripts, and extensively updating the documentation to reflect this new strategy. The new ADR provides excellent context for the decision. I've identified a few minor issues related to consistency and robustness in the new scripts and documentation, which are detailed in the review comments. Overall, this is a great improvement that simplifies the build process and aligns the project with standard JVM distribution practices.

bin/scopes Outdated
fi

# Check Java version (robust extraction for EA builds and vendor variations)
JAVA_VERSION=$(java -version 2>&1 | sed -E -n 's/.*version "([0-9]+).*/\1/p' | head -n 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current sed command for Java version parsing is not robust for versions older than 9 (e.g., Java 8), as it won't match the 1.x format. This causes the script to issue a generic warning and proceed, which could lead to runtime errors. Using a more robust awk-based approach ensures that older Java versions are correctly identified and a proper error is shown, improving user experience and consistency with the other wrapper scripts.

JAVA_VERSION=$(java -version 2>&1 | grep 'version' | awk -F'"' '{print $2}' | awk -F. '{if ($1 == "1") print $2; else print $1}')

bin/scopes.bat Outdated
Comment on lines 70 to 78
REM Load Java options from environment variables
REM Priority: SCOPES_JAVA_OPTS > JAVA_OPTS
set "JAVA_OPTIONS="
if defined JAVA_OPTS (
set "JAVA_OPTIONS=%JAVA_OPTS%"
)
if defined SCOPES_JAVA_OPTS (
set "JAVA_OPTIONS=%SCOPES_JAVA_OPTS%"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The bash and PowerShell wrapper scripts support loading JAVA_OPTS from a scopes.conf configuration file, but this batch script only supports environment variables. For feature consistency across platforms, support for reading from a configuration file (e.g., %APPDATA%\scopes\scopes.conf) should be added, maintaining the override priority of SCOPES_JAVA_OPTS > JAVA_OPTS > config file.

REM Load Java options from config file, then environment variables
REM Priority: SCOPES_JAVA_OPTS > JAVA_OPTS > config file
set "JAVA_OPTIONS="

REM Check for config file in standard locations
set "CONFIG_FILE="
if exist "%APPDATA%\scopes\scopes.conf" (
    set "CONFIG_FILE=%APPDATA%\scopes\scopes.conf"
) else if exist "%USERPROFILE%\.scopes\scopes.conf" (
    set "CONFIG_FILE=%USERPROFILE%\.scopes\scopes.conf"
)

if defined CONFIG_FILE (
    for /f "usebackq tokens=1,* delims==" %%a in ("%CONFIG_FILE%") do (
        if /i "%%a"=="JAVA_OPTS" (
            set "TEMP_OPTS=%%b"
            set "JAVA_OPTIONS=!TEMP_OPTS:"=!!"
        )
    )
)

REM Override with environment variables
if defined JAVA_OPTS (
    set "JAVA_OPTIONS=%JAVA_OPTS%"
)
if defined SCOPES_JAVA_OPTS (
    set "JAVA_OPTIONS=%SCOPES_JAVA_OPTS%"
)

fi

# Extract major version number (handles both old and new version formats, EA builds, and vendor variations)
JAVA_VERSION=$(java -version 2>&1 | sed -E -n 's/.*version "([0-9]+).*/\1/p' | head -n 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current sed command for Java version parsing is not robust for versions older than 9 (e.g., Java 8). It will fail to extract the version, causing the script to exit with a generic "Could not determine Java version" error. Using a more robust awk-based approach would provide a more accurate error message to the user, indicating that their Java version is too old.

Suggested change
JAVA_VERSION=$(java -version 2>&1 | sed -E -n 's/.*version "([0-9]+).*/\1/p' | head -n 1)
JAVA_VERSION=$(java -version 2>&1 | grep 'version' | awk -F'"' '{print $2}' | awk -F. '{if ($1 == "1") print $2; else print $1}')

Comment on lines 86 to 88
slsa-verifier verify-artifact scopes.jar \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/kamiazya/scopes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The command example for SLSA verification has an incorrect path to the provenance file. It should point to verification/multiple.intoto.jsonl inside the bundle, but the verification/ prefix is missing. This will cause the command to fail for users following the guide.

Suggested change
slsa-verifier verify-artifact scopes.jar \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/kamiazya/scopes
slsa-verifier verify-artifact scopes.jar \
--provenance-path verification/multiple.intoto.jsonl \
--source-uri github.com/kamiazya/scopes

```bash
# Set version and platform (replace with actual values)
# Set version (replace with actual values)
VERSION="v0.1.0" # Check latest release at https://github.com/kamiazya/scopes/releases
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The documentation uses inconsistent version placeholders across different files (e.g., v0.1.0, v1.0.0, vX.X.X). To avoid confusion and make it clear that this is a placeholder, it would be best to use a consistent, generic placeholder like vX.X.X across all documentation. This applies to the PowerShell example in this file as well.

Suggested change
VERSION="v0.1.0" # Check latest release at https://github.com/kamiazya/scopes/releases
VERSION="vX.X.X" # Check latest release at https://github.com/kamiazya/scopes/releases

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🧹 Nitpick comments (14)
.github/ISSUE_TEMPLATE/graalvm-config-cache-issue.md (1)

2-11: Deprecation approach is clear and well-communicated.

The metadata updates (lines 2–5) and deprecation notice (lines 9–11) effectively signal that this template is obsolete. The redirect to the standard bug report template on line 11 helps users navigate to the appropriate current process.

Consider whether this template should be moved to an archived location (e.g., .github/ISSUE_TEMPLATE/archive/) rather than remaining in the active templates directory. This would prevent it from appearing in GitHub's issue creation UI while preserving it for historical reference. However, keeping it discoverable is also reasonable if you want users with legacy GraalVM issues to easily find the context.

docs/reference/jni-config.md (1)

3-6: Deprecation banner reads well; add cross-links for migration context.

Suggest linking ADR-0017 and the Java setup guide here to guide readers out of this deprecated page. Also consider marking the page as “Deprecated” in the nav/sidebar if your docs tooling supports it. As per coding guidelines.

bin/scopes.bat (2)

70-79: Parity and robustness for Java options and config (recommended).

  • Read JAVA_OPTS from a config file like the Unix/PS1 wrappers (e.g., %APPDATA%\scopes\scopes.conf, %USERPROFILE%.scopes\scopes.conf).
  • Preserve quoting in options (current splitting can break -Dprop="a b"). Consider supporting Java argfiles (@file) to avoid fragile tokenization.

Example additions:

REM Optional: load JAVA_OPTS from config
for %%F in ("%APPDATA%\scopes\scopes.conf" "%USERPROFILE%\.scopes\scopes.conf") do (
  if exist "%%~F" (
    for /f "usebackq tokens=1,* delims==" %%K in ("%%~F") do (
      if /I "%%~K"=="JAVA_OPTS" set "JAVA_OPTIONS=%%~L"
    )
    goto :opts_loaded
  )
)
:opts_loaded

Argfile pattern (requires writing to %TEMP% and passing @file before -jar).


10-21: Allow overrides for JAR location and Java locator (optional).

  • Support SCOPES_JAR and SCOPES_HOME to override discovery.
  • If where java fails, try %JAVA_HOME%\bin\java.exe.

This improves portability on locked-down Windows images.

bin/scopes.ps1 (2)

117-125: Preserve quoting for Java options (use @argfile).

-split '\s+' breaks values with spaces (e.g., -Dprop="a b"). Prefer Java’s argument files to avoid manual tokenization.

Minimal change:

if ($JavaOptions) {
  $argFile = Join-Path $env:TEMP "scopes-java-opts.args"
  Set-Content -Path $argFile -NoNewline -Value $JavaOptions
  & java "@$argFile" -jar $JarFile @Arguments
  $exit = $LASTEXITCODE
  Remove-Item -ErrorAction SilentlyContinue $argFile
  exit $exit
} else {
  & java -jar $JarFile @Arguments
}

16-28: Add environment overrides for JAR discovery and JAVA_HOME fallback (optional).

  • Check $env:SCOPES_JAR first; then $env:SCOPES_HOME\lib\scopes.jar.
  • If Get-Command java fails, try & (Join-Path $env:JAVA_HOME 'bin\java.exe') when $env:JAVA_HOME is set.

Improves operability on enterprise Windows hosts.

bin/scopes (2)

102-108: Avoid fragile splitting of JAVA options (use Java @argfile).

Passing $JAVA_OPTIONS unquoted breaks quoted values. Prefer an argfile to preserve intended tokens.

-if [ -n "$JAVA_OPTIONS" ]; then
-    # shellcheck disable=SC2086
-    exec java $JAVA_OPTIONS -jar "$JAR_FILE" "$@"
-else
-    exec java -jar "$JAR_FILE" "$@"
-fi
+if [ -n "$JAVA_OPTIONS" ]; then
+    ARGFILE="$(mktemp)"
+    printf '%s' "$JAVA_OPTIONS" > "$ARGFILE"
+    exec java "@$ARGFILE" -jar "$JAR_FILE" "$@"
+else
+    exec java -jar "$JAR_FILE" "$@"
+fi

12-24: Support env overrides for JAR discovery and JAVA_HOME fallback (optional).

  • Prepend checks for SCOPES_JAR and SCOPES_HOME (e.g., $SCOPES_HOME/lib/scopes.jar).
  • If command -v java fails but $JAVA_HOME is set, try "$JAVA_HOME/bin/java".

Improves ergonomics across diverse environments.

SECURITY.md (1)

69-77: Minor clarity: name the SBOM/scanner tools for consistency.

To align with migration notes, explicitly call out Syft and Grype:

-  - Compiled JAR artifacts scanned with Grype
+  - Binary-level SBOM (CycloneDX) generated with Syft from compiled JAR artifacts
+  - Compiled JAR artifacts scanned with Grype

This matches the “dual SBOMs (CycloneDX + Syft)” and “Grype scanning” described in the PR.

install/install.sh (1)

331-361: Fish shell PATH update uses bash syntax; won’t work in fish.

Use fish-native commands when $SHELL is fish.

-            fish)
-                PROFILE_FILE="$HOME/.config/fish/config.fish"
-                ;;
+            fish)
+                PROFILE_FILE="$HOME/.config/fish/config.fish"
+                ;;
...
-                echo "" >> "$PROFILE_FILE"
-                echo "# Added by Scopes installer" >> "$PROFILE_FILE"
-                echo "export PATH=\"$INSTALL_DIR/bin:\$PATH\"" >> "$PROFILE_FILE"
+                if [ "$SHELL_NAME" = "fish" ]; then
+                  mkdir -p "$(dirname "$PROFILE_FILE")"
+                  echo "" >> "$PROFILE_FILE"
+                  echo "# Added by Scopes installer" >> "$PROFILE_FILE"
+                  echo "set -gx PATH \"$INSTALL_DIR/bin\" \$PATH" >> "$PROFILE_FILE"
+                else
+                  echo "" >> "$PROFILE_FILE"
+                  echo "# Added by Scopes installer" >> "$PROFILE_FILE"
+                  echo "export PATH=\"$INSTALL_DIR/bin:\$PATH\"" >> "$PROFILE_FILE"
+                fi
install/install.ps1 (1)

128-157: Java version parsing: proceed-on-parse-fail weakens the requirement.

If version can’t be parsed, we should fail closed instead of proceeding.

-        } else {
-            Write-Warn "Could not parse Java version, proceeding anyway..."
-        }
+        } else {
+            Write-Err "Could not parse Java version. Scopes requires Java 21+."
+            exit 1
+        }
...
-    } catch {
-        Write-Warn "Could not check Java version, proceeding anyway..."
-    }
+    } catch {
+        Write-Err "Could not check Java version. Ensure Java 21+ is installed."
+        exit 1
+    }
.github/workflows/release.yml (2)

226-229: Initialize file without bare redirection (SC2188).

Use a no-op with redirection to satisfy shellcheck.

-          # Initialize the combined hashes file
-          > combined-hashes.txt
+          # Initialize the combined hashes file
+          : > combined-hashes.txt

Static analysis flagged this (actionlint/shellcheck SC2188). Based on hints.


237-239: Quote outputs and avoid Useless Use of cat; also fix SC2086 risk.

Safer and cleaner:

-          HASHES_B64=$(cat combined-hashes.txt | base64 -w0)
-          echo "hashes=$HASHES_B64" >> $GITHUB_OUTPUT
+          HASHES_B64="$(base64 -w0 combined-hashes.txt)"
+          echo "hashes=$HASHES_B64" >> "$GITHUB_OUTPUT"

actionlint hinted SC2086; this addresses it. Based on static analysis.

docs/explanation/adr/README.md (1)

252-253: ADR-0017 index entry looks good; consider adding it to the relationship diagram.

Optional: extend the Mermaid graph with ADR-0017 and its links (e.g., to ADR-0006 Docs, ADR-0005 CLI).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2da8ec3 and 9d6ad37.

📒 Files selected for processing (34)
  • .changeset/jar-distribution-docs-update.md (1 hunks)
  • .github/ISSUE_TEMPLATE/graalvm-config-cache-issue.md (1 hunks)
  • .github/workflows/build.yml (0 hunks)
  • .github/workflows/release.yml (10 hunks)
  • SECURITY.md (2 hunks)
  • apps/scopes/build.gradle.kts (2 hunks)
  • apps/scopes/src/main/resources/META-INF/native-image/jni-config.json (0 hunks)
  • apps/scopes/src/main/resources/META-INF/native-image/native-image.properties (0 hunks)
  • apps/scopes/src/main/resources/META-INF/native-image/reflect-config.json (0 hunks)
  • apps/scopes/src/main/resources/META-INF/native-image/resource-config.json (0 hunks)
  • apps/scopes/src/main/resources/logback-native.xml (0 hunks)
  • bin/scopes (1 hunks)
  • bin/scopes.bat (1 hunks)
  • bin/scopes.ps1 (1 hunks)
  • build.gradle.kts (0 hunks)
  • docs/explanation/adr/0017-jvm-jar-distribution-strategy.md (1 hunks)
  • docs/explanation/adr/README.md (1 hunks)
  • docs/explanation/automated-release-process.md (4 hunks)
  • docs/explanation/security/README.md (1 hunks)
  • docs/explanation/security/sbom-verification.md (5 hunks)
  • docs/explanation/security/security-verification.md (5 hunks)
  • docs/explanation/setup/README.md (2 hunks)
  • docs/explanation/setup/graalvm-setup.md (0 hunks)
  • docs/explanation/setup/java-setup.md (1 hunks)
  • docs/explanation/user-stories/0007-secure-manual-installation.md (10 hunks)
  • docs/reference/jni-config.md (1 hunks)
  • docs/tutorials/getting-started.md (1 hunks)
  • gradle/libs.versions.toml (2 hunks)
  • install/README.md (0 hunks)
  • install/install.ps1 (1 hunks)
  • install/install.sh (1 hunks)
  • install/offline/README.md (0 hunks)
  • install/offline/install.sh (0 hunks)
  • install/verify-README.md (0 hunks)
💤 Files with no reviewable changes (12)
  • apps/scopes/src/main/resources/META-INF/native-image/resource-config.json
  • apps/scopes/src/main/resources/META-INF/native-image/jni-config.json
  • install/offline/README.md
  • apps/scopes/src/main/resources/META-INF/native-image/reflect-config.json
  • install/verify-README.md
  • apps/scopes/src/main/resources/META-INF/native-image/native-image.properties
  • install/README.md
  • apps/scopes/src/main/resources/logback-native.xml
  • docs/explanation/setup/graalvm-setup.md
  • .github/workflows/build.yml
  • build.gradle.kts
  • install/offline/install.sh
🧰 Additional context used
📓 Path-based instructions (5)
docs/**

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Documentation under docs/ should follow the Diátaxis framework structure

Files:

  • docs/reference/jni-config.md
  • docs/explanation/security/sbom-verification.md
  • docs/explanation/adr/0017-jvm-jar-distribution-strategy.md
  • docs/tutorials/getting-started.md
  • docs/explanation/security/security-verification.md
  • docs/explanation/automated-release-process.md
  • docs/explanation/setup/java-setup.md
  • docs/explanation/user-stories/0007-secure-manual-installation.md
  • docs/explanation/setup/README.md
  • docs/explanation/security/README.md
  • docs/explanation/adr/README.md
docs/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Write documentation in English (project’s official language)

Files:

  • docs/reference/jni-config.md
  • docs/explanation/security/sbom-verification.md
  • docs/explanation/adr/0017-jvm-jar-distribution-strategy.md
  • docs/tutorials/getting-started.md
  • docs/explanation/security/security-verification.md
  • docs/explanation/automated-release-process.md
  • docs/explanation/setup/java-setup.md
  • docs/explanation/user-stories/0007-secure-manual-installation.md
  • docs/explanation/setup/README.md
  • docs/explanation/security/README.md
  • docs/explanation/adr/README.md
**/*.{kt,kts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{kt,kts}: Adhere to ktlint formatting rules for all Kotlin source and script files; run ktlintFormat before committing
Code must pass Detekt static analysis; avoid suppressing rules without clear justification

Files:

  • apps/scopes/build.gradle.kts
{gradle/libs.versions.toml,settings.gradle.kts,**/build.gradle.kts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not modify dependencies to work around the JitPack/kulid resolution issue; keep declared dependencies unchanged until connectivity is restored

Files:

  • apps/scopes/build.gradle.kts
  • gradle/libs.versions.toml
{**/build.gradle.kts,gradle.properties}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Keep the project targeting Java 21 in Gradle configuration; do not downgrade the toolchain

Files:

  • apps/scopes/build.gradle.kts
🪛 actionlint (1.7.8)
.github/workflows/release.yml

181-181: shellcheck reported issue in this script: SC2086:info:2:41: Double quote to prevent globbing and word splitting

(shellcheck)


218-218: shellcheck reported issue in this script: SC2188:warning:9:1: This redirection doesn't have a command. Move to its command (or use 'true' as no-op)

(shellcheck)


218-218: shellcheck reported issue in this script: SC2086:info:20:30: Double quote to prevent globbing and word splitting

(shellcheck)

🪛 LanguageTool
docs/explanation/adr/0017-jvm-jar-distribution-strategy.md

[grammar] ~253-~253: Ensure spelling is correct
Context: ...ired) - Faster build times (30s vs 2-5min per platform) - Easier debugging (st...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~260-~260: Consider an alternative to avoid wordiness and to strengthen your wording.
Context: ... - Standard JVM networking libraries work without issues - Future IPC implementations unblock...

(WORKS_WITHOUT_PROBLEMS)

🪛 markdownlint-cli2 (0.18.1)
docs/explanation/adr/0017-jvm-jar-distribution-strategy.md

190-190: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


397-397: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

docs/explanation/setup/java-setup.md

325-325: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Lint and Static Analysis
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (35)
bin/scopes.ps1 (1)

55-80: Version check logic is solid and resilient.

Handles EA and legacy 1.x formats, and safely proceeds on parse failures. LGTM.

SECURITY.md (1)

58-61: All documentation links verified and correct.

The relative paths in SECURITY.md (lines 58-61) all resolve successfully. No action required.

install/install.sh (1)

121-156: Java version parse is OK; consider stricter failure on unknown format.

If parsing fails (Line 141), exiting is good. Keep as-is.
If you want EA builds support (e.g., “22-ea”), add fallback: grep -oE '"[0-9]+' | tr -dc 0-9. Do you want a patch?

docs/explanation/security/README.md (1)

35-37: Good alignment with new installers; note current Windows hash bug.

Docs state installers auto-verify SHA256 and SLSA. Linux path is correct; Windows will fail until the hash parsing fix lands (see install/install.ps1). No changes needed here.

.github/workflows/release.yml (1)

180-185: The review comment is based on an incorrect assumption and should be dismissed.

The code correctly handles SLSA provenance, though for a different reason than the structure suggests:

  1. The jar_hash output at line 183 (custom format scopes.jar:$JAR_HASH) is defined but never consumed by any downstream job.

  2. The actual SLSA integration occurs in the collect-hashes job (lines 210–218), which:

    • Independently downloads the JAR artifact
    • Recalculates the hash in the correct format: "$JAR_HASH scopes.jar" (standard sha256sum format)
    • Base64 encodes this properly formatted output
    • Passes it to the SLSA generator as base64-subjects
  3. The provenance job receives correctly formatted input from collect-hashes, not from the unused jar_hash variable.

There is no format incompatibility with the SLSA generator because the problematic jar_hash output is never used. The unused output is a code organization issue but does not affect correctness.

Likely an incorrect or invalid review comment.

docs/explanation/setup/java-setup.md (1)

1-365: Excellent comprehensive Java setup guide.

This document provides clear, platform-specific guidance with multiple installation options, troubleshooting, and advanced configuration. The structure follows the explanation/reference pattern appropriately with logical section progression and clear examples. Well-suited to support the migration away from GraalVM-specific setup requirements.

docs/explanation/setup/README.md (1)

8-8: Appropriate index updates reflecting Java setup migration.

The setup directory index now correctly references the Java Setup guide (replacing GraalVM-focused content) and accurately documents that Java 21+ is required. Navigation is clear and consistent with the migration strategy.

Also applies to: 18-19

docs/explanation/security/sbom-verification.md (3)

15-19: Clarify SBOM format availability.

Line 16 states "Format: JSON" but the surrounding context and ADR-0017 mention CycloneDX in both JSON and XML formats. Verify whether XML SBOMs are still provided as alternative formats or completely removed from the JAR distribution. If XML is removed, this should be explicitly stated. If retained, the format documentation should list both.

Search for references to SBOM XML format in release documentation or ADR-0017 to confirm whether XML is included in the JAR bundle distribution.


31-55: Bundle extraction and SBOM path consistency verified.

The JAR bundle extraction instructions (lines 34-43 and 46-55) correctly reference the generalized SBOM paths (sbom/scopes-sbom.json and sbom/scopes-binary-sbom.json) for both Linux/macOS and Windows PowerShell workflows. Terminology appropriately updated from platform-specific to JAR bundle.


69-104: SBOM analysis commands appropriately updated for JAR distribution.

Commands for validating, scanning, and analyzing SBOMs (lines 72-145) now correctly reference the generalized SBOM file paths consistent with the JAR-only distribution model. Scanning tools (Grype, Syft) and Dependency-Track integration commands are properly updated.

.changeset/jar-distribution-docs-update.md (1)

1-43: Comprehensive and accurate migration changeset.

The changeset clearly documents the GraalVM-to-JAR migration with proper breaking change notice, detailed technical changes (Shadow JAR plugin, wrapper scripts, CI/CD simplification), and balanced user impact analysis. All statements align with the PR objectives and related documentation updates. The benefits/requirements framing is appropriate for end-user communication.

gradle/libs.versions.toml (1)

37-37: Appropriate build plugin migration to Shadow JAR.

The version catalog correctly introduces the Shadow plugin (com.gradleup.shadow v8.3.6) which is the industry-standard Gradle plugin for creating fat JARs. The version is stable and well-maintained. Removal of GraalVM-related entries follows the migration strategy cleanly, and no conflicts exist with other declared dependencies.

Also applies to: 94-94

docs/tutorials/getting-started.md (2)

16-23: Prerequisites clearly updated with Java 21+ requirement.

The updated prerequisites (lines 16-18) appropriately add Java 21+ as a critical requirement with cross-reference to the Java Setup Guide. Line 23 provides clear context-setting note about JAR distribution and Java dependency. This sets proper expectations for users transitioning from native binaries.


112-125: Installation verification step appropriate for JAR context.

The verification commands now correctly check for Scopes functionality (scopes --version) after JAR installation, with example output that reflects the JAR-based distribution. This is the right verification approach for the new installation model.

docs/explanation/adr/0017-jvm-jar-distribution-strategy.md (1)

69-210: Comprehensive and well-reasoned ADR for JAR distribution decision.

ADR-0017 effectively documents the decision to migrate from GraalVM Native Image to a universal JAR distribution. The context clearly outlines the limitations of GraalVM (gRPC incompatibility, build complexity, development friction), and the decision is well-justified with industry-standard practices. The distribution strategy is concrete with clear implementation details, migration plan is phased and practical, and consequences are honestly balanced. The future enhancement section on modular JAR distribution shows forward thinking.

Minor: Fix two missing language identifiers in fenced code blocks (lines 190 and 397) per linting hints.

docs/explanation/user-stories/0007-secure-manual-installation.md (2)

1-112: User story successfully updated for JAR bundle installation.

The user story title, terminology, and acceptance criteria have been consistently updated from platform-bundle to JAR bundle context. The Gherkin scenarios are comprehensive, testable, and appropriately focused on security verification of the JAR distribution. All platform-specific installer references have been replaced with universal JAR bundle + wrapper script approach, and the Java 21+ requirement is clearly stated in dependencies (line 164) and context.

The security features section (lines 174-192) appropriately emphasizes JAR hash verification and SLSA provenance for the new distribution model.


194-213: Implementation notes appropriately detail JAR bundle workflow.

The platform support section now correctly documents bash/PowerShell scripts with Java 21+ requirement, and installation methods clearly show the tar/zip → extract → install workflow for both Unix and Windows platforms. This aligns with the overall JAR distribution strategy.

apps/scopes/build.gradle.kts (4)

1-8: Plugin migration from GraalVM to Shadow looks correct.

The replacement of alias(libs.plugins.graalvm.native) with alias(libs.plugins.shadow) is the right approach for this migration. The application plugin is preserved, which is correct for JAR-based applications.


87-109: Shadow JAR configuration is well-structured; clarify Multi-Release attribute necessity.

The shadowJar task configuration appropriately handles fat JAR creation with service file merging (critical for Koin DI) and reasonable size optimizations. However, the Multi-Release attribute on Line 95 is typically used for JARs with version-specific class files (e.g., Java 8, 11, 21 variants). Since this project targets Java 21 exclusively, verify whether this attribute is necessary or if it can be removed to simplify the manifest.

#!/bin/bash
# Verify if Multi-Release attribute serves a purpose in this codebase
# Check for version-specific module-info or Java version-conditional compilation

rg -n "module-info\|jpms\|java.base" --type=kotlin --type=java apps/scopes/
grep -r "sourceCompatibility\|targetCompatibility" gradle.properties build.gradle.kts apps/scopes/build.gradle.kts 2>/dev/null | head -20

104-108: JAR size optimization exclusions are appropriate.

The exclusions of signature files (*.SF, *.DSA, *.RSA) and license metadata from the shaded JAR are standard practice and won't affect functionality. This helps reduce the JAR size significantly while maintaining all functional classes and resources.


111-113: Build dependency on shadowJar ensures fat JAR is always produced.

Adding the explicit dependency ensures the shadow JAR is built alongside the standard build task, which is correct for this distribution model.

docs/explanation/automated-release-process.md (6)

13-41: Mermaid diagrams effectively communicate the JAR-centric release workflow.

The overview diagram clearly illustrates the three main job stages (Build JAR, Security Verification & SLSA, GitHub Release) and output types, making the migration from multi-platform native binaries to a universal JAR transparent. The styling and grouping are appropriate.


45-75: Build JAR Artifacts job flow is comprehensive and well-detailed.

The step-by-step flow (Checkout → Setup Java 21 + Gradle → Extract Version → ... → Upload Artifacts) correctly captures the Shadow JAR build process with integrated SBOM and vulnerability scanning. The ordering and dependencies are logical.


77-111: JAR Security Scanning section properly integrates Grype and Syft.

The scanning pipeline (Artifact Collection → Security Analysis → Results Integration) is appropriate for JAR-based verification. The distinction between Grype (vulnerability scanning) and Syft (SBOM generation) is clear.


113-139: Provenance generation section accurately reflects SLSA Level 3 integration.

The use of JAR hash encoding for SLSA provenance is correct, and the flow clearly shows integration with the SLSA framework for cryptographic attestation.


141-181: GitHub Release Creation section comprehensively covers artifact organization.

The diagram properly shows downloading all artifact types (JAR, SBOMs, scan results, provenance) before processing and publishing. The asset attachment and publication workflow is clear.


303-312: Verify all cross-referenced documentation files exist and have appropriate content.

Line 312 references ../tutorials/getting-started.md, and earlier lines reference ../guides/security-verification.md and ../guides/sbom-verification.md. Ensure these paths are correct relative to this file's location and that the referenced documents align with the JAR distribution model described here.

#!/bin/bash
# Verify cross-referenced documentation files exist
# Check paths relative to docs/explanation/automated-release-process.md

echo "Checking referenced files..."
find docs -name "getting-started.md" -o -name "security-verification.md" -o -name "sbom-verification.md" | sort

# Verify relative paths from docs/explanation/
cd docs/explanation 2>/dev/null && {
    echo ""
    echo "Relative paths from docs/explanation/:"
    ls -la ../tutorials/getting-started.md 2>/dev/null || echo "✗ ../tutorials/getting-started.md NOT FOUND"
    ls -la ../guides/security-verification.md 2>/dev/null || echo "✗ ../guides/security-verification.md NOT FOUND"
    ls -la ../guides/sbom-verification.md 2>/dev/null || echo "✗ ../guides/sbom-verification.md NOT FOUND"
}
docs/explanation/security/security-verification.md (8)

1-15: Documentation introduction appropriately emphasizes JAR-based security verification.

The updated overview correctly positions SHA256 checksums and SLSA provenance as primary verification mechanisms for the universal JAR distribution, with SBOMs as supporting security inventory. This aligns well with the migration objectives.


18-49: Automated installation verification section provides clear, actionable guidance.

The installer-based verification path is well-documented with platform-specific instructions (bash for Linux/macOS/WSL, PowerShell for Windows) and a clear bulleted list of what the installer performs (SHA256 check, SLSA verification, installation, PATH configuration). This lowers the barrier for users to verify before installation.


50-127: Manual verification instructions are comprehensive and platform-specific.

The manual SLSA and SHA256 verification sections correctly guide users through:

  • Installing slsa-verifier
  • Extracting the JAR bundle
  • Verifying the artifact
  • Handling platform-specific variations (bash, shasum, PowerShell)

The expected output for successful verification is clearly documented. This allows users to verify without relying on the installer scripts.


129-139: SLSA verification scope and limitations are clearly articulated.

The distinction between what SLSA confirms (source repository, commit hash, build environment, artifact integrity) and what it does not confirm (source code content, runtime behavior, dependency security) is important for user understanding and is well-explained.


212-240: Verify SBOM file paths and naming conventions match the build and release workflow.

The SBOM verification section references specific file paths (sbom/scopes-sbom.json, sbom/scopes-binary-sbom.json) and integration with tools like cyclonedx and grype. Ensure these paths match what is actually generated by the Shadow JAR build process and published in the release workflow. Cross-check with .github/workflows/release.yml and the build.gradle.kts CycloneDX plugin configuration.

#!/bin/bash
# Description: Verify SBOM paths and naming in build configuration

echo "=== Checking build.gradle.kts for SBOM configuration ==="
grep -n "cyclonedx\|sbom\|CycloneDX" apps/scopes/build.gradle.kts build.gradle.kts 2>/dev/null | head -20

echo ""
echo "=== Checking release workflow for SBOM artifact naming ==="
grep -n "sbom\|SBOM" .github/workflows/release.yml 2>/dev/null | head -20

echo ""
echo "=== Checking for SBOM generation in tasks ==="
rg -n "tasks\.|shadowJar\|cyclone" gradle/libs.versions.toml apps/scopes/build.gradle.kts --type=kotlin 2>/dev/null | grep -i sbom | head -20

217-240: SBOM verification examples are tool-appropriate and follow security standards.

The use of cyclonedx validate for format validation and grype for vulnerability scanning against SBOM files demonstrates awareness of current security practices. Providing both source-level and binary-level SBOM examples is valuable for comprehensive dependency tracking.


190-210: Troubleshooting section appropriately handles common failure scenarios.

The guidance for verification failures (detection of tampering/corruption), missing provenance, and tool installation issues is practical and escalation-appropriate (contact maintainers if provenance is missing from official releases).


18-49: Verify JAR bundle naming and download URLs are consistent with actual release workflow.

The documentation references specific download URLs with bundle naming patterns (scopes-vX.X.X-jar-bundle.tar.gz, scopes-vX.X.X-jar-bundle.zip) and includes installer script paths (./install.sh, .\install.ps1). Ensure these match the actual artifacts published by the release workflow and the directory structure of the distributed bundles.

#!/bin/bash
# Description: Verify JAR bundle naming and structure in release workflow

echo "=== Checking release workflow for artifact naming ==="
grep -n "scopes.*jar-bundle\|jar.bundle\|scopes.jar" .github/workflows/release.yml 2>/dev/null | head -30

echo ""
echo "=== Checking for install script references ==="
grep -n "install\\.sh\|install\\.ps1" .github/workflows/release.yml docs/explanation/security/security-verification.md 2>/dev/null | head -20

echo ""
echo "=== Listing files in install/ and bin/ directories if they exist ==="
find . -path "./install/*" -o -path "./bin/*" 2>/dev/null | head -30

Also applies to: 82-127

Comment on lines 620 to 637
## Security & Verification

This release includes SLSA Level 3 provenance and Software Bill of Materials (SBOM) for comprehensive supply chain security.
This release includes SLSA Level 3 provenance for supply chain security.

### SLSA Provenance Verification
```bash
# Install slsa-verifier
go install github.com/slsa-framework/slsa-verifier/v2/cli/slsa-verifier@latest

# Extract and verify from platform bundle
tar -xzf scopes-${{ needs.resolve-version.outputs.version }}-linux-x64-bundle.tar.gz
cd scopes-*-bundle
# Download the JAR and provenance
wget https://github.com/${{ github.repository }}/releases/download/${{ needs.resolve-version.outputs.tag_version }}/scopes-${{ needs.resolve-version.outputs.version }}-jar-bundle.tar.gz
wget https://github.com/${{ github.repository }}/releases/download/${{ needs.resolve-version.outputs.tag_version }}/multiple.intoto.jsonl

slsa-verifier verify-artifact scopes-${{ needs.resolve-version.outputs.version }}-linux-x64 \
--provenance-path verification/multiple.intoto.jsonl \
# Verify
slsa-verifier verify-artifact scopes-${{ needs.resolve-version.outputs.version }}-jar-bundle.tar.gz \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/${{ github.repository }}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

SLSA verification instructions target tarball, but provenance is for the JAR only.

collect-hashes only includes scopes.jar, so the generated provenance covers the JAR, not the tar/zip bundles. The current notes will fail.

Two options:

  • A) Quick doc fix (recommended now): verify scopes.jar instead of the tarball.
-          # Download the JAR and provenance
-          wget https://github.com/${{ github.repository }}/releases/download/${{ needs.resolve-version.outputs.tag_version }}/scopes-${{ needs.resolve-version.outputs.version }}-jar-bundle.tar.gz
-          wget https://github.com/${{ github.repository }}/releases/download/${{ needs.resolve-version.outputs.tag_version }}/multiple.intoto.jsonl
-
-          # Verify
-          slsa-verifier verify-artifact scopes-${{ needs.resolve-version.outputs.version }}-jar-bundle.tar.gz \
-            --provenance-path multiple.intoto.jsonl \
-            --source-uri github.com/${{ github.repository }}
+          # Download the JAR and provenance
+          wget https://github.com/${{ github.repository }}/releases/download/${{ needs.resolve-version.outputs.tag_version }}/scopes.jar
+          wget https://github.com/${{ github.repository }}/releases/download/${{ needs.resolve-version.outputs.tag_version }}/multiple.intoto.jsonl
+
+          # Verify
+          slsa-verifier verify-artifact scopes.jar \
+            --provenance-path multiple.intoto.jsonl \
+            --source-uri github.com/${{ github.repository }}
  • B) Workflow change (later): include tar/zip hashes in subjects and generate provenance after bundles are created. I can draft that if you want.
🤖 Prompt for AI Agents
.github/workflows/release.yml around lines 620 to 637: the docs currently
instruct verifying the tarball but the provenance only covers scopes.jar
(collect-hashes included only the JAR), so update the verification command and
examples to target scopes.jar (e.g., download and verify scopes.jar and its
corresponding multiple.intoto.jsonl) to match the generated provenance;
alternatively, if you want the workflow change later, add bundle artifact hashes
to the subjects and generate provenance after bundle creation so tarball
verification is valid.

## Overview

The `jni-config.json` file in `/apps/scopes/src/main/resources/META-INF/native-image/` is required for GraalVM native image compilation when using SQLite JDBC driver.
The `jni-config.json` file in `/apps/scopes/src/main/resources/META-INF/native-image/` was required for GraalVM native image compilation when using SQLite JDBC driver.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix path prefix to avoid implying an absolute filesystem path.

Change “/apps/scopes/…” to a repo‑relative path.

-The `jni-config.json` file in `/apps/scopes/src/main/resources/META-INF/native-image/` was required for GraalVM native image compilation when using SQLite JDBC driver.
+The `jni-config.json` file in `apps/scopes/src/main/resources/META-INF/native-image/` was required for GraalVM native image compilation when using the SQLite JDBC driver.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The `jni-config.json` file in `/apps/scopes/src/main/resources/META-INF/native-image/` was required for GraalVM native image compilation when using SQLite JDBC driver.
The `jni-config.json` file in `apps/scopes/src/main/resources/META-INF/native-image/` was required for GraalVM native image compilation when using the SQLite JDBC driver.
🤖 Prompt for AI Agents
In docs/reference/jni-config.md around line 9, the path shown for
jni-config.json uses a leading slash implying an absolute filesystem path
("/apps/scopes/..."); update it to a repo‑relative path by removing the leading
slash (e.g., "apps/scopes/src/main/resources/META-INF/native-image/...") so the
doc correctly references the file within the repository.

kamiazya and others added 3 commits October 26, 2025 02:03
Add comprehensive protections against Gradle cache lint errors:
- Add .gradle-local/ to .gitignore
- Create scripts/clean-gradle-cache.sh for cleaning all Gradle caches
- Update spotless configuration to exclude .gradle-local/** from all targets
- Exclude package.json from spotless JSON formatting

This prevents the 1079 lint errors that occurred in the previous commit
when pre-commit hooks ran spotless checks on auto-generated Gradle cache
files in .gradle-local/ directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Critical installer fixes:
- Fix bash installer hash verification (extract checksum token properly)
- Fix PowerShell installer hash verification (parse digest from hash file)
- Update script name references in install.ps1 (install-jar.ps1 → install.ps1)

Wrapper script improvements:
- Improve Java version parsing in bash wrapper (support Java 8 format: 1.8.0_xxx)
- Add config file support to batch wrapper (scopes.bat)
- Guard Java version parsing in batch wrapper (handle parse failures gracefully)
- Improve config parsing in bash wrapper (trim whitespace from key=value)
- Enhance PowerShell wrapper error messages (add installation instructions)

Documentation fixes:
- Fix SLSA verification path (add missing verification/ prefix)
- Standardize version placeholders (use vX.X.X consistently)
- Update getting-started.md with correct install instructions
- Add language identifiers to code blocks in ADR-0017
- Fix absolute path in jni-config.md (remove leading slash)

All fixes address specific issues identified in AI code review:
- Hash verification now works correctly on Linux/macOS/Windows
- Java version detection handles both old (1.x) and new (21+) formats
- Config file parsing is robust to whitespace and quotes
- Documentation references are accurate and consistent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The jni-config.md document is no longer applicable after migration
from GraalVM Native Image to JAR distribution. JNI configuration is
not required for standard JVM execution with SQLite JDBC driver.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@kamiazya kamiazya changed the title docs: migrate from GraalVM Native Image to JAR distribution feat: migrate from GraalVM Native Image to JAR distribution Oct 25, 2025
This file was only needed for GraalVM Native Image compilation and is no longer relevant after migrating to JAR distribution. Its presence was causing CodeQL Autobuild to fail with:
- error: package org.graalvm.nativeimage.hosted does not exist

Fixes CodeQL workflow failure on this branch.
@kamiazya kamiazya merged commit 5cff8d5 into main Oct 25, 2025
9 checks passed
@kamiazya kamiazya deleted the docs/jar-distribution-migration branch October 25, 2025 17:49
@github-actions github-actions bot mentioned this pull request Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants