Skip to content

Make invalid repo-memory baselines repairable during the agent turn - #67400

Merged
pelikhan merged 10 commits into
mainfrom
copilot/make-repo-memory-validation-recoverable
Oct 10, 2026
Merged

pelikhan merged 10 commits into
mainfrom
copilot/make-repo-memory-validation-recoverable

Conversation

Copilot AI commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

An existing repo-memory branch can fail a newer custom validator without the agent seeing why. The post-agent validation then fails after the repair opportunity has passed.

  • Baseline diagnosis: Validate a temporary copy after clone and add bounded stdout/stderr diagnostics to the agent prompt without failing the agent job.
  • Persistence boundary: Skip upload when an invalid baseline is unchanged. Changed memory must still pass post-agent validation and push-job validation before commit.
  • Coverage: Add cases for valid, repaired, unchanged-invalid, and newly-invalid memory.

Copilot AI and others added 3 commits October 10, 2026 11:14
…emory

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Make repo-memory validation recoverable for invalid baseline state Make invalid repo-memory baselines repairable during the agent turn Oct 10, 2026
Copilot AI requested a review from pelikhan October 10, 2026 11:30
@pelikhan
pelikhan marked this pull request as ready for review October 10, 2026 13:30
Copilot AI balanced review requested due to automatic review settings October 10, 2026 13:31

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

Baseline validation diverges from persistence preprocessing, leaks into read-only restore jobs, and includes a failing assertion.

2 open findings
What changed in this PR

Adds recoverable diagnostics for invalid repo-memory baselines while preventing unchanged invalid memory from being persisted.

Changes:

  • Validates cloned baselines and injects diagnostics into agent prompts.
  • Skips persistence for unchanged invalid baselines.
  • Adds runtime/compiler tests and documentation.
File Description
pkg/​workflow/​repo_memory.go Generates baseline validation and conditional upload steps.
pkg/​workflow/​repo_memory_test.go Tests generated validation workflow.
docs/​src/​content/​docs/​reference/​repo-memory.md Documents baseline recovery behavior.
actions/​setup/​js/​validate_memory_step.test.cjs Tests baseline diagnosis and repair cases.
actions/​setup/​js/​validate_memory_step.cjs Implements baseline validation and comparison.
actions/​setup/​js/​memory_custom_validation.cjs Adds baseline paths and excludes Git metadata from digests.

🧠 Review effort: Balanced


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

Comment thread pkg/workflow/repo_memory_test.go Outdated
Comment thread pkg/workflow/repo_memory.go Outdated
Comment on lines +640 to +642
if memory.Validation != nil {
fmt.Fprintf(builder, " - name: Validate repo-memory baseline (%s)\n", memory.ID)
fmt.Fprintf(builder, " uses: %s\n", getActionPin("actions/github-script"))

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.

Moved baseline validation out of the shared clone helper and gated it to the main agent restore setup. Pre-activation and custom-job read-only restores now remain clone-only. Verified in commit HEAD.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/workflow/repo_memory_test.go:1644): This count is four, not three. The parsed entry retains the default non-empty AllowedExtensions, so the skip condition is emitted on the sanitize, filter, custom-validation, and upload steps; this assertion will fail. Include the filter step in both the expected count and message. - Make invalid repo-memory baselines repairable during the agent turn #67400 (comment)
  3. Review (pkg/workflow/repo_memory.go:642): generateRepoMemorySteps is also reused by pre-activation restores and custom-job restore-memory (compiler_pre_activation_job.go:277 and compiler_custom_job_memory.go:193). Emitting baseline validation here makes every read-only restore execute the custom validator—potentially adding its full timeout and side effects—although those jobs have no agent prompt or upload check that consumes the result. Gate this step to the main agent restore path or split baseline diagnosis from the shared clone helper. - Make invalid repo-memory baselines repairable during the agent turn #67400 (comment)
  4. Fix failing check lint-js (FAILURE): https://github.com/github/gh-aw/actions/runs/38048556656/job/114224685921.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: b1d5e87
Sous-chef work: 10237e308e37e5244addc9e714b38aba1fa295064f1a0389e0b13ef35f1feb4f 28519275862743af5fe472a67150047414a0054326bd4c203d4b53df8f372465 bbcbbd0ca3f44836842efeccbe6ee4e009cf3d5f19a08d57a88ad2789afa0a2e
Sous-chef state: b63716ed3b370833191d27cd0eb322f09b5e09cdf1eca016bb0e9bfdaf0db77a

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 4.6 AIC · ⌖ 12.4 AIC · ⊞ 1K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits October 10, 2026 14:07
…ory-validation-recoverable

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot store validation log in temp file so that large validation errors do not explode the context.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot use secure write

Copilot AI and others added 2 commits October 10, 2026 15:10
…ory-validation-recoverable

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Copilot AI commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Ran make merge-main successfully (25a71b79d2). The four-step assertion and agent-only baseline gate were already addressed in f667cf6; their targeted tests pass. The prior formatting failure is no longer reproducible: make lint-cjs, full make lint, and make agent-report-progress pass. Secure diagnostic writes and tests are pushed in f7605bf96d. Existing review replies were not duplicated. The agent-only restore thread still needs resolution; the available API tools cannot resolve it and GitHub CLI lacks credentials. No CI was triggered.

@copilot store validation log in temp file so that large validation errors do not explode the context.

7b1c8d0 stores validator output in a temporary log and limits prompt excerpts to 1,000 characters. f7605bf96d secures those writes and adds a large-output regression test; all focused tests pass.

Copilot AI commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Ran PR-finisher on unchanged HEAD f7605bf96d. Prior lint, impacted tests, and security validation remain applicable; current main is included. Both review concerns are fixed and answered, but one thread still requires resolution—the available MCP tools lack that operation and GitHub CLI has no credentials. Required CI workflows show action_required; completed security/license checks pass. No files changed, duplicate replies posted, or CI triggered. Remaining work is thread resolution, human review, and CI approval.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan merged commit 540e47a into main Oct 10, 2026
36 of 37 checks passed
@pelikhan
pelikhan deleted the copilot/make-repo-memory-validation-recoverable branch October 10, 2026 15:31
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.

Make repo-memory validation recoverable for invalid baseline state

4 participants