Skip to content

feat(skills): publish changes through vetted-op-git instead of raw git recipes - #2228

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:chore/skills-vetted-git-recipes
Nov 22, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:chore/skills-vetted-git-recipes

Conversation

@potiuk

@potiuk potiuk commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #2224, which added the vetted-op-git operations but only updated the shared sandbox golden-rule block.
The skills that publish a change still told the agent (or the user) to run raw git push, git commit, git worktree add and gh pr create.
This PR rewrites those publish paths to the vetted operations.

  • One canonical sequence. New shared block tools/dev/blocks/vetted-git-publish.md, rendered by check-shared-blocks.py into a vetted-git-publish.md companion per skill, with --caller set to the skill's own name.
    It maps each step to its operation (git-fetch, git-worktree-add, git-worktree-sync, git-stage, git-commit, git-push-branch, git-pr-create, git-worktree-remove), says to run the pre-commit / pre-push checks in the sandbox first, and keeps every call user-confirmed.
  • Fallback, stated once per skill. When no [git] values are configured for the project, the skill hands the user the commands as before. A refused caller names the missing grant; no skill borrows another's --caller. A draft PR or a base other than pr_base keeps gh pr create --web (git-pr-create opens ready PRs against pr_base only).
  • Skills rewritten: security-issue-fix, issue-fix-workflow, audit-finding-fix, setup-upstream-fix, setup-override-upstream, pr-management-shepherd, pr-management-code-review (FIXUP), release-audit-report, release-prepare (automated-signing draft PR), release-announce-draft (site PR, only when the site repo is the policy's upstream), security-submit-to-oss-scan (the <upstream> PR), committer-onboarding (CODEOWNERS / roster PRs).
  • Conventions and docs: AGENTS.md PR-opening and trailer bullets (the git-commit message file carries the trailer, since the operation takes no --trailer), the fix-workflow.md template, and the docs that describe how the fix PR is opened.
  • Grants: the vetted-ops README [callers] example gains the git-* grants for these callers.
    Magpie's own policy grants setup-upstream-fix and setup-override-upstream the git-* operations; the [git] values stay per maintainer in operator-git.toml.

Deliberately left as commands the release manager or user runs: tag pushes in release-rc-cut, the KEYS flow in release-keys-sync, security-issue-sync site-records commits, setup-shared-config-sync (personal config repo), and pushes to a contributor's fork; none of these target the policy's upstream or fork.

Type of change

  • Documentation / skill prose

Test plan

  • python3 tools/dev/check-shared-blocks.py --fix, tools/dev/skill-surface-hash.py --fix, skill-token-count --write
  • prek run --files <changed files> (all hooks pass, including the skill-and-tool validator and lychee)
  • uv run pytest in tools/vetted-ops and tools/dev
  • Skill eval suites for the touched skills

🤖 Generated with Claude Code

@potiuk
potiuk enabled auto-merge (squash) November 22, 2026 09:40
…t recipes

The skills that go from a change to an open pull request now run the
git steps as vetted-op-git operations (git-fetch, git-worktree-add,
git-stage, git-commit, git-push-branch, git-pr-create), each still
confirmed by the user, instead of handing out or running raw git push,
git commit, git worktree add and gh pr create commands.

The canonical sequence lives in one shared block,
tools/dev/blocks/vetted-git-publish.md, rendered into a
vetted-git-publish.md companion in each skill with that skill's
--caller. It also carries the fallback: when no [git] values are
configured for the project, the skill hands the user the commands as
before; a draft pull request or a base other than pr_base keeps
gh pr create --web.

Rewritten: security-issue-fix, issue-fix-workflow, audit-finding-fix,
setup-upstream-fix, setup-override-upstream, pr-management-shepherd,
pr-management-code-review (FIXUP), release-audit-report,
release-prepare, release-announce-draft, security-submit-to-oss-scan
and committer-onboarding, plus the fix-workflow template, the PR and
trailer conventions in AGENTS.md, and the docs that describe how the
fix PR is opened. The vetted-ops README [callers] example gains the
git-* grants for these callers.

Generated-by: Claude Opus 5
… file

Follow-up on the rebase over apache#2227, where the [git] values moved to each
operator's ~/.config/apache-magpie/vetted-ops/operator-git.toml:

- The shared vetted-git-publish block says where checkouts, worktree
  roots and the fork come from, quotes the new refusal ("no [git] values
  for <repository>") and names the table to add.
- Magpie's own policy grants setup-upstream-fix and
  setup-override-upstream the git-* operations they now run from a
  session in the framework clone; without them both skills would always
  fall back to handing over commands here. No [git] table: those values
  are per maintainer.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the chore/skills-vetted-git-recipes branch from fc4b253 to 8668408 Compare November 22, 2026 10:02
@github-actions github-actions Bot added family:pr-management pr-management-* skills family:security security-* skills family:setup setup-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs family:ci .github workflows, prek, validators family:issue issue-* skills capability:triage Sweep + classify + propose disposition capability:review Deep per-item code review or contributor mentoring capability:fix Implement code change to resolve an issue capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement capability:stats Read-only dashboards, metrics, governance evidence capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:authoring Skills that author or maintain other skills: write-skill, optimize-skill family:release-management release-* skills family:repo-health repo-health skills family:contributor-growth contributor-growth skills substrate:sandbox Tool substrate: agent isolation, egress control, settings audit substrate:framework-dev Tool substrate: build / validate / eval the framework itself labels Nov 22, 2026
@potiuk
potiuk merged commit 1e1093e into apache:main Nov 22, 2026
11 checks passed
potiuk added a commit that referenced this pull request Nov 22, 2026
…e policy (#2231)

#2230 and #2228 each added a "setup-upstream-fix" entry to [callers]. Git
merged the two cleanly, but the key is declared twice, so the committed
policy is no longer valid TOML and every vetted op in this repository fails
on its config. Keep #2228's entry, drop #2230's.

Add a test that loads the committed policy and checks every granted
operation exists, so a merge like this fails CI. Setup config Step 3a.3 no
longer lists missing shared-policy grants (a separate check covers it), and
the setup skill's measured_tokens is refreshed.

Generated-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:authoring Skills that author or maintain other skills: write-skill, optimize-skill capability:fix Implement code change to resolve an issue capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement capability:review Deep per-item code review or contributor mentoring capability:stats Read-only dashboards, metrics, governance evidence capability:triage Sweep + classify + propose disposition family:ci .github workflows, prek, validators family:contributor-growth contributor-growth skills family:docs Docs, MISSION.md, READMEs family:issue issue-* skills family:pr-management pr-management-* skills family:release-management release-* skills family:repo-health repo-health skills family:security security-* skills family:setup setup-* skills family:tools tools/* substrate:framework-dev Tool substrate: build / validate / eval the framework itself 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