feat: show confidence level on AI field marker - #9901
Open
tomivirkki wants to merge 12 commits into
Open
Conversation
Data model for AI source tracking, shared by all controllers: the snippets the model read, their page and rectangle when the source has them, and a confidence level. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Opt-in via FormAIController.setSourceTrackingEnabled. When on, the fill_form tool description asks the LLM to wrap each value it fills in an envelope carrying the snippets it read, their locations, and a confidence level. The reported source is available from FieldValueChangeEvent.getFieldSource and FormAIController.getFieldSource, can be restored after a reload with restoreFieldSource, and lasts as long as the field holds the value it was reported with. Bad source data is dropped and logged, never blocking the value. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Line-removal and operator mutation over the feature's changed lines found untested behavior: rect and page boundary values, the page-region location without a rect, object-shaped extracts, drop-path logging, null-guard messages, stale-source cleanup on value revert, and ValueSource extracts normalization. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A fill_form write carrying no source kept the field's earlier entry, and when the written value matched the one that source was recorded with, getFieldSource described the new write with a citation it never had. Every successful write now replaces the source, clearing it when none was reported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A page number beyond the int range truncated to its low 32 bits in asInt() and could pass the range check as a wrong page. Whole-number floats (e.g. 2.0) are now accepted, consistent with how integer fields convert values. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Stale entries were dropped only when getFieldSource read them, so an application consuming sources through the change event alone — or a field edited and then removed from the form — accumulated entries for the life of the controller. Behavior of the getters is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The enum said "source" where the wording the LLM sees says "document"; a reader comparing the two saw different meanings for the same level. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
When source tracking is on and the model reported a confidence level for a filled value, the automatic field marker now shows it via the marker's confidence indicator. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A fill that writes the value the field already had fires no change event and is never re-marked, but it does replace the source — a marker kept from an earlier turn kept showing a level the new source did not include. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> ^ Conflicts: ^ vaadin-ai-components-flow-parent/vaadin-ai-extensions-flow/src/main/java/com/vaadin/flow/component/ai/form/FormAIController.java
tomivirkki
force-pushed
the
feat/form-ai-marker-confidence
branch
from
August 18, 2026 12:52
e49c5ed to
a8a5348
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Depends on #9900 and vaadin/web-components#12436.
Fixes https://github.com/orgs/vaadin/projects/103/views/3?pane=issue&itemId=226179925
🤖 Generated with Claude Code