Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
700c360
perf: optimize startup performance with metadata tracking and update …
djm81 Jan 27, 2026
4b167dd
Merge branch 'main' into dev
djm81 Jan 27, 2026
e4782ea
fix: add missing ADO field mappings and assignee display (#145)
djm81 Jan 27, 2026
a2f6ac7
Merge branch 'main' into dev
djm81 Jan 27, 2026
c74a773
fix: mitigate code scanning vulnerabilities (#148)
djm81 Jan 27, 2026
af030dc
fix: detect GitHub remotes using ssh:// and git:// URLs
djm81 Jan 27, 2026
db827a0
chore: bump version to 0.26.9 and update changelog
djm81 Jan 27, 2026
1ade334
Merge branch 'main' into dev
djm81 Jan 27, 2026
5c1cb41
fix: compare GitHub SSH hostnames case-insensitively
djm81 Jan 27, 2026
68cc345
Merge branch 'main' into dev
djm81 Jan 27, 2026
dfeb7ca
Add openspec and workflow commands for transparency
djm81 Jan 27, 2026
9e1f22d
Add specs from openspec
djm81 Jan 27, 2026
115e402
Remove aisp change which wasn't implemented
djm81 Jan 27, 2026
2675361
Fix openspec gitignore pattern
djm81 Jan 27, 2026
573fb7b
Update gitignore
djm81 Jan 27, 2026
907501e
Update contribution standards to use openspec for SDD
djm81 Jan 27, 2026
568000c
Merge branch 'main' into dev
djm81 Jan 27, 2026
fe082f6
Migrate to new opsx openspec commands
djm81 Jan 27, 2026
036afbe
Migrate workflow and openspec config
djm81 Jan 28, 2026
5a1493f
fix: bump version to 0.26.10 for PyPI publish
djm81 Jan 28, 2026
da606a1
Update version and changelog
djm81 Jan 28, 2026
608f317
Add canonical user-friendly workitem url for ado workitems
djm81 Jan 28, 2026
719256c
Update to support OSPX
djm81 Jan 28, 2026
1f94d7c
Merge branch 'main' into dev
djm81 Jan 28, 2026
bbf730a
feat(backlog): implement refine --import-from-tmp and fix type-check …
djm81 Jan 28, 2026
080743a
Merge branch 'main' into dev
djm81 Jan 28, 2026
5ab46a5
Merge branch 'main' into dev
djm81 Jan 28, 2026
1cdfc66
feat: debug logs under ~/.specfact/logs and release 0.26.13 (#159)
djm81 Jan 29, 2026
6bd9d7f
Potential fix for pull request finding 'Empty except'
djm81 Jan 29, 2026
d7d194b
Fix unused variable review
djm81 Jan 29, 2026
39563fc
Fix unused variable review
djm81 Jan 29, 2026
d15485a
Fix type and test errors
djm81 Jan 29, 2026
6c9c9b9
Merge branch 'main' into dev
djm81 Jan 29, 2026
bd9b96a
Finalize change
djm81 Jan 29, 2026
c7e4546
Change for debug logs archived
djm81 Jan 29, 2026
09e8040
Merge branch 'main' into dev
djm81 Jan 29, 2026
642e1a9
fix: improve ADO backlog refine error logging and user-facing error U…
djm81 Jan 29, 2026
64365db
Merge branch 'main' into dev
djm81 Jan 29, 2026
0d0abba
feat: backlog refine --ignore-refined and --id, startup docs (fixes #…
djm81 Jan 30, 2026
aad02cd
Add change proposals for full scrum support
djm81 Jan 30, 2026
a3c3fb4
Merge branch 'main' into dev
djm81 Jan 30, 2026
1f054c5
Add support for systematic, structured issue creation with copilot help
djm81 Jan 30, 2026
899b9c2
feat(backlog): daily standup defaults, iteration/sprint, unassigned i…
djm81 Feb 3, 2026
b596766
Issue 179 resolution (#180)
djm81 Feb 3, 2026
bb7214f
Merge branch 'main' into dev
djm81 Feb 3, 2026
61a820c
fix(backlog): address CodeQL/Codex PR 181 findings
djm81 Feb 3, 2026
10fee30
Update openspec enforcement rules
djm81 Feb 3, 2026
8e770dc
Structure openspec changes
djm81 Feb 3, 2026
5782860
Fix ruff finding
djm81 Feb 3, 2026
05c592d
Fix linter issues with StrEnum and parameters
djm81 Feb 3, 2026
f7e3d0f
Fix tests and depcreation warnings
djm81 Feb 3, 2026
15d710b
Improve sync script
djm81 Feb 3, 2026
b223161
Merge branch 'main' into dev
djm81 Feb 3, 2026
870db6a
Add change for modular command registry
djm81 Feb 3, 2026
5404c18
Fix review finding on dev sync script
djm81 Feb 3, 2026
e4650dd
Update modular change proposal
djm81 Feb 4, 2026
c44013e
feat: CLI modular command registry and lazy load (arch-01) (#196)
djm81 Feb 4, 2026
542183c
docs: document CLI modules design; sync version and cleanup
djm81 Feb 4, 2026
c4b10d8
Archive modular change and specs
djm81 Feb 4, 2026
a7a83c2
Merge branch 'main' into dev
djm81 Feb 4, 2026
2faf547
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 4, 2026
b5d2680
Fix banner display on help screen
djm81 Feb 4, 2026
077ff3f
Improve action runner on main
djm81 Feb 4, 2026
7567149
Merge branch 'main' into dev
djm81 Feb 4, 2026
8a0a38f
Setup claude skills and instructions
djm81 Feb 5, 2026
336efb5
feat: module package separation for command implementations (#200)
djm81 Feb 6, 2026
ad023f5
Merge branch 'main' into dev
djm81 Feb 6, 2026
8b4adcb
fix: address CodeQL and Codex review findings from PR #201
djm81 Feb 6, 2026
b44ce9c
Merge branch 'main' into dev
djm81 Feb 6, 2026
a6b9d32
feat: module lifecycle management, init split, and interactive module…
djm81 Feb 6, 2026
de89bba
archived change for module improvements
djm81 Feb 6, 2026
b4edcfb
Merge branch 'main' into dev
djm81 Feb 6, 2026
bc71080
fix: address review feedback in init and boundary tests
djm81 Feb 6, 2026
e5d7002
Fix test setup for tmpfiles
djm81 Feb 6, 2026
c97080b
Merge branch 'main' into dev
djm81 Feb 6, 2026
46b1357
docs: add openspec change arch-05 bridge registry (#210)
djm81 Feb 8, 2026
20410a6
docs: add openspec change arch-06 manifest security (#211)
djm81 Feb 8, 2026
04aba4b
feat: Core Contracts and Module Interface Formalization (#209)
djm81 Feb 8, 2026
0f492f6
Update specs and archive arch-04 change
djm81 Feb 8, 2026
7656d7c
Fix changelog format
djm81 Feb 8, 2026
b826fb6
docs: align arch-05 scope with protocol migration cleanup (#212)
djm81 Feb 8, 2026
c8ec9bb
docs: add OpenSpec changes for module marketplace phases
djm81 Feb 9, 2026
b6e1fe1
feat: apply arch-05 bridge registry implementation (#216)
djm81 Feb 10, 2026
f10e14e
Archive arch-05 change after implementation
djm81 Feb 10, 2026
285a9ff
Merge branch 'main' into dev
djm81 Feb 10, 2026
5075d0c
fix: address post-merge review findings and restore lazy registration
djm81 Feb 10, 2026
31e6924
fix: refresh project console per invocation in tests
djm81 Feb 10, 2026
d7ca6af
fix: detect runtime interface protocol ops in source scan
djm81 Feb 10, 2026
0e5463f
fix: harden project console refresh and protocol source scan
djm81 Feb 10, 2026
57c729b
fix: refresh import command console for each invocation
djm81 Feb 10, 2026
e270e09
fix: resolve type-check errors and harden protocol scanning
djm81 Feb 10, 2026
7cc1c48
fix: stabilize module protocol scan and project console lifecycle
djm81 Feb 10, 2026
5996a1d
Merge branch 'main' into dev
djm81 Feb 10, 2026
81527a5
Refine pending changes for new modular ecosystem and marketplace inte…
djm81 Feb 10, 2026
6fd151a
fix: update stale spec-delta paths in tasks.md after change renames
djm81 Feb 10, 2026
22640fa
docs: rewrite CHANGE_ORDER.md for module-scoped changes and full depe…
djm81 Feb 10, 2026
e7d69d6
Merge branch 'main' into dev
djm81 Feb 10, 2026
9a7f9f6
feat(backlog): daily/refine comment context, interactive standup post…
djm81 Feb 11, 2026
e61d56b
fix(backlog): satisfy interactive daily adapter typing
djm81 Feb 11, 2026
fff65e9
fix(backlog): bypass default daily limit for issue-window flags
djm81 Feb 11, 2026
b2a8ab5
Merge branch 'main' into dev
djm81 Feb 11, 2026
88ea93c
fix: parse backlog refine writeback fields and refactor refine comman…
djm81 Feb 12, 2026
f3c5759
fix: avoid raw label fallback when description block is missing
djm81 Feb 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ All notable changes to this project will be documented in this file.

---

## [0.30.3] - 2026-02-12

### Fixed (0.30.3)

- **Backlog refine writeback parsing for ADO/GitHub**
- `specfact backlog refine --write` now parses structured refinement output (markdown headings and label-style fields like `Description:`, `Acceptance Criteria:`, `Story Points:`, `Business Value:`, `Priority:`) into canonical fields before adapter writeback.
- ADO writeback now avoids writing labeled refinement blocks verbatim into description and instead updates mapped fields with split canonical values.
- GitHub writeback now preserves canonical field updates even when refined bodies include structured headings that do not explicitly include all core field sections.
- **Refine command maintainability**
- Decomposed `backlog refine` orchestration into focused helper methods (stdin refinement capture, update-field construction, writeback, optional OpenSpec comment) to reduce top-level command complexity while keeping behavior parity.

### Changed (0.30.3)

- **Version**: Bumped to `0.30.3` (patch).

---

## [0.30.2] - 2026-02-11

### Fixed (0.30.2)
Expand Down
4 changes: 4 additions & 0 deletions docs/guides/backlog-refinement.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ This helps copilot identify missing elements that need to be added during refine
- Records `refinement_timestamp`
- Updates template detection metadata
- **Preserves all other fields** (assignees, tags, state, priority, due_date, story_points, etc.)
- Parses structured refinement output into canonical fields before writeback:
- accepts markdown-heading sections and label-style sections (for example `Description:`, `Acceptance Criteria:`, `Story Points:`)
- maps ADO description/acceptance criteria/metrics to separate provider fields
- avoids writing prompt label blocks verbatim into ADO description

**Field Preservation Policy**:

Expand Down
4 changes: 4 additions & 0 deletions docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -3697,6 +3697,10 @@ specfact backlog refine <ADAPTER> [OPTIONS]

- `--preview` / `--no-preview` - Preview mode: show what will be written without updating backlog (default: `--preview`)
- `--write` - Write mode: explicitly opt-in to update remote backlog (requires `--write` flag)
- During `--write`, structured refinement output is parsed into canonical fields before adapter updates.
- Supports markdown headings and label-style sections (for example `Description:`, `Acceptance Criteria:`, `Story Points:`).
- ADO updates mapped fields separately (description, acceptance criteria, metrics) instead of writing label blocks verbatim to description.
- GitHub keeps field updates consistent even when refined body contains headings that omit some core field sections.

**Definition of Ready (DoR):**

Expand Down
1 change: 1 addition & 0 deletions openspec/CHANGE_ORDER.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ All entries in the table below are pending implementation.
|--------|-------|---------------|----------|------------|
| backlog-core | 01 | backlog-core-01-dependency-analysis-commands | [#116](https://github.com/nold-ai/specfact-cli/issues/116) | β€” |
| backlog-core | 02 | backlog-core-02-interactive-issue-creation | [#173](https://github.com/nold-ai/specfact-cli/issues/173) | #116 (optional: #176, #177) |
| backlog-core | 03 | backlog-core-03-refine-writeback-field-splitting | #225 | β€” |

### backlog-scrum

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Change Validation Report: backlog-core-03-refine-writeback-field-splitting

**Validation Date**: 2026-02-11T14:31:00+01:00
**Change Proposal**: [proposal.md](./proposal.md)
**Validation Method**: Local static dependency scan + OpenSpec strict validation

## Executive Summary

- Breaking Changes: 0 detected
- Dependent Files Reviewed: 4
- Impact Level: Low
- Validation Result: Pass
- User Decision: Proceed with implementation

## Dependency and Interface Analysis

Reviewed writeback path and parser touch points:

- `src/specfact_cli/modules/backlog/src/commands.py`
- `src/specfact_cli/adapters/ado.py`
- `src/specfact_cli/adapters/github.py`
- `tests/unit/commands/test_backlog_commands.py`
- `tests/unit/adapters/test_github_backlog_adapter.py`

No public CLI signature changes or adapter method signature changes were introduced by this change.

## Impact Assessment

- **Code Impact**: Refinement write path now parses structured response content before writeback.
- **Test Impact**: Added regression coverage for label-style parsing and GitHub fallback behavior.
- **Documentation Impact**: Potential wording updates for refine writeback behavior (tasked in `tasks.md`).
- **Release Impact**: Patch-level bugfix.

## Format Validation

- **proposal.md Format**: Pass
- **tasks.md Format**: Pass
- **spec delta Format**: Pass (Given/When/Then scenarios)
- **Config.yaml Compliance**: Pass

## OpenSpec Validation

- **Status**: Pass
- **Validation Command**: `openspec validate backlog-core-03-refine-writeback-field-splitting --strict`
- **Result**: `Change 'backlog-core-03-refine-writeback-field-splitting' is valid`
- **Notes**: Non-blocking telemetry network errors from PostHog occurred after validation in restricted network environment.

## Refactor Follow-up Validation (2026-02-11)

- `hatch run type-check`: Pass (`0 errors`) after decomposing `refine` command helper flow.
- `hatch test -- tests/unit/commands/test_backlog_commands.py tests/unit/adapters/test_github_backlog_adapter.py tests/unit/adapters/test_ado_backlog_adapter.py -v`: Pass (`64 passed`).
- `hatch run format`: Pass.

## Review Follow-up Validation (2026-02-12)

- `openspec validate backlog-core-03-refine-writeback-field-splitting --strict`: Pass.
- `hatch test -- tests/unit/commands/test_backlog_commands.py -k TestParseRefinementOutputFields -v`: Pass (`3 passed`).
- `hatch test -- tests/unit/adapters/test_ado_backlog_adapter.py tests/unit/adapters/test_github_backlog_adapter.py -v`: Pass (`35 passed`).
- `hatch run type-check`: Pass (`0 errors`, warnings unchanged).
- `hatch run format`: Pass.

## Review Follow-up Validation (Case-Insensitive Heading Match, 2026-02-12)

- `hatch test -- tests/unit/commands/test_backlog_commands.py -k uppercase_heading_style_notes_and_dependencies -v`: Failing pre-implementation evidence captured.
- `hatch test -- tests/unit/commands/test_backlog_commands.py -k TestParseRefinementOutputFields -v`: Pass (`4 passed`) after parser fix.
- `hatch test -- tests/unit/adapters/test_ado_backlog_adapter.py tests/unit/adapters/test_github_backlog_adapter.py -v`: Pass (`35 passed`).

## Review Follow-up Validation (Label-Only Description Fallback, 2026-02-12)

- `hatch test -- tests/unit/commands/test_backlog_commands.py -k label_only_output_without_description -v`: Failing pre-implementation evidence captured.
- `hatch test -- tests/unit/commands/test_backlog_commands.py -k TestParseRefinementOutputFields -v`: Pass (`5 passed`) after parser fix.
- `hatch test -- tests/unit/adapters/test_ado_backlog_adapter.py tests/unit/adapters/test_github_backlog_adapter.py -v`: Pass (`35 passed`).

## Next Steps

1. Complete implementation and tests per `tasks.md`.
2. Run quality gates.
3. Update version/changelog and docs if needed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# TDD Evidence: backlog-core-03-refine-writeback-field-splitting

## Pre-Implementation Failing Run

- **Timestamp**: 2026-02-11T14:30:38+01:00
- **Command**: `hatch test -- tests/unit/commands/test_backlog_commands.py -k parse_refinement_output_fields -v`
- **Result**: Failed (collection error)
- **Failure Summary**:
- `ImportError: cannot import name '_parse_refinement_output_fields'`
- New parser behavior is specified in tests but not implemented yet.

## Post-Implementation Passing Run

- **Timestamp**: 2026-02-11T14:32:52+01:00
- **Command**: `hatch test -- tests/unit/commands/test_backlog_commands.py tests/unit/adapters/test_github_backlog_adapter.py -v`
- **Result**: Passed
- **Summary**:
- `41 passed`
- Includes regression coverage for:
- label-style refinement field parsing
- markdown heading refinement parsing
- GitHub writeback fallback when structured body lacks core field headings.

## Review Follow-up: Heading-Style Narrative Regression

### Pre-Implementation Failing Run

- **Timestamp**: 2026-02-12T10:22:00+01:00
- **Command**: `hatch test -- tests/unit/commands/test_backlog_commands.py -k heading_style_notes_and_dependencies -v`
- **Result**: Failed
- **Failure Summary**:
- `test_preserves_heading_style_notes_and_dependencies_in_body_markdown` failed.
- Parsed `body_markdown` contained only description (`User-facing summary.`) and dropped heading-style `## Notes` section.

### Post-Implementation Passing Run

- **Timestamp**: 2026-02-12T10:24:00+01:00
- **Command**: `hatch test -- tests/unit/commands/test_backlog_commands.py -k TestParseRefinementOutputFields -v`
- **Result**: Passed
- **Summary**:
- `3 passed`
- Includes heading-style preservation regression test for `## Notes` and `## Dependencies`.

## Review Follow-up: Case-Insensitive Heading Matching

### Pre-Implementation Failing Run

- **Timestamp**: 2026-02-12T10:42:00+01:00
- **Command**: `hatch test -- tests/unit/commands/test_backlog_commands.py -k uppercase_heading_style_notes_and_dependencies -v`
- **Result**: Failed
- **Failure Summary**:
- `test_preserves_uppercase_heading_style_notes_and_dependencies_in_body_markdown` failed.
- Parsed `body_markdown` contained only description and dropped uppercase `## NOTES` / `## DEPENDENCIES` narrative sections.

### Post-Implementation Passing Run

- **Timestamp**: 2026-02-12T10:43:00+01:00
- **Command**: `hatch test -- tests/unit/commands/test_backlog_commands.py -k TestParseRefinementOutputFields -v`
- **Result**: Passed
- **Summary**:
- `4 passed`
- Includes uppercase heading regression coverage for `## NOTES` and `## DEPENDENCIES`.

## Review Follow-up: Label-Only Output Without Description

### Pre-Implementation Failing Run

- **Timestamp**: 2026-02-12T10:49:00+01:00
- **Command**: `hatch test -- tests/unit/commands/test_backlog_commands.py -k label_only_output_without_description -v`
- **Result**: Failed
- **Failure Summary**:
- `test_label_only_output_without_description_does_not_fallback_to_raw_payload` failed.
- Parser retained the full raw label payload as fallback `description` and `body_markdown` when no `Description:` block existed.

### Post-Implementation Passing Run

- **Timestamp**: 2026-02-12T10:50:00+01:00
- **Command**: `hatch test -- tests/unit/commands/test_backlog_commands.py -k TestParseRefinementOutputFields -v`
- **Result**: Passed
- **Summary**:
- `5 passed`
- Includes regression coverage for label-only field blocks without `Description:`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Change: Backlog Refine Writeback Field Splitting for ADO/GitHub

## Why


`specfact backlog refine --write` currently applies the raw copilot response as `body_markdown` and does not parse structured refinement output back into canonical fields before adapter writeback. For Azure DevOps this causes `System.Description` to receive a verbatim payload containing labels like `Description`, `Acceptance Criteria`, `Story Points`, `Business Value`, `Priority`, `Area Path`, and provider markers instead of updating separate fields. GitHub can exhibit the same issue when copilot output uses label-style sections instead of markdown headings.

This breaks the provider-aware contract implied by refinement prompts and produces low-quality remote item updates.

## What Changes


- **MODIFY**: Backlog refine write path to parse structured refinement content into canonical fields (`description`, `acceptance_criteria`, `story_points`, `business_value`, `priority`, `work_item_type`) before writeback.
- **MODIFY**: Normalize label-style refinement output to canonical markdown sections so both ADO and GitHub writeback paths behave deterministically.
- **MODIFY**: ADO/GitHub writeback behavior to prefer parsed refined values over stale pre-refinement values when `--write` is used.
- **MODIFY**: Refactor `backlog refine` orchestration in `commands.py` into smaller helper methods (initialization, export/import handling, writeback/comment flow) to reduce command-function complexity and improve readability.
- **ADD**: Regression tests for ADO and GitHub writeback from label-style refinement output.

## Capabilities
- **backlog-refinement**: Provider-aware parsing and canonical field splitting for `specfact backlog refine --write`.

---

## Source Tracking

<!-- source_repo: nold-ai/specfact-cli -->
- **GitHub Issue**: #225
- **Issue URL**: <https://github.com/nold-ai/specfact-cli/issues/225>
- **Last Synced Status**: proposed
- **Sanitized**: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## MODIFIED Requirements

### Requirement: AI Refinement Writeback Preserves Provider Field Semantics

The system SHALL parse structured refinement output into canonical fields before provider writeback so provider-specific fields are updated correctly rather than storing prompt labels verbatim in description/body.

#### Scenario: ADO writeback splits label-style refined output into canonical fields

- **GIVEN** a user runs `specfact backlog refine ado --write`
- **AND** the refined output uses label-style sections such as `Description:`, `Acceptance Criteria:`, `Story Points:`, `Business Value:`, and `Priority:`
- **WHEN** the refinement is accepted
- **THEN** SpecFact parses those sections into canonical fields
- **AND** writes `description` content to ADO description field
- **AND** writes `acceptance_criteria`, `story_points`, `business_value`, and `priority` to their mapped ADO fields when present
- **AND** does not write the entire labeled structure verbatim as ADO description.

#### Scenario: GitHub writeback normalizes label-style refined output to structured markdown

- **GIVEN** a user runs `specfact backlog refine github --write`
- **AND** the refined output uses label-style sections rather than markdown headings
- **WHEN** the refinement is accepted
- **THEN** SpecFact normalizes the output into canonical markdown sections
- **AND** updates issue body and related canonical fields consistently
- **AND** avoids duplicating or flattening structured fields into a single unparsed description block.

#### Scenario: Heading-style narrative sections are preserved during writeback parsing

- **GIVEN** a user runs `specfact backlog refine <provider> --write`
- **AND** the refined output uses markdown headings like `## Notes` and `## Dependencies`
- **WHEN** the refinement output is parsed into canonical fields for writeback
- **THEN** `body_markdown` keeps those narrative sections
- **AND** canonical numeric/provider metadata sections (for example `## Story Points`, `## Business Value`, `## Priority`, `## Provider`) are not duplicated into narrative body text.

#### Scenario: Heading-style narrative sections are matched case-insensitively

- **GIVEN** a user runs `specfact backlog refine <provider> --write`
- **AND** the refined output uses uppercase narrative headings like `## NOTES` and `## DEPENDENCIES`
- **WHEN** the refinement output is parsed into canonical fields for writeback
- **THEN** `body_markdown` preserves those narrative sections as normalized `## Notes` / `## Dependencies` sections
- **AND** writeback does not silently drop narrative context because of heading case differences.

#### Scenario: Label-only field blocks without Description do not leak raw labels into body/description

- **GIVEN** a user runs `specfact backlog refine <provider> --write`
- **AND** the refined output contains label-style field blocks (for example `Acceptance Criteria:`, `Story Points:`, `Priority:`) but no `Description:` block
- **WHEN** the refinement output is parsed into canonical fields for writeback
- **THEN** canonical fields (for example acceptance criteria and numeric fields) are extracted
- **AND** parser fallback does not keep the entire raw labeled payload as `description`
- **AND** `body_markdown` does not contain prompt labels verbatim.

#### Scenario: Refine command orchestration remains behaviorally consistent after decomposition

- **GIVEN** `specfact backlog refine` supports initialization, filtering, export/import, interactive refinement, writeback, and summary flows
- **WHEN** the command implementation is decomposed into smaller helper methods
- **THEN** observable CLI behavior and writeback semantics remain unchanged for equivalent inputs
- **AND** command complexity in the top-level `refine` function is reduced to keep the implementation readable and maintainable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Tasks: Backlog Refine Writeback Field Splitting for ADO/GitHub

## 1. Git Workflow

- [x] 1.1 Create git branch `bugfix/backlog-refine-writeback-field-splitting` from `dev`

## 2. Spec Deltas

- [x] 2.1 Add/modify `backlog-refinement` spec scenarios for provider-aware writeback field splitting
- [x] 2.2 Run `openspec validate backlog-core-03-refine-writeback-field-splitting --strict`

## 3. Tests First (TDD)

- [x] 3.1 Add tests for label-style refined output parsing into canonical fields
- [x] 3.2 Add ADO writeback regression test: structured output does not get written verbatim to description
- [x] 3.3 Add GitHub writeback regression test for label-style output normalization
- [x] 3.4 Run targeted tests and capture failing evidence in `openspec/changes/backlog-core-03-refine-writeback-field-splitting/TDD_EVIDENCE.md`

## 4. Implementation

- [x] 4.1 Implement refinement output parser integration in `backlog refine --write` flow
- [x] 4.2 Ensure parsed canonical fields are applied before adapter update calls
- [x] 4.3 Add adapter-safe fallback handling for structured label output where needed
- [x] 4.4 Run targeted tests and capture passing evidence in `openspec/changes/backlog-core-03-refine-writeback-field-splitting/TDD_EVIDENCE.md`
- [x] 4.5 Refactor `refine` command into smaller helper methods with clear responsibilities
- [x] 4.6 Keep behavior parity for export/import/write/preview flows after refactor
- [x] 4.7 Preserve heading-style `## Notes` / `## Dependencies` sections in parsed `body_markdown` for writeback
- [x] 4.8 Match heading-style `## Notes` / `## Dependencies` sections case-insensitively during parser writeback normalization
- [x] 4.9 Prevent label-only refinement output (without `Description:`) from leaking raw prompt labels into fallback description/body fields

## 5. Quality Gates

- [x] 5.1 `hatch run format`
- [x] 5.2 `hatch run type-check`
- [x] 5.3 `hatch run contract-test`
- [x] 5.4 `hatch run smart-test`

## 6. Documentation and Release Hygiene

- [x] 6.1 Review and update docs for backlog refine writeback behavior (if needed)
- [x] 6.2 Bump patch version and sync: `pyproject.toml`, `setup.py`, `src/specfact_cli/__init__.py`
- [x] 6.3 Update `CHANGELOG.md` with bugfix entry

## 7. Pull Request

- [ ] 7.1 Push branch and open PR to `dev`
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "specfact-cli"
version = "0.30.2"
version = "0.30.3"
description = "The swiss knife CLI for agile DevOps teams. Keep backlog, specs, tests, and code in sync with validation and contract enforcement for new projects and long-lived codebases."
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if __name__ == "__main__":
_setup = setup(
name="specfact-cli",
version="0.30.2",
version="0.30.3",
description=(
"The swiss knife CLI for agile DevOps teams. Keep backlog, specs, tests, and code in sync with "
"validation and contract enforcement for new projects and long-lived codebases."
Expand Down
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""

# Package version: keep in sync with pyproject.toml, setup.py, src/specfact_cli/__init__.py
__version__ = "0.30.1"
__version__ = "0.30.3"
2 changes: 1 addition & 1 deletion src/specfact_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
- Supporting agile ceremonies and team workflows
"""

__version__ = "0.30.2"
__version__ = "0.30.3"

__all__ = ["__version__"]
Loading
Loading