Skip to content

fix: positional step params no longer carry the label prefix into XML#201

Merged
fuzzzerd merged 1 commit intomasterfrom
fuzzz/fix-synthesize-hr-params
Apr 28, 2026
Merged

fix: positional step params no longer carry the label prefix into XML#201
fuzzzerd merged 1 commit intomasterfrom
fuzzz/fix-synthesize-hr-params

Conversation

@fuzzzerd
Copy link
Copy Markdown
Owner

@fuzzzerd fuzzzerd commented Apr 28, 2026

Summary

FmScript.SynthesizeHrParams blindly converted every entry in the caller's param map into "{Key}: {Value}" regardless of whether the underlying step param had a display label. Steps whose params are positional (no HrLabel in their metadata) received the dict key as a literal prefix into XML.

Concrete impact for MCP / external callers using update_script_steps with structured params:

Step Param Before After
Set Variable Name <Name>Name: $i</Name> <Name>$i</Name>
If / Else If / Exit Loop If condition <Calculation>condition: $i &gt; $limit</Calculation> <Calculation>$i &gt; $limit</Calculation>

The bad XML imports into FileMaker successfully (it's structurally valid) but produces silent runtime errors because the variable name / calculation now contains an extraneous "label: " prefix.

Fix

SynthesizeHrParams now consults StepMetadata.Params to drive output:

  • Iterates metadata in declared order (positional correctness)
  • Formats with HrLabel when defined; raw when not
  • Case-insensitive key matching
  • Forward-compat: unknown keys fall through with the previous labeled formatting so newly-introduced params keep working until their metadata catches up

Test plan

  • Six new regression tests under tests/SharpFM.Tests/Scripting/FmScriptApplyTests.cs cover Set Variable, If, Exit Loop If, out-of-order params, case-insensitive keys, and the update path
  • Full test suite green (1174 SharpFM.Tests + 92 SharpFM.Plugin.Tests)
  • Manually verify a generated FizzBuzz script imports and runs in FileMaker

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Test Results

✔️ Tests 1260 / 1260 - passed in 13.5s
✔️ Coverage 78.38% - passed with 70% threshold
📏 14433 / 16876 lines covered 🌿 4913 / 7806 branches covered
🔍 click here for more details

✏️ updated for commit e5009d4

@fuzzzerd fuzzzerd merged commit 1fd29e2 into master Apr 28, 2026
8 of 9 checks passed
@fuzzzerd fuzzzerd deleted the fuzzz/fix-synthesize-hr-params branch April 28, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant