Skip to content

Extract prompt bootstrap into a shared runtime helper - #76990

Merged
pelikhan merged 2 commits into
mainfrom
pelikhan/prompt-rendering-helper
Nov 12, 2026
Merged

pelikhan merged 2 commits into
mainfrom
pelikhan/prompt-rendering-helper

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Generated prompt steps repeated an environment-filtering loop and assigned globals inline, adding noise to every lock file. Move that bootstrap into setup_prompt_globals.cjs, following the existing shared-helper pattern while preserving credential isolation.

The compiler passes selected environment names through GH_AW_PROMPT_ENV; the helper retains those bindings and non-secret runner/context variables, removes inherited credentials and Node startup options, and exposes only core and context. Regenerated 365 workflow locks remove roughly 3,300 lines of repeated code. Includes focused regression coverage and updated templating documentation.

Validation

  • Focused Go prompt compiler tests passed.
  • 41 prompt runtime tests, TypeScript checking, and changed-file JavaScript lint passed.
  • Go lint, custom linters, and impacted unit tests passed.
  • All 365 workflows compiled and workflow drift checking passed.

The final validation command initially stopped because ESLint tooling was missing. After restoring dependencies, the failed lint check and remaining workflow drift gate passed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review November 11, 2026 23:36
Copilot AI dynamic review requested due to automatic review settings November 11, 2026 23:36
Regenerate expected compiler output after extracting credential-free prompt bootstrap into setupPromptGlobals. Keep golden comparisons and normalization unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

🟡 Changes recommended

Ten golden fixtures still expect the old inline bootstrap and omit GH_AW_PROMPT_ENV, causing the corresponding TestWasmGolden_* subtests to fail.

1 open issue
What changed in this PR

Moves prompt initialization into a shared gh-aw runtime helper, reducing generated workflow duplication while retaining environment filtering and limited prompt globals.

Changes:

  • Adds setupPromptGlobals and validated environment selection through GH_AW_PROMPT_ENV.
  • Updates the compiler and generated workflow locks to use the helper.
  • Adds regression coverage and documents the credential-isolation boundaries.
File Description
pkg/​workflow/​credential_free_prompt.go Emits helper calls and selected environment names.
pkg/​workflow/​credential_free_prompt_test.go Checks helper integration and credential filtering.
docs/​src/​content/​docs/​reference/​templating.md Documents shared bootstrap and environment selection.
actions/​setup/​js/​setup_prompt_globals.test.cjs Tests filtering, globals, and invalid configuration.
actions/​setup/​js/​setup_prompt_globals.cjs Implements shared prompt environment and global setup.
.github/​workflows/​smoke-work-queue-worker.lock.yml Uses shared bootstrap in queue-worker prompts.
.github/​workflows/​smoke-pi-auto.lock.yml Uses shared bootstrap in Pi smoke prompts.
.github/​workflows/​smoke-github-codex.lock.yml Uses shared bootstrap in GitHub Codex prompts.
.github/​workflows/​smoke-codex-routed.lock.yml Uses shared bootstrap in routed Codex prompts.
.github/​workflows/​smoke-codex-routed-openai.lock.yml Uses shared bootstrap in OpenAI-routed prompts.
.github/​workflows/​smoke-codex-bare-auto.lock.yml Uses shared bootstrap in bare Codex prompts.
.github/​workflows/​smoke-codex-auto.lock.yml Uses shared bootstrap in Codex smoke prompts.
.github/​workflows/​smoke-claude-sub-agents.lock.yml Uses shared bootstrap in Claude sub-agent prompts.
.github/​workflows/​smoke-claude-dynamic.lock.yml Uses shared bootstrap in dynamic Claude prompts.
.github/​workflows/​smoke-claude-copilot.lock.yml Uses shared bootstrap in Claude/Copilot prompts.
.github/​workflows/​smoke-claude-copilot-auto.lock.yml Uses shared bootstrap in automatic Claude/Copilot prompts.
.github/​workflows/​smoke-claude-auto.lock.yml Uses shared bootstrap in Claude smoke prompts.
.github/​workflows/​smoke-azure-pi.lock.yml Uses shared bootstrap in Azure Pi prompts.
.github/​workflows/​smoke-azure-codex.lock.yml Uses shared bootstrap in Azure Codex prompts.
.github/​workflows/​smoke-agy.lock.yml Uses shared bootstrap in Agy smoke prompts.
.github/​workflows/​sighthound-security-scan.lock.yml Uses shared bootstrap in security-scan prompts.
.github/​workflows/​objective-impact-report.lock.yml Uses shared bootstrap in impact-report prompts.
.github/​workflows/​firewall.lock.yml Uses shared bootstrap in firewall prompts.
.github/​workflows/​example-permissions-warning.lock.yml Updates example prompt bootstrap.
.github/​workflows/​example-failure-category-filter.lock.yml Updates failure-filter example prompt bootstrap.
.github/​workflows/​eslint-factory-dispatcher.lock.yml Uses shared bootstrap in dispatcher prompts.
.github/​workflows/​enterprise-docs-audit.lock.yml Uses shared bootstrap in documentation-audit prompts.
.github/​workflows/​engine-conformance-pydantic-ai.lock.yml Updates Pydantic AI conformance prompt bootstrap.
.github/​workflows/​engine-conformance-pi.lock.yml Updates Pi conformance prompt bootstrap.
.github/​workflows/​engine-conformance-opencode.lock.yml Updates OpenCode conformance prompt bootstrap.
.github/​workflows/​engine-conformance-kiro.lock.yml Updates Kiro conformance prompt bootstrap.
.github/​workflows/​engine-conformance-goose.lock.yml Updates Goose conformance prompt bootstrap.
.github/​workflows/​engine-conformance-gemini.lock.yml Updates Gemini conformance prompt bootstrap.
.github/​workflows/​engine-conformance-factory.lock.yml Updates Factory conformance prompt bootstrap.
.github/​workflows/​engine-conformance-cursor.lock.yml Updates Cursor conformance prompt bootstrap.
.github/​workflows/​engine-conformance-crush.lock.yml Updates Crush conformance prompt bootstrap.
.github/​workflows/​engine-conformance-copilot.lock.yml Updates Copilot conformance prompt bootstrap.
.github/​workflows/​engine-conformance-codex.lock.yml Updates Codex conformance prompt bootstrap.
.github/​workflows/​engine-conformance-claude.lock.yml Updates Claude conformance prompt bootstrap.
.github/​workflows/​engine-conformance-atomic.lock.yml Updates Atomic conformance prompt bootstrap.
.github/​workflows/​engine-conformance-agy.lock.yml Updates Agy conformance prompt bootstrap.
.github/​workflows/​dev.lock.yml Uses shared bootstrap in development prompts.
.github/​workflows/​designer-drift-audit.lock.yml Uses shared bootstrap in drift-audit prompts.
.github/​workflows/​daily-work-queue-formal-verification.lock.yml Uses shared bootstrap in queue-verification prompts.
.github/​workflows/​daily-team-status.lock.yml Uses shared bootstrap in team-status prompts.
.github/​workflows/​daily-squid-image-scan.lock.yml Uses shared bootstrap in image-scan prompts.
.github/​workflows/​daily-github-docs-seo-optimizer.lock.yml Uses shared bootstrap in SEO-optimizer prompts.
.github/​workflows/​daily-credit-limit-test.lock.yml Uses shared bootstrap in credit-limit prompts.
.github/​workflows/​daily-choice-test.lock.yml Uses shared bootstrap in choice-test prompts.
.github/​workflows/​daily-byok-ollama-test.lock.yml Uses shared bootstrap in Ollama test prompts.
.github/​workflows/​copilot-pr-merged-report.lock.yml Uses shared bootstrap in merged-PR report prompts.
.github/​workflows/​copilot-centralization-drilldown.lock.yml Uses shared bootstrap in centralization-analysis prompts.
.github/​workflows/​aw-issue-clustering.lock.yml Uses shared bootstrap in issue-clustering prompts.
.github/​workflows/​auditor.lock.yml Uses shared bootstrap in auditor prompts.
.github/​workflows/​agy-conformance-reusable.lock.yml Updates reusable Agy conformance prompt bootstrap.

Review effort: Max (auto)

Comment thread pkg/workflow/credential_free_prompt.go Resolved
@pelikhan
pelikhan merged commit 54d0e33 into main Nov 12, 2026
74 of 75 checks passed
@pelikhan
pelikhan deleted the pelikhan/prompt-rendering-helper branch November 12, 2026 00:15
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

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.

2 participants