microsoft / microsoft/flint-chart
validate_chart silently accepts nonexistent chartProperties and options keys
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.2k
- Forks
- 235
- Avg merge
- 17h 45m
- Merged PRs (30d)
- 11
Description
Summary
validate_chart silently accepts nonexistent chartProperties and options keys — it returns valid: true, warnings: []. Agents (and humans) get no signal that a knob does not exist, so they retry blindly.
Verified against flint-chart@0.3.0. Source refs at main (commit 95b2552).
Repro
{
"chart_spec": {
"chartType": "Line Chart",
"encodings": { "x": { "field": "x" }, "y": { "field": "y" } },
"chartProperties": { "lineWidth": 5, "pointSize": 12, "totallyFakeKnob": true }
},
"options": { "fontSize": 18, "bogusOption": "xyz" }
}
→ { "valid": true, "warnings": [], "errors": [] }
None of lineWidth, pointSize, totallyFakeKnob, fontSize, bogusOption exist for a Line Chart, yet nothing is reported.
Root cause
packages/flint-js/src/core/normalize-properties.ts (normalizeChartProperties) validates discrete property values against the template's declared options, but never checks whether a chartProperties key exists in chartTemplate.properties. options keys are not validated at all. No unknown-key check exists in the pipeline.
Suggested fix
In normalizeChartProperties (and/or the validate path), diff the incoming keys against the template's known option keys (chartTemplate.properties.map(p => p.key) — the same model that drives the customization panel) and the recognized AssembleOptions names, and push a warning per unknown key:
unknown chartProperty "lineWidth" for Line Chart; available: [cornerRadius, ...]
Keep it a warning, not an error, for forward compatibility.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/flint-js/src/core/normalize-properties.ts at normalizeChartProperties, then trace the validate path and the chart template properties model. Run the supplied validate_chart reproduction and inspect how AssembleOptions names are represented. Done means unknown chartProperties and options produce individual warnings while recognized keys and forward-compatible inputs remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100