Skip to content

components C6: /doctor wiring + config-validation surfacing - #298

Merged
ericleepi314 merged 1 commit into
mainfrom
components/c6-doctor-validation
Jun 11, 2026
Merged

components C6: /doctor wiring + config-validation surfacing#298
ericleepi314 merged 1 commit into
mainfrom
components/c6-doctor-validation

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Summary

  • /doctor wired on every surface: the dormant DoctorScreen (now with config-health + permission-rules sections) for the TUI, an output-style registry command elsewhere
  • services/config_health checks the loader-faithful path set (git-root project config, .clawcodex settings trio, managed file) and surfaces problems as distinct warning startup rows
  • Loaders hardened so "file ignored" is true for every detected class (mis-encoded/array-shaped settings previously CRASHED setup_permissions pre-mount; non-object config blew up in _deep_merge)
  • Delivers the C1-deferred dangerous/shadowed-rule warning surfacing (startup rows + /doctor everywhere)

Test plan

  • 18 tests: loader-hardening regressions via the real loaders, real CommandContext field pin, unreadable/dir-shaped paths, textual-free subprocess import check, startup-row emit/silent paths
  • 723 adjacent tests green; full suite BASELINE-IDENTICAL
  • Impl-critic: REQUEST CHANGES (wrong loader paths, false "never hard-fails" premise, undelivered C1 promise) → all fixed via the recommended loader-hardening route → APPROVE (follow-ups folded in)

🤖 Generated with Claude Code

- /doctor finally reaches the dormant DoctorScreen (TUI inversion) and
  a new output-style registry command serves headless/REPL (python/
  platform, ripgrep availability, sessions dir, config + rule health)
- services/config_health: per-file JSON/encoding/top-level checks over
  the paths the loaders ACTUALLY read (git-root-anchored project
  config via get_project_config_path — review M1 — plus the .clawcodex
  settings trio and the managed file); startup warning rows in a new
  visually-distinct "-warning" SystemMessage variant, with "Run
  /doctor for details."
- loaders HARDENED so "file ignored" is true for every detected class
  (review M2): permissions/setup._load_settings_file catches
  ValueError/OSError + rejects non-dict top levels (a mis-encoded or
  array-shaped settings file crashed setup_permissions before the TUI
  mounted); config._read_json rejects non-object top levels (which
  previously blew up in _deep_merge)
- delivers the C1-deferred rule-warning surfacing (review M3):
  collect_rule_warnings formats dangerous + shadowed permission rules
  into the startup rows, the /doctor report, AND a new DoctorScreen
  section; the stale C1 comment now states it
- conftest: GLOBAL_CONFIG_DIR isolated per-test (full-app tests no
  longer read the developer's real global config)

18 tests incl. loader-hardening regressions through the REAL loaders,
a real-CommandContext pin, unreadable/dir-shaped paths, and a
subprocess textual-free import check. Suite baseline-identical.
Critic-approved after one round; KeybindingWarnings deferral and the
no-reset-gate divergence documented in the module.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ericleepi314
ericleepi314 merged commit 179a758 into main Jun 11, 2026
singlaamitesh pushed a commit to singlaamitesh/clawcodex that referenced this pull request Jul 7, 2026
…-doctor-validation

components C6: /doctor wiring + config-validation surfacing
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