Skip to content

fix(embeddings): accept RFC 2045 last-line image folds - #680

Closed
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/bc-ac17bc86-defb-4040-8181-e2f70df71aec-6c3d
Closed

fix(embeddings): accept RFC 2045 last-line image folds#680
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/bc-ac17bc86-defb-4040-8181-e2f70df71aec-6c3d

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Buyer next action

Do not merge #665. Merge this successor instead. POST /v1/batch/embeddings with a 76-column RFC 2045 wrap of a data:image scan (the in-repo 1x1 PNG split after 76 base64 characters) and "chunking_strategy": "meaning_units". Search chunk_units for INV-20260816 — leftover AAAASUVORK5CYII= must not be in that vector. Wrapped <div><p>greeting</p><p>invoice</p></div> isolation from #665 is kept.

Why

#665 (ef4370e) used a {16,} continuation floor counted before padding. RFC 2045 wrap of the 92-character PNG leaves AAAASUVORK5CYII= (15 alphabet characters + =). The continuation was rejected; leftover base64 glued onto the invoice body_paragraph. The in-repo MIME fixture wrapped mid-payload so line 2 stayed long — false green.

This tip walks the payload: stop at padding / space / quote / >, fold only a following line that is entirely base64/padding, and keep a following alphanumeric invoice line out of the image.

Tests

python3 tests/test_meaning_unit_chunking.py
python3 tests/test_embeddings_meaning_units_http_honesty.py

RFC 2045 column-76, short padded last line, same-line prose after =, and HTTP POST of the wrap all isolate the invoice unit.

References

Freed, N., & Borenstein, N. (1996). Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies (RFC 2045). RFC Editor. https://doi.org/10.17487/RFC2045

Masinter, L. (1998). The "data" URL scheme (RFC 2397). RFC Editor. https://doi.org/10.17487/RFC2397

Independent non-author APPROVE is required. This automation will not self-approve or merge. Do not fold live NIM OCR, Responses SSE, or KV allowlist here.

Open in Web View Automation 

cursoragent and others added 4 commits August 16, 2026 16:30
Token-budget map/reduce still averages provider parts of one input. Buyers
searching naruon invoice mail need the balance line as its own vector.
chunking_strategy=meaning_units expands /v1/batch/embeddings into email,
HTML, image, and paragraph units and returns chunk_units with source
offsets. Omit keeps the naruon one-vector-per-input contract.

Grounded in Zhao et al. (2024), Qu et al. (2025), UAX #29, and Lewis et al.
(2020). Next action: POST the raw invoice email with meaning_units and
search chunk_units for the invoice id.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Keep innermost HTML leaves so a Gmail wrapper div does not glue the
greeting to the invoice line. Accept charset parameters, URL-safe
payloads, and MIME line wraps on data:image spans so a scanned invoice
keeps one source offset.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
The {16,} continuation floor rejected a 76-column wrap whose last
line is 15 alphabet characters plus padding, so leftover base64
glued onto the invoice unit. Walk the payload instead: stop at
padding, space, quote, or >, and keep a following alphanumeric
invoice line out of the image.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Author

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@seonghobae seonghobae closed this Aug 16, 2026
auto-merge was automatically disabled August 16, 2026 18:23

Pull request was closed

@seonghobae

Copy link
Copy Markdown
Contributor

Superseded by tip #691 (cumulative honesty substrate ≥ #689). Closing to free Full unit + Semgrep runners.

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