The owner list is read from a file spec a set may ship, and foreign_hosts extends a built-in list that quiets claude.ai - #206
Conversation
|
Warning Review limit reachedNext included review available in 36 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (14)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds ChangesPrivate owner source model
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Policy
participant Guard
participant ConfigFile
participant Stderr
Policy->>Guard: provide resolved owner source
Guard->>ConfigFile: read private_owners_file
ConfigFile-->>Guard: owner names or missing-file error
Guard->>Stderr: report optional missing source
Guard-->>Policy: continue checks with resolved owners
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (95.13%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #206 +/- ##
========================================
Coverage 93.63% 93.63%
========================================
Files 44 44
Lines 17057 17576 +519
========================================
+ Hits 15971 16458 +487
- Misses 1086 1118 +32 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…osts extends a built-in list that quiets claude.ai Two top-level lines were the same in nearly every consumer: 97 copies of one `private_owners_from` shell line across 87 policy files, and 84 copies of `foreign_hosts = ["claude.ai"]`. Neither was a fact about the repository it sat in, and neither could be shipped by a set -- the first because a set may not carry a shell command, the second because nothing was quieted by default. `private_owners_file` is the non-shell spelling of the owner source. It takes `xdg:<path>` under `$XDG_CONFIG_HOME` (else `$HOME/.config`), `home:<path>` under `$HOME`, or an absolute path; a bare relative path is refused at load. The file is read by the binary, one owner per line with comments and blank lines dropped, exactly as the command form's stdout is. `private_owners_optional` keeps its meaning for a file that is not there. Both spellings at one level, top of the file or on one rule, are refused naming both. A bundled set may carry `private_owners_file` and `private_owners_optional` at its top level as the default for every inheriting policy; the policy's own top-level line, in either spelling, overrides it, and a rule's own line overrides both for that rule. `private-names` ships `xdg:principles/private-owners` with the absence reported rather than refused, the default is printed by `uphold rules --set` and held in `sets.lock.json`, and a set carrying the shell form is refused where it is parsed. This repository's own policy drops its two lines in favour of the set's. `foreign_hosts` now extends a compiled-in list, `["claude.ai"]`, of hosts that serve no `owner/repo` path for anybody; a policy's or a rule's list adds to it rather than starting from nothing. Closes #198
b6788d1 to
90e20d2
Compare
Closes #198.
What the fleet repeated
97 copies of one
private_owners_fromshell line across 87 policy files, and 84 copies offoreign_hosts = ["claude.ai"]. Neither is a fact about the repository it sits in, and neither could be shipped by a set: the first because a set may not carry a shell command, the second because nothing was quieted by default.Part A:
private_owners_fileA non-shell spelling of the owner source, accepted at the top of the policy file and on any rule that accepts
private_owners_from.xdg:principles/private-owners$XDG_CONFIG_HOME/principles/private-owners, else$HOME/.config/principles/private-ownershome:.private-owners$HOME/.private-owners/etc/uphold/private-ownersA bare relative path (or
~, or an absolute path behind a prefix) is refused at load. The file is read by the binary, one owner per line,#comments and blank lines dropped, exactly as the command form's stdout is.private_owners_optionalkeeps its meaning: an absent file with it is a stderr notice naming the two forms not checked; without it, exit 2 exactly like a failing command.private_owners_frombesideprivate_owners_fileat one level is refused naming both.A set may ship it. A bundled set's top-level
private_owners_fileandprivate_owners_optionalare the default for every inheriting policy. The policy's own top-level line, in either spelling, overrides it; a rule's own line overrides both for that rule. The set'soptionalreaches only the set's file.private-namesnow shipsxdg:principles/private-ownerswithprivate_owners_optional = true; the default prints inuphold rules --set private-namesand is insets.lock.jsonfield for field. A set carryingprivate_owners_fromis refused where it is parsed, as isprivate_owners_optionalwith no file in the set, and aninherit.pathsfile carrying a top-levelprivate_owners_file(not adopted, so refused rather than dropped). The notice for an absent set-default file names the set, since no line in the reader's tree names the source.uphold's own
policy/principles.tomldrops its two lines.Part B:
foreign_hostsdefaultFOREIGN_HOSTS_DEFAULT = ["claude.ai"]is compiled in; a policy's list, and a rule's own list, extend it rather than replace it.docs/REFERENCE.mdno longer says nothing is quieted by default.Tests
src/config.rs: the three spec forms and the refused fourth; resolution against a supplied environment (XDG set, unset, empty;HOMEunset); both spellings refused at top level and on a rule; a bad spec refused; the set default adopted where the policy writes no line and not where it does; a set may not carry the shell form or a bareoptional; an inherited file's top-levelprivate_owners_filerefused.src/guard/names.rs: the file read as the command form reads stdout (comments, blank lines, trimming); absent is exit 2 namingprivate_owners_optional; with it, an empty list; the built-in hosts stay quiet under a declared list.tests/base_sets_cli.rs: a fixture inheritingprivate-nameswith no ownprivate_owners_*line reads$XDG_CONFIG_HOME/principles/private-ownersfrom a temp XDG dir and refusessecretcorp/thing; absent, exit 0 with a notice naming the set; a policy's ownhome:line is not read through the set default;foreign_hosts = ["example.test"]still quietsclaude.aiwhileother.testis refused underrefuse_unknown. Theguardhelpers now setXDG_CONFIG_HOMEto a per-fixture directory so the suite never reads the developer's real owner list.cargo test: 905 passed, 0 failed.cargo run -- check,cargo run -- scan,scripts/validate.py,scripts/build_reference.py --check, and the Python unittest suite all pass.Summary by CodeRabbit
New Features
xdg:,home:, or absolute paths.claude.ai, alongside configured patterns.Documentation