babysit_resolve_thread.py machine-enforces two conditions and only two. Read from the source:
if not thread["botOnly"] and not include_human — participation.
if (autonomous or only_outdated) and not thread["isOutdated"] — outdatedness.
There is no severity check, no CHANGES_REQUESTED check, and no check on whether the pull request belongs to the invoking agent.
That matters because of what a host permission grant can see. A grant covering source-control-babysit-resolve-thread --autonomous sees the same command shape whether the target is a stale formatting nit or a live P1 security finding on the agent's own PR. The host cannot discriminate, so every condition beyond the two above is advisory in practice no matter how absolutely it is written — and the review-thread merge gate means the agent resolving those threads is the same actor that benefits from resolving them.
Ask
Move the remaining conditions into the resolver, so --autonomous refuses rather than relies on the caller:
- Severity / blocking state. Refuse a thread whose first comment carries a P1 or security marker, or whose review state is
CHANGES_REQUESTED.
- Own-PR. Refuse when the PR author is the invoking identity, or gate it behind an explicit flag that the wrapper then rejects — the shape
source-control-babysit-merge already uses for --allow-unpinned-head.
Both are checkable from data the resolver already fetches. The merge gate and this resolver are the two components that already demonstrate the pattern of enforcing an invariant in code so a host grant can name a bounded command; this closes the gap between what the resolver enforces and what its callers are told it enforces.
Context
Found by the Codex reviewer on melodic-software/dotfiles#315, which hardens the host-side autoMode prose granting this wrapper. That PR restricted thread resolution to this wrapper under --autonomous without --include-human and dropped the raw resolveReviewThread mutation, on the reasoning that a raw mutation carries an opaque thread ID so no stated condition is checkable. The reviewer's follow-up is that the wrapper only partially closes it: two conditions moved into code, three did not, and the host still cannot tell the cases apart.
The dotfiles entry now states plainly which conditions have code behind them and which do not. That honesty is what surfaced this — but a settings file cannot fix it, which is why it is filed here.
Related: #843 (plugin bin/ not on the Bash-tool PATH), #1281 (--apply helpers need mechanically-validated wrappers). Same theme: a host grant is only as narrow as what the named command refuses on its own.
babysit_resolve_thread.pymachine-enforces two conditions and only two. Read from the source:if not thread["botOnly"] and not include_human— participation.if (autonomous or only_outdated) and not thread["isOutdated"]— outdatedness.There is no severity check, no
CHANGES_REQUESTEDcheck, and no check on whether the pull request belongs to the invoking agent.That matters because of what a host permission grant can see. A grant covering
source-control-babysit-resolve-thread --autonomoussees the same command shape whether the target is a stale formatting nit or a live P1 security finding on the agent's own PR. The host cannot discriminate, so every condition beyond the two above is advisory in practice no matter how absolutely it is written — and the review-thread merge gate means the agent resolving those threads is the same actor that benefits from resolving them.Ask
Move the remaining conditions into the resolver, so
--autonomousrefuses rather than relies on the caller:CHANGES_REQUESTED.source-control-babysit-mergealready uses for--allow-unpinned-head.Both are checkable from data the resolver already fetches. The merge gate and this resolver are the two components that already demonstrate the pattern of enforcing an invariant in code so a host grant can name a bounded command; this closes the gap between what the resolver enforces and what its callers are told it enforces.
Context
Found by the Codex reviewer on melodic-software/dotfiles#315, which hardens the host-side
autoModeprose granting this wrapper. That PR restricted thread resolution to this wrapper under--autonomouswithout--include-humanand dropped the rawresolveReviewThreadmutation, on the reasoning that a raw mutation carries an opaque thread ID so no stated condition is checkable. The reviewer's follow-up is that the wrapper only partially closes it: two conditions moved into code, three did not, and the host still cannot tell the cases apart.The dotfiles entry now states plainly which conditions have code behind them and which do not. That honesty is what surfaced this — but a settings file cannot fix it, which is why it is filed here.
Related: #843 (plugin
bin/not on the Bash-tool PATH), #1281 (--applyhelpers need mechanically-validated wrappers). Same theme: a host grant is only as narrow as what the named command refuses on its own.