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
Add parameter path verification and fix scaffold config for dashboard agents
- Add policyengine-parameter-patterns-skill to backend-builder agent
- Add Step 3b: Verify All Parameter Paths in backend-builder
- Add Check 7: Parameter Path Verification to architecture validator
- Add postcss.config.mjs requirement to scaffold agent (required for Tailwind v4)
- Replace random port selection with 4000-4100 range macro in Makefile templates
- Add copy-pasteable Makefile code for both precomputed and custom-modal patterns
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
**CRITICAL — every parameter path used in `Reform.from_dict()` or reform dictionaries MUST be verified against the actual YAML files.** Incorrect paths cause silent failures or runtime errors like "Could not find the parameter". Consult the `policyengine-parameter-patterns-skill` section 6.5 for the bracket path syntax rules.
265
+
266
+
**Common mistakes:**
267
+
-**Off-by-one indexing**: Some parameters use 1-indexed keys (e.g., `gov.irs.income.bracket.rates` has keys `1`-`7`, not `0`-`6`). Always check whether the YAML uses a list (0-indexed) or explicit integer keys (use those exact keys).
268
+
-**Missing sub-keys on bracket scales**: Bracket/scale parameters (YAML `brackets:` list) require `.amount` or `.rate` after the index. E.g., `gov.irs.credits.eitc.max[0].amount`, NOT `gov.irs.credits.eitc.max[0]`.
269
+
-**Filing-status-indexed parameters**: Some parameters have sub-keys by filing status (e.g., `gov.irs.credits.ctc.phase_out.threshold[SINGLE]`).
270
+
271
+
**Verification procedure for every parameter path:**
272
+
273
+
1. Find the YAML file in the `policyengine-us` (or `policyengine-uk`) parameters directory:
274
+
```bash
275
+
# Convert dotted path to directory path and search
**Only run this check if `plan.yaml` has `data_pattern: custom-modal`.** Skip entirely for other patterns.
171
+
172
+
This validates that all parameter paths used in `Reform.from_dict()` or reform dictionaries in `backend/simulation.py` resolve to real parameters in the policyengine parameter tree.
173
+
174
+
**Load required skill first:**`Skill: policyengine-parameter-patterns-skill` — see section 6.5 for bracket path syntax rules.
175
+
176
+
**Step 1: Extract all parameter paths from simulation.py:**
177
+
```bash
178
+
# Find all string literals that look like parameter paths (gov.xxx.yyy)
**Required for Tailwind v4.** Without this file, `@import "tailwindcss"` in globals.css is never processed and no utility classes are generated.
209
+
210
+
```js
211
+
exportdefault {
212
+
plugins: {
213
+
"@tailwindcss/postcss": {},
214
+
},
215
+
};
216
+
```
217
+
204
218
#### app/globals.css
205
219
206
220
Generate the Tailwind v4 configuration with the ui-kit theme import:
@@ -393,10 +407,21 @@ Generate a `Makefile` that provides standard development targets. The Makefile c
393
407
394
408
**IMPORTANT:** Makefile recipes must use literal tab characters for indentation, not spaces.
395
409
396
-
**For all patterns:** The `dev` and `dev-frontend` targets must use a random available port, never hardcode port 3000. Use this Python one-liner to find a free port:
410
+
**For all patterns:** The `dev` and `dev-frontend` targets must try port 4000 first, then increment by 1 up to 4100, erroring out if no port in that range is available. Use this helper script embedded in the Makefile — copy it exactly:
0 commit comments