Tinker
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Home
Comments
197
Details
197
Go back
Delete
Edit
Id
197
Ticket
Add confidence field (0-100) to approvals and proposals
Agent
tinker-reviewer
Content
## Code Review ### Spec Pattern Search (REQUIRED) - Searched for existing spec patterns: `find spec -name "*spec.rb" | sort` - Found existing spec files: - spec/models/proposal_spec.rb ✓ - spec/requests/api/v1/mcp_spec.rb ✓ - spec/factories/proposals.rb ✓ - spec/features/proposals_spec.rb ✓ - spec/requests/proposals_spec.rb ✓ - Similar patterns found: All relevant spec files exist and were mostly updated ### Test Results - Test suite run: `bundle exec rspec` - Results: 714 examples, **3 failures**, 7 pending ### Test Failure Analysis **Pre-existing failures (2)** - Unrelated to this PR: 1. spec/features/dashboard_spec.rb:4 - Dashboard content issue 2. spec/features/dashboard_spec.rb:17 - Kanban link issue **NEW failure caused by this PR (1)**: 3. spec/features/proposals_spec.rb:20 - `ActiveRecord::RecordInvalid: Validation failed: Confidence is not a number` **Root Cause**: `spec/features/proposals_spec.rb:21` still uses `confidence: "high"` (string) but the migration changed confidence to integer (0-100). The PR updated: - ✓ spec/factories/proposals.rb (default changed to 50) - ✓ spec/models/proposal_spec.rb (validation test updated) - ✓ spec/requests/api/v1/mcp_spec.rb (uses numeric values like 75) But **missed updating**: - ✗ spec/features/proposals_spec.rb (still uses confidence: "high" string) ### Spec Coverage Check - Files changed: - db/migrate/20251231171527_*.rb - Migration file - app/models/proposal.rb - Model validation change - app/models/ticket.rb - Added worker_confidence, reviewer_confidence - app/avo/resources/proposal.rb - Avo admin UI - app/controllers/api/v1/mcp_controller.rb - API schema - app/controllers/proposals_controller.rb - Filter logic - app/helpers/proposals_helper.rb - Badge helper - app/views/proposals/index.html.haml - UI filter - app/serializers/ticket_serializer.rb - Added confidence fields - spec/factories/proposals.rb - Updated ✓ - spec/models/proposal_spec.rb - Updated ✓ - spec/requests/api/v1/mcp_spec.rb - Updated ✓ - Required specs found: Most present - **Missing spec update**: spec/features/proposals_spec.rb line 21 needs `confidence: 75` instead of `confidence: "high"` ### Findings - **Database migration**: Good approach with proper data mapping (low→25, medium→50, high→75) ✓ - **Model validations**: Correctly changed from enum to numericality ✓ - **API schema**: Updated to use integer type with min/max ✓ - **UI updates**: Numeric input and color-coded badges ✓ - **Worker/Reviewer confidence**: Added to tickets model ✓ - **Code quality**: Clean implementation - **Security**: No issues detected - **Implementation**: Matches ticket requirements - **Breaking changes**: Migration handles data conversion properly ### Decision **FAIL - Test Suite Not Passing** The PR has good implementation but a single test file wasn't updated: `spec/features/proposals_spec.rb:21` uses `confidence: "high"` which must be changed to `confidence: 75`. Once this one-line fix is applied, all tests should pass (the other 2 failures are pre-existing).
Comment type
code_review
Avo
· © 2026 AvoHQ ·
v3.27.0
Close modal
Are you sure?
Yes, I'm sure
No, cancel