You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agents/country-models/edge-case-generator.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,9 @@ For time-based rules:
149
149
benefit: 0# Or reduced amount
150
150
```
151
151
152
+
### Bracket Boundary Consistency
153
+
When testing bracket boundaries, you do NOT need to test every threshold — test a few representative ones (first, one in the middle, last). But if you find that a boundary uses "above X%" (exclusive) semantics and needs a 0.0001 shift (see `/policyengine-parameter-patterns` — "Above X%" bracket boundaries), flag ALL thresholds in the same bracket — the boundary semantics applies consistently across the whole bracket, not just the one you tested.
Copy file name to clipboardExpand all lines: agents/country-models/parameter-architect.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -306,6 +306,15 @@ Before finalizing, validate your work against ALL loaded skills:
306
306
307
307
Run through each skill's Quick Checklist if available.
308
308
309
+
## Scope Boundary
310
+
311
+
**You create PARAMETER YAML files ONLY.** Do NOT create:
312
+
- Variable `.py` files — the rules-engineer agent handles these
313
+
- Test `.yaml` files — the test-creator agent handles these
314
+
- Enum classes or any Python code
315
+
316
+
Even if you know what the variables and tests should look like, stay in your lane. Other agents are specialized for those tasks and will produce higher-quality output. If you create files outside your scope, the orchestrator may skip those specialized agents, degrading overall quality.
Copy file name to clipboardExpand all lines: agents/country-models/test-creator.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,4 +147,5 @@ Tests must:
147
147
- Include edge cases at thresholds
148
148
- Document calculation steps in comments
149
149
- Cover all eligibility paths
150
-
- Use only existing PolicyEngine variables
150
+
- Use only existing PolicyEngine variables
151
+
- NOT exhaustively test every entry in a lookup table — for brackets indexed by household size, FPL tier, etc., test a few representative points (first, middle, last) not every value
Copy file name to clipboardExpand all lines: agents/reference-validator.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,9 +112,18 @@ reference:
112
112
113
113
**Flag as CRITICAL if:**
114
114
- Clicking link doesn't show the value
115
-
- Section number too vague (missing subsections)
115
+
- Section number is WRONG (title cites a section that doesn't contain the parameter value — e.g., citing `4.3.1(B)` when the value is actually in `4.3.1(A)(4)`). A wrong section citation is worse than a missing one because it points readers to incorrect regulatory text.
116
116
- PDF missing page number
117
117
118
+
**When proposing a corrected citation**, verify the replacement against the PDF text or
119
+
extracted text file. Search for the exact section/definition heading in the text — do not
120
+
guess the correct number from memory or nearby context. If you cannot confirm the correct
121
+
citation from the source text, flag it as "WRONG — correct section unknown, manual lookup
122
+
required" rather than proposing an unverified replacement.
123
+
124
+
**Flag as WARNING if:**
125
+
- Section number too vague (missing subsections) but still within the correct provision
126
+
118
127
### Phase 3: Check Corroboration
119
128
120
129
**The reference must explicitly support the value.**
- Income sources list (for sources.yaml parameter, NOT inline adds)
137
153
- Reference implementation paths to study
138
154
- For TANF: note simplified vs full approach recommendation
139
-
- For each requirement: cite the source (statute, manual section, page)
155
+
- For each requirement: cite the source (statute, manual section, page) — verified against PDF text in Step 2
140
156
141
157
FILE 2: /tmp/{PREFIX}-requirements-checklist.md (SHORT — for orchestrator, max 40 lines)
142
158
- One line per requirement:
@@ -322,6 +338,8 @@ RULES:
322
338
323
339
### Step 3B: Create Variables and Tests (Parallel)
324
340
341
+
**ORCHESTRATOR RULE: Always spawn BOTH agents below, even if the parameter-architect created variable or test files.** Each agent is specialized for its task. If a previous agent went out of scope and created files that aren't its responsibility, the specialized agent will overwrite or improve them. Never skip an agent because "the files already exist."
342
+
325
343
After parameters are complete, spawn both in parallel — they work on different folders.
326
344
327
345
**Agent: Rules Engineer**
@@ -642,6 +660,11 @@ Closes #{ISSUE_NUMBER}
642
660
## Not Modeled
643
661
{Excluded requirements with reasons}
644
662
663
+
## Historical Notes
664
+
If the regulatory reviewer or document-collector noted historical changes to any parameter
665
+
values (e.g., threshold increases, rate changes), document what changed and when, with
666
+
source links. This helps reviewers understand why parameters only start at a recent date.
Copy file name to clipboardExpand all lines: skills/technical-patterns/policyengine-parameter-patterns-skill/SKILL.md
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -467,6 +467,61 @@ brackets:
467
467
468
468
**Real-world example:** Hawaii Food/Excise Tax Credit uses AGI brackets. The first threshold must be `-.inf` to correctly handle taxpayers with negative AGI (e.g., business losses).
469
469
470
+
### Bracket Boundary: "Above X%" Regulations
471
+
472
+
**CRITICAL: PolicyEngine's `single_amount` bracket uses "at or above threshold" logic.** A value exactly at the threshold gets that bracket's rate, not the previous bracket's. When a regulation says "above X%" (meaning X% itself belongs to the lower bracket), shift the threshold by `0.0001` to match.
473
+
474
+
**Example — co-payment tiers by FPL:**
475
+
```
476
+
Regulation says:
477
+
Level 0: Less than or equal to 100% → $0
478
+
Level 1: Above 100% up to and including 125% → 2%
479
+
Level 2: Above 125% up to and including 150% → 5%
480
+
Level 3: Above 150% up to and including 261% → 7%
481
+
```
482
+
483
+
**❌ WRONG — family at exactly 100% FPL gets 2% instead of 0%:**
484
+
```yaml
485
+
brackets:
486
+
- threshold:
487
+
2024-01-01: 0
488
+
amount:
489
+
2024-01-01: 0
490
+
- threshold:
491
+
2024-01-01: 1.0 # ❌ At 100% FPL → hits this bracket
492
+
amount:
493
+
2024-01-01: 0.02
494
+
```
495
+
496
+
**✅ CORRECT — shift by 0.0001 to encode "above X%":**
**When a parameter changes structure over time** (e.g., a flat rate becomes a tiered/marginal rate in a later year), you CANNOT put both structures in a single YAML file. Instead, split into separate files with a boolean toggle.
8. **Don't exhaustively test lookup tables** — when a parameter is a bracket indexed by household size, FPL tier, or similar, test a few representative points (first, middle, last/max) not every entry. If the bracket mechanism works for sizes 1, 4, and 10, it works for size 7 too. The same applies to income brackets, age brackets, and any other parameterized lookup.
677
680
678
681
When optimizing test suites:
679
682
1. **Identify slow tests** - Profile with `pytest --durations=10`
0 commit comments