Skip to content

feat(sign): skip LLM composition for standalone words - #10

Merged
eeeeeaaan merged 1 commit into
mainfrom
feat/sign-standalone-word-bypass
Aug 25, 2026
Merged

eeeeeaaan merged 1 commit into
mainfrom
feat/sign-standalone-word-bypass

Conversation

@eeeeeaaan

@eeeeeaaan eeeeeaaan commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Single-word gloss inputs like 감사합니다, 안녕하세요, 네 (and a few common variants) already are the sentence — no need to round-trip to the LLM for them.
  • SignSentenceService.compose() now short-circuits: if exactly one word is given and it's in a small standalone-word set, it's returned as-is.
  • Everything else (multi-word input, or a single word not in the set) goes through the LLM path unchanged.

Test plan

  • ./gradlew test --tests "com.ssu.unithon.sign.api.SignControllerTests" — added returns_standalone_word_without_calling_the_llm, asserting the fake OpenAI client is never invoked; existing tests unaffected

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added direct recognition for common standalone Korean greetings, acknowledgements, and expressions of thanks.
    • Recognized single-word inputs now return faster without unnecessary AI processing.
    • Existing behavior remains unchanged for other phrases.
  • Tests

    • Added coverage verifying direct responses for standalone words.

A single-word gloss like "감사합니다" or "네" is already the full
sentence, so route it back as-is instead of paying an LLM round trip.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fd9c26d-5341-4d7f-b225-415deda8a14e

📥 Commits

Reviewing files that changed from the base of the PR and between ee07191 and a234d26.

📒 Files selected for processing (2)
  • src/main/java/com/ssu/unithon/sign/application/SignSentenceService.java
  • src/test/java/com/ssu/unithon/sign/api/SignControllerTests.java

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The compose service now returns configured standalone Korean greetings, acknowledgements, and thanks without LLM invocation. An integration test verifies the response and confirms that the OpenAI client is not called.

Changes

Standalone word composition

Layer / File(s) Summary
Standalone word routing
src/main/java/com/ssu/unithon/sign/application/SignSentenceService.java
The service defines standalone Korean words and returns a matching trimmed input before prompt construction. Other inputs retain the existing LLM and fallback flow.
Direct response integration test
src/test/java/com/ssu/unithon/sign/api/SignControllerTests.java
The test verifies an OK response containing the standalone word and confirms that the OpenAI client is not invoked.

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

Merge Risk: ⚪ Minimal · up to a234d

The change narrowly bypasses LLM composition for a defined set of standalone words while leaving other inputs on the existing path; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant SignController
  participant SignSentenceService
  participant OpenAIClient
  SignController->>SignSentenceService: Submit standalone word
  SignSentenceService-->>SignController: Return the trimmed word
  Note over SignSentenceService,OpenAIClient: No OpenAIClient call for standalone words
``

</details>

<!-- walkthrough_end -->
<!-- pre_merge_checks_walkthrough_start -->

<details>
<summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary>

### ❌ Failed checks (1 warning)

|     Check name     | Status     | Explanation                                                                                                                                                                                | Resolution                                                                         |
| :----------------: | :--------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |

<details>
<summary>✅ Passed checks (4 passed)</summary>

|         Check name         | Status   | Explanation                                                                                                |
| :------------------------: | :------- | :--------------------------------------------------------------------------------------------------------- |
|      Description Check     | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled.                                                |
|         Title check        | ✅ Passed | The title clearly and concisely describes the main change: bypassing LLM composition for standalone words. |
|     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.                                   |

</details>

</details>

<!-- pre_merge_checks_walkthrough_end -->
<!-- finishing_touch_checkbox_start -->

<details>
<summary>✨ Finishing Touches 💡 1</summary>

<!-- finishing_touch_suggestion:docstrings -->
<details>
<summary>📝 Generate docstrings 💡</summary>

- [ ] <!-- {"checkboxId":"7962f53c-55bc-4827-bfbf-6a18da830691"} --> Create stacked PR
- [ ] <!-- {"checkboxId":"3e1879ae-f29b-4d0d-8e06-d12b7ba33d98"} --> Commit on current branch

</details>
<details>
<summary>🧪 Generate unit tests (beta)</summary>

- [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Create PR with unit tests
- [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Commit unit tests in branch `feat/sign-standalone-word-bypass`

</details>

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---




<sub>Comment `@coderabbitai help` to get the list of available commands.</sub>

<!-- tips_end -->
Loading

@eeeeeaaan
eeeeeaaan merged commit 7f29eab into main Aug 25, 2026
9 checks passed
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.

1 participant