Commit Graph

730 Commits

Author SHA1 Message Date
dave cd6d98b99f debug: log all room messages in verification handler to diagnose in-room verification 2026-04-02 13:08:02 +00:00
Timmy 358f177584 Bump version to 0.8.6 2026-04-02 13:39:49 +01:00
dave 7003fca873 storkit: merge 456_bug_matrix_bot_ignores_in_room_verification_requests_from_element 2026-04-02 11:53:58 +00:00
dave c6020b7f43 storkit: merge 452_bug_claude_code_pty_crashes_with_fatal_runtime_error_on_agent_restart 2026-04-02 10:31:05 +00:00
Timmy 50405800c6 Bump version to 0.8.5 2026-04-02 11:08:18 +01:00
dave 57e0197d75 storkit: merge 449_bug_oauth_callback_url_ignores_port_cli_flag 2026-03-31 14:55:46 +00:00
dave dc4bac3a85 fix: update /help test to expect botCommand dispatch, fix PTY fd leak in claude_code.rs (#451, #452)
The /help test expected the help overlay to appear, but /help now goes
through botCommand like other slash commands. Updated the test to match.

Also added reader thread join and child.wait() calls to
claude_code.rs to prevent PTY master fd leaks from web UI chat sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:48:47 +00:00
dave f16545ec36 fix: join PTY reader thread before returning to prevent stale fd leak (#453)
The reader thread spawned in run_agent_pty_blocking was never joined,
leaving a cloned PTY master fd open after the agent exited. When the
pipeline restarted the agent on the same worktree, the stale fd from
the previous session interfered with the new PTY allocation, causing
Claude Code's bundled ripgrep to crash with:
  fatal runtime error: assertion failed: output.write(&bytes).is_ok()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:41:00 +00:00
Timmy 7427865e46 Adding more slash commands 2026-03-31 11:33:41 +01:00
Timmy ff5f9c76fd Bump version to 0.8.4 2026-03-31 11:32:10 +01:00
dave 5516ec4595 storkit: merge 448_story_send_oauth_login_link_via_chat_when_credentials_are_missing 2026-03-31 10:28:02 +00:00
dave 10be86587a storkit: merge 447_bug_element_tab_completion_display_name_breaks_bot_command_matching 2026-03-31 10:18:21 +00:00
Timmy a006985faf Bump version to 0.8.3 2026-03-30 18:17:09 +01:00
Timmy b75679175b Bump version to 0.8.2 2026-03-30 11:57:05 +01:00
dave fec417cb16 storkit: merge 433_story_setup_wizard_interviews_user_on_bare_projects_with_no_existing_code 2026-03-29 00:46:05 +00:00
dave b32fdf7d65 storkit: merge 434_story_wizard_auto_checks_completion_on_first_conversation 2026-03-28 23:33:05 +00:00
dave 5992f9bd19 storkit: merge 438_story_slash_command_autocomplete_in_web_ui_text_input 2026-03-28 22:27:40 +00:00
dave 3048d26e66 storkit: merge 445_bug_rate_limited_mergemaster_exits_advance_stories_to_done_without_merging 2026-03-28 20:08:15 +00:00
dave ddc4a57cd2 storkit: merge 444_refactor_extract_shared_test_helpers_test_ctx_write_story_file_make_api 2026-03-28 19:51:17 +00:00
dave 8cd881c8f1 storkit: merge 440_refactor_consolidate_is_permission_approval_into_chat_util 2026-03-28 19:47:33 +00:00
dave 8ee59f5dc1 storkit: merge 439_refactor_unify_story_stuck_states_into_a_single_status_field 2026-03-28 18:36:42 +00:00
dave 5dcc35a1b3 fix: gate runner delegates to script/test instead of hardcoding cargo clippy
The acceptance gate was hardcoded to run cargo clippy, which fails on
non-Rust projects (Go, Node, etc.). Now the gate only runs script/test
which is project-specific. Clippy is added to storkit's own script/test
so Rust linting is preserved for this project.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:15:29 +00:00
dave 96793de11b storkit: merge 441_refactor_deduplicate_get_project_root_wrappers_in_io_modules 2026-03-28 16:48:49 +00:00
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