Skip to content

(CODUX-69) Capture self-reflection ratings - #2624

Merged
numnx merged 1 commit into
feature/CODUX-180-self-reflection-ratingfrom
task/feature-codux-180-self-reflection-rating-t01-codex-mramzpd4
Jul 7, 2026
Merged

(CODUX-69) Capture self-reflection ratings#2624
numnx merged 1 commit into
feature/CODUX-180-self-reflection-ratingfrom
task/feature-codux-180-self-reflection-rating-t01-codex-mramzpd4

Conversation

@numnx

@numnx numnx commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Capture self-reflection ratings

Automated task PR opened by Code UX for T01.

📋 Summary

Sprint: Sprint 180 · Self Reflection Rating · Task: T01

Expose each task agent's self-reflection as a persisted 5-star rating, surface the latest rating on Tasks and Live task cards, and show per-section ratings in an accessible hover/focus overlay.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-07 12:40:08 UTC
Finished 2026-07-07 12:49:15 UTC
Duration 9m 7s

📊 Token Usage

Metric Value
Input tokens 142,024
Cached input tokens 3,134,464
Output tokens 20,065
Total tokens 3,296,553
Invocations 1
Tool calls 80
Active time 8m 19s

Included usage estimate (subscription/local login): $2.88

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Add a backend capture path for structured self-reflection ratings so each completed task run can persist an overall 0-5 rating plus per-section ratings.

## Scope
- Create `src/contracts/task-self-reflection-types.ts`
- Create `src/repositories/task-self-reflection-rating-repository.ts`
- Edit `src/repositories/db/app-db-schema.ts`
- Edit `src/repositories/db/app-db-migrations.ts`
- Edit `src/services/cli-workflow/pipeline/memory-capture-stage.ts`
- Edit `src/services/cli-workflow/pipeline/pipeline-context.ts`
- Edit `src/app/dependency-factory/core-factory.ts`
- Edit `src/repositories/settings-defaults.ts`
- Add or update tests under `tests/backend/services/cli-workflow/pipeline/memory-capture-stage.test.ts` and `tests/backend/repositories/task-self-reflection-rating-repository.test.ts`

## Implementation Requirements
1. Define `TaskSelfReflectionRating` and `TaskSelfReflectionSectionRating` contracts with `overallRating`, `sections`, `sourceTaskRunId`, `capturedAt`, and normalized section labels/ratings.
2. Add a `task_self_reflection_ratings` SQLite table with project, sprint, task, task run, overall rating, section JSON, timestamps, cascade foreign keys, and indexes for latest-by-task lookup.
3. Implement a repository that upserts one rating per task run and returns the latest rating map for a list of task ids.
4. Extend `.task-learnings.md` capture to parse an optional `## Self Reflection Rating` section, accepting an `Overall: N/5` line and bullet lines such as `- Implementation: 4/5 - note`.
5. Wire the repository through the CLI workflow pipeline context and core dependency factory so task runs capture ratings when memory capture reads `.task-learnings.md`.
6. Extend the default `workerLearningsInstruction` to ask workers for a self-reflection rating section without breaking existing category learning capture.

## Constraints
- Do not require a rating section for successful memory capture; absence of ratings must be a no-op.
- Clamp or reject invalid ratings safely so malformed worker output cannot crash task finalization.
- Keep memory entries and self-reflection ratings as separate persisted concepts; do not store UI-only rating data in `memories`.
- Do not change provider execution behavior or task status transitions.
- Preserve existing `.task-learnings.md` parsing for `## Category:` sections.

## Verification
- Run `pnpm run test:backend -- tests/backend/services/cli-workflow/pipeline/memory-capture-stage.test.ts tests/backend/repositories/task-self-reflection-rating-repository.test.ts`.
- Run `pnpm run lint`.
- Success means valid rating sections create one latest rating per task run, missing or malformed rating sections do not fail memory capture, and existing learning bullets still capture as before.
🌿 Branch Info

Base: feature/CODUX-180-self-reflection-rating
Head: task/feature-codux-180-self-reflection-rating-t01-codex-mramzpd4


🤖 Generated by Code UX

@numnx
numnx merged commit 26e209a into feature/CODUX-180-self-reflection-rating Jul 7, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-180-self-reflection-rating-t01-codex-mramzpd4 branch July 7, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant