fix(cli): correct signed-out context guidance #3183
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.47) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 498 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.372
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3183"
general
weight: 0.35
nick-potts
Summary
ployz ctxnow suggestsployz loginonly when signed out with no selected context,PLOYZ_CONTEXT,--connect, or visible local socket. A Directory Link that selects a Project keeps main's hint when a Server route exists. A missing, inaccessible, or uncheckable local socket leaves no usable local route.organization = no onebecomesorganization = (none: not signed in). The existing JSONorganizationremains null in that state. The earliercredentialfield is stilldevice,token,local, or null.servers.local_socket_existsremains true only when the socket is visible and false otherwise. The new additiveservers.local_socket_statusisvisible,missing,permission_denied, orunknown;servers.viakeeps its existing route value. A permission error now sayscan't read the local daemon socket; run with sudo or join the ployz groupinstead of claiming the socket is absent. The installer names the groupployzand creates/run/ployzwith mode0750.Relative to main,
nextchanges only when signed out and no Server route is available, with or without a selected Project. With a selected context,PLOYZ_CONTEXT,--connect, a visible local socket, a token, or a stored sign-in, the hint remains exactly as main chose it. No exit codes, refusals, or warnings change.Design bets touched in
core/DESIGN.mdare 8. Evidence over claims, which replaces an unconditional local route claim with socket evidence and preserves permission errors, and 10. Client-first, daemon when forced, which keeps this display decision in the CLI. The Stable promise stays intact with additive CLI JSON fields and no wire, RPC, or persisted schema changes.Closes #2876.
Evidence
Before the fix, focused
ctx_showtests showed the wrong hints and organization text.After the fix,
cargo test -p ployz --test ctx_showpasses 6/6, includingPLOYZ_CONTEXT, stored device sign-in, token JSON, and a linked Project.cargo test -p ployz --lib local_socket_check_distinguishes_visibility_and_permissionpasses 1/1 with deterministic visible, missing, permission-denied, and unknown socket results.cargo clippy -p ployz --all-targetsandcargo fmt --checkpass.The built CLI with no sign-in, token, context, connection, or local socket exits 0. Before:
After:
The built CLI with a Directory Link to Project
shopand selected standalone contextlabexits 0. Before:After:
The signed-out no-route JSON still has
organization: null,credential: null, andservers.via: "local". It hasservers.local_socket_exists: false,servers.local_socket_status: "missing", andnext: "ployz login".Merge danger
Door: Two-way.
Blast radius: CLI
ctxoutput only. Socket presence is not a daemon liveness check. The pre-existing case where a config file has no current context andctxreportsvia localis out of scope for this PR.