From 0ae0d0fba75cb86040c7117d6f96044585491490 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 4 Apr 2026 12:31:53 +0000 Subject: [PATCH] huskies: create 475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper --- ..._split_chat_tsx_into_smaller_components.md | 26 ------------------- ...overage_report_with_improvement_targets.md | 21 --------------- ...ions_into_a_shared_parameterised_helper.md | 25 ++++++++++++++++++ 3 files changed, 25 insertions(+), 47 deletions(-) delete mode 100644 .huskies/work/1_backlog/473_refactor_split_chat_tsx_into_smaller_components.md delete mode 100644 .huskies/work/1_backlog/474_story_per_file_test_coverage_report_with_improvement_targets.md create mode 100644 .huskies/work/1_backlog/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md diff --git a/.huskies/work/1_backlog/473_refactor_split_chat_tsx_into_smaller_components.md b/.huskies/work/1_backlog/473_refactor_split_chat_tsx_into_smaller_components.md deleted file mode 100644 index e5651bd5..00000000 --- a/.huskies/work/1_backlog/473_refactor_split_chat_tsx_into_smaller_components.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: "Split Chat.tsx into smaller components" ---- - -# Refactor 473: Split Chat.tsx into smaller components - -## Current State - -- TBD - -## Desired State - -Chat.tsx is 1513 lines and growing. ChatInput and ChatHeader are already split out. Break up the remaining monolith into focused components — likely candidates: message list/rendering, websocket connection management, message bubbles, typing indicators, and any other distinct UI concerns. - -## Acceptance Criteria - -- [ ] Chat.tsx reduced to under 500 lines by extracting components -- [ ] Message list/rendering extracted into its own component -- [ ] Message bubble rendering extracted into its own component -- [ ] WebSocket connection logic extracted (hook or provider) -- [ ] All existing Chat.test.tsx tests still pass -- [ ] No visual or behavioural regressions in the chat UI - -## Out of Scope - -- TBD diff --git a/.huskies/work/1_backlog/474_story_per_file_test_coverage_report_with_improvement_targets.md b/.huskies/work/1_backlog/474_story_per_file_test_coverage_report_with_improvement_targets.md deleted file mode 100644 index 26c3547d..00000000 --- a/.huskies/work/1_backlog/474_story_per_file_test_coverage_report_with_improvement_targets.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: "Per-file test coverage report with improvement targets" ---- - -# Story 474: Per-file test coverage report with improvement targets - -## User Story - -As a developer, I want a standardised JSON output format for test coverage so that any language's coverage tool can produce it and huskies can read it without language-specific logic. - -## Acceptance Criteria - -- [ ] Define a standard `.coverage_report.json` format: `{ "overall": float, "threshold": float, "files": [{ "path": string, "coverage": float }] }` -- [ ] Update huskies' own `script/test_coverage` to write `.coverage_report.json` in this format (Rust via `cargo llvm-cov --json`, frontend via vitest) -- [ ] `coverage` bot command reads `.coverage_report.json` and shows overall percentage plus top 5 lowest-covered files as improvement targets -- [ ] Document the `.coverage_report.json` format in `.huskies/README.md` so other projects can produce it from any language -- [ ] Huskies server has zero language-specific coverage logic — all intelligence is in the project's `script/test_coverage` - -## Out of Scope - -- TBD diff --git a/.huskies/work/1_backlog/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md b/.huskies/work/1_backlog/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md new file mode 100644 index 00000000..c17c5357 --- /dev/null +++ b/.huskies/work/1_backlog/475_refactor_deduplicate_lifecycle_rs_move_functions_into_a_shared_parameterised_helper.md @@ -0,0 +1,25 @@ +--- +name: "Deduplicate lifecycle.rs move functions into a shared parameterised helper" +--- + +# Refactor 475: Deduplicate lifecycle.rs move functions into a shared parameterised helper + +## Current State + +- TBD + +## Desired State + +The move_story_to_current, move_story_to_done, move_story_to_merge, move_story_to_qa, and reject_story_from_qa functions share the same pattern: build paths, check idempotency, find source file in one or more stages, rename, clear front matter fields, log. Extract a shared `move_story()` helper parameterised by source stages, target stage, and fields to clear. The named functions become thin wrappers. The existing `move_story_to_stage` function should also use this shared helper. 27 existing tests provide a safety net. + +## Acceptance Criteria + +- [ ] Single shared move_story helper function parameterised by source stages, target stage, and fields to clear +- [ ] All existing named move functions (move_story_to_current, move_story_to_done, move_story_to_merge, move_story_to_qa, reject_story_from_qa) become thin wrappers +- [ ] move_story_to_stage also delegates to the shared helper +- [ ] All 27 existing tests pass unchanged +- [ ] Net reduction of at least 150 lines from lifecycle.rs + +## Out of Scope + +- TBD