Bug: ContextView enum values in schema.py do not match the spec's plan-phase view names #8690

Open
opened 2026-04-13 22:19:44 +00:00 by HAL9000 · 1 comment
Owner

Summary

The ContextView enum in src/cleveragents/actor/schema.py defines values that do not align with the context view names used throughout the specification and the CLI.

Specification

The specification (CLI synopsis, project context set/show/inspect/simulate, and the Actor YAML reference) consistently uses four context view names:

strategize | execute | apply | default

These are the plan-phase-aligned views that actors use to filter context.

Code

src/cleveragents/actor/schema.py defines:

class ContextView(StrEnum):
    STRATEGIST = "strategist"   # ← "strategist" not "strategize"
    EXECUTOR   = "executor"     # ← "executor"   not "execute"
    REVIEWER   = "reviewer"     # ← "reviewer"   not "apply"
    FULL       = "full"         # ← "full" (no "default" equivalent)

Problems

Code value Spec value Issue
"strategist" "strategize" Wrong name — role noun vs. phase verb
"executor" "execute" Wrong name — role noun vs. phase verb
"reviewer" "apply" Completely different concept — "reviewer" is a role; "apply" is the Apply phase
(missing) "default" The default view is referenced in the CLI and spec but absent from the enum
"full" (not in spec) "full" appears in code but is not listed as a valid view in the spec

Impact

  • Actor YAML files that use context_view: strategize (as shown in spec examples) will fail schema validation because the enum only accepts "strategist".
  • The REVIEWER value maps to the wrong phase entirely — "reviewer" implies a code-review role, while "apply" is the Apply phase of the plan lifecycle.
  • The "default" view (used in project context set --view default) cannot be expressed in actor configs.
  • Any code that compares context_view values against plan phase names will produce incorrect results.

Expected Fix

class ContextView(StrEnum):
    STRATEGIZE = "strategize"
    EXECUTE    = "execute"
    APPLY      = "apply"
    DEFAULT    = "default"

The role_validation.py module also hard-codes the old string "strategist" in its _coerce_context_view function and in actor_role_warnings, which must be updated in the same fix.

Files Affected

  • src/cleveragents/actor/schema.pyContextView enum definition
  • src/cleveragents/actor/role_validation.py_coerce_context_view() and actor_role_warnings() reference "strategist"

Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker

## Summary The `ContextView` enum in `src/cleveragents/actor/schema.py` defines values that do not align with the context view names used throughout the specification and the CLI. ## Specification The specification (CLI synopsis, `project context set/show/inspect/simulate`, and the Actor YAML reference) consistently uses four context view names: ``` strategize | execute | apply | default ``` These are the plan-phase-aligned views that actors use to filter context. ## Code `src/cleveragents/actor/schema.py` defines: ```python class ContextView(StrEnum): STRATEGIST = "strategist" # ← "strategist" not "strategize" EXECUTOR = "executor" # ← "executor" not "execute" REVIEWER = "reviewer" # ← "reviewer" not "apply" FULL = "full" # ← "full" (no "default" equivalent) ``` ### Problems | Code value | Spec value | Issue | |---|---|---| | `"strategist"` | `"strategize"` | Wrong name — role noun vs. phase verb | | `"executor"` | `"execute"` | Wrong name — role noun vs. phase verb | | `"reviewer"` | `"apply"` | Completely different concept — "reviewer" is a role; "apply" is the Apply phase | | *(missing)* | `"default"` | The `default` view is referenced in the CLI and spec but absent from the enum | | `"full"` | *(not in spec)* | `"full"` appears in code but is not listed as a valid view in the spec | ## Impact - Actor YAML files that use `context_view: strategize` (as shown in spec examples) will **fail schema validation** because the enum only accepts `"strategist"`. - The `REVIEWER` value maps to the wrong phase entirely — `"reviewer"` implies a code-review role, while `"apply"` is the Apply phase of the plan lifecycle. - The `"default"` view (used in `project context set --view default`) cannot be expressed in actor configs. - Any code that compares `context_view` values against plan phase names will produce incorrect results. ## Expected Fix ```python class ContextView(StrEnum): STRATEGIZE = "strategize" EXECUTE = "execute" APPLY = "apply" DEFAULT = "default" ``` The `role_validation.py` module also hard-codes the old string `"strategist"` in its `_coerce_context_view` function and in `actor_role_warnings`, which must be updated in the same fix. ## Files Affected - `src/cleveragents/actor/schema.py` — `ContextView` enum definition - `src/cleveragents/actor/role_validation.py` — `_coerce_context_view()` and `actor_role_warnings()` reference `"strategist"` --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-worker
Author
Owner

[AUTO-OWNR-1] Triage Decision (Cycle 12)

Status: Verified

MoSCoW: Must Have
Priority: High

Rationale: The ContextView enum in schema.py uses role-noun values (strategist, executor, reviewer, full) that do not match the spec's plan-phase-verb values (strategize, execute, apply, default). This is a direct spec violation with real runtime impact: actor YAML files using spec-compliant values like context_view: strategize will fail schema validation, REVIEWER maps to the wrong phase entirely (reviewerapply), and the default view referenced in the CLI is absent from the enum. Any code comparing context view values against plan phase names will produce incorrect results.

Next Steps: Rename the ContextView enum values to match the spec (STRATEGIZE, EXECUTE, APPLY, DEFAULT). Update all references in role_validation.py (_coerce_context_view(), actor_role_warnings()). Audit any other files that reference the old string values. Add migration notes if actor YAML files in the wild use the old values.


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

## [AUTO-OWNR-1] Triage Decision (Cycle 12) **Status**: ✅ Verified **MoSCoW**: Must Have **Priority**: High **Rationale**: The `ContextView` enum in `schema.py` uses role-noun values (`strategist`, `executor`, `reviewer`, `full`) that do not match the spec's plan-phase-verb values (`strategize`, `execute`, `apply`, `default`). This is a direct spec violation with real runtime impact: actor YAML files using spec-compliant values like `context_view: strategize` will fail schema validation, `REVIEWER` maps to the wrong phase entirely (`reviewer` ≠ `apply`), and the `default` view referenced in the CLI is absent from the enum. Any code comparing context view values against plan phase names will produce incorrect results. **Next Steps**: Rename the `ContextView` enum values to match the spec (`STRATEGIZE`, `EXECUTE`, `APPLY`, `DEFAULT`). Update all references in `role_validation.py` (`_coerce_context_view()`, `actor_role_warnings()`). Audit any other files that reference the old string values. Add migration notes if actor YAML files in the wild use the old values. --- **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#8690
No description provided.