Skip to content

feat(api,ui): showcase-completion E5 — agent/hitl + rag story capture (#411)#418

Merged
w7-mgfcode merged 3 commits into
devfrom
feat/showcase-completion-e5-agent-rag-story
Jun 13, 2026
Merged

feat(api,ui): showcase-completion E5 — agent/hitl + rag story capture (#411)#418
w7-mgfcode merged 3 commits into
devfrom
feat/showcase-completion-e5-agent-rag-story

Conversation

@w7-mgfcode

Copy link
Copy Markdown
Owner

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).
  • D2 concurrent drain in 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_flow rework: decision window 3 s → 10 s, relay wait, Reject path (keeps the run GREEN — D5; the gated save_scenario never executes), one approval_events entry on every resolved path (approve / reject / window-lapse auto-approve / hard-timeout).
  • RAG-event capture in all three knowledge steps (probe/index/retrieve/skip).
  • finalize_workspace writes the approval_events / rag_events slots (NULL when empty) + result_summary.story_reproduction on replay keep-runs; new list_approval_events helper.
  • POST /demo/hitl-decision (204/404/409/422) + GET /demo/approval-events; HitlDecisionRequest / ApprovalEventItem / ApprovalEventsResponse schemas.
  • config_schema_version ORM default 1 → 2 (D4; server_default unchanged — no migration).
  • No agents-slice changes; agent_require_approval untouched (D8); no Alembic migration (E1 shipped the columns).

Frontend (feat(ui)8277e45)

  • HitlDecisionButtons (Approve + Reject) on the step card — POSTs the relay via lib/api.ts api(), countdown reads data.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 new useApprovalEvents() hook; ApprovalEventItem/RagEventDetail types added to WorkspaceDetail.

Docs (docs(docs)d41f80b)

  • API_CONTRACTS (2 endpoints + WS data keys), DOMAIN_MODEL (slot-schema v2 delta + story_reproduction + config_schema_version=2), RUNBOOKS (incident 24 + out-of-scope trim).

Validation

  • Backend: ruff ✅ · ruff format ✅ · mypy --strict ✅ (344 files) · pyright --strict ✅ (0 errors) · 2097 unit passed · 42 demo integration passed (incl. story-slot writes + reproduction matrix + approval-events flatten).
  • Frontend: pnpm lint ✅ (0 errors) · pnpm test --run ✅ (457 passed) · tsc -b no new errors (one pre-existing fixture error fixed).
  • Legacy byte-compat: DemoRunRequest unchanged; demo_minimal/sparse write no slots; drain ordering + Stop-button cancellation covered by dedicated orchestrator tests.

🤖 Generated with Claude Code

@sourcery-ai sourcery-ai 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.

Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ae3b2bf3-6a40-4c0a-8f6e-8faa2b55a80e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/showcase-completion-e5-agent-rag-story

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@w7-mgfcode w7-mgfcode merged commit e38e66c into dev Jun 13, 2026
10 checks passed
@w7-mgfcode w7-mgfcode deleted the feat/showcase-completion-e5-agent-rag-story branch June 13, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant