Skip to content

fix(runtime): isolate state by infobase - #39

Closed
zeegin wants to merge 10 commits into
IngvarConsulting:masterfrom
korolevpavel:fix/per-ib-runtime-state
Closed

fix(runtime): isolate state by infobase#39
zeegin wants to merge 10 commits into
IngvarConsulting:masterfrom
korolevpavel:fix/per-ib-runtime-state

Conversation

@zeegin

@zeegin zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member

Migrated from alkoleft/v8-runner-rust pr #39.
Original author: korolevpavel; created: 2026-07-22T07:48:14Z; last upstream update: 2026-08-14T20:03:02Z.
GitHub shows the migration account as the new author; this block preserves actual attribution.
Upstream historical base: master at d612e2d07e0702c6c829f3981d083022611f6373; head: korolevpavel:fix/per-ib-runtime-state at 577661b060a4046f7455ea0f31f17fe3a2e96ecd. Active migrated PRs compare that exact head with the current IngvarConsulting/v8-runner-rust:master.


Что сделано

  • состояние runtime изолировано по fingerprint информационной базы в ib-state/v1;
  • tracked source tree больше не используется для публикации ConfigDumpInfo.xml: Designer и EDT работают через приватные транзакционные копии;
  • sync receipts фиксируют точный набор обработанных файлов и канонический recovery token;
  • dump выполняется через приватные shadows с трёхсторонним merge, журналом и восстановлением после сбоя;
  • добавлены архитектурные guardrails, CLI-регрессии, live-fixture, ADR и обновление SKILL/SKILL.md.

Проверки

  • cargo fmt --all -- --check;
  • cargo check --all-targets --offline;
  • targeted suites: architecture 4/4, cli_build 19/19, cli_dump 10/10, cli_test 20/20, use_case_boundaries 1/1;
  • независимые tester/reviewer/Rust expert проверки — без findings;
  • реальная 1С 8.3.27: A → A(skip) → B → A(skip), чистый source без CDFI, FULL applied, INCREMENTAL/PARTIAL conflict без изменения source и ib-state;
  • полный suite: 794 passed; 43 воспроизводимых environment/baseline failures (sandbox/macOS path/TCP bind), не связанных с изменением.

Closes upstream #30

Summary by CodeRabbit

  • Новые возможности

    • Добавлены подробные квитанции результатов для операций build и dump: статус, обработанные, пропущенные и конфликтующие файлы.
    • Состояние операций теперь изолируется для каждой информационной базы и контекста.
    • Все режимы dump используют безопасную теневую копию и восстановление после сбоев.
  • Исправления

    • Конфликты и одновременные изменения больше не публикуют частичные результаты.
    • Улучшено безопасное выполнение операций с файлами в Windows.
  • Документация

    • Обновлены инструкции по build/dump, конфликтам, восстановлению и runtime-каталогам.

- 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
- propagate hard storage lookup failures during recovery
- support symlinked source roots without leaking excluded files
- align documentation and remove review-reported duplication
- 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
@zeegin zeegin added the upstream-migrated Migrated from the historical upstream tracker label Sep 2, 2026
@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream comment by coderabbitai[bot] at 2026-07-22T07:48:22Z: original

Review Change Stack

Warning

Review limit reached

@​korolevpavel, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @​coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 43684f46-eedb-4c5c-bb15-7a8369053bc2

📥 Commits

Reviewing files that changed from the base of the PR and between e105049 and 577661b.

📒 Files selected for processing (25)
  • SKILL/SKILL.md
  • SKILL/references/file-and-artifact-workflows.md
  • SKILL/references/troubleshooting.md
  • docs/CAPABILITIES.md
  • docs/CONFIGURATION.md
  • scripts/test/live-cli-fixture.sh
  • spec/acceptance/real-environment-validation.md
  • spec/architecture/arc42/09-architecture-decisions.md
  • spec/decisions/0002-izolirovat-runtime-state-po-source-set-pod-workpath.md
  • spec/decisions/0012-on-demand-change-detection-i-faylovaya-partial-load-strategiya.md
  • src/change_detection/hash_storage.rs
  • src/change_detection/partial_load.rs
  • src/change_detection/source_sets.rs
  • src/domain/dump.rs
  • src/domain/mod.rs
  • src/mcp/service.rs
  • src/platform/connection.rs
  • src/platform/designer.rs
  • src/use_cases/dump_config.rs
  • src/use_cases/dump_config/coordinator.rs
  • src/use_cases/dump_config/helpers.rs
  • src/use_cases/runtime_state.rs
  • src/use_cases/source_transaction.rs
  • tests/cli_dump.rs
  • tests/cli_test.rs

Walkthrough

Введено изолированное per-IB runtime state под workPath/ib-state/v1, private build/dump shadows, exact sync receipts, B/S/D merge, recoverable journal publication и Windows-safe filesystem operations. Build, dump, EDT, IBCMD, MCP и acceptance-тесты обновлены под новые контракты.

Changes

Runtime state and contracts

Layer / File(s) Summary
Runtime identity and receipts
src/domain/*, src/change_detection/*
Добавлены fingerprint-based runtime identities, scoped storage, typed SyncReceipt и exact file deltas.
Private build pipeline
src/use_cases/build_project/*, src/use_cases/runtime_state.rs, src/use_cases/source_transaction.rs
Designer/EDT build используют private source transactions, private CDFI, deferred commits и recovery journals.
Private dump publication
src/use_cases/dump_shadow.rs, src/use_cases/dump_execution.rs, src/use_cases/shadow_merge.rs, src/use_cases/source_publication.rs
Dump выполняется в private shadow, планирует B/S/D merge и публикует managed files через recoverable transactions.
Adapters and validation
src/use_cases/dump_config/*, src/use_cases/tool_extension.rs, src/platform/*, tests/*, scripts/test/*
Обновлены orchestration, platform arguments, JSON receipts, conflict handling и acceptance-проверки.
Architecture and documentation
ARCHITECTURE.md, docs/*, spec/*, SKILL/*
Документированы ib-state/v1, private shadows, recovery, receipt semantics и no-clobber dump flow.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: alkoleft

Poem

Я, кролик, state в норке храню,
Тени дампа по тропке веду.
Receipt’ы шуршат: “всё учтено!”,
Конфликтам сказать: “не тронуто!”.
CDFI в source не прыгнет никак —
Пусть безопасен будет каждый шаг!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок кратко и точно отражает основное изменение: изоляцию runtime state по ИБ.
Linked Issues check ✅ Passed Изменения покрывают #30: изоляцию state по ИБ, приватный CDFI, точные receipts, private shadow dump и защиту от записи в source tree.
Out of Scope Changes check ✅ Passed Не видно посторонних изменений: документация, тесты и платформенные правки поддерживают заявленную изоляцию runtime state и публикацию CDFI.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @​coderabbitai help to get the list of available commands.

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream comment by korolevpavel at 2026-07-22T08:15:51Z: original

@​coderabbitai review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream comment by coderabbitai[bot] at 2026-07-22T08:15:57Z: original

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream comment by korolevpavel at 2026-07-22T08:50:47Z: original

Исправления по CodeRabbit опубликованы в b90dde1.

Помимо четырёх inline findings:

  • вынесено единое вычисление пути full-rebuild marker;
  • централизована сборка SourceSetContext без изменения role/path/identity контрактов;
  • объединено сравнение staged/source snapshots с сохранением разных диагностик;
  • импорт connection parser перенесён к остальным use;
  • doc comments Designer приведены к фактическому набору аргументов.

Отдельный 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, а массовые комментарии не улучшают публичный контракт. Новые и изменённые публичные/инвариантные контракты документированы адресно.

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream comment by alkoleft at 2026-08-14T20:03:02Z: original

Закрываю текущий PR #39 и разделю изменения на несколько меньших PR.
Причина: он одновременно меняет runtime-state, private ConfigDumpInfo.xml, транзакционный dump через shadow и публичные JSON/документационные контракты. Такой объём затрудняет независимую проверку, тестирование и безопасное принятие изменений.
План разделения:
Per-IB runtime-state и изоляция change detection.
Private ConfigDumpInfo.xml и staging для build без изменений source tree.
Private shadow dump, трёхсторонний merge и recoverable publication.
Receipts, документация и сопутствующие контрактные изменения — вместе с соответствующими функциональными частями либо отдельным PR.

@​korolevpavel @​zeegin

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by coderabbitai[bot]; state: COMMENTED; submitted: 2026-07-22T08:32:10Z; commit: e10504998632ca452e33cb8466501cba3c48b7e4. Original review

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

📥 Commits

Reviewing files that changed from the base of the PR and between be558db and e105049.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (67)
  • ARCHITECTURE.md
  • Cargo.toml
  • SKILL/SKILL.md
  • SKILL/references/file-and-artifact-workflows.md
  • SKILL/references/troubleshooting.md
  • docs/CAPABILITIES.md
  • docs/CONFIGURATION.md
  • docs/DEEP_DIVE.md
  • docs/plans/2026-07-21-issue-30-per-ib-runtime-state.md
  • scripts/test/README.md
  • scripts/test/ci-designer-config.sh
  • scripts/test/live-cli-fixture.sh
  • spec/acceptance/real-environment-validation.md
  • spec/architecture/arc42/02-constraints.md
  • spec/architecture/arc42/04-solution-strategy.md
  • spec/architecture/arc42/05-building-block-view.md
  • spec/architecture/arc42/06-runtime-view.md
  • spec/architecture/arc42/08-cross-cutting-concepts.md
  • spec/architecture/arc42/09-architecture-decisions.md
  • spec/architecture/arc42/11-risks-and-technical-debt.md
  • spec/architecture/invariants.md
  • spec/decisions/0002-izolirovat-runtime-state-po-source-set-pod-workpath.md
  • spec/decisions/0012-on-demand-change-detection-i-faylovaya-partial-load-strategiya.md
  • spec/decisions/0015-atomarnaya-publikatsiya-dump-artifacts-cherez-staging-backup.md
  • spec/decisions/0023-izolirovat-runtime-state-po-infobase-i-ispolzovat-private-shadow.md
  • spec/decisions/README.md
  • src/change_detection/analyzer.rs
  • src/change_detection/hash_storage.rs
  • src/change_detection/partial_load.rs
  • src/change_detection/scanner.rs
  • src/change_detection/source_sets.rs
  • src/domain/build.rs
  • src/domain/dump.rs
  • src/domain/mod.rs
  • src/domain/runtime_state.rs
  • src/domain/source_set.rs
  • src/domain/sync_receipt.rs
  • src/mcp/edt_syntax.rs
  • src/mcp/service.rs
  • src/platform/connection.rs
  • src/platform/designer.rs
  • src/support/connection_args.rs
  • src/support/error.rs
  • src/support/mod.rs
  • src/support/path.rs
  • src/support/windows_fs.rs
  • src/use_cases/artifacts.rs
  • src/use_cases/build_project.rs
  • src/use_cases/build_project/coordinator.rs
  • src/use_cases/build_project/helpers.rs
  • src/use_cases/check_syntax.rs
  • src/use_cases/dump_config.rs
  • src/use_cases/dump_config/coordinator.rs
  • src/use_cases/dump_config/helpers.rs
  • src/use_cases/dump_execution.rs
  • src/use_cases/dump_shadow.rs
  • src/use_cases/mod.rs
  • src/use_cases/result.rs
  • src/use_cases/runtime_state.rs
  • src/use_cases/shadow_merge.rs
  • src/use_cases/source_inventory.rs
  • src/use_cases/source_publication.rs
  • src/use_cases/source_transaction.rs
  • src/use_cases/tool_extension.rs
  • tests/cli_build.rs
  • tests/cli_dump.rs
  • tests/cli_test.rs

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by korolevpavel; state: COMMENTED; submitted: 2026-07-22T08:50:14Z; commit: b90dde117ec3e000c29180b741c5941c74333f7a. Original review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by korolevpavel; state: COMMENTED; submitted: 2026-07-22T08:50:15Z; commit: b90dde117ec3e000c29180b741c5941c74333f7a. Original review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by korolevpavel; state: COMMENTED; submitted: 2026-07-22T08:50:17Z; commit: b90dde117ec3e000c29180b741c5941c74333f7a. Original review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by korolevpavel; state: COMMENTED; submitted: 2026-07-22T08:50:18Z; commit: b90dde117ec3e000c29180b741c5941c74333f7a. Original review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by coderabbitai[bot]; state: COMMENTED; submitted: 2026-07-22T08:50:32Z; commit: b90dde117ec3e000c29180b741c5941c74333f7a. Original review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by coderabbitai[bot]; state: COMMENTED; submitted: 2026-07-22T08:50:34Z; commit: b90dde117ec3e000c29180b741c5941c74333f7a. Original review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by coderabbitai[bot]; state: COMMENTED; submitted: 2026-07-22T08:50:35Z; commit: b90dde117ec3e000c29180b741c5941c74333f7a. Original review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream review by coderabbitai[bot]; state: COMMENTED; submitted: 2026-07-22T08:50:39Z; commit: b90dde117ec3e000c29180b741c5941c74333f7a. Original review

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by coderabbitai[bot] at 2026-07-22T08:32:08Z; path: docs/CAPABILITIES.md, original line: 36. Original comment

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Экранируйте | внутри ячейки таблицы.

Символ | в DESIGNER|IBCMD трактуется как разделитель ячеек, поэтому строка получает 4 ячейки вместо 3 (что и отмечает markdownlint, MD056). При рендеринге столбец «Примечания» (Reverse sync через private…) отбрасывается. Экранируйте пайп как \|. Тот же дефект присутствует в соседних IBCMD-строках — их стоит поправить заодно для консистентности.

Предлагаемое исправление
-| `dump` | `format=EDT` + `builder=DESIGNER|IBCMD` | Reverse sync через private Designer/configured-source shadows и EDT import |
+| `dump` | `format=EDT` + `builder=DESIGNER\|IBCMD` | Reverse sync через private Designer/configured-source shadows и EDT import |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

| `dump` | `format=EDT` + `builder=DESIGNER\|IBCMD` | Reverse sync через private Designer/configured-source shadows и EDT import |
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 36-36: Table column count
Expected: 3; Actual: 4; Too many cells, extra data will be missing

(MD056, table-column-count)

🤖 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 `@​docs/CAPABILITIES.md` at line 36, Исправьте Markdown-таблицу в
docs/CAPABILITIES.md: экранируйте символы "|" внутри значений ячеек, начиная с
DESIGNER|IBCMD в строке dump. Найдите соседние строки с IBCMD и также замените
внутренние разделители на "\|", сохранив структуру таблицы из трёх ячеек.

Source: Linters/SAST tools

✅ Addressed in commit b90dde1

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by coderabbitai[bot] at 2026-07-22T08:32:08Z; path: spec/architecture/arc42/09-architecture-decisions.md, line: 29. Original comment

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Проверяем, существуют ли ADR-0021/0022 и упомянуты ли они в обзоре
fd -t f . spec/decisions | rg -n '00(21|22)-' || echo "нет файлов ADR-0021/0022"
rg -n 'ADR-0021|ADR-0022' spec/architecture/arc42/09-architecture-decisions.md || echo "нет ссылок в обзорной таблице"

Repository: alkoleft/v8-runner-rust

Length of output: 335


Добавьте ADR-0021 и ADR-0022 в обзорную таблицу
Сейчас список перескакивает с ADR-0020 на ADR-0023, хотя ADR-0021 и ADR-0022 уже есть в spec/decisions. Этот раздел нужно синхронизировать вместе с новыми ADR.

🤖 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 `@​spec/architecture/arc42/09-architecture-decisions.md` around lines 26 - 27,
Добавьте в обзорную таблицу раздела архитектурных решений отдельные строки для
ADR-0021 и ADR-0022, используя их существующие названия, ссылки, статусы, даты и
описания из spec/decisions; сохраните текущий порядок ADR между ADR-0020 и
ADR-0023.

✅ Addressed in commit b90dde1

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by coderabbitai[bot] at 2026-07-22T08:32:08Z; path: src/change_detection/hash_storage.rs, line: 548. Original comment

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

current_dump_transaction_id использует exists() — ошибка ввода-вывода может быть замаскирована.

На Line 543 при неудачном Database::open guard !self.path.exists() вернёт false при любой ошибке exists() (например, отказ в доступе или сбой ФС), поэтому реальная ошибка открытия БД будет проглочена, а функция вернёт Ok(None). Это может привести к неверному recovery-решению (транзакция трактуется как отсутствующая). В load_state для той же цели используется try_exists() с явной обработкой через map_filesystem_lookup_error; стоит выровнять поведение здесь.

🛡️ Предлагаемое выравнивание с `load_state`
         let database = match Database::open(&self.path) {
             Ok(database) => database,
-            Err(_error) if !self.path.exists() => return Ok(None),
+            Err(_error) if matches!(self.path.try_exists(), Ok(false)) => return Ok(None),
             Err(error) => return Err(map_database_error(&self.path, error)),
         };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    pub(crate) fn current_dump_transaction_id(
        &self,
    ) -> Result<Option<DumpTransactionId>, StorageError> {
        let database = match Database::open(&self.path) {
            Ok(database) => database,
            Err(_error) if matches!(self.path.try_exists(), Ok(false)) => return Ok(None),
            Err(error) => return Err(map_database_error(&self.path, error)),
        };
🤖 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/hash_storage.rs` around lines 538 - 545, Обновите
current_dump_transaction_id, заменив проверку self.path.exists() на try_exists()
с явной обработкой ошибки через map_filesystem_lookup_error, как в load_state.
Возвращайте Ok(None) только когда путь достоверно отсутствует; ошибки проверки
файловой системы или открытия базы данных должны передаваться как StorageError.

✅ Confirmed as addressed by @​korolevpavel

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by coderabbitai[bot] at 2026-07-22T08:32:08Z; path: src/use_cases/source_transaction.rs, line: 98. Original comment

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Как формируется путь, передаваемый в DesignerSourceTransaction::create / load_context.path()
rg -nP -C3 'DesignerSourceTransaction::create' src/use_cases
rg -nP -C3 '\bcanonicaliz' src/use_cases/build_project.rs src/use_cases/build_project/coordinator.rs src/use_cases/build_project/helpers.rs

Repository: alkoleft/v8-runner-rust

Length of output: 3446


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== tool_extension ==\n'
sed -n '410,470p' src/use_cases/tool_extension.rs

printf '\n== build_project ==\n'
sed -n '520,555p' src/use_cases/build_project.rs

printf '\n== source_transaction create / tests around symlinks ==\n'
sed -n '1,220p' src/use_cases/source_transaction.rs | sed -n '1,220p'
printf '\n-- symlink-related tests --\n'
sed -n '620,725p' src/use_cases/source_transaction.rs

printf '\n== source_publication symlink test lookup ==\n'
rg -n -C3 'publication_accepts_a_symlinked_configured_root|symlinked configured root|symlink' src/use_cases/source_publication.rs src/use_cases -g '!src/use_cases/source_transaction.rs'

Repository: alkoleft/v8-runner-rust

Length of output: 48592


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C2 'fn path\(|load_context\.path\(|canonicaliz' src/use_cases src -g '!**/target/**'

Repository: alkoleft/v8-runner-rust

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== source_transaction copy path ==\n'
sed -n '300,470p' src/use_cases/source_transaction.rs

printf '\n== scanner policy ==\n'
sed -n '1,130p' src/change_detection/scanner.rs

printf '\n== source_transaction symlink tests around root acceptance ==\n'
rg -n -C2 'symlinked configured root|symlinked_source|configured root|accepts.*symlink|rejects.*symlink' src/use_cases/source_transaction.rs src/use_cases/build_project.rs src/use_cases/tool_extension.rs

Repository: alkoleft/v8-runner-rust

Length of output: 11809


🌐 Web query:

walkdir crate follow_links(false) symlink root directory semantics root entry symlink to directory

💡 Result:

In the walkdir crate, if the root directory is a symbolic link, it is always followed for the purposes of directory traversal, regardless of the follow_links setting [1][2][3]. This behavior is controlled by a separate configuration method called follow_root_links [1][3]. By default, follow_root_links is enabled [1][3]. When enabled, if the root path is a symlink that points to a directory, walkdir will resolve the link and traverse the contents of that directory [1][3]. If the root symlink is broken or leads to a loop, an error will be yielded as the first entry [1][3]. The follow_links setting (which defaults to false) controls whether symbolic links encountered during the recursive descent are followed [1][3][4]. Crucially, even when follow_links is set to false, the root entry itself remains subject to the follow_root_links configuration [1][2]. If you explicitly disable follow_root_links(false), walkdir will treat the root symlink as a file/entry itself, effectively preventing it from descending into the target of that link [1][3].

Citations:


DesignerSourceTransaction::create не принимает symlinked configured root. WalkDir::new(source_root).follow_links(false) всё равно обходит корень-симлинк по умолчанию, но copy_regular_beneath_unix открывает сам source_root с O_NOFOLLOW|O_DIRECTORY, так что staging падает уже на открытии корня. Если такой root должен поддерживаться как в publication, нужен канонический root перед staging или явный отказ выше по стеку.

🤖 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 63 - 89, Обновите
DesignerSourceTransaction::create, чтобы staging работал с симлинком в
настроенном source_root: после вычисления canonical_source_root используйте его
как физический корень для WalkDir и передачи исходного корня в
copy_regular_no_follow. Сохраните относительные пути, фильтрацию
SourceInventoryPolicy и поведение для обычных корней без изменений.

✅ Confirmed as addressed by @​korolevpavel

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by korolevpavel at 2026-07-22T08:50:14Z; path: docs/CAPABILITIES.md, original line: 36. Original comment

Исправлено в b90dde1: экранированы все четыре значения DESIGNER|IBCMD в таблице. Вне таблицы значения не изменялись.

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by korolevpavel at 2026-07-22T08:50:15Z; path: src/change_detection/hash_storage.rs, line: 548. Original comment

Исправлено в b90dde1. После ошибки Database::open выполняется полный разбор try_exists: Ok(false) означает отсутствие, Ok(true) сохраняет database error, Err преобразуется в hard filesystem lookup error. Добавлены ENOTDIR-регрессия и fail-closed recovery-тест, сохраняющий journal/staged artifacts.

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by korolevpavel at 2026-07-22T08:50:17Z; path: spec/architecture/arc42/09-architecture-decisions.md, line: 29. Original comment

Исправлено в b90dde1: ADR-0021 и ADR-0022 добавлены между ADR-0020 и ADR-0023 с точными названиями, ссылками, статусами и датами.

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by korolevpavel at 2026-07-22T08:50:18Z; path: src/use_cases/source_transaction.rs, line: 98. Original comment

Исправлено в b90dde1: staging работает от canonical physical root, а excluded roots переносятся из configured namespace в canonical namespace. Unix-регрессия подтверждает поддержку root-симлинка, исключение вложенного каталога и запрет следования вложенным симлинкам.

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by coderabbitai[bot] at 2026-07-22T08:50:32Z; path: docs/CAPABILITIES.md, original line: 36. Original comment

@​korolevpavel, спасибо — исправление корректно устраняет нарушение структуры таблицы во всех четырёх строках.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by coderabbitai[bot] at 2026-07-22T08:50:34Z; path: src/change_detection/hash_storage.rs, line: 548. Original comment

@​korolevpavel, спасибо — это устраняет маскировку ошибок: Ok(None) теперь возвращается только при достоверном отсутствии пути, а ошибки проверки ФС fail-closed преобразуются в StorageError. ENOTDIR- и recovery-регрессии также покрывают исходный риск.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by coderabbitai[bot] at 2026-07-22T08:50:35Z; path: src/use_cases/source_transaction.rs, line: 98. Original comment

@​korolevpavel, спасибо за исправление и регрессионное покрытие. Canonical physical root вместе с переносом excluded roots устраняет несовпадение между обходом и безопасным копированием, сохраняя запрет на вложенные симлинки.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@zeegin

zeegin commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Upstream inline review comment by coderabbitai[bot] at 2026-07-22T08:50:39Z; path: spec/architecture/arc42/09-architecture-decisions.md, line: 29. Original comment

@​korolevpavel, спасибо — ADR-0021 и ADR-0022 теперь присутствуют в таблице в правильном порядке между ADR-0020 и ADR-0023. ✅


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream-migrated Migrated from the historical upstream tracker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants