Skip to content

fix(api): keep invoice catalog searchable on stream and DATA: URIs - #684

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-9732f936-8623-4e2d-8e8a-d82717406b75-6c67
Closed

fix(api): keep invoice catalog searchable on stream and DATA: URIs#684
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-9732f936-8623-4e2d-8e8a-d82717406b75-6c67

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Unique slice on protected main (6841b71..074d051)

#663 records a 3NF image_content_catalog so an invoice PNG stays next to Please pay invoice 1042. This successor keeps that figure searchable when real clients send it:

  • DATA:IMAGE/PNG;BASE64,... and HTTPS:// schemes (RFC 2397 is case-insensitive)
  • wrapped base64 with newlines (RFC 2397 whitespace)
  • placement_id on each JSON placement so it matches docs/database_design.sql
  • the same catalog on the SSE stop chunk and on --state-db after stream_route
  • credential shapes in adjacent_text redacted; invoice numbers and AP emails stay searchable

Prefer this PR over #663 for merge (this tip is #663 plus the honesty slice). Do not fold text.format (#666/#681), meaning-unit (#680), or mock-envelope (#679) work here.

Buyer next action

POST /v1/chat/completions with stream: true and a wrapped DATA:image/png;base64,... part under Please pay invoice 1042 to ap@acme.com. Read orchestration.image_content_catalog on the stop chunk. Confirm invoice 1042 and ap@acme.com are present, the PNG bytes are not, and placement_id is image_placement_0_1.

Checks run locally

  • python3 tests/test_image_catalog_honesty.py
  • python3 tests/test_image_placement_catalog.py
  • python3 tests/test_streaming.py
  • python3 tests/test_true_streaming.py
  • python3 tests/test_security_hardening.py
  • python3 tests/test_persistence.py
  • python3 tests/test_paper_contracts.py
  • python3 tests/test_api_contract.py
  • python3 tests/test_conventions.py
  • python3 tests/test_self_check.py
  • python3 tests/test_admin_contract.py
  • python3 tests/test_product_planning_contract.py

Independent non-author APPROVE required. This automation will not self-approve or merge.

References

  • Faysse, M., Sibille, H., Wu, T., Omrani, B., Viaud, G., Hudelot, C., & Colombo, P. (2024). ColPali: Efficient document retrieval with vision language models (arXiv:2407.01449). arXiv. https://doi.org/10.48550/arXiv.2407.01449
  • Xu, Y., Li, M., Cui, L., Huang, S., Wei, F., & Zhou, M. (2020). LayoutLM: Pre-training of text and layout for document image understanding. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (pp. 1192–1200). Association for Computing Machinery. https://doi.org/10.1145/3394486.3403172
  • Masinter, L. (1998). The "data" URL scheme (RFC 2397). Internet Engineering Task Force. https://doi.org/10.17487/RFC2397
Open in Web View Automation 

cursoragent and others added 2 commits August 16, 2026 16:40
Accept OpenAI text+image_url parts and record a 3NF image catalog
(payload / placement / later recognition events) so a PNG under
"Please pay invoice 1042" stays findable. Hash inline bytes; do not
store raw base64. Grounded in ColPali, LayoutLM, and RFC 2397.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Accept RFC 2397 case and whitespace, emit placement_id, persist the
catalog on streamed runs, and redact credential shapes without hiding
invoice numbers or AP mailboxes.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@seonghobae
seonghobae marked this pull request as ready for review August 16, 2026 17:05
@seonghobae
seonghobae self-requested a review as a code owner August 16, 2026 17:05
@seonghobae
seonghobae enabled auto-merge (squash) August 16, 2026 17:05
@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