From bf55f8621ebba8e42aa311b9d9a8eb8e91d0ce4c Mon Sep 17 00:00:00 2001 From: Gabor Szabo Date: Fri, 12 Jun 2026 15:56:37 +0200 Subject: [PATCH 1/5] feat(api): tag showcase plans with workspace label (#392) --- app/features/demo/pipeline.py | 26 +++++- app/features/demo/tests/test_pipeline.py | 107 ++++++++++++++++++++++- 2 files changed, 130 insertions(+), 3 deletions(-) diff --git a/app/features/demo/pipeline.py b/app/features/demo/pipeline.py index 66caa76b..a8ae7c3c 100644 --- a/app/features/demo/pipeline.py +++ b/app/features/demo/pipeline.py @@ -258,6 +258,9 @@ class DemoContext: # E1 (#390) -- workspace persistence. Set only on preservation="keep" runs # (and only when the row insert succeeded); None on ephemeral runs. workspace_id: str | None = None + # E3 (#392) -- workspace label for plan tagging. Set alongside + # workspace_id in run_pipeline's keep-branch; None on ephemeral runs. + workspace_name: str | None = None # ============================================================================= @@ -354,6 +357,21 @@ def _format_demo_artifact_key(run_id_raw: str) -> str: return run_id_raw.replace("-", "")[:_DEMO_ARTIFACT_KEY_LEN] +def _showcase_plan_tags(ctx: DemoContext, kind: str) -> list[str]: + """Build the tag list for a pipeline-saved scenario plan (E3, #392). + + Always: ["showcase", , "source:showcase"]. When the run records a + workspace (ctx.workspace_id set -- preservation="keep" AND the E1 insert + succeeded), append "workspace: