Commit Graph

3468 Commits

Author SHA1 Message Date
dave 7ac3fc2e3e feat(884): persistent perm_rx lock-holder for Matrix bot
Before: handle_message.rs acquired services.perm_rx only while processing
one chat message and dropped it on chat_fut completion. The moment the
bot wasn't actively responding, prompt_permission auto-denied any spawned
coder bash call as "no interactive session" — making unattended coder
work impossible.

Now: a permission_listener task is spawned at bot startup and holds
perm_rx for the bot's lifetime. Permission requests are forwarded to
the first configured Matrix room, replies resolved by the existing
on_room_message handler via pending_perm_replies. Per-message acquire is
gone from handle_message.rs (chat_fut just awaits cleanly).

- New module: chat/transport/matrix/bot/permission_listener.rs.
- Wired into run_bot before BotContext construction; bot_sent_event_ids
  is hoisted out so the listener and the rest of the bot share it.
- handle_message.rs no longer touches perm_rx.
- diagnostics/permission.rs comment updated to reflect the new reality.
- Regression test asserts the listener forwards a PermissionForward to
  the target room and records the pending reply key — exactly the path
  that was broken when no chat_fut was in flight.

Discord/Slack/WhatsApp transports still acquire perm_rx per message
(commands.rs:368 / commands/llm.rs:83 / commands/llm.rs:82). They are
not the active transport in this deployment so their per-message acquire
remains dormant; the same listener pattern should be applied to them as
follow-up work in 884 phase 2.
2026-04-30 13:53:46 +00:00
dave 0e4a970e3a fix(883): canonical Bash(:*) syntax in scaffold settings template
Claude Code 2.1.123+ honours wildcard Bash allowlist patterns only in
the canonical form `Bash(cmd:*)`. The space form `Bash(cmd *)` falls
through to prompt_permission and gets auto-denied in agent mode,
breaking spawned coders.

- Rewrite all `Bash(cmd *)` patterns in STORY_KIT_CLAUDE_SETTINGS to
  the colon form.
- Replace separate `Bash(cargo build:*)` / `Bash(cargo check:*)` with
  a single `Bash(cargo:*)`.
- Add commonly-needed patterns: python3, node, npm, which, sed, awk,
  rg, diff, sort, uniq.
- Patch the live project-root .claude/settings.json so the running
  system picks up the fix immediately (rebuilt scaffolds will match).
- Add regression test asserting no `Bash(... *)` patterns survive and
  required common commands are present.
2026-04-30 13:44:51 +00:00
Timmy 801f9d8a26 Merge branch 'master' of code.crashlabs.io:crashlabs/huskies 2026-04-30 14:38:20 +01:00
Timmy 3a9ff5e740 fix(mcp): restore HTTP /mcp endpoint after 855 regression
855 deleted the HTTP /mcp route and pointed agents at ws://...crdt-sync,
but Claude Code's .mcp.json doesn't speak ws:// and the rendezvous WS
never had MCP method handlers wired up — so every spawned Claude Code
agent (gateway-routed and local) booted with zero huskies tools and
died on --permission-prompt-tool=mcp__huskies__prompt_permission.

Restore mcp_post_handler / mcp_get_handler / handle_initialize, re-add
the /mcp route, and revert all three .mcp.json writers to emit
http://localhost:{port}/mcp with explicit "type": "http". Reuses the
already-extracted gateway::jsonrpc types and the surviving
dispatch_tool_call / list_tools surfaces — net add ~140 lines.

Federation work is unaffected: /crdt-sync continues to do CRDT sync,
which is what it was actually doing. MCP-over-WebSocket for cross-LAN
agents was never wired up by 855 and can be done as a proper follow-up
with a regression test that boots a real claude and verifies tool
registration.

Verified end-to-end: /mcp initialize, tools/list (74 tools incl.
prompt_permission), and tools/call all respond correctly from inside
the rebuilt container.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 14:03:16 +01:00
dave b0de86767a huskies: merge 882 2026-04-30 00:35:35 +00:00
dave a796bd933f huskies: merge 879 2026-04-30 00:26:35 +00:00
dave 8fc581ad6b huskies: merge 878 2026-04-29 23:53:15 +00:00
dave 1d86202abb huskies: merge 868 2026-04-29 23:34:24 +00:00
dave e02e566648 huskies: merge 881_bug_inject_prior_gate_failure_output_into_retry_agent_s_system_prompt 2026-04-29 22:52:55 +00:00
dave 9a3f60d5d3 huskies: merge 866 2026-04-29 22:47:53 +00:00
dave a49f668b5a huskies: merge 867 2026-04-29 22:17:08 +00:00
dave e56bd2d834 huskies: merge 877 2026-04-29 22:10:47 +00:00
dave 7e2f122d36 huskies: merge 880 2026-04-29 21:46:12 +00:00
dave 4d24b5b661 huskies: merge 855 2026-04-29 21:41:03 +00:00
dave a7b1572693 huskies: merge 856 2026-04-29 21:34:58 +00:00
dave db526bbdb2 huskies: merge 876 2026-04-29 21:20:29 +00:00
dave 56244e8e35 Merge spike branch 'feature/story-814' into master 2026-04-29 20:40:02 +00:00
dave c0801c3894 huskies: merge 875 2026-04-29 18:44:50 +00:00
dave a956a98197 huskies: merge 847 2026-04-29 18:40:08 +00:00
dave 39013be535 huskies: merge 846 2026-04-29 18:24:11 +00:00
dave c50a04445c spike(814): add gateway update command design doc
Documents chat-driven `update` bot command for multi-project gateway:
command surface, auth (room+role guard, future Ed25519), Docker-managed
rollout sequence, automatic and manual rollback, open questions, and
dependencies.
2026-04-29 18:17:19 +00:00
dave 320be659c0 huskies: merge 816 2026-04-29 17:57:34 +00:00
dave 02ebf14828 huskies: merge 845 2026-04-29 17:52:27 +00:00
dave fc86774618 huskies: merge 857 2026-04-29 17:45:51 +00:00
dave 8a42839b37 huskies: merge 820 2026-04-29 17:20:32 +00:00
dave c84786364a huskies: merge 874 2026-04-29 17:00:28 +00:00
dave deffcdc326 huskies: merge 844 2026-04-29 16:29:52 +00:00
dave 8a7e1aa036 huskies: merge 873 2026-04-29 16:11:34 +00:00
dave cf35027b5a config(coders): step 0 — resume prior-session work via git_status + git_log/diff against master..HEAD 2026-04-29 16:03:03 +00:00
dave 9bd3c10a09 huskies: merge 872 2026-04-29 15:59:37 +00:00
dave 7505f7fdeb huskies: merge 843 2026-04-29 15:54:28 +00:00
dave 7f8467b068 huskies: merge 871 2026-04-29 15:45:54 +00:00
dave 2655288412 huskies: merge 870 2026-04-29 15:26:57 +00:00
dave db65271587 huskies: merge 842 2026-04-29 15:10:11 +00:00
dave f3e4d5d072 huskies: merge 869 2026-04-29 14:58:11 +00:00
dave b9bb1ff804 huskies: merge 840 2026-04-29 14:36:50 +00:00
dave d1f58094f8 huskies: merge 839 2026-04-29 14:13:34 +00:00
dave 4324fa7511 huskies: merge 838 2026-04-29 13:58:05 +00:00
dave 59b626d3ba huskies: merge 824 2026-04-29 13:42:58 +00:00
dave b4854cf693 huskies: merge 862 2026-04-29 13:28:37 +00:00
dave 69930fb29f huskies: merge 837 2026-04-29 12:06:09 +00:00
dave 186cb38eeb huskies: merge 836 2026-04-29 11:50:04 +00:00
dave edeed3d1b6 huskies: merge 861 2026-04-29 11:12:20 +00:00
dave 19a2ffde96 huskies: merge 860 2026-04-29 10:53:39 +00:00
dave 11d111360d huskies: merge 858 2026-04-29 10:47:18 +00:00
dave be5db846cc huskies: merge 835 2026-04-29 10:41:27 +00:00
dave 1ae8e8ec9d huskies: merge 841 2026-04-29 10:36:03 +00:00
dave 9979ff2cf9 huskies: merge 859 2026-04-29 10:18:37 +00:00
dave d22a591fdc huskies: merge 834 2026-04-29 10:12:53 +00:00
dave 0403dc9871 huskies: merge 833 2026-04-29 09:55:09 +00:00