fix: report unreadable LoopX state directories instead of crashing #9689
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.52) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #9689"
general
weight: 0.35
loopx-agent
Goal And Delivered Outcome
default_runtime_route()stats and lists~/.loopxand~/.codex/loopxto choose the default route. When a root can be seen but not searched or listed (for example, a host sandbox that denies listing~/.loopx),Path.exists()oriterdir()raisesPermissionError. Every command without an explicit--runtime-root/--registrythen fails with a raw traceback. Separately,resolve_cli_registry()probes the default.loopx/registry.jsonwithPath.exists(): when a project.loopxcannot be searched, Python 3.11–3.13 raisePermissionErrorwhile Python 3.14+ returnsFalseand silently falls back to the global registry (ok: trueagainst the wrong registry).- With the default root at
0o111or0o000,loopx statuspreviously crashed withPermissionError; it now exits 1 withA default runtime root cannot be inspected (Permission denied: <path>). Allow read access to it, or pass --runtime-root or --registry explicitly., while--runtime-rootkeeps working (unitandreal_entrypointrows below).- With a project
.loopxat0o000and a readable global registry present,resolve_cli_registry()now probes viastat()consistently across Python 3.11–3.14+ and stops withCannot inspect registry .loopx/registry.json (Permission denied). Allow read access to it, or pass --registry explicitly.instead of crashing or falling back (unitrow below).main.Author Declaration
Implemented against
| Criterion (spec clause) | Disposition | Symbol / path | Test or command |
| --- | --- | --- | --- |
| An unreadable default root is reported as
invalid, not raised | implemented |loopx/paths.py::default_runtime_route|tests/test_local_state_migration.py::test_default_route_reports_a_runtime_root_it_cannot_list|| An unsearchable project registry directory stops without silent fallback across Python 3.11–3.14+ | implemented |
loopx/cli_runtime.py::_registry_path_exists|tests/test_local_state_migration.py::test_unsearchable_project_registry_directory_stops_instead_of_falling_back|0o111,0o000) and confirmed both new tests fail on base (including silent global fallback on Python 3.14). Readable roots keep their existing classification.Scope And Continuation
Validation
ba466d39a| Check kind | Result | Public-safe evidence / limitation |
| --- | --- | --- |
|
unit|passed|tests/test_local_state_migration.py(both new tests passed on Python 3.13 and 3.14; full file +tests/test_cli_argument_diagnostics.py198 passed, 3 skipped; both new tests fail on base). ||
unit|passed| Neighboring default-route suites (test_doctor_installation_scope.py,test_state_backup.py,test_turn_default_host_binding.py,test_support_control_update_ownership.py): 98 passed. ||
static|passed|ruff checkandgit diff --checkclean on all changed files. ||
real_entrypoint|passed|python -m loopx.cli statuswith synthetic HOME.loopxat0o111/0o000: clean exit 1 without traceback;--runtime-rootstill succeeds. |Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
N/A
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).