Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Summary

Implemented Option 1: Workflows with a project field now compile directly to their own .lock.yml with campaign orchestrator features injected during compilation.

Implementation

Campaign injection (pkg/campaign/injection.go)

  • Created InjectOrchestratorFeatures() function
  • Detects campaigns using multiple indicators (workflows field is optional):
    • workflows - List of worker workflows (optional)
    • governance - Campaign-specific policies
    • bootstrap - Work item generation config
    • memory-paths, metrics-glob, cursor-glob - State tracking
  • Injects orchestrator instructions directly into workflow markdown
  • Configures safe-outputs (dispatch-workflow when workflows present, update-project always)
  • Adds campaign-specific prompts: bootstrap, workflow execution, orchestrator instructions, project updates, closing

Compilation pipeline (pkg/cli/compile_workflow_processor.go)

  • Calls InjectOrchestratorFeatures() after parsing, before compilation
  • Transforms workflows with project field into campaign orchestrators in-place
  • No separate orchestrator file generation

Helper cleanup (pkg/cli/compile_helpers.go)

  • Removed project field detection code
  • Injection now happens in compile_workflow_processor layer

Template updates (pkg/campaign/prompt_sections.go, orchestrator.go)

  • Exported AppendPromptSection() for use by injection logic
  • Updated references to use capitalized function name

Frontmatter types (pkg/workflow/frontmatter_types.go)

  • Extended ProjectConfig to include campaign orchestration fields
  • Campaign configuration nested within project field
  • All campaign fields are optional

Schema (pkg/parser/schemas/main_workflow_schema.json)

  • Added campaign properties to project object schema
  • Validates governance, bootstrap, and worker configurations
  • All fields are optional

How It Works

  1. Parse workflow file normally
  2. Inject orchestrator features if any campaign indicator is present in project
  3. Compile the enhanced workflow to .lock.yml

Campaign Detection

A workflow is considered a campaign orchestrator if it has a project field with ANY of these:

  • workflows - List of worker workflows (optional)
  • governance - Campaign policies
  • bootstrap - Initial work item generation
  • memory-paths - Campaign state tracking
  • metrics-glob - Metrics collection
  • cursor-glob - Checkpoint files

Examples

Campaign with predefined workers:

---
name: Security Alert Burndown
on:
  schedule:
    - cron: "0 * * * *"
project:
  url: https://github.com/orgs/myorg/projects/123
  workflows:
    - security-fixer
  governance:
    max-new-items-per-run: 5
---

Campaign with custom discovery (no workers):

---
name: Dependabot PR Campaign
on:
  schedule:
    - cron: "0 * * * *"
project:
  url: https://github.com/orgs/myorg/projects/456
  governance:
    max-discovery-items-per-run: 100
    max-new-items-per-run: 3
---

# Campaign

Discovers Dependabot PRs with `dependencies` and `javascript` labels.
Assigns to Copilot coding agent using `assign-to-agent`.

Both compile to .lock.yml with orchestrator features. The simplest campaign only needs governance or another indicator - no workflows field required.

Result

Compiles to a single .lock.yml file containing:

  • Original workflow content
  • Injected orchestrator instructions (bootstrap, workflow execution, coordination)
  • Safe-outputs configured (dispatch-workflow when workflows present, update-project always)
  • Campaign concurrency controls

No separate files generated - the workflow IS the campaign orchestrator.

Example Output

The security-alert-burndown.md workflow (simplified without workers) compiles to a 75.9 KB .lock.yml with campaign orchestrator features:
✅ WORKFLOW EXECUTION (PHASE 0) instructions
✅ ORCHESTRATOR INSTRUCTIONS for coordination
✅ PROJECT UPDATE INSTRUCTIONS for project board management
✅ CLOSING INSTRUCTIONS for completion
✅ No dispatch-workflow safe-output (uses assign-to-agent for Copilot integration instead)

The example demonstrates a minimal campaign that discovers Dependabot PRs with specific labels and assigns them to the Copilot coding agent, without predefined worker workflows.

Notes

  • .campaign.md format remains supported for backward compatibility
  • Existing .campaign.md files not modified in this PR
  • workflows field is optional - campaigns can use custom discovery and assign-to-agent for Copilot integration
  • Simplest campaigns need only governance or another campaign indicator field
Original prompt

Detecting project field during compilation should build full orchestrator workflow structure (discovery steps, campaign prompts, coordination logic) with campaign-specific features (workflows list, memory-paths, metrics, governance, etc.) and handling orchestrator-specific triggers (schedule, workflow_dispatch). Finally, remove .campaign.md file support.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@mnkiefer mnkiefer changed the title Detecting project field during compilation should build full orchestrator workflow structure (discovery steps, campaign prompts, coordination logic) with campaign-specific features (workflows list, memory-paths, metrics, governance, etc.) and handlin... Detecting project field during compilation should build orchestrator workflow Jan 27, 2026
Copilot AI and others added 4 commits January 27, 2026 17:10
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
…flow

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer
Copy link
Contributor

@copilot No campaign field, this is in project now.

Copilot AI changed the title Detecting project field during compilation should build orchestrator workflow Enable campaign orchestrator generation via project field detection Jan 27, 2026
Copilot AI requested a review from mnkiefer January 27, 2026 17:20
Campaign configuration is now nested within the project field instead of being a separate top-level field. This simplifies the structure and makes it clear that campaign orchestration is an extension of project tracking.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 27, 2026

@copilot No campaign field, this is in project now.

Fixed in commit 4a2f057. Campaign fields are now nested within the project configuration instead of being a separate top-level field. The example workflow structure is now:

project:
  url: https://github.com/orgs/myorg/projects/123
  scope:
    - owner/repo
  # Campaign orchestration fields  
  workflows:
    - security-fixer
  governance:
    max-new-items-per-run: 5

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer
Copy link
Contributor

@copilot No frontmatter conversion, this is a new native field in regular workflows which distinguishes it as a campaign.

Copy link
Contributor Author

Copilot AI commented Jan 27, 2026

@copilot No frontmatter conversion, this is a new native field in regular workflows which distinguishes it as a campaign.

I want to confirm the intended approach:

Should workflows with a project field:

  1. Compile directly to their own .lock.yml with orchestrator features added during compilation (discovery steps, coordination logic, etc.)?

OR

  1. Still generate a separate orchestrator workflow file (like .campaign.g.md.campaign.lock.yml) but triggered by the project field instead of a .campaign.md file?

The "no frontmatter conversion" feedback suggests option 1, where the workflow itself becomes the orchestrator without generating separate files.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title Enable campaign orchestrator generation via project field detection Add project field with campaign orchestration support to workflows Jan 27, 2026
These files should not be modified or deleted in this PR. Restored to their state before commit b30d018.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer marked this pull request as ready for review January 27, 2026 18:12
@mnkiefer
Copy link
Contributor

@copilot Make workflows field optional. The simplest campaign could, for example, do its own discovery and dispatch to copilot assign-to-agent.

Copilot AI and others added 2 commits January 27, 2026 18:21
Campaigns can now be created without predefined worker workflows. Detection now checks for any campaign indicator (governance, bootstrap, memory-paths, metrics-glob, cursor-glob) instead of requiring workflows field. This allows campaigns to use custom discovery and dispatch logic like assign-to-agent.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI requested a review from mnkiefer January 27, 2026 18:22
@mnkiefer
Copy link
Contributor

@copilot Reduce security-alert-burndown campaign to:

  • Not have workflows field
  • Discover "dependabot" bot opened PRs with labels "dependencies", "javascript"
  • Assign those items to copilot coding agent (instead of dispatch)

Removed workflows field and simplified to show a campaign that:
- Discovers Dependabot PRs with dependencies/javascript labels
- Assigns PRs to Copilot coding agent (not worker dispatch)
- Uses governance for pacing and discovery limits

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer merged commit 7cf926b into main Jan 27, 2026
56 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-89615882-1036865607-d6925574-f488-4956-adff-dcce191aac36 branch January 27, 2026 19:01
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