Skip to content

lisa/control-suggestion-state-api#425

Merged
gusfcarvalho merged 2 commits into
mainfrom
lisa/control-suggestion-state-api
Jun 18, 2026
Merged

lisa/control-suggestion-state-api#425
gusfcarvalho merged 2 commits into
mainfrom
lisa/control-suggestion-state-api

Conversation

@ccf-lisa

@ccf-lisa ccf-lisa Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

automated implementation by lisa.

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings inline (1 Medium, 2 Low — non-blocking). Solid change overall: cross-cell aggregation is order-independent and well-tested, latest-per-control supersession is correct, and writes are transaction-gated. Headline: outcome is derived from newly-inserted rows rather than from whether the LLM matched the control, so capped/excluded/rerun-deduped controls record no_match despite a real match — worth confirming the UI cross-references pending suggestions. Two redundant indexes noted.

Comment thread internal/service/worker/dashboard_suggestion_worker.go
Comment thread internal/service/relational/suggestions/models.go Outdated
Comment thread internal/service/relational/suggestions/models.go Outdated

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three findings from the prior round are addressed in fbe957b and verified:

  • Medium (outcome derivation)recordControlResultsTx now decides matched from matchedControlKeySet(validation.Mappings) (LLM-matched controls) rather than insert success, while SuggestionCount stays on newly-inserted counts. A control whose mappings were capped / excluded / rerun-deduped now correctly records outcome: matched, suggestion_count: 0, with a new test covering the run-cap case. No-match upserts still DO NOTHING, so a later empty cell cannot downgrade an earlier match.
  • Low — redundant index dropped from both RunID and Outcome gorm tags; the composite unique index (run_id, control_catalog_id, control_id) is intact for the upsert conflict target.

Verified locally: go build ./... clean, worker + suggestions packages pass. CI green. LGTM.

@ccf-lisa

ccf-lisa Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

PR approved. Marking as ready for e2e.

@gusfcarvalho gusfcarvalho merged commit 2c85af6 into main Jun 18, 2026
4 checks passed
@gusfcarvalho gusfcarvalho deleted the lisa/control-suggestion-state-api branch June 18, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant