Repository navigation
Conversation
paskal
force-pushed
the
openai-auto-extraction
branch
2 times, most recently
from
August 20, 2026 08:33
ddc9c7b to
340218e
Compare
paskal
force-pushed
the
openai-auto-extraction
branch
from
September 10, 2026 06:17
340218e to
4d707c6
Compare
When a page is parsed wrong, an administrator can ask OpenAI for a CSS selector of the article. The model sees an outline of the page body instead of raw HTML, and a suggestion is accepted only after it is applied to the page and matches a plausible amount of text that is neither nearly the whole page nor what is extracted now. The selector is stored as a disabled rule with an insert-only write, so an existing rule of the domain is never replaced and nothing changes for readers until the rule is enabled. OpenAI is never asked for a selector during normal extraction. The request shares the per-request deadline used for summaries.
paskal
force-pushed
the
openai-auto-extraction
branch
from
October 18, 2026 12:15
4d707c6 to
3dcd2de
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously, this PR evaluated every extraction with OpenAI and saved the suggested selector as an enabled rule, which cost an API call on each request for domains without a rule and saved a selector without checking its result. This change replaces it with an explicit action on top of the OpenAI configuration from #92.
POST /api/content-parsed-wrong?url=...is protected by the same credentials as the rule management routes. Selectors are requested only from this endpoint, never during extraction or preview.--openai.model.SaveIfAbsent, which leaves an existing rule of the domain untouched, enabled or not. In that case the suggestion is only returned. The response holdsselector,savedand the page extracted with the selector, so it can be tried in the rule preview before it is enabled.The README documents the endpoint.
summaryIDalso ignores the hash writer's errors explicitly, which the current linter requires.TestSuggestRule,TestPageOutline,TestServer_ContentParsedWrongandTestRulesSaveIfAbsentcover the checks, the saved rule, the existing-rule case, the request deadline and the credentials. Restoring each of these defects makes a test fail. A call with a real OpenAI key was not made.