Repository navigation
LT-22836: Preserve HermitCrab trace failure facts in Try A Word - #1173
johnml1135 wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1173 +/- ##
==========================================
+ Coverage 39.49% 39.56% +0.07%
==========================================
Files 1537 1537
Lines 354392 354396 +4
Branches 41058 41059 +1
==========================================
+ Hits 139974 140234 +260
+ Misses 185044 184807 -237
+ Partials 29374 29355 -19
🚀 New features to boost your workflow:
|
jasonleenaylor
left a comment
There was a problem hiding this comment.
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
Environmentelement, the emptyBlocked, and theMatchTypetest. 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"/> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Good catch: for template blocking it would have read "Blocked: Morphology.", the stratum's name, which looks like a rule. Looking further, neither blocking path can fire from FLEx. Machine only blocks when the root's entry belongs to a lexical family, and HCLoader never builds one (FLEx models irregular forms as variant entries). So I've dropped the Blocked display in 9a536e9; the callback is empty again, as on main.
Two tests build a synthetic project, load it with HCLoader and trace a word through the real Morpher and FwXmlTraceManager: - a stem whose two environments both fail: main records them as one run-together environment, "/ _ a/ _ i" - a circumfix whose prefix environment its stem does not match: main records an empty environment Both fail on main and pass with this branch's trace manager. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
15c1249 to
90eae66
Compare
Machine blocks a word only when its root entry belongs to a lexical family, and HCLoader never builds one: FLEx models irregular forms as variant entries. No FLEx project can reach the Blocked callback, so recording and displaying it was code no user could see. The callback is empty again, as on main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
HCSynthByGloss keeps its own copy of the trace manager. Like FwXmlTraceManager before this branch, it wrapped all of an allomorph's failed environments in one Environment element, so a synthesis trace showed "/ _ i/ _ a" as a single environment (LT-22836). It now writes one element per environment; its stylesheet already separates them. TraceListsEachFailedEnvironment synthesizes a root from a small grammar whose two environments both fail. It fails without this change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks, Jason. Your approval was on 15c1249. Since then the PR has grown past what you reviewed, so please take another look at the scope before this merges:
Jira: LT-22836, with a synthetic FLEx project and manual steps attached. On HCSynthByGloss's other two differences: its empty Blocked callback now matches FLEx's, and its @AndyBlack, FYI since this touches HCSynthByGloss. |
Fixes LT-22836.
Start here:
Src/LexText/ParserCore/FwXmlTraceManager.cspreserves the facts;Src/Transforms/Presentation/FormatHCTrace.xsldisplays 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.5,
without rerunning parser checks or changing dependencies.
Environment element per failed alternative.
NonHeadProdRestrictMprFeatures here; an unrecognized reason stays unknown.
uses OR for the required at-least-one restrictions, and displays unknown causes
explicitly.
HcXmlTraceManager.cs) had the samerun-together environments; it now writes one element per environment, and its
stylesheet already separates them.
HCSynthByGlossTests.TraceListsEachFailedEnvironmentsynthesizes a root from a small grammar whose two environments both fail.
lexical family, and HCLoader never builds one (FLEx models irregular forms as
variant entries), so the callback stays empty as on main.
Synthetic before/after trace examples (headless callback/stylesheet cases):
/ e _, prefix/ p _, suffix/ _ s/ e _Environment values/ e _,/ p _,/ _ srootEnvironment incorrect for allomorph 'root': / p _/ _ s.Environment incorrect for allomorph 'root': / p _, / _ s.actual1actual2/required1required2actual1 and actual2/required1 or required2(Reason: Unknown reason.)Two end-to-end tests reproduce LT-22836 from a synthetic project loaded through
HCLoaderand traced by the realMorpher:HCLoaderTests.Trace_StemFailingTwoEnvironmentsListsEach(main records"/ _ a/ _ i" as one environment) and
HCLoaderTests.Trace_CircumfixPatternFailureNamesItsEnvironment(main records anempty environment). Both fail against main's trace manager and pass here. The
ticket attaches the same data as a FLEx project with manual steps.
Build passed with zero warnings/errors; all 73 ParserCore tests passed, including
14 new callback, transform and end-to-end cases, and all 3 HCSynthByGloss tests
passed, including the new one. 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. The visible behavior is tracked as LT-22836.
Next: review the trace presentation.
Preflight review details
Eight files changed: three production files, four test files and one test grammar. No interface,
package, native, COM, installer, or persisted language-project changes. The trace
XML is transient, and completion remains on the
existing path. Allomorph identities use the existing cache lookup and clickable
id conventions.
New presentation text follows the stylesheet's existing xsl:text convention.
Read-only inspection of Machine's v3.9.5 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:
The build compiled native prerequisites before managed code and finished with
zero warnings/errors. The test script ran 73/73 passing ParserCore cases and 3/3 HCSynthByGloss cases.
Regression coverage includes distinct circumfix halves, supplied environment
alternatives/allomorph identity, reason-versus-operand attribution, list
punctuation, 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. No tracked working documents enter the PR.
This change is
🤖 Generated with Claude Code