Appearance
Grant eligibility
A household applies for a grant: an accessible flow takes the region, the household and its income with evidence, eligibility rules written from the scheme's text decide, and near-limit or incomplete applications go to a caseworker. Pack: examples/policies/grant-eligibility/.
A pattern for expressing a public sector & grants policy, not compliance guidance: the thresholds, lists and fields are placeholders chosen to make the example run; a real policy comes from the business's own rules. It calls no app, so it runs in an empty workspace as it is.
The decision it automates
Whether the household is eligible, needs a caseworker, or is not eligible, when the application is submitted.
Data expected
- The applicant as a subject (kind
user); nothing is read from its data. - The flow's answers under
submission:region,householdSize,incomeandincomeEvidence(files).
Steps and rules
| Step | Type | Why |
|---|---|---|
collect | wait_for_collection | The grant-application flow. |
rules | evaluate_rules | The grant-eligibility rule set under max_severity: residency and the income limit are block, the rest warn. |
route | branch | rules.outcome == manual_review opens a case. |
review | create_case | grant_caseworker, 10-day SLA. |
decide | emit_decision | From the rules, or the reviewer's decision. |
The rule set grant-eligibility (useCase: custom) uses max_severity: a failed block rule rejects, a failed warn rule sends the run to review, and the weights add up to the score.
| Rule | Type | Severity, weight | Fails when |
|---|---|---|---|
grant_residency | comparison | block, 100 | region is not North, South or East |
grant_income_limit | expression | block, 100 | income is above 15 000 + 7 500 × householdSize |
grant_near_limit | expression | warn, 20 | income is above 90% of that limit |
grant_evidence | comparison | warn, 30 | no evidence of income was uploaded |
What a reviewer sees
A grant_caseworker case with the answers, the evidence and each rule's result, so the refusal or award letter can quote the rule that applied.
How to adapt it
Write your scheme's formula as the CEL expressions, add steps for each household member, look applicants up in your registers through an app you build, and add an appeal workflow that a different caseworker reviews.
Run it
bash
pnpm policy:import examples/policies/grant-eligibility --publishThe fixture is a household of three earning 34 000 with no evidence: under the limit of 37 500 but within 10% of it, so the near-limit and evidence rules fail, a grant_caseworker case opens, the check approves it and the run completes with a manual approve.