Skip to content

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

Merged
pelikhan merged 1 commit into
mainfrom
pattern-quality-min-integrity-364ef7d5f26d40a9
Sep 4, 2026
Merged

Pattern quality: Emit tools.github.min-integrity for PR-review archetypes#254
pelikhan merged 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>
@pelikhan
pelikhan marked this pull request as ready for review September 4, 2026 16:29
@pelikhan
pelikhan merged commit 243493d into main Sep 4, 2026
1 check passed
@pelikhan
pelikhan deleted the pattern-quality-min-integrity-364ef7d5f26d40a9 branch September 4, 2026 16:30

@github-actions github-actions Bot left a comment

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.

Reviewer: matt-pocock (JS/generator logic change)

Reviewed the diff for src/js/workflow.js, patterns/workflow-generation.json, and test/workflow.test.js.

The change is small, well-scoped, and safe:

  • min-integrity is only emitted inside the existing inferred.githubToolsets branch, so it can't leak into workflows without a tools.github block.
  • Guard is a simple truthy check (if (minIntegrity)), consistent with the surrounding code style (though it silently accepts any string value — fine given min_integrity is only ever set to "approved" in the pattern data today).
  • New tests cover both the positive case (pr-review gets min-integrity: approved) and the negative case (status-report doesn't emit it at all), which is good regression coverage for this data-driven generator.

No blocking issues found. Approving is not requested per dispatcher rules, so leaving this as a COMMENT review — no changes needed before merge (already merged).

Generated by Specialist PR Review for #254 · copilot · auto · 18.9 AIC · ⌖ 5.38 AIC · ⊞ 8.1K

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.

1 participant