Skip to content

Preserve HermitCrab trace failure facts in Try A Word - #1173

Open
johnml1135 wants to merge 1 commit into
mainfrom
fix/hc-trace-display
Open

johnml1135 wants to merge 1 commit into
mainfrom
fix/hc-trace-display

Conversation

@johnml1135

@johnml1135 johnml1135 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Start here: Src/LexText/ParserCore/FwXmlTraceManager.cs preserves the facts;
Src/Transforms/Presentation/FormatHCTrace.xsl displays them in Try A Word.

Try A Word drops or miswrites facts HermitCrab already supplies. This fixes the
existing callback XML and its presentation against the pinned SIL.Machine 3.9.2,
without rerunning parser checks or changing dependencies.

  • Prefix and suffix environment branches serialize their own values.
  • Terminal environment failure retains the supplied allomorph and writes one
    Environment element per failed alternative.
  • Blocking records the supplied rule, replacement root allomorph and lexical
    identity, and replacement output. The trace displays a clickable blocking
    entry and preserves subsequent parse completion.
  • Compounding dispatches on the recorded reason. Version 3.9.2 emits only
    NonHeadProdRestrictMprFeatures here; an unrecognized reason stays unknown.
  • The stylesheet separates environment alternatives and exception-feature lists,
    uses OR for the required at-least-one restrictions, includes blocking in
    traversal/expandability, and displays unknown causes explicitly.

Synthetic before/after trace examples (headless callback/stylesheet cases):

Case Before After
Common / e _, prefix / p _, suffix / _ s Three / e _ Environment values / e _, / p _, / _ s
Failed alternatives for root Environment incorrect for allomorph 'root': / p _/ _ s. Environment incorrect for allomorph 'root': / p _, / _ s.
past replaced by vem No blocking node displayed Blocked: past. Blocking entry = vem and Output = vem
Compound exception features actual1actual2 / required1required2 actual1 and actual2 / required1 or required2
Unrecognized compound reason Guessed productivity failure or empty reason (Reason: Unknown reason.)

Build passed with zero warnings/errors; all 75 ParserCore tests passed, including
17 new callback and transform cases. Both required hygiene checks passed.
The full repository suite and live desktop checks were not run.

The optional detailed callbacks and additional facts in
sillsdev/machine#534 await a Machine
release and a follow-up FieldWorks PR. No Jira key was supplied; the repository's
AI PR workflow expects an LT ticket for this visible behavior.

Next: review the trace presentation and associate the appropriate Jira ticket.

Preflight review details

Four files changed: two production files and two test fixtures. No interface,
package, native, COM, installer, or persisted language-project changes. The trace
XML is transient; blocking preserves CurrentTrace and completion remains on the
existing path. Allomorph and blocking identities use the existing cache lookup
and clickable id conventions; unresolved blocking identities display as unknown.
New presentation text follows the stylesheet's existing xsl:text convention.

Read-only inspection of Machine's v3.9.2 AnalysisCompoundingRule confirmed that
productivity restrictions are the sole emitted reason on this callback. Other
failure gates must wait for a released version containing the Machine changes.
The serializer never derives a cause from a neighboring trace or repeats a gate.

Validation on Windows/x64:

.\build.ps1 -CommentHygiene -TokenHygiene -BuildTests
.\test.ps1 -CommentHygiene -TokenHygiene -NoBuild -SkipNative -TestProject Src/LexText/ParserCore/ParserCoreTests

The build compiled native prerequisites before managed code and finished with
zero warnings/errors. The test script ran 75/75 passing ParserCore cases against
that fresh build. The pre-fix focused run had 15 expected failures among 17 cases.
Regression coverage includes distinct circumfix halves, supplied environment
alternatives/allomorph identity, replacement entry/output and completion,
unresolved cache lookup, reason-versus-operand attribution, list punctuation,
blocking traversal/expandability, and both writing directions. Comment hygiene,
token hygiene, PowerShell compatibility, and whitespace checks passed.

The sandboxed restore could not reach NuGet; the network-enabled build succeeded.
No full-suite, live desktop, or screenshot claim is made. Self-review found no
remaining correctness defects; maintainers should confirm blocking wording and
navigation. No Jira key was supplied, and no tracked working documents enter
the PR.


This change is Reviewable

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ± 0      1 suites  ±0   10m 40s ⏱️ +18s
6 382 tests +17  6 297 ✅ +17  85 💤 ±0  0 ❌ ±0 
6 391 runs  +17  6 306 ✅ +17  85 💤 ±0  0 ❌ ±0 

Results for commit 15c1249. ± Comparison against base commit 6b8a752.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.34%. Comparing base (37b7024) to head (15c1249).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1173      +/-   ##
==========================================
+ Coverage   39.30%   39.34%   +0.03%     
==========================================
  Files        1523     1523              
  Lines      353047   353124      +77     
  Branches    40750    40761      +11     
==========================================
+ Hits       138782   138934     +152     
+ Misses     185001   184931      -70     
+ Partials    29264    29259       -5     
Files with missing lines Coverage Δ
Src/LexText/ParserCore/FwXmlTraceManager.cs 26.05% <100.00%> (+26.05%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jasonleenaylor jasonleenaylor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Two questions and a note, none blocking:

  • Is there a Jira issue to pin this to?
  • One question inline on the blocking display.
  • HCSynthByGloss has its own copy of the trace manager and stylesheet, which keep the single Environment element, the empty Blocked, and the MatchType test. Perhaps a follow-up Jira issue to write, or something to discuss with Andy.

This review was assisted by Claude Opus 5.5.

<xsl:call-template name="GetAnalysisFont"/>
</xsl:attribute>
<xsl:text>Blocked: </xsl:text>
<xsl:value-of select="Rule"/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For template blocking, Machine passes the stratum as the rule (SynthesisAffixTemplatesRule.cs:110 in v3.9.2). How does this line read in that case?

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.

3 participants