Custody's second rung was macOS-only too, and the ratchet is empty - #10
Merged
opencdlee-dotcom merged 1 commit intoAug 25, 2026
Merged
Conversation
Two deferred review findings, plus the debt the last commit left behind.
`_grade_binary` offers a sensor exactly two demotions: operator-vouched and
package-managed. The second consulted Homebrew, VS Code, pipx and uv — so an
apt/rpm/winget-installed binary, the ordinary shape of a developer's toolchain,
was scored at full severity with custody=None on Linux and Windows while its
Homebrew equivalent on macOS was demoted a step. Both rungs available off-mac
were narrower than on mac; the previous commit fixed one of them and this
fixes the other.
The Linux half needed no new machinery. `_classify_linux` had shelled out to
dpkg/rpm/pacman since forever to decide `os-managed`; custody simply never
asked. That query is now `_linux_pkg_owner` — one spelling, two callers, with a
test asserting they agree. It sits LAST in _PACKAGE_RECEIPTS because it can
cost three subprocesses while every probe above it is pure path arithmetic, and
it memoizes per resolved path because the custody layer asks about the same
handful of programs repeatedly within one scan (also tested: one query per
path, not four).
Windows gets `_winget_receipt` and `_choco_receipt`, path-shaped like the
portable probes beside them but normalizing separators instead of using os.sep,
so they are exercisable from any body — the same reason test_cross_platform
parses captured Windows output on a Mac. Measured on real files:
before [None, None, None]
after ['winget:Foo.Bar', 'winget:link', 'choco:ripgrep']
and on Linux, None -> 'dpkg:curl'. A path under Local/Temp still earns nothing;
a probe that demoted anything under a user-writable root would be a blind spot,
not a rung.
And the ratchet from the previous commit is EMPTY — by shrinking, not by
deletion, with the stale-entry check still guarding it. Its last three entries
were settled by mutation rather than by reading: swapping all four
"developer-id" sites to PUBLISHER_TRUST broke exactly one test,
TestHotDirAppBundle's, whose subject is an unnotarized Developer-ID .app — a
Gatekeeper concept with no analog on any other body, in a class conftest
already gates to macOS. That literal stays, with the reason recorded above the
class. The other three were inert: `target_trust` is written at aegis.py:11172
and read by no gate at all.
Verified: 1045 passed / 4 skipped on macOS, and the whole suite under simulated
linux and win diffed against 7279c68 — no new failures on either.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the two review findings deferred from #9, and empties the ratchet #9 introduced.
The other half of the macOS-only custody asymmetry
_grade_binaryoffers a sensor exactly two demotions:operator-vouchedandpackage-managed. #9 fixedpublisher-stable; this fixes the second. The receipt probes wereHomebrew, VS Code, pipx and uv — so an apt/rpm/winget-installed binary, the ordinary shape of a
developer's toolchain, was scored at full severity with
custody=Noneon Linux and Windowswhile its Homebrew equivalent on macOS was demoted a step.
The Linux half needed no new machinery.
_classify_linuxhad shelled out to dpkg/rpm/pacmansince forever to decide
os-managed; custody simply never asked. That query is now_linux_pkg_owner— one spelling, two callers, with a test asserting they agree.Measured on real files:
…/Microsoft/WinGet/Packages/Foo.Bar_1.2.3/tool.exeNonewinget:Foo.Bar…/Microsoft/WinGet/Links/tool.exeNonewinget:link…/chocolatey/lib/ripgrep/tools/rg.exeNonechoco:ripgrep/usr/bin/curl(Linux, dpkg)Nonedpkg:curl…/Local/Temp/payload/tool.exeNoneNone← still earns nothing_os_package_receiptsits last in_PACKAGE_RECEIPTS(three subprocesses vs pure patharithmetic above it) and memoizes per resolved path, both tested.
The ratchet is empty
Emptied by shrinking, with the stale-entry check still guarding it, so it cannot quietly
become an exemption list. Its last three entries were settled by mutation rather than by
reading: swapping all four
"developer-id"sites toPUBLISHER_TRUSTbroke exactly one test —TestHotDirAppBundle's, whose subject is an unnotarized Developer-ID.app, a Gatekeeperconcept with no analog on any other body, in a class conftest already gates to macOS. That
literal stays with the reason recorded above the class. The other three were inert:
target_trustis written ataegis.py:11172and read by no gate at all.Verification
linuxandwin(tests/simbody.py, added in The guard I shipped did not catch the thing it was written for #9), diffedagainst
7279c68— no new failures on eitherTargets
feat/custody-gradingrather than pushing to it, because another agent holds anuncommitted
ci.ymledit in that checkout.🤖 Generated with Claude Code