FE-674: Agent classifier UI on pending review rows#124
Draft
kostandinang wants to merge 10 commits into
Draft
Conversation
Per-row Re-run endpoint: resets one need's agent_status / classification / proposal back to null, then re-dispatches the same classifier pipeline used by the spec-level run-agent route on just that row. The reset half is idempotent. Inner-loop refactor extracts the per-need classify body of handleRunReconciliationAgent into classifyClaimedNeed so both the spec-level loop and per-row Re-run use one path through the I114 lifecycle (queued → classifying → classified | failed). Eight new test cases on reconciliation-agent-route.test.ts cover: - reclassify a previously classified row - reclassify a previously failed row - record failed outcome when model throws on re-run - idempotent reset on a row already at null - 404 unknown spec - 404 unknown need - 404 wrong-spec need - 400 non-numeric ids Wire registered in app.ts via registerPost on the new path family. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
New ClassificationChip component renders six variants
(queued / classifying / auto-confirm / auto-edit / substantive / failed)
following the kind-chip layout from Card 4. The failed variant carries
the agent_proposal text as its tooltip.
PendingReviewSection header gains a Run agent button (visible only when
at least one open need has agent_status null) and an inline progress
strip ("Agent: M of N classified") while classification is in flight.
Run agent is disabled mid-flight to prevent double-dispatch.
Each row gains a classification chip next to the kind chip and, when
agent_status is classified or failed, a Re-run button that calls
POST .../:needId/reset-agent. Re-run also disables the row's Resolve
and Edit buttons while in flight.
useSpecificationOpenReconciliationNeeds now polls at 1s while any need
is queued or classifying; otherwise polling is off.
edit-api.ts gains runReconciliationAgentRequest and
resetReconciliationNeedAgentRequest wrappers matching the server
response shapes.
Twenty new test cases: 12 over ClassificationChip variants and the
variantFor helper, 10 over the run-agent button / progress strip /
classification chips per row / Re-run button / disabled state
composition.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ef code The pending-review listing endpoint now joins each need against its target knowledge_item to expose target_item_kind and target_reference_code, read-time only. Closes Card 4's deferred follow-up: the substantive Open-side-chat affordance in Card 7 can hand useSideChat() a full SideChatPinnableItem without a second fetch. Shared ReconciliationNeedRecord type gains the two nullable fields; makeNeed fixture defaults both to null so existing tests stay green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per-row buttons keyed off agent_classification: - auto-confirm: Confirm (single resolve call) - auto-edit: View proposal (opens DiffPopover with target_current vs agent_proposal), Apply (edit + resolve), Skip (resolve only) - substantive: Open side-chat (calls useSideChat().openFor with target kind / id / referenceCode / content); hidden when no SideChatHost is mounted (useSideChat returns null) Header bulk buttons next to Run agent: - Confirm all (N): serially resolves each auto-confirm row - Apply all suggested (N): serially edits + resolves each auto-edit row with a non-null agent_proposal Bulk operations serialize rather than parallelize so cascade-opening stays predictable when an Apply triggers hard-impact downstream needs. DiffPopover state now carries a mode discriminator (source-diff vs agent-proposal) so the same primitive renders both popovers. Nine new test cases cover per-class affordances, bulk visibility, serial dispatch, and the null-side-chat-context guard. Existing tests stay green (38 total). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 11, 2026
This was referenced May 11, 2026
Contributor
Author
3 tasks
1 task
Semgrep flagged dynamic interpolation of need ids into console.error template literals as a format-string injection risk. Convert all six call sites to constant format string + separate args. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
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.

What
Closes FE-674 V3.1 end-to-end: agent classifier UI, per-class actions, and bulk affordances. Built on the classifier backend shipped at
5c3a70c.Stacked on #121. Draft.
Visibility
POST .../needs/:needId/reset-agent: clears the row's agent state and re-dispatches the classifier.<ClassificationChip>with six variants:queued / classifying / auto-confirm / auto-edit / substantive / failed. Failed surfaces the agent's reason as tooltip.M of N classifiedprogress strip, and 1s polling only while in flight.↻ Re-runon classified/failed rows.Per-class actions
auto-confirm→ Confirmauto-edit→ View (DiffPopover) + Apply (edit + resolve) + Skipsubstantive→ Open side-chatBulk
Header buttons next to Run agent:
Misc
Test plan
npm run verifypassesauto-confirmConfirm; oneauto-editView / Apply; onesubstantiveOpen side-chat