151 Commits

Author SHA1 Message Date
dave a4480fa067 chore: feed CONTEXT and STACK specs to all agents, update STACK with source map
Agents now read specs/00_CONTEXT.md (what the project does) and
specs/tech/STACK.md (tech stack + source map) in addition to the
README. STACK.md rewritten to reflect current state — removes stale
references to biome, tauri-specta, .story_kit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:15:09 +00:00
dave 483489cc44 fix: rewrite coder agent prompts — run tests before commit, remove stale instructions
Key changes:
- Tests before commit, not after: "run run_tests, fix failures, then commit"
- Removed polling references (run_tests blocks now)
- Removed "never run script/test" (primes agents to think about it)
- Removed dead "user review" instruction
- Removed "commit and stop" which signalled skip-testing
- Cleaner workflow: implement → check criteria → test → fix → commit → exit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:19:08 +00:00
dave 8936abd8cd docs: add project architecture section to README for agent context
Agents need to know the gateway is a mode of the binary, not a
separate app, and that UI stories are frontend React work, not
Rust backend restructuring.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 16:23:18 +00:00
dave 28adef9739 chore: switch mergemaster to opus and add cargo fmt guidance
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 12:35:57 +00:00
dave badfabcf5e chore: switch mergemaster to opus and add cargo fmt guidance
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 12:27:58 +00:00
dave 845b85e7a7 fix: add --all to cargo fmt in script/test and autoformat codebase
cargo fmt without --all fails with "Failed to find targets" in
workspace repos. This was blocking every story's gates. Also ran
cargo fmt --all to fix all existing formatting issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 14:07:08 +00:00
dave 0cb68e1de9 docs: add deployment modes to README — standard, headless, and gateway
Documents the three modes of the huskies binary: standard single-project
server, headless build agent (--rendezvous), and multi-project gateway
(--gateway). Includes projects.toml config example and Docker Compose
sketch for multi-project setup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 13:44:10 +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 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 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 c0d1be675b fix: mergemaster prompt says merge_agent_work blocks — no polling needed 2026-04-11 18:13:53 +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 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 7e5b9839e8 huskies: merge 523_refactor_introduce_script_test_script_lint_script_build_and_migrate_agent_prompts_off_tech_specific_commands 2026-04-10 11:22:51 +00:00
Timmy 934bda5904 Trying out sonnet for merges 2026-04-10 01:04:25 +01:00
Timmy 7c0015beb0 docs: file 12 stories from 2026-04-09 architecture session + handoff doc
Adds the markdown shadows for stories filed during today's stress-test
session, plus a SESSION_HANDOFF document for picking up the work in
a future session.

New stories (510-521):
  510 — bug: stale 1_backlog filesystem shadows get re-promoted by timers
  511 — bug: CRDT lamport clock resets to 1 on restart (FIXED in 99557635)
  512 — story: migrate chat commands from filesystem lookup to CRDT/DB
  513 — story: startup reconcile pass for state-machine drift detection
  514 — story: delete_story should do a full cleanup
  515 — story: debug MCP tool to dump in-memory CRDT state
  516 — story: update_story.description should create the section if missing
  517 — story: remove filesystem-shadow fallback paths from lifecycle.rs
  518 — story: apply_and_persist should log persist_tx send failures
  519 — story: mergemaster should fail loudly on no-op merges (mostly
                 obviated by Stage::Merge { commits_ahead: NonZeroU32 } in 520)
  520 — story: typed pipeline state machine in Rust (sketches added in f7d69cde)
  521 — story: MCP capability to write a CRDT tombstone for a story

Refactor 436 (unify story stuck states) is marked superseded by 520
via front_matter — its functionality is now part of the
Stage::Archived { reason: ArchiveReason } enum in story 520's design.

The SESSION_HANDOFF_2026-04-09.md document captures: the four-state-machine
drift situation that motivated story 520, today's bug fixes (502 + 511),
the off-leash rogue commit incident (forensic tag rogue-commit-2026-04-09-ac9f3ecf
preserved), the recommended next-session priority order, and useful
diagnostic recipes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:03:53 +01:00
dave 41515e3b8f huskies: merge 503_bug_depends_on_pointing_at_an_archived_story_is_silently_treated_as_deps_met_surprising_users 2026-04-09 18:31:29 +00:00
dave 59fbb56252 chore: ignore pipeline.db backup files in .huskies/.gitignore
The pre-478-surgery backup file was left untracked, causing the
acceptance gate to fail. Add pipeline.db.bak* pattern to ignore
such backup files.
2026-04-09 19:16:27 +01:00
Timmy f5634a7434 Archiving the last of the pipeline story files 2026-04-09 17:59:54 +01:00
Timmy 8d9600183f Ignoring the huskies pipeline datastore 2026-04-09 17:59:12 +01:00
dave 1ffdd75475 huskies: accept 499_story_web_ui_shows_project_name_in_browser_tab_with_huskies_favicon 2026-04-08 05:04:16 +00:00
dave 46a254f80c huskies: accept 496_bug_hard_rate_limit_without_reset_at_never_auto_schedules_retry 2026-04-08 04:05:13 +00:00
dave 1baa83c1fd huskies: accept 491_story_watcher_fires_on_crdt_state_transitions_instead_of_filesystem_events 2026-04-08 04:03:12 +00:00
dave 870f49509d huskies: done 492_story_remove_filesystem_pipeline_state_and_store_story_content_in_database 2026-04-08 03:07:36 +00:00
dave f43d30bdae huskies: accept 497_bug_dependency_promotion_loop_missing_stories_with_met_deps_never_move_from_backlog_to_current 2026-04-08 01:33:33 +00:00
dave 6a56fa5623 huskies: done 497_bug_dependency_promotion_loop_missing_stories_with_met_deps_never_move_from_backlog_to_current 2026-04-08 01:32:29 +00:00
dave bc429edf49 huskies: done 491_story_watcher_fires_on_crdt_state_transitions_instead_of_filesystem_events 2026-04-08 01:18:33 +00:00
dave dbdcf334aa huskies: done 499_story_web_ui_shows_project_name_in_browser_tab_with_huskies_favicon 2026-04-08 01:07:35 +00:00
dave 0fa0b60feb huskies: create 491_story_watcher_fires_on_crdt_state_transitions_instead_of_filesystem_events 2026-04-08 00:55:02 +00:00
dave e814f5dd3c huskies: delete 488_story_web_ui_shows_project_name_in_browser_tab_with_huskies_favicon 2026-04-08 00:52:31 +00:00
dave ce9acbdeab huskies: create 499_story_web_ui_shows_project_name_in_browser_tab_with_huskies_favicon 2026-04-08 00:52:01 +00:00
dave ea8e12190b huskies: done 496_bug_hard_rate_limit_without_reset_at_never_auto_schedules_retry 2026-04-08 00:04:28 +00:00
dave f8bebd0fdf huskies: create 498_bug_stale_merge_job_lock_prevents_new_merges_after_agent_dies 2026-04-07 23:49:27 +00:00
dave c4e70db85f huskies: accept 490_story_crdt_state_layer_backed_by_sqlite 2026-04-07 18:54:36 +00:00
dave c06a01facb huskies: accept 495_bug_status_traffic_light_dots_use_unsupported_html_colouring_switch_to_emoji 2026-04-07 18:41:32 +00:00
dave 0072e44e0f huskies: accept 494_story_mcp_tool_to_run_project_test_suite 2026-04-07 18:39:31 +00:00
dave 8372b77e07 huskies: accept 493_bug_story_dependency_chain_not_firing_due_to_front_matter_format_issues 2026-04-07 17:16:27 +00:00
dave 8be4e73d10 huskies: accept 489_story_sqlite_shadow_write_for_pipeline_state_via_sqlx 2026-04-07 17:10:27 +00:00
dave c621bca7b1 huskies: done 495_bug_status_traffic_light_dots_use_unsupported_html_colouring_switch_to_emoji 2026-04-07 15:55:04 +00:00
dave b05ddedb41 huskies: create 497_bug_dependency_promotion_loop_missing_stories_with_met_deps_never_move_from_backlog_to_current 2026-04-07 15:52:48 +00:00
dave 0e2d9fe1cd huskies: accept 487_story_display_story_dependencies_in_web_ui_and_chat_commands 2026-04-07 15:47:55 +00:00
dave a126929f00 huskies: done 490_story_crdt_state_layer_backed_by_sqlite 2026-04-07 15:47:50 +00:00
dave c7cf1e8335 huskies: accept 488_story_web_ui_shows_project_name_in_browser_tab_with_huskies_favicon 2026-04-07 15:35:57 +00:00
dave 61a8f0edca huskies: accept 481_bug_scaffold_does_not_copy_agent_definitions_from_project_toml_to_new_projects 2026-04-07 15:11:57 +00:00
dave fa5885154b huskies: create 496_bug_hard_rate_limit_without_reset_at_never_auto_schedules_retry 2026-04-07 14:57:20 +00:00
dave 0adc2a494e huskies: done 494_story_mcp_tool_to_run_project_test_suite 2026-04-07 14:43:44 +00:00
dave 1b8c391836 huskies: create 495_bug_status_traffic_light_dots_use_unsupported_html_colouring_switch_to_emoji 2026-04-07 14:41:00 +00:00
dave 1acb8123ae huskies: create 494_story_mcp_tool_to_run_project_test_suite 2026-04-07 14:16:19 +00:00
dave 132d61cb68 huskies: done 488_story_web_ui_shows_project_name_in_browser_tab_with_huskies_favicon 2026-04-07 13:36:46 +00:00
dave 4476c57444 huskies: merge 488_story_web_ui_shows_project_name_in_browser_tab_with_huskies_favicon 2026-04-07 13:36:43 +00:00