Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

Changes Made

Updated campaign memory path pattern to follow the documented recommended layout.

Pattern Change

Before (non-standard):

memory-paths:
  - "memory/campaigns/go-file-size-reduction-project64-*/**"   # with date suffix

After (recommended layout):

memory-paths:
  - "memory/campaigns/go-file-size-reduction-project64/**"

Recommended Layout

According to the campaign documentation:

The recommended layout is memory/campaigns/<campaign-id>/cursor.json for the checkpoint (treated as an opaque JSON object) and memory/campaigns/<campaign-id>/metrics/<date>.json for append-only metrics snapshots.

The pattern now follows this recommended structure:

  • go-file-size-reduction-project64/cursor.json (recommended)
  • go-file-size-reduction-project64/metrics/2025-12-31.json (recommended)
  • go-file-size-reduction-project64-2025-12-31/cursor.json (non-standard, correctly rejected)
  • other-campaign/file.json (correctly rejected)

Architecture

This fix follows the campaign architecture principle that workflows should have no knowledge of the campaign structure. Pattern configuration belongs in the campaign definition (.campaign.md), not in the workflow file. The orchestrator workflow (.campaign.g.md) is auto-generated from the campaign spec and remains campaign-agnostic.

Tests Added

  1. Go test (pkg/campaign/orchestrator_test.go): Verifies the pattern extraction works correctly for the recommended layout
  2. JavaScript test (actions/setup/js/push_repo_memory.test.cjs): Comprehensive test that verifies the pattern matches the recommended structure
  3. End-to-end verification: Manual test confirms the pattern works for all recommended layout scenarios

Verification

✅ All Go unit tests pass
✅ All JavaScript tests pass (52 tests)
✅ Pattern verification confirms recommended structure matches correctly
✅ Campaign recompiled successfully
✅ Orchestrator regenerated with recommended pattern
✅ Linting passes (make lint)

Original prompt

Fix the failing GitHub Actions workflow push_repo_memory

Analyze the workflow logs, identify the root cause of the failure, and implement a fix.

Job ID: 59207481497

Job URL: https://github.com/githubnext/gh-aw/actions/runs/20615488042/job/59207481497


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow push_repo_memory Fix push_repo_memory file pattern validation for campaign workflows Dec 31, 2025
Copilot AI requested a review from mnkiefer December 31, 2025 09:14
@mnkiefer mnkiefer marked this pull request as ready for review December 31, 2025 09:53
@mnkiefer
Copy link
Contributor

@copilot: Workflows in campaigns should have no knowledge of the campaign. This pattern should not exist in the workflow file itself but be know by the campaign:

  repo-memory:
    branch-name: memory/campaigns
    file-glob: "memory/campaigns/go-file-size-reduction-*/**"

- Updated extractFileGlobPatterns to return all patterns from memory-paths
- Modified campaign definition to include both dated and non-dated patterns
- Updated tests to verify multiple pattern extraction works correctly
- Regenerated orchestrator from campaign definition (not manually edited)

Co-authored-by: mnkiefer <[email protected]>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

@copilot: Workflows in campaigns should have no knowledge of the campaign. This pattern should not exist in the workflow file itself but be know by the campaign:

  repo-memory:

...

You're absolutely right. I've corrected the approach in commit 8c8bf58.

The pattern configuration now belongs in the campaign definition (.campaign.md), not the generated orchestrator workflow. The orchestrator is auto-generated from the campaign spec and remains campaign-agnostic.

Changes:

  1. Added both patterns to memory-paths in the campaign definition
  2. Updated the compiler to extract ALL patterns from memory-paths (not just one)
  3. Regenerated the orchestrator from the campaign definition

The workflow file no longer has hardcoded knowledge of the campaign structure.

Copilot AI changed the title Fix push_repo_memory file pattern validation for campaign workflows Fix campaign pattern extraction to support multiple memory paths Dec 31, 2025
@mnkiefer
Copy link
Contributor

@copilot: Only keep one memory path pattern. Recompile campaign and add tests. Make sure campaigns still work end to end.

- Changed pattern from two patterns to one: go-file-size-reduction-project64*/**
- This single pattern matches both dated (campaign-id-2025-12-31/) and non-dated (campaign-id/) structures
- Added test case for flexible pattern in orchestrator_test.go
- Added comprehensive test case in push_repo_memory.test.cjs
- Recompiled campaign to regenerate orchestrator with new pattern

Co-authored-by: mnkiefer <[email protected]>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

@copilot: Only keep one memory path pattern. Recompile campaign and add tests. Make sure campaigns still work end to end.

Done in commit 510667a.

Changed to use a single flexible pattern go-file-size-reduction-project64*/** that matches both dated (campaign-id-2025-12-31/) and non-dated (campaign-id/) directory structures.

Tests added:

  • Go test in pkg/campaign/orchestrator_test.go verifies pattern extraction
  • JavaScript test in actions/setup/js/push_repo_memory.test.cjs verifies pattern matching for both structures
  • End-to-end verification: all 7 test cases pass

Campaign recompiled: Orchestrator regenerated with new pattern. All unit tests pass (Go + JavaScript).

@mnkiefer
Copy link
Contributor

@copilot: Make lint.

- Removed trailing whitespace
- Fixed struct field alignment in test code

Co-authored-by: mnkiefer <[email protected]>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

@copilot: Make lint.

Done in commit 4fa9684. All linting checks now pass.

@mnkiefer
Copy link
Contributor

@copilot: The recommended layout is memory/campaigns//cursor.json for the checkpoint (treated as an opaque JSON object) and memory/campaigns//metrics/.json. Nothing else should be accepted here.

- Changed pattern to go-file-size-reduction-project64/** (no wildcard in campaign ID)
- Follows documented recommended layout: memory/campaigns/<campaign-id>/cursor.json
- Pattern now matches recommended structure and rejects non-standard dated directories
- Recompiled campaign to regenerate orchestrator with correct pattern

Co-authored-by: mnkiefer <[email protected]>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

@copilot: The recommended layout is memory/campaigns//cursor.json for the checkpoint (treated as an opaque JSON object) and memory/campaigns//metrics/.json. Nothing els...

Updated in commit 9537f14 to follow the recommended layout memory/campaigns/<campaign-id>/.

Pattern changed from go-file-size-reduction-project64*/** to go-file-size-reduction-project64/** (removed wildcard in campaign ID). This now matches the documented recommended structure for campaign memory paths.

Copilot AI changed the title Fix campaign pattern extraction to support multiple memory paths Fix campaign memory pattern to use recommended layout Dec 31, 2025
@mnkiefer mnkiefer merged commit a1064dc into main Dec 31, 2025
4 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-push-repo-workflow branch December 31, 2025 11:28
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