Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions cli/src/services/config/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,6 @@ where
resolve_global_config_path,
)?;

if !runtime.validation_errors.is_empty() {
bail!(
"Agent Trace storage config resolution failed because a discovered config file is invalid: {}",
runtime.validation_errors.join(" | ")
);
}

Ok(ResolvedAgentTraceStorageRuntimeConfig {
repository_id: runtime.agent_trace_repository_id.value,
repository_remote: runtime.agent_trace_repository_remote.value,
Expand Down
1 change: 0 additions & 1 deletion cli/src/services/setup/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ impl SetupCommand {
// The repository root is resolved before any prompt so the interactive
// optional-workflow prompt can pre-check the persisted selection.
let repository_root = resolve_setup_repository(&setup_start_path)?;
setup::validate_existing_repo_local_config(&repository_root).map_err(CliError::runtime)?;

let setup_dispatch = if self.request.context_only {
None
Expand Down
26 changes: 9 additions & 17 deletions cli/src/services/setup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,23 +485,6 @@ pub fn ensure_git_remote(repository_root: &Path, remote_name: &str) -> Result<()
}))
}

/// Validates an existing repo-local `.sce/config.json` before setup performs
/// any other repository or lifecycle work. An absent config remains eligible
/// for the normal bootstrap path.
pub fn validate_existing_repo_local_config(repository_root: &Path) -> Result<()> {
let config_file = RepoPaths::new(repository_root).sce_config_file();
if !config_file.exists() {
return Ok(());
}

crate::services::config::validate_config_file(&config_file).with_context(|| {
format!(
"Setup preflight rejected invalid repo-local config file '{}'",
config_file.display()
)
})
}

/// Bootstraps the repo-local `.sce/config.json` file if it does not already exist.
///
/// Creates the `.sce/` parent directory as needed, then writes the canonical
Expand Down Expand Up @@ -845,6 +828,15 @@ pub fn persist_integration_targets(
let repo_paths = RepoPaths::new(repository_root);
let config_file = repo_paths.sce_config_file();

// Default-discovered invalid config is intentionally degradable during
// setup. Do not rewrite it while recording the installed target: the
// startup resolver already reported the invalid layer and setup must leave
// the user's file byte-for-byte unchanged.
if config_file.exists() && crate::services::config::validate_config_file(&config_file).is_err()
{
return Ok(());
}

// Read existing config or start with bootstrap payload.
let raw = if config_file.exists() {
fs::read_to_string(&config_file)
Expand Down
4 changes: 2 additions & 2 deletions context/architecture.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions context/cli/agent-trace-storage.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading