Skip to content

Expose memory stores to on.steps in pre-activation for deterministic dispatch gating#44015

Merged
pelikhan merged 11 commits into
mainfrom
copilot/expose-memory-stores-on-steps
Jul 8, 2026
Merged

Expose memory stores to on.steps in pre-activation for deterministic dispatch gating#44015
pelikhan merged 11 commits into
mainfrom
copilot/expose-memory-stores-on-steps

Conversation

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

on.steps executes in pre_activation, but memory stores were only restored in the agent job. This prevented deterministic pre-activation filters from using prior memory state without spending an LLM turn.

  • Pre-activation memory hydration

    • Added buildPreActivationMemoryRestoreSteps and invoked it before injectPreActivationOnSteps.
    • Pre-activation now restores/loads:
      • cache-memory (restore/setup path),
      • repo-memory (clone path),
      • comment-memory (materialized files via setup_comment_memory_files.cjs).
    • Hydration is scoped to workflows that define on.steps.
  • Read-only behavior in pre-activation

    • Reused restore/load paths only.
    • No cache commit or repo push/write-back steps are introduced in pre_activation.
  • Coverage for memory-aware pre-activation dispatch

    • Added an on_steps test case that validates:
      • memory restore/load steps are present in pre_activation,
      • they appear before the on.steps gate step,
      • write-back/commit steps are absent from pre_activation.
steps = c.buildPreActivationRolesBotsCmdSteps(data, steps)
steps = c.buildPreActivationMemoryRestoreSteps(data, steps) // restore memory before on.steps
steps, onStepIDs, err := c.injectPreActivationOnSteps(data, steps, customSteps)

Generated by 👨‍🍳 PR Sous Chef · 11.9 AIC · ⌖ 7.75 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 11.9 AIC · ⌖ 7.75 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 3.94 AIC · ⌖ 7.46 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 4.03 AIC · ⌖ 8.11 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 10.1 AIC · ⌖ 5.64 AIC · ⊞ 4.7K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 7.79 AIC · ⌖ 6.55 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 8.05 AIC · ⌖ 8.96 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 9.66 AIC · ⌖ 5.93 AIC · ⊞ 7.1K ·
Comment /souschef to run again


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

Generated by 👨‍🍳 PR Sous Chef · 13 AIC · ⌖ 12.3 AIC · ⊞ 7.1K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Expose memory stores to on.steps pre-activation filter Expose memory stores to on.steps in pre-activation for deterministic dispatch gating Jul 7, 2026
Copilot AI requested a review from pelikhan July 7, 2026 12:44
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Triage · Run §28868091227

Field Value
Category feature
Risk Medium
Score 38 / 100
Action defer

Score breakdown: Impact 15 · Urgency 10 · Quality 13

Rationale: Draft. Adds memory-store hydration to pre_activation / on.steps. Related to #43984 (cache/repo-memory ordering) — defer until #43984 is reviewed/merged first to avoid rework.

Labels: pr-type:feature pr-risk:medium pr-priority:low pr-action:defer

Generated by 🔧 PR Triage Agent · 119.4 AIC · ⌖ 6.65 AIC · ⊞ 5.4K ·

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

This PR updates the workflow compiler so that workflows using on.steps can access previously persisted memory state during the pre_activation job, enabling deterministic dispatch gating without needing an LLM turn to reconstruct state.

Changes:

  • Adds pre-activation memory hydration via a new buildPreActivationMemoryRestoreSteps hook that runs before injectPreActivationOnSteps.
  • Extends on_steps tests to validate memory restore steps are present and ordered before the on.steps gate, and that explicit write-back steps are absent.
  • Updates a generated workflow lock file to reflect the new pre-activation repo-memory clone step.
Show a summary per file
File Description
pkg/workflow/compiler_pre_activation_job.go Adds pre-activation memory restore step generation before on.steps injection.
pkg/workflow/on_steps_test.go Adds coverage asserting memory restore steps appear in pre_activation before the on.steps gate.
.github/workflows/daily-cli-performance.lock.yml Regenerates lock output to include the new pre-activation repo-memory restore step.

Review details

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment on lines +241 to +244
var memorySteps strings.Builder

generateCacheMemorySteps(&memorySteps, data)
generateRepoMemorySteps(&memorySteps, data)
Comment on lines +286 to +290
// Memory stores should be restored before on.steps run in pre-activation.
assert.Contains(t, preActivationSection, "Restore cache-memory file share data")
assert.Contains(t, preActivationSection, "Clone repo-memory branch (default)")
assert.Contains(t, preActivationSection, "Prepare comment memory files")
assert.Contains(t, preActivationSection, " id: gate")
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (111 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/44015-expose-memory-stores-to-on-steps-pre-activation.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff
  2. Complete the missing sections — add context the AI could not infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-44015: Expose Memory Stores to on.steps in Pre-Activation

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number (e.g., 44015-expose-memory-stores-to-on-steps-pre-activation.md for PR #44015).

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · 36.3 AIC · ⌖ 12.8 AIC · ⊞ 8.5K ·
Comment /review to run again

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel · 35.9 AIC · ⌖ 9.98 AIC · ⊞ 6.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.

Test Quality Sentinel: 90/100. 0% implementation tests (threshold: 30%). One new design_test with behavioral_contract coverage; minor: 4 assert calls lack failure-context messages; inflation ratio 2.47:1 (expected for compiler integration tests). No guideline violations.

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, make this PR merge-ready, address all unresolved review feedback, and rerun checks once the branch is up to date.

...

Ran pr-finisher on head b8514e4. No additional code changes were needed; unresolved feedback remains covered by 315c559, d6faece, and 85aabb5.

Re-ran local checks successfully: make fmt, make lint, make test-unit, make test, make recompile, and make agent-report-progress.

Current PR workflow runs on this head are action_required with no jobs started, so CI on this head is still unverified until a maintainer re-triggers workflows.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

\n@copilot please run the skill, make this PR merge-ready, address all unresolved review feedback, and rerun checks once the branch is up to date.\n\nOutstanding review feedback to address first:\n- github-actions: outstanding requested changes on this PR\n- github-actions: outstanding requested changes on this PR

Generated by 👨‍🍳 PR Sous Chef · 13 AIC · ⌖ 12.3 AIC · ⊞ 7.1K ·
Comment /souschef to run again

@pelikhan

pelikhan commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

@copilot

  • merge main and recompile

  • add frontmatter field

    on.restore-memory: true/false

to enable this behavior. False by default.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, make this PR merge-ready, address unresolved review feedback, and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 9.99 AIC · ⌖ 9.17 AIC · ⊞ 4.7K ·
Comment /souschef to run again

…-stores-on-steps

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

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

  • merge main and recompile...

Done in 6167377.

  • Merged latest main into this branch.
  • Added on.restore-memory (boolean) to frontmatter parsing/schema.
  • Pre-activation memory restore now runs only when on.restore-memory: true (default is false).
  • Recompiled workflows and updated generated lock output accordingly.
  • Validation passed locally: make fmt, make lint, make test-unit, make test, make recompile, make agent-report-progress.

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, make this PR merge-ready, address unresolved review feedback, and rerun checks once the branch is up to date.

...

Ran pr-finisher triage on current head 6167377 and revalidated locally: make fmt, make lint, make test-unit, make test, make recompile, and make agent-report-progress all pass.

No further code changes were needed in this pass; unresolved review feedback is already addressed by 6167377 (with earlier supporting fixes in 85aabb5, d6faece, and 315c559).

Current PR workflow runs on this head are action_required/stale (agent pushes do not trigger CI), so required checks need a maintainer-triggered rerun.

@pelikhan

pelikhan commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

@copilot enable flag in a few agentic workflows that use memory in this repository

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

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot enable flag in a few agentic workflows that use memory in this repository

Implemented in caac628.

Enabled on.restore-memory: true in these memory-using workflows:

  • .github/workflows/daily-cli-performance.md
  • .github/workflows/smoke-copilot.md
  • .github/workflows/smoke-codex.md

Also fixed compilation/schema handling by commenting out on.restore-memory in generated YAML (same path used for on.steps/on.permissions) and added regression coverage in pkg/workflow/on_steps_test.go.

Recompiled workflows and re-ran checks (make recompile, go test ./pkg/workflow -run TestOnSteps, make agent-report-progress).

@pelikhan pelikhan merged commit 0186054 into main Jul 8, 2026
29 checks passed
@pelikhan pelikhan deleted the copilot/expose-memory-stores-on-steps branch July 8, 2026 02:57
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.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.

[plan] Expose memory stores to on.steps pre-activation filter for deterministic dispatch decisions

4 participants