Skip to content

repo-memory: filter disallowed files before validation/upload instead of failing downstream in push - #58120

Open
dsyme with Copilot wants to merge 7 commits into
mainfrom
copilot/repo-memory-ignore-disallowed-files
Open

repo-memory: filter disallowed files before validation/upload instead of failing downstream in push#58120
dsyme with Copilot wants to merge 7 commits into
mainfrom
copilot/repo-memory-ignore-disallowed-files

Conversation

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

allowed-extensions/file-glob on repo-memory were enforced inconsistently: the agent-side validation step never received ALLOWED_EXTENSIONS, so ineligible files (e.g. a stray notes.json.new) passed artifact upload and only surfaced as a hard failure in the downstream push_repo_memory job — after the eligible file had already been staged.

Persistence filtering, applied consistently

  • New shared helper actions/setup/js/memory_file_eligibility.cjs: isMemoryFileEligible, compileFileGlobPatterns, filterIneligibleMemoryFiles. Disallowed files are logged and skipped, never a hard failure.
  • Compiler (pkg/workflow/repo_memory.go) now emits a "Filter repo-memory files" step before custom validation and artifact upload, whenever allowed-extensions or file-glob is set — so validation, the uploaded artifact, and the push job all see the same effective file set.

push_repo_memory.cjs

  • scanDirectory now applies extension + glob eligibility inline during the scan, dropping ineligible files from consideration entirely (they no longer count toward max-file-count/size/patch-size).
  • Removed the post-scan validateMemoryFiles hard-fail over the whole directory — the old failure mode this issue reports.
  • No eligible files changed → clean no-op exit, not a failure.
  • Fixed a latent bug where skipping a filtered file used return inside the per-file loop, silently aborting the scan of the rest of that directory instead of just skipping one entry (continue).

Result

# allowed-extensions: [".json"]
# notes.json      -> persisted
# notes.json.new  -> logged and ignored, never uploaded/pushed

Regenerated .lock.yml files for all workflows using repo-memory to include the new filter step.


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 34.6 AIC · ⌖ 9.83 AIC · ⊞ 8.7K ·
Comment /souschef to run again


Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 42 AIC · ⌖ 8.67 AIC · ⊞ 9.2K ·
Comment /souschef to run again


pr-sous-chef https://github.com/github/gh-aw/actions/runs/33831313247

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 40.5 AIC · ⌖ 8.81 AIC · ⊞ 8.9K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 31.7 AIC · ⌖ 8.68 AIC · ⊞ 8.7K ·
Comment /souschef to run again


pr-sous-chef https://github.com/github/gh-aw/actions/runs/33865510093

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • github.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 18.6 AIC · ⌖ 8.56 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix repo-memory artifact upload to ignore disallowed files repo-memory: filter disallowed files before validation/upload instead of failing downstream in push Sep 3, 2026
Copilot AI requested a review from dsyme September 3, 2026 03:56
@dsyme
dsyme marked this pull request as ready for review September 3, 2026 05:00
Copilot AI balanced review requested due to automatic review settings September 3, 2026 05:00
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

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

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • ab.chatgpt.com
  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"
    - "github.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #58120

@dsyme

dsyme commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

@copilot

  1. It looks like we should be using a script file rather than the large script: added to the workflow, like we do in other situations.

  2. I suspect we should be applying a uniform rule for other memory types too. Assess that and implement if correct.

  3. Also check if the script-based validation we added a week or so ago to repo memory is uniformly implemented for other memory types, and that this is under appropriate test

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-09-03T05:05:16Z
review_event: REQUEST_CHANGES
top_themes:
  - slashless file-glob regression drops valid root-level repo-memory files
files_reviewed:
  - actions/setup/js/memory_file_eligibility.cjs
  - actions/setup/js/push_repo_memory.cjs
  - actions/setup/js/push_repo_memory.test.cjs
  - actions/setup/js/glob_pattern_helpers.cjs
  - pkg/workflow/repo_memory.go
comment_count: 1

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 36 AIC · ⌖ 7.51 AIC · ⊞ 21.8K ·
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.

Request changes

The new repo-memory filtering path still breaks valid workflows that persist files at the repo-memory root, so this is not safe to merge as-is.

Blocking theme

The shared eligibility helper now forces every slashless file-glob pattern through matchSubfolderRoot, which only matches files exactly one directory below the memory root. That silently changes existing semantics for common patterns like .json/*.json/*.md: root-level files that previously matched are now filtered out before validation, upload, and push. The regression is visible in this PR's generated lockfiles as well (daily-awf-spec-compiler-surfacing now emits FILE_GLOB_FILTER: ".json .md"), so workflows that write root-level memory files will degrade to no-op runs instead of persisting their data.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 36 AIC · ⌖ 7.51 AIC · ⊞ 21.8K
Comment /review to run again

return { patternStrs: [], compiledPatterns: [] };
}
const patternStrs = fileGlobFilter.trim().split(/\s+/).filter(Boolean);
const compiledPatterns = patternStrs.map(pattern => globPatternToRegex(pattern, { matchSubfolderRoot: !pattern.includes("/") }));

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.

This helper now rewrites every slashless file-glob into a matchSubfolderRoot regex, which means patterns like *.json or .json stop matching files at the repo-memory root. Existing workflows use those patterns for root-level state files, so this change will silently filter out valid memory output and turn successful runs into no-op uploads/pushes.

💡 Why this blocks

globPatternToRegex(..., { matchSubfolderRoot: true }) only matches subdir/file.ext, never file.ext. That is a semantic change, not just refactoring: the previous push path matched the full relative path directly, and the compiler is still generating slashless filters in lockfiles such as daily-awf-spec-compiler-surfacing (FILE_GLOB_FILTER: ".json .md"). After this lands, a root-level processed-discussions.json or latest-run.md will be deleted by the new filter step before custom validation and before artifact upload, so the workflow quietly stops persisting its main outputs. Keep the old slashless-pattern semantics here, or normalize those patterns in the compiler before routing them through the shared helper.

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.

🟡 Changes recommended

Preflight and downstream validation remain inconsistently scoped, and filter failures can still allow unfiltered artifacts to upload.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds consistent repo-memory eligibility filtering before validation, upload, and downstream persistence.

Changes:

  • Adds a shared extension/glob eligibility helper with tests.
  • Filters ineligible files during push scanning and supports clean no-op exits.
  • Generates pre-upload filtering steps and refreshes affected workflow lock files.
File summaries
File Description
pkg/workflow/repo_memory.go Generates the pre-upload filter step.
actions/setup/js/memory_file_eligibility.cjs Implements shared eligibility filtering.
actions/setup/js/memory_file_eligibility.test.cjs Tests extension and glob filtering.
actions/setup/js/push_repo_memory.cjs Filters files during downstream scanning.
actions/setup/js/push_repo_memory.test.cjs Adds push filtering regression checks.
.github/workflows/workflow-health-manager.lock.yml Adds generated filtering step.
.github/workflows/smoke-ci.lock.yml Adds generated filtering step.
.github/workflows/sergo.lock.yml Adds generated filtering step.
.github/workflows/security-compliance.lock.yml Adds generated filtering step.
.github/workflows/pr-triage-agent.lock.yml Adds generated filtering step.
.github/workflows/metrics-collector.lock.yml Adds generated filtering step.
.github/workflows/eslint-refiner.lock.yml Adds generated filtering step.
.github/workflows/delight.lock.yml Adds generated filtering step.
.github/workflows/deep-report.lock.yml Adds generated filtering step.
.github/workflows/daily-testify-uber-super-expert.lock.yml Adds generated filtering step.
.github/workflows/daily-storify.lock.yml Adds generated filtering step.
.github/workflows/daily-safeoutputs-git-simulator.lock.yml Adds generated filtering step.
.github/workflows/daily-news.lock.yml Adds generated filtering step.
.github/workflows/daily-harness-experiment-proposer.lock.yml Adds generated filtering step.
.github/workflows/daily-formal-spec-verifier.lock.yml Adds generated filtering step.
.github/workflows/daily-cli-performance.lock.yml Adds generated filtering step.
.github/workflows/daily-awf-spec-compiler-surfacing.lock.yml Adds generated filtering step.
.github/workflows/copilot-session-insights.lock.yml Adds generated filtering step.
.github/workflows/copilot-pr-prompt-analysis.lock.yml Adds generated filtering step.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Adds generated filtering step.
.github/workflows/copilot-cli-deep-research.lock.yml Adds generated filtering step.
.github/workflows/copilot-centralization-optimizer.lock.yml Adds generated filtering step.
.github/workflows/copilot-agent-analysis.lock.yml Adds generated filtering step.
.github/workflows/audit-workflows.lock.yml Adds generated filtering step.
.github/workflows/agentic-token-optimizer.lock.yml Adds generated filtering step.
.github/workflows/agentic-token-audit.lock.yml Adds generated filtering step.
.github/workflows/agent-performance-analyzer.lock.yml Adds generated filtering step.
Review details
  • Files reviewed: 32/32 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/workflow/repo_memory.go Outdated
builder.WriteString(" const memoryDir = process.env.MEMORY_DIR || '';\n")
builder.WriteString(" const allowedExtensions = JSON.parse(process.env.ALLOWED_EXTENSIONS || '[]');\n")
builder.WriteString(" const fileGlobFilter = process.env.FILE_GLOB_FILTER || '';\n")
builder.WriteString(" filterIneligibleMemoryFiles(memoryDir, allowedExtensions, fileGlobFilter, core);\n")
Comment on lines +359 to +362
// Allowed extensions and file-glob are persistence filters: files that do not
// pass are logged and ignored (never uploaded, validated, counted toward
// max-file-count/size/patch-size, or pushed) rather than causing a hard failure.
const eligibility = isMemoryFileEligible(relativeFilePath, allowedExtensions, compiledPatterns);
Comment thread pkg/workflow/repo_memory.go Outdated
Comment on lines +390 to +391
fmt.Fprintf(builder, " - name: Filter %s files (%s)\n", memoryLabel, memory.ID)
builder.WriteString(" if: always()\n")
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

⚠️ Test Quality Score: 77/100 — Acceptable

Analyzed 56+ tests: 54 design, 2 implementation, 0 violations. Behavioral tests verify file filtering and glob pattern matching contracts. Strong regression coverage for the core issue (notes.json.new rejection).

📊 Metrics (56+ tests)
Metric Value
Analyzed 56+ (JS: 56+)
✅ Design 54 (96.4%)
⚠️ Implementation 2 (3.6%)
Edge/error coverage 16 (28.6%)
Duplicate clusters 0
Inflation No (1.04:1 new file, 2.5:1 refactor context acceptable)
🚨 Violations 0

Test Analysis by File

actions/setup/js/memory_file_eligibility.test.cjs ✅ (NEW, 126 lines)

13 behavioral tests covering the new filtering logic:

Test Classifications
Test Classification Value Status
allows all files when no config design_test high_value
rejects disallowed extensions design_test high_value REGRESSION
accepts allowed extension design_test high_value
case-insensitive, trim whitespace design_test medium_value
rejects no glob match design_test high_value
requires both filters pass design_test high_value
compileFileGlobPatterns empty implementation_test low_value
compileFileGlobPatterns space-separated implementation_test low_value
removes disallowed, keeps allowed design_test high_value REGRESSION
no-op success when no eligible files design_test high_value KEY FIX
glob + extension filtering design_test high_value
nested dirs, skip .git design_test high_value
non-existent directory design_test medium_value

Strengths:

  • ✅ Direct regression test for the reported issue (notes.json.new)
  • ✅ Validates the critical fix: "no eligible files → clean success, not hard failure"
  • ✅ Comprehensive edge case coverage (.git skip, missing directory, whitespace handling)
  • ✅ File I/O safety: fs.rmSync cleanup in afterEach
  • ✅ All design tests (84.6%); only trivial implementation tests for compile helpers

actions/setup/js/push_repo_memory.test.cjs ✅ (MODIFIED, +30 lines)

43 new tests added to existing file, split into three suites:

Test Suite Breakdown

Suite 1: globPatternToRegex helper (24 tests)

  • Basic pattern matching (exact, *, **, nesting): 6 tests ✅
  • Special character escaping (dots, backslashes, multiple): 3 tests ✅
  • Real-world patterns (*.jsonl, nested metrics, prefix wildcards): 6 tests ✅
  • Edge cases (empty, *, **, complex nesting): 5 tests ✅
  • Regex output format (RegExp, anchors, conversions): 4 tests ✅

Suite 2: Security tests (19+ tests)

  • Glob-to-regex conversion with escape-order validation: 11 tests ✅
    • Includes security fix verification: backslash escape BEFORE dot escape
    • Demonstrates CWE-20/80/116 prevention
  • Subdirectory glob patterns (**, , **/): 5 tests ✅
  • Security implications (bypass attempts, validation): 3+ tests ✅

Strengths:

  • Security-critical design tests: All 43 tests validate behavioral contracts (regex output, wildcard semantics, escape order)
  • Dedicated security suite with CWE references (CWE-20, CWE-80, CWE-116)
  • Escape-order validation explicitly tests the fix (backslashes first, then dots)
  • Wildcard disambiguation: clear tests for *, **, and */ semantics
  • Real-world use case: daily-code-metrics workflow validation with *.jsonl pattern
  • ✅ No mocking; pure regex/string behavior validation
  • ✅ Comprehensive edge cases: empty patterns, special chars, nested paths

Verdict

Passed. 96.4% design tests (threshold: ≤30% implementation). No violations.

Key findings:

  • Strong behavioral coverage of both core issue (file filtering) and security fix (glob pattern matching)
  • Regression test explicitly addresses issue repo-memory: ignore disallowed files before artifact upload and push #58119 (notes.json.new rejection)
  • Critical fix validated: "no eligible files" → clean no-op, not hard failure
  • Security fix validated: glob-to-regex escape order prevents ReDoS/bypass attacks
  • Test inflation acceptable in refactor context (push_repo_memory: -25 net production lines, +30 test lines for bugfix/security improvements)

Recommendation: ✅ Approve — tests demonstrate strong design validation and comprehensive behavioral coverage.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel · copilot · haiku45 · 25.9 AIC · ⌖ 8.88 AIC · ⊞ 8.4K ·
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: 77/100. 96.4% design tests (threshold: ≤30% implementation). Strong behavioral coverage of file filtering regression and glob pattern security fixes. No violations detected.

@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 /tdd (via pr-triage: change_type=bug_fix) — the fix itself is sound and well-designed (single source of truth for eligibility via memory_file_eligibility.cjs, applied consistently at filter/scan/validate time), but test coverage has two gaps worth closing.

📋 Key Themes & Highlights

Key Themes

  • Missing compiler-level test: the new "Filter repo-memory files" step in pkg/workflow/repo_memory.go (step name, env vars, ordering) has no Go test asserting it's emitted correctly — only the JS side is tested.
  • Source-string-only regression tests: the two new tests in push_repo_memory.test.cjs grep the source file for expected substrings rather than exercising the actual scan/filter behavior end-to-end, so they wouldn't catch subtle wiring regressions.

Positive Highlights

  • ✅ Clean extraction of isMemoryFileEligible/compileFileGlobPatterns/filterIneligibleMemoryFiles into a single shared helper, eliminating the duplicated glob-compile logic that caused the original inconsistency.
  • ✅ Thorough, well-named unit tests in memory_file_eligibility.test.cjs covering the actual regression scenario, nested dirs, .git exclusion, and the no-eligible-files no-op case.
  • ✅ Root cause fix — replaces the downstream hard-fail with consistent upstream filtering, plus fixes the latent returncontinue bug that silently aborted directory scans.

Non-blocking — the fix logic is correct and behaviorally tested at the helper level; addressing the two comments would harden regression coverage at the integration points.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 81.1 AIC · ⌖ 14.9 AIC · ⊞ 10.3K
Comment /matt to run again

Comment thread pkg/workflow/repo_memory.go Outdated
}
builder.WriteString(" with:\n")
builder.WriteString(" script: |\n")
builder.WriteString(" const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');\n")

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.

[/tdd] No Go-level test asserts the new "Filter" step is emitted correctly (name, env vars, script content, and ordering vs. Sanitize/Validation/Upload steps). Existing coverage for this behavior lives only in .cjs source-string-matching tests, which don't verify the compiler wiring itself.

💡 Suggested test

Add a case in pkg/workflow/repo_memory_test.go alongside TestGenerateRepoMemoryArtifactUpload asserting:

  • The Filter repo-memory files (%s) step name appears when AllowedExtensions/FileGlob are set, and that it appears after "Sanitize" and before "Validate"/"Upload".
  • ALLOWED_EXTENSIONS and FILE_GLOB_FILTER env vars are populated with the expected values.
  • Since AllowedExtensions defaults to a non-empty list via extractRepoMemoryConfig, confirm the "no filter step" branch is only reachable when a caller explicitly empties both fields (an edge case not currently exercised).

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added TestRepoMemoryFilterStepGatesUpload (now asserts the "Filter repo-memory files" step name/ordering and the exact ALLOWED_EXTENSIONS/FILE_GLOB_FILTER env values) and TestRepoMemoryFilterStepEmptyBothFieldsSkipsFilter (asserts the no-filter branch is only reachable when both fields are empty) in 91e55b2.

});

describe("push_repo_memory.cjs - allowed-extensions persistence filter (regression: notes.json.new)", () => {
it("filters ineligible files before validation/upload instead of hard-failing on them (source check)", () => {

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.

[/tdd] Both new tests only grep the source file for expected substrings — they never actually invoke the scanDirectory/eligibility logic against real files, so they'd pass even if the wiring were subtly broken (e.g. wrong argument order, wrong reason string, filter applied after size validation instead of before).

💡 Suggested behavioral test

Since memory_file_eligibility.test.cjs already unit-tests isMemoryFileEligible/filterIneligibleMemoryFiles directly and thoroughly, complement these with a behavioral test that runs the real push_repo_memory.cjs main() (or an extracted scanDirectory-equivalent) against a temp source directory containing an eligible and an ineligible file, then asserts on filesToCopy/filteredOutFiles results and that the ineligible file never reaches the destination — mirroring the regression fixture from issue #58119 end-to-end rather than just matching strings in the source text.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replaced the source-grep-only test with a real behavioral test in 91e55b2: it writes actual notes.json/notes.json.new fixtures to a temp dir and drives the real isMemoryFileEligible/compileFileGlobPatterns helpers through the identical scan loop used in scanDirectory, asserting the ineligible file is filtered out and the eligible one is kept.

Note: I couldn't drive this through main() directly — vi.doMock can't intercept the CJS require() for git_helpers.cjs in this dynamic-import test setup (there's already a documented case of this in the same file, "should propagate git fetch authentication failure..."), so a true end-to-end run needs a real git remote. The new test instead exercises the exact real eligibility logic push_repo_memory.cjs runs inline, without relying on string matching.

@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.

Reviewed the repo-memory persistence-filter change (memory_file_eligibility.cjs, push_repo_memory.cjs, repo_memory.go, regenerated lock files).

Correctness: the shared isMemoryFileEligible/filterIneligibleMemoryFiles helper is applied consistently across the new compiler-emitted filter step and the scan loop in push_repo_memory.cjs, replacing the old whole-directory hard-fail (validateMemoryFiles) with per-file skip-and-log — matches the PR description and fixes the reported notes.json.new regression. The .git directory is correctly excluded from the recursive scan/delete. Bug fix (returncontinue) is verified in the diff.

Tests: JS-side logic is thoroughly covered by memory_file_eligibility.test.cjs (extension/glob interaction, nested dirs, .git exclusion, no-op case) and updated push_repo_memory.test.cjs. One gap: the new Go compiler logic in repo_memory.go (conditional "Filter %s files" step emission, env var wiring) has no dedicated Go test — left an inline comment with a concrete suggestion.

No blocking issues found; the inline comment is a suggestion for improved coverage, not a correctness concern.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 99.7 AIC · ⌖ 14.4 AIC · ⊞ 8.3K

Comments that could not be inline-anchored

pkg/workflow/repo_memory.go:416

New compiler logic that emits the "Filter %s files" step (env vars ALLOWED_EXTENSIONS/FILE_GLOB_FILTER, step ordering before validate/upload) has no Go-level test coverage. TestGenerateRepoMemoryArtifactUpload in repo_memory_test.go already asserts step ordering and env vars for the sibling sanitize/upload steps — consider adding a similar case asserting that: (1) the Filter step is only emitted when AllowedExtensions or FileGlob is set, (2) it appears between the sanitize and valid…

Copilot AI and others added 2 commits September 3, 2026 05:17
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

  1. It looks like we should be using a script file rather than the large script: added to the workflow, like we do in other situations....

Addressed in 872b7d2:

  1. The repo-memory "Filter files" step now uses the shared generateGitHubScriptWithRequire pattern — a main() entrypoint was added to memory_file_eligibility.cjs (reading MEMORY_DIR/ALLOWED_EXTENSIONS/FILE_GLOB_FILTER itself), so the compiled step is just the standard 4-line require(...) boilerplate instead of inlined logic.

  2. Yes — cache-memory and drive-memory had the same "hard fail instead of filter" issue: their post-agent validateMemoryStep call used core.setFailed on disallowed extensions rather than filtering. I changed validate_memory_step.cjs to call filterIneligibleMemoryFiles (log + remove) instead of failing, uniformly across repo/cache/drive, and removed the now-dead validate_memory_files.cjs hard-fail module.

  3. The script-based custom validation hook (Validation/VALIDATION_SCRIPT_B64) was already wired for all three kinds, but drive-memory had no test mirroring the cache/repo coverage — added TestDriveMemoryValidationConfigAndGeneratedSteps. Also added a validate_memory_step.test.cjs case asserting the filter (never hard-fail) behavior across all three kinds.

Also split generateRepoMemoryArtifactUpload into smaller step-builder functions since it was already over the repo's 60-line function limit and this touched every line of it.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Category: bug | Risk: high | Score: 78 | Action: fast_track

Note: Core repo-memory persistence bug fix with broad downstream impact.

Generated by 🔧 PR Triage Agent · copilot · mai10 · 24.3 AIC · ⌖ 2.54 AIC · ⊞ 16.1K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please take another pass on this PR: refresh the branch if needed, address any remaining review feedback, and run the pr-finisher skill before handing back to maintainers.

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

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please take another pass on this PR: refresh the branch if needed, address any remaining review feedback, and run the pr-finisher skill before handing back to maintainers.

Generated by [��...

No new review feedback has appeared since the last pass — HEAD is still e52731a with all prior fixes and test coverage in place, and the working tree has no pending changes. There's nothing new to act on; the outstanding blocker remains the stale CHANGES_REQUESTED review from github-actions[bot] against an old commit, which needs a maintainer to dismiss or a fresh automated review trigger.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🎉 Thanks for this fix! This PR is part of the core team's agentic development workflow and looks ready for review.

What's covered:

  • Persistent file eligibility filtering applied consistently across validation, upload, and push steps
  • New shared helper (memory_file_eligibility.cjs) with clear, reusable filtering logic
  • Comprehensive test coverage for both the new eligibility logic and existing memory operations
  • Workflow regeneration across all affected .lock.yml files to include the new filter step
  • Fixes the reported issue where ineligible files passed agent-side validation but failed downstream

The PR does one thing well and includes all necessary tests and documentation. Ready to merge! 🚀

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by ✅ Contribution Check · copilot · auto · 42 AIC · ⌖ 6.7 AIC · ⊞ 9.3K ·

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Category: bug | Risk: medium | Score: 71 (impact 34 + urgency 19 + quality 18) | Action: fast_track | CI: passing (2/2)

Core repo-memory reliability fix with green checks.

Generated by 🔧 PR Triage Agent · copilot · mai10 · 21.1 AIC · ⌖ 2.54 AIC · ⊞ 16.1K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on this PR.

  • The current head appears to contain the root-level slashless file-glob fix, shared script-file pattern, and cross-memory filtering consistency work, but the PR is still blocked by stale review state.
  • Please run the pr-finisher skill, reconcile the current head against any still-visible blocking review, and summarize the exact maintainer-facing blocker.
  • If the remaining blocker is only stale github-actions[bot] review state or branch protection rather than code changes, say that explicitly.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 42 AIC · ⌖ 8.67 AIC · ⊞ 9.2K ·
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on this PR.

  • The current head appears to contain the root-level slashless file-glob fix, shared script-file pattern, and cross-memory filtering consistency work, but the PR still looks blocked by stale review state.
  • Please run the pr-finisher skill, reconcile the current head against any still-visible blocking review, and summarize the exact maintainer-facing blocker.
  • If the remaining blocker is only stale github-actions[bot] review state or branch protection rather than code changes, say that explicitly.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/33831313247

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 40.5 AIC · ⌖ 8.81 AIC · ⊞ 8.9K ·
Comment /souschef to run again

Copilot AI commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

Confirmed explicitly: the remaining blocker is not a code issue. HEAD (e52731a) already contains the root-level slashless file-glob fix, the shared script-file pattern, and consistent filtering across preflight/agent-validation/push for all memory types, with test coverage. The mergeable_state: blocked is due to stale CHANGES_REQUESTED review state from github-actions[bot] (submitted against an old commit, 950771f) that hasn't been dismissed or refreshed — that requires maintainer action or a new automated review run, not further code changes from me.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on this PR.

  • The current head appears to contain the root-level slashless file-glob fix, shared script-file pattern, and consistent filtering across preflight, validation, and push for all memory types.
  • Please run the pr-finisher skill on the current head, reconcile that against the still-visible stale blocking review state, and restate the exact maintainer-facing blocker.
  • If the only remaining blocker is stale github-actions[bot] review state or branch protection rather than code changes, say that explicitly.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/33841481803

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 24.8 AIC · ⌖ 8.76 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Copilot AI commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author
pr-sous-chef
```...

Confirmed again: HEAD is unchanged at e52731a (working tree clean, no drift), and it already contains the root-level slashless file-glob fix, the shared script-file pattern, and consistent filtering across preflight/agent-validation/push for all memory types (repo/cache/drive), with test coverage.

Explicitly, per this comment's own request: the remaining blocker is not a code issue. It is the stale CHANGES_REQUESTED review from github-actions[bot] submitted against an old commit (950771f, several commits behind current HEAD), which has not been dismissed or refreshed and is keeping mergeable_state: blocked. No tool available to me can dismiss or force a re-run of that review — this needs a maintainer to dismiss it manually or trigger a fresh automated review pass. There is no further code action for me to take on this pass.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot PR #58120 (repo-memory: filter disallowed files before validation/upload instead of failing downstream in push) is ready for another pass. Please review outstanding feedback/checks, refresh the branch if needed, and run the pr-finisher skill to move it toward maintainer-ready state.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 6.97 AIC · ⌖ 8.68 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Copilot AI commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot PR #58120 (repo-memory: filter disallowed files before validation/upload instead of failing downstream in push) is ready for another pass. Please review outstanding feedback/checks, refresh t...

No new feedback has appeared since the last pass — HEAD is still e52731a, working tree clean, mergeable_state still blocked. All prior fixes and test coverage remain in place; there's nothing new to act on. The outstanding blocker continues to be the stale CHANGES_REQUESTED review from github-actions[bot] against an old commit, which requires maintainer action to dismiss/refresh — not further code changes from me.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on this PR.

  • The current head appears to contain the root-level slashless file-glob fix, shared script-file pattern, and consistent filtering across preflight, validation, and push.
  • Please run the pr-finisher skill on the current head, reconcile that against the still-visible stale blocking review state, and restate the exact maintainer-facing blocker.
  • If the only remaining blocker is stale github-actions[bot] review state or branch protection rather than code changes, say that explicitly.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/33868135047

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 27.1 AIC · ⌖ 8.74 AIC · ⊞ 9.2K ·
Comment /souschef to run again

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.

repo-memory: ignore disallowed files before artifact upload and push

4 participants