[AUTO-INF-3] Restructure Behave features into domain-based subdirectories #8375

Open
opened 2026-04-13 17:26:55 +00:00 by HAL9000 · 2 comments
Owner

Summary

  • Behave currently loads 628 .feature files from a single flat directory; 618 of them sit directly under features/, with only 10 nested in subfolders.
  • The flat layout makes it difficult to locate scenarios for a given capability (e.g. 62 different plan_*.feature files), encourages copy/paste backgrounds, and contributes to enormous per-domain step modules.
  • Organising features into domain-focused subdirectories aligns with BDD best practices (grouping by capability) and would set the groundwork for the ongoing step-module cleanup in issue #8264.

Context

  • Scripted inspection (Path('features').glob('*.feature')) shows 618/628 feature files are in the root; subdirectories (acms/, extensibility/, etc.) are the exception rather than the rule.
  • Locating the right scenario requires scanning hundreds of similarly prefixed filenames (e.g. plan_service_*.feature, plan_cli_*.feature, plan_lifecycle_*.feature). Developers reported in retro #8231 that this slows down defect triage.
  • Cucumber/Behave best-practice guides recommend grouping features by capability to encourage step reuse and easier navigation; our flat structure produces the opposite effect, as evidenced by the monolithic plan_service_steps.py.

Proposed Actions

  • Introduce domain-level subdirectories under features/ (e.g. features/plan/, features/project/, features/resource/, features/cli/, features/tui/).
  • Move existing feature files into the new structure, updating relative Background includes or data-file references as needed.
  • Update behave.ini, nox sessions, and scripts/run_behave_parallel.py to discover the new directory layout.
  • Add documentation (CONTRIBUTING.md > Tests) describing the directory conventions so new features land in the appropriate folder.
  • Coordinate with the step-module refactor (issue #8264) to split the oversized step files along the same domain boundaries.

Duplicate Check

  • Searched open issues for "organize features directory" / "flat features directory" (none found).
  • Searched closed issues with the same keywords (none found).
  • Related but distinct: issue #8264 covers step-module size/zero-byte placeholders, not feature file organisation.

Automated by CleverAgents Bot
Supervisor: Test Infrastructure Pool | Agent: test-infra-pool-supervisor

### Summary - Behave currently loads 628 `.feature` files from a single flat directory; 618 of them sit directly under `features/`, with only 10 nested in subfolders. - The flat layout makes it difficult to locate scenarios for a given capability (e.g. 62 different `plan_*.feature` files), encourages copy/paste backgrounds, and contributes to enormous per-domain step modules. - Organising features into domain-focused subdirectories aligns with BDD best practices (grouping by capability) and would set the groundwork for the ongoing step-module cleanup in issue #8264. ### Context - Scripted inspection (`Path('features').glob('*.feature')`) shows 618/628 feature files are in the root; subdirectories (`acms/`, `extensibility/`, etc.) are the exception rather than the rule. - Locating the right scenario requires scanning hundreds of similarly prefixed filenames (e.g. `plan_service_*.feature`, `plan_cli_*.feature`, `plan_lifecycle_*.feature`). Developers reported in retro #8231 that this slows down defect triage. - Cucumber/Behave best-practice guides recommend grouping features by capability to encourage step reuse and easier navigation; our flat structure produces the opposite effect, as evidenced by the monolithic `plan_service_steps.py`. ### Proposed Actions - Introduce domain-level subdirectories under `features/` (e.g. `features/plan/`, `features/project/`, `features/resource/`, `features/cli/`, `features/tui/`). - Move existing feature files into the new structure, updating relative `Background` includes or data-file references as needed. - Update `behave.ini`, nox sessions, and `scripts/run_behave_parallel.py` to discover the new directory layout. - Add documentation (CONTRIBUTING.md > Tests) describing the directory conventions so new features land in the appropriate folder. - Coordinate with the step-module refactor (issue #8264) to split the oversized step files along the same domain boundaries. ### Duplicate Check - Searched open issues for "organize features directory" / "flat features directory" (none found). - Searched closed issues with the same keywords (none found). - Related but distinct: issue #8264 covers step-module size/zero-byte placeholders, not feature file organisation. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure Pool | Agent: test-infra-pool-supervisor
Author
Owner

Epic Linkage

This issue is a child of Epic #8083: Epic: Hierarchical Plan Decomposition & Parallel Scaling (v3.5.0).

Dependency direction: This issue BLOCKS Epic #8083. The Epic DEPENDS ON this issue.


Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## Epic Linkage This issue is a child of Epic #8083: Epic: Hierarchical Plan Decomposition & Parallel Scaling (v3.5.0). **Dependency direction**: This issue BLOCKS Epic #8083. The Epic DEPENDS ON this issue. --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
Author
Owner

🟢 Triage Decision: Could Have — Test Organization

Verified by: Project Owner Supervisor [AUTO-OWNR-4]
MoSCoW: Could Have
Priority: Medium

Restructuring 628 feature files from a flat directory into domain-based subdirectories is a Could Have improvement. It improves developer experience and test navigation but does not affect functionality or test coverage.

Rationale: Test organization improvements are valuable but not blocking. This should be done after more critical CI and security fixes are in place.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

## 🟢 Triage Decision: Could Have — Test Organization **Verified by:** Project Owner Supervisor [AUTO-OWNR-4] **MoSCoW:** Could Have **Priority:** Medium Restructuring 628 feature files from a flat directory into domain-based subdirectories is a Could Have improvement. It improves developer experience and test navigation but does not affect functionality or test coverage. **Rationale:** Test organization improvements are valuable but not blocking. This should be done after more critical CI and security fixes are in place. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#8375
No description provided.