Commit Graph

607 Commits

Author SHA1 Message Date
dave 08db28d9d6 storkit: merge 437_bug_strip_prefix_ci_panics_on_multi_byte_utf_8_input 2026-03-28 16:33:26 +00:00
Timmy 3595df4d9d Bump version to 0.8.1 2026-03-28 15:37:08 +00:00
dave be0036922a fix: unblock command also clears merge_failure field
Previously unblock only checked for blocked=true. Stories stuck in
merge with a merge_failure field were not considered "blocked" and
unblock refused to act. Now it clears both blocked and merge_failure,
and reports which fields were cleared.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:33:01 +00:00
dave 361f9dff0d fix(426): also narrow pre-cherry-pick code change check to .storkit/work/
There were two places checking for code changes: the post-cherry-pick
verification (already fixed) and a pre-cherry-pick check in the
merge-queue worktree. The pre-cherry-pick check was still filtering
all of .storkit/ which rejected stories that only change project.toml.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:27:19 +00:00
dave fc160b5c5f feat: wizard detects bare projects and prompts user interview for context/stack
wizard_generate now checks if the project has no source code. On bare
projects, the generation hints tell the LLM to ask the user what they
want to build and what tech stack they plan to use, rather than trying
to read a nonexistent codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:17:42 +00:00
dave 9092b8a2c9 fix: wizard hints address the LLM not the user, README adds bare project guidance
The format_wizard_state hints now tell the LLM what to do ("show it
to the user and ask if they're happy") rather than exposing tool names
to the user ("Run wizard_generate").

README wizard instructions now distinguish between existing-code projects
(read codebase, generate files) and bare projects (interview the user
about what they want to build).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:15:14 +00:00
dave dfe3d96313 docs: move wizard instructions to .storkit/README.md for LLM-agnostic access
The wizard check was only in CLAUDE.md which is Claude-specific.
Move the primary instruction to .storkit/README.md (step 1 of First
Steps) so any LLM reading the dev process docs will discover the wizard.
CLAUDE.md keeps a shorter pointer to the README.

Also fix stale .story_kit/ paths to .storkit/ in the README.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:12:54 +00:00
dave 50bfeddcb5 fix: scaffold CLAUDE.md uses active wizard instruction
Change from passive "call wizard_status to check progress" to active
"On your first conversation, call wizard_status" with IMPORTANT prefix.
Without the direct instruction, Claude ignores the wizard tools.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:06:21 +00:00
dave d363eb63e2 fix: scaffold CLAUDE.md now mentions wizard and MCP tools
Without this, Claude Code in a freshly scaffolded project has no idea
storkit's wizard or MCP tools exist and gives generic setup advice.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 14:37:44 +00:00
dave 49b78f3642 storkit: merge 432_story_complete_setup_wizard_with_mcp_tools_and_agent_driven_file_generation 2026-03-28 14:23:59 +00:00
dave 93576e3f83 fix(426): narrow merge verification exclude to .storkit/work/ only
The post-cherry-pick diff check was excluding all of .storkit/, which
rejected stories whose deliverable is .storkit/project.toml changes
(e.g. 431 updating QA agent prompts). Narrow the exclusion to
.storkit/work/ which is where pipeline file moves live.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 14:21:57 +00:00
dave fe0a032e8e storkit: merge 430_bug_status_command_traffic_light_dots_not_coloured_in_matrix 2026-03-28 13:57:38 +00:00
dave eff8f6a6a6 feat(399): add --port CLI flag with project.toml persistence
Manual merge of story 399 feature branch, adapted for the current CLI
parser (which includes the init subcommand from 429).

- storkit --port 3000 sets the listening port
- storkit --port=3000 also works
- Port resolution: CLI flag > STORKIT_PORT env > default 3001
- Supports combining with init: storkit init --port 3000 /path
- Replaces CliDirective enum with CliArgs struct that handles both
  --port and init in a single pass

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 13:47:02 +00:00
Timmy e45eab82f2 Bump version to 0.8.0 2026-03-28 13:32:07 +00:00
dave 0b50c66caa storkit: merge 429_story_interactive_project_setup_wizard_for_new_storkit_projects 2026-03-28 13:29:05 +00:00
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