Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

The push_repo_memory.cjs script was constructing the destination path using the memory ID instead of the branch name, causing all repo-memory branches to store files at memory/default/ regardless of their actual branch name. Additionally, file-glob patterns were being validated against artifact-relative paths instead of branch-relative paths.

Changes:

  • Updated push_repo_memory.cjs line 248 to use branchName instead of memoryId:

    // Before: files always stored at memory/default/
    const destMemoryPath = path.join(workspaceDir, "memory", memoryId);
    
    // After: files stored at branch name path
    const destMemoryPath = path.join(workspaceDir, branchName);
  • Updated glob pattern matching in push_repo_memory.cjs to test against the full branch-relative path:

    // Now tests patterns against "memory/code-metrics/file.json" 
    // instead of just "file.json"
    const branchRelativePath = path.join(branchName, relativeFilePath).replace(/\\/g, "/");
  • Updated file-glob patterns in 21 workflow files to include the full branch path structure:

    • *.jsonmemory/code-metrics/*.json
    • metrics/**memory/meta-orchestrators/metrics/**
    • Campaign patterns updated to include branch prefix
  • Updated docs/src/content/docs/reference/memory.md to document that file-glob patterns must include the full branch path

Impact:

Branch Name Old Path New Path Glob Pattern Example
memory/code-metrics memory/default/ memory/code-metrics/ memory/code-metrics/*.json
memory/audit-workflows memory/default/ memory/audit-workflows/ memory/audit-workflows/*.json

This makes the folder structure semantically aligned with the branch naming convention and ensures glob patterns correctly validate files at their actual storage location within the branch.

Testing:

  • ✅ All 126 workflows compiled successfully
  • ✅ JavaScript tests pass (50 tests in push_repo_memory.test.cjs)
  • ✅ Go unit tests pass
  • ✅ Glob pattern matching correctly validates branch-relative paths
Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20611373336/job/59196659478#step:7:1

Make sure the matching account for the relative folder created for the memory


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 31, 2025 04:08
The push_repo_memory.cjs script now uses the branch name as the folder
path within the branch, instead of hardcoding "memory/{memoryId}". This
ensures the folder structure matches the branch name semantics.

For example:
- Branch "memory/code-metrics" → files at "memory/code-metrics/" in branch
- Branch "memory/audit-workflows" → files at "memory/audit-workflows/" in branch

Previously, all branches stored files at "memory/default/" regardless of
the branch name, which was inconsistent and confusing.

Also updated documentation to reflect the correct behavior.

Co-authored-by: pelikhan <[email protected]>
Copilot AI changed the title [WIP] Fix matching account for memory folder Fix repo-memory folder path to use branch name instead of memory ID Dec 31, 2025
Copilot AI requested a review from pelikhan December 31, 2025 04:17
@pelikhan
Copy link
Contributor

@copilot Glob match must account for memory/id folder path

Copilot AI and others added 2 commits December 31, 2025 04:41
Updated push_repo_memory.cjs to test glob patterns against the full
branch-relative path (e.g., "memory/code-metrics/file.json") instead of
just the artifact-relative path ("file.json").

This ensures file-glob patterns correctly validate files that will be
stored at the branch name path within the memory branch.

Also updated all workflow file-glob patterns to include the full branch
path structure (e.g., "memory/code-metrics/*.json" instead of "*.json")
and updated documentation to reflect this requirement.

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

Copilot AI commented Dec 31, 2025

@copilot Glob match must account for memory/id folder path

Fixed in commit 325f9af. The glob pattern matching now accounts for the full branch path structure. Updated push_repo_memory.cjs to test patterns against the branch-relative path (e.g., "memory/code-metrics/file.json") and updated all workflow file-glob patterns to include the branch path.

Copilot AI changed the title Fix repo-memory folder path to use branch name instead of memory ID Fix repo-memory folder path to use branch name and update glob pattern matching Dec 31, 2025
@pelikhan pelikhan marked this pull request as ready for review December 31, 2025 05:24
@pelikhan pelikhan merged commit 55aff01 into main Dec 31, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/fix-memory-folder-account branch December 31, 2025 05:24
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