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.rbDefaults to group gitlab-duo and user root (both overridable as positional args). One run does everything:
- Creates a small Python project with a deliberately non-obvious test setup: tests in
spec/, imports that needPYTHONPATH=src, no AGENTS.md, no docs — so the agent has to burn steps discoveringPYTHONPATH=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. - Opens an MR adding division tests, one failing against an integer-division bug in
src/calculator.py. - Enables the
merge_request_merged_flow_triggerfeature flag for the project. - 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. - Creates the
mergedflow trigger record directly — its UI ships separately in !249084 (merged). - Posts the mention comment that starts the Developer flow session.
What the reviewer watches
- The mention-triggered session: the agent takes several attempts to find the test command, then fixes the bug and pushes to the MR branch.
- Click Merge on the demo MR.
- 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