Skip to content

feat(pr-management): plug skill families into the tool, and guard review mentions - #1579

Merged
potiuk merged 1 commit into
mainfrom
perf/pr-mgmt-4-infra
Oct 10, 2026
Merged

potiuk merged 1 commit into
mainfrom
perf/pr-mgmt-4-infra

Conversation

@potiuk

@potiuk potiuk commented Oct 10, 2026

Copy link
Copy Markdown
Member

Summary

Groundwork for moving the remaining pr-management skills onto tools/pr-management, after #1570 / #1571 / #1572:

  • pr-management discovers a family's subcommands from pr_management.<family>.cli (FAMILY, add_parsers, dispatch), and vetted-ops loads per-family ops_<family>.py modules shipped in the package, so each skill adds its commands and reads without editing a shared file. The catalogue stays closed: only modules inside the package load.
  • The agent-guard mention guard now also covers review posting (gh pr review --body/--body-file) and every value a non-GET gh api call sends, whatever the endpoint: every -f / -F / --raw-field / --field spelling gh accepts (including @file) and every --input string. No endpoint or mutation list to fall behind. Text it cannot read (stdin, an unreadable file) is refused instead of passing unseen.
  • It allows the one mention the mentoring hand-off exists to make: the configured maintainer team, alone, in a body opening with the hand-off template line, and only within the target repository's own organisation.

Bottom of a stack of seven; each skill PR above builds on this one.

Security notes

The hand-off exemption here trusts a committed, unmodified local mentoring-config.md. The top PR of the stack (mention allowlist) replaces that with a read from the target repository's default branch on GitHub, so a scratch repository the agent creates cannot satisfy it. Please merge the stack together rather than this PR alone.

Type of change

  • Tool change (agent-guard, vetted-ops, tools/pr-management)

Test plan

  • prek run --all-files passes
  • agent-guard pytest: new cases for review posting, every gh api write spelling, uninspectable bodies and the hand-off exemption
  • tools/pr-management and vetted-ops pytest / ruff / mypy

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5). I reviewed the diff and the test results; commits carry Generated-by:.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GTPsZ5aEE5bUVYqp47Dpvv

@potiuk potiuk added family:pr-management pr-management-* skills family:tools tools/* capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) labels Oct 10, 2026
@github-actions github-actions Bot added family:setup setup-* skills capability:triage Sweep + classify + propose disposition substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:sandbox Tool substrate: agent isolation, egress control, settings audit substrate:action-guard Tool substrate: deterministic pre-tool-use command guards labels Oct 10, 2026
@potiuk
potiuk added this pull request to stack #1586 October 10, 2026 09:23
@potiuk
potiuk force-pushed the perf/pr-mgmt-4-infra branch from 9ea3d17 to 9358aa1 Compare October 10, 2026 09:46
…iew mentions

Groundwork for moving the remaining pr-management skills onto
tools/pr-management:

- `pr-management` discovers a family's subcommands from
  `pr_management.<family>.cli` (`FAMILY`, `add_parsers`, `dispatch`), and
  vetted-ops loads per-family `ops_<family>.py` modules shipped in the
  package, so each skill adds its commands and reads without editing a
  shared file. The catalogue stays closed: only modules inside the
  package load.
- The agent-guard `mention` guard now covers review posting
  (`gh pr review --body/--body-file`) and every value a non-GET `gh api`
  call sends, whatever the endpoint — every `-f` / `-F` / `--raw-field` /
  `--field` value in each spelling `gh` accepts (`-fk=v`, `--field=k=v`,
  `@file` read) and every `--input` string: such text may @-mention
  nobody. No endpoint or mutation list to fall behind. Text it cannot
  read (a body on stdin, an unreadable body or field file) is refused
  instead of passing unseen.
- It also allows the one mention the mentoring hand-off exists to make:
  the `maintainer_team_handle` of the committed
  `.apache-magpie-overrides/mentoring-config.md`, alone, in a body that
  opens with the hand-off template's "— handing this off:" line. The
  file must be tracked and identical to HEAD (an uncommitted edit, or a
  scratch repository, does not count), the personal layer is never read
  for it, and the team must belong to the organisation that owns the
  target repository.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the perf/pr-mgmt-4-infra branch from 9358aa1 to 173bb56 Compare October 10, 2026 11:03
@potiuk
potiuk merged commit 7c789d7 into main Oct 10, 2026
13 checks passed
@potiuk
potiuk deleted the perf/pr-mgmt-4-infra branch October 10, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:triage Sweep + classify + propose disposition family:pr-management pr-management-* skills family:setup setup-* skills family:tools tools/* substrate:action-guard Tool substrate: deterministic pre-tool-use command guards substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant