Skip to content

fix(iris): classify compiler failures as compile errors - #3796

Open
lshtar13 wants to merge 2 commits into
mainfrom
hotfix/compile-error-classification
Open

lshtar13 wants to merge 2 commits into
mainfrom
hotfix/compile-error-classification

Conversation

@lshtar13

@lshtar13 lshtar13 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Return a compile error when the compiler exits with a nonzero status, while keeping compiler startup failures as server errors.
  • Preserve compiler diagnostics in the judge response.
  • Remove a status-code comparison that incorrectly treated compile errors as system errors.

Additional context

A failed compilation now returns resultCode: 6 with the compiler diagnostic instead of resultCode: 9 and a missing log.out error.

Tests passed: go test ./src/service/sandbox/judger ./src/service/build ./src/handler


Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines and follow the Commit Convention.
  • Describe the bug this PR solves.
  • Include regression tests.

Summary by CodeRabbit

  • Bug Fixes
    • Failed compilations now include compiler diagnostic output and the compiler’s exit status, making source errors easier to identify.
    • Compiler startup failures are reported separately from rejected source code, so they are not misclassified as user errors.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 70e0335d-19ba-4f85-9cb5-4164114cc119

📥 Commits

Reviewing files that changed from the base of the PR and between e94e356 and 50609cc.

📒 Files selected for processing (4)
  • apps/iris/src/service/build/unit.go
  • apps/iris/src/service/build/unit_test.go
  • apps/iris/src/service/sandbox/judger/compiler.go
  • apps/iris/src/service/sandbox/judger/compiler_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Compiler execution now classifies compiler exits as compile errors and startup failures as server errors. New tests check diagnostic output and how the build service classifies each failure.

Changes

Compiler failure classification

Layer / File(s) Summary
Compiler execution result classification
apps/iris/src/service/sandbox/judger/compiler.go, apps/iris/src/service/sandbox/judger/compiler_test.go
Compiler exits with nonnegative codes return COMPILE_ERROR with the exit code. Other execution failures return SERVER_ERROR with an error. Compiler stdout and stderr are written to the output file. Tests cover exit-code handling, diagnostic output, and startup failure.
Build error classification assertions
apps/iris/src/service/build/unit.go, apps/iris/src/service/build/unit_test.go
Comments distinguish compiler-start or sandbox-service failures from unsuccessful or timed-out compiler exits. Tests check that compiler rejection is classified as a user error and compiler execution failure is not.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 50609

The compiler failure handling and build classification have no identified issue that needs correction before merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 50609

The change affects caller-visible error classification, but the reviewed execution path does not show a new way to invoke the compiler or bypass its timeout. Deployment and downstream exposure remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The evidenced change affects Iris compiler results and their build-error classification. The available relationship evidence does not establish a broader service or deployment blast radius.

Trust Boundaries and Controls

  • observed — Submitted code reaches a build unit, while LangConfig supplies the compiler execution arguments. The compiler uses a timed process invocation and routes compiler diagnostics through its output file.

Resilience and Maintainability Implications

  • observed — Compiler startup errors retain an error channel, whereas rejected compilations retain diagnostics and an exit code. The tests exercise both outcomes.

Hardening Proposals

  • proposed — Consider keeping compiler-start OS error details out of caller-visible messages: the changed branch wraps the execution error, and the existing build and response path carries its text as a user message. This is a precaution, not a verified disclosure of sensitive data.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: compiler failures are classified as compile errors. It matches the pull request objectives and changed behavior.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@lshtar13 lshtar13 changed the title hotfix(iris): classify compiler failures as compile errors fix(iris): classify compiler failures as compile errors Sep 29, 2026
@lshtar13
lshtar13 requested a review from khgerr8909 September 29, 2026 13:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant