Conversation
- Remove policy change history feature * Delete internal/policy/history.go * Remove /api/policy/history endpoint from server * Remove history UI components (button, modal, event handlers) * Remove 'policy history' CLI command - Set default language for new rules from global settings * New rules now inherit languages from policy.defaults.languages * Improves consistency across policy rules 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove auto-save-checkbox references (element was deleted from HTML) * Remove event listener * Remove from saveSettings() and loadSettings() - Remove defaults-autofix references (element was deleted from HTML) * Remove from renderAll() * Remove from saveSettings() * Remove from applyPermissions() 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove auto-save timer and startAutoSave() function - Remove autoSave from appState.settings - Remove autoSave from localStorage loading/saving - Clean up all autoSave references This prevents the 30-second auto-save timer from triggering and attempting to save incomplete/invalid policy data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…ements Major Changes: 1. **Environment Variable Management (envutil package)** - Created internal/envutil package to centralize .env operations - Removed duplicate env-related functions across multiple files - Unified API key and policy path retrieval from .env files - Functions: GetAPIKey(), GetPolicyPath(), LoadKeyFromEnvFile(), SaveKeyToEnvFile() 2. **Policy Editor Improvements** - Add automatic policy path save on editor save - Implement file migration when policy path changes - Add convert prompt when rules are modified - Integrate convert API endpoint for linter config generation - Store original rules to detect changes 3. **Convert Command Enhancement** - Use POLICY_PATH from .env as default input - Output to same directory as input policy by default - Remove hardcoded paths 4. **Init Command Enhancement** - Create .sym/.env with default POLICY_PATH during init - Preserve existing API keys when adding POLICY_PATH 5. **MCP Server Enhancement** - Load policy path from .env instead of hardcoded path - Support both ANTHROPIC_API_KEY and OPENAI_API_KEY from .env Files Modified: - internal/envutil/env.go (new) - internal/cmd/api_key.go - internal/cmd/convert.go - internal/cmd/init.go - internal/engine/llm/engine.go - internal/llm/client.go - internal/mcp/server.go - internal/server/server.go - internal/server/static/policy-editor.js 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fix errcheck linter error by explicitly handling the file.Close() error in deferred function. This resolves CI lint test failure.
Changes: - Add originalRBAC to appState for tracking RBAC changes - Implement createStableJSON helper for consistent object comparison - Extend change detection to include both rules and RBAC - Update conversion prompt to show what changed (rules/RBAC) - Add .mcp.json to .gitignore This enables the policy editor to detect RBAC changes and prompt for linter config generation when either rules or RBAC are modified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Summary
정책 에디터 기능 개선 및 환경변수 관리 통합
🎯 Changes
1. Environment Variable Management (envutil package)
internal/envutil패키지 생성하여 .env 파일 관련 작업 중앙화GetAPIKey(),GetPolicyPath(),LoadKeyFromEnvFile(),SaveKeyToEnvFile()2. Policy Editor Improvements
3. Convert Command Enhancement
.env의POLICY_PATH를 기본 입력 경로로 사용4. Init Command Enhancement
sym init실행 시.sym/.env파일에 기본POLICY_PATH자동 설정POLICY_PATH추가5. MCP Server Enhancement
.env에서 정책 경로 로드ANTHROPIC_API_KEY와OPENAI_API_KEY모두.env에서 조회 지원📁 Files Changed
New Files
internal/envutil/env.go- 환경변수 관리 유틸리티Modified Files
internal/cmd/api_key.go- envutil 사용, 중복 함수 제거internal/cmd/convert.go- .env 경로 기본값 사용internal/cmd/init.go- .env 초기화 추가internal/engine/llm/engine.go- envutil 사용internal/llm/client.go- envutil 사용internal/mcp/server.go- envutil 사용, 정책 경로 .env 조회internal/server/server.go- envutil 사용, convert API 추가internal/server/static/policy-editor.js- 자동 convert 기능 추가✅ Testing
go vet ./...- 통과go test -short- 대부분 통과 (1개 Linux 전용 테스트 제외)make build- 빌드 성공🔄 Breaking Changes
없음. 기존 동작은 유지하면서 개선사항만 추가됨.
📝 Migration Guide
기존 사용자의 경우:
.sym/.env파일이 없다면sym init재실행 권장.env파일 우선순위: 시스템 환경변수 →.sym/.env