Skip to content

Commit 4c7b5ef

Browse files
djm81cursoragentgithub-code-quality[bot]claude
authored
docs: add CLI end-user validation change proposals (cli-val-01 through 06) (#286)
* 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 <djm81@users.noreply.github.com> * 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 <cursoragent@cursor.com> * 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 <cursoragent@cursor.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * fix: mitigate code scanning vulnerabilities (#148) * fix: mitigate code scanning vulnerabilities - Fix ReDoS vulnerability in github_mapper.py by replacing regex with line-by-line processing - Fix incomplete URL sanitization in github.py, bridge_sync.py, and ado.py using proper URL parsing - Add explicit permissions blocks to 7 GitHub Actions jobs following least-privilege model Resolves all 13 code scanning findings: - 1 ReDoS error - 5 URL sanitization warnings - 7 missing workflow permissions warnings Fixes #147 Co-authored-by: Cursor <cursoragent@cursor.com> * fix: accept GitHub SSH host aliases in repo detection Accept ssh.github.com (port 443) in addition to github.com when detecting GitHub repositories via SSH remotes. This ensures repositories using git@ssh.github.com:owner/repo.git are properly detected as GitHub repos. Addresses review feedback on PR #148 Co-authored-by: Cursor <cursoragent@cursor.com> * fix: prevent async cleanup issues in test mode Remove manual Live display cleanup that could cause EOFError. The _safe_progress_display function already handles test mode by skipping progress display, so direct save path is sufficient. Fixes test_unlock_section failure with EOFError/ValueError. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * fix: detect GitHub remotes using ssh:// and git:// URLs Extend URL pattern matching to support ssh://git@github.com/owner/repo.git and git://github.com/owner/repo.git formats in addition to existing https?:// and scp-style git@host:path URLs. This fixes a regression where these valid GitHub URL formats were not detected, causing detect() to return false for repos using these schemes. Addresses review feedback on PR #149 Co-authored-by: Cursor <cursoragent@cursor.com> * chore: bump version to 0.26.9 and update changelog - Update version from 0.26.8 to 0.26.9 - Add changelog entry for GitHub remote detection fix and code scanning fixes Co-authored-by: Cursor <cursoragent@cursor.com> * fix: compare GitHub SSH hostnames case-insensitively Lowercase host_part before comparison to handle mixed-case hostnames like git@GitHub.com:org/repo.git. This restores the case-insensitive behavior from the previous config_content.lower() check and prevents regression where valid GitHub repos with mixed-case hostnames would not be detected. Addresses review feedback on PR #150 Co-authored-by: Cursor <cursoragent@cursor.com> * Add openspec and workflow commands for transparency * Add specs from openspec * Remove aisp change which wasn't implemented * Fix openspec gitignore pattern * Update gitignore * Update contribution standards to use openspec for SDD * Migrate to new opsx openspec commands * Migrate workflow and openspec config * fix: bump version to 0.26.10 for PyPI publish - Sync version across pyproject.toml, setup.py, src/__init__.py, src/specfact_cli/__init__.py - Add CHANGELOG entry for 0.26.10 (fixes incorrect version publish issue) Co-authored-by: Cursor <cursoragent@cursor.com> * Update version and changelog * Add canonical user-friendly workitem url for ado workitems * Update to support OSPX * feat(backlog): implement refine --import-from-tmp and fix type-check (#156) * feat(backlog): implement --import-from-tmp for refine export/import round-trip - Add _parse_refined_export_markdown() to parse export-format markdown (ID, Body, Acceptance Criteria, optional title/metrics) - Import branch: read file, match by ID, update items; --write calls adapter.update_backlog_item() - Remove 'Import functionality pending implementation' message - Unit tests for parser (single item, AC/metrics, header-only, blocks without ID) - Bump version to 0.26.11 and sync across pyproject.toml, setup.py, src/__init__.py, src/specfact_cli/__init__.py - OpenSpec change: implement-backlog-refine-import-from-tmp (proposal, tasks, spec delta) Fixes #155 Co-authored-by: Cursor <cursoragent@cursor.com> * Fix type check issues --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * feat: debug logs under ~/.specfact/logs and release 0.26.13 (#159) * feat: add debug logs under ~/.specfact/logs with operation metadata - User-level log dir: get_specfact_home_logs_dir() (~/.specfact/logs, 0o755) - debug_print() routes to console and rotating specfact-debug.log when --debug - debug_log_operation() for structured metadata (ADO, GitHub, backlog, init) - CLI init_debug_log_file() when --debug; help text updated Closes #158 OpenSpec change: add-debug-logs-specfact-home Co-authored-by: Cursor <cursoragent@cursor.com> * Add debug logging for selected commands at first * release: 0.26.13 - debug log parity for upgrade, versions and changelog - Log upgrade success (up to date) to ~/.specfact/logs/specfact-debug.log - Bump version to 0.26.13; sync pyproject.toml, setup.py, src/__init__.py, specfact_cli/__init__.py - CHANGELOG: 0.26.13 Fixed entry for upgrade debug parity Co-authored-by: Cursor <cursoragent@cursor.com> * Remove pr markdown --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * Potential fix for pull request finding 'Empty except' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * Fix unused variable review * Fix unused variable review * Fix type and test errors * Finalize change * Change for debug logs archived * fix: improve ADO backlog refine error logging and user-facing error UX (#164) * Improving error logging capabilities * small fix on changelog * Archived change --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat: backlog refine --ignore-refined and --id, startup docs (fixes #166) (#167) * feat: backlog refine --ignore-refined and --id, startup docs (fixes #166) OpenSpec change: improve-backlog-refine-and-cli-startup. Adds --ignore-refined/--no-ignore-refined, --id <issue-id>; helper _item_needs_refinement; interactive refinement prompt section; version 0.26.15. * Add change for this branch and improve change create workflow * Improve refinement prompt and add specification feedback, update docs and add backlog refinement tutorial * Fix spec update and tasks * Improve pr orchestrator pipeline triggers --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add change proposals for full scrum support * Add support for systematic, structured issue creation with copilot help * feat(backlog): daily standup defaults, iteration/sprint, unassigned items view (#174) * Issue 179 resolution (#180) * fix(backlog): address CodeQL/Codex PR 181 findings - Replace empty except with debug_log_operation in _load_standup_config and _load_backlog_config (correct signature: operation, target, status, error) - Add dim console message in sprint end date parse except block - Gate summarize prompt description/comments on --comments; add include_comments to _build_summarize_prompt_content and call site - Add test for metadata-only summarize when include_comments=False; update existing test to pass include_comments=True Co-authored-by: Cursor <cursoragent@cursor.com> * Update openspec enforcement rules * Structure openspec changes * Fix ruff finding * Fix linter issues with StrEnum and parameters * Fix tests and depcreation warnings * Improve sync script * Add change for modular command registry * Fix review finding on dev sync script * Update modular change proposal * feat: CLI modular command registry and lazy load (arch-01) (#196) * feat: CLI modular command registry and lazy load (arch-01) Co-authored-by: Cursor <cursoragent@cursor.com> * Add missing exports * Fix lazy loading review findigns * Removed example package and fixed tests * Fix test failures and lazy load logic for modules * Fix tests --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * docs: document CLI modules design; sync version and cleanup - Add Modules design section to architecture (registry, module packages, state) - Update module structure tree with registry/ and modules/ - Cross-reference directory-structure to architecture#modules-design - Changelog, version, and project file updates; remove obsolete commands/prompts Co-authored-by: Cursor <cursoragent@cursor.com> * Archive modular change and specs * Fix banner display on help screen * Improve action runner on main * Setup claude skills and instructions * feat: module package separation for command implementations (#200) * feat: separate module package command implementations * docs: finalize openspec apply checklist for arch-02 * Archived arch-02 change and updated specs * fix: restore plan sync shared compatibility import --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: address CodeQL and Codex review findings from PR #201 - Fix unreachable code in contract init (Prompt.ask after raise typer.Exit) - Replace empty except with print_warning for contract file load failures - Fix repo-root fallback path depth in backlog commands after module migration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: module lifecycle management, init split, and interactive module UX (#204) * Release v0.28.0: Module package separation for command implementations (#201) * 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 <djm81@users.noreply.github.com> * 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 <cursoragent@cursor.com> * 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 <cursoragent@cursor.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * fix: mitigate code scanning vulnerabilities (#148) * fix: mitigate code scanning vulnerabilities - Fix ReDoS vulnerability in github_mapper.py by replacing regex with line-by-line processing - Fix incomplete URL sanitization in github.py, bridge_sync.py, and ado.py using proper URL parsing - Add explicit permissions blocks to 7 GitHub Actions jobs following least-privilege model Resolves all 13 code scanning findings: - 1 ReDoS error - 5 URL sanitization warnings - 7 missing workflow permissions warnings Fixes #147 Co-authored-by: Cursor <cursoragent@cursor.com> * fix: accept GitHub SSH host aliases in repo detection Accept ssh.github.com (port 443) in addition to github.com when detecting GitHub repositories via SSH remotes. This ensures repositories using git@ssh.github.com:owner/repo.git are properly detected as GitHub repos. Addresses review feedback on PR #148 Co-authored-by: Cursor <cursoragent@cursor.com> * fix: prevent async cleanup issues in test mode Remove manual Live display cleanup that could cause EOFError. The _safe_progress_display function already handles test mode by skipping progress display, so direct save path is sufficient. Fixes test_unlock_section failure with EOFError/ValueError. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * fix: detect GitHub remotes using ssh:// and git:// URLs Extend URL pattern matching to support ssh://git@github.com/owner/repo.git and git://github.com/owner/repo.git formats in addition to existing https?:// and scp-style git@host:path URLs. This fixes a regression where these valid GitHub URL formats were not detected, causing detect() to return false for repos using these schemes. Addresses review feedback on PR #149 Co-authored-by: Cursor <cursoragent@cursor.com> * chore: bump version to 0.26.9 and update changelog - Update version from 0.26.8 to 0.26.9 - Add changelog entry for GitHub remote detection fix and code scanning fixes Co-authored-by: Cursor <cursoragent@cursor.com> * fix: compare GitHub SSH hostnames case-insensitively Lowercase host_part before comparison to handle mixed-case hostnames like git@GitHub.com:org/repo.git. This restores the case-insensitive behavior from the previous config_content.lower() check and prevents regression where valid GitHub repos with mixed-case hostnames would not be detected. Addresses review feedback on PR #150 Co-authored-by: Cursor <cursoragent@cursor.com> * Add openspec and workflow commands for transparency * Add specs from openspec * Remove aisp change which wasn't implemented * Fix openspec gitignore pattern * Update gitignore * Update contribution standards to use openspec for SDD * Migrate to new opsx openspec commands * Migrate workflow and openspec config * fix: bump version to 0.26.10 for PyPI publish - Sync version across pyproject.toml, setup.py, src/__init__.py, src/specfact_cli/__init__.py - Add CHANGELOG entry for 0.26.10 (fixes incorrect version publish issue) Co-authored-by: Cursor <cursoragent@cursor.com> * Update version and changelog * Add canonical user-friendly workitem url for ado workitems * Update to support OSPX * feat(backlog): implement refine --import-from-tmp and fix type-check (#156) * feat(backlog): implement --import-from-tmp for refine export/import round-trip - Add _parse_refined_export_markdown() to parse export-format markdown (ID, Body, Acceptance Criteria, optional title/metrics) - Import branch: read file, match by ID, update items; --write calls adapter.update_backlog_item() - Remove 'Import functionality pending implementation' message - Unit tests for parser (single item, AC/metrics, header-only, blocks without ID) - Bump version to 0.26.11 and sync across pyproject.toml, setup.py, src/__init__.py, src/specfact_cli/__init__.py - OpenSpec change: implement-backlog-refine-import-from-tmp (proposal, tasks, spec delta) Fixes #155 Co-authored-by: Cursor <cursoragent@cursor.com> * Fix type check issues --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * feat: debug logs under ~/.specfact/logs and release 0.26.13 (#159) * feat: add debug logs under ~/.specfact/logs with operation metadata - User-level log dir: get_specfact_home_logs_dir() (~/.specfact/logs, 0o755) - debug_print() routes to console and rotating specfact-debug.log when --debug - debug_log_operation() for structured metadata (ADO, GitHub, backlog, init) - CLI init_debug_log_file() when --debug; help text updated Closes #158 OpenSpec change: add-debug-logs-specfact-home Co-authored-by: Cursor <cursoragent@cursor.com> * Add debug logging for selected commands at first * release: 0.26.13 - debug log parity for upgrade, versions and changelog - Log upgrade success (up to date) to ~/.specfact/logs/specfact-debug.log - Bump version to 0.26.13; sync pyproject.toml, setup.py, src/__init__.py, specfact_cli/__init__.py - CHANGELOG: 0.26.13 Fixed entry for upgrade debug parity Co-authored-by: Cursor <cursoragent@cursor.com> * Remove pr markdown --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * Potential fix for pull request finding 'Empty except' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * Fix unused variable review * Fix unused variable review * Fix type and test errors * Finalize change * Change for debug logs archived * fix: improve ADO backlog refine error logging and user-facing error UX (#164) * Improving error logging capabilities * small fix on changelog * Archived change --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat: backlog refine --ignore-refined and --id, startup docs (fixes #166) (#167) * feat: backlog refine --ignore-refined and --id, startup docs (fixes #166) OpenSpec change: improve-backlog-refine-and-cli-startup. Adds --ignore-refined/--no-ignore-refined, --id <issue-id>; helper _item_needs_refinement; interactive refinement prompt section; version 0.26.15. * Add change for this branch and improve change create workflow * Improve refinement prompt and add specification feedback, update docs and add backlog refinement tutorial * Fix spec update and tasks * Improve pr orchestrator pipeline triggers --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add change proposals for full scrum support * Add support for systematic, structured issue creation with copilot help * feat(backlog): daily standup defaults, iteration/sprint, unassigned items view (#174) * Issue 179 resolution (#180) * fix(backlog): address CodeQL/Codex PR 181 findings - Replace empty except with debug_log_operation in _load_standup_config and _load_backlog_config (correct signature: operation, target, status, error) - Add dim console message in sprint end date parse except block - Gate summarize prompt description/comments on --comments; add include_comments to _build_summarize_prompt_content and call site - Add test for metadata-only summarize when include_comments=False; update existing test to pass include_comments=True Co-authored-by: Cursor <cursoragent@cursor.com> * Update openspec enforcement rules * Structure openspec changes * Fix ruff finding * Fix linter issues with StrEnum and parameters * Fix tests and depcreation warnings * Improve sync script * Add change for modular command registry * Fix review finding on dev sync script * Update modular change proposal * feat: CLI modular command registry and lazy load (arch-01) (#196) * feat: CLI modular command registry and lazy load (arch-01) Co-authored-by: Cursor <cursoragent@cursor.com> * Add missing exports * Fix lazy loading review findigns * Removed example package and fixed tests * Fix test failures and lazy load logic for modules * Fix tests --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * docs: document CLI modules design; sync version and cleanup - Add Modules design section to architecture (registry, module packages, state) - Update module structure tree with registry/ and modules/ - Cross-reference directory-structure to architecture#modules-design - Changelog, version, and project file updates; remove obsolete commands/prompts Co-authored-by: Cursor <cursoragent@cursor.com> * Archive modular change and specs * Fix banner display on help screen * Improve action runner on main * Setup claude skills and instructions * feat: module package separation for command implementations (#200) * feat: separate module package command implementations * docs: finalize openspec apply checklist for arch-02 * Archived arch-02 change and updated specs * fix: restore plan sync shared compatibility import --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: address CodeQL and Codex review findings from PR #201 - Fix unreachable code in contract init (Prompt.ask after raise typer.Exit) - Replace empty except with print_warning for contract file load failures - Fix repo-root fallback path depth in backlog commands after module migration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * feat: add module lifecycle management and split init ide setup * docs: update arch-03 tasks after pr creation * docs: update init help text for module lifecycle and ide split * Format missing * fix: tighten ado assignee typing for basedpyright warning * fix: honor init install-deps and tighten ado typing * test: satisfy bundle converter constructor typing * test: isolate module registry state in migration compatibility test * Update change * disable claude review due to high costs --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * archived change for module improvements * fix: address review feedback in init and boundary tests * Fix test setup for tmpfiles * docs: add openspec change arch-05 bridge registry (#210) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: add openspec change arch-06 manifest security (#211) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat: Core Contracts and Module Interface Formalization (#209) * feat: add ModuleIOContract protocol and core-module isolation - Create ModuleIOContract protocol with four core operations - Add static analysis enforcement preventing core->module imports - Add ProjectBundle schema versioning (schema_version field) - Update 5 modules to implement ModuleIOContract - Add protocol compliance tracking in module discovery - Create docs for ProjectBundle schema and module contracts - Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * chore: update arch-04 task tracking after implementation and PR * test: fix flaky help assertions and typing warnings --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Update specs and archive arch-04 change * Fix changelog format * docs: align arch-05 scope with protocol migration cleanup (#212) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: add OpenSpec changes for module marketplace phases Add three OpenSpec changes from Module Marketplace Decoupling Plan: - arch-07-schema-extension-system: Schema extension mechanism for ProjectBundle - marketplace-01-central-module-registry: Central registry MVP with module discovery - marketplace-02-advanced-marketplace-features: Dependency resolution and custom registries All changes include: - Proposal, design, specs, tasks, and validation artifacts - Source tracking linked to GitHub issues #213, #214, #215 - TDD/SDD ordering with contract-first development - Backward compatibility guarantees Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat: apply arch-05 bridge registry implementation (#216) * docs: add openspec change arch-05 bridge registry * feat: apply arch-05 bridge registry workflow * docs: update arch-05 apply task execution state * fix: resolve arch-05 protocol reporting and duplicate lifecycle logs * fix: close arch-05 review gaps for protocol reporting * docs: mark arch-05 PR task complete * fix: complete arch-05 module io contract migration * fix: make module protocol startup reporting user-friendly * fix: make debug logging work for eager cli flags * fix: print active debug log path on debug startup * fix: harden repro output and telemetry fallback behavior * test: fix service bridge metadata typing in unit tests * fix: add strict crosshair mode and clearer repro diagnostics * fix: remove contracts import side-effects for crosshair * fix: make crosshair exploration output specific and deduplicated * fix: make crosshair exploration skip noisy signature-limited files * ci: reduce specfact workflow env setup overhead * ci: avoid hatch env sync in specfact validation workflow * fix: stabilize crosshair exploration for side-effectful modules * fix: improve crosshair compatibility for backlog converters * ci: require crosshair in specfact repro workflows * Apply fixes on crosshair tests * ci: speed up workflow setup with cache and lean hatch installs * ci: pin contract scenario test env to py3.12 * ci: improve contract test progress logging * ci: increase and expose smart test timeout for scenario runs * Fix test failure logic * Fix test failure logic * Reformat files * Fix contract test findings * Update docs integrity --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archive arch-05 change after implementation * fix: address post-merge review findings and restore lazy registration * fix: refresh project console per invocation in tests * fix: detect runtime interface protocol ops in source scan * fix: harden project console refresh and protocol source scan * fix: refresh import command console for each invocation * fix: resolve type-check errors and harden protocol scanning * fix: stabilize module protocol scan and project console lifecycle * Refine pending changes for new modular ecosystem and marketplace integration * fix: update stale spec-delta paths in tasks.md after change renames Corrects three broken spec-delta references flagged in PR #221 review: - backlog-core-02: add-backlog-add-interactive-issue-creation → backlog-core-02-interactive-issue-creation - backlog-scrum-02: sprint-planning-capacity-commitment-support → backlog-scrum-02-sprint-planning - backlog-scrum-03: story-complexity-splitting-hints-support → backlog-scrum-03-story-complexity Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs: rewrite CHANGE_ORDER.md for module-scoped changes and full dependency graph - Replace old flat backlog-01..09 naming with module-scoped groups: backlog-core, backlog-scrum, backlog-kanban, backlog-safe, policy-engine, patch-mode, bundle-mapper, ceremony-cockpit - Add arch-06/07 and marketplace-01/02 as pending changes - Mark arch-01 through arch-05 as implemented (archived 2026-02-04..10) - Update all GitHub issue numbers to current (incl. new #208, #213, #214, #215, #220 from recent changes) - Clarify hard vs optional dependencies; optional deps are graceful no-ops and not set as GitHub blockers - Update implementation waves to reflect current unblocked state (Wave 0 done) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat(backlog): daily/refine comment context, interactive standup posting, and filter parity (#222) * feat(backlog): finalize daily/refine comment context, interactive posting, and docs parity * docs(openspec): mark backlog-scrum-01 standup change checklist complete * fix(openspec): mark backlog-refinement delta as ADDED for archive apply * Archived completed change backlog-scrum-01 * fix(backlog): make map-fields exit cleanly under CliRunner * Fix format * fix(backlog): stabilize map-fields tests in non-interactive env * docs(agents): enforce signed-commit handoff flow --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix(backlog): satisfy interactive daily adapter typing * fix(backlog): bypass default daily limit for issue-window flags * fix: parse backlog refine writeback fields and refactor refine command (#224) * fix: parse backlog refine writeback fields and refactor refine command * fix: preserve heading-style narrative sections in refine parser * chore: sync OpenSpec change to GitHub issue tracking --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: avoid raw label fallback when description block is missing * fix: harden backlog refine prompt scaffold and mixed-format parsing (#228) * fix: harden backlog refine prompt scaffold and parsing * fix: normalize mixed notes parsing and boundary flushing --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Finish change * chore: bump version to 0.30.4 and update changelog * Add MEMORY.md for claude code * Archive backlog writeback field split change * Archived flask support sidecar change * feat: add backlog-core module — dependency analysis and command suites (#231) * fix(backlog-core): remove unused module io contract global * fix: rename LICENSE.md to LICENSE for GitHub license detection (#233) GitHub's licensee gem only recognizes standard filenames (LICENSE, LICENSE.txt) — LICENSE.md caused the repo to show "Other" instead of "Apache License 2.0". Updated all references across pyproject.toml, README, docs, workflows, and FAQ. Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore standard Apache 2.0 license text for GitHub detection (#235) The LICENSE body had two non-standard edits that pushed it below GitHub licensee's ~95% similarity threshold, causing "Other" instead of "Apache License 2.0". Restored the canonical text; only the copyright line in the appendix is customized (as intended by the Apache template). Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * Add openspec changes for architecture level enhancement * feat(ci): attach test and repro log artifacts to PR orchestrator runs (#262) * feat(ci): attach test and repro log artifacts to PR orchestrator runs - Tests job: run smart-test-full, upload logs/tests/ as test-logs artifact - Contract-first-ci: capture repro to logs/repro/, upload repro-logs and repro-reports - Docs: CI and GitHub Actions section in troubleshooting (artifact names, usage) - Version 0.31.1, CHANGELOG entry Implements OpenSpec change ci-01-pr-orchestrator-log-artifacts. Fixes #260. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix workflow and test * ci(pr-orchestrator): add log artifacts for all pipeline jobs - type-check: capture output to logs/type-check/, upload type-check-logs - lint: capture to logs/lint/, upload lint-logs - compat-py311: capture to logs/compat-py311/, upload compat-py311-logs - quality-gates: capture to logs/quality-gates/, upload quality-gates-logs - compat-py311: use hatch -e ENV run run (not hatch test) for pytest - docs: list all CI artifact names and jobs in troubleshooting Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * feat: enhanced module manifest security and integrity (arch-06) (#263) * feat: enhanced module manifest security and integrity (arch-06) Co-authored-by: Cursor <cursoragent@cursor.com> * fix: remove duplicate ModulePackageMetadata import (ruff F811) * Fix failed tests * Fix type-check errors --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * feat: Schema Extension System for Modular ProjectBundle Extensions (arch-07) (#265) * feat: add schema extension system for modular ProjectBundle extensions Enables modules to extend Feature and ProjectBundle with namespaced custom fields without modifying core models, supporting marketplace-ready interoperability. - Add extensions dict field to Feature and ProjectBundle models - Implement type-safe get/set extension accessors with namespace enforcement - Extend module manifest schema with schema_extensions declaration - Add ExtensionRegistry for collision detection and introspection - Extend module lifecycle registration to load and validate extensions OpenSpec Change: arch-07-schema-extension-system Resolves #213 * feat: schema extension system (arch-07) and quality gate fixes - Add extensions field and get_extension/set_extension to Feature and ProjectBundle - Add SchemaExtension model and schema_extensions to ModulePackageMetadata - Add ExtensionRegistry with collision detection; integrate in module registration - Parse schema_extensions in discover_package_metadata - Docs: extending-projectbundle guide, architecture section, sidebar - Version 0.32.0, CHANGELOG entry, TDD_EVIDENCE - Format: E402 (imports at top in project.py), UP042 (StrEnum in backlog-core), RUF043/B017 in schema extension tests - Type-check: pass schema_metadata/project_metadata in BundleManifest test calls OpenSpec Change: arch-07-schema-extension-system Resolves #213 Co-authored-by: Cursor <cursoragent@cursor.com> * Update change progress * Add docs guides and update changes * Use v0.32.0 as version and combine arch-06/arch-07 * Update change order plan --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * Fix codeql findings * feat(workflow): standardize worktree-first development flow (#268) * feat(workflow): standardize worktree-first development flow * docs(openspec): mark workflow-01 delivery tasks complete * Apply review finding --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Fix review finding * feat: implement policy-engine-01 unified policy framework (#270) * feat(policy-engine): implement unified policy framework * docs(openspec): mark policy-engine-01 implemented in change order * fix(policy-engine): make module io contract compliant * feat(policy-engine): add policy init templates and docs coverage * fix: refine grouped policy limit semantics and outputs * docs: clarify policy engine value for new users --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: harden policy module imports and snapshot path resolution * Update backlog core change to cover workspace level modules * feat(init): align init module discovery with registry (backlog-core-01) (#275) - Use discover_all_package_metadata() in init so list-modules/enable/disable use same roots as registry (built-in + workspace modules + SPECFACT_MODULES_ROOTS) - Extend backlog-core-01 OpenSpec: init-module-discovery-alignment spec, tasks 0.5.x, TDD evidence - Bump version to 0.34.0; CHANGELOG Fixes #116 Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * feat: add thorough codebase validation (validation-01, #163) (#272) * feat: add thorough codebase validation (validation-01) - Add --crosshair-per-path-timeout to specfact repro and ReproChecker - Add docs/reference/thorough-codebase-validation.md (quick check, contract-full, sidecar, dogfooding) - Unit test and TDD evidence for CrossHair per-path timeout - OpenSpec validation-01-deep-validation tasks and TDD_EVIDENCE updated * fix: reject non-positive CrossHair per-path timeout (review) * docs: CHANGELOG v0.34.0 and doc updates for thorough codebase validation --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat: add patch apply (local + --write with confirmation) [#177] (#273) * feat(patch-mode): add patch apply (local + --write with confirmation) [#177] - Add patch_mode module: pipeline (generator, applier, idempotency), patch apply command - specfact patch apply <file> (local + preflight), patch apply --write --yes (upstream, idempotent) - OpenSpec patch-mode-01-preview-apply: proposal Source Tracking, tasks, TDD_EVIDENCE - CHANGELOG [Unreleased] entry for v0.34.0 merge Co-authored-by: Cursor <cursoragent@cursor.com> * fix(patch-mode): sanitize idempotency keys, derive key from patch content [PR review] * Fix errors and ensure module compatibility --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * feat: add bundle-mapper module (bundle-mapper-01, #121) (#274) * feat: add bundle-mapper module with confidence-based spec-to-bundle mapping - BundleMapping model and BundleMapper engine (explicit label, historical, content similarity) - Mapping history persistence and MappingRule (save_user_confirmed_mapping, load_bundle_mapping_config) - Interactive UI (ask_bundle_mapping) with Rich confidence visualization - Unit tests and TDD_EVIDENCE for bundle-mapper-01 (OpenSpec #121) Co-authored-by: Cursor <cursoragent@cursor.com> * fix(bundle-mapper): address PR review findings (P1/P2) - P1 interactive: no default accept for low-confidence; use default only when conf >= 0.5 - P1 history: ignore empty key fields in item_keys_similar (only count non-empty matches) - P2 engine: add historical weight only when hist_bundle == primary_bundle_id - Add test_item_keys_similar_empty_fields_not_counted to lock empty-key behavior Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> * Archive finished changes * fix: implement verification-01 wave1 delta closure (#277) * fix: implement verification-01 delta for bundle mapping, patch apply, and docs parity * test: fix patch write yes scenario for real diff apply * fix: keep bundle mapping history out of bundle manifest --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archive delta validation change and update specs * Update patch version * Potential fix for pull request finding 'Empty except' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * apply review fixes * Add cli validation changes --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 98e880f commit 4c7b5ef

File tree

31 files changed

+1975
-0
lines changed

31 files changed

+1975
-0
lines changed

openspec/CHANGE_ORDER.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ These are derived extensions of the same 2026-02-15 plan and are required to ope
169169
| ai-integration | 02 | ai-integration-02-mcp-server | [#252](https://github.com/nold-ai/specfact-cli/issues/252) | validation-02 |
170170
| ai-integration | 03 | ai-integration-03-instruction-files | [#253](https://github.com/nold-ai/specfact-cli/issues/253) | ai-integration-01 |
171171

172+
### CLI end-user validation (validation gap plan, 2026-02-19)
173+
174+
| Module | Order | Change folder | GitHub # | Blocked by |
175+
|--------|-------|---------------|----------|------------|
176+
| cli-val | 01 | cli-val-01-behavior-contract-standard | [#279](https://github.com/nold-ai/specfact-cli/issues/279) ||
177+
| cli-val | 02 | cli-val-02-output-snapshot-stability | [#280](https://github.com/nold-ai/specfact-cli/issues/280) ||
178+
| cli-val | 03 | cli-val-03-misuse-safety-proof | [#281](https://github.com/nold-ai/specfact-cli/issues/281) | #279 |
179+
| cli-val | 04 | cli-val-04-acceptance-test-runner | [#282](https://github.com/nold-ai/specfact-cli/issues/282) | #279, #281 |
180+
| cli-val | 05 | cli-val-05-ci-integration | [#283](https://github.com/nold-ai/specfact-cli/issues/283) | #280, #282 |
181+
| cli-val | 06 | cli-val-06-copilot-test-generation | [#284](https://github.com/nold-ai/specfact-cli/issues/284) | #279 (soft: #283) |
182+
172183
### Integration governance and proof (architecture integration plan, 2026-02-15)
173184

174185
| Module | Order | Change folder | GitHub # | Blocked by |
@@ -252,6 +263,7 @@ One parent issue per module group for grouping. Set **Type** to Epic on the proj
252263
| Sidecar validation | [Epic] Sidecar validation | [#191](https://github.com/nold-ai/specfact-cli/issues/191) |
253264
| Bundle mapping | [Epic] Bundle/spec mapping | [#192](https://github.com/nold-ai/specfact-cli/issues/192) |
254265
| Architecture + Marketplace | [Epic] Architecture (CLI structure, modularity, performance) | [#194](https://github.com/nold-ai/specfact-cli/issues/194) |
266+
| CLI end-user validation | [Epic] CLI End-User Validation | [#285](https://github.com/nold-ai/specfact-cli/issues/285) |
255267

256268
---
257269

@@ -267,6 +279,12 @@ Dependencies flow left-to-right; a wave may start once all its hard blockers are
267279
- backlog-core-01 ✅
268280
- validation-01 ✅, sidecar-01 ✅, bundle-mapper-01 ✅
269281

282+
- **Wave 1.5 — CLI end-user validation** (cross-cutting, parallel to Wave 2+):
283+
- cli-val-01, cli-val-02 (no blockers — start immediately after Wave 1)
284+
- cli-val-03, cli-val-06 (after cli-val-01)
285+
- cli-val-04 (after cli-val-01 + cli-val-03)
286+
- cli-val-05 (after cli-val-02 + cli-val-04 — capstone)
287+
270288
- **Wave 2 — Marketplace + backlog module layer** (needs Wave 1):
271289
- marketplace-01 (needs arch-06)
272290
- backlog-core-02 (needs backlog-core-01)
@@ -319,6 +337,7 @@ A wave cannot be considered complete until all gate criteria listed for that wav
319337

320338
- Wave 0 gate: Core modular CLI and bridge registry flows remain stable and archived changes are validated.
321339
- Wave 1 gate: arch-06/07, policy-engine-01, patch-mode-01, backlog-core-01, validation-01 produce passing contract and strict OpenSpec validation. ✅ Completed 2026-02-18.
340+
- Wave 1.5 gate: CLI behavior contract schema validated, snapshot tests pass for all command groups, black-box acceptance tests prove installed binary works, anti-pattern safety assertions pass for all Wave 1 commands, CI gates enforce all of the above.
322341
- Wave 2 gate: At least one backlog planning workflow completes with no blocking dependency regressions across backlog-core + marketplace-01.
323342
- Wave 3 gate: Higher-order backlog workflows and marketplace-02 interoperate without command-group regressions.
324343
- Wave 4 gate: `ceremony-cockpit-01` aliases resolve and execute against installed modules without fallback failures.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Change Validation: cli-val-01-behavior-contract-standard
2+
3+
- **Validated on (UTC):** 2026-02-19T12:00:00Z
4+
- **Workflow:** /wf-validate-change (proposal-stage dry-run validation)
5+
- **Strict command:** `openspec validate cli-val-01-behavior-contract-standard --strict`
6+
- **Result:** PASS
7+
8+
## Scope Summary
9+
10+
- **New capabilities:** cli-behavior-contracts
11+
- **Modified capabilities:** none
12+
- **Declared dependencies:** none (foundation change with no prerequisites)
13+
- **Downstream dependents:** cli-val-03-misuse-safety-proof, cli-val-04-acceptance-test-runner, cli-val-06-copilot-test-generation
14+
- **Proposed affected code paths:**
15+
- `tests/cli-contracts/schema/cli-scenario.schema.yaml` (new schema file)
16+
- `tests/cli-contracts/*.scenarios.yaml` (new pilot scenario files)
17+
- `tools/validate_cli_contracts.py` (new validation tool)
18+
- `openspec/config.yaml` (extend with CLI behavior contract artifact type)
19+
- `docs/` (new contributor page)
20+
21+
## Format Validation
22+
23+
- **proposal.md Format**: PASS
24+
- Title format: Correct (`# Change: CLI Behavior Contract Standard`)
25+
- Required sections: All present (Why, What Changes, Capabilities, Impact)
26+
- "What Changes" format: Correct (uses NEW/EXTEND markers with bullet list)
27+
- "Capabilities" section: Present (one capability: `cli-behavior-contracts`)
28+
- "Impact" format: Correct (lists Affected specs, Affected code, Integration points, Documentation impact)
29+
- Source Tracking section: Present (GitHub Issue #279, repository nold-ai/specfact-cli)
30+
- Note: Section heading uses `## Dependencies` instead of the standard `## Impact` subsection for dependency declarations. Dependencies are still clearly stated. Minor deviation, non-blocking.
31+
- **tasks.md Format**: PASS
32+
- Section headers: Correct (hierarchical numbered format: `## 1.`, `## 2.`, ... `## 8.`)
33+
- Task format: Correct (`- [ ] 1.1 [Description]`)
34+
- Sub-task format: Correct (`- [ ] 1.1.1 [Description]`)
35+
- TDD order enforced section: Present at top
36+
- Git worktree creation: First task (`## 1.`)
37+
- PR creation: Last implementation task (`## 8. Delivery`, task 8.4)
38+
- Post-merge cleanup: Present
39+
- Quality gate tasks: Present (`## 6.` includes format, type-check, lint, contract-test, smart-test)
40+
- Version and changelog tasks: Present (`## 7.`)
41+
- Note: No explicit worktree bootstrap pre-flight tasks (hatch env create, smart-test-status, contract-test-status). Minor gap, non-blocking.
42+
- **specs Format**: PASS
43+
- Given/When/Then format: Verified across all 7 scenarios in `specs/cli-behavior-contracts/spec.md`
44+
- Three requirements defined: CLI Behavior Contract Schema (3 scenarios), Pilot Scenario Files (3 scenarios), Schema Validation Tool (1 scenario)
45+
- All scenarios use GIVEN/WHEN/THEN/AND structure correctly
46+
- **design.md Format**: PASS
47+
- Context section: Present
48+
- Goals / Non-Goals: Present (4 goals, 4 non-goals)
49+
- Decisions: Present (5 decisions documented)
50+
- Risks / Trade-offs: Present (3 risks with mitigations)
51+
- Migration Plan: Present (5-step plan)
52+
- Schema Design: Present (bonus detail showing YAML structure)
53+
- Open Questions: Present (2 questions)
54+
- Note: No bridge adapter integration or sequence diagrams documented, but these are not applicable (no multi-repo flows or adapter integration in this change)
55+
56+
## Dependency and Integration Review
57+
58+
- **CHANGE_ORDER.md consistency**: PASS
59+
- CHANGE_ORDER.md row: `cli-val | 01 | cli-val-01-behavior-contract-standard | #279 | ---`
60+
- Blocked by: none (matches proposal declaration of no hard blockers)
61+
- Wave 1.5 position: First in wave alongside cli-val-02 (no blockers -- start immediately after Wave 1)
62+
- **GitHub Issue consistency**: PASS
63+
- Issue #279 is OPEN, title "[Change] CLI Behavior Contract Standard"
64+
- Issue body matches proposal scope (YAML schema, pilot files, validation tool, documentation)
65+
- No "Blocked by" references in issue body (correct -- no blockers)
66+
- Labels: enhancement, change-proposal
67+
- **Cross-artifact dependency consistency**: PASS
68+
- Proposal states no hard blockers
69+
- CHANGE_ORDER.md shows no blockers for #279
70+
- GitHub issue #279 shows no blocker references
71+
- All three sources agree
72+
73+
## Breaking-Change Analysis
74+
75+
- **Breaking changes detected:** 0
76+
- **Interface changes:** None. This change introduces new files only (schema, validation tool, scenario files). No existing production code, interfaces, contracts, or APIs are modified.
77+
- **Risk assessment:** No breaking-change risk. All artifacts are additive.
78+
79+
## Impact Assessment
80+
81+
- **Impact Level:** Low
82+
- **Code Impact:** No production CLI code changes. New test infrastructure files only.
83+
- **Test Impact:** New schema validation tests in `tests/unit/`. New scenario files in `tests/cli-contracts/`. No changes to existing tests.
84+
- **Documentation Impact:** New contributor page in `docs/` describing CLI behavior contract format.
85+
- **Release Impact:** Patch/Minor (additive only, no breaking changes)
86+
87+
## Validation Outcome
88+
89+
- Required artifacts are present: `proposal.md`, `design.md`, `specs/cli-behavior-contracts/spec.md`, `tasks.md`.
90+
- All format checks pass with minor non-blocking observations noted.
91+
- Dependency declarations are consistent across proposal, CHANGE_ORDER.md, and GitHub issue #279.
92+
- No breaking changes detected.
93+
- Change is ready for implementation-phase intake. No prerequisites to satisfy.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
## Context
2+
3+
This change establishes the foundational artifact format for CLI end-user validation. It defines how command behavior expectations are recorded, validated, and consumed by downstream validation changes (cli-val-03, cli-val-04, cli-val-06). No production CLI code is modified.
4+
5+
## Goals / Non-Goals
6+
7+
**Goals:**
8+
9+
- Define a YAML schema for CLI behavior scenarios that is both human-readable and machine-executable
10+
- Pilot the format on 2-3 command groups to validate usability
11+
- Provide a schema validation tool that integrates with the existing hatch script system
12+
- Keep the format simple enough for AI copilots to generate reliably
13+
14+
**Non-Goals:**
15+
16+
- No test runner implementation (that is cli-val-04)
17+
- No CI integration (that is cli-val-05)
18+
- No changes to production CLI commands
19+
- No snapshot testing infrastructure (that is cli-val-02)
20+
21+
## Decisions
22+
23+
- Store scenario files in `tests/cli-contracts/` to keep them adjacent to existing test tiers
24+
- Use YAML (not JSON or TOML) for scenario files — aligns with existing SpecFact config patterns and is copilot-friendly
25+
- Separate patterns and anti-patterns within the same file using a `type` field rather than separate files — keeps related behavior together
26+
- Use JSON Schema for the schema definition — enables validation with `jsonschema` (already a project dependency)
27+
- Pilot on three command groups: one with many args (e.g., `backlog ceremony`), one with file I/O (e.g., `validate`), one simple (e.g., `--help`/`--version`)
28+
29+
## Schema Design
30+
31+
```yaml
32+
# tests/cli-contracts/schema/cli-scenario.schema.yaml
33+
feature: string # command group name (e.g., "spec validate")
34+
scenarios:
35+
- name: string # human-readable scenario name
36+
type: pattern | anti-pattern
37+
argv: [string] # exact command tokens
38+
context: # optional workspace setup
39+
requires: string # "empty-repo" | "sample-bundle" | "initialized-project"
40+
env: {key: value} # environment variable overrides
41+
stdin: string # stdin input (if any)
42+
expect:
43+
exit: int # exact exit code (for patterns)
44+
exit_nonzero: bool # true for anti-patterns
45+
stdout_contains: [string]
46+
stdout_regex: [string]
47+
stderr_contains: [string]
48+
stderr_regex: [string]
49+
no_traceback: bool # assert no Python traceback in output
50+
fs:
51+
creates: [string] # files expected to be created
52+
modifies: [string] # files expected to be modified
53+
forbidden: [string] # files that must NOT be created/modified
54+
```
55+
56+
## Risks / Trade-offs
57+
58+
- [Schema rigidity] -> Mitigation: start with a minimal schema and extend per downstream change needs; version the schema
59+
- [YAML complexity for many scenarios] -> Mitigation: one file per command group keeps files manageable; add `$ref` support later if needed
60+
- [Scenario maintenance burden] -> Mitigation: cli-val-06 provides copilot generation; cli-val-05 CI catches stale scenarios
61+
62+
## Migration Plan
63+
64+
1. Define schema and validation tool
65+
2. Create pilot scenario files for 3 command groups
66+
3. Validate all pilots pass schema validation
67+
4. Document format in `docs/` for contributors
68+
5. Downstream changes (cli-val-03/04/06) consume the format
69+
70+
## Open Questions
71+
72+
- Exact command groups for the pilot: recommend `backlog ceremony standup`, `validate`, and root `specfact --help`/`--version`
73+
- Whether to support YAML anchors and aliases for reducing repetition in large scenario files
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Change: CLI Behavior Contract Standard
2+
3+
## Why
4+
5+
Every SpecFact CLI feature should have a single artifact that answers: "What does this command do, and what happens when you use it wrong?" Today this knowledge lives scattered across 73+ test files, docstrings, and docs pages. When a user reports unexpected behavior, there is no single source of truth to check the expected CLI behavior against. A machine-readable behavior contract per command group — recording exact argv, expected exit codes, output patterns, and filesystem side effects — closes this gap and becomes the foundation for all downstream validation (snapshot tests, acceptance runners, anti-pattern suites, CI gates).
6+
7+
## What Changes
8+
9+
- **NEW**: YAML schema definition for CLI behavior scenarios (`tests/cli-contracts/schema/cli-scenario.schema.yaml`) — defines the contract format for command groups
10+
- **NEW**: Scenario files for pilot command groups stored in `tests/cli-contracts/` — one YAML file per command group recording patterns (happy paths) and anti-patterns (misuse/invalid input)
11+
- **NEW**: Schema validation utility (`tools/validate_cli_contracts.py`) that validates scenario YAML files against the schema
12+
- **EXTEND**: `openspec/config.yaml` context to reference CLI behavior contracts as a recognized artifact type
13+
- **EXTEND**: Documentation in `docs/` to describe the CLI behavior contract format and authoring guidelines
14+
15+
## Capabilities
16+
17+
### New Capabilities
18+
19+
- `cli-behavior-contracts`: A YAML-based schema and authoring standard for declaring CLI command behavior expectations — exact argv, required context, expected exit class (success/failure), stdout/stderr patterns, and filesystem diff expectations — separated into patterns (happy paths) and anti-patterns (misuse).
20+
21+
## Impact
22+
23+
- **Affected specs**: No existing specs modified; new spec delta defines the schema and authoring process
24+
- **Affected code**: New schema file and validation tool only; no production CLI code changes
25+
- **Integration points**: Consumed by cli-val-03 (anti-patterns), cli-val-04 (acceptance runner), cli-val-06 (copilot generation)
26+
- **Documentation impact**: New page in `docs/` describing the CLI behavior contract format for contributors
27+
28+
## Dependencies
29+
30+
- No hard blockers — this is the foundation change with no prerequisites
31+
- Downstream dependents: cli-val-03-misuse-safety-proof, cli-val-04-acceptance-test-runner, cli-val-06-copilot-test-generation
32+
33+
## Source Tracking
34+
35+
<!-- source_repo: nold-ai/specfact-cli -->
36+
- **GitHub Issue**: #279
37+
- **Issue URL**: https://github.com/nold-ai/specfact-cli/issues/279
38+
- **Repository**: nold-ai/specfact-cli
39+
- **Last Synced Status**: proposed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
## ADDED Requirements
2+
3+
### Requirement: CLI Behavior Contract Schema
4+
5+
The system SHALL provide a YAML schema that defines the structure for CLI behavior scenario files, enabling machine-readable declaration of expected command behavior.
6+
7+
#### Scenario: Schema validates a well-formed scenario file
8+
9+
- **GIVEN** a scenario YAML file with feature name, argv list, expect block (exit code, stdout/stderr patterns), and fs block (creates/modifies)
10+
- **WHEN** the schema validator runs against the file
11+
- **THEN** validation passes with no errors
12+
- **AND** all required fields are present and correctly typed.
13+
14+
#### Scenario: Schema rejects a scenario file missing required fields
15+
16+
- **GIVEN** a scenario YAML file missing the `argv` field in a scenario entry
17+
- **WHEN** the schema validator runs against the file
18+
- **THEN** validation fails with a descriptive error identifying the missing field
19+
- **AND** the error message includes the scenario name and line context.
20+
21+
#### Scenario: Schema supports both pattern and anti-pattern categorization
22+
23+
- **GIVEN** a scenario YAML file with entries categorized as `type: pattern` and `type: anti-pattern`
24+
- **WHEN** the file is parsed
25+
- **THEN** patterns and anti-patterns are distinguishable programmatically
26+
- **AND** anti-patterns require `exit_nonzero: true` in the expect block.
27+
28+
### Requirement: Pilot Scenario Files
29+
30+
The system SHALL include pilot scenario files for at least three command groups demonstrating the contract format across different command characteristics.
31+
32+
#### Scenario: Pilot covers a command with many arguments
33+
34+
- **GIVEN** a scenario file for a command group with multiple required and optional arguments
35+
- **WHEN** the file includes happy-path and misuse scenarios
36+
- **THEN** at least 3 pattern scenarios and 3 anti-pattern scenarios are defined
37+
- **AND** each scenario records exact argv, expected exit code, and output patterns.
38+
39+
#### Scenario: Pilot covers a command with file I/O
40+
41+
- **GIVEN** a scenario file for a command that reads or writes files
42+
- **WHEN** the file includes filesystem expectation blocks
43+
- **THEN** the `fs.creates` and `fs.modifies` fields list expected file paths
44+
- **AND** anti-patterns assert `fs.creates: []` and `fs.modifies: []` (no side effects on failure).
45+
46+
#### Scenario: Pilot covers a simple informational command
47+
48+
- **GIVEN** a scenario file for a command like `--help` or `--version`
49+
- **WHEN** the file defines expected output
50+
- **THEN** stdout patterns match documented help text structure
51+
- **AND** exit code is 0 for valid invocation.
52+
53+
### Requirement: Schema Validation Tool
54+
55+
The system SHALL provide a validation tool that checks scenario YAML files against the schema and reports errors.
56+
57+
#### Scenario: Validation tool runs via hatch script
58+
59+
- **GIVEN** scenario files exist in `tests/cli-contracts/`
60+
- **WHEN** `hatch run validate-cli-contracts` is executed
61+
- **THEN** all scenario files are validated against the schema
62+
- **AND** errors are reported with file path and line context
63+
- **AND** exit code is 0 when all files pass, non-zero when any fail.

0 commit comments

Comments
 (0)