Skip to content

feat(vetted-ops): save large reads to the workspace, and add the pr-management reads - #1570

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

potiuk merged 1 commit into
mainfrom
perf/pr-mgmt-1-vetted-reads

Conversation

@potiuk

@potiuk potiuk commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

  • vetted-op-read --save NAME writes a read's output to <workspace>/saved/NAME and prints one JSON line, so large reads (a whole PR sweep) reach a deterministic tool instead of the agent's context.
  • New read operations for what pr-management-triage and pr-management-stats compute on: triage sweeps in one TriagePR shape (open / label / author / review-requested / one PR, all pages), triage pre-flight, recent main-branch failures, the action_required index, runs and check runs at a head, commits-behind, team members, and the stats open / closed reads.
  • Bottom of a stack: the triage and stats PRs on top consume these reads.

Security notes

vetted-op-read runs outside the sandbox, and --config can name a policy the agent wrote, so the policy's workspace proves nothing. --save therefore:

  • writes only into a saved/ directory that already exists and holds a .vetted-ops-save marker — it creates neither, so it can never write where the caller could not already write;
  • writes to an exclusive temp file and renames it into place, so a planted symlink or hard link is replaced, never written through;
  • is refused for writes and procedures.

Every search string is built with repo:<upstream> from policy first; parameters only narrow it. Tests cover marker absence, symlinked dir / marker / target, hard links, open workspaces, write ops and failed reads.

One-time setup per machine: mkdir -m 700 <workspace>/saved && touch <workspace>/saved/.vetted-ops-save.

Type of change

  • Python package (tools/*/ with pyproject.toml)
  • Cross-cutting (sandbox)

Test plan

  • prek run --all-files passes (whole tree, at the top of the stack)
  • uv run pytest / ruff check / mypy for tools/vetted-ops

RFC-AI-0004 compliance

  • Sandbox — the new write path cannot reach a directory outside what the caller could already write
  • Write-access discipline — read operations only

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_01FTTd3HMcMsj7FwkhPPQcSx

…anagement reads

`vetted-op-read --save NAME` writes a read operation's output to
`<workspace>/saved/NAME` and prints one JSON line, so a sweep's pages
reach a deterministic tool without passing through the agent's context.
Writes and procedures refuse it. Because `vetted-op-read` runs outside
the sandbox and `--config` can name a policy the agent wrote, `--save`
only writes into a `<workspace>/saved/` directory that already exists
and holds a `.vetted-ops-save` marker — it creates neither, so it never
reaches a directory the caller could not already write. The output is
written to an exclusive temporary file and renamed into place, so a
planted symlink or hard link is replaced rather than written through.

New read operations cover what pr-management-triage and
pr-management-stats compute on: the open / label / author /
review-requested triage sweeps and one PR in a single TriagePR shape
(all pages), the triage pre-flight (viewer permission and labels), the
recent main-branch failures, the action_required run index, a head's
workflow runs and check runs, commits-behind, the committers-team
roster, and the stats open / closed reads. Each search is built with
`repo:<upstream>` from policy first.

Generated-by: Claude Opus 5
@potiuk
potiuk added this pull request to stack #1573 October 9, 2026 18:51
@potiuk potiuk added family:tools tools/* family:pr-management pr-management-* skills substrate:sandbox Tool substrate: agent isolation, egress control, settings audit labels Oct 9, 2026
@github-actions github-actions Bot added family:setup setup-* skills family:docs Docs, MISSION.md, READMEs labels Oct 9, 2026
@potiuk
potiuk merged commit b35a806 into main Oct 10, 2026
10 checks passed
@potiuk
potiuk deleted the perf/pr-mgmt-1-vetted-reads branch October 10, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:docs Docs, MISSION.md, READMEs family:pr-management pr-management-* skills family:setup setup-* 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.

1 participant