Skip to content

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

Open
pelikhan with Copilot wants to merge 8 commits into
mainfrom
copilot/expose-memory-stores-on-steps
Open

Expose memory stores to on.steps in pre-activation for deterministic dispatch gating#44015
pelikhan with Copilot wants to merge 8 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

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 and others added 2 commits July 7, 2026 17:12
…-stores-on-steps

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>

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review comments, and rerun checks once the branch is up to date.

...

Done. I ran pr-finisher, updated the branch with origin/main in 30c3789, and addressed remaining unresolved review follow-ups in 85aabb5 (separate pre-activation memory step appends + more robust pre_activation section extraction in on_steps tests).

Local checks passed: make fmt, make lint, make test-unit, make test, make recompile, and make agent-report-progress.

CI on this new head did not auto-rerun from agent pushes, so a maintainer-triggered rerun is still required.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review comments, and rerun checks once the branch is up to date.
Unresolved review threads to address:

  • `@copilot-pull-request-reviewer...

Addressed. The unresolved threads you listed are already covered by commits 315c559, d6faece, and 85aabb5 (with branch update in b8514e4).

I re-ran local checks on the current head and they pass: make fmt, make lint, make test-unit, make test, make recompile, and make agent-report-progress.

CI on agent-pushed commits remains stale/action-required and must be re-triggered by a maintainer to refresh required checks on the latest head.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address outstanding review feedback, and rerun checks once the branch is up to date.
Outstanding review feedback to address first:

  • github-actions: outstanding requested changes on this PR
  • github-actions: outstanding requested changes on this PR

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

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address outstanding review feedback, and rerun checks once the branch is up to date.
Outstanding review feedback to address first:

  • github-actions: outsta...

I re-ran pr-finisher triage on the current head (b8514e4) and verified the outstanding github-actions requested-change items are already addressed by 315c559, d6faece, and 85aabb5 (cache restore-only in pre_activation, test assertions for actions/cache/restore, and pre-activation step/list ordering cleanup).

I also re-ran local checks on this branch and they pass: make fmt, make lint, make test-unit, make test, make recompile, and make agent-report-progress.

Branch is up to date with main; CI on agent-pushed commits remains stale/unverified until a maintainer re-triggers workflows.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

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

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

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

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

...

Ran pr-finisher triage on the current head (b8514e4). The branch is up to date with origin/main, and local checks pass on this head: make fmt, make lint, make test-unit, make test, make recompile, and make agent-report-progress.

No additional code changes were needed in this pass; prior review feedback remains covered by 315c559, d6faece, and 85aabb5.

CI on agent-pushed commits is stale/action-required and cannot be refreshed by this agent; a maintainer needs to re-trigger workflows (close/reopen PR, workflow_dispatch, or maintainer push) to validate required checks on b8514e4.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

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.

Unresolved review threads to address (ne...

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

The unresolved threads listed are already addressed by existing commits:

  • 315c559 (pre-activation cache restore-only fix)
  • d6faece (restore-only hardening + cache action assertions)
  • 85aabb5 (remaining pre-activation ordering/structure follow-ups)

No additional code changes were needed in this pass. CI on the agent head remains unverified until a maintainer re-triggers workflows.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

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

Generated by 👨‍🍳 PR Sous Chef · 9.66 AIC · ⌖ 5.93 AIC · ⊞ 7.1K ·
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.

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

4 participants