Skip to content

Commit c2a02ea

Browse files
djm81cursoragent
andauthored
Merge dev into main - v0.26.8 release (#146)
* perf: optimize startup performance with metadata tracking and update command (#142) * feat: implement backlog field mapping and refinement improvements - Add FieldMapper abstract base class with canonical field names - Implement GitHubFieldMapper and AdoFieldMapper - Add custom field mapping support with YAML templates - Add field validation in refinement (story_points, business_value, priority) - Add comprehensive unit and integration tests (42 tests) - Add custom field mapping documentation - Fix custom_field_mapping parameter connection - Add early validation for custom mapping files Implements OpenSpec change: improve-backlog-field-mapping-and-refinement * perf: optimize startup performance with metadata tracking and update command - Add metadata management module for tracking version and check timestamps - Optimize startup checks to only run when needed: - Template checks: Only after version changes detected - Version checks: Limited to once per day (24h threshold) - Add --skip-checks flag for CI/CD environments - Add new 'specfact update' command for manual update checking and installation - Add comprehensive unit and integration tests (35 tests, all passing) - Update startup_checks to use metadata for conditional execution - Ensure backward compatibility (first-time users still get all checks) Performance Impact: - Startup time: Reduced from several seconds to < 1-2 seconds - Network requests: Reduced from every startup to once per day - File system operations: Reduced from every startup to only after version changes Fixes #140 Implements OpenSpec change: optimize-startup-performance * feat: request offline_access scope for Azure DevOps refresh tokens - Add offline_access scope to Azure DevOps OAuth requests - Refresh tokens now last 90 days (vs 1 hour for access tokens) - Automatic token refresh via persistent cache (no re-authentication needed) - Update documentation to reflect 90-day refresh token lifetime This addresses the issue where tokens were expiring too quickly. Refresh tokens obtained via offline_access scope enable automatic token renewal for 90 days without user interaction. Fixes token lifetime limitation issue * feat: improve CLI UX with banner control and upgrade command - Change banner to hidden by default, shown on first run or with --banner flag - Add simple version line (SpecFact CLI - vXYZ) for regular use - Rename 'update' command to 'upgrade' to avoid confusion - Update documentation for new banner behavior and upgrade command - Update startup checks message to reference 'specfact upgrade' * fix: suppress version line in test mode and fix field mapping issues - Suppress version line output in test mode and for help/version commands to prevent test failures - Fix ADO custom field mapping to honor --custom-field-mapping on writeback - Fix GitHub issue body updates to prevent duplicate sections - Ensure proper type handling for story points and business value calculations * Fix failed tests * chore: bump version to 0.26.7 and update changelog - Fixed adapter token validation tests (ADO and GitHub) - Resolved test timeout issues (commit history, AST parsing, Semgrep) - Improved test file discovery to exclude virtual environments - Added file size limits for AST parsing to prevent timeouts --------- Co-authored-by: Dominikus Nold <[email protected]> * fix: add missing ADO field mappings and assignee display (#145) * fix: add missing ADO field mappings and assignee display - Add Microsoft.VSTS.Common.AcceptanceCriteria to default field mappings - Update AdoFieldMapper to support multiple field name alternatives - Fix assignee extraction to include displayName, uniqueName, and mail - Add assignee display in preview output - Add interactive template mapping command (specfact backlog map-fields) - Update specfact init to copy backlog field mapping templates - Extend documentation with step-by-step guides Fixes #144 * test: add unit tests for ADO field mapping and assignee fixes - Add tests for Microsoft.VSTS.Common.AcceptanceCriteria field extraction - Add tests for multiple field name alternatives - Add tests for assignee extraction with displayName, uniqueName, mail - Add tests for assignee filtering with multiple identifiers - Add tests for assignee display in preview output - Add tests for interactive mapping command - Add tests for template copying in init command - Update existing tests to match new assignee extraction behavior * docs: update init command docstring to mention template copying * docs: update documentation for ADO field mapping and interactive mapping features - Update authentication guide with ADO token resolution priority - Update custom field mapping guide with interactive mapping details - Update backlog refinement guide with progress indicators and required field display - Update Azure DevOps adapter guide with field mapping improvements - Update command reference with map-fields command documentation - Update troubleshooting guide with ADO-specific issues - Update README files with new features - Update getting started guide with template initialization Co-authored-by: Cursor <[email protected]> * fix: address review findings for ADO field mapping - Prefer System.* fields over Microsoft.VSTS.Common.* when writing updates (fixes issue where PATCH requests could fail for Scrum templates) - Preserve existing work_item_type_mappings when saving field mappings (prevents silent erasure of custom work item type mappings) Fixes review comments: - P1: Prefer System.AcceptanceCriteria when writing updates - P2: Preserve existing work_item_type_mappings on save Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Dominikus Nold <[email protected]> Co-authored-by: Cursor <[email protected]> * Fix review findings on mappings --------- Co-authored-by: Dominikus Nold <[email protected]> Co-authored-by: Cursor <[email protected]>
1 parent c4cd5de commit c2a02ea

36 files changed

+2615
-138
lines changed

CHANGELOG.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,89 @@ All notable changes to this project will be documented in this file.
99

1010
---
1111

12+
## [0.26.8] - 2026-01-27
13+
14+
### Fixed (0.26.8)
15+
16+
- **ADO Field Mapping - Acceptance Criteria**: Fixed missing Acceptance Criteria field in backlog refinement output for Azure DevOps
17+
- **Root Cause**: Default field mappings used `System.AcceptanceCriteria`, but ADO API returns `Microsoft.VSTS.Common.AcceptanceCriteria` for many process templates
18+
- **Solution**: Added `Microsoft.VSTS.Common.AcceptanceCriteria` as alternative mapping for `acceptance_criteria` canonical field (backward compatible with `System.AcceptanceCriteria`)
19+
- **Impact**: Acceptance criteria now properly extracted and displayed in `specfact backlog refine` preview output
20+
- **Templates Updated**: All default ADO field mapping templates (`ado_default.yaml`, `ado_scrum.yaml`, `ado_agile.yaml`, `ado_safe.yaml`, `ado_kanban.yaml`) updated with alternative field mappings
21+
22+
- **ADO Field Mapping - Assignee Display**: Fixed missing assignee information in backlog refinement preview output
23+
- **Root Cause**: Assignee was extracted from ADO work items but not displayed in preview output
24+
- **Solution**: Added assignee display to preview output showing all assignees or "Unassigned" status
25+
- **Impact**: Users can now see assignee information in preview mode and filter by assignee
26+
27+
- **ADO Assignee Extraction**: Improved assignee extraction from ADO `System.AssignedTo` object
28+
- **Enhanced Logic**: Now extracts `displayName`, `uniqueName`, and `mail` fields from ADO assignee object
29+
- **Deduplication**: Filters out empty strings and duplicate assignee identifiers
30+
- **Priority**: Prioritizes `displayName` over `uniqueName` for better user experience
31+
- **Impact**: More reliable assignee extraction and filtering across different ADO configurations
32+
33+
### Added (0.26.8)
34+
35+
- **Interactive Field Mapping Command**: Added `specfact backlog map-fields` command for guided ADO field mapping
36+
- **Purpose**: Helps users discover available ADO fields and map them to canonical field names interactively
37+
- **Features**:
38+
- Fetches live ADO fields from API (`_apis/wit/fields` endpoint)
39+
- Filters out system-only fields (e.g., `System.Id`, `System.Rev`)
40+
- Interactive selection of ADO fields for each canonical field (description, acceptance_criteria, story_points, business_value, priority, work_item_type)
41+
- Supports multiple field alternatives for same canonical field
42+
- Validates mappings before saving
43+
- Saves to `.specfact/templates/backlog/field_mappings/ado_custom.yaml` (per-project configuration)
44+
- **Usage**: `specfact backlog map-fields --ado-org <org> --ado-project <project> --ado-token <token>`
45+
- **Benefits**: Eliminates need for manual YAML creation and API exploration for custom ADO process templates
46+
47+
- **Template Initialization in `specfact init`**: Extended `specfact init` command to copy backlog field mapping templates
48+
- **New Behavior**: Automatically creates `.specfact/templates/backlog/field_mappings/` directory during initialization
49+
- **Templates Copied**: Copies all default ADO field mapping templates (`ado_default.yaml`, `ado_scrum.yaml`, `ado_agile.yaml`, `ado_safe.yaml`, `ado_kanban.yaml`) from `resources/templates/backlog/field_mappings/`
50+
- **Smart Copying**: Skips existing files unless `--force` flag is used
51+
- **User Benefit**: Users can review and modify templates directly in their project after initialization
52+
53+
### Changed (0.26.8)
54+
55+
- **AdoFieldMapper Field Extraction**: Enhanced `_extract_field()` method to support multiple field name alternatives
56+
- **Behavior**: Now checks all alternative ADO field names that map to the same canonical field
57+
- **Backward Compatibility**: Existing mappings continue to work (e.g., `System.AcceptanceCriteria` still supported)
58+
- **Flexibility**: Supports custom ADO process templates with different field naming conventions
59+
60+
- **Backlog Filtering - Assignee**: Improved assignee filtering logic in `specfact backlog refine`
61+
- **Enhanced Matching**: Now matches against `displayName`, `uniqueName`, and `mail` fields (case-insensitive)
62+
- **Robustness**: Handles empty assignee fields and unassigned items correctly
63+
- **User Experience**: More reliable filtering when using `--assignee` filter option
64+
65+
### Documentation (0.26.8)
66+
67+
- **Custom Field Mapping Guide**: Extensively updated `docs/guides/custom-field-mapping.md`
68+
- **New Section**: "Discovering Available ADO Fields" with API endpoint instructions
69+
- **New Section**: "Using Interactive Mapping Command (Recommended)" with step-by-step instructions
70+
- **Enhanced Section**: "Manually Creating Field Mapping Files" with YAML schema reference and examples
71+
- **Updated Section**: "Default Field Mappings" to mention multiple field alternatives
72+
- **New Section**: "Troubleshooting" covering common issues (fields not extracted, mappings not applied, interactive mapping failures)
73+
74+
- **Backlog Refinement Guide**: Updated `docs/guides/backlog-refinement.md`
75+
- **Preview Mode Section**: Explicitly states that assignee information and acceptance criteria are now displayed
76+
- **Filtering Section**: Enhanced assignee filtering documentation
77+
78+
### Testing (0.26.8)
79+
80+
- **Unit Tests**: Added comprehensive unit tests for new and modified functionality
81+
- **AdoFieldMapper**: Tests for multiple field alternatives, backward compatibility
82+
- **Converter**: Tests for assignee extraction (displayName, uniqueName, mail, combinations, unassigned)
83+
- **Backlog Commands**: Tests for assignee display, interactive mapping command, field fetching, system field filtering
84+
- **Backlog Filtering**: Tests for assignee filtering (case-insensitive matching, unassigned items)
85+
- **Init Command**: E2E tests for template copying, skipping existing files, force overwrite
86+
87+
- **Test Coverage**: Maintained ≥80% test coverage with all new features fully tested
88+
89+
### Related Issues
90+
91+
- **GitHub Issue #144**: Fixed missing Acceptance Criteria and Assignee fields in ADO backlog refinement output
92+
93+
---
94+
1295
## [0.26.7] - 2026-01-27
1396

1497
### Fixed (0.26.7)

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,26 @@ specfact validate sidecar run my-project /path/to/repo
173173
- **Agile/scrum ready** - DoR checklists, story points, dependencies
174174
- **Backlog standardization** 🆕 - Template-driven refinement with persona/framework filtering
175175
- **Sprint/iteration filtering** 🆕 - Filter by sprint, release, iteration for agile workflows
176+
- **Interactive field mapping** 🆕 - Discover and map Azure DevOps fields with arrow-key navigation
177+
- **Azure DevOps integration** 🆕 - Full support for ADO work items with automatic token resolution
176178

177179
👉 **[Agile/Scrum Workflows](docs/guides/agile-scrum-workflows.md)** - Team collaboration guide
178-
👉 **[Backlog Refinement](docs/guides/backlog-refinement.md)** 🆕 - Standardize backlog items with templates
180+
👉 **[Backlog Refinement](docs/guides/backlog-refinement.md)** 🆕 - Standardize backlog items with templates
181+
👉 **[Custom Field Mapping](docs/guides/custom-field-mapping.md)** 🆕 - Map ADO fields interactively
179182

180183
### 🔌 Integrations
181184

182185
- **VS Code, Cursor** - Catch bugs before you commit
183186
- **GitHub Actions** - Automated quality gates
184187
- **AI IDEs** - Generate prompts for fixing gaps
185-
- **DevOps tools** - Sync with GitHub Issues, Linear, Jira
188+
- **DevOps tools** - Sync with GitHub Issues, Azure DevOps, Linear, Jira
186189
- **Backlog Refinement** 🆕 - AI-assisted template-driven refinement for standardizing work items
190+
- **Azure DevOps field mapping** 🆕 - Interactive field discovery and mapping for custom ADO process templates
187191
- **Spec-Kit, OpenSpec, Specmatic** - Works with your existing tools
188192

189193
👉 **[Integrations Overview](docs/guides/integrations-overview.md)** - All integration options
190-
👉 **[Backlog Refinement Guide](docs/guides/backlog-refinement.md)** 🆕 **NEW** - Template-driven backlog standardization
194+
👉 **[Backlog Refinement Guide](docs/guides/backlog-refinement.md)** 🆕 **NEW** - Template-driven backlog standardization
195+
👉 **[Custom Field Mapping](docs/guides/custom-field-mapping.md)** 🆕 **NEW** - Interactive ADO field mapping
191196

192197
---
193198

@@ -252,8 +257,9 @@ specfact validate sidecar run my-project /path/to/repo
252257
- **[Spec-Kit Journey](docs/guides/speckit-journey.md)** - From Spec-Kit to SpecFact
253258
- **[OpenSpec Journey](docs/guides/openspec-journey.md)** - OpenSpec integration
254259
- **[Specmatic Integration](docs/guides/specmatic-integration.md)** - API contract testing
255-
- **[DevOps Adapter Integration](docs/guides/devops-adapter-integration.md)** - GitHub Issues, Linear, Jira
260+
- **[DevOps Adapter Integration](docs/guides/devops-adapter-integration.md)** - GitHub Issues, Azure DevOps, Linear, Jira
256261
- **[Backlog Refinement](docs/guides/backlog-refinement.md)** 🆕 **NEW** - AI-assisted template-driven backlog standardization
262+
- **[Custom Field Mapping](docs/guides/custom-field-mapping.md)** 🆕 **NEW** - Interactive Azure DevOps field mapping
257263

258264
👉 **[Full Documentation Index](docs/README.md)** - Browse all documentation
259265
👉 **[Online Documentation](https://docs.specfact.io/)** - Complete documentation site

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ SpecFact isn't just a technical tool—it's designed for **real-world agile/scru
3838
-**Team collaboration** → Spec-Kit is single-user focused; SpecFact supports persona-based workflows for agile teams
3939
-**DevOps integration** 🆕 → **Bidirectional backlog sync** - Sync change proposals to GitHub Issues and Azure DevOps Work Items (and future: Linear, Jira) with automatic progress tracking
4040
-**Backlog refinement** 🆕 → **Template-driven standardization** - Transform arbitrary DevOps backlog input into structured, template-compliant work items with AI assistance, persona/framework filtering, and sprint/iteration support
41+
-**Interactive field mapping** 🆕 → **Azure DevOps field discovery** - Discover and map ADO fields interactively with arrow-key navigation, automatic default pre-population, and fuzzy matching
4142
-**Definition of Ready (DoR)** 🆕 → **Sprint readiness validation** - Check DoR rules before adding items to sprints, with repo-level configuration
4243
-**GitHub Actions integration** → Works seamlessly with your existing GitHub workflows
4344

@@ -188,6 +189,7 @@ specfact enforce sdd --bundle my-project
188189
- [OpenSpec Journey](guides/openspec-journey.md) 🆕 - OpenSpec integration with SpecFact (DevOps export ✅, bridge adapter ✅)
189190
- [DevOps Adapter Integration](guides/devops-adapter-integration.md) 🆕 **NEW FEATURE** - Bidirectional GitHub Issues sync, automatic progress tracking, and agile DevOps workflow integration
190191
- [Backlog Refinement](guides/backlog-refinement.md) 🆕 **NEW FEATURE** - AI-assisted template-driven refinement for standardizing work items with persona/framework filtering, sprint/iteration support, and DoR validation
192+
- [Custom Field Mapping](guides/custom-field-mapping.md) 🆕 **NEW FEATURE** - Interactive Azure DevOps field discovery and mapping with arrow-key navigation
191193
- [Bridge Adapters](reference/commands.md#sync-bridge) - OpenSpec and DevOps integration
192194

193195
#### Team Collaboration & Agile/Scrum

docs/adapters/azuredevops.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,64 @@ external_base_path: ../openspec-repo # Optional: cross-repo support
9090
9191
**Note**: Organization, project, and API token are **not** stored in bridge config for security. They must be provided via CLI flags or environment variables.
9292
93+
### Field Mapping
94+
95+
The adapter supports flexible field mapping to handle different ADO process templates:
96+
97+
- **Multiple Field Alternatives**: Supports multiple ADO field names mapping to the same canonical field (e.g., both `System.AcceptanceCriteria` and `Microsoft.VSTS.Common.AcceptanceCriteria` map to `acceptance_criteria`)
98+
- **Default Mappings**: Includes default mappings for common ADO fields (Scrum, Agile, SAFe, Kanban)
99+
- **Custom Mappings**: Supports per-project custom field mappings via `.specfact/templates/backlog/field_mappings/ado_custom.yaml`
100+
- **Interactive Mapping**: Use `specfact backlog map-fields` to interactively discover and map ADO fields for your project
101+
102+
**Interactive Field Mapping Command**:
103+
104+
```bash
105+
# Discover and map ADO fields interactively
106+
specfact backlog map-fields --ado-org myorg --ado-project myproject
107+
```
108+
109+
This command:
110+
111+
- Fetches available fields from your ADO project
112+
- Pre-populates default mappings
113+
- Uses arrow-key navigation for field selection
114+
- Saves mappings to `.specfact/templates/backlog/field_mappings/ado_custom.yaml`
115+
- Automatically used by all subsequent backlog operations
116+
117+
See [Custom Field Mapping Guide](../guides/custom-field-mapping.md) for complete documentation.
118+
119+
### Assignee Extraction and Display
120+
121+
The adapter extracts assignee information from ADO work items:
122+
123+
- **Extraction**: Assignees are extracted from `System.AssignedTo` field
124+
- **Display**: Assignees are always displayed in backlog refinement preview output
125+
- **Format**: Shows assignee names or "Unassigned" if no assignee
126+
- **Preservation**: Assignee information is preserved during refinement and sync operations
127+
93128
### Authentication
94129

95130
The adapter supports multiple authentication methods (in order of precedence):
96131

97132
1. **Explicit token**: `api_token` parameter or `--ado-token` CLI flag
98133
2. **Environment variable**: `AZURE_DEVOPS_TOKEN` (also accepts `ADO_TOKEN` or `AZURE_DEVOPS_PAT`)
99-
3. **Stored auth token**: `specfact auth azure-devops` (device code flow)
134+
3. **Stored auth token**: `specfact auth azure-devops` (device code flow or PAT token)
135+
136+
**Token Resolution Priority**:
137+
138+
When using ADO commands, tokens are resolved in this order:
139+
140+
1. Explicit `--ado-token` parameter
141+
2. `AZURE_DEVOPS_TOKEN` environment variable
142+
3. Stored token via `specfact auth azure-devops`
143+
4. Expired stored token (shows warning with options to refresh)
144+
145+
**Token Types**:
146+
147+
- **OAuth Tokens**: Device code flow, expire after ~1 hour, automatically refreshed when possible
148+
- **PAT Tokens**: Personal Access Tokens, can last up to 1 year, recommended for automation
149+
150+
See [Authentication Guide](../reference/authentication.md) for complete documentation.
100151

101152
**Example:**
102153

@@ -368,6 +419,7 @@ The adapter uses a three-level matching strategy to prevent duplicate work items
368419
3. **Org-only match**: For ADO, match by organization only when project names differ
369420

370421
This handles cases where:
422+
371423
- ADO URLs contain GUIDs instead of project names (e.g., `dominikusnold/69b5d0c2-2400-470d-b937-b5205503a679`)
372424
- Project names change but organization stays the same
373425
- Work items are synced across different projects in the same organization

docs/getting-started/first-steps.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ cd /path/to/your/project
4747
# Step 3: Initialize IDE integration (one-time)
4848
specfact init
4949

50+
# This creates:
51+
# - .specfact/ directory structure
52+
# - .specfact/templates/backlog/field_mappings/ with default ADO field mapping templates
53+
# - IDE-specific command files for your AI assistant
54+
5055
# Step 4: Use slash command in IDE chat
5156
/specfact.01-import legacy-api --repo .
5257
# Or let the AI assistant prompt you for bundle name
@@ -168,6 +173,7 @@ specfact plan init my-project --interactive
168173
- Creates `.specfact/` directory structure
169174
- Prompts you for project title and description
170175
- Creates modular project bundle at `.specfact/projects/my-project/`
176+
- Copies default ADO field mapping templates to `.specfact/templates/backlog/field_mappings/` for review and customization
171177

172178
**Example output**:
173179

0 commit comments

Comments
 (0)