architecture.feature missing three spec-required enforcement scenarios: no type:ignore, no bare except, no SQLAlchemy in CLI #8397

Open
opened 2026-04-13 18:36:23 +00:00 by HAL9000 · 1 comment
Owner

Metadata

Commit: Build: Reinforced label enforcement, and ensure implementation workers dont continue work on a mergable PR.
Branch: main

Background and Context

The project specification (CONTRIBUTING.md) requires that features/architecture.feature enforce four architectural rules via BDD scenarios:

  1. No SQLAlchemy imports in CLI layer
  2. All public methods have return type annotations
  3. No type: ignore comments in source ← MISSING
  4. No bare except clauses ← MISSING

Additionally, rule 1 (no SQLAlchemy in CLI) has no BDD enforcement scenario, even though issue #8386 documents an active violation of this rule. The absence of this test means the violation was not caught by the architecture test suite.

At SHA 5a9aaa79edaefb1a257114f054ea87facb8efe69, features/architecture.feature contains only these scenarios:

  • ADR directory absent after cleanup
  • Package structure follows layering ADR
  • Dependencies follow inversion principle
  • Configuration uses CLEVERAGENTS prefix
  • Type hints are used throughout (partial — checks return types only, not type: ignore)
  • CONTRIBUTING documents LangChain best practices
  • Every source module imports without errors

None of these scenarios check for type: ignore comments, bare except clauses, or SQLAlchemy imports in the CLI layer.

Current Behavior

features/architecture.feature has no scenario that:

  • Scans source files for # type: ignore comments and fails if any are found
  • Scans source files for bare except: or except Exception: pass patterns and fails if any are found
  • Scans src/cleveragents/cli/ for import sqlalchemy or from sqlalchemy and fails if found

Expected Behavior

Per the specification, features/architecture.feature must include scenarios that enforce:

  1. No type: ignore comments — scan all .py files under src/cleveragents/ and assert zero occurrences
  2. No bare except clauses — scan all .py files under src/cleveragents/ and assert zero bare except: or except Exception: pass patterns
  3. No SQLAlchemy imports in CLI layer — scan src/cleveragents/cli/ and assert no sqlalchemy imports

These checks would have caught the existing violation documented in #8386 and the type: ignore usages in features/environment.py.

Acceptance Criteria

  • features/architecture.feature contains a scenario: "No type: ignore comments in source code"
  • features/architecture.feature contains a scenario: "No bare except clauses in source code"
  • features/architecture.feature contains a scenario: "CLI layer does not import SQLAlchemy"
  • features/steps/architecture_steps.py contains step implementations for all three new scenarios
  • All three new scenarios pass on a clean codebase (after fixing known violations)
  • All three new scenarios fail when violations are introduced (regression test)

Subtasks

  • Add Scenario: No type: ignore comments in source code to features/architecture.feature
  • Add Scenario: No bare except clauses in source code to features/architecture.feature
  • Add Scenario: CLI layer does not import SQLAlchemy to features/architecture.feature
  • Implement step_check_no_type_ignore in features/steps/architecture_steps.py
  • Implement step_check_no_bare_except in features/steps/architecture_steps.py
  • Implement step_check_no_sqlalchemy_in_cli in features/steps/architecture_steps.py
  • Verify all new scenarios pass in CI

Definition of Done

This issue is closed when all three new architecture enforcement scenarios exist in features/architecture.feature, have passing step implementations in features/steps/architecture_steps.py, and all three scenarios pass in the CI pipeline.


Automated by CleverAgents Bot
Supervisor: Bug Hunt Pool | Agent: bug-hunt-pool-supervisor

## Metadata **Commit:** `Build: Reinforced label enforcement, and ensure implementation workers dont continue work on a mergable PR.` **Branch:** main ## Background and Context The project specification (CONTRIBUTING.md) requires that `features/architecture.feature` enforce four architectural rules via BDD scenarios: 1. No SQLAlchemy imports in CLI layer 2. All public methods have return type annotations 3. **No `type: ignore` comments in source** ← MISSING 4. **No bare `except` clauses** ← MISSING Additionally, rule 1 (no SQLAlchemy in CLI) has no BDD enforcement scenario, even though issue #8386 documents an active violation of this rule. The absence of this test means the violation was not caught by the architecture test suite. At SHA `5a9aaa79edaefb1a257114f054ea87facb8efe69`, `features/architecture.feature` contains only these scenarios: - ADR directory absent after cleanup - Package structure follows layering ADR - Dependencies follow inversion principle - Configuration uses CLEVERAGENTS prefix - Type hints are used throughout (partial — checks return types only, not `type: ignore`) - CONTRIBUTING documents LangChain best practices - Every source module imports without errors None of these scenarios check for `type: ignore` comments, bare `except` clauses, or SQLAlchemy imports in the CLI layer. ## Current Behavior `features/architecture.feature` has no scenario that: - Scans source files for `# type: ignore` comments and fails if any are found - Scans source files for bare `except:` or `except Exception: pass` patterns and fails if any are found - Scans `src/cleveragents/cli/` for `import sqlalchemy` or `from sqlalchemy` and fails if found ## Expected Behavior Per the specification, `features/architecture.feature` must include scenarios that enforce: 1. **No `type: ignore` comments** — scan all `.py` files under `src/cleveragents/` and assert zero occurrences 2. **No bare `except` clauses** — scan all `.py` files under `src/cleveragents/` and assert zero bare `except:` or `except Exception: pass` patterns 3. **No SQLAlchemy imports in CLI layer** — scan `src/cleveragents/cli/` and assert no `sqlalchemy` imports These checks would have caught the existing violation documented in #8386 and the `type: ignore` usages in `features/environment.py`. ## Acceptance Criteria - [ ] `features/architecture.feature` contains a scenario: "No type: ignore comments in source code" - [ ] `features/architecture.feature` contains a scenario: "No bare except clauses in source code" - [ ] `features/architecture.feature` contains a scenario: "CLI layer does not import SQLAlchemy" - [ ] `features/steps/architecture_steps.py` contains step implementations for all three new scenarios - [ ] All three new scenarios pass on a clean codebase (after fixing known violations) - [ ] All three new scenarios fail when violations are introduced (regression test) ## Subtasks - [ ] Add `Scenario: No type: ignore comments in source code` to `features/architecture.feature` - [ ] Add `Scenario: No bare except clauses in source code` to `features/architecture.feature` - [ ] Add `Scenario: CLI layer does not import SQLAlchemy` to `features/architecture.feature` - [ ] Implement `step_check_no_type_ignore` in `features/steps/architecture_steps.py` - [ ] Implement `step_check_no_bare_except` in `features/steps/architecture_steps.py` - [ ] Implement `step_check_no_sqlalchemy_in_cli` in `features/steps/architecture_steps.py` - [ ] Verify all new scenarios pass in CI ## Definition of Done This issue is closed when all three new architecture enforcement scenarios exist in `features/architecture.feature`, have passing step implementations in `features/steps/architecture_steps.py`, and all three scenarios pass in the CI pipeline. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunt Pool | Agent: bug-hunt-pool-supervisor
HAL9000 added this to the v3.3.0 milestone 2026-04-13 18:42:18 +00:00
Author
Owner

Verified — Missing BDD scenarios for no-type:ignore, no-bare-except, and no-SQLAlchemy-in-CLI enforcement means these rules are not tested. MoSCoW: Must Have for v3.3.0 — architecture enforcement must be verified by tests. [AUTO-OWNR-1]


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

✅ **Verified** — Missing BDD scenarios for no-type:ignore, no-bare-except, and no-SQLAlchemy-in-CLI enforcement means these rules are not tested. **MoSCoW: Must Have** for v3.3.0 — architecture enforcement must be verified by tests. [AUTO-OWNR-1] --- **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#8397
No description provided.