Commit Graph

3234 Commits

Author SHA1 Message Date
dave f6cd947173 fix: shrink hero husky logo from 320px to 160px for mobile
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.10.0
2026-04-12 23:24:18 +00:00
dave fa7c2fa0ed fix: switch tokio-tungstenite from native-tls to rustls to remove OpenSSL dependency
native-tls pulls in openssl-sys which requires system OpenSSL headers,
breaking macOS release builds. rustls-tls-native-roots is pure Rust.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 23:20:46 +00:00
Timmy f2fc33c86b Bump version to 0.10.0 2026-04-13 00:10:03 +01:00
dave 05c3b11e57 huskies: merge 551_bug_get_agent_output_mcp_tool_returns_fetch_failed_for_running_agents 2026-04-12 17:50:44 +00:00
dave ae4cacefe8 huskies: merge 549_bug_stale_stage_transition_notifications_for_stories_that_skipped_stages 2026-04-12 15:40:11 +00:00
dave 8ae06cc8e2 huskies: merge 550_story_split_status_command_into_status_pipeline_info_and_logs_agent_output_subcommands 2026-04-12 15:00:05 +00:00
dave da5d604d01 huskies: merge 548_refactor_rename_living_spec_standalone_to_huskies_in_package_json_and_cargo_lock 2026-04-12 14:50:38 +00:00
dave 9c3dbfb765 huskies: merge 485_story_documentation_site_for_huskies_dev 2026-04-12 14:17:28 +00:00
dave b85d7b3b86 huskies: merge 542_refactor_add_doc_comments_to_all_undocumented_source_files_and_generate_source_map_in_readme 2026-04-12 14:05:08 +00:00
dave 76765e15d2 huskies: merge 547_story_run_tests_bot_command_accepts_optional_story_number_to_run_tests_in_a_worktree 2026-04-12 13:26:13 +00:00
dave b7f077197d chore: add doc comment guidance to coder agent system prompts
Agents now know to add //! module comments and /// doc comments
to new public items, keeping documentation consistent with the
codebase-wide doc pass from story 542.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:25:21 +00:00
dave a344cfadee huskies: merge 544_story_add_run_build_and_run_lint_mcp_tools_backed_by_script_build_and_script_lint 2026-04-12 13:21:41 +00:00
dave cec62dad1c huskies: merge 542_refactor_add_doc_comments_to_all_undocumented_source_files_and_generate_source_map_in_readme 2026-04-12 13:16:11 +00:00
dave 6b1737d52d huskies: merge 546_refactor_rename_bot_test_command_to_run_tests_to_avoid_eating_chat_messages 2026-04-12 13:11:17 +00:00
dave b4dbfcbde6 huskies: merge 541_story_backlog_command_for_chat_and_web_ui_shows_only_backlog_items 2026-04-12 13:05:12 +00:00
dave 2bdb0eb730 fix: add log rotation to docker-compose to prevent disk fill
Test output now goes to container stdout via Stdio::inherit, so logs
grow fast. Cap at 50MB with 3 rotated files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:00:21 +00:00
dave 5f01631e6a huskies: merge 543_story_resume_failed_coder_agents_with_resume_instead_of_starting_fresh_sessions 2026-04-12 12:58:42 +00:00
dave c80931c15c fix: add ETXTBSY retry to run_coverage_gate
Use fsync in coverage gate tests to ensure the kernel releases the
write handle before executing the script. Prevents flaky ETXTBSY
errors on fast test runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:40:08 +00:00
dave f140238cc3 fix: update run_tests tests for Stdio::inherit and bump tool count to 60
run_tests now uses Stdio::inherit so stdout/stderr aren't captured —
tests can only assert on pass/fail and exit code. Tool count bumped
from 59 to 60 for the new get_test_result tool.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:30:10 +00:00
dave 05bdc71ebc fix: add rustfmt to Docker image for formatting checks
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:20:47 +00:00
dave ec6891b5ba fix: remove stale tests that hang or assert dead behaviour
- Remove tool_merge_agent_work_returns_started and
  tool_get_merge_status_returns_running: these tested the old
  non-blocking API but tool_merge_agent_work now blocks in a poll
  loop, causing the tests to hang forever.

- Update coder_agents_have_root_cause_guidance: prompt no longer
  requires "git bisect" — check for bug workflow guidance instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:02:47 +00:00
dave 06defd9596 fix: collapse nested if-let blocks to satisfy clippy collapsible_if lint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 11:43:36 +00:00
dave 0b58b0486c fix: use Stdio::inherit for run_tests to prevent pipe deadlock
spawn() with piped stdout/stderr deadlocks when the test binary
produces more output than the OS pipe buffer (64KB). Switch to
Stdio::inherit so test output flows to server logs and we can
see what's happening.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 00:46:43 +00:00
dave b43e7cf752 fix: kill stale cargo processes before running acceptance gates
The completion handler now pgrep+kills any cargo processes targeting
the worktree's Cargo.toml before running gates. This prevents the
run_tests MCP child from holding the build lock and blocking gates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 00:25:56 +00:00
dave 8ae6ca3eb8 fix: make run_tests block server-side instead of requiring agent polling
run_tests now spawns the child and blocks in a 1-second poll loop until
tests complete or the 20-minute timeout fires. Returns the full result
in a single MCP call — agents use 1 turn instead of 50+. Child process
is properly killed on timeout (no zombies).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 23:07:02 +00:00
dave bac07d28a7 fix: increase run_tests MCP timeout to 20 minutes to match acceptance gates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:43:31 +00:00
dave fc89be2f55 fix: server-side 20s blocking in get_test_result to prevent agent poll spam
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:29:38 +00:00
dave 028bff5ef1 fix: rewrite .huskies/README.md for CRDT-only world
Strip all filesystem pipeline references that were causing agents to
waste turns searching for story files on disk. The README now points
agents at MCP tools exclusively and documents the async run_tests
workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:11:36 +00:00
dave 1f66183c8e fix: update scaffold settings template to match locked-down agent permissions 2026-04-11 22:03:53 +00:00
dave f958f57e56 fix: async run_tests to prevent zombie cargo processes blocking gates
run_tests MCP tool now spawns tests in the background and returns
immediately. Agents poll get_test_result to check completion. This
prevents zombie cargo processes from holding the build lock when the
CLI times out the MCP call before tests finish.

Also fixes agent permission mode: acceptEdits replaces invalid
allowFullAutoEdit that was causing agents to crash-loop on spawn.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:00:05 +00:00
dave 8393a67c89 fix: log git hash on build success and startup to verify which commit is running
Writes HEAD short hash to .huskies/build_hash after successful cargo
build. Logs it on startup as [startup] Running build: <hash>. No more
guessing whether the rebuild actually deployed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 20:50:15 +00:00
dave e32300d1f8 fix: switch agent permission mode from bypassPermissions to allowFullAutoEdit
bypassPermissions ignored the worktree's .claude/settings.json entirely,
letting agents run any Bash command including cargo test (which they'd
spawn 4+ times concurrently, deadlocking on the build directory lock).

allowFullAutoEdit respects the settings.json allowlist, so agents can
only use the Bash commands we explicitly permit (cargo check, cargo
build, git) and must use MCP tools for everything else (run_tests,
run_lint, run_build).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 20:23:22 +00:00
dave 32e36bbc4b fix: remove cargo test/clippy/npm from agent Bash permissions
Agents were running cargo test directly via Bash instead of using the
run_tests MCP tool, causing 4 concurrent cargo builds that deadlocked
on the build directory lock. Removed cargo test, cargo clippy, cargo
nextest, script/test, npm test, and pnpm test from the allowed Bash
commands. Agents must use the run_tests MCP tool which returns truncated
output and prevents concurrent builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 19:50:52 +00:00
dave c0d1be675b fix: mergemaster prompt says merge_agent_work blocks — no polling needed 2026-04-11 18:13:53 +00:00
dave d06241c20c fix: merge_agent_work blocks until complete instead of requiring polling
The mergemaster agent was burning all 30 turns polling get_merge_status
every 2 seconds while the merge pipeline takes ~2 minutes. It would
exhaust turns, exit, restart, and repeat — never seeing the result.

merge_agent_work now blocks with a 10-second internal poll loop and
returns the final result directly. The agent calls it once and gets
the answer. No more polling turns wasted.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 17:43:50 +00:00
dave 599fbdc71d huskies: merge 539_bug_crdt_event_bridge_still_writes_filesystem_shadow_files_after_530_eliminated_filesystem_state 2026-04-11 17:04:36 +00:00
dave 6998275331 huskies: merge 540_bug_get_agent_output_mcp_tool_returns_no_agent_for_exited_agents_instead_of_reading_session_logs_from_disk 2026-04-11 16:33:58 +00:00
dave a9a1852422 fix: agent prompts say trust the story description instead of always investigating
Agents were spending entire $5 budgets grepping the codebase and reading
git history instead of making fixes when the story already specifies
exact file paths and function names. Changed bug workflow from
"investigate root cause first" to "trust the story, act fast" — go
directly to the specified location when the story tells you where.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:16:12 +00:00
dave 48ea612739 fix: remove startup CRDT stage sync — it fights the done→archived sweep
The sync_crdt_stages_from_db migration reads pipeline_items (which has
stale 5_done stages) and overwrites the CRDT back to 5_done for stories
that were already swept to 6_archived. On every restart, done stories
reappear and get re-swept.

The migration served its purpose — CRDT stages are now correct. Remove it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:50:07 +00:00
dave 17d635b66b fix: restore CRDT-based triage command (535 fix was reverted by merge conflict)
Story 535's triage fix was overwritten by a subsequent merge that
resolved a conflict by taking the old filesystem-based version.
Re-applies the CRDT-based triage that reads from pipeline state
and content store, works for any pipeline stage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:43:26 +00:00
dave 4ab723f40b huskies: merge 538_bug_done_archived_sweep_never_fires_because_stage_done_projection_uses_utc_now_instead_of_real_merged_at_timestamp 2026-04-11 13:29:38 +00:00
dave 5d193bb568 huskies: merge 537_bug_delete_item_sets_stage_to_deleted_string_instead_of_writing_a_crdt_tombstone 2026-04-11 13:25:45 +00:00
dave dcf6cf8f82 fix: collapse consecutive str::replace calls to satisfy clippy 2026-04-11 13:21:47 +00:00
dave eea54ca616 fix: thread-local CRDT and content store for test isolation
Tests shared a global CRDT singleton and content store HashMap, causing
flaky failures when parallel tests wrote items that polluted each
other's assertions. 3-5 random test failures per run.

Both CRDT_STATE and CONTENT_STORE now use thread_local! in test mode
so each test thread gets its own isolated instance. Production code
is unchanged — it still uses the global OnceLock singletons.

Also fixed 3 tests (create_story_writes_correct_content,
next_item_number_increments_from_existing_bugs,
next_item_number_scans_archived_too) that relied on leaked state
from other tests — they now write to the content store explicitly.

Result: 1902 passed, 0 failed across 5 consecutive runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:02:09 +00:00
dave dd53870c59 fix: agent prompts use run_tests MCP tool instead of running script/test via Bash
Agents were running script/test directly through the PTY, streaming
the full output of npm install, cargo clippy, cargo test, and frontend
builds into session logs. This tripled session log sizes (~200KB to
~600KB per session) and contributed to CLI SIGABRT crashes.

The run_tests MCP tool already runs script/test server-side and returns
a truncated JSON summary. Agents now use it exclusively.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:46:05 +00:00
dave 5696d77922 debug: add PTY spawn diagnostics for Session: None investigation
When an agent CLI exits without creating a session, we now log:
- Number of prior sessions and total session log bytes
- Child process exit status (exit code or signal)
- Explicit SESSION NONE warning with context

This will help diagnose whether the fatal runtime error
(output.write assertion) correlates with accumulated sessions,
budget exhaustion, or something else.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:21:06 +00:00
dave 44ef477a01 fix: skip rate limit timer for short blocks (≤10 min) — CLI handles internally
The rate limit auto-scheduler was creating timers for every hard block,
including short 5-minute throttles. This caused a death loop: agent hits
rate limit, timer set, agent exits, pipeline restarts before timer fires,
new agent dies instantly (Session: None) because API is still throttled.

Short rate limits are handled naturally by the CLI's internal wait. Only
schedule timers for long session-level blocks (>10 min) where the CLI
will exit and needs external restart.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:52:14 +00:00
Timmy de738b27ed fix: CrdtNode derive macro defaults missing fields instead of panicking
When replaying old CRDT ops that predate new struct fields (e.g.
claimed_by, claim_ts added by story 479), node_from would call
.unwrap() on None and panic during init. Now defaults to an empty
CrdtNode::new() for missing fields, allowing schema evolution without
breaking replay of historical ops.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 00:16:10 +01:00
dave fc24da82ae debug: add logging to sync_crdt_stages_from_db to diagnose stale backlog 2026-04-10 20:33:04 +00:00
dave bae3619723 fix: startup migration syncs stale CRDT stages from pipeline_items DB
510 stories had stale 1_backlog stages in the CRDT because they were
imported during the filesystem→CRDT migration and then moved forward
via filesystem-only moves that never wrote CRDT ops. This made done
stories appear as ghost entries in the backlog.

On startup, reads the authoritative stage from pipeline_items and
corrects any CRDT entries that disagree.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 19:58:17 +00:00