Skip to content

fix(commands): resolve FEAT-019 review findings - #5839

Merged
Hmbown merged 5 commits into
Hmbown:reland-feat019from
aboimpinto:fix/pr-5833-review
Sep 2, 2026
Merged

fix(commands): resolve FEAT-019 review findings#5839
Hmbown merged 5 commits into
Hmbown:reland-feat019from
aboimpinto:fix/pr-5833-review

Conversation

@aboimpinto

@aboimpinto aboimpinto commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

No-Issue: review fixes and current-main reconciliation for maintainer-owned FEAT-019 PR #5833

Summary

Resolves the remaining review findings on #5833:

  • remove the orphaned utility/loop_cmd.rs topology entry that fails the migration manifest gate
  • remove unused WORKSPACE authority from /goal and pin exact project capability sets in tests
  • replace remaining contextual-facet expect calls in /dispatch and the FEAT-015 fixture with safe errors
  • define and test that CommandCapabilities::contains(NONE) is false

Validation

  • python3 scripts/check-command-migration-manifest.py — PASS
  • python3 scripts/test_check_command_migration_manifest.py — 56/56 PASS
  • cargo fmt --all -- --check — PASS
  • cargo test -p codewhale-command-contract --lib --locked — 21/21 PASS
  • focused /dispatch tests — 4/4 PASS
  • focused FEAT-015 tests — 3/3 PASS
  • exact FEAT-021 project registration test — PASS
  • focused memory tests — 29/29 PASS
  • CI-equivalent workspace Clippy with -D warnings — PASS
  • conflict-marker and stale contextual tuple-form scans — clean
  • merged current main locally and resolved all six command-contract/TUI conflicts while preserving FEAT-019 memory and FEAT-022 skills
  • complete TUI bin/test targets exercised: 11,926 passed per run; environment/global-state failures all passed independently with isolated runtime/TMUX state
  • git diff --check — PASS

This targets the maintainer-owned reland-feat019 branch because contributor access to that branch is read-only.

Paulo Aboim Pinto

Hmbown and others added 4 commits September 2, 2026 17:15
…#5588) (Hmbown#5832)

- Remaining-credit lookup was DeepSeek-only (and /balance was a stub
  even there). One fetch_balance seam now covers DeepSeek /user/balance,
  OpenRouter /credits, and SiliconFlow /user/info. /balance runs a live
  fetch; the opt-in footer chip renders the parked value.
- Ghost-text prompt suggestions gated on the DeepSeek enum even though
  the generator speaks ordinary Chat Completions. Gate on wire protocol
  so OpenAI/OpenRouter/custom/Z.ai routes can launch with their own
  credentials; Messages and Responses stay out.
- MCP deepseek/deepseek-reply omitted-model calls hardcoded
  deepseek-v4-pro. They now follow Config::default_model() for the
  active provider.

Co-authored-by: CodeWhale Bot <bot@codewhale.net>
Co-authored-by: Grok 4.6 <grok@x.ai>
* feat(tui): per-session control socket with message/interrupt/relaunch/status verbs

Config-gated [control_socket] table (off by default) binds
<sessions-dir>/<session-id>/control.sock (0600) per running session,
speaking a newline-framed JSON-RPC. Verbs: message (structured
user message through the composer dispatch path; queued under load),
interrupt (the extracted Esc cancel body, shared with the Esc key path),
relaunch (seam: dispatches the /relaunch slash-command path — no
mechanics duplicated here), status (turn/goal snapshot answered by the
socket thread). Wiring: run_event_loop constructs SessionControl and
reconciles/updates/drains once per iteration; the socket runs on
background threads with bounded reads (1 MiB) and 5 s dispatch
timeouts. Unix-only; non-unix parses the key but refuses to bind.

Signed-off-by: M-Maciej <130112810+M-Maciej@users.noreply.github.com>

* fix(tui): back off control-socket bind retries after a refused takeover

A second live process holding a session's socket made the per-frame
reconcile retry the connect-probe and warn-log every iteration. Retries
now back off (5 s in prod, 200 ms under test) keyed on the session id,
so switching sessions is never delayed by another session's refusal.

Signed-off-by: M-Maciej <130112810+M-Maciej@users.noreply.github.com>

* fix(tui): make accepted control-socket connections blocking on BSD platforms

The listener is nonblocking, and on macOS/FreeBSD an accepted socket
inherits O_NONBLOCK from the listener (Linux accepted sockets are
blocking). The connection handler assumes blocking reads, so on macOS a
large request hit EAGAIN mid-frame, the handler dropped the connection,
and the client's in-flight write failed with BrokenPipe — the
oversized-request test failed exactly this way on macOS CI. Setting the
accepted stream back to blocking (a no-op on Linux) makes the handler's
bounded-read model hold on every platform.

Signed-off-by: M-Maciej <130112810+M-Maciej@users.noreply.github.com>

* fix(tui): cfg-gate unix-only control-socket items for Windows builds

The Windows CI gate (cargo test --no-run) denies unused imports and dead
code under -D warnings. On non-unix targets the socket transport does not
exist, so its imports, timing constants, and request/response types are
unreachable there. Split the io/atomic imports and gate the five socket
timing constants with cfg(unix), and mark the six protocol types
(Request, Method, MessageParams, EmptyParams, ControlCommand,
ResponseResult) with a scoped allow: they stay reachable in the portable
protocol/parsing tests and on unix builds, and are only unreachable in
the plain Windows lib build. The dead-code budget file is untouched.

Signed-off-by: M-Maciej <130112810+M-Maciej@users.noreply.github.com>

* docs(tui): reference the filed issue Hmbown#5533 in the control-socket module doc

The module doc still carried the pre-filing placeholder numbering; the
issue is filed as Hmbown#5533 and the changelog/PR text already use it.

Signed-off-by: M-Maciej <130112810+M-Maciej@users.noreply.github.com>

* fix(config): remove syntax errors in tests for control socket

---------

Signed-off-by: M-Maciej <130112810+M-Maciej@users.noreply.github.com>
Co-authored-by: M-Maciej <130112810+M-Maciej@users.noreply.github.com>
Co-authored-by: CodeWhale Bot <bot@codewhale.net>
Remove the orphaned loop topology entry that fails the migration gate, enforce exact project authority, make contextual fixtures fail closed, and pin empty capability containment semantics.

Signed-off-by: Paulo Aboim Pinto <paulo.aboim.pinto@gmail.com>
@aboimpinto
aboimpinto requested a review from Hmbown as a code owner September 2, 2026 19:26
Preserve the FEAT-019 memory facet and capability-scoped dispatch while integrating current main, including FEAT-022 skill-group handlers and the control-socket changes. Resolve the combined migration frontier to five pending groups.

Signed-off-by: Paulo Aboim Pinto <paulo.aboim.pinto@gmail.com>
@Hmbown
Hmbown merged commit 80dd2af into Hmbown:reland-feat019 Sep 2, 2026
4 of 6 checks passed
Hmbown pushed a commit that referenced this pull request Sep 3, 2026
…t, and typed outcomes

Harvested from reland-feat019 (PR head 80dd2af, includes #5839 review fixes).
See codewhale-ops HARVEST_LEDGER-20260903.
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.

2 participants