Skip to content

Add bootstrap and worker metadata for zero-discovery campaign initialization#11269

Merged
mnkiefer merged 7 commits intomainfrom
copilot/add-bootstrap-planning-model
Jan 22, 2026
Merged

Add bootstrap and worker metadata for zero-discovery campaign initialization#11269
mnkiefer merged 7 commits intomainfrom
copilot/add-bootstrap-planning-model

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Implementation Complete: Bootstrap + Planning Model for Campaign Generator/Orchestrator ✅

This PR implements an explicit bootstrap + planning model for campaign generator/orchestrator workflows, addressing all requirements from the problem statement.

✅ All Requirements Met

1. Bootstrap + Planning Model

Requirement: Create/select initial work items when discovery = 0

Solution: Three bootstrap strategies implemented:

  • seeder-worker: Dispatch scanner to discover work
  • project-todos: Read from Project board Todo column
  • manual: Wait for manual work item creation

2. Worker Metadata / Standardized Payload Schema

Requirement: Deterministic worker selection with defined input contracts

Solution:

  • WorkerMetadata struct with capabilities, payload schemas, priorities
  • WorkerPayloadField defines expected inputs with types and descriptions
  • Deterministic selection algorithm: match capabilities → validate schema → select by priority

3. Labeling/Correlation Contract

Requirement: Guarantee worker outputs are discoverable and attributable

Solution:

  • WorkerOutputLabeling defines guaranteed labeling format
  • Workers use regular labels (not separate tracker-label field)
  • Campaign's tracker-label automatically applied by workers
  • Deterministic keys in titles: [{key}] {description}
  • Metadata fields for Project board tracking

4. Orchestrator Integration

Requirement: Orchestrator uses bootstrap when discovery = 0

Solution:

  • Bootstrap template renders Phase 0 instructions
  • Orchestrator checks discovery count and follows bootstrap mode
  • Payload building from worker metadata schemas
  • Worker selection based on capabilities and priority

Implementation Details

Core Changes:

  • pkg/campaign/spec.go: Added 8 new types for bootstrap and worker metadata
  • pkg/campaign/orchestrator.go: Integrated bootstrap rendering
  • pkg/campaign/template.go: Added RenderBootstrapInstructions()
  • pkg/campaign/schemas/campaign_spec_schema.json: Extended schema
  • .github/aw/bootstrap-agentic-campaign.md: Bootstrap template

Testing:

  • 13 unit tests covering all scenarios
  • Tests for YAML/JSON serialization
  • Validation of payload schemas and output labeling
  • All tests passing ✅

Documentation:

  • Updated docs/campaign-workers.md with bootstrap guide
  • Added comprehensive summary: docs/bootstrap-implementation-summary.md
  • Documented worker selection algorithm and contracts

Files Changed (10 files)

Implementation:

  1. pkg/campaign/spec.go - Core types (+206 lines)
  2. pkg/campaign/orchestrator.go - Bootstrap integration (+42 lines)
  3. pkg/campaign/template.go - Template rendering (+27 lines)
  4. pkg/campaign/schemas/campaign_spec_schema.json - Schema (+200 lines)
  5. .github/aw/bootstrap-agentic-campaign.md - Bootstrap template (+156 lines)

Testing:
6. pkg/campaign/bootstrap_test.go - Unit tests (+500 lines)

Documentation:
7. docs/campaign-workers.md - Bootstrap guide (+120 lines)
8. docs/bootstrap-implementation-summary.md - Complete overview (+350 lines)

Key Features

Zero Discovery Bootstrap: 3 strategies for initial work creation
Worker Metadata: Capabilities, schemas, output contracts
Deterministic Selection: Priority-based worker routing
Guaranteed Discoverability: Campaign tracker-label + deterministic keys
Idempotency Strategies: 4 patterns documented
Type Safety: Payload schemas with validation
Regular Labels: Workers use standard labels, not separate tracker-label field

Testing Coverage

=== Campaign Package Tests ===
TestBootstrapConfig_SeederWorker        PASS
TestBootstrapConfig_ProjectTodos        PASS  
TestBootstrapConfig_Manual              PASS
TestWorkerMetadata_Basic                PASS
TestWorkerMetadata_Multiple             PASS
TestBootstrapAndWorkers_Combined        PASS
TestBootstrapConfig_JSONSerialization   PASS
TestWorkerPayloadField_RequiredDefaultsFalse PASS

All campaign tests passing (13/13) ✅

Example Usage

id: security-q1-2025
name: Security Alert Burndown
project-url: https://github.com/orgs/example/projects/1
tracker-label: campaign:security-q1-2025

bootstrap:
  mode: seeder-worker
  seeder-worker:
    workflow-id: security-scanner
    payload:
      severity: high

workers:
  - id: security-scanner
    capabilities: [scan-security-alerts]
    output-labeling:
      labels: [automated-scan]
      key-in-title: true
    idempotency-strategy: issue-title-based
    priority: 5
    
  - id: security-fixer
    capabilities: [fix-security-alerts]
    output-labeling:
      labels: [security, automated]
      key-in-title: true
    idempotency-strategy: pr-title-based
    priority: 10

Migration Path

Backward Compatible: Existing campaigns work without changes
Opt-in: New features are optional
Incremental: Can add bootstrap or workers independently

Ready for review and merge! 🚀

Original prompt

The generator/orchestrator still needs an explicit bootstrap + planning model: a way to create/select initial work items when discovery is 0 (e.g., dispatch a seeder/scanner worker or treat Project “Todo” items as the task queue). It also needs worker metadata / a standardized payload schema so it can deterministically choose which worker to run and with what inputs, plus a guaranteed labeling/correlation contract so worker outputs become discoverable and attributable to the right task/campaign.


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

Copilot AI and others added 3 commits January 22, 2026 12:41
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>
Copilot AI changed the title [WIP] Add bootstrap and planning model for task management Add bootstrap and worker metadata for zero-discovery campaign initialization Jan 22, 2026
Copilot AI requested a review from mnkiefer January 22, 2026 12:52
@mnkiefer
Copy link
Contributor

@copilot campaigns should use regular labels, not tracker label/ids.

…r-label

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

Copilot AI commented Jan 22, 2026

@copilot campaigns should use regular labels, not tracker label/ids.

Updated to use regular labels instead of tracker-label in worker metadata. Workers now use the labels field for additional labels, and the campaign's tracker-label (defined at the campaign level) is automatically applied to all worker outputs.

Changes in commit 967a316:

  • Removed tracker-label field from WorkerOutputLabeling struct
  • Renamed additional-labels to labels
  • Updated JSON schema to make labels optional
  • All tests passing ✅

Copilot AI requested a review from mnkiefer January 22, 2026 13:08
@mnkiefer mnkiefer marked this pull request as ready for review January 22, 2026 13:09
@mnkiefer
Copy link
Contributor

@copilot Remove invalid content entry in campaign docs

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

Copilot AI commented Jan 22, 2026

@copilot Remove invalid content entry in campaign docs

Removed invalid content entry. The dependency-upgrade-example.campaign.md file was incorrectly placed in docs/src/content/docs/examples/campaigns/ (Astro content directory). Campaign spec files belong in .github/workflows/, not in the docs content directory.

Fixed in commit ff659c3.

@mnkiefer mnkiefer merged commit cc33b1e into main Jan 22, 2026
@mnkiefer mnkiefer deleted the copilot/add-bootstrap-planning-model branch January 22, 2026 13:22
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