Draft: Demo script to verify merged-MR memory distillation end-to-end

What does this MR do and why?

Review aid for !249514 (merged)not intended to be merged.

Adds scripts/duo/merged_trigger_demo.rb, a single-command Rails runner script to verify the merged-MR memory-distillation trigger end-to-end in GDK.

Usage

Prerequisite: your GDK Duo setup works for the gitlab-duo group (you can already trigger a Developer flow via assign/mention).

bundle exec rails runner scripts/duo/merged_trigger_demo.rb

Defaults to group gitlab-duo and user root (both overridable as positional args). One run does everything:

  1. Creates a small Python project with a deliberately non-obvious test setup: tests in spec/, imports that need PYTHONPATH=src, no AGENTS.md, no docs — so the agent has to burn steps discovering PYTHONPATH=src python -m pytest spec/. That struggle is what the distillation flow should later persist. Includes a .gitlab/duo/agent-config.yml (based on ai-assist's) that installs pytest.
  2. Opens an MR adding division tests, one failing against an integer-division bug in src/calculator.py.
  3. Enables the merge_request_merged_flow_trigger feature flag for the project.
  4. Enables the Developer flow for the project via Ai::Catalog::ItemConsumers::CreateService (same path as the UI), which auto-creates the assign/mention triggers and service account.
  5. Creates the merged flow trigger record directly — its UI ships separately in !249084 (merged).
  6. Posts the mention comment that starts the Developer flow session.

What the reviewer watches

  1. The mention-triggered session: the agent takes several attempts to find the test command, then fixes the bug and pushes to the MR branch.
  2. Click Merge on the demo MR.
  3. Expected result: the merged event starts a new Developer flow session that reads the previous session's trace and opens a follow-up MR adding the test command to AGENTS.md, citing session evidence.
Edited by Junming Huang

Merge request reports

Loading