Repository navigation
feat(cli): initialize chat defaults and workspace roots from stdin - #6909
Open
Colafornia wants to merge 1 commit into
Open
Colafornia wants to merge 1 commit into
Colafornia wants to merge 1 commit into
Conversation
Generated-by: Google Antigravity
Colafornia
force-pushed
the
feat/cli-init-workspace-and-sandbox-defaults
branch
from
November 14, 2026 15:46
3e6ec54 to
89f5925
Compare
Colafornia
marked this pull request as ready for review
November 14, 2026 15:46
This branch has not been deployed
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.
English
Summary
Extend
maka host init --settings-stdinto accept optionalchatDefaultsandprojectDirectoryRoots, completing headless State Root bootstrap so containerized ACP clients and evaluation harnesses (maka-eval) can set default sandbox policy and register explicit workspace roots outside$HOMEbefore any Host starts.Refs #6667 and #6805.
Settings/PreparedSettingsinproducts/maka/cli/src/initialize.rs) withchatDefaults: Option<ChatDefaults>andprojectDirectoryRoots: Option<Vec<DirectoryRootSpec>>.projectDirectoryRootsviaDirectoryRootSpec::normalizeinsideSettings::prepare()beforeRootOwner::create, returning a redacted"invalid initial settings: invalid project directory roots"error without leaking caller paths or creating.maka-storage-root.json. Reject any root whose path falls inside a pre-existing State Root directory.store.update_network_proxyintostore.set_chat_defaults(policy_revision, chat_defaults).crate::application::configure_workspace_locations(owner, roots)after shutting downConfigurationStoreso workspace root configuration persists cleanly on initial bootstrap.products/maka/cli/README.mdandproducts/maka/cli/README.zh-CN.mdto mentionchatDefaults.sandboxModeandprojectDirectoryRoots.products/maka/cli/tests/integration/initialize.rsto verifychatDefaults.sandboxMode(danger-full-access),projectDirectoryRootsoutside$HOMEvia a realmaka acp --rootsubprocess (initialize->session/newassertingsessionIdandsandbox_mode.currentValue == "danger_full_access"), and redacted rejection of invalid or self-overlapping roots.Verification
Validated at
89f5925e2d3c341e7182b0b6ba09e7d7023976e0(based onorigin/rust-preview2e52be5293346bdca975cca7c6356d96ad22bd87):cargo test --locked -p maka-cli --test integration initialize: 4 passed, 0 failed (public_init_persists_settings_from_stdin_and_rejects_reconfiguration,public_init_persists_connections_and_default_target_from_stdin,public_init_rejects_invalid_settings_without_exposing_input,public_init_times_out_unfinished_input_without_leaving_a_reader_or_root).cargo clippy --locked -p maka-cli --bins --no-deps -- -D warnings: passed (0 errors).cargo clippy --locked -p maka-cli --test integration --no-deps: passed with 0 warnings ininitialize.rs(--all-targets -D warningsstops on pre-existingdead_codewarnings inproducts/maka/cli/tests/integration/main.rs,products/maka/cli/tests/integration/candidate.rs, andproducts/maka/cli/tests/support/host.rs, outside this PR's diff).cargo fmt -p maka-cli -- --check: passed.node scripts/asf-license-headers.mjs checkandgit diff --check: passed.Full
just check, live upstream model requests, and remote CI were not run locally.AI use
Tool(s) and scope: Google Antigravity authored the implementation, integration test additions, documentation updates, and local verification. Preserve the
Generated-bytrailer when squashing.Checklist
Does this PR entail a change in behavior?
中文
概述
扩展
maka host init --settings-stdin支持可选的chatDefaults与projectDirectoryRoots,补齐无界面 State Root 初始化闭环,使容器内 ACP 客户端和评测工具(maka-eval)无需人工操作即可在 Host 启动前预设默认沙盒策略并注册$HOME之外的工作区根目录。关联 #6667 与 #6805。
products/maka/cli/src/initialize.rs的Settings/PreparedSettings中新增chatDefaults: Option<ChatDefaults>与projectDirectoryRoots: Option<Vec<DirectoryRootSpec>>。Settings::prepare()阶段(早于RootOwner::create)执行DirectoryRootSpec::normalize,失败时统一返回脱敏错误"invalid initial settings: invalid project directory roots",既不泄露输入路径,也不残留.maka-storage-root.json;同时拦截落入已有 State Root 目录内的 root。store.update_network_proxy返回的policy_revision串联传入store.set_chat_defaults(policy_revision, chat_defaults)。ConfigurationStore后调用crate::application::configure_workspace_locations(owner, roots)持久化工作区根目录。products/maka/cli/README.md与products/maka/cli/README.zh-CN.md的说明。products/maka/cli/tests/integration/initialize.rs增加真实maka acp --root子进程initialize->session/new端到端断言(校验$HOME外工作区可创建会话且sandbox_mode == "danger_full_access"),并覆盖非法路径脱敏与自包含拦截。验证
验证提交:
89f5925e2d3c341e7182b0b6ba09e7d7023976e0(基于origin/rust-preview2e52be5293346bdca975cca7c6356d96ad22bd87):cargo test --locked -p maka-cli --test integration initialize:4 项通过,0 项失败。cargo clippy --locked -p maka-cli --bins --no-deps -- -D warnings:通过(0 错误)。cargo clippy --locked -p maka-cli --test integration --no-deps:initialize.rs零告警(带--all-targets -D warnings会在 diff 之外的main.rs、candidate.rs、tests/support/host.rs既有的dead_code告警处中断)。cargo fmt -p maka-cli -- --check、node scripts/asf-license-headers.mjs check与git diff --check:通过。未在本地执行完整
just check、真实上游模型请求及远端 CI。AI 使用
工具与范围:Google Antigravity 完成实现编写、集成测试补充、文档更新与本地验证。Squash 合并时保留
Generated-bytrailer。审查清单
本 PR 是否带来行为变更?