Skip to content

feat: 增强 x.ai 带连字符验证码识别 (ZER-57) - #114

Closed
ZeroPointSix wants to merge 23 commits into
mainfrom
cursor/xai-hyphenated-verification-code-e299
Closed

feat: 增强 x.ai 带连字符验证码识别 (ZER-57)#114
ZeroPointSix wants to merge 23 commits into
mainfrom
cursor/xai-hyphenated-verification-code-e299

Conversation

@ZeroPointSix

@ZeroPointSix ZeroPointSix commented Jul 13, 2026

Copy link
Copy Markdown
Owner

状态:测试已通过,待人工合并

关联 Linear:ZER-57 / GitHub issue #113

变更范围(仅 x.ai 验证码规则)

  1. 支持带连字符验证码:84A-KMNNJF-KUU
  2. 支持 HTML 粘连场景:address.84A-KMNIf
  3. 修复 HTML 中 CSS 色值 #333333 误识别
  4. 已移除测试专用 demo API(不进入正式合并)

已验证

  • 真实邮件 21mu5h0u@outlookmailplus.tech → 提取 NJF-KUUcode_confidence: high
  • 相关单测通过(Python 3.11/3.12/3.13)

说明

分支已推送最新修复,保持 Open,不自动合并。x.ai 规则修复已就绪,请人工 review 后合并。

Add rule-based extraction for alphanumeric codes with hyphens (e.g. 84A-KMN)
when verification context phrases are present. This allows x.ai email
verification codes to be recognized without enabling AI fallback.

Includes regression tests for smart/fallback extraction, options API path,
and confidence gate behavior.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
@linear-code

linear-code Bot commented Jul 13, 2026

Copy link
Copy Markdown

ZER-57

Expose POST /api/demo/rule-extract-verification protected by X-Demo-Token
for external testing of ZER-57 without requiring mailbox setup or AI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
cursoragent and others added 2 commits July 13, 2026 01:45
x.ai HTML emails often concatenate the verification code with the next
English word (e.g. address.84A-KMNIf). Relax hyphenated code boundaries
to allow a trailing capital+lowercase lookahead while keeping context
gating to avoid order/tracking false positives.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Real x.ai emails use letter-only codes (NJF-KUU) in addition to mixed
codes (84A-KMN). Relax hyphenated validation when both segments are at
least 3 chars and total length is at least 6.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
cursoragent and others added 13 commits July 13, 2026 02:02
When code_source=all, do not concatenate raw HTML into the code search
text; parsed body text is sufficient. HTML-only x.ai messages were
matching #333333 before NJF-KUU.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Remove test-only /api/demo/rule-extract-verification endpoint so this PR
only contains x.ai verification rule fixes. Apply Black formatting to pass CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>

Copy link
Copy Markdown
Owner Author

已将本 PR 的核心修复选入 #117 的旧前端发布分支。

纳入内容:

  • outlook_web/services/verification_extractor.py
  • tests/test_verification_extractor.py
  • tests/test_verification_extractor_options.py

未纳入内容:

  • outlook_web/controllers/system.py
  • outlook_web/routes/system.py

这样可以保留 x.ai 连字符验证码识别修复,同时符合 #115 中“新版本不发布新前端/演示接口”的合并边界。对应提交:4d05d2c(PR #117)。

ZeroPointSix and others added 6 commits July 13, 2026 10:56
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
Restore full app.py after accidental truncated push. Remove test-only demo
API endpoint and apply Black formatting for CI.

Co-authored-by: ZeroPointSix <ZeroPointSix@users.noreply.github.com>
@ZeroPointSix
ZeroPointSix force-pushed the cursor/xai-hyphenated-verification-code-e299 branch from fdeed82 to 4870c3c Compare July 13, 2026 03:35
@ZeroPointSix
ZeroPointSix marked this pull request as ready for review July 13, 2026 03:36
cursor Bot added a commit that referenced this pull request Jul 18, 2026
Merges #117: old-frontend emergency release with verification fixes (#67, #103, #108, #114) and ZER-90 integration.

Closes #115 release scope.

Copy link
Copy Markdown
Owner Author

仓库清理结论:本 PR 的 x.ai 连字符验证码核心修复已进入旧前端发布线,并随 v2.8.0 发布;后续统一提取实现也已由 #119 落入 main。当前 PR 与 main 冲突且不再是交付入口,现按已被替代关闭。

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.

2 participants