-
Notifications
You must be signed in to change notification settings - Fork 1
fix: keep visual whitespace out of authoritative structure #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seonghobae
merged 10 commits into
codex/post-structure-case-fixes
from
codex/normalize-source-indent-semantics
Aug 21, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cea0e7b
fix: separate source whitespace from explicit structure
seonghobae 9f7574f
docs: record source indentation buyer gap
seonghobae e84994e
Merge remote-tracking branch 'origin/codex/post-structure-case-fixes'…
seonghobae 1e762d5
Merge remote-tracking branch 'origin/codex/post-structure-case-fixes'…
seonghobae 9a45941
fix: expose unexpected content channel defects
seonghobae 9e59b70
fix: expose recoverable content batch failures
seonghobae e3f00ea
Merge remote-tracking branch 'origin/codex/post-structure-case-fixes'…
seonghobae 33f53ac
Merge remote-tracking branch 'origin/codex/post-structure-case-fixes'…
seonghobae 5cb315d
docs: normalize gap baseline headings
seonghobae 365f253
fix: retain partial visual regions (#320)
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # 2.13.1 Buyer-safe image evidence | ||
|
|
||
| Buyer views and search keep legitimate captions while suppressing internal | ||
| VISION instructions. Region responses with invalid JSON value types now fail | ||
| closed with an explicit type error instead of being treated as valid evidence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # ADR 0121: Keep Internal Image Instructions Out of Buyer Evidence | ||
|
|
||
| ## Status | ||
|
|
||
| Accepted | ||
|
|
||
| ## Context | ||
|
|
||
| VISION analysis may receive or inherit an internal instruction such as | ||
| `This post is an image. Ask questions to read its text.` or its Korean | ||
| equivalent. That text is an agent instruction, not a caption describing the | ||
| source image. Persisted legacy content can still contain it even after the | ||
| prompt is corrected. | ||
|
|
||
| ## Decision | ||
|
|
||
| At the image and visual-region evidence boundary, normalize captions and suppress captions that | ||
| match the known internal instruction forms. Apply the same rule when creating | ||
| LLM/embedding placeholders and when rendering the buyer-facing post body. | ||
| Retain the original image, OCR text, tags, region coordinates, and provenance; | ||
| only the non-evidence caption is removed. If no useful caption remains, show | ||
| the image and available evidence without inventing a description. | ||
|
|
||
| The instruction matcher uses concrete imperative phrases for Korean text | ||
| extraction guidance rather than ordinary words such as `텍스트` or `질문`, so | ||
| legitimate captions that describe an image containing text remain evidence. | ||
|
|
||
| The configured Vision destination is also a trust boundary. The client rejects | ||
| credential-bearing URLs, invalid ports, loopback/private/link-local/reserved | ||
| IP literals, and known local or cloud-metadata hostnames even when local HTTP | ||
| is explicitly enabled. Compose uses the service name `orchestrator` for its | ||
| local HTTP route; a caller cannot opt into an internal IP destination by | ||
| setting `allow_insecure_http`. | ||
|
|
||
| Vision parse failures and unexpected provider failures are also trust-boundary | ||
| events. Their raw response or exception text is never returned in an API | ||
| payload or persisted as post-content detail; the product exposes a stable | ||
| unavailable message and schedules a retry where applicable. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Buyer screens cannot expose the analysis agent's instruction as post content. | ||
| - Existing persisted image rows are safe immediately; re-ingestion is not | ||
| required merely to hide the legacy caption. | ||
| - OCR, region evidence, and semantic search remain available. | ||
| - New provider-specific instruction variants require an explicit, reviewed | ||
| pattern and a regression test rather than a broad caption guess. | ||
| - A malformed or attacker-controlled Vision endpoint fails closed at client | ||
| construction, before an API key or image payload is sent. | ||
| - A malformed provider response cannot disclose gateway diagnostics through a | ||
| buyer-facing error or durable ingestion record. | ||
|
|
||
| ## References — APA 7th | ||
|
|
||
| MITRE. (2026). *CWE-209: Generation of error message containing sensitive | ||
| information*. https://cwe.mitre.org/data/definitions/209.html | ||
|
|
||
| National Institute of Standards and Technology. (2020). *Security and privacy | ||
| controls for information systems and organizations* (NIST Special Publication | ||
| 800-53 Rev. 5). https://doi.org/10.6028/NIST.SP.800-53r5 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Duplicate unreachable exception handler
chat_about_postnow has two identicalexcept Exception as exc:handlers back to back. The first already catches everything, so the second (main.py) is unreachable dead code, an apparent merge artifact.Was this helpful? React with 👍 or 👎 to provide feedback.