What happened
Issue #6273 reported that the GitLab code agent failed because CODE_ALLOWED_TARGET_BRANCHES was declared in reusable-code.yml (GitHub) but missing from the GitLab CI template. The issue author documented a broader pattern: fix.yaml and scribe.yaml have similar ${VAR} passthroughs that will break when multi-forged.
The triage agent (run 31988031730) proposed a comprehensive test shape that would parse harness YAMLs for ${VAR} patterns and verify both forge templates declare them. The code agent (run 31988273425) implemented a simpler approach: a manually-maintained passthroughVars list in TestGitLabAgentTemplateHarnessPassthroughVars with a comment instructing future developers to update it.
Related issue #5799 covers ${VAR} substitution semantics for unset vars but does not address cross-forge parity detection.
What could go better
The manually-maintained passthroughVars list in TestGitLabAgentTemplateHarnessPassthroughVars requires a developer to remember to add new entries when passthrough variables are introduced. This is the same class of error that caused #6273 — a variable was added to the GitHub workflow but the GitLab template was missed. A comment telling developers to update a list is helpful but not a structural guarantee.
The GitHub reusable workflows (reusable-code.yml, reusable-dispatch.yml, etc.) and the GitLab agent template both live in this repo. Passthrough variables in the GitHub workflows follow a recognizable pattern: they are set to an empty string '' in the env: block specifically so the harness engine's os.Expand succeeds. The test could parse these workflows to extract such variables automatically and verify the GitLab template declares them too.
Confidence: High. The issue author explicitly documented that fix.yaml and scribe.yaml will hit the same bug when multi-forged. An automated parity check would catch those before they surface as runtime failures.
Proposed change
Enhance TestGitLabAgentTemplateHarnessPassthroughVars in internal/scaffold/scaffold_gitlab_test.go to replace the manually-maintained passthroughVars list with automated extraction:
- Parse each
reusable-*.yml workflow file under .github/workflows/ for env: blocks.
- Extract variable names that are set to empty string (
'' or ""), which is the passthrough convention.
- For each extracted variable, verify it is declared in the GitLab agent template's
variables: section (read via GitLabPerRepoFile).
- Fail with a descriptive message naming the workflow file, variable, and the GitLab template path when a declaration is missing.
This keeps the test entirely within this repo (no external dependencies on fullsend-ai/agents) and catches mismatches at go test time rather than at runtime on a real GitLab pipeline.
Validation criteria
- The enhanced test passes with the current set of passthrough variables.
- Adding a new empty-string env var to any
reusable-*.yml workflow without a corresponding GitLab template declaration causes the test to fail with a clear error message.
- The manually-maintained
passthroughVars slice is removed or reduced to an override/exclusion list rather than the primary source of truth.
Generated by retro agent from #6274
What happened
Issue #6273 reported that the GitLab code agent failed because
CODE_ALLOWED_TARGET_BRANCHESwas declared inreusable-code.yml(GitHub) but missing from the GitLab CI template. The issue author documented a broader pattern:fix.yamlandscribe.yamlhave similar${VAR}passthroughs that will break when multi-forged.The triage agent (run 31988031730) proposed a comprehensive test shape that would parse harness YAMLs for
${VAR}patterns and verify both forge templates declare them. The code agent (run 31988273425) implemented a simpler approach: a manually-maintainedpassthroughVarslist inTestGitLabAgentTemplateHarnessPassthroughVarswith a comment instructing future developers to update it.Related issue #5799 covers
${VAR}substitution semantics for unset vars but does not address cross-forge parity detection.What could go better
The manually-maintained
passthroughVarslist inTestGitLabAgentTemplateHarnessPassthroughVarsrequires a developer to remember to add new entries when passthrough variables are introduced. This is the same class of error that caused #6273 — a variable was added to the GitHub workflow but the GitLab template was missed. A comment telling developers to update a list is helpful but not a structural guarantee.The GitHub reusable workflows (
reusable-code.yml,reusable-dispatch.yml, etc.) and the GitLab agent template both live in this repo. Passthrough variables in the GitHub workflows follow a recognizable pattern: they are set to an empty string''in theenv:block specifically so the harness engine'sos.Expandsucceeds. The test could parse these workflows to extract such variables automatically and verify the GitLab template declares them too.Confidence: High. The issue author explicitly documented that
fix.yamlandscribe.yamlwill hit the same bug when multi-forged. An automated parity check would catch those before they surface as runtime failures.Proposed change
Enhance
TestGitLabAgentTemplateHarnessPassthroughVarsininternal/scaffold/scaffold_gitlab_test.goto replace the manually-maintainedpassthroughVarslist with automated extraction:reusable-*.ymlworkflow file under.github/workflows/forenv:blocks.''or""), which is the passthrough convention.variables:section (read viaGitLabPerRepoFile).This keeps the test entirely within this repo (no external dependencies on fullsend-ai/agents) and catches mismatches at
go testtime rather than at runtime on a real GitLab pipeline.Validation criteria
reusable-*.ymlworkflow without a corresponding GitLab template declaration causes the test to fail with a clear error message.passthroughVarsslice is removed or reduced to an override/exclusion list rather than the primary source of truth.Generated by retro agent from #6274