Skip to content

Report structured config file load statuses#2952

Open
Yeachan-Heo wants to merge 3 commits intoultraworkers:mainfrom
Yeachan-Heo:fix/config-loaded-false-reason
Open

Report structured config file load statuses#2952
Yeachan-Heo wants to merge 3 commits intoultraworkers:mainfrom
Yeachan-Heo:fix/config-loaded-false-reason

Conversation

@Yeachan-Heo
Copy link
Copy Markdown
Contributor

Summary

  • add best-effort config inspection metadata for discovered files, including loaded/not_found/skipped/load_error status and reason/detail fields
  • emit config JSON file statuses plus top-level status/load_error and clarify merged_keys with merged_key_count/merged_keys_meaning
  • add focused Rust regressions for missing, skipped legacy, and parse-error config files

Tests

  • cargo fmt
  • cargo test -p runtime config::tests::inspect_classifies_missing_loaded_and_legacy_skipped_files
  • cargo test -p rusty-claude-cli config_json_reports
  • cargo test -p rusty-claude-cli --test output_format_contract

@Yeachan-Heo
Copy link
Copy Markdown
Contributor Author

OMX review verdict: REQUEST_CHANGES

Reviewed PR head dcf047ed6e1297e98f3695b41ef421f639eb5ca2 against current upstream/main.

Changed files:

  • rust/crates/runtime/src/config.rs
  • rust/crates/rusty-claude-cli/src/main.rs

What changed:

  • Adds structured config inspection types (ConfigFileStatus, ConfigFileReport, ConfigInspection, ConfigLoader::inspect()).
  • Adds config JSON fields such as status, merged_key_count, merged_keys_meaning, load_error, and per-file status / reason / skip_reason / detail.

CI/mergeability:

  • MERGEABLE / CLEAN
  • Checks passing: cargo fmt, cargo clippy --workspace, cargo test --workspace, docs source-of-truth

Local verification passed:

cargo test -p runtime inspect_classifies_missing_loaded_and_legacy_skipped_files -- --nocapture
cargo test -p rusty-claude-cli config_json_reports -- --nocapture

I also compared representative claw config --output-format json behavior between current upstream/main and this PR for valid and malformed project config.

Blocker: malformed config behavior changes materially.

  • Before / upstream main: malformed project config makes claw config --output-format json exit nonzero and emit an error JSON object to stderr.
  • After this PR: malformed project config exits 0 and emits a normal config JSON object with status: "error" and per-file load-error details.

That is a user-facing JSON/error/exit-code contract change, not merely additive metadata. Per repo-owner operating rules, it needs explicit owner confirmation before merge, or the PR should preserve the prior nonzero exit behavior while still exposing structured per-file statuses.

Approval path:

  • owner confirms the exit-code / JSON contract change is intended; or
  • PR keeps the previous nonzero error behavior for malformed config while adding structured diagnostics.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Copy link
Copy Markdown
Contributor Author

Re-review update: technically APPROVE, with owner-confirmation gate before merge.

Reviewed current PR head dcf047ed6e1297e98f3695b41ef421f639eb5ca2 against origin/main / base e939777f928d625f9b4c2d5c8b4e95e869b7f850.

Scope reviewed:

  • rust/crates/runtime/src/config.rs
  • rust/crates/rusty-claude-cli/src/main.rs

Verification:

  • GitHub CI is green: cargo test --workspace, cargo clippy --workspace, cargo fmt, docs source-of-truth.
  • Local targeted checks passed:
    • cargo test -p runtime inspect_classifies_missing_loaded_and_legacy_skipped_files --manifest-path rust/Cargo.toml
    • cargo test -p rusty-claude-cli config_json_reports_structured_unloaded_file_reasons --manifest-path rust/Cargo.toml
    • cargo test -p rusty-claude-cli config_json_reports_parse_errors_without_dropping_file_statuses --manifest-path rust/Cargo.toml

Findings:

  • No code blockers found.
  • The structured inspection/reporting implementation is coherent and covered by targeted regression tests.
  • The remaining risk is product-contract level: malformed config JSON reporting now returns structured JSON with "status": "error" / per-file load_error instead of failing early the old way.

So the merge-readiness verdict is:

  • APPROVE from code-review perspective.
  • Do not merge until owner explicitly confirms the claw config --output-format json malformed-config exit/JSON contract change is intended.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Copy link
Copy Markdown
Contributor Author

Review verdict: APPROVE

Inspected exact diff against origin/main (e939777f -> dcf047e). This is a real code PR touching:

  • rust/crates/runtime/src/config.rs
  • rust/crates/rusty-claude-cli/src/main.rs

CI is green: cargo test, clippy, fmt, and docs source-of-truth all pass.

Targeted local checks also passed:

  • cargo test -p runtime inspect_classifies_missing_loaded_and_legacy_skipped_files --manifest-path rust/Cargo.toml
  • cargo test -p rusty-claude-cli config_json_reports_structured_unloaded_file_reasons --manifest-path rust/Cargo.toml
  • cargo test -p rusty-claude-cli config_json_reports_parse_errors_without_dropping_file_statuses --manifest-path rust/Cargo.toml

Main contract changes reviewed:

  • Adds ConfigLoader::inspect() plus structured ConfigInspection / ConfigFileReport / ConfigFileStatus reporting.
  • render_config_json() now uses inspection rather than loader.load().
  • Config JSON now includes structured per-file status/reason/skip_reason/detail plus top-level status, merged_key_count, merged_keys_meaning, and optional load_error.
  • Malformed config in JSON config reporting can now return structured JSON with status:"error" instead of failing early.

Blockers: none found.

Merge risk: MEDIUM because this intentionally changes user-facing JSON/config behavior. Most fields are additive and existing top-level kind, cwd, loaded_files, merged_keys, and files[*].{path,source,loaded} are preserved, but scripts expecting non-zero failure from JSON config reporting on malformed config may observe changed behavior.

Owner confirmation recommended before merge because this is a user-facing JSON/exit-behavior contract change.

Non-blocking notes:

  • reason and skip_reason currently duplicate the same value from file.reason; okay if intentional, but it becomes public contract wording.
  • During partial error states, loaded_files / merged_keys can reflect successfully loaded files while top-level status:"error" and load_error indicate the overall inspection failed. Consumers should treat those as partial inspection results.


[repo owner's gaebal-gajae (clawdbot) 🦞]

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.

1 participant