Skip to content

Add AI agent system with RAG, law search, and bug fixes#71

Open
gp80430-alt wants to merge 59 commits into
golbin:mainfrom
gp80430-alt:master
Open

Add AI agent system with RAG, law search, and bug fixes#71
gp80430-alt wants to merge 59 commits into
golbin:mainfrom
gp80430-alt:master

Conversation

@gp80430-alt

Copy link
Copy Markdown

Summary

  • AI Agent 백엔드 추가: Qwen GGUF 로컬 모델 + 클라우드 API 폴백, RAG 키워드 인덱스, 법령 검색, MCP 서버
  • AI Agent 프론트엔드 추가: AgentSidebar (채팅/법령 패널/DiffViewer/오타카드)
  • 버그 수정 4건: reclassify_file unwrap 패닉, get_rag_status 하드코딩 경로, ai_edit_document insert fallback 로직 오류, 클라우드 API IP 하드코딩

Test plan

  • cargo check 통과
  • AI 채팅 클라우드 폴백 동작
  • RAG 폴더 설정 후 실제 경로 반환
  • ai_edit_document insert fallback 정상 반환

🤖 Generated with Claude Code

daeho-ro and others added 30 commits April 24, 2026 11:01
Standardize issue reporting with structured YAML forms.

Bug report template captures OS, version, install package type, and
reproduction steps. Feature request template captures motivation,
proposed solution, and affected area.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover the three previously untested UI modules:

- custom-select: enhancement skip conditions, getCustomSelectRoot,
  syncCustomSelect, idempotent re-enhancement
- dialog (ModalDialog): DOM structure, show/hide lifecycle, Escape
  and Enter key handling, keyboard capture for editable inputs
- print-dialog: zero-page early exit, onStatus progress messages,
  per-page SVG rendering, malformed SVG rejection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Compile all shortcuts from menu.rs and shortcut-map.ts into a
user-facing reference document, organized by category. Includes
notes on Hancom-to-HOP remappings that avoid browser conflicts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use toContain for titleBar.textContent (real DOM includes child text)
- Implement parent/child detachment in FakeElement.remove() and move
  semantics in appendChild() to match real DOM behavior
- Fix Enter key test: verify dialog closes instead of eagerly invoking spy
- Stub window.setTimeout/clearTimeout to prevent timer leaks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Note that Alt corresponds to Option on macOS
- Add Cmd/Ctrl+N for New Document (from menu.rs)
- Add Cut/Copy/Paste shortcuts (from menu.rs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Link the new keyboard shortcuts reference in docs/README.md
so it is discoverable from the documentation index.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
custom-select.test.ts:
- Add FakeOption/FakeOptGroup subclasses so options pass instanceof
  checks, enabling rebuildMenu to actually create option rows
- Fix className/classList desync in FakeElement by making className
  a getter/setter that keeps the internal class Set in sync
- Assert menu row count, display text, selected class, and
  idempotent DOM count after enhancement
- Assert syncCustomSelect updates display text and selected class

print-dialog.test.ts:
- Assert malformed SVG is not appended to the page div (0 children)
- Assert print is still called even with invalid SVG
- Assert afterprint cleanup listener is registered

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
#	apps/studio-host/src/ui/print-dialog.test.ts
# Conflicts:
#	docs/README.md
Added a note to regularly upgrade the hop package.
golbin and others added 29 commits May 5, 2026 19:20
rhwp v0.7.9 기준으로 동기화하고 문서 검증/lineseg 자동 보정 기능 복원함
Resolve PR golbin#58 on top of current main while preserving the recent documents home screen feature and the rhwp v0.7.11 upgrade.
Resolve PR golbin#58 recent documents on current main
Keep the PR 66 commits intact and add a focused HOP follow-up that preserves upstream overlay creation while replacing delayed full re-renders with flow-only re-renders. Split canvas layout and overlay lifecycle helpers out of CanvasView and tighten the validation baseline guard.
Preserve contributor commits and include maintainer follow-up for flow-only delayed canvas re-render handling.
- Add Rust backend: Agent, AI model manager (Qwen GGUF), RAG keyword index,
  MCP server, OCR, embedding stubs, and law search (Korean statute DB)
- Add frontend: AgentSidebar with chat, law panel, diff viewer, typo cards,
  and context chips; agent-sidebar.css and ai-sidebar.css
- Fix reclassify_file unwrap() panic risk → map_err
- Fix get_rag_status returning hardcoded "폴더 활성화됨" → actual watch_folder path
- Fix ai_edit_document insert fallback: broken borrow + error always propagated
  even on successful fallback; restructure with scoped block
- Move hardcoded cloud API IP to CLOUD_API_URL constant; allow override via
  HOP_AI_API_URL env var

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- law.rs: 3회 재시도 + 지수 백오프(1s/2s) + 10s 타임아웃 추가;
  get_law_structure/get_law_article 중복 HTTP 로직을 fetch_law_content()로 통합;
  mutex.lock().unwrap() → unwrap_or_else(poison 복구)
- agent.rs: 클라우드 API 호출에 30초 타임아웃 추가
- state.rs: mcp_shutdown: Mutex<Option<watch::Sender<bool>>> 필드 추가
- mcp.rs: mpsc 버퍼 32 → 256; tokio::select!로 셧다운 시그널 수신 처리
- lib.rs: RunEvent::Exit 시 MCP 셧다운 시그널 전송
- rag.rs: search() 전체 정렬 O(n log n) → select_nth_unstable + 상위 k 정렬
  O(n + k log k)로 개선; partial_cmp unwrap → unwrap_or(Equal)
- AgentSidebar.tsx: 법령 관련 invoke 중복 4개를 useLawSystem 훅으로 추출
- 임시 파일 commands.diff 삭제

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@golbin

golbin commented May 28, 2026

Copy link
Copy Markdown
Owner

스크린샷 부탁드립니다. 윈도우와 리눅스에서 작동 가능한 범위는 어디까지인지도 말씀 부탁드립니다.

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.

6 participants