UAT: AutomationProfileService hardcodes "manual" as global default profile — spec requires "supervised" #2056

Open
opened 2026-04-03 03:44:36 +00:00 by freemo · 0 comments
Owner

Background and Context

The AutomationProfileService is responsible for resolving the effective automation profile at every level of the hierarchy (plan, action, project, global config, env var, and hardcoded fallback). The specification (docs/specification.md, Global Configuration Keys table, line 30508) explicitly defines the default value for core.automation-profile as "supervised". The current implementation hardcodes "manual" as the ultimate fallback, contradicting the specification and causing new plans to require human approval for every action by default — the most restrictive possible behaviour — rather than the spec-intended "supervised" mode.

Current Behavior

In src/cleveragents/application/services/automation_profile_service.py:

  • Line 41: _DEFAULT_PROFILE = "manual" — hardcoded fallback constant is wrong.
  • Line 81: return _DEFAULT_PROFILE — this fallback is returned when no profile is configured at any level (plan, action, project, global config, or CLEVERAGENTS_AUTOMATION_PROFILE env var).

The AutomationProfileService.effective_global_default property therefore returns "manual" when the env var is unset and no explicit global default is configured.

Additionally, the BDD feature file features/consolidated_automation_profile.feature contains a scenario titled "Default global is manual when nothing configured" that asserts "manual" — this test is incorrect per the specification and must be updated.

Expected Behavior

Per docs/specification.md (Global Configuration Keys table):

| core.automation-profile | string | supervised | CLEVERAGENTS_AUTOMATION_PROFILE | The default automation profile applied to new plans when no profile is specified at the plan, action, or project level.
  • _DEFAULT_PROFILE must be "supervised".
  • AutomationProfileService.effective_global_default must return "supervised" when no profile is configured at any level.
  • The BDD scenario must assert "supervised", not "manual".

Steps to Reproduce

from cleveragents.application.services.automation_profile_service import AutomationProfileService
service = AutomationProfileService()
assert service.effective_global_default == "supervised"  # FAILS: returns "manual"

Acceptance Criteria

  • _DEFAULT_PROFILE in automation_profile_service.py is "supervised".
  • AutomationProfileService.effective_global_default returns "supervised" when no env var or config is set.
  • The BDD scenario "Default global is manual when nothing configured" is renamed and updated to assert "supervised".
  • The corresponding step implementation in features/steps/automation_profile_service_steps.py is updated.
  • All nox sessions pass with coverage ≥ 97%.

Supporting Information

  • Spec reference: docs/specification.md line 30508, Global Configuration Keys table, core.automation-profile row.
  • Affected files:
    • src/cleveragents/application/services/automation_profile_service.py (lines 41, 81)
    • features/consolidated_automation_profile.feature (scenario "Default global is manual when nothing configured")
    • features/steps/automation_profile_service_steps.py (corresponding step)
  • Discovered during: UAT testing of Epic #362 (Security & Safety Hardening).

Metadata

  • Branch: fix/automation-profile-service-default-supervised
  • Commit Message: fix(automation-profile): correct global default profile from "manual" to "supervised"
  • Milestone: v3.7.0
  • Parent Epic: #362

Subtasks

  • Change _DEFAULT_PROFILE = "manual" to _DEFAULT_PROFILE = "supervised" in src/cleveragents/application/services/automation_profile_service.py line 41
  • Verify line 81 (return _DEFAULT_PROFILE) now returns "supervised" correctly — no further change needed if constant is fixed
  • Update BDD scenario in features/consolidated_automation_profile.feature: rename "Default global is manual when nothing configured" → "Default global is supervised when nothing configured" and update assertion to "supervised"
  • Update corresponding step implementation in features/steps/automation_profile_service_steps.py to assert "supervised"
  • Run nox -e unit_tests — confirm all Behave scenarios pass
  • Run nox -e typecheck — confirm Pyright reports no errors
  • Run nox -e coverage_report — confirm coverage ≥ 97%
  • Run nox (all default sessions) — confirm all quality gates pass

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(automation-profile): correct global default profile from "manual" to "supervised"), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (fix/automation-profile-service-default-supervised).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage ≥ 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Background and Context The `AutomationProfileService` is responsible for resolving the effective automation profile at every level of the hierarchy (plan, action, project, global config, env var, and hardcoded fallback). The specification (`docs/specification.md`, Global Configuration Keys table, line 30508) explicitly defines the default value for `core.automation-profile` as `"supervised"`. The current implementation hardcodes `"manual"` as the ultimate fallback, contradicting the specification and causing new plans to require human approval for every action by default — the most restrictive possible behaviour — rather than the spec-intended `"supervised"` mode. ## Current Behavior In `src/cleveragents/application/services/automation_profile_service.py`: - **Line 41**: `_DEFAULT_PROFILE = "manual"` — hardcoded fallback constant is wrong. - **Line 81**: `return _DEFAULT_PROFILE` — this fallback is returned when no profile is configured at any level (plan, action, project, global config, or `CLEVERAGENTS_AUTOMATION_PROFILE` env var). The `AutomationProfileService.effective_global_default` property therefore returns `"manual"` when the env var is unset and no explicit global default is configured. Additionally, the BDD feature file `features/consolidated_automation_profile.feature` contains a scenario titled **"Default global is manual when nothing configured"** that asserts `"manual"` — this test is incorrect per the specification and must be updated. ## Expected Behavior Per `docs/specification.md` (Global Configuration Keys table): ``` | core.automation-profile | string | supervised | CLEVERAGENTS_AUTOMATION_PROFILE | The default automation profile applied to new plans when no profile is specified at the plan, action, or project level. ``` - `_DEFAULT_PROFILE` must be `"supervised"`. - `AutomationProfileService.effective_global_default` must return `"supervised"` when no profile is configured at any level. - The BDD scenario must assert `"supervised"`, not `"manual"`. ## Steps to Reproduce ```python from cleveragents.application.services.automation_profile_service import AutomationProfileService service = AutomationProfileService() assert service.effective_global_default == "supervised" # FAILS: returns "manual" ``` ## Acceptance Criteria - `_DEFAULT_PROFILE` in `automation_profile_service.py` is `"supervised"`. - `AutomationProfileService.effective_global_default` returns `"supervised"` when no env var or config is set. - The BDD scenario "Default global is manual when nothing configured" is renamed and updated to assert `"supervised"`. - The corresponding step implementation in `features/steps/automation_profile_service_steps.py` is updated. - All nox sessions pass with coverage ≥ 97%. ## Supporting Information - **Spec reference**: `docs/specification.md` line 30508, Global Configuration Keys table, `core.automation-profile` row. - **Affected files**: - `src/cleveragents/application/services/automation_profile_service.py` (lines 41, 81) - `features/consolidated_automation_profile.feature` (scenario "Default global is manual when nothing configured") - `features/steps/automation_profile_service_steps.py` (corresponding step) - **Discovered during**: UAT testing of Epic #362 (Security & Safety Hardening). --- ## Metadata - **Branch**: `fix/automation-profile-service-default-supervised` - **Commit Message**: `fix(automation-profile): correct global default profile from "manual" to "supervised"` - **Milestone**: v3.7.0 - **Parent Epic**: #362 --- ## Subtasks - [ ] Change `_DEFAULT_PROFILE = "manual"` to `_DEFAULT_PROFILE = "supervised"` in `src/cleveragents/application/services/automation_profile_service.py` line 41 - [ ] Verify line 81 (`return _DEFAULT_PROFILE`) now returns `"supervised"` correctly — no further change needed if constant is fixed - [ ] Update BDD scenario in `features/consolidated_automation_profile.feature`: rename "Default global is manual when nothing configured" → "Default global is supervised when nothing configured" and update assertion to `"supervised"` - [ ] Update corresponding step implementation in `features/steps/automation_profile_service_steps.py` to assert `"supervised"` - [ ] Run `nox -e unit_tests` — confirm all Behave scenarios pass - [ ] Run `nox -e typecheck` — confirm Pyright reports no errors - [ ] Run `nox -e coverage_report` — confirm coverage ≥ 97% - [ ] Run `nox` (all default sessions) — confirm all quality gates pass --- ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(automation-profile): correct global default profile from "manual" to "supervised"`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`fix/automation-profile-service-default-supervised`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage ≥ 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.7.0 milestone 2026-04-03 03:44:40 +00:00
freemo self-assigned this 2026-04-03 16:58:12 +00:00
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.

Blocks
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2056
No description provided.