Compare commits

...

8 Commits

Author SHA1 Message Date
HAL9000 0376538ffc fix(spec): add dedicated v3.8.0 heading to resolve BDD test assertion
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Failing after 47s
CI / build (pull_request) Successful in 35s
CI / push-validation (pull_request) Successful in 26s
CI / quality (pull_request) Successful in 1m17s
CI / helm (pull_request) Successful in 45s
CI / typecheck (pull_request) Successful in 1m32s
CI / security (pull_request) Successful in 1m31s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 3m43s
CI / integration_tests (pull_request) Successful in 5m3s
CI / unit_tests (pull_request) Successful in 7m9s
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 4s
The Behave scenario asserts '### v3.8.0 — Server Mode + Cloud Integration'
but no such heading existed in the spec (only a navigation table row).

This adds a full milestone section mirroring v3.2.0–v3.7.0 format:
- Goal, Spec Coverage, Key ADRs
- Deliverables table with 12 items
- Key Architectural Constraints
- Definition of Done

Closes #8195 (fixing root cause of CI unit_tests failure)

ISSUES CLOSED: #8195
2026-05-09 14:58:36 +00:00
HAL9000 bd4072c6cf fix(spec): resolve AmbiguousStep conflict in milestone navigation BDD tests
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 34s
CI / build (pull_request) Successful in 44s
CI / push-validation (pull_request) Successful in 29s
CI / quality (pull_request) Successful in 1m6s
CI / lint (pull_request) Failing after 1m8s
CI / typecheck (pull_request) Successful in 1m18s
CI / security (pull_request) Successful in 1m27s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 3m29s
CI / integration_tests (pull_request) Failing after 4m7s
CI / unit_tests (pull_request) Failing after 6m35s
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
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
2026-05-05 16:10:21 +00:00
HAL9000 a3d410618a fix: remove duplicate step definition and restore CONTRIBUTORS.md entries
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 1m13s
CI / quality (pull_request) Successful in 1m0s
CI / security (pull_request) Successful in 1m26s
CI / typecheck (pull_request) Successful in 1m24s
CI / helm (pull_request) Successful in 33s
CI / push-validation (pull_request) Successful in 32s
CI / build (pull_request) Successful in 39s
CI / e2e_tests (pull_request) Successful in 3m39s
CI / integration_tests (pull_request) Successful in 7m2s
CI / unit_tests (pull_request) Failing after 8m55s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 11m21s
CI / status-check (pull_request) Failing after 2s
CI / benchmark-regression (pull_request) Failing after 1h3m48s
- Remove duplicate @then('the content should contain "{text}"') step from milestone_plan_navigation_steps.py — this step already exists in uko_ontology_registry_steps.py and caused AmbiguousStep errors in Behave (unit_tests CI failure)

- Restore HAL 9000 contribution entries that were accidentally removed from CONTRIBUTORS.md in a prior commit

- Add new CONTRIBUTORS.md entry for the Milestone Plan Navigation section (PR #8195 / issue #7564)
2026-05-02 21:20:41 +00:00
HAL9000 ee39b33700 fix: add missing step definition for generic content contains assertion
CI / lint (pull_request) Failing after 25s
CI / typecheck (pull_request) Successful in 1m13s
CI / security (pull_request) Successful in 54s
CI / quality (pull_request) Successful in 30s
CI / coverage (pull_request) Has been skipped
CI / build (pull_request) Successful in 24s
CI / helm (pull_request) Successful in 35s
CI / e2e_tests (pull_request) Successful in 3m37s
CI / push-validation (pull_request) Successful in 22s
CI / unit_tests (pull_request) Failing after 6m37s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 9m29s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
2026-04-17 08:15:47 +00:00
HAL9000 9549897ef3 fix: remove update_spec.py utility script from repository
CI / lint (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 32s
CI / security (pull_request) Successful in 33s
CI / unit_tests (pull_request) Has been cancelled
CI / e2e_tests (pull_request) Has been cancelled
CI / integration_tests (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / benchmark-regression (pull_request) Has been cancelled
CI / benchmark-publish (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / helm (pull_request) Has been cancelled
CI / push-validation (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
CI / quality (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
2026-04-17 07:22:05 +00:00
HAL9000 b3547e7692 fix: resolve lint and duplicate step definition issues in milestone plan navigation tests
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 22s
CI / lint (pull_request) Successful in 25s
CI / push-validation (pull_request) Successful in 27s
CI / helm (pull_request) Successful in 27s
CI / quality (pull_request) Successful in 39s
CI / typecheck (pull_request) Successful in 54s
CI / security (pull_request) Successful in 56s
CI / e2e_tests (pull_request) Successful in 4m3s
CI / integration_tests (pull_request) Successful in 4m6s
CI / unit_tests (pull_request) Failing after 5m39s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m35s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-regression (pull_request) Successful in 57m27s
- Fix import ordering: move pathlib before typing, add blank line before third-party imports
- Remove unnecessary 'r' mode argument from open() call (defaults to read mode)
- Remove duplicate step definition for 'the content should contain' that already exists in uko_ontology_registry_steps.py
- Keep only unique step definitions specific to milestone plan navigation

This resolves the CI failures:
- ruff I001 import block unsorted error
- ruff UP015 unnecessary mode argument error
- behave AmbiguousStep duplicate step definition error
2026-04-14 22:40:11 +00:00
HAL9000 1aa0c2a499 fix(spec): align Behave test expectation with specification text
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Failing after 30s
CI / security (pull_request) Successful in 52s
CI / typecheck (pull_request) Successful in 1m2s
CI / quality (pull_request) Successful in 45s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / build (pull_request) Successful in 18s
CI / helm (pull_request) Successful in 29s
CI / push-validation (pull_request) Successful in 25s
CI / e2e_tests (pull_request) Successful in 3m32s
CI / integration_tests (pull_request) Successful in 5m10s
CI / unit_tests (pull_request) Failing after 8m16s
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 2s
The test was expecting 'Milestone Plan Navigation section provides a quick reference'
but the specification contains 'This navigation section provides a quick reference'.
Updated the test to match the actual specification content.
2026-04-14 05:45:12 +00:00
HAL9000 a3b01ef785 docs(spec): add Milestone Plan navigation section
CI / push-validation (pull_request) Successful in 18s
CI / helm (pull_request) Successful in 23s
CI / build (pull_request) Successful in 24s
CI / lint (pull_request) Failing after 39s
CI / security (pull_request) Successful in 54s
CI / typecheck (pull_request) Successful in 1m16s
CI / quality (pull_request) Successful in 3m39s
CI / coverage (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 4m0s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 4m25s
CI / integration_tests (pull_request) Successful in 4m38s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
Add comprehensive Milestone Plan Navigation section to specification mapping
milestones v3.2.0 through v3.8.0 to their key architectural features and
specification coverage areas. Includes Navigation by Feature index for
cross-milestone lookups. Extends milestone coverage to v3.8.0 (Server Mode +
Cloud Integration). Improves specification navigability.

Also add BDD test suite to verify Milestone Plan Navigation documentation
exists and is properly formatted.

ISSUES CLOSED: #7564
2026-04-13 04:24:01 +00:00
5 changed files with 220 additions and 1 deletions
+8
View File
@@ -7,6 +7,14 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added
- **Milestone Plan Navigation Section** (#7564): Added a comprehensive navigation table
to the specification's Milestone Plan section, mapping milestones v3.2.0 through v3.8.0
to their key architectural features and specification coverage areas. Includes a
"Navigation by Feature" index for quick cross-milestone lookups. Extends milestone
coverage from v3.7.0 to v3.8.0 (Server Mode + Cloud Integration). Improves specification
navigability and helps users understand the relationship between milestones and
architectural components.
- **Git Worktree Sandbox Apply** (#4454): The `plan apply` command now merges
LLM-generated changes via `git merge` from an isolated worktree branch
instead of flat `shutil.copy2`. Displays spec-aligned Apply Summary
+11
View File
@@ -14,4 +14,15 @@ Below are some of the specific details of various contributions.
* Jeffrey Phillips Freeman has acted as Lead Developer, daily contributor, and Project Owner.
* Brent E. Edwards has contributed quality assurance, test coverage, and CI pipeline improvements.
* HAL 9000 has contributed automated implementation, bug fixes, and feature development as part of the CleverAgents automation pool.
* HAL 9000 has contributed concurrency safety improvements, including thread-safe context tier management (issue #7547) for parallel plan execution.
* HAL 9000 has contributed the plan concurrency race-condition fix (#7989): wired `LockService` into the plan lifecycle, guarding `execute_plan()` and `apply_plan()` with plan-level advisory locks and unique per-invocation owner identities to prevent silent concurrent state corruption.
* HAL 9000 has contributed the bug-hunt-pool-supervisor non-blocking tracking fix: updated step 5 to be best-effort and added rule 9 to prevent the automation-tracking-manager call from blocking the main supervisor loop.
* HAL 9000 has contributed the plugin entry point security hardening fix (#7476): enforced entry point allowlist validation before importing plugin modules to prevent malicious plugin loading.
* HAL 9000 has contributed the benchmark workflow separation (#9040): moved the benchmark-regression job out of the default PR workflow into a dedicated scheduled workflow, reducing median PR CI turnaround time from 99-132 minutes to under 30 minutes.
* This project was made possible thanks to considerable donation of time, money, and resources by CleverThis, Inc.
* HAL 9000 has contributed automated bug fixes, CLI output formatting improvements, and ongoing maintenance as part of the CleverAgents automation system.
* HAL 9000 has contributed the file edit encoding parameter fix (PR #8258 / issue #7559).
* HAL 9000 has contributed the architecture-pool-supervisor milestone assignment feature (PR #8188 / issue #7521): added `forgejo_update_pull_request` permission and documented the PR workflow for major spec changes, enabling automatic milestone assignment for specification PRs.
* HAL 9000 has contributed the git worktree TOCTOU race condition fix (PR #8178 / issue #7507): replaced the unsafe mkdtemp() + rmdir() pattern with a parent-directory approach to eliminate the race window in concurrent git worktree operations.
* HAL 9000 has contributed the Milestone Plan Navigation section (PR #8195 / issue #7564): added a comprehensive navigation table mapping milestones v3.2.0v3.8.0 to their key architectural features and specification coverage areas, along with a Navigation by Feature index and BDD test coverage.
+65 -1
View File
@@ -46797,7 +46797,7 @@ The following table shows which Protocol each pipeline slot implements and what
## Milestone Plan
This section defines the ordered milestone plan for CleverAgents v3.x, mapping architectural features to verifiable deliverables. Each milestone builds on the previous and is independently testable. Milestones v3.0.0 and v3.1.0 are **complete**. This plan covers v3.2.0 through v3.7.0 — the production-ready target.
This section defines the ordered milestone plan for CleverAgents v3.x, mapping architectural features to verifiable deliverables. Each milestone builds on the previous and is independently testable. Milestones v3.0.0 and v3.1.0 are **complete**. This plan covers v3.2.0 through v3.8.0 — the production-ready target.
!!! note "Milestone Status (as of 2026-04-08)"
- **v3.0.0** ✅ CLOSED — Minimal Local Source-Code Workflow
@@ -46808,6 +46808,28 @@ This section defines the ordered milestone plan for CleverAgents v3.x, mapping a
- **v3.5.0** 🔄 IN PROGRESS — Autonomy Hardening (486 open / 188 closed)
- **v3.6.0** 🔄 IN PROGRESS — Advanced Concepts & Deferred Features (162 open / 150 closed)
- **v3.7.0** 🔄 IN PROGRESS — TUI Implementation (461 open / 403 closed)
- **v3.8.0** 🔄 PLANNED — Server Mode + Cloud Integration (0 open / 0 closed)
### Milestone Plan Navigation
This navigation section provides a quick reference mapping each milestone to its key architectural features and specification coverage areas.
| Milestone | Goal | Key Features | Spec Coverage |
|-----------|------|--------------|----------------|
| **v3.2.0** | Decisions + Validations + Invariants | Decision tree recording, invariant enforcement, decision correction (revert/append), validation framework | [Decision Tree](#decision-tree-and-correction), [Invariant System](#invariant-system), [Validation Abstraction](#validation-abstraction) |
| **v3.3.0** | Corrections + Subplans + Checkpoints | Subplan spawning, parallel execution, three-way merge, checkpoint/rollback, selective subtree recomputation | [Subplan Architecture](#subplan-architecture), [Checkpoint and Rollback](#checkpoint-and-rollback), [Merge Strategies](#merge-strategies), [Correction Model](#correction-model) |
| **v3.4.0** | ACMS v1 + Context Scaling | Context policies, budget enforcement, context assembly pipeline, UKO ontology, hot/warm/cold tiers, 10k+ file indexing | [ACMS Architecture](#acms-advanced-context-management-system), [Context Assembly Pipeline](#context-assembly-pipeline), [UKO Ontology](#uko-universal-knowledge-ontology), [Context Storage Tiers](#context-storage-tiers) |
| **v3.5.0** | Autonomy Hardening | A2A facade, event queue, guard enforcement, automation profiles, safety profiles, hierarchical decomposition (4+ levels), parallel execution (10+ subplans), validation-gated apply | [Automation Profiles](#automation-profiles), [Safety Profiles](#safety-profiles), [A2A Facade](#agent-to-agent-protocol-a2a), [Guard Enforcement](#guard-enforcement), [Event Queue](#event-queue) |
| **v3.6.0** | Advanced Concepts & Deferred Features | LSP integration, resource type inheritance, devcontainer auto-discovery, container tool execution, additional LLM backends, pluggable scope chain, cost/session budgets, E2E workflow tests | [LSP Integration](#lsp-integration), [Resource Type Inheritance](#resource-type-inheritance), [Devcontainer Integration](#devcontainer-integration), [Container Resource Types](#container-resource-types), [Provider Registry](#provider-registry) |
| **v3.7.0** | TUI Implementation | Textual-based MainScreen, sidebar states, persona system, reference/command input modes, session persistence, multi-session tabs, settings/session management, loading states, safety confirmations | [TUI Architecture](#tui), [Persona System](#persona-system), [Reference and Command System](#reference-and-command-system), [TUI Materializer](#tui-materializer) |
| **v3.8.0** | Server Mode + Cloud Integration | Multi-user server backend, namespace resolution, remote plan execution, cloud resource provisioning, distributed execution, server-mode A2A routing, authentication/authorization | [Server Architecture](#server-and-client-architecture), [Cloud Resource Types](#cloud-resource-types), [Distributed Execution](#distributed-execution), [Authentication](#authentication-and-authorization) |
**Navigation by Feature**:
- **Plan Lifecycle**: v3.2.0 (decisions), v3.3.0 (subplans/checkpoints), v3.5.0 (autonomy)
- **Context Management**: v3.4.0 (ACMS v1), v3.6.0 (LSP integration)
- **User Interface**: v3.7.0 (TUI), v3.8.0 (server web UI)
- **Execution Environment**: v3.6.0 (containers), v3.8.0 (cloud)
- **Quality & Testing**: All milestones (97%+ coverage, BDD tests, quality gates)
---
@@ -47066,6 +47088,48 @@ This section defines the ordered milestone plan for CleverAgents v3.x, mapping a
---
### v3.8.0 — Server Mode + Cloud Integration
**Goal**: Deploy a multi-user server backend with remote plan execution, cloud resource provisioning, and server-mode A2A routing over HTTP.
**Spec Coverage**: [Server Architecture](#server-and-client-architecture), [Cloud Resource Types](#cloud-resource-types), [Distributed Execution](#distributed-execution), [Authentication](#authentication-and-authorization)
**Key ADRs**: [ADR-023: Server Mode](adr/ADR-023-server-mode.md), [ADR-047: ACP Standard Adoption](adr/ADR-047-acp-standard-adoption.md), [ADR-048: Server Application Architecture](adr/ADR-048-server-application-architecture.md)
#### Deliverables
| # | Deliverable | Spec Reference | Verifiable Check |
|---|-------------|----------------|-----------------|
| 1 | Multi-user server backend accepts remote plan requests | §Server and Client Architecture | Server starts; HTTP POST `/api/v1/agents/plans` returns plan ID |
| 2 | Namespace resolution for team/org scoping of plans | §Namespace System | `local/foo` resolved to owner; `org/bar` routed to org-scoped execution |
| 3 | Remote plan execution via A2A over HTTP (JSON-RPC 2.0) | §A2A Protocol — Server Mode | Remote client triggers `plan execute`; results returned via SSE streaming |
| 4 | Cloud resource provisioning stubs for sandbox environments | §Cloud Resource Types | Cloud provider config loaded; `NotImplementedError` raised for actual provision |
| 5 | Distributed execution with configurable concurrency limits | §Distributed Execution | Subplans execute across agents; parallel degree bounded by config |
| 6 | Server-mode A2A routing with namespace awareness | §ACP Standard Adoption, Server Mode | Server dispatches plan events to correct namespace-bound workers |
| 7 | Authentication and authorization for server endpoints | §Authentication and Authorization | Unauthenticated request returns 401; wrong token returns 403 |
| 8 | Server-mode session persistence in PostgreSQL | §Database Schema — Multi-tenant | Session state stored in remote DB; resumed across restarts |
| 9 | `agents plan execute` with `--server` flag triggers remote execution | §CLI Commands — plan execute | Local CLI forwards request to server; output matches local mode |
| 10 | Server-mode event streaming (SSE) for plan lifecycle updates | §A2A Protocol — Server Mode | Client subscribes to SSE endpoint; receives real-time phase transition events |
| 11 | Cloud resource type support: VM, container, and storage provisioning | §Cloud Resource Types | `fs-mount` and `fs-directory` cloud variants create sandbox environments |
| 12 | Test coverage ≥ 97% | §Quality Gates | `nox -s coverage_report` passes |
#### Key Architectural Constraints
- **Server/client duality**: CLI works in local mode (default) or server mode (`--server`); all server-mode operations route through A2A over HTTP, not direct database access.
- **A2A exclusivity**: All client-server communication uses A2A protocol (JSON-RPC 2.0); no REST API bypasses.
- **Namespace isolation**: Plans scoped to namespaces prevent cross-team interference; namespace resolution is required before any execution.
- **Cloud resource stubs**: Cloud SDK integration is planned for v3.8.0+; stubs validate configuration but raise `NotImplementedError` for sandbox provisioning.
- **PostgreSQL backend**: Server mode uses PostgreSQL instead of SQLite; session persistence stored in remote DB at configured endpoint.
#### Definition of Done
- All 12 deliverables verified by automated tests
- `nox` passes with coverage ≥ 97%
- No open P0/P1 bugs in v3.8.0 milestone
- Full server-mode end-to-end: start server, authenticate, create remote plan, execute, stream results, verify output
---
### Cross-Milestone Quality Gates
These quality gates apply to **every milestone** and must pass before a milestone is considered complete:
@@ -0,0 +1,65 @@
Feature: Milestone Plan Navigation Section
As a user reading the CleverAgents specification
I want to quickly navigate between milestones and understand their relationships
So that I can find relevant architectural features and specification coverage
Background:
Given the specification file exists at "docs/specification.md"
Scenario: Milestone Plan Navigation section exists
When I read the specification file
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
Then the content should contain a table with milestone "v3.2.0"
And the content should contain a table with milestone "v3.3.0"
And the content should contain a table with milestone "v3.4.0"
And the content should contain a table with milestone "v3.5.0"
And the content should contain a table with milestone "v3.6.0"
And the content should contain a table with milestone "v3.7.0"
And the content should contain a table with milestone "v3.8.0"
Scenario: v3.2.0 milestone has explicit acceptance criteria
When I read the specification file
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 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 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 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 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 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)"
@@ -0,0 +1,71 @@
"""Step definitions for Milestone Plan Navigation specification tests."""
from pathlib import Path
from typing import Any
from behave import given, then, when
@given('the specification file exists at "{filepath}"')
def step_specification_file_exists(context: Any, filepath: str) -> None:
"""Verify the specification file exists."""
spec_path = Path(filepath)
assert spec_path.exists(), f"Specification file not found at {filepath}"
context.spec_path = spec_path
@when("I read the specification file")
def step_read_specification_file(context: Any) -> None:
"""Read the specification file content."""
spec_path = getattr(context, "spec_path", Path("docs/specification.md"))
with open(spec_path, encoding="utf-8") as f:
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."""
assert hasattr(context, "spec_content"), "Specification content not loaded"
# Check for milestone in table format (| **v3.X.0** |)
table_entry = f"| **{milestone}** |"
assert table_entry in context.spec_content, (
f"Milestone {milestone} not found in table"
)
@then('the content should NOT contain "{text}"')
def step_content_not_contains(context: Any, text: str) -> None:
"""Verify the specification does not contain the given text."""
assert hasattr(context, "spec_content"), "Specification content not loaded"
assert text not in context.spec_content, (
f"Text should not be in specification: {text}"
)
@then('the content should contain "{text}" in the milestone status')
def step_content_contains_in_milestone_status(context: Any, text: str) -> None:
"""Verify the specification contains text in the milestone status section."""
assert hasattr(context, "spec_content"), "Specification content not loaded"
# Find the milestone status section
status_start = context.spec_content.find('!!! note "Milestone Status')
assert status_start != -1, "Milestone Status section not found"
# Find the next section after milestone status
next_section = context.spec_content.find("###", status_start + 1)
if next_section == -1:
status_section = context.spec_content[status_start:]
else:
status_section = context.spec_content[status_start:next_section]
assert text in status_section, (
f"Text '{text}' not found in Milestone Status section"
)