feat(feedback): eval sampling — down-thumbs feed AgentCore Evaluations (response-feedback PR-4) - #1148
Open
philmerrell wants to merge 1 commit into
Open
feat(feedback): eval sampling — down-thumbs feed AgentCore Evaluations (response-feedback PR-4)#1148philmerrell wants to merge 1 commit into
philmerrell wants to merge 1 commit into
Conversation
…s (response-feedback PR-4) Down-thumbed turns become the evaluation harness's input queue. Thumb rows carry GSI1PK=FEEDBACK#down / GSI1SK=updatedAt on the existing UserTimestampIndex, so the fleet's recent down-thumbs are one query with no new index. POST /admin/feedback/evaluations/run judges up to N not-yet-judged ones in a background task via bedrock_agentcore.evaluation.EvaluationClient over the runtime log group (keyed by the runtime session id the chat proxy pins); GET /admin/feedback/evaluations is the queue with verdicts. Routing is spec §6: wrong → Correctness + Faithfulness, instructions → InstructionFollowing, length → Conciseness, other/none → Helpfulness; tool_failed gets no judge and is corroborated against the call's tool census (ops, not model); outdated has no judge yet. The stored verdict is per-evaluator value / rating / n / tokens — the judge's explanation quotes the conversation, so it is dropped at summarisation, refused at the storage write, and denylisted in the content policy. The profile shows feedback.evaluations. Opt-in: FEEDBACK_EVAL_SAMPLING_ENABLED defaults off (CDK CDK_FEEDBACK_EVAL_SAMPLING_ENABLED=true) because the managed judge reads the sampled conversation's spans — the scoping decision the evaluations spike says to make per environment. CDK wires the runtime log group into app-api and grants Logs Insights on it and aws/spans plus Evaluate/GetEvaluator; inert until an environment opts in. Spec §13 updated. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
docs/specs/response-feedback.md§11 PR-4, off develop (independent of #1146, the implicit-signals PR).Why
The spec's thesis: feedback is a sampler, not a metric. A down-thumb marks the turn worth spending judge tokens on. The evaluations spike proved
EvaluationClient.run()works end to end on dev today; what it lacked was an affordable input queue. This is that queue, and the first standing quality measurement the cost work has ever had.Opt-in, and why
FEEDBACK_EVAL_SAMPLING_ENABLEDdefaults off (CDK_FEEDBACK_EVAL_SAMPLING_ENABLED=trueto enable). The judge is an AWS-managed evaluator that reads the sampled conversation's spans — the system prompt and every user message. The spike's §2 says to make that decision explicitly per environment rather than let it happen as a side effect, and the feedback spec's §8 puts conversation content behind a scope. Flipping the flag is that decision. Everything else here (the queue keys, the read surfaces, the IAM grant) is wired and inert.What
GSI1PK = FEEDBACK#down|up,GSI1SK = updatedAton the existingUserTimestampIndex. Recent down-thumbs across the fleet are one query; flipping to up leaves the queue.apis/shared/feedback_eval/sampler.py): routes by reason code per spec §6 —wrong→ Correctness + Faithfulness,instructions→ InstructionFollowing,length→ Conciseness,other/none → Helpfulness.tool_failedgets no judge: it is ops, corroborated against the call's tool census on theC#row.outdatedgets no judge yet (KB-freshness join is a follow-up).Judgeis a one-method protocol;AgentCoreJudgeis the SDK adapter, lazily imported, sending the runtime session id (sid-<sha256>) the chat proxy already pins, overAGENTCORE_RUNTIME_LOG_GROUP.F#row: per-evaluatorvalue,rating,n,tokens, plustoolFailureCorroborated. The evaluator'sexplanationquotes the conversation, so it is dropped at summarisation, refused by the storage write, and added to the content-policy denylist. (The evaluator'slabelis stored asrating—labelis already a denylisted path on other row families and the denylist is by name.)/admin/feedback/…, scopeadmin.costs):GET /evaluationslists the queue with verdicts, newest first, content-free by projection;POST /evaluations/run?limit=judges up to 50 not-yet-judged thumbs in a background task and returns 202 (the SDK waits on span ingestion — minutes). 404 while the flag is off.feedback.evaluations = {judged, byEvaluator: {name: {n, mean}}, toolFailuresReported, toolFailuresCorroborated}; a line under the Feedback tile.feedbackEvalSampling.enabled(opt-in, only the literaltrue),AGENTCORE_RUNTIME_LOG_GROUPthreaded from the inference construct'sruntimeLogGroupName, and three task-role statements:logs:StartQueryon the runtime log group andaws/spans,logs:GetQueryResults/StopQuery(not resource-scopable),bedrock-agentcore:Evaluate/GetEvaluator/ListEvaluators(built-in evaluators are AWS-owned). NoAction:*.What this does not change
outdatedjoin remain unbuilt.Tests
explanation; corroboration from the census; verdict shapes; batch over a real moto table with a fake judge (judged / no-judge / already-judged / one failure, second pass finds only the retry); the adapter refuses a missing log group and sends the runtime session id (SDK module faked at import).displayTextand a nestedexplanationboth stripped.pending; run 404 off / 202 on with the injected judge reaching the batch; limit bounded.nullwhen nothing judged. Architecture test's admin-scope registry updated for the new router.npm run buildclean; 827 passed across all 44 jest suites (config opt-in semantics, security policy).ng build(AOT) clean.🤖 Generated with Claude Code