Commit Graph

392 Commits

Author SHA1 Message Date
Timmy aa90646edf Bump version to 0.7.1 2026-03-28 12:51:39 +00:00
dave 953fce2ca6 fix(426): verify cherry-pick landed on master before marking story done
After the cherry-pick step in run_squash_merge, verify:
1. project_root is on the base branch (not a merge-queue branch)
2. HEAD commit has actual code changes (not an empty/story-only diff)

If either check fails, return success=false so the story stays in merge
stage for retry instead of being phantom-advanced to done.

Also rename move_story_to_archived → move_story_to_done.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 12:37:03 +00:00
Timmy c2f477dde6 Bump version to 0.7.0 2026-03-28 12:20:00 +00:00
dave b098c8ff9f storkit: merge 428_refactor_split_pool_pipeline_rs_into_submodules 2026-03-28 11:50:15 +00:00
dave f8bb23a6d4 fix(424): correct WatcherEvent::HardBlock to RateLimitHardBlock in pool/mod.rs
Story 424's merge used the wrong variant name HardBlock instead of
RateLimitHardBlock, breaking master compilation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 11:47:26 +00:00
dave 3639d64da6 fix(424): add throttled field to all StoryAgent ctors and handle HardBlock in ws.rs
The initial commit added the `throttled` field to `StoryAgent` but missed
several construction sites in lifecycle.rs, test_helpers.rs, and scan.rs.
Also adds the `HardBlock` match arm in the WebSocket event conversion and
minor CSS/import ordering fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 11:33:43 +00:00
dave ebdcf18134 feat(424): rate-limit traffic-light dots and hard-block alerts
- Add HardBlock variant to WatcherEvent (story_id, agent_name, reset_time)
- In pty.rs, distinguish allowed_warning (throttle) from hard blocks;
  emit RateLimitWarning for throttles, HardBlock for actual 429s
- Add `throttled: bool` field to StoryAgent / AgentInfo
- Pool spawns a background listener that sets throttled=true on
  RateLimitWarning or HardBlock events and fires AgentStateChanged
- Status command shows traffic-light dots: ○ idle, ● running, ◑ throttled, ✗ blocked
- Read blocked flag from story front matter for the ✗ dot
- Notifications: RateLimitWarning silenced (too noisy); HardBlock sends
  urgent chat notification with optional reset time
- Tests added for traffic_light_dot, read_story_blocked, status output,
  and all notification paths
2026-03-28 11:33:01 +00:00
dave 40575924b5 chore: bump version to 0.6.1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 10:50:59 +00:00
dave 52513b55ff storkit: merge 427_story_server_side_text_normalization_for_chat_message_line_breaks 2026-03-28 10:41:43 +00:00
dave 8ab2e19e98 fix(423): handle RateLimitHardBlock in ws.rs match
The new WatcherEvent::RateLimitHardBlock variant added in the feature
commit was not covered in the ws.rs From<WatcherEvent> match, causing
a compile error. Add the missing arm returning None (same as
RateLimitWarning — handled by chat notifications only, not WebSocket).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 10:11:44 +00:00
dave b44f3a33e3 feat(423): auto-schedule timer on rate limit to resume after reset
- pty.rs: detect rate_limit_event hard blocks, parse reset_at, emit
  WatcherEvent::RateLimitHardBlock with story_id, agent_name, reset_at
- watcher.rs: add RateLimitHardBlock variant to WatcherEvent enum
- timer.rs: add TimerStore::upsert (add-or-update-to-later) and
  spawn_rate_limit_auto_scheduler (listens for RateLimitHardBlock,
  upserts timer for the blocked story)
- notifications.rs: handle RateLimitHardBlock events with a debounced
  chat notification including the scheduled resume time;
  add format_rate_limit_hard_block_notification helper
- matrix/mod.rs: subscribe second watcher_rx for auto-scheduler,
  pass it to run_bot
- matrix/bot/run.rs: wire spawn_rate_limit_auto_scheduler into bot startup

Tests cover: AC1 (hard block detection in pty), AC2 (auto-scheduler
adds timer), AC3 (upsert deduplication), AC5 (chat notification sent),
AC6 (worktree preserved — timer fires start_agent on existing worktree)
2026-03-28 10:11:08 +00:00
dave 6c6bc35785 feat: add unblock command and MCP tool to reset blocked stories
- Add `unblock` bot command (chat + web UI slash command) that clears the
  `blocked` flag and resets `retry_count` to 0 in story front matter
- Works across all pipeline stages (1_backlog through 6_archived)
- Returns confirmation with story name and ID, or clear error if story
  is not found or not blocked
- Expose `unblock_story` MCP tool for programmatic use by agents
- Make `chat::commands::unblock` module pub(crate) so story_tools can
  call `unblock_by_number`
- Add 8 unit tests covering registration, validation, core logic, and
  edge cases (not-found, not-blocked, any stage, story ID in response)
- Update MCP tools list test: 49 → 50 tools
2026-03-28 10:05:51 +00:00
dave 98b5475160 storkit: merge 425_story_chat_notification_when_a_story_blocks_with_reason 2026-03-28 09:38:47 +00:00
dave 1193b7ac9a storkit: merge 419_bug_matrix_bot_crashes_on_transient_network_error_instead_of_retrying 2026-03-28 09:11:26 +00:00
dave cf5424f9a6 storkit: merge 421_story_timer_command_for_deferred_agent_start 2026-03-28 09:02:20 +00:00
dave d6f82393f5 storkit: merge 420_story_loc_for_a_specified_file_bot_command_and_web_ui_slash_command 2026-03-28 08:58:57 +00:00
dave d375c4b1d3 storkit: merge 418_refactor_split_pool_auto_assign_rs_into_submodules 2026-03-28 08:48:02 +00:00
dave 665c036a56 storkit: merge 417_refactor_split_matrix_bot_rs_into_focused_modules 2026-03-28 08:30:01 +00:00
dave 26f5b25f22 storkit: merge 416_refactor_split_io_fs_rs_into_submodules 2026-03-27 16:08:10 +00:00
dave 7c25aca39b storkit: merge 415_refactor_split_agents_pool_mod_rs_into_submodules 2026-03-27 15:56:00 +00:00
dave e88b9bbc63 storkit: merge 414_story_loc_command_filters_out_known_huge_files 2026-03-27 15:37:51 +00:00
dave 16853328fa storkit: merge 413_refactor_split_slack_rs_into_focused_modules 2026-03-27 15:29:23 +00:00
dave a9cdd3a354 storkit: merge 404_bug_whatsapp_and_slack_missing_assign_command_handler 2026-03-27 15:09:50 +00:00
dave f6d632139e storkit: merge 410_story_loc_bot_command_top_files_by_line_count 2026-03-27 14:36:07 +00:00
Timmy 02d08faaa2 Fixing build/test errors in master/ 2026-03-27 12:31:08 +00:00
Timmy 3571511349 restore: reset past source tree deletion, apply pending work 2026-03-27 10:49:39 +00:00
dave 24b1aa6e7f storkit: merge 401_bug_whatsapp_and_slack_missing_start_command_handler 2026-03-26 20:51:52 +00:00
dave c4cee72938 storkit: merge 396_story_whatsapp_bot_startup_announcement_after_restart 2026-03-26 20:22:26 +00:00
dave cd3ded278d storkit: merge 400_bug_whatsapp_and_slack_missing_reset_command_handler 2026-03-26 20:17:57 +00:00
Timmy 877f69c897 feat: browser-based OAuth login flow (story 406)
Add three HTTP endpoints for OAuth login without terminal access:
- GET /oauth/authorize — generates PKCE params, redirects to
  claude.com/cai/oauth/authorize with code=true and full scopes
- GET /callback — exchanges auth code for tokens via JSON POST to
  platform.claude.com/v1/oauth/token, writes ~/.claude/.credentials.json
- GET /oauth/status — returns current credential state as JSON

Uses SHA-256 (sha2 crate) for PKCE code challenge. The authorize URL
targets claude.com/cai/ (not platform.claude.com) which is required
for Max/Pro subscriptions to grant user:inference scope.

Users visit http://localhost:3001/oauth/authorize in their browser
to authenticate. Matrix/WhatsApp can send this link when auth fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:58:18 +00:00
Timmy 710b604b7c feat: auto-refresh expired OAuth token for Claude Code PTY (story 405)
Detect authentication_failed errors from the Claude Code PTY stream
and automatically refresh the OAuth access token using the stored
refresh token in ~/.claude/.credentials.json.

- New module server/src/llm/oauth.rs: reads credentials, calls
  platform.claude.com/v1/oauth/token with JSON body, writes back
- PTY provider detects "error":"authentication_failed" via AtomicBool
- chat_stream retries once after successful refresh
- Clear error message if refresh also fails

On success the retry is transparent. On failure the user sees:
"OAuth session expired. Please run claude login to re-authenticate."

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:58:04 +00:00
Timmy 61f6fd60a8 storkit: merge 402_bug_whatsapp_and_slack_missing_rebuild_command_handler 2026-03-26 11:20:55 +00:00
Timmy 108a697483 storkit: merge 397_bug_selection_screen_directory_picker_unreadable_in_dark_mode 2026-03-26 11:16:21 +00:00
dave 5dd8feb75c storkit: merge 393_story_pipeline_stage_notifications_for_whatsapp_and_slack_transports 2026-03-25 15:37:54 +00:00
dave 6521c83eec storkit: merge 394_story_whatsapp_and_slack_permission_prompt_forwarding 2026-03-25 15:34:50 +00:00
dave 077288e7b7 storkit: merge 392_refactor_extract_shared_transport_utilities_from_matrix_module_into_chat_submodule 2026-03-25 14:46:02 +00:00
dave 0457fbfecc storkit: merge 391_bug_strip_prefix_ci_panics_on_multi_byte_utf_8_characters 2026-03-25 14:04:59 +00:00
dave 84a775be77 storkit: merge 389_story_whatsapp_phone_number_allowlist_authorization 2026-03-25 13:42:31 +00:00
dave a1a30bcc42 storkit: merge 387_story_configurable_base_branch_name_in_project_toml 2026-03-25 13:33:38 +00:00
dave 11bbfca3da storkit: merge 386_story_unreleased_command_shows_list_of_stories_since_last_release 2026-03-24 22:23:01 +00:00
dave 18755aac96 storkit: merge 385_story_slack_markdown_to_mrkdwn_formatting_conversion 2026-03-24 22:12:31 +00:00
dave 821345d266 storkit: accept 383_refactor_reorganize_chat_system_into_chat_module_with_transport_submodules 2026-03-24 21:41:42 +00:00
Timmy 721d12bcfe Fixing code warnings 2026-03-24 21:26:48 +00:00
Timmy 9408bd2cdf Bump version to 0.6.0 2026-03-24 21:06:15 +00:00
Timmy a24e4c5c85 Making Matrix config fields optional to meet Twilio login needs 2026-03-24 21:05:35 +00:00
dave 438be196c9 feat: scaffold creates per-transport bot.toml example files
New projects now get bot.toml.matrix.example, bot.toml.whatsapp-meta.example,
bot.toml.whatsapp-twilio.example, and bot.toml.slack.example in .storkit/
during scaffolding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:13:32 +00:00
dave 79edc28334 storkit: merge 383_refactor_reorganize_chat_system_into_chat_module_with_transport_submodules 2026-03-24 17:57:21 +00:00
dave dedf951b17 storkit: merge 382_story_whatsapp_transport_supports_twilio_api_as_alternative_to_meta_cloud_api 2026-03-24 17:36:32 +00:00
dave 1a9833d820 storkit: merge 380_story_assign_command_restarts_coder_when_story_is_already_in_progress 2026-03-24 15:05:52 +00:00
dave c755c03f0e storkit: merge 381_story_bot_command_to_delete_a_worktree 2026-03-24 15:02:50 +00:00