Skip to content

Pattern quality: Emit tools.github.min-integrity for PR-review archetypes - #254

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
pattern-quality-min-integrity-364ef7d5f26d40a9
Draft

Pattern quality: Emit tools.github.min-integrity for PR-review archetypes#254
github-actions[bot] wants to merge 1 commit into
mainfrom
pattern-quality-min-integrity-364ef7d5f26d40a9

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What was evaluated

Reviewed all 6 samples in /tmp/gh-aw/data/generated-patterns-and-prompts.json (status-report, issue-triage, code-improvement, documentation-updater, dependency-monitor, pr-review) against patterns/manifest.json, patterns/workflow-generation.json, patterns/archetypes/*.json, and the generator logic in src/js/workflow.js.

Recurring quality issue found

For the pr-review-ready sample (and the closely related skill-pr-reviewer archetype), the archetype's own curated tip already says:

"Set tools.github.min-integrity (e.g. approved) so the agent only acts on content from trusted authors"

This tip is data the wizard already knows is safety-critical for pull_request-triggered workflows, since PR content can come from untrusted external contributors. However, the generator only surfaced it as a prose "for example" bullet in the requirements list — it was never baked into the emitted tools.github: block of the suggested workflow YAML draft. A downstream agent implementing the draft is likely to treat prose tips as optional guidance and ship a workflow that reviews/reacts to unverified external PR content without the integrity gate, undermining the "Include DO NOT constraints to avoid false positive comments" goal stated elsewhere in the same prompt.

What changed

  • patterns/workflow-generation.json: added "min_integrity": "approved" to the pr-review and skill-pr-reviewer archetype definitions (both are pull_request/ready_for_review-triggered reviewers that read potentially untrusted diff/PR content).
  • src/js/workflow.js: generateWorkflowFile now emits tools.github.min-integrity: <value> directly in the generated frontmatter whenever an archetype defines min_integrity, so the guardrail ships by default in the suggested draft instead of only appearing as prose.
  • test/workflow.test.js: added assertions that pr-review workflows include min-integrity: approved under tools.github, and that unrelated archetypes (e.g. status-report) do not emit min-integrity at all.

Validation

  • npm test: 319/319 tests pass (18 test files).
  • npm run build: production build succeeds, dist/patterns/archetypes/pr-review.json regenerated correctly.

Follow-ups deliberately left out

  • Did not extend min_integrity to other pull_request-related archetypes (e.g. pr-iteration-loop, accessibility-expert, user-simulator, community-digest, ci-failure-triage) since those don't primarily process untrusted external diff content the way PR reviewers do — a broader audit of which archetypes need this guardrail is worth a separate pass.
  • Did not attempt to regenerate patterns/ from raw scan data, per task constraints.

Generated by Pattern Quality Eval · copilot · auto · 78.3 AIC · ⌖ 9.54 AIC · ⊞ 7.8K ·

The pr-review and skill-pr-reviewer archetypes' own tips already
recommend setting tools.github.min-integrity so the agent only acts on
content from trusted authors, but the generator only surfaced this as
a prose bullet in the requirements list rather than baking it into the
emitted workflow YAML. A downstream agent following the suggested
draft was therefore likely to omit this guardrail entirely, leaving
PR-triggered review workflows exposed to untrusted external-contributor
content.

Add a min_integrity field to these two archetype definitions in
patterns/workflow-generation.json and have generateWorkflowFile emit
tools.github.min-integrity in the generated frontmatter whenever it is
set, so the safety-critical setting ships by default instead of relying
on prose-only guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

0 participants