fix(runtime): isolate state by infobase - #39
Conversation
- define secret-free versioned runtime identity and bootstrap semantics - specify private CDFI, shadow merge, journal recovery, and exact receipts - add the test-driven implementation plan for issue 30
- derive secret-free versioned identities for infobases and source contexts - route change detection through per-infobase storage with explicit bootstrap semantics - propagate identity failures through typed use-case boundaries without panics
- validate normalized targets and raw SHA-256 transitions - preserve pre-platform observations across full and partial flows - exclude runtime artifacts from managed source inventories
- stage managed sources and private CDFI outside source trees - commit CDFI and hash observations through recoverable journals - prevent concurrent state replacement with exact no-clobber claims
- commit EDT observations only after downstream convergence - preserve per-infobase lifecycle across backends and restarts - resolve relative tool-extension sources against project base
- merge baseline source and dump states without overwriting conflicts - recover manifest publication and coherent runtime generations - report exact per-file dump receipts across all modes
- describe private build and dump state lifecycle - document exact receipts and recovery tokens - update operator guidance and superseded ADR clauses
- cover incremental and partial no-clobber conflicts - validate private CDFI lifecycle in trusted live smoke - harden fixture setup across CI and macOS bash
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (25)
WalkthroughВведено изолированное per-IB runtime state под ChangesRuntime state and contracts
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (5)
src/use_cases/runtime_state.rs (1)
292-316: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winВынести вычисление пути маркера
full-rebuild-requiredв общий помощник.Одинаковая логика вычисления пути маркера (родитель
transactions_dir()→state_dir.join(FULL_REBUILD_MARKER)с fallback наtransactions_dir().join(...)) продублирована трижды: здесь вdesigner_full_rebuild_required(Line 295-299) иrequire_designer_full_rebuild(Line 307-311), а также вclear_full_rebuild_marker(Line 686-690). Извлечение единого помощникаfull_rebuild_marker_path(context)исключит риск расхождения при будущих изменениях расположения маркера.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/use_cases/runtime_state.rs` around lines 292 - 316, Extract the duplicated marker-path calculation into a shared full_rebuild_marker_path helper. Update designer_full_rebuild_required, require_designer_full_rebuild, and clear_full_rebuild_marker to use it, preserving the existing parent-directory fallback behavior.src/change_detection/source_sets.rs (1)
50-84: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueОпционально: вынести сборку
SourceSetContextв общий помощник.Три ветки (
Designer,Edt-generated иedt_contexts) почти идентичны:RuntimeSourceDescriptor::new(...)→state_layout.source_state(...)→SourceSetContext::new(...).with_excluded_roots(...). Разница только вsource_rootиlogical_role. Помощник видаbuild_context(ss, path, role, work_path)уберёт дублирование и снизит риск рассинхронизации при будущих правках полей дескриптора.Also applies to: 103-116
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/change_detection/source_sets.rs` around lines 50 - 84, Optionally extract the duplicated SourceSetContext construction shared by the Designer, Edt-generated, and edt_contexts branches into a helper such as build_context. Have it accept the source set, source root, logical role, and work path, while centralizing RuntimeSourceDescriptor::new, source_state, SourceSetContext::new, and excluded-root setup; preserve each branch’s existing path and role values.src/use_cases/source_transaction.rs (1)
145-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winДублирование логики сравнения snapshot с
verify_snapshot.
verify_source_snapshot(Line 145–172) повторяет ту же схему, что и методverify_snapshot(Line 108–133): скан → построениеHashMap<rel_path, hash>→ сравнение →SnapshotMismatch. Различаются лишь корень скана и текст ошибки. Стоит вынести сравнение в общий помощник, чтобы обе ветки не разошлись при будущих правках.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/use_cases/source_transaction.rs` around lines 145 - 172, Вынеси общую логику сканирования, построения карт rel_path/hash и сравнения snapshot из verify_snapshot и verify_source_snapshot в единый вспомогательный метод. Обеспечь передачу корня скана и сохранение различающихся текстов SnapshotMismatch, затем замени дублирующиеся участки в обоих методах вызовом этого помощника.src/platform/connection.rs (1)
136-136: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueПеренесите
useв начало файла.Импорт
split_v8_arg_stringразмещён в самом конце файла после модуляmod tests. Это допустимо синтаксически, но ухудшает читаемость — объявление лучше держать вместе с остальными импортами вверху файла.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/platform/connection.rs` at line 136, Переместите импорт split_v8_arg_string из нижней части файла, после mod tests, в начало src/platform/connection.rs, разместив его рядом с остальными объявлениями use; не изменяйте остальную логику.src/platform/designer.rs (1)
182-182: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueОбновите doc-комментарии под новый набор аргументов.
Методы теперь всегда добавляют
-updateConfigDumpInfo, но doc-комментарии не отражают это. Актуализируйте описания сигнатур команд, чтобы они соответствовали реально формируемым аргументам.
- Line 182 (
dump_config_to_files):/DumpConfigToFiles <dir> -updateConfigDumpInfo [-Extension <name>]- Line 199 (
dump_config_to_files_incremental): добавить-updateConfigDumpInfo- Line 259 (
dump_config_to_files_partial): добавить-updateConfigDumpInfo🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/platform/designer.rs` at line 182, Обновите doc-комментарии методов dump_config_to_files, dump_config_to_files_incremental и dump_config_to_files_partial, добавив обязательный аргумент -updateConfigDumpInfo в описания формируемых команд; для dump_config_to_files сохраните порядок `/DumpConfigToFiles <dir> -updateConfigDumpInfo [-Extension <name>]`, чтобы документация соответствовала фактическим аргументам.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/CAPABILITIES.md`:
- Line 36: Исправьте Markdown-таблицу в docs/CAPABILITIES.md: экранируйте
символы "|" внутри значений ячеек, начиная с DESIGNER|IBCMD в строке dump.
Найдите соседние строки с IBCMD и также замените внутренние разделители на "\|",
сохранив структуру таблицы из трёх ячеек.
In `@spec/architecture/arc42/09-architecture-decisions.md`:
- Around line 26-27: Добавьте в обзорную таблицу раздела архитектурных решений
отдельные строки для ADR-0021 и ADR-0022, используя их существующие названия,
ссылки, статусы, даты и описания из spec/decisions; сохраните текущий порядок
ADR между ADR-0020 и ADR-0023.
In `@src/change_detection/hash_storage.rs`:
- Around line 538-545: Обновите current_dump_transaction_id, заменив проверку
self.path.exists() на try_exists() с явной обработкой ошибки через
map_filesystem_lookup_error, как в load_state. Возвращайте Ok(None) только когда
путь достоверно отсутствует; ошибки проверки файловой системы или открытия базы
данных должны передаваться как StorageError.
In `@src/use_cases/source_transaction.rs`:
- Around line 63-89: Обновите DesignerSourceTransaction::create, чтобы staging
работал с симлинком в настроенном source_root: после вычисления
canonical_source_root используйте его как физический корень для WalkDir и
передачи исходного корня в copy_regular_no_follow. Сохраните относительные пути,
фильтрацию SourceInventoryPolicy и поведение для обычных корней без изменений.
---
Nitpick comments:
In `@src/change_detection/source_sets.rs`:
- Around line 50-84: Optionally extract the duplicated SourceSetContext
construction shared by the Designer, Edt-generated, and edt_contexts branches
into a helper such as build_context. Have it accept the source set, source root,
logical role, and work path, while centralizing RuntimeSourceDescriptor::new,
source_state, SourceSetContext::new, and excluded-root setup; preserve each
branch’s existing path and role values.
In `@src/platform/connection.rs`:
- Line 136: Переместите импорт split_v8_arg_string из нижней части файла, после
mod tests, в начало src/platform/connection.rs, разместив его рядом с остальными
объявлениями use; не изменяйте остальную логику.
In `@src/platform/designer.rs`:
- Line 182: Обновите doc-комментарии методов dump_config_to_files,
dump_config_to_files_incremental и dump_config_to_files_partial, добавив
обязательный аргумент -updateConfigDumpInfo в описания формируемых команд; для
dump_config_to_files сохраните порядок `/DumpConfigToFiles <dir>
-updateConfigDumpInfo [-Extension <name>]`, чтобы документация соответствовала
фактическим аргументам.
In `@src/use_cases/runtime_state.rs`:
- Around line 292-316: Extract the duplicated marker-path calculation into a
shared full_rebuild_marker_path helper. Update designer_full_rebuild_required,
require_designer_full_rebuild, and clear_full_rebuild_marker to use it,
preserving the existing parent-directory fallback behavior.
In `@src/use_cases/source_transaction.rs`:
- Around line 145-172: Вынеси общую логику сканирования, построения карт
rel_path/hash и сравнения snapshot из verify_snapshot и verify_source_snapshot в
единый вспомогательный метод. Обеспечь передачу корня скана и сохранение
различающихся текстов SnapshotMismatch, затем замени дублирующиеся участки в
обоих методах вызовом этого помощника.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 70d94cbe-760e-4f66-9710-bd19cf695129
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (67)
ARCHITECTURE.mdCargo.tomlSKILL/SKILL.mdSKILL/references/file-and-artifact-workflows.mdSKILL/references/troubleshooting.mddocs/CAPABILITIES.mddocs/CONFIGURATION.mddocs/DEEP_DIVE.mddocs/plans/2026-07-21-issue-30-per-ib-runtime-state.mdscripts/test/README.mdscripts/test/ci-designer-config.shscripts/test/live-cli-fixture.shspec/acceptance/real-environment-validation.mdspec/architecture/arc42/02-constraints.mdspec/architecture/arc42/04-solution-strategy.mdspec/architecture/arc42/05-building-block-view.mdspec/architecture/arc42/06-runtime-view.mdspec/architecture/arc42/08-cross-cutting-concepts.mdspec/architecture/arc42/09-architecture-decisions.mdspec/architecture/arc42/11-risks-and-technical-debt.mdspec/architecture/invariants.mdspec/decisions/0002-izolirovat-runtime-state-po-source-set-pod-workpath.mdspec/decisions/0012-on-demand-change-detection-i-faylovaya-partial-load-strategiya.mdspec/decisions/0015-atomarnaya-publikatsiya-dump-artifacts-cherez-staging-backup.mdspec/decisions/0023-izolirovat-runtime-state-po-infobase-i-ispolzovat-private-shadow.mdspec/decisions/README.mdsrc/change_detection/analyzer.rssrc/change_detection/hash_storage.rssrc/change_detection/partial_load.rssrc/change_detection/scanner.rssrc/change_detection/source_sets.rssrc/domain/build.rssrc/domain/dump.rssrc/domain/mod.rssrc/domain/runtime_state.rssrc/domain/source_set.rssrc/domain/sync_receipt.rssrc/mcp/edt_syntax.rssrc/mcp/service.rssrc/platform/connection.rssrc/platform/designer.rssrc/support/connection_args.rssrc/support/error.rssrc/support/mod.rssrc/support/path.rssrc/support/windows_fs.rssrc/use_cases/artifacts.rssrc/use_cases/build_project.rssrc/use_cases/build_project/coordinator.rssrc/use_cases/build_project/helpers.rssrc/use_cases/check_syntax.rssrc/use_cases/dump_config.rssrc/use_cases/dump_config/coordinator.rssrc/use_cases/dump_config/helpers.rssrc/use_cases/dump_execution.rssrc/use_cases/dump_shadow.rssrc/use_cases/mod.rssrc/use_cases/result.rssrc/use_cases/runtime_state.rssrc/use_cases/shadow_merge.rssrc/use_cases/source_inventory.rssrc/use_cases/source_publication.rssrc/use_cases/source_transaction.rssrc/use_cases/tool_extension.rstests/cli_build.rstests/cli_dump.rstests/cli_test.rs
- propagate hard storage lookup failures during recovery - support symlinked source roots without leaking excluded files - align documentation and remove review-reported duplication
|
Исправления по CodeRabbit опубликованы в b90dde1. Помимо четырёх inline findings:
Отдельный Rust expert review обнаружил связанный fail-closed риск: hard/concurrent storage errors маскировались через is_ok_and во время journal recovery. Теперь только Recoverable трактуется как mismatch; Hard и ConcurrentStateModified прерывают recovery до rollback. Регрессионный тест подтверждает сохранение journal и staged artifacts. Проверки: cargo fmt, cargo check --all-targets, architecture 4/4, targeted unit 76/76, CLI 49/49, новые regressions 3/3. Независимые tester/reviewer/Rust expert проходы — CLEAN. Предупреждение CodeRabbit о blanket docstring coverage принято как waiver: проект не требует документировать все private helpers, а массовые комментарии не улучшают публичный контракт. Новые и изменённые публичные/инвариантные контракты документированы адресно. |
- preserve per-infobase private state and source transactions - integrate partial selectors, IBCMD data isolation, and upstream launch changes - reconcile dump tests and docs with shadow bootstrap semantics
Что сделано
ib-state/v1;ConfigDumpInfo.xml: Designer и EDT работают через приватные транзакционные копии;SKILL/SKILL.md.Проверки
cargo fmt --all -- --check;cargo check --all-targets --offline;Closes #30
Summary by CodeRabbit
Новые возможности
Исправления
Документация