Skip to content

Integrate Conductor into java-slang#95

Open
kjw142857 wants to merge 2 commits into
mainfrom
conductor
Open

Integrate Conductor into java-slang#95
kjw142857 wants to merge 2 commits into
mainfrom
conductor

Conversation

@kjw142857

Copy link
Copy Markdown
Contributor

No description provided.

@kjw142857 kjw142857 requested a review from martin-henz June 10, 2026 02:01
Comment on lines +10 to +37
name: Build runner
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn run build --all || yarn build

- name: Upload artifacts
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: dist/

deploy:

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a minimal JavaEvaluator and associated conductor runner infrastructure to support executing Java class files encoded as base64, along with corresponding unit tests. Feedback on the changes includes: initializing the entries array in ExceptionTable to prevent runtime errors, importing EVALUATOR directly from the evaluator module to avoid using @ts-expect-error, and addressing the unused setupJVM call in JavaEvaluator which currently acts as dead code.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


insert(from: number, to: number, target: number, type: ClassData): void {
var entry = new Entry(from, to, target, type)
const entry = new Entry(from, to, target, type)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The this.entries array is declared but never initialized (e.g., to []), which will cause a runtime TypeError when push is called. Please initialize this.entries to an empty array. Note that the retrieve method also has an issue where returning from inside forEach does not return from the outer function; consider refactoring it to use find or a for...of loop.

        if (!this.entries) {
            this.entries = []
        }
        const entry = new Entry(from, to, target, type)

Comment on lines +2 to +3
// @ts-expect-error — __EVALUATOR__ is replaced at build time by bundlers
import { __EVALUATOR__ } from './index'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Instead of importing __EVALUATOR__ from ./index (which does not export it) and using @ts-expect-error, you can import it directly from ./evaluator where it is declared and exported as default. This provides full type safety and avoids compilation/bundling workarounds.

Suggested change
// @ts-expect-error — __EVALUATOR__ is replaced at build time by bundlers
import { __EVALUATOR__ } from './index'
import __EVALUATOR__ from './evaluator'

Comment on lines +28 to +36
setupJVM({
callbacks: {
readFileSync: (path: string) => {
throw new Error('readFileSync not available in conductor JavaEvaluator')
},
stdout: (m: string) => this.conductor.sendOutput(m),
stderr: (m: string) => this.conductor.sendOutput(`ERR: ${m}`)
}
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

setupJVM returns a runner function that must be executed to actually start the JVM. Currently, the returned function is discarded, meaning the JVM is never run. Since running the class via the in-memory runner is not yet implemented, this call is dead code and can be removed or commented out to avoid unnecessary instantiation overhead.

        // setupJVM call removed as it is currently unused dead code

@github-actions

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
69.56% (-2.94% 🔻)
7487/10764
🔴 Branches
58.29% (-0.89% 🔻)
2493/4277
🟡 Functions
66.87% (-2.17% 🔻)
1326/1983
🟡 Lines
70.35% (-3.02% 🔻)
7053/10026
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟡
... / JavaEvaluator.ts
72.22% 33.33% 33.33% 72.22%
🟢 jvm/index.ts 81.82% 56.25% 33.33% 90%
🔴
... / index.ts
10.53% 100% 0% 11.32%
🔴
... / readAttributes.ts
1.19% 0% 0% 1.27%
🟢
... / attributes.ts
100% 100% 100% 100%
🔴
... / readConstants.ts
1.72% 0% 0% 1.74%
🔴
... / readField.ts
32.35% 100% 0% 33.33%
🔴
... / readMethod.ts
15.79% 100% 0% 16.67%
🟡
... / CustomSystem.ts
63.64% 100% 20% 63.64%
🟡 conductor/runner.ts 66.67% 100% 33.33% 66.67%

Test suite run success

1136 tests passing in 65 suites.

Report generated by 🧪jest coverage report action from d637754

@martin-henz martin-henz requested review from AaravMalani and removed request for martin-henz June 10, 2026 06:56
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