Skip to content

feat(build): add --dynamic flag and infobase.unlock_code config#8

Open
steel-code-agent wants to merge 3 commits into
alkoleft:masterfrom
SteelMorgan:feat/dynamic-and-unlock-code
Open

feat(build): add --dynamic flag and infobase.unlock_code config#8
steel-code-agent wants to merge 3 commits into
alkoleft:masterfrom
SteelMorgan:feat/dynamic-and-unlock-code

Conversation

@steel-code-agent
Copy link
Copy Markdown

@steel-code-agent steel-code-agent commented May 13, 2026

Summary

Adds two related capabilities required when the configuration database is protected by an
exclusive lock or by an admin-set password:

  • --dynamic flag for build — emits /UpdateDBCfg -Dynamic+ so the build can run
    while the infobase has live HTTP services or background jobs holding the exclusive lock.
  • infobase.unlock_code config field — propagates /UC <value> to every DESIGNER
    invocation. Without it any administrative operation against a locked infobase is rejected
    by the platform.

Behavior

  • New CLI flag: v8-runner build --dynamic. Equivalent project-wide default:
    build.dynamicUpdate: true in v8project.yaml. CLI overrides config for one invocation.
  • New config field: infobase.unlock_code: '<code>'. Empty value is treated as "no unlock
    code" so unlock_code: '' overlays do not accidentally push /UC without a value.
  • /UC <value> is masked in command-render logs the same way the password is masked
    (/UC ***), so it never ends up in build logs / agent traces.
  • dynamic flag is threaded through BuildRequest, McpBuildProjectRequest and the
    execute_source_set_step pipeline. The load and tool-extension flows keep the historical
    static /UpdateDBCfg (no -Dynamic+), matching the upstream conservative default.

Failure modes

  • Platform refuses dynamic mode when the change set requires schema restructuring; v8-runner
    surfaces that error verbatim and does NOT fall back to a static update — the operator
    decides whether to retry without --dynamic (and gain exclusive access first).
  • Missing or wrong unlock_code produces the platform's own "code mismatch" error from
    DESIGNER; no v8-runner-side guessing.

Why both at once

Locked infobases in production typically combine both safeguards (password-protected DBCfg
and active sessions). Splitting these into two PRs would force one to land first without
a usable end-to-end path. They share the same plumbing (BuildRequest, designer.rs render,
schema regen, version bump 0.4.2 → 0.5.0).

Files

  • CLI: src/cli/args.rs, src/cli/execute.rs--dynamic flag wiring.
  • Config: src/config/{loader,model,schema,validate}.rsbuild.dynamicUpdate and
    infobase.unlock_code parsing/validation.
  • Domain: src/use_cases/request.rs, src/use_cases/build_project*.rs,
    src/use_cases/run_tests/coordinator.rs, src/use_cases/load_artifact.rs,
    src/use_cases/tool_extension.rs.
  • Platform: src/platform/connection.rs (/UC argv), src/platform/designer.rs
    (-Dynamic+), src/platform/process.rs (log masking).
  • MCP: src/mcp/{port,request,service}.rs — propagate dynamic over MCP.
  • Docs: docs/CAPABILITIES.md, docs/CONFIGURATION.md,
    SKILL/references/{config-and-backends,project-workflows}.md.
  • Schemas: docs/schemas/v8project*.schema.json regenerated.
  • Version bump: 0.4.2 → 0.5.0.

Testing

  • cargo build --release passes on Linux (gcc).
  • Manual verification on gbig_pam_ai (8.3.27.2074) — /UC reaches DESIGNER in argv,
    /UpdateDBCfg -Dynamic+ is emitted when --dynamic is set, masked properly in logs.

Note

Rebased on top of latest upstream/master (post chore(release): bump version to 0.5.0).
Cargo.lock auto-merged. Conflicts were limited to the schema $id URL (resolved by keeping
the upstream master URL) and a doc path moved from v8-runner/references/ to
SKILL/references/ in upstream (content reapplied in the new location).

Summary by CodeRabbit

  • Новые функции

    • Добавлен флаг --dynamic для команды build — выполняет динамическое обновление БД (без отката на статическое при ошибке).
    • В конфигурацию проекта добавлены build.dynamicUpdate и infobase.unlock_code для управления динамикой обновления и передачи кода разблокировки.
  • Документация

    • Обновлены руководства и схемы: поведение --dynamic, приоритет CLI над конфигом, маскирование unlock_code в логах, и рекомендации по запуску тестов (тесты используют статичный build; динамическая подготовка — отдельной командой).

Review Change Stack

- CLI flag `--dynamic` for `build` enables /UpdateDBCfg -Dynamic+
- New config field `build.dynamicUpdate` (default false), CLI overrides config
- New config field `infobase.unlock_code` propagates /UC <value> to DESIGNER
- Mask unlock_code in command-render logs like password (/UC ***)
- Propagate dynamic flag through BuildRequest, McpBuildProjectRequest and the
  execute_source_set_step pipeline; `load` and tool-extension flows keep the
  historical static update
- Bump version 0.4.2 -> 0.5.0
- Regenerate JSON schemas for v8project.yaml / v8project.local.yaml
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2c093f0a-8212-452c-ae27-3914aea669ba

📥 Commits

Reviewing files that changed from the base of the PR and between e4b5845 and 20db539.

📒 Files selected for processing (5)
  • SKILL/references/config-and-backends.md
  • docs/CONFIGURATION.md
  • docs/schemas/v8project.local.schema.json
  • docs/schemas/v8project.schema.json
  • src/config/schema.rs
✅ Files skipped from review due to trivial changes (2)
  • SKILL/references/config-and-backends.md
  • docs/CONFIGURATION.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/schemas/v8project.schema.json
  • src/config/schema.rs

Walkthrough

Добавлены опциональный infobase.unlock_code и конфигурация build.dynamicUpdate, CLI-флаг --dynamic и MCP-перекрытие; значения прокидываются в V8Connection/Designer как /UC и /UpdateDBCfg -Dynamic+, unlock-код маскируется в рендере команд; поведение покрыто тестами и документацией.

Changes

Поддержка динамического обновления и кода разблокировки

Layer / File(s) Summary
Документация и контракты
SKILL/references/config-and-backends.md, SKILL/references/project-workflows.md, docs/CAPABILITIES.md, docs/CONFIGURATION.md, docs/DEEP_DIVE.md, docs/schemas/*
Описаны infobase.unlock_code и build.dynamicUpdate, CLI --dynamic, поведение test и MCP-переопределение dynamicUpdate.
Схемы и модели конфигурации
src/config/model.rs, src/config/schema.rs, src/config/loader.rs, src/config/validate.rs, docs/schemas/*
Добавлены поля unlock_code: Option<String> и dynamic_update: bool с serde-default; JSON-схемы обновлены; загрузчик YAML и тесты проверяют пропагацию.
CLI, MCP и маппинг запросов
src/cli/args.rs, src/cli/execute.rs, src/mcp/request.rs, src/mcp/service.rs, src/use_cases/request.rs
BuildArgs получает флаг --dynamic, map_build_request/сервис мапит в BuildRequest.dynamic_update: Option<bool>, MCP-схема дополняется dynamicUpdate.
Генерация команд платформы и маскирование
src/platform/connection.rs, src/platform/designer.rs, src/platform/process.rs
V8Connection условно эмиттирует /UC <code>; Designer::update_db_cfg(dynamic) добавляет -Dynamic+; render_command маскирует /UC/-UC.
Разрешение динамики в use-case сборки
src/use_cases/build_project.rs, src/use_cases/build_project/coordinator.rs
Добавлена resolve_dynamic_update(config, args); effective-значение проходит в execute_source_set_step и используется при вызове update_db_cfg(..., dynamic).
Специализированные сценарии (load, test, extensions)
src/use_cases/load_artifact.rs, src/use_cases/run_tests/coordinator.rs, src/use_cases/tool_extension.rs
Load, тест-пререквизиты и extension-пути явно используют статический update_db_cfg(false); документация покрывает порядок build --dynamic && test.
Регрессионные и unit-тесты
src/config/loader.rs, src/platform/connection.rs, src/platform/designer.rs, src/platform/process.rs, src/use_cases/build_project.rs
Тесты проверяют YAML-парсинг, /UC аргументы, -Dynamic+ эмиссию, маскирование и приоритет CLI vs config.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as "CLI (--dynamic)"
  participant MCP as "MCP build_project"
  participant BuildReq as "BuildRequest"
  participant Config as "AppConfig"
  participant Resolver as "resolve_dynamic_update"
  participant Coordinator as "run_build_designer/run_build_edt"
  participant Designer as "DesignerDsl::update_db_cfg"
  participant V8Conn as "V8Connection (args)"
  participant Renderer as "Process::render_command"
  CLI->>BuildReq: sets dynamic=true
  MCP->>BuildReq: dynamicUpdate=Some(true)
  BuildReq->>Resolver: provide per-invocation override
  Config->>Resolver: provide build.dynamic_update default
  Resolver->>Coordinator: effective dynamic flag
  Coordinator->>Designer: call update_db_cfg(extension, dynamic)
  V8Conn->>Designer: args() includes /UC <code> (if set)
  Designer->>Renderer: command includes /UpdateDBCfg -Dynamic+ (if dynamic)
  Renderer->>Renderer: mask /UC and -UC in rendered output
Loading

🎯 3 (Умеренная) | ⏱️ ~25 minutes

🐰 Динамическое обновленье — волшебный флаг,
Код разблокировки в маске стоит,
Сборка без локов летит в речку благ,
И логи секреты в молчанье хранят! 🔐✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно отражает основные изменения: добавление флага --dynamic и поля конфигурации infobase.unlock_code
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/mcp/service.rs (1)

806-843: ⚡ Quick win

Добавьте проверку поля dynamic_update в тесте.

Тест build_project_maps_success_request_and_response проверяет маппинг полей full_rebuild и source_set (строки 841-842), но не проверяет, что dynamic_update корректно передаётся в BuildRequest. Добавление этой проверки повысит надёжность теста для критического пути передачи запросов.

✅ Предлагаемое дополнение теста
 assert_eq!(requests[0].1.full_rebuild, true);
 assert_eq!(requests[0].1.source_set.as_deref(), Some("main"));
+assert_eq!(requests[0].1.dynamic_update, None);
🤖 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/mcp/service.rs` around lines 806 - 843, The test
build_project_maps_success_request_and_response currently asserts full_rebuild
and source_set but omits dynamic_update; add an assertion that the BuildRequest
received by the port carries the expected dynamic_update value (referencing
McpBuildProjectRequest and the captured BuildRequest at
service.port.build_requests -> requests[0].1). If you intend to verify the
current call with no dynamic update, assert requests[0].1.dynamic_update ==
None; if you want to test a true value, set dynamic_update: Some(true) on the
McpBuildProjectRequest and assert requests[0].1.dynamic_update == Some(true).
src/use_cases/build_project.rs (1)

2610-2718: ⚡ Quick win

Не хватает регрессии для EDT→Designer ветки.

Новые кейсы проверяют только сборку из Designer-исходников. При этом resolve_dynamic_update(...) теперь ещё проброшен в EDT-пайплайн, а теста на SourceFormat::Edt с проверкой -Dynamic+/static-поведения здесь нет, поэтому именно эта изменённая ветка останется без защиты от регрессии.

🤖 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/build_project.rs` around lines 2610 - 2718, Add regression
tests covering the EDT→Designer branch by duplicating the existing Designer
tests but using SourceFormat::Edt and the EDT backend (e.g.,
BuilderBackend::Edt) where build_config is called; create EDT variants of
dynamic_cli_flag_emits_dynamic_marker_in_update_db_cfg,
build_dynamic_update_config_default_emits_dynamic_marker, and
build_without_dynamic_flag_emits_static_update_db_cfg that mirror their
assertions (check for "/UpdateDBCfg" and presence/absence of "-Dynamic+" as
appropriate) so the resolve_dynamic_update behavior in the EDT pipeline is
exercised.
🤖 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 `@src/use_cases/run_tests/coordinator.rs`:
- Around line 76-81: The prerequisite build is not forcing dynamic_update off
because BuildArgs currently sets dynamic_update: None and
resolve_dynamic_update() falls back to config.build.dynamic_update; change the
BuildArgs construction used for the prerequisite build in coordinator.rs so
dynamic_update is explicitly Some(false) (instead of None) to ensure the test
use case always performs a static update; update the BuildArgs instance where
full_rebuild is false and source_set is None so it passes Some(false) to
dynamic_update and keep resolve_dynamic_update() semantics unchanged.

---

Nitpick comments:
In `@src/mcp/service.rs`:
- Around line 806-843: The test build_project_maps_success_request_and_response
currently asserts full_rebuild and source_set but omits dynamic_update; add an
assertion that the BuildRequest received by the port carries the expected
dynamic_update value (referencing McpBuildProjectRequest and the captured
BuildRequest at service.port.build_requests -> requests[0].1). If you intend to
verify the current call with no dynamic update, assert
requests[0].1.dynamic_update == None; if you want to test a true value, set
dynamic_update: Some(true) on the McpBuildProjectRequest and assert
requests[0].1.dynamic_update == Some(true).

In `@src/use_cases/build_project.rs`:
- Around line 2610-2718: Add regression tests covering the EDT→Designer branch
by duplicating the existing Designer tests but using SourceFormat::Edt and the
EDT backend (e.g., BuilderBackend::Edt) where build_config is called; create EDT
variants of dynamic_cli_flag_emits_dynamic_marker_in_update_db_cfg,
build_dynamic_update_config_default_emits_dynamic_marker, and
build_without_dynamic_flag_emits_static_update_db_cfg that mirror their
assertions (check for "/UpdateDBCfg" and presence/absence of "-Dynamic+" as
appropriate) so the resolve_dynamic_update behavior in the EDT pipeline is
exercised.
🪄 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: 402afecb-3cc5-4ff5-a1fd-9eb38068dcf4

📥 Commits

Reviewing files that changed from the base of the PR and between 43674ee and b465d01.

📒 Files selected for processing (22)
  • SKILL/references/config-and-backends.md
  • SKILL/references/project-workflows.md
  • docs/CAPABILITIES.md
  • docs/CONFIGURATION.md
  • src/cli/args.rs
  • src/cli/execute.rs
  • src/config/loader.rs
  • src/config/model.rs
  • src/config/schema.rs
  • src/config/validate.rs
  • src/mcp/port.rs
  • src/mcp/request.rs
  • src/mcp/service.rs
  • src/platform/connection.rs
  • src/platform/designer.rs
  • src/platform/process.rs
  • src/use_cases/build_project.rs
  • src/use_cases/build_project/coordinator.rs
  • src/use_cases/load_artifact.rs
  • src/use_cases/request.rs
  • src/use_cases/run_tests/coordinator.rs
  • src/use_cases/tool_extension.rs

Comment thread src/use_cases/run_tests/coordinator.rs Outdated
- force static update for test prerequisite builds

- cover dynamic update mapping for MCP and EDT Designer builds

- refresh config schemas and docs for dynamic update behavior
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/schemas/v8project.local.schema.json (1)

246-246: ⚡ Quick win

Уточните описание unlock_code для случая пустой строки.

Сейчас текст выглядит как безусловная передача /UC <value>, но по поведению PR пустая строка должна означать «не передавать /UC». Лучше зафиксировать это прямо в description, чтобы документация и runtime-семантика не расходились.

Предлагаемое изменение
-          "description": "Optional local infobase unlock code propagated as `/UC <value>`. Masked in command logs.",
+          "description": "Optional local infobase unlock code. Non-empty value is propagated as `/UC <value>`; empty string means no unlock code and `/UC` is not passed. Masked in command logs.",
🤖 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/schemas/v8project.local.schema.json` at line 246, Update the JSON schema
description for the unlock_code property to explicitly state that an empty
string means the `/UC` segment is omitted (i.e., do not send `/UC`) and that
non-empty values are propagated as `/UC <value>` and masked in logs; modify the
"description" text for the unlock_code field to include this explicit behavior
so documentation matches runtime semantics.
🤖 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.

Nitpick comments:
In `@docs/schemas/v8project.local.schema.json`:
- Line 246: Update the JSON schema description for the unlock_code property to
explicitly state that an empty string means the `/UC` segment is omitted (i.e.,
do not send `/UC`) and that non-empty values are propagated as `/UC <value>` and
masked in logs; modify the "description" text for the unlock_code field to
include this explicit behavior so documentation matches runtime semantics.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 32ba5b78-0731-408d-8229-a2933ca325a0

📥 Commits

Reviewing files that changed from the base of the PR and between b465d01 and e4b5845.

📒 Files selected for processing (9)
  • SKILL/SKILL.md
  • docs/CAPABILITIES.md
  • docs/DEEP_DIVE.md
  • docs/schemas/v8project.local.schema.json
  • docs/schemas/v8project.schema.json
  • src/config/loader.rs
  • src/mcp/service.rs
  • src/use_cases/build_project.rs
  • src/use_cases/run_tests/coordinator.rs
✅ Files skipped from review due to trivial changes (3)
  • docs/DEEP_DIVE.md
  • SKILL/SKILL.md
  • docs/schemas/v8project.schema.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/CAPABILITIES.md
  • src/config/loader.rs
  • src/use_cases/build_project.rs

- document that empty unlock_code omits /UC

- refresh generated config schemas
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.

2 participants