feat(api,ui): showcase-completion E5 — agent/hitl + rag story capture (#411)#418
Conversation
There was a problem hiding this comment.
Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Implements Parallel epic E5 of the showcase-completion initiative (umbrella #406, issue #411): persist the HITL approval story and RAG events into the showcase workspace row, add a genuinely-clickable Reject button to the Showcase HITL step card, and surface the history on Showcase +
/ops.Closes #411.
What changed
Backend (
feat(api)—de16625)app/features/demo/hitl.py— NEW single-slot in-memory decision relay (safe under the one-at-a-time_pipeline_lock).run_pipeline: intermediate events now stream to the browser during the decision window (pre-E5 they flushed only after the step returned, so the Approve button could never render).finally: task.cancel()keeps the Stop-button (generator-close) path from orphaning the in-flight step.step_agent_hitl_flowrework: decision window 3 s → 10 s, relay wait, Reject path (keeps the run GREEN — D5; the gatedsave_scenarionever executes), oneapproval_eventsentry on every resolved path (approve / reject / window-lapse auto-approve / hard-timeout).probe/index/retrieve/skip).finalize_workspacewrites theapproval_events/rag_eventsslots (NULL when empty) +result_summary.story_reproductionon replay keep-runs; newlist_approval_eventshelper.POST /demo/hitl-decision(204/404/409/422) +GET /demo/approval-events;HitlDecisionRequest/ApprovalEventItem/ApprovalEventsResponseschemas.config_schema_versionORM default 1 → 2 (D4;server_defaultunchanged — no migration).agent_require_approvaluntouched (D8); no Alembic migration (E1 shipped the columns).Frontend (
feat(ui)—8277e45)HitlDecisionButtons(Approve + Reject) on the step card — POSTs the relay vialib/api.tsapi(), countdown readsdata.decision_window_s, absorbs 404/409.WorkspaceStoryPanel(Run story: approval history + knowledge events + reproduction chips; self-hides on legacy rows) mounted on Showcase./ops"Approval History" table fed by a newuseApprovalEvents()hook;ApprovalEventItem/RagEventDetailtypes added toWorkspaceDetail.Docs (
docs(docs)—d41f80b)story_reproduction+config_schema_version=2), RUNBOOKS (incident 24 + out-of-scope trim).Validation
pnpm lint✅ (0 errors) ·pnpm test --run✅ (457 passed) ·tsc -bno new errors (one pre-existing fixture error fixed).DemoRunRequestunchanged;demo_minimal/sparsewrite no slots; drain ordering + Stop-button cancellation covered by dedicated orchestrator tests.🤖 Generated with Claude Code