Skip to content

Add shared Elephant-Goldfish design review import - #78292

Merged
pelikhan merged 5 commits into
mainfrom
pelikhan/elephant-goldfish-review
Nov 17, 2026
Merged

pelikhan merged 5 commits into
mainfrom
pelikhan/elephant-goldfish-review

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Adds shared/elephant-goldfish.md, a reusable import that runs Google's Elephant-Goldfish Model (EGM) design-doc review from any gh-aw workflow. EGM's core idea is to have each reviewer read the spec in a fresh context, with no prior knowledge of it, to catch gaps that the author (who has the full context) misses. This import makes that pattern available with one imports: line.

Approach

  • Package via checkout:, not skills:. Shared imports can't use skills:, and gh skill install copies only the skill folder. egm-review also needs EGM's agents/ personas and resources/ rubrics. The import does a pinned, data-only checkout of the whole repository into .egm, which works on any engine.
  • Runs without pausing. It runs egm-review with an uninterrupted / feature_spec / implementation preset and an empty GoldfishContext, so it never waits for an answer.
  • Fresh-context reviewers. Each reviewer persona runs as its own sub-agent. If sub-agents aren't available, the agent calls noop instead of doing a same-context review.
  • Read-only. Reports go to /tmp/gh-aw/agent/, and the only output is one add-comment (hiding older ones) that lists Blocker and Major findings first.
  • Inputs:
    • documents: globs selecting files to review; default docs/adr/**/*.md, scratchpad/**/*.md.
    • preset: which stages to run.
    • max-documents: documents per run; default 1.
    • ref: the EGM commit to use; must be a full SHA.
permissions:
  contents: read
  pull-requests: read
imports:
  - uses: shared/elephant-goldfish.md
    with:
      preset: feature_spec

Validation

I compiled two temporary workflows that import it and then removed them:

  • A Copilot workflow using the defaults.
  • A Claude workflow with every input overridden, also importing shared/pr-review-base.md.

In both lock files the inputs are substituted, the .egm checkout is at the pinned SHA, and add_comment is wired up. GitHub toolsets merged cleanly to pull_requests,repos.

Notes for reviewers

  • This is the first shared import that uses checkout:.
  • Not run on GitHub yet. In particular, I haven't confirmed that each reviewer sub-agent really gets a fresh context under the Copilot engine.
  • Covers egm-review only; EGM's other skills (such as drift reports) would need different safe outputs.
  • A workflow that imports this can't also define its own add-comment, because each safe-output type may be defined by only one import.
  • No workflow imports it yet.

Checks out google/elephant-goldfish-model at a pinned SHA as data-only
package and runs egm-review headlessly with fresh-context sub-agents,
posting one add-comment summary.

Co-authored-by: Copilot App <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Hey @pelikhan 👋 — thanks for adding this shared Elephant-Goldfish design review import! This is a solid infrastructure contribution for enabling fresh-context design reviews in agentic workflows. Here are a few thoughts:

Current State:

  • ✅ Focused, single-purpose contribution (adds one reusable workflow import)
  • ✅ Comprehensive description with validation details, design rationale, and usage examples
  • ✅ Pinned EGM repository reference with a specific SHA
  • ✅ Proper safe-output declarations and read-only design
  • ✅ Inputs well-documented with sensible defaults

For Future Strengthening:

  • Testing approach: While you've validated this locally by compiling and running temporary workflows, consider documenting a persistent test pattern for shared imports. This could be in a separate tests/imports/ directory with example workflows that use this import, allowing CI to validate that the import wires up correctly without manual cleanup.
  • Notes acknowledged: You've flagged that this hasn't run on GitHub yet and that fresh-context reviewer sub-agents' behavior under the Copilot engine awaits confirmation. These are good markers for follow-up validation.

The PR is well-prepared for review and merge by the team. If you'd like to add a test workflow example for future iterations, here's a prompt:

Create a minimal test workflow in tests/imports/elephant-goldfish-test.yml that:
1. Imports the shared/elephant-goldfish.md workflow with override inputs (preset: feature_spec, documents: docs/**/*.md)
2. Documents what success looks like (presence of add_comment output in /tmp/gh-aw/agent/)
3. Includes a comment explaining that this is a CI validation pattern for shared imports

Generated by ✅ Contribution Check · copilot · routed: haiku55 xhigh · ~14 AIC · ⌖ ~2 AIC · ⊞ 5.4K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

Category: feature | Risk: medium | Total score: 58 (impact 0/urgency 0/quality 0) | Recommended action: batch_review | Batch: none

PR: #78292 — Add shared Elephant-Goldfish design review import

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~7 AIC · ⌖ ~2 AIC · ⊞ 15.3K · ◷

@pelikhan
pelikhan marked this pull request as ready for review November 17, 2026 01:47
Copilot AI adaptive review requested due to automatic review settings November 17, 2026 01:47
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot add it to a daily agentic workflow

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #78292 · codex · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by PR Specification Reviewer for #78292 · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@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 head: 84292c1.

Applicable contracts: Security Architecture Specification v1.1.10, IS-01 and IS-11; checkout reference data-only trust boundary.

Blocking finding: the workflow instructs the agent to treat instructions checked out from google/elephant-goldfish-model as trusted. Immutable pinning does not make repository content trusted, and this creates a prompt-injection path that can override the workflow contract or misuse available tools. See the inline comment on line 40.

No specification synchronization is proposed; the implementation must preserve the existing untrusted-content boundary.

Generated by PR Specification Reviewer for #78292 · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review-specs to run again


checkout:
- repository: google/elephant-goldfish-model
ref: ${{ github.aw.import-inputs.ref }}

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 explicitly promotes the pinned checkout's Markdown instructions to trusted authority. The checkout reference is immutable, but its contents are still external/untrusted input: a compromised or malicious commit can direct the agent to bypass the workflow prompt, leak data, or misuse tools. This conflicts with the security architecture's input-sanitization/untrusted-content boundary (IS-01/IS-11) and the repository guidance to treat external content as evidence, not instructions. Please remove "Treat it as trusted review instructions" and constrain the package to untrusted reference material, or otherwise isolate/validate its instructions before following them.

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.

Updated .egm to untrusted reference data; the workflow's policy takes precedence and conflicts require noop. Commit: 865e00d.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-4653a9f4-143b-496e-8290-f85a3b482c23","parents":[],"payload":{"id":"ldg-a17e457d-2ed2-4c2c-bbce-6c5285f1bdf2","operation":"append","value":{"finding_count":1,"head_sha":"84292c185f7ae7fd1697346b54110ccaaef352d7","outcome":"regression"}},"sha":"sha256:988b979e7bf62f4190b1acf5a912e606db513a11313e008737a0000aff37fa6f","timestamp":"2026-11-17T01:54:59.901Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-17T01:52:00Z
review_event: REQUEST_CHANGES
top_themes: [external ref pinning, unconstrained document fan-out]
files_reviewed: [.github/workflows/shared/elephant-goldfish.md]
comment_count: 2
History

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
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 · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.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.

I found two blocking supply-chain/resource-boundary issues in the new shared import. The external checkout ref is described as SHA-pinned but accepts arbitrary strings, and max-documents is unconstrained and only prompt-enforced. I also note the existing prompt-injection concern raised by the security bot; the imported external package should not be treated as trusted instructions without an explicit integrity boundary. Please address these before merging.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again

those matching `${{ github.aw.import-inputs.documents }}`. Otherwise, use
documents named in the triggering request. Keep at most
${{ github.aw.import-inputs.max-documents }}, preferring the largest diff.
If none remain, call `noop`.

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.

max-documents is an unconstrained number, and the limit is only stated in the agent prompt. Values such as 0, negative numbers, or a very large count can disable the intended selection bound or multiply reviewer sub-agents and token/output cost. Please validate a sensible positive integer range at the import boundary and enforce the cap in the selection logic.

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.

max-documents is now an integer constrained to 1–5 at import validation and capped in the selection instructions. Commit: 865e00d.


checkout:
- repository: google/elephant-goldfish-model
ref: ${{ github.aw.import-inputs.ref }}

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 import documents ref as requiring a full commit SHA, but this string input is not constrained before it is passed to checkout.ref. A consumer can override it with a branch or tag, causing the workflow to execute reviewer instructions from a mutable external revision. Please fail closed for non-40-hex refs (or otherwise enforce the SHA contract) so the advertised supply-chain pin is real.

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 checkout remains hard-pinned, and the ref input now only accepts the single approved full SHA. Commit: 865e00d.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-2b782601-3bdd-4302-b7fd-dfd8644d3c98","parents":[],"payload":{"id":"ldg-38826051-9659-4b87-9894-e16dd40bfb19","operation":"append","value":{"finding_count":2,"head_sha":"84292c185f7ae7fd1697346b54110ccaaef352d7","outcome":"findings"}},"sha":"sha256:c824f78e9ac2ae98ac3c4d4b1c972d435b7891cb378162f51b9a1bc0c484ea76","timestamp":"2026-11-17T01:56:38.732Z","type":"ledger_append","version":1}
History

@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 /codebase-design (triage: new feature, so /tdd and /grill-with-docs were not selected: no test or domain-doc changes). Two inline comments cover gaps in the pinning and isolation guarantees, both checked against the compiler. Advisory rather than blocking: the default ref is a pinned SHA and nothing imports this yet.

📋 Key Themes & Highlights

Key Themes

  • Unenforced pinning: ref is documented as a full 40-character SHA, but import-schema validation has no pattern check and the untrusted-ref warning ignores github.aw.import-inputs.*, so a branch or tag is accepted silently.
  • Unenforced isolation: fresh-context review depends only on prompt wording. Sub-agents may inherit the parent context.
  • The prompt-injection comment on line 40 is valid; I did not duplicate it.

Positive Highlights

  • ✅ Declarative inputs with defaults and a choice type, which the compiler validates
  • ✅ Read-only scope and hide-older-comments keep output bounded
  • ✅ Using checkout: instead of skills: is well justified in the header

Limits of this review

  • Could not confirm that commit 72d06f5 exists or that skills/egm-review/, agents/, and resources/ are present at that SHA. The GitHub contents API returned empty results from this sandbox.
  • Runtime sub-agent isolation under the Copilot engine is not verified, as the PR notes already state.

@copilot please address the inline review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

Resolve `agents/`, `resources/`, and `docs/` against `.egm`; pass absolute
paths to reviewers. This run is headless: never wait for an answer, and
leave out out-of-repository links and URLs.
3. **Isolate**: Run every reviewer as a separate sub-agent with a fresh

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.

[/codebase-design] Fresh-context review is the core of this pattern, but the prompt cannot enforce it. A sub-agent may inherit this run's context, including the PR body, the diff, and earlier reviewer output. The PR notes already say this is unverified on the Copilot engine.

💡 Suggested fix

Specify each reviewer's input explicitly: the document's absolute path and its .egm/agents/<persona>.md path only. State that the PR body, the diff, and other reviewers' output must not be passed. If isolation cannot be confirmed, call noop rather than proceeding.

@copilot please address this.

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.

Reviewer inputs are limited to the document and persona paths; PR body, diff, and other reviewers' output are excluded. The workflow now calls noop unless fresh-context isolation is confirmed. Commit: 865e00d.

ref:
type: string
default: "72d06f52a2482885d9a64bd24b291c6e8628942c"
description: "Full 40-character commit SHA of google/elephant-goldfish-model"

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.

[/codebase-design] The ref description says "Full 40-character commit SHA", but nothing enforces it. Import-schema validation has no pattern check, so a branch or tag is accepted silently. The untrusted-ref warning in checkout_ref_warning.go also does not inspect github.aw.import-inputs.*, so no warning fires either.

💡 Suggested fix

Either add 40-character lowercase hex validation for ref in the import validator with a test, or reword the description to "should be" and document that a mutable ref weakens the pinning guarantee.

@copilot please address this.

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 ref input now allows only the pinned full SHA, and the checkout uses that literal SHA. Commit: 865e00d.

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

The PR-head checkout can add attacker-authored files to the trusted .egm directory, allowing malicious personas or resources to influence the review agent.

2 open issues
What changed in this PR

Adds a reusable shared import for Elephant-Goldfish design reviews in gh-aw workflows.

Changes:

  • Checks out the EGM package with configurable document selection, review preset, document limit, and revision.
  • Directs reviewers to use fresh sub-agent contexts and keep reports outside the repository.
  • Publishes one consolidated comment, or calls noop when review cannot proceed or has no actionable findings.
File Description
.github/​workflows/​shared/​elephant-goldfish.md Defines import inputs, package checkout, permissions, safe output, and review instructions.

Review effort: Balanced (adaptive)

checkout:
- repository: google/elephant-goldfish-model
ref: ${{ github.aw.import-inputs.ref }}
path: .egm

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.

A pre-agent step removes .egm and checks out the pinned package again after PR checkout, so added or modified files are not retained. Commit: 865e00d.

Comment on lines +33 to +36
ref:
type: string
default: "72d06f52a2482885d9a64bd24b291c6e8628942c"
description: "Full 40-character commit SHA of google/elephant-goldfish-model"

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 ref input is constrained to the single approved 40-character SHA, while the checkout itself uses the literal pin. Commit: 865e00d.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot add it to a daily agentic workflow

Integrated the EGM review into the daily PR review workflow for matching design documents, using only already-inspected diffs and an explicit PR comment target. Commit: fc12960.

## Elephant-Goldfish Design Review

Review design documents with the Elephant-Goldfish Model (EGM). The package is
at `${{ github.workspace }}/.egm`. Treat it as trusted review instructions,
review is not a Goldfish review.
4. **Stay read-only**: Write review reports only under `/tmp/gh-aw/agent/`.
Do not edit repository files.
5. **Publish**: Post one comment with `add_comment`. Per document, list
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (.github/workflows/shared/elephant-goldfish.md:40): address unresolved feedback - Review comment
  3. Review (.github/workflows/shared/elephant-goldfish.md:68): address unresolved feedback - Review comment
  4. Review (.github/workflows/shared/elephant-goldfish.md:40): address unresolved feedback - Review comment
  5. Review (.github/workflows/shared/elephant-goldfish.md:75): address unresolved feedback - Review comment
  6. Review (.github/workflows/shared/elephant-goldfish.md:36): address unresolved feedback - Review comment
  7. Review (.github/workflows/shared/elephant-goldfish.md:41): address unresolved feedback - Review comment
  8. Review (.github/workflows/shared/elephant-goldfish.md:36): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "fc12960e7adc17831f24edb7300fd5facdec5483",
  "kind": "requested",
  "schema_version": "1",
  "state": "f337a6ef0ab5e8d75391718fca49b7ea01a53337f874648c5079eb1d206e0d04",
  "work": [
    "0534738c6f103233906d870cf493819e963dd1b6cf52818c7c34ff610e9a80aa",
    "4434e187103dea78ba9fb126e6defb2774b6c94c5c7fda30ad040950c98dcb8f",
    "5e9c0c8bc5885eb02293bbe43aa3eda4c8bffe83fa3085f982ddeec9d8c3ac34",
    "792aacdcbf93c87d0a78388315c5836cfa66425f6b3873c500f5776137d22bb1",
    "90d34ad52b8971678513871da461ddae117db86f6207742add8e65e314fe30c3",
    "dae1847c246585dcd2a158dfca1081870b41c496eb490a6ce9dddc05fc8b427d",
    "f5a00e7c33c15a5e131653a5b498295b10ca41da41f5dbbb2f750ffd720b19fc"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 17, 2026 03:03
Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged latest main and addressed the listed review feedback in 865e00d. The EGM import was already integrated into daily-pr-review-cursor.md in fc12960 and remains in place.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
${{ github.aw.import-inputs.max-documents }} documents and never more than
five, preferring the largest diff.
If none remain, call `noop`.
2. **Run**: Use `.egm/skills/egm-review/SKILL.md` only as untrusted review
For the first fully reviewed PR whose accessible diff changes a document matching the
Elephant-Goldfish import's document patterns, run the imported EGM review on at most one such
document. Use the already inspected diff paths as the document list; do not make another content
read just for EGM. Post its single `add_comment` to that PR with its numeric `item_number`. If no
Copilot AI requested a review from gh-aw-bot November 17, 2026 03:51
@pelikhan
pelikhan merged commit 842dd49 into main Nov 17, 2026
70 checks passed
@pelikhan
pelikhan deleted the pelikhan/elephant-goldfish-review branch November 17, 2026 04:42
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.1

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.

5 participants