Skip to content

Increase Metrics Collector repo-memory patch cap to prevent push_repo_memory gate failures - #49970

Merged
pelikhan merged 7 commits into
mainfrom
copilot/aw-failures-fix-push-repo-memory
Aug 3, 2026
Merged

Increase Metrics Collector repo-memory patch cap to prevent push_repo_memory gate failures#49970
pelikhan merged 7 commits into
mainfrom
copilot/aw-failures-fix-push-repo-memory

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Metrics Collector’s push_repo_memory job failed when a daily metrics update generated a ~131KB patch against a 10KB cap (12KB effective with overhead). This change raises the workflow’s patch-size limit to accommodate current metrics payload size while preserving existing retention/pruning behavior.

  • Scope: Repo-memory cap adjustment (Metrics Collector)

    • Updated .github/workflows/metrics-collector.md to set a higher repo-memory patch limit:
      • tools.repo-memory.max-patch-size: 131072 (128KB)
  • Scope: Compiled workflow parity

    • Recompiled .github/workflows/metrics-collector.lock.yml so runtime config matches source:
      • Safe-outputs push_repo_memory.memories[].max_patch_size now 131072
      • push_repo_memory env MAX_PATCH_SIZE now 131072
      • Generated memory-constraints text now reflects 128KB
  • Scope: No behavioral change outside cap

    • 30-day pruning logic for metrics/daily/*.json is unchanged.
tools:
  repo-memory:
    branch-name: memory/meta-orchestrators
    file-glob: "metrics/**"
    max-patch-size: 131072

Run: https://github.com/github/gh-aw/actions/runs/30820387900

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13.2 AIC · ⌖ 5.18 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix push_repo_memory patch-size cap breach in Metrics Collector Increase Metrics Collector repo-memory patch cap to prevent push_repo_memory gate failures Aug 3, 2026
Copilot AI requested a review from pelikhan August 3, 2026 12:45
@pelikhan

pelikhan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

@copilot review push_repo_memory patch size computation and ensure it does not measure the entire changes, just the diff. Reuse heleprs from push_evals_state

Copilot AI and others added 2 commits August 3, 2026 13:10
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot review push_repo_memory patch size computation and ensure it does not measure the entire changes, just the diff. Reuse heleprs from push_evals_state

Updated in 154bd8c.

push_repo_memory now scopes status/staging to managed memory pathspecs and computes patch size from staged diff bytes via getStagedPatchDiffSizeBytes with explicit cwd, so it measures only the intended diff rather than unrelated workspace changes. I also updated tests to cover the pathspec-based staging/status behavior.

@pelikhan
pelikhan marked this pull request as ready for review August 3, 2026 13:22
Copilot AI review requested due to automatic review settings August 3, 2026 13:22
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has 0 new lines of code in business logic directories.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Code Quality Reviewer failed during code quality review.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Triage

Category: chore · Risk: low · Total score: 40/100

Impact Urgency Quality
18/50 12/30 10/20

Raises Metrics Collector repo-memory patch-size cap (10KB → 128KB) to fix push_repo_memory gate failures. PR is currently marked draft.

Recommended action: defer — small config fix, low urgency; convert out of draft before merging.

Generated by 🔧 PR Triage Agent · auto · 55.7 AIC · ⌖ 4.24 AIC · ⊞ 8K ·

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Raises Metrics Collector’s repo-memory patch cap to handle larger daily snapshots.

Changes:

  • Raises the cap to 128KB and recompiles the workflow.
  • Changes global repo-memory Git staging behavior and tests.
  • Adds an unrelated workflow-skill reference.
Show a summary per file
File Description
.github/workflows/metrics-collector.md Configures the larger patch cap.
.github/workflows/metrics-collector.lock.yml Propagates the cap into generated runtime configuration.
actions/setup/js/push_repo_memory.cjs Scopes Git operations to copied memory paths.
actions/setup/js/push_repo_memory.test.cjs Updates source assertions for scoped Git operations.
.github/skills/agentic-workflows/SKILL.md Adds an observability-document reference.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread actions/setup/js/push_repo_memory.cjs Outdated
}

// Check if we have any changes to commit
const changedPathspecs = Array.from(new Set(filesToCopy.map(file => file.relativePath))).sort();
Comment thread .github/skills/agentic-workflows/SKILL.md Outdated
// Check if we have any changes to commit
const changedPathspecs = Array.from(new Set(filesToCopy.map(file => file.relativePath))).sort();

// Check if we have any changes to commit, scoped to managed memory files only.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are correct and consistent across all layers.

  • The 128KB patch cap is a reasonable fix for observed gate failures on large daily metrics snapshots.
  • Scoping git status --porcelain and git add --sparse to changedPathspecs is a correctness improvement that avoids accidentally counting or staging files outside the managed memory scope.
  • The cwd parameter is already accepted by getStagedPatchDiffSizeBytes, so that wiring is correct.
  • The empty-pathspecs fallback (git add --sparse .) preserves existing behavior.
  • Tests accurately reflect the new code paths.
  • Lock file is consistent with the workflow source.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 22.7 AIC · ⌖ 10.3 AIC · ⊞ 5.4K

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 100/100 — Excellent

Analyzed 2 test(s): 2 design, 0 implementation, 0 violation(s).

📊 Metrics (2 tests)
Metric Value
Analyzed 2 (JavaScript/vitest)
✅ Design 2 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 2 (100%)
Duplicate clusters 0
Inflation No (0.29:1 ratio)
🚨 Violations 0
Test File Classification Focus
should use git add --sparse to handle sparse-checkout on orphan branch creation push_repo_memory.test.cjs:1060 design_test Pathspec-scoped git staging safety
should enforce MAX_FILE_COUNT against changed files... push_repo_memory.test.cjs:1559 design_test File count enforcement with pathspec limits

Key Observations

Both tests are source verification tests that validate the production implementation matches critical security and functional invariants:

  • Test 1 verifies that git add --sparse uses pathspec-scoped staging (fixes sparse-checkout failures)
  • Test 2 verifies that file counting uses pathspec-limited git status (prevents counting unrelated files)

Test changes align with production changes: The assertions were updated to reflect the new pathspec-scoped architecture (using ...changedPathspecs) while maintaining coverage of the critical design invariants.

Verdict

passed. 0% implementation tests (threshold: 30%). All tests verify behavioral contracts, not implementation details.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 14.8 AIC · ⌖ 4.92 AIC · ⊞ 8.5K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Test Quality Sentinel: 100/100. 0% implementation tests (threshold: 30%). All tests verify behavioral contracts.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — one minor dead-code finding; overall the fix is clean and well-reasoned.

📋 Key Themes & Highlights

Key Themes

  • Root cause properly addressed: The 10KB cap was genuinely too small for ~131KB daily metrics snapshots; raising to 128KB is a rational, measured increase.
  • Pathspec-scoped git ops: Refactoring git status and git add to target only managed memory paths is the right defensive move for sparse-checkout environments.
  • Dead branch: The else { addArgs.push(".") } fallback in git add is unreachable (noted in inline comment).

Positive Highlights

  • ✅ PR description clearly documents the root cause with concrete byte counts.
  • metrics-collector.lock.yml recompiled in sync — no config drift.
  • cwd: workspaceDir consistently threaded through all git calls.
  • ✅ Tests updated to assert the new pathspec-based behavior rather than just removing the old assertion.
  • ✅ Comment in metrics-collector.md explains why 128KB is needed, which helps future reviewers reason about the cap.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 37.9 AIC · ⌖ 8.03 AIC · ⊞ 7.1K
Comment /matt to run again

const addArgs = ["add", "--sparse"];
if (changedPathspecs.length > 0) {
addArgs.push("--", ...changedPathspecs);
} else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] Dead code: the else { addArgs.push(".") } branch (lines 546–548) is unreachable — filesToCopy is guaranteed non-empty at this point (line 400 returns early when it is empty), so changedPathspecs will always be non-empty here.

💡 Suggestion

Remove the dead branch and rely on the early-return guarantee:

// changedPathspecs is always non-empty here (filesToCopy emptiness is checked at line 400)
addArgs.push("--", ...changedPathspecs);

Leaving the fallback "." in place makes the sparse-checkout safety invariant harder to reason about and could mask a future regression if the early-return is ever removed.

@copilot please address this.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot sous-chef triage:

Failed checks:

Please refresh the branch if needed and then run the skill.

Generated by 👨🍳 PR Sous Chef · run: https://github.com/github/gh-aw/actions/runs/30820387900

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13.2 AIC · ⌖ 5.18 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot August 3, 2026 14:22
@pelikhan
pelikhan merged commit 7570484 into main Aug 3, 2026
9 checks passed
@pelikhan
pelikhan deleted the copilot/aw-failures-fix-push-repo-memory branch August 3, 2026 15:12
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw-failures] Metrics Collector push_repo_memory hard-fails on 131KB patch vs 10KB cap

4 participants