Skip to content

fix(catalog): decode Revert Transaction by treating Option as a hidden gate - #96

Open
marcoaperez wants to merge 1 commit into
petrowsky:mainfrom
Taiko-Solutions:fix/revert-transaction-hidden-gate
Open

marcoaperez wants to merge 1 commit into
petrowsky:mainfrom
Taiko-Solutions:fix/revert-transaction-hidden-gate

Conversation

@marcoaperez

Copy link
Copy Markdown
Contributor

Problem

The SaXML → fmxmlsnippet reader refuses Revert Transaction and emits a TODO placeholder. Option has no HR label and two unclaimed SaXML booleans (Condition, Error Code) are candidates for it, so the positional fallback correctly fails loud. The XML → HR direction also renders an On token that FileMaker never shows for this step.

Fix (catalog only)

Model the step like Fine-Tune Model's Option:

  • Option becomes an hrHidden boolean.
  • Condition, ErrorCode and ErrorMessage declare visibleWhen: Option=True.

The reader skips the hidden gate, and the emitter derives its state from whether a gated calculation carries a value (aa75b34), so no step-specific decoder is needed.

Why a hidden gate and not a flag in <Options>

11ba8a6 rightly stopped reading Option from <Boolean type="Condition"> and noted that the real Option lives in the step's <Options> integer. Decoding that integer across 616 real Revert Transaction steps (SaXML from FileMaker Pro 26) shows it is a gate, not an independent setting:

<Options> Bits Condition Error Code Steps
17152 0x4000 + 0x100 + 0x200 on on 461
16640 0x4000 + 0x100 on off 143
16896 0x4000 + 0x200 off on 3
absent — off off 8
1065728 0x100000 + 0x4000 + 0x100 + 0x200 on on 1

0x4000 is set exactly when Condition or Error Code is on, and never on its own. That matches the fmxmlsnippet behaviour: FileMaker drops Condition / ErrorCode on paste unless <Option state="True"/> is present. So Option can be derived from the gated calcs, with no dedicated decoder. (The meaning of the single 0x100000 bit is unknown; it appears alongside the normal gate bits.)

Changes

  • agent/catalogs/step-catalog-en.json: the Revert Transaction entry.
  • agent/fixtures/converter/saxml_unsupported/revert-transaction.xml → saxml/, with its golden in saxml-to-snippet.json.
  • agent/fixtures/converter/xml-to-hr.json: HR without On, matching the catalog hrSignature.

Verification

  • Copied a Revert Transaction step with condition from the Script Workspace: FileMaker shows Revert Transaction [ Condition: … ; Error Code: … ; Error Message: … ], with no On, which is exactly what the converter now produces.
  • test_catalog_grammar.py and test_catalog_grammar_engine.py pass.
  • pytest agent/scripts/test_converter_conformance.py agent/scripts/test_catalog_emit.py: 11 passed, 2 failed. The same two tests fail identically on an untouched main (05e43a3); the conformance failure is insert-text.xml drifting, so neither is related to this change.

🤖 Generated with Claude Code

…n gate

The SaXML reader refused Revert Transaction (emitting a TODO placeholder):
Option has no HR label and two unclaimed SaXML booleans (Condition, Error Code)
were candidates, so the positional fallback correctly failed loud.

Model it like Fine-Tune Model.Option instead: Option becomes an hrHidden
boolean and Condition / ErrorCode / ErrorMessage declare
visibleWhen Option=True. The reader skips the gate and the emitter derives its
state from whether a gated calc carries a value (aa75b34), so no step-specific
decoder is needed.

- revert-transaction.xml moves from saxml_unsupported/ to saxml/ with a golden
- XML -> HR no longer renders an "On" token: FileMaker's HR for this step has
  none, and the catalog hrSignature already omits it
- Python and web viewer goldens updated for that one entry

Verified: test_catalog_*, test_converter_conformance (Python) and vitest pass
except Insert Text, which fails identically on an untouched upstream/main.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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