Skip to content

fix(xlsform): a guidance_hint pyxform rejects in parameters becomes its column - #166

Merged
jstet merged 1 commit into
mainfrom
fix/guidance-hint-parameters
Sep 27, 2026
Merged

jstet merged 1 commit into
mainfrom
fix/guidance-hint-parameters

Conversation

@jstet

@jstet jstet commented Sep 27, 2026

Copy link
Copy Markdown
Member

qwacback's old DDI → XLSForm export stored the guidance hint inside parameters as guidance_hint=<text>. pyxform reads parameters as space-separated key=value pairs, so a hint with spaces makes the form invalid. Since #163, ddi2xlsform gives parameters back exactly as authored, including that invalid cell, and Kobo would refuse the result.

Now the XLSForm writer moves such a hint, one whose text has whitespace, to the guidance_hint column. A hint without whitespace stays in parameters, so a valid form still comes back as written. The codebook doesn't change: cdl:parameters stays as authored.

  • hints_survey's ddi2xlsform.json is valid XLSForm again, so its pyxform xfail is removed. Its source stays an expected failure.
  • Round-trip tests: the canonical comparison folds this repair. For a repaired form, the DDI → XLSForm → DDI codebook changes once and is then stable.
  • New unit tests cover both cases: a hint that stays in parameters, and one that moves.
  • ddi2xlsform/README.md lists it under known losses as a repair.

Checks

  • vitest: 1475 passed
  • pytest validation + codegen: 151 passed, 3 xfailed
  • npm run validate and the drift check pass

🤖 Generated with Claude Code

…ts column

qwacback's old DDI → XLSForm export put the guidance hint into
`parameters` as `guidance_hint=<text>`. pyxform reads that cell as
space-separated key=value pairs, so a hint with spaces makes the form
invalid. Since #163 ddi2xlsform gives parameters back as authored, and
with it that invalid cell, which Kobo refuses.

The XLSForm writer now moves such a hint (its text has whitespace) to the
guidance_hint column. One without whitespace stays in parameters, so a
valid form still comes back as written. hints_survey's ddi2xlsform.json
is valid XLSForm again; its source stays an expected pyxform failure.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jstet
jstet merged commit 5070cf3 into main Sep 27, 2026
4 checks passed
@jstet
jstet deleted the fix/guidance-hint-parameters branch September 27, 2026 20:47
@jstet jstet mentioned this pull request Sep 27, 2026
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