From bd4072c6cfb185e2dca62cf18c818cb7d85a2a1e Mon Sep 17 00:00:00 2001 From: CleverThis Date: Tue, 5 May 2026 16:10:21 +0000 Subject: [PATCH] fix(spec): resolve AmbiguousStep conflict in milestone navigation BDD tests Rename generic step 'the content should contain' to 'the spec should contain' in the milestone plan navigation feature file and add the corresponding step definition in milestone_plan_navigation_steps.py. The previous fix removed the duplicate step definition from milestone_plan_navigation_steps.py, but left the feature file using the step from uko_ontology_registry_steps.py which reads from context.ontology_ttl_content instead of context.spec_content. This caused all milestone navigation scenarios to fail with an AttributeError at runtime. The new 'the spec should contain' step reads from context.spec_content and is unique to the milestone navigation step file, eliminating the AmbiguousStep conflict entirely. ISSUES CLOSED: #7564 --- .../milestone_plan_navigation.feature | 50 +++++++++---------- .../steps/milestone_plan_navigation_steps.py | 9 ++++ 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/features/specification/milestone_plan_navigation.feature b/features/specification/milestone_plan_navigation.feature index c759f7864..5951dcd02 100644 --- a/features/specification/milestone_plan_navigation.feature +++ b/features/specification/milestone_plan_navigation.feature @@ -8,8 +8,8 @@ Feature: Milestone Plan Navigation Section Scenario: Milestone Plan Navigation section exists When I read the specification file - Then the content should contain "### Milestone Plan Navigation" - And the content should contain "This navigation section provides a quick reference" + Then the spec should contain "### Milestone Plan Navigation" + And the spec should contain "This navigation section provides a quick reference" Scenario: Navigation table includes all milestones v3.2.0 through v3.8.0 When I read the specification file @@ -23,43 +23,43 @@ Feature: Milestone Plan Navigation Section Scenario: v3.2.0 milestone has explicit acceptance criteria When I read the specification file - Then the content should contain "### v3.2.0 — Decisions + Validations + Invariants" - And the content should contain "#### Deliverables" - And the content should contain "#### Key Architectural Constraints" - And the content should contain "#### Definition of Done" + Then the spec should contain "### v3.2.0 — Decisions + Validations + Invariants" + And the spec should contain "#### Deliverables" + And the spec should contain "#### Key Architectural Constraints" + And the spec should contain "#### Definition of Done" Scenario: v3.6.0 milestone lists explicit acceptance criteria When I read the specification file - Then the content should contain "### v3.6.0 — Advanced Concepts & Deferred Features" - And the content should contain "#### Deliverables" - And the content should contain "#### Key Architectural Constraints" - And the content should contain "#### Definition of Done" + Then the spec should contain "### v3.6.0 — Advanced Concepts & Deferred Features" + And the spec should contain "#### Deliverables" + And the spec should contain "#### Key Architectural Constraints" + And the spec should contain "#### Definition of Done" Scenario: v3.8.0 milestone is documented When I read the specification file - Then the content should contain "### v3.8.0 — Server Mode + Cloud Integration" + Then the spec should contain "### v3.8.0 — Server Mode + Cloud Integration" And the content should contain "Server Mode + Cloud Integration" in the milestone status Scenario: Navigation by Feature index exists When I read the specification file - Then the content should contain "**Navigation by Feature**:" - And the content should contain "Plan Lifecycle" - And the content should contain "Context Management" - And the content should contain "User Interface" - And the content should contain "Execution Environment" - And the content should contain "Quality & Testing" + Then the spec should contain "**Navigation by Feature**:" + And the spec should contain "Plan Lifecycle" + And the spec should contain "Context Management" + And the spec should contain "User Interface" + And the spec should contain "Execution Environment" + And the spec should contain "Quality & Testing" Scenario: Milestone Plan section covers v3.2.0 through v3.8.0 When I read the specification file - Then the content should contain "This plan covers v3.2.0 through v3.8.0" + Then the spec should contain "This plan covers v3.2.0 through v3.8.0" And the content should NOT contain "This plan covers v3.2.0 through v3.7.0" Scenario: Each milestone has spec coverage links When I read the specification file - Then the content should contain "[Decision Tree](#decision-tree-and-correction)" - And the content should contain "[Subplan Architecture](#subplan-architecture)" - And the content should contain "[ACMS Architecture](#acms-advanced-context-management-system)" - And the content should contain "[Automation Profiles](#automation-profiles)" - And the content should contain "[LSP Integration](#lsp-integration)" - And the content should contain "[TUI Architecture](#tui)" - And the content should contain "[Server Architecture](#server-and-client-architecture)" + Then the spec should contain "[Decision Tree](#decision-tree-and-correction)" + And the spec should contain "[Subplan Architecture](#subplan-architecture)" + And the spec should contain "[ACMS Architecture](#acms-advanced-context-management-system)" + And the spec should contain "[Automation Profiles](#automation-profiles)" + And the spec should contain "[LSP Integration](#lsp-integration)" + And the spec should contain "[TUI Architecture](#tui)" + And the spec should contain "[Server Architecture](#server-and-client-architecture)" diff --git a/features/steps/milestone_plan_navigation_steps.py b/features/steps/milestone_plan_navigation_steps.py index bcb1a8324..322c93c8b 100644 --- a/features/steps/milestone_plan_navigation_steps.py +++ b/features/steps/milestone_plan_navigation_steps.py @@ -22,6 +22,15 @@ def step_read_specification_file(context: Any) -> None: context.spec_content = f.read() +@then('the spec should contain "{text}"') +def step_spec_should_contain(context: Any, text: str) -> None: + """Verify the specification contains the given text.""" + assert hasattr(context, "spec_content"), "Specification content not loaded" + assert text in context.spec_content, ( + f"Text not found in specification: {text}" + ) + + @then('the content should contain a table with milestone "{milestone}"') def step_content_contains_milestone_in_table(context: Any, milestone: str) -> None: """Verify the specification contains a milestone in a table."""