├── .cursor └── rules │ └── GO.MDC ├── .gitignore ├── .golangci.yml ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── README_AI.md ├── cmd ├── compare │ └── main.go ├── extract_mxl │ └── main.go ├── mcp │ └── main.go └── parser │ └── main.go ├── configs ├── cluster_map.yaml ├── cluster_map.yaml.example └── techlog │ └── logcfg.xml.disabled ├── deploy ├── clickhouse │ ├── config │ │ └── users.xml │ ├── init │ │ └── 20_full_schema.sql │ ├── init_archive │ │ ├── 00_create_logs_db.sql │ │ ├── 01_create_event_log.sql │ │ ├── 02_create_tech_log.sql │ │ ├── 05_add_hash_column.sql │ │ ├── 05_create_parser_metrics.sql │ │ ├── 06_add_transaction_fields.sql │ │ ├── 08_add_detailed_timing_fields.sql │ │ ├── 09_add_missing_parser_metrics_columns.sql │ │ ├── 10_add_computed_columns_to_parser_metrics.sql │ │ ├── 11_create_file_reading_progress.sql │ │ ├── 12_update_parser_metrics_for_incremental.sql │ │ ├── 13_recreate_parser_metrics_replacing.sql │ │ ├── 14_fix_parser_metrics_order_by.sql │ │ ├── 15_fix_file_reading_progress_order_by.sql │ │ ├── 16_add_comment_normalized.sql │ │ ├── 17_add_raw_line_normalized.sql │ │ ├── 18_remove_total_time_alternative_ms.sql │ │ ├── 19_add_cluster_infobase_names_to_tech_log.sql │ │ └── 99_migrate_to_utc_timezone.sql │ └── scripts │ │ ├── delete_by_date.sql │ │ ├── truncate_all.sql │ │ ├── truncate_event_log.sql │ │ └── truncate_tech_log.sql ├── docker │ ├── .env.example │ ├── Dockerfile.grafana │ ├── Dockerfile.mcp │ ├── Dockerfile.parser │ ├── README.md │ ├── detect-timezone.ps1 │ ├── docker-compose.yml │ └── init-grafana.sh └── grafana │ └── provisioning │ ├── dashboards │ ├── dashboards.yml │ ├── event-log-errors.json │ ├── event-log-explorer.json │ ├── event-log-metadata.json │ ├── event-log-overview.json │ └── event-log-temporal.json │ └── datasources │ └── clickhouse.yml ├── docs ├── clickhouse-resources.md ├── file-reading-progress.md ├── guides │ ├── TODO_sql_knowledge_base.md │ ├── clickhouse-cleanup.md │ ├── error-normalization.md │ ├── get-guids.md │ └── techlog-normalization.md ├── mcp │ ├── call-graph-logc_get_event_log.md │ └── usage.md ├── specs │ ├── initial-plan.md │ ├── kiro-checklist.md │ ├── log-service.spec.md │ ├── user-request.md │ └── workflow-process.md ├── status │ └── current-progress.md ├── techlog │ ├── all_techlog_properties.md │ ├── configuration-setup.md │ └── logcfg.md ├── testing │ ├── 1c-unit-test-guide.md │ ├── comparison-guide.md │ ├── mcp-server-testing.md │ ├── parser-debugging.md │ └── phase3-test-results.md ├── threading-analysis.md ├── timezone-analysis.md ├── timing-analysis.md ├── timing-coverage-proof.md └── troubleshooting │ └── boltdb-lock.md ├── go.mod ├── go.sum ├── internal ├── circuitbreaker │ ├── circuit_breaker.go │ └── circuit_breaker_test.go ├── clickhouse │ ├── client.go │ ├── client_test.go │ ├── pool.go │ └── pool_test.go ├── config │ └── config.go ├── domain │ ├── event.go │ ├── file_reading_progress.go │ ├── parser_metrics.go │ └── techlog.go ├── handlers │ ├── configure_techlog.go │ ├── disable_techlog.go │ ├── event_log.go │ ├── get_actual_log_timestamp.go │ ├── get_techlog_config.go │ ├── restore_techlog.go │ ├── save_techlog.go │ ├── tech_log.go │ ├── tracing.go │ ├── validation.go │ └── validation_test.go ├── health │ ├── health.go │ └── health_test.go ├── logreader │ ├── cluster_reader.go │ ├── eventlog │ │ ├── lgf_parser.go │ │ ├── lgp_parser.go │ │ └── reader.go │ ├── interface.go │ └── scanner.go ├── mapping │ └── cluster_map.go ├── mcp │ ├── server.go │ ├── stdio.go │ └── tools.json ├── metrics │ └── prometheus.go ├── normalizer │ ├── comment_normalizer.go │ ├── comment_normalizer_test.go │ ├── techlog_normalizer.go │ └── techlog_normalizer_test.go ├── observability │ ├── logger.go │ └── tracer.go ├── offset │ ├── boltdb.go │ ├── boltdb_test.go │ └── interface.go ├── queue │ ├── dead_letter_queue.go │ └── dead_letter_queue_test.go ├── ratelimit │ ├── rate_limiter.go │ └── rate_limiter_test.go ├── retry │ ├── retry.go │ └── retry_test.go ├── service │ ├── parser_service.go │ └── parser_service_test.go ├── techlog │ ├── config_reader.go │ ├── filename_parser.go │ ├── filename_parser_test.go │ ├── json_parser.go │ ├── json_parser_test.go │ ├── path_parser.go │ ├── path_parser_test.go │ ├── property_mapper.go │ ├── tailer.go │ ├── text_parser.go │ └── text_parser_test.go ├── workerlimit │ └── limiter.go └── writer │ ├── clickhouse.go │ ├── clickhouse_test.go │ ├── hash.go │ ├── hash_test.go │ └── interface.go ├── memory-bank ├── activeContext.md ├── productContext.md ├── progress.md ├── projectbrief.md ├── systemPatterns.md └── techContext.md ├── scripts ├── analyze_duplicates.ps1 ├── check_parsed_data.sql ├── check_parser_logs.ps1 ├── cleanup_clickhouse.ps1 ├── cleanup_clickhouse.sh ├── create_config_simple.ps1 ├── full_reset.ps1 ├── phase3_1_create_config.ps1 ├── phase3_2_check_logs.ps1 ├── test_clickhouse_event_log.ps1 ├── test_configure_techlog.json ├── test_configure_techlog.ps1 ├── test_configure_with_file.ps1 ├── test_event_log_verification.ps1 ├── test_get_event_log.json ├── test_get_new_errors.json ├── test_get_tech_log.json ├── test_mcp_server.ps1 ├── test_mcp_tools.ps1 ├── test_techlog_workflow.ps1 ├── test_workflow.ps1 ├── update_infobase_name.ps1 ├── verify_parsed_data.sql └── verify_simple.sql └── tasks.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | /cmd/parser/parser 7 | /cmd/mcp/mcp 8 | 9 | # Test binary, built with `go test -c` 10 | *.test 11 | 12 | # Output of the go coverage tool 13 | *.out 14 | 15 | # Dependency directories 16 | vendor/ 17 | 18 | # Go workspace file 19 | go.work 20 | 21 | # IDE 22 | .idea/ 23 | .vscode/ 24 | *.swp 25 | *.swo 26 | *~ 27 | 28 | # OS 29 | .DS_Store 30 | Thumbs.db 31 | 32 | # Environment files 33 | .env 34 | .env.local 35 | *.env 36 | 37 | # Secrets 38 | .secrets/ 39 | *.key 40 | *.pem 41 | 42 | # Docker volumes data 43 | /deploy/docker/volumes/ 44 | 45 | # Build artifacts 46 | /build/ 47 | /dist/ 48 | 49 | # Logs 50 | *.log 51 | /logs/ 52 | 53 | # ClickHouse data (local development) 54 | /clickhouse_data/ 55 | 56 | # Grafana data (local development) 57 | /grafana_data/ 58 | 59 | # Parser offset storage 60 | /parser_offsets/ 61 | /offsets/ 62 | *.dat 63 | 64 | # Temporary files 65 | /tmp/ 66 | *.tmp 67 | 68 | OneSTools_EventLog* 69 | 70 | # Project-local directories (debug/tests/tools) 71 | /parser_debug/ 72 | /test_data/ 73 | /tech_logs/ 74 | /.claude/ 75 | /.cursor/ 76 | /.playwright-mcp/ 77 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | linters-settings: 2 | govet: 3 | check-shadowing: true 4 | gocyclo: 5 | min-complexity: 15 6 | dupl: 7 | threshold: 100 8 | goconst: 9 | min-len: 2 10 | min-occurrences: 2 11 | 12 | linters: 13 | disable-all: true 14 | enable: 15 | - errcheck 16 | - gosimple 17 | - govet 18 | - ineffassign 19 | - staticcheck 20 | - typecheck 21 | - unused 22 | - gocyclo 23 | - gofmt 24 | - goimports 25 | - misspell 26 | - unparam 27 | 28 | run: 29 | timeout: 5m 30 | tests: true 31 | 32 | issues: 33 | exclude-use-default: false 34 | max-issues-per-linter: 0 35 | max-same-issues: 0 36 | 37 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to 1C Log Parser Service 2 | 3 | Добро пожаловать! Этот проект следует методологии Kiro с формальной спецификацией и процессом разработки. 4 | 5 | --- 6 | 7 | ## Процесс работы 8 | 9 | ### Обязательные шаги 10 | 11 | 1. **Прочитайте спецификацию**: [docs/specs/log-service.spec.md](docs/specs/log-service.spec.md) 12 | 2. **Изучите процесс Киры**: [docs/specs/workflow-process.md](docs/specs/workflow-process.md) 13 | 3. **Следуйте чек-листу**: [docs/specs/kiro-checklist.md](docs/specs/kiro-checklist.md) 14 | 15 | ### Добавление нового функционала 16 | 17 | 1. **Создайте требование** в разделе Requirements спеки 18 | 2. **Дождитесь утверждения** от владельца проекта 19 | 3. **Разработайте дизайн** и добавьте в раздел Design 20 | 4. **Получите утверждение дизайна** 21 | 5. **Создайте задачи** в Implementation Tasks 22 | 6. **Реализуйте** по утверждённым задачам 23 | 7. **Проверьте чек-лист** перед созданием PR 24 | 25 | --- 26 | 27 | ## Стандарты кода 28 | 29 | ### Go 30 | 31 | Проект следует правилам из [.cursor/rules/GO.MDC](.cursor/rules/GO.MDC): 32 | 33 | - **Clean Architecture** (handlers → services → repositories → domain) 34 | - **Интерфейсы** для всех зависимостей 35 | - **Dependency Injection** через конструкторы 36 | - **Table-driven tests** для unit-тестов 37 | - **GoDoc комментарии** для экспортируемых функций 38 | - **Обработка ошибок** с wrap (`fmt.Errorf("context: %w", err)`) 39 | - **Context propagation** для cancellation 40 | 41 | ### Линтинг 42 | 43 | Перед коммитом запустите: 44 | 45 | ```powershell 46 | golangci-lint run 47 | goimports -w . 48 | go fmt ./... 49 | ``` 50 | 51 | ### Тестирование 52 | 53 | Обязательные тесты: 54 | 55 | - **Unit tests**: покрытие >80% для exported functions 56 | - **Integration tests**: для ClickHouse, BoltDB 57 | - **E2E tests**: для критических путей 58 | 59 | Запуск: 60 | 61 | ```powershell 62 | go test ./... -v 63 | go test ./... -cover 64 | ``` 65 | 66 | --- 67 | 68 | ## Структура коммитов 69 | 70 | Формат: 71 | 72 | ``` 73 | : 74 | 75 | 76 | 77 |