feat(decisions): implement DecisionRecorder service to capture decisions during Strategize phase #4988

Open
opened 2026-04-09 00:20:25 +00:00 by HAL9000 · 3 comments
Owner

Metadata

  • Commit Message: feat(decisions): implement DecisionRecorder service to capture decisions during Strategize phase
  • Branch: feat/m3/decision-recorder-service
  • Milestone: v3.2.0
  • Parent Epic: #4958

Background and Context

The CleverAgents system needs to record all decisions made during the Strategize phase with full context snapshots. Currently, decisions are not persisted to the database, making it impossible to visualize the decision tree or correct decisions later.

This issue implements the DecisionRecorder service that hooks into the Strategize phase and captures each decision with its context, alternatives considered, and rationale.

Expected Behavior

  • DecisionRecorder.record_decision() captures decision ID, context snapshot, alternatives, and rationale
  • Decisions are persisted to the decisions database table
  • Each decision has a ULID identifier
  • Context snapshots include the full actor context at decision time
  • Decisions are linked to their parent plan

Acceptance Criteria

  • DecisionRecorder service class implemented in src/cleveragents/decisions/
  • DecisionRecorder.record_decision(plan_id, context, alternatives, rationale) persists to DB
  • decisions DB table schema matches spec DDL (id, plan_id, context_snapshot, alternatives_json, rationale, created_at)
  • DecisionRecorder is injected into StrategizePhase and called for each decision
  • Unit tests (Behave) cover happy path and error cases
  • Integration test (Robot) verifies decisions appear in DB after plan execution

Subtasks

  • Define decisions DB table schema (migration)
  • Implement DecisionRecorder service class
  • Implement DecisionRecorder.record_decision() with DB persistence
  • Wire DecisionRecorder into StrategizePhase
  • Tests (Behave): Add scenarios for decision recording
  • Tests (Robot): Add integration test for DB persistence
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

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.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planner

## Metadata - **Commit Message**: `feat(decisions): implement DecisionRecorder service to capture decisions during Strategize phase` - **Branch**: `feat/m3/decision-recorder-service` - **Milestone**: v3.2.0 - **Parent Epic**: #4958 ## Background and Context The CleverAgents system needs to record all decisions made during the Strategize phase with full context snapshots. Currently, decisions are not persisted to the database, making it impossible to visualize the decision tree or correct decisions later. This issue implements the `DecisionRecorder` service that hooks into the Strategize phase and captures each decision with its context, alternatives considered, and rationale. ## Expected Behavior - `DecisionRecorder.record_decision()` captures decision ID, context snapshot, alternatives, and rationale - Decisions are persisted to the `decisions` database table - Each decision has a ULID identifier - Context snapshots include the full actor context at decision time - Decisions are linked to their parent plan ## Acceptance Criteria - [ ] `DecisionRecorder` service class implemented in `src/cleveragents/decisions/` - [ ] `DecisionRecorder.record_decision(plan_id, context, alternatives, rationale)` persists to DB - [ ] `decisions` DB table schema matches spec DDL (id, plan_id, context_snapshot, alternatives_json, rationale, created_at) - [ ] `DecisionRecorder` is injected into `StrategizePhase` and called for each decision - [ ] Unit tests (Behave) cover happy path and error cases - [ ] Integration test (Robot) verifies decisions appear in DB after plan execution ## Subtasks - [ ] Define `decisions` DB table schema (migration) - [ ] Implement `DecisionRecorder` service class - [ ] Implement `DecisionRecorder.record_decision()` with DB persistence - [ ] Wire `DecisionRecorder` into `StrategizePhase` - [ ] Tests (Behave): Add scenarios for decision recording - [ ] Tests (Robot): Add integration test for DB persistence - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## 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. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planner
HAL9000 added this to the v3.2.0 milestone 2026-04-09 01:03:37 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — Core decision recording feature required for Decision Intelligence Legendary
  • Milestone: v3.2.0
  • Story Points: 8 — XL
  • MoSCoW: Must Have — Required for Decision Recording Epic (#4958)
  • Parent Epic: #4958

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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — Core decision recording feature required for Decision Intelligence Legendary - **Milestone**: v3.2.0 - **Story Points**: 8 — XL - **MoSCoW**: Must Have — Required for Decision Recording Epic (#4958) - **Parent Epic**: #4958 --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — Core decision recording feature required for Decision Intelligence Legendary
  • Milestone: v3.2.0
  • Story Points: 8 — XL
  • MoSCoW: Must Have — Required for Decision Recording Epic (#4958)
  • Parent Epic: #4958

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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — Core decision recording feature required for Decision Intelligence Legendary - **Milestone**: v3.2.0 - **Story Points**: 8 — XL - **MoSCoW**: Must Have — Required for Decision Recording Epic (#4958) - **Parent Epic**: #4958 --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — Core decision recording feature required for Decision Recording Epic (#4958)
  • Milestone: v3.2.0
  • Story Points: 8 — XL
  • MoSCoW: Must Have — Required for Decision Recording Epic (#4958)
  • Parent Epic: #4958

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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — Core decision recording feature required for Decision Recording Epic (#4958) - **Milestone**: v3.2.0 - **Story Points**: 8 — XL - **MoSCoW**: Must Have — Required for Decision Recording Epic (#4958) - **Parent Epic**: #4958 --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
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.

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