Repository navigation
feat: refuse budget grants while a minor has no verified guardian - #8
Draft
jaspermayone wants to merge 4 commits into
Draft
jaspermayone wants to merge 4 commits into
jaspermayone wants to merge 4 commits into
Conversation
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.
Krater grants no budget to a project while a team member is under 18 without a verified guardian in Weave.
An email link proves only that someone reads an inbox, not that they are a parent. So a Weave admin records a stronger check in Weave: a signed guardian form and a call or video check. Krater stores none of this. It reads the Weave directory fresh at decision time, as it does for roles.
Depends on the Weave stack, mainly patchworklabsorg/weave#195 (
minor) and patchworklabsorg/weave#196 (guardian_verified). Merge order does not matter: a record withoutminorcounts as "not known to be a minor".flowchart TD A[Approve proposal, raise ceiling, or admin budget increase] --> B[Fresh directory lookup for each team member] B -->|Weave down| X[Refuse: try again] B --> C{Directory answer} C -->|404| D[Block: not available in Weave] C -->|minor and not guardian_verified| E[Block: no verified guardian] C -->|no minor field| F[Allow, log a warning] C -->|adult, or minor with verified guardian| G[Allow]Changes
WeaveUsergetsminorandguardian_verified. The stub fixture has two minor users and helpers to change them.krater/services/guardian.pyholds the rule.krater/services/projects.pycalls it before every grant: a proposal approval, an amendment approval that raises the ceiling, and an admin budget increase.record_review. A refusal rolls back the whole decision and lists the members with the reason.record_review,admin_decideandadmin_adjust_budgetnow requireweave_client, so no caller can skip the check. About 60 test call sites changed for that.docs/SPEC.mdanddocs/weave-integration.mddescribe the rule.Open point
The page notice is visible to the submitter as well as to reviewers and admins.