Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Campaign orchestrators were creating incomplete metrics snapshots, causing push_repo_memory.cjs validation failures: Metrics snapshot 'tasks_total' is required but was undefined.

Root Cause

The orchestrator instruction template only documented 2 of 4 required fields:

- Each snapshot MUST include `campaign_id` and `date` (UTC).

AI agents followed these incomplete instructions, writing metrics files like:

{
  "campaign_id": "docs-quality-maintenance-project73",
  "date": "2026-01-05"
}

The push_repo_memory.cjs validator expects all required fields per the CampaignMetricsSnapshot Go struct (which correctly lacks omitempty tags for required fields).

Changes

Updated orchestrator instructions (pkg/campaign/prompts/orchestrator_instructions.md):

  • Document all 4 required fields explicitly
  • Provide minimal valid snapshot example
  • Clarify optional fields
- Each snapshot MUST include ALL required fields (even if zero):
  - `campaign_id` (string): The campaign identifier
  - `date` (string): UTC date in YYYY-MM-DD format
  - `tasks_total` (number): Total number of tasks (>= 0, even if 0)
  - `tasks_completed` (number): Completed task count (>= 0, even if 0)
- Example minimum valid snapshot:
  ```json
  {
    "campaign_id": "{{.CampaignID}}",
    "date": "2025-12-22",
    "tasks_total": 0,
    "tasks_completed": 0
  }

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

The orchestrator instructions now explicitly list ALL required fields for metrics snapshots:
- campaign_id (string)
- date (string, YYYY-MM-DD)
- tasks_total (number, >= 0)
- tasks_completed (number, >= 0)

Includes example minimum valid snapshot to guide AI agents.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer marked this pull request as ready for review January 5, 2026 12:08
Copilot AI and others added 2 commits January 5, 2026 12:10
The campaign lock file now includes the complete metrics schema in the orchestrator instructions, ensuring AI agents know to include all required fields (campaign_id, date, tasks_total, tasks_completed) even when values are zero.

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] Fix push repo memory issue for campaigns Fix campaign metrics validation by documenting required fields in orchestrator instructions Jan 5, 2026
Copilot AI requested a review from mnkiefer January 5, 2026 12:20
@mnkiefer mnkiefer merged commit 6844aa9 into main Jan 5, 2026
123 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-push-repo-memory-issue branch January 5, 2026 12:32
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