Skip to content

perf(security-issue-import-from-pr): wording pass, with a vetted-ops PR read - #1457

Merged
potiuk merged 3 commits into
apache:mainfrom
potiuk:perf/security-wording-import-from-pr
Sep 28, 2026
Merged

potiuk merged 3 commits into
apache:mainfrom
potiuk:perf/security-wording-import-from-pr

Conversation

@potiuk

@potiuk potiuk commented Sep 28, 2026

Copy link
Copy Markdown
Member

First skill of the security-family wording pass (#1344): the optimize-skill rewrite pass, done paragraph by paragraph with the maintainer on security-issue-import-from-pr.

Summary

  • Wording. One sentence per line, restated rationale cut, and links to the source (AGENTS.md, the security-issue-fix guardrails, scope-labels.md, the bot-credit policy) instead of copies. Headings, golden-rule headlines, code blocks, the generated review block and eval fixture strings are unchanged. SKILL.md: 840 → 679 lines, 9,624 → 8,059 tokens (−16%).
  • Fixes found along the way:
    • Step 1 fetched the PR with a redirected gh pr view. A redirected gh stays sandboxed under the secure setup and fails; the step now uses a new vetted-ops read, pr-view-with-body.
    • Step 3 checked the milestone with gh api … | grep -F, which is piped and fails the same way. It now lists the titles with one plain call and compares them.
    • 5c said labels are applied at creation, while 7a created the issue without them and 7b added hardcoded literals in a second call. 7a now sets the configured labels at creation.
    • The rollup template linked to .claude/skills/… on the tracker, a path that does not exist there. It now links to the skill files in apache/magpie.
    • The mixed-scope guard now says several sub-packages of one scope are not mixed.
  • pr-view-with-body (vetted-ops): the fields of pr-view plus body. It reads only the policy-pinned upstream repository, through vetted-op-read. Adding body to pr-view itself would load every PR description into pr-management's sweeps.
  • Learned style rules are written into optimize-skill's learned-style region, as the rewrite pass prescribes. They apply to the next skills in the pass.

Adopters: grant pr-view-with-body to the security-issue-import-from-pr caller in your vetted-ops policy file (.apache-magpie-overrides/tools/vetted-ops/config.toml).

Test plan

  • prek run on the diff, after rebasing onto main; skill-and-tool-validate; check-placeholders
  • vetted-ops tests, including one that pins pr-view-with-body's command and checks it is a read
  • import-from-pr evals, before (main) and after, outside the sandbox:
    • step-3 3/3, step-6 3/3 and step-8 2/2 on both sides.
    • step-2 5/5 before. After, case-5-multi-provider failed once; it was already flaky on main (2 of 4 runs). The mixed-scope clarification makes it pass 4 of 4.

Part of #1344.

Generated-by: Claude Code (Opus 5.5)

🤖 Generated with Claude Code

security-issue-import-from-pr needs the upstream PR's description to
build the tracker body. The existing `pr-view` operation leaves `body`
out, and adding it there would load every PR description into
pr-management's sweeps. `pr-view-with-body` returns the same fields plus
`body`. It reads only the policy-pinned upstream repository, and runs
through `vetted-op-read`.

The policy example grants it to security-issue-import-from-pr.

Generated-by: Claude Code (Opus 5.5)
The optimize-skill rewrite pass, run paragraph by paragraph with the
maintainer: one sentence per line, restated rationale cut, and pointers
to the source (AGENTS.md, the security-issue-fix guardrails,
scope-labels.md, the bot-credit policy) instead of copies of it. Headings,
golden-rule headlines, code blocks, the generated review block and eval
fixture strings are unchanged. SKILL.md goes from 840 to 679 lines.

Fixes found along the way:
- Step 1 fetched the PR with `gh pr view … > <scratch>/pr-<N>.json`.
  A redirected `gh` stays sandboxed under the secure setup and fails;
  the step now uses vetted-ops' `pr-view-with-body` read.
- Step 3 checked the milestone with `gh api … | grep -F`, which is
  piped and fails the same way. It now lists the titles with one plain
  call and compares them.
- 5c said labels are applied at creation, while 7a created the issue
  without them and 7b added hardcoded label literals in a second call.
  7a now sets the configured labels at creation.
- The rollup template linked to `.claude/skills/…` on the tracker, a
  path that does not exist there; it now links to the skill files in
  apache/magpie.
- The mixed-scope guard now says that several sub-packages of one scope
  are not mixed. The step-2 multi-provider eval case, flaky before
  (2 of 4 runs), passes 4 of 4.

Generated-by: Claude Code (Opus 5.5)
…ding pass

The rewrite pass ends by writing down the rules the maintainer's edits
implied, as bullets in the skill's learned-style region. These come
from the security-issue-import-from-pr pass: point at the source instead
of restating it, cut rationale a nearby section gives, leave short
paragraphs alone, keep boundary-marking examples (an eval regressed
without one), and fix sandbox-hostile `gh` calls met along the way.

Generated-by: Claude Code (Opus 5.5)
@potiuk potiuk added family:security security-* skills family:tools tools/* labels Sep 28, 2026
Comment thread tools/vetted-ops/src/vetted_ops/ops.py Dismissed
@github-actions github-actions Bot added the substrate:sandbox Tool substrate: agent isolation, egress control, settings audit label Sep 28, 2026
@potiuk
potiuk merged commit 87bfb59 into apache:main Sep 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:security security-* skills family:tools tools/* substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants