Skip to content

feat(frontend): create and edit human evaluators in /m - #8146

Merged
mmabrouk merged 5 commits into
release/v0.128.9from
feat/m-parity-human-evaluator-form
Nov 6, 2026
Merged

mmabrouk merged 5 commits into
release/v0.128.9from
feat/m-parity-human-evaluator-form

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member

Context

In /m you could not create a human evaluator, and you could not edit one either. The Human tab of Evaluators had no create button, and a human row opened a read-only drawer that showed the raw output schema instead of the feedback fields. So a /m user could not set up a human evaluation or an annotation queue with new feedback. /w has a "Create new evaluator" drawer and an "Edit evaluator" drawer for this.

Changes

On the Human tab of Evaluators (a developer view), "Create new" now opens a form sheet. The empty tab offers "Create evaluator" too. The form has:

  • Evaluator name, slug (filled from the name until you edit it) and description.
  • One card per feedback field: name, type (Integer, Decimal, Boolean, Categorical single, Categorical multi, String), a minimum and maximum for numbers, an option list for choices (Enter adds the next option), and an Optional switch.
  • Errors next to each field after the first submit, and a taken slug under the slug field.

A human row, and the new "Edit" item in its row menu, open the same form filled from the evaluator. As in /w, the name and slug stay fixed, and Update waits for a change. Update saves a new revision with the new outputs schema. A reader without edit_evaluators still gets the read-only drawer.

The save uses the existing createHumanEvaluatorAtom and updateHumanEvaluatorAtom from @agenta/entities. Reading the feedback fields back from a stored schema used to live only in a /w component. It is now humanEvaluatorMetricsFromSchema in @agenta/entities/workflow, next to buildHumanEvaluatorOutputsSchema that writes them, with the feedback type list. /w keeps its own copy for now (this PR does not edit /w).

Automatic evaluators get no create button in this PR. Their create flow opens in the editable revision drawer, which comes in a separate PR.

This branch is based on main.

Tests

  • humanEvaluatorSheet.render.test.tsx drives the real create and update atoms with only HTTP faked, and checks the exact request bodies (workflow create, outputs schema commit; workflow update with meta and tags kept, revision commit).
  • humanEvaluatorForm.test.ts covers validation (names, slugs, ranges, options) and the payload.
  • humanEvaluatorMetrics.test.ts checks that every feedback type survives a write and a read.
  • evaluatorsScreen.render.test.tsx: Create new only on the Human tab and only with edit_evaluators, the empty-state create, a human row opening the edit form, and the read-only drawer without the permission.
  • Types for @agenta/mobile, @agenta/entities and @agenta/oss, and lint on the changed files.
  • Checked in the browser on a dev build against a test stack: create, edit and update a human evaluator at 1440 px and 390 px.

What to QA

  • Developer mode on, Evaluators, Human tab: "Create new" opens "Create human evaluator". Fill a name, add an Integer feedback with 1 to 5 and a Categorical (Single-choice) feedback with two options, Create. The row shows both feedback names.
  • Click that row: "Edit evaluator" opens filled in. Add a String feedback, Update. The row shows v2 with three feedback names.
  • Automatic tab: no "Create new" button yet.
  • Regression: a user without edit rights opens a human row and sees the read-only drawer, with no Create new.

Entire-Checkpoint: 01M6R1FEV76ZMS9CY3AEXPGC4R
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Create and edit human evaluators from the evaluator list, including their name, description, and feedback fields.
    • Configure text, numeric, and choice-based feedback fields, with validation for required details and invalid values.
    • Find the create action in the empty state when evaluator creation is available.
    • Human evaluator rows offer an Edit action to users with editing access; others see Open details.
  • Bug Fixes
    • Feedback field errors are shown during entry, and duplicate slugs receive a specific error message.

The change adds human evaluator creation and editing. It introduces feedback metric schema parsing, a validated form and save flow, and entry points from the evaluator list for users who can edit evaluators.

Changes: Human evaluator management

Layer / File(s) Summary
Feedback metric schema
web/packages/agenta-entities/src/workflow/core/humanEvaluatorMetrics.ts, web/packages/agenta-entities/src/workflow/core/index.ts, web/packages/agenta-entities/src/workflow/index.ts, web/packages/agenta-entities/src/workflow/state/evaluatorUtils.ts, web/packages/agenta-entities/tests/unit/humanEvaluatorMetrics.test.ts
Adds a shared feedback metric type and a parser that maps output-schema properties to metrics. Re-exports the parser and constants, and adds parser tests.
Draft mapping and validation
web/mobile/src/features/evaluators/human/humanEvaluatorForm.ts, web/mobile/tests/unit/humanEvaluatorForm.test.ts
Adds draft initialization and schema reconstruction, field-type conversion, validation, metric conversion, and draft signatures. Tests cover validation and mapping behavior.
Feedback field and form UI
web/mobile/src/features/evaluators/human/FeedbackFieldCard.tsx, web/mobile/src/features/evaluators/human/FeedbackOptionsField.tsx, web/mobile/src/features/evaluators/human/HumanEvaluatorForm.tsx
Adds controls for feedback names, types, numeric bounds, choice options, and optionality. The form handles validation, field changes, and submission.
Create and edit sheet
web/mobile/src/features/evaluators/human/useSaveHumanEvaluator.ts, web/mobile/src/features/evaluators/human/HumanEvaluatorSheet.tsx, web/mobile/tests/unit/humanEvaluatorSheet.render.test.tsx
Adds create/update saving and a sheet that manages the form lifecycle, save results, success messages, and dismissal. Tests cover create, validation failure, duplicate slug, and edit flows.
Evaluator list entry points
web/mobile/src/features/evaluators/EvaluatorRowCells.tsx, web/mobile/src/features/evaluators/EvaluatorRowMenu.tsx, web/mobile/src/features/evaluators/EvaluatorSheets.tsx, web/mobile/src/features/evaluators/EvaluatorsScreen.tsx, web/mobile/src/features/evaluators/states/EvaluatorsEmpty.tsx, web/mobile/src/features/evaluators/useEvaluatorSheets.ts, web/mobile/tests/unit/evaluatorsScreen.render.test.tsx
Adds create and edit entry points for editable human evaluators. Human row actions open the edit sheet; other row selections continue to route to the revision view. Tests cover create visibility and row behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant EvaluatorsScreen
  participant EvaluatorSheets
  participant HumanEvaluatorSheet
  participant HumanEvaluatorForm
  participant useSaveHumanEvaluator
  User->>EvaluatorsScreen: Open create or edit
  EvaluatorsScreen->>EvaluatorSheets: Set human sheet state
  EvaluatorSheets->>HumanEvaluatorSheet: Pass open and editing state
  HumanEvaluatorSheet->>HumanEvaluatorForm: Render form with draft
  HumanEvaluatorForm->>HumanEvaluatorSheet: Submit valid draft
  HumanEvaluatorSheet->>useSaveHumanEvaluator: Save draft
  useSaveHumanEvaluator->>EvaluatorsScreen: Invalidate workflows query on success
  useSaveHumanEvaluator->>HumanEvaluatorSheet: Return save result
  HumanEvaluatorSheet->>User: Show success and close sheet
Loading

Possibly related PRs

  • Agenta-AI/agenta#8007: Adds the evaluator list, row menu, empty state, and read-only drawer extended by this change.
  • Agenta-AI/agenta#8149: Adds a create-evaluator link from the New Evaluation sheet to the category where this change adds human evaluator creation.
Merge Risk: Minimal · previous review f24ef

The previously reported edit blockers appear addressed, with no remaining issue established that should prevent merging after normal checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly describes the addition of human evaluator creation and editing in /m.
Description check Passed The description covers the human evaluator create and edit flows, permissions, shared schema parser, and tests.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 20 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d4276d7 and f24ef64.

Files selected for processing: 10

  • web/mobile/src/features/evaluators/EvaluatorRowCells.tsx
  • web/mobile/src/features/evaluators/human/FeedbackOptionsField.tsx
  • web/mobile/src/features/evaluators/human/HumanEvaluatorForm.tsx
  • web/mobile/src/features/evaluators/human/HumanEvaluatorSheet.tsx
  • web/mobile/src/features/evaluators/human/humanEvaluatorForm.ts
  • web/mobile/src/features/evaluators/human/useSaveHumanEvaluator.ts
  • web/mobile/tests/unit/evaluatorsScreen.render.test.tsx
  • web/mobile/tests/unit/humanEvaluatorForm.test.ts
  • web/mobile/tests/unit/humanEvaluatorSheet.render.test.tsx
  • web/packages/agenta-entities/src/workflow/core/humanEvaluatorMetrics.ts
Files skipped from review as they are similar to previous changes: 3

  • web/mobile/src/features/evaluators/human/FeedbackOptionsField.tsx
  • web/mobile/src/features/evaluators/human/useSaveHumanEvaluator.ts
  • web/packages/agenta-entities/src/workflow/core/humanEvaluatorMetrics.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

Nitpick comments: 1

web/mobile/src/features/evaluators/human/HumanEvaluatorForm.tsx: 1

15-20: Trivial · Maintainability & Code Quality · Quick win

Shorten the doc comment to one line.

This block comment narrates behavior across five lines. The same pattern appears in useSaveHumanEvaluator.ts, HumanEvaluatorSheet.tsx, FeedbackOptionsField.tsx and humanEvaluatorMetrics.ts. Keep one short line per comment. Keep a longer comment only for a surprising constraint.

♻️ Proposed change

-/**
- * The human evaluator form: name, slug and description, then the feedback fields. The slug
- * follows the name until the reader edits it. Errors show after the first submit and then follow
- * each change. In edit mode the name and the slug stay fixed, as in /w, and Update waits for a
- * change.
- */
+/** The human evaluator create and edit form. */

As per coding guidelines: "Hard rule. At most ONE short line per comment. No multi-line blocks narrating why".

Source: Coding guidelines

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8d75125 and d4276d7.

Files selected for processing: 20

  • web/mobile/src/features/evaluators/EvaluatorRowCells.tsx
  • web/mobile/src/features/evaluators/EvaluatorRowMenu.tsx
  • web/mobile/src/features/evaluators/EvaluatorSheets.tsx
  • web/mobile/src/features/evaluators/EvaluatorsScreen.tsx
  • web/mobile/src/features/evaluators/human/FeedbackFieldCard.tsx
  • web/mobile/src/features/evaluators/human/FeedbackOptionsField.tsx
  • web/mobile/src/features/evaluators/human/HumanEvaluatorForm.tsx
  • web/mobile/src/features/evaluators/human/HumanEvaluatorSheet.tsx
  • web/mobile/src/features/evaluators/human/humanEvaluatorForm.ts
  • web/mobile/src/features/evaluators/human/useSaveHumanEvaluator.ts
  • web/mobile/src/features/evaluators/states/EvaluatorsEmpty.tsx
  • web/mobile/src/features/evaluators/useEvaluatorSheets.ts
  • web/mobile/tests/unit/evaluatorsScreen.render.test.tsx
  • web/mobile/tests/unit/humanEvaluatorForm.test.ts
  • web/mobile/tests/unit/humanEvaluatorSheet.render.test.tsx
  • web/packages/agenta-entities/src/workflow/core/humanEvaluatorMetrics.ts
  • web/packages/agenta-entities/src/workflow/core/index.ts
  • web/packages/agenta-entities/src/workflow/index.ts
  • web/packages/agenta-entities/src/workflow/state/evaluatorUtils.ts
  • web/packages/agenta-entities/tests/unit/humanEvaluatorMetrics.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Item Value
Status stopped
Commit 7d64a8b434746debcd7fa53bb646b1177732ddb8
Manual expiry (UTC) Not granted
CI deadline (UTC) Not granted
Workflow https://github.com/Agenta-AI/agenta/actions/runs/42212395637

Preview use finished or expired. Environment absence verified; retained storage requires separate provider accounting.

Post /preview as a new comment to request a one-hour preview. Repeating it while active does not extend the hour.
Preview data is disposable. Expiry is enforced by the next successful cleanup sweep, not an exact timer.
Environment deletion stops its compute. Provider-retained storage and permanent services may still be billed.

Entire-Checkpoint: 01M6R3KXDE72J8PDSDWM2W3AWQ
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Website preview

Preview URL: https://pr-8146-agenta-website-preview.mahmoud-637.workers.dev

Built from 475e0c2a454c077c0abb9f78d723ed690acc82d6. This comment updates in place on every push.

@mmabrouk

mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: The nitpick about long doc comments is fixed in f24ef64: the comments it named are now one line each.

Agenta Product Agent added 2 commits November 6, 2026 11:36
Entire-Checkpoint: 01M6R6VZ5B3YZ6YWASSTFH3G38
… edit prop canEdit

Entire-Checkpoint: 01M6RAN296ETGF35XGW23R0DXP
…rity-human-evaluator-form

# Conflicts:
#	web/mobile/src/features/evaluators/EvaluatorRowCells.tsx
#	web/mobile/src/features/evaluators/EvaluatorsScreen.tsx
#	web/mobile/src/features/evaluators/EvaluatorsTable.tsx
@mmabrouk
mmabrouk merged commit c97a24e into release/v0.128.9 Nov 6, 2026
28 of 30 checks passed
@mmabrouk mmabrouk added the lgtm This PR has been approved by a maintainer label Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants