Repository navigation
fix(crossref): strip known face markup tags while retaining inequality operators (#14307) - #14318
Conversation
…dHardware#13972) Updated fields to be optional and added coercion methods for better handling of None values.
Refactor answer extraction logic to handle None values more gracefully.
Refactor Pydantic models for improved validation and clarity.
Added regression tests for IQ rating functionality, covering various edge cases including null content handling, empty choices, and malformed payloads.
Removed iq-rating-regression-tests check from manifest.
…y operators (BasedHardware#14307) - Strip Crossref face-markup tags (b, i, u, sub, sup, scp, tt, font, sc, strike) unconditionally before open/close tag filtering - Preserve inequality operators (e.g. If a<b, then c>d.) - Add regression tests covering chemical formulas (H2O, CO2), mathematical powers (E=mc2), and font attributes
aryanorastar
left a comment
There was a problem hiding this comment.
Reviewed current head d1d6cc15. The submitted cleaner suite passes (6 passed), but the new face-tag regex regresses the inequality-preservation contract it claims to retain.
html.unescape runs before _FACE_TAG, so an encoded chained comparison becomes indistinguishable from a known opening tag:
clean("If a<b>c, continue.")On main this returns If a<b>c, continue.; on this PR it returns If ac, continue. because <b> is stripped. The same class affects names such as <i>. Please only remove an opening face tag when there is evidence it is markup—for example, a corresponding closing tag—and add a regression covering encoded chained comparisons alongside the existing H<sub>2</sub>O cases.
Hygiene also fails because the PR body has no required Failure-Class: declaration. Add one of the exact accepted forms and rerun the check.
Non-blocking history cleanup: this two-file change currently carries 13 commits, including unrelated IQ-rating, CoinGecko, model, and manifest work. Please rebuild the branch from current upstream main so the PR contains only the Crossref change.
Re-review evidence: the new comparison regression and submitted cleaner suite pass, Hygiene is green, and the current branch is mergeable.
|
Hey @PINYOPATTANAWASANPORN 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
|
@aryanorastar Thank you for the insightful and accurate catch! All review requests have been resolved:
|
aryanorastar
left a comment
There was a problem hiding this comment.
Reviewed current head 5b5d404. The previous inequality regression is gone: clean("If a<b>c, continue.") returns If a<b>c, continue. because _FACE_TAG_PAIR requires a matching closer, and _OPEN_TAG still will not strip <b> after a word character. Word-adjacent formulas now clean as intended (H<sub>2</sub>O → H2O, nested sup → xyz). test_clean_preserves_encoded_and_raw_inequalities covers the encoded chained comparison.
PR body has Failure-Class: none. Hygiene and PR Metadata Preflight are green on this SHA. The branch is mergeable.
I executed the clean() cases from this head locally (the plugin test file is not in the backend CI detect path). All submitted cases passed.
Non-blocking: the branch still lists earlier unrelated IQ-rating / CoinGecko commits. The merge diff is the two Crossref files only.
|
Verified on head
Non-blocking follow-up candidate (not a regression vs For whoever merges: the earlier decline notice was posted against the previous head, before the fix commit and the human approval of this head. No escalation from me — this head already has maintainer approval; the by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Confirmed old clean() regex still on main; fix correctly strips paired face-markup tags while preserving inequality operators, thorough tests, CLEAN merge state, CI green. 5/5.
… pooling, payload guards, and hermetic test suite - Rebase onto latest upstream/main while preserving _FACE_TAG_PAIR markup handling (BasedHardware#14318) - Add clean_doi with URL/markdown extraction and input sanitization - Implement AsyncClient lifespan pooling with graceful error handling - Fold all face markup regression tests into test_main.py (44 hermetic tests) - Register omi-crossref-tests in checks-manifest.yaml
… pooling, payload guards, and hermetic test suite - Rebase onto latest upstream/main while preserving _FACE_TAG_PAIR markup handling (BasedHardware#14318) - Add clean_doi with URL/markdown extraction and input sanitization - Implement AsyncClient lifespan pooling with graceful error handling - Fold all face markup regression tests into test_main.py (44 hermetic tests) - Register omi-crossref-tests in checks-manifest.yaml
… pooling, payload guards, and hermetic test suite - Rebase onto latest upstream/main while preserving _FACE_TAG_PAIR markup handling (BasedHardware#14318) - Add clean_doi with URL/markdown extraction and input sanitization - Implement AsyncClient lifespan pooling with graceful error handling - Fold all face markup regression tests into test_main.py (44 hermetic tests) - Register omi-crossref-tests in checks-manifest.yaml
… pooling, payload guards, and hermetic test suite - Rebase onto latest upstream/main while preserving _FACE_TAG_PAIR markup handling (BasedHardware#14318) - Add clean_doi with URL/markdown extraction and input sanitization - Implement AsyncClient lifespan pooling with graceful error handling - Fold all face markup regression tests into test_main.py (44 hermetic tests) - Register omi-crossref-tests in checks-manifest.yaml
… pooling, payload guards, and hermetic test suite - Rebase onto latest upstream/main while preserving _FACE_TAG_PAIR markup handling (BasedHardware#14318) - Add clean_doi with URL/markdown extraction and input sanitization - Implement AsyncClient lifespan pooling with graceful error handling - Fold all face markup regression tests into test_main.py (44 hermetic tests) - Register omi-crossref-tests in checks-manifest.yaml
… pooling, payload guards, and hermetic test suite - Rebase onto latest upstream/main while preserving _FACE_TAG_PAIR markup handling (BasedHardware#14318) - Add clean_doi with URL/markdown extraction and input sanitization - Implement AsyncClient lifespan pooling with graceful error handling - Fold all face markup regression tests into test_main.py (44 hermetic tests) - Register omi-crossref-tests in checks-manifest.yaml
Summary of Changes
b,i,u,sub,sup,scp,tt,font,sc,strike) only when they form a matching opening and closing tag pair, preserving inner text.If a<b>c, continue.) unescape toIf a<b>c, continue.and are preserved as text rather than mistakenly stripped as opening tags.x<sup>y<sup>z</sup></sup>->xyz).test_clean.pyvalidating chemical formulas, mathematical superscripts/subscripts, font tags with attributes, and encoded comparison operators.Root Cause / Technical Context
plugins/omi-crossref-app/main.py:clean()useshtml.unescapeprior to tag stripping. In the previous iteration, standalone opening tag matching risked stripping encoded chained comparisons likea<b>c. By requiring opening face tags to have a corresponding closing tag, markup is cleanly stripped without regressing inequality or mathematical expressions.Verification & Testing
test_clean.py:If a<b, then c>d.)If a<b>c, continue.->If a<b>c, continue.)H2O,xyz,CO2,E=mc2,Drug-A1 and Drug-B2)x<sup>y<sup>z</sup></sup>->xyz)<font color="red">Sample Title</font>)Failure class (fixes)
Failure-Class: none
Fixes #14307