Repository navigation
fix(ingestion): fetchable crawl URLs, bounded markdown prefixes, at-block hiding rules - #1339
Merged
Merged
Conversation
…lock hiding rules - WebCrawler fetched the raw abs:href, so href="my doc.html" failed in the fetcher's URI.create on every run as an inconclusive error, which also blocked deletion reconciliation. CrawlUrls.fetchable strips the fragment and encodes through the same tolerant parser as canonicalize; links and sitemap URLs use it for the fetch, the length bound and the frontier cost. - HtmlToMarkdownConverter copied every line once per enclosing blockquote or re-indented list item, so 90 nested quotes in a 236 KB mail allocated 339 MB. At most MAX_PREFIXED_NESTING = 8 such containers stack, counted on the per-conversion Walk; deeper ones are written in place. - HiddenStylesheetRules skipped every at-block, so a hiding rule inside @media screen hid text from readers and still reached the model. @layer, @supports and screen-wide @media blocks are entered in the same forward scan; viewport and device queries stay skipped.
…ts other counters
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 53 minutes. View limit details
|
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
rolandpickl
approved these changes
Nov 11, 2026
ginccc
added a commit
that referenced
this pull request
Nov 23, 2026
…plete the release docs (#1518) * fix(workspaces): legacy resources grant at most EDIT; settings load once and revalidate (#1322) * fix(workspaces): legacy resources grant at most EDIT A descriptor with no owner and no space gave every caller OWN under legacy-visibility=shared, so any user could delete, share, publish or move a pre-workspace resource, and moving it into their own space took it from everyone else. With enforcement off the same answer disclosed its grant list. The legacy contribution is now EDIT: reading, using, editing and deploying keep working after an upgrade, while the OWN acts are admin-only until an owner is assigned. Explicit grants still count in full, matching the no-descriptor fallback in ResourceAccessGuard. * fix(workspaces): settings load once and revalidate without blocking WorkspaceSettings re-read the stored settings inside synchronized(this) when its 5-second cache expired, so every access check queued behind a database read with no timeout of its own. It is now stale-while-revalidate: one caller re-reads while the others are served the last values, and a write adopted meanwhile is not overwritten by the older read. Only the first read, with nothing to serve, is still waited for. A stored legacy-visibility is validated once at load instead of on every access check, where an invalid value logged a WARN per call; it is now dropped (the default applies and the settings report DEFAULT) and logged once per distinct value. PUT /workspaces/settings stamps updatedAt to the millisecond both stores keep. * test(workspaces): Mongo and Postgres settings store parity Neither settings store had a test, and they encode "not set" differently (an absent key against a NULL column) while PUT /workspaces/settings relies on a write clearing an omitted field. The new parity test runs both real adapters through the same cases, including the timestamp precision each keeps. Adds the changelog fragment for the branch. * fix(workspaces): order settings snapshots by when their read began The stale-while-revalidate install compared against the snapshot seen when a read started, so a forced re-read (GET /workspaces/settings) that answered after an older access-check re-read lost its swap and left the older values served. Each store read is now numbered as it starts, and each adopted write as it lands; the higher number stays served, whichever answers first. A failed re-read keeps what is served when it fails rather than what was served when it began. The changelog fragment no longer says a resource with no descriptor gets the same level as a legacy descriptor: that fallback stops at read and use. * fix(workspaces): rewrap two test comments the formatter split mid-sentence * test(workspaces): null-guard the reader threads in two finally blocks (cherry picked from commit 8176edb) * fix(ingestion): fetchable crawl URLs, bounded markdown prefixes, at-block hiding rules (#1339) * fix(ingestion): fetchable crawl URLs, bounded markdown prefixes, at-block hiding rules - WebCrawler fetched the raw abs:href, so href="my doc.html" failed in the fetcher's URI.create on every run as an inconclusive error, which also blocked deletion reconciliation. CrawlUrls.fetchable strips the fragment and encodes through the same tolerant parser as canonicalize; links and sitemap URLs use it for the fetch, the length bound and the frontier cost. - HtmlToMarkdownConverter copied every line once per enclosing blockquote or re-indented list item, so 90 nested quotes in a 236 KB mail allocated 339 MB. At most MAX_PREFIXED_NESTING = 8 such containers stack, counted on the per-conversion Walk; deeper ones are written in place. - HiddenStylesheetRules skipped every at-block, so a hiding rule inside @media screen hid text from readers and still reached the model. @layer, @supports and screen-wide @media blocks are entered in the same forward scan; viewport and device queries stay skipped. * fix(ingestion): keep the walk's prefix-nesting counter private like its other counters * fix(ingestion): state the at-block hiding rules in security.md without nested dashes (cherry picked from commit 7d65ba2) * fix(nlp): an unknown word drops * as well, so it cannot act as the wildcard A lone * typed by a user became unknown(*). Expression.equals treats * as a wildcard, so that expression matched every behavior rule written as unknown(x). Unknown now strips * together with ( ) and ,. * docs(release): complete the 6.7.1 behaviour changes and record the review additions The upgrade notes gain the workspace, ingestion, import and sync, and Helm Keycloak digest changes, the price gap for GPT-6.2 and Gemini 4, and the expression injection the unknown(...) change closes. The Vertex picker never offered gemini-2.5-*, so that claim goes. Release-notes row dated 2026-11-22. OpenAiPermitModeAuthMechanism is @SInCE 6.7.1, and the Java4ShellMitigationTest Javadoc no longer contradicts itself. * fix(ingestion,workspaces): address review of the 6.7.1 backports - WorkspaceSettings: a failed re-read keeps the sequence of the snapshot it keeps, so an earlier-started read that answers later is not refused; the fail-closed snapshot of a never-read store ranks below every read. - WebCrawler: a held document linked only through a URL too long to fetch is reported after the crawl as content unknown (recorded unreachable, not missed) instead of being skipped silently. CrawlSink.holds says which documents the source holds. - HiddenStylesheetRules: a comment in an @media prelude separates tokens, so @media only/**/screen is entered. - CrawlUrls.encodeIllegal encodes by code point: an emoji is %F0%9F%98%80, not %3F%3F. - HtmlToMarkdownConverterSalvageTest: allocation tests also assume the counters are enabled. * fix(ingestion): bound and narrow the oversized-link report - reportOversized skips documents already visited or delivered, so a page reached through a redirect is not also reported as content unknown. - At most MAX_OVERSIZED_LINKS (1,000) documents are remembered; past that, discovery is incomplete. The report runs only after a crawl that completed with discovery complete, and stops on cancellation, interruption or the time budget, leaving discovery incomplete. - Collector.holds treats a failing state-store lookup as held, so it cannot fail a finished crawl. - A sitemap URL dropped for exceeding MAX_SITEMAP_URL_LENGTH marks the sitemap incomplete, so a page listed only that way is not tombstoned. * fix(ingestion): keep the oversized-link report from failing or flooding a run - Revert the sitemap change from the previous commit: a <loc> longer than MAX_SITEMAP_URL_LENGTH is dropped silently again. The check runs before the scheme and scope checks, so any long line disabled deletion reconciliation for the source for good; it stays a known gap. - Collector.onError: a failing recordUnreachable is caught and logged at debug, as ownershipUnverified does, so it cannot fail a finished crawl. - Collector.holds: after the first failing lookup it warns once and answers "held" for the rest of the run without asking the store again. - reportOversized: the queued/visited/delivered and robots skips come first; cancellation, interruption and the time budget are checked just before each lookup. - The skip log says "discovery was incomplete" rather than "incomplete sitemap discovery", which no longer covers every cause. - Tests: RecordingSink counts holds calls; a crawl past MAX_OVERSIZED_LINKS makes none, and exactly MAX_OVERSIZED_LINKS stays complete. A pipeline test covers a failing lookup: the run completes, looks up once, and tombstones nothing. * fix(ingestion): let a failed unreachable mark fail the run again - Collector.onError: the try/catch around recordUnreachable is removed. A swallowed failure let the run end covered and reconcile, so pages that merely answered an error counted as missed and could be tombstoned. The holds once-only failure flag stays; its comment now says what happens. - reportOversized Javadoc: names the queued/visited/delivered (redirect) skips, MAX_OVERSIZED_LINKS and the cancel/deadline stop. - Test: a store that cannot record an unreachable page fails the run and tombstones nothing. - docs: the overlong-link behaviour in "Behaviour changes in 6.7.1"; the silent drop of over-long sitemap <loc> entries recorded as a known gap. * fix(ingestion): admit only unreached oversized links; ignore robots in the report - noteOversized skips ids already visited or delivered, so overlong links to redirect targets the crawl reached no longer fill MAX_OVERSIZED_LINKS and disable reconciliation. reportOversized keeps its skips for links seen before their target was reached. - reportOversized no longer consults robots.txt. It matched rules against the canonical id, which has lost the link's tracking parameters, so a held document the real link reaches could be skipped and then deleted. Reported instead, it is kept.
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.
Three ingestion defects from the whole-codebase review (MOD-8, MOD-9, NEW-gap-modules-integrations-1), each with a concrete failure today.
1. A link with a raw space is never fetched (MOD-8)
A Confluence or SharePoint export links
<a href="my doc.html">. jsoup resolvesabs:hrefwithout percent-encoding, so the crawler gothttps://example.com/my doc.html.CrawlUrls.canonicalizealready encoded it for the document id (my%20doc.html), but the fetch used the raw string:SafeHttpPageFetchercallsURI.create(command.url()), which throwsIllegalArgumentException.WebCrawlerrecords that as a content-unknownCrawlError, andIngestionPipeline.onErrorcounts it as inconclusive. Result, on every run: the page is never ingested, and deletion reconciliation (sweepOrphans) never runs for the source while the link exists. Sitemap<loc>values took the same path.Fix.
CrawlUrls.fetchable(url)strips the fragment and encodes through the existingparseTolerantly, so an already valid or already encoded URL comes back byte-identical (new URI(s).toString()iss), and an unparseable one returns"".WebCrawlercomputes it once per link and per sitemap URL, and uses it for theMAX_LINK_LENGTHbound, the frontier cost and theCandidate. A URL that does not parse even encoded (a stray%) is now skipped instead of queued to fail inconclusively.index.htmland strips the trailing slash, so it is not the URL the site servesSafeHttpPageFetcherencodepathAndQuery) and the frontier would still see the raw string, and the fetcher should reject what it is given rather than guess2. Nested quotes and lists cost the square of their depth (MOD-9)
appendBlockquoterenders its children into a fresh buffer and copies every line out behind>; a list item nested through another element (li > div > ul) is re-indented by every enclosing item. A linedlevels deep is therefore copieddtimes and grows at each copy. The walk's budgets count source text and elements, never prefixes, andMAX_DEPTH = 200still allows ~100 quote levels. Measured: a 236 KB mail of 90 nested quotes allocated 339 MB (13x the same text unnested); 104 KB of lists nested 40 deep throughdivs allocated 239 MB (20x). Quoted reply chains inconvertMailare exactly this shape.Fix.
MAX_PREFIXED_NESTING = 8prefixing containers may be open at once, counted on the per-conversionWalk(the converter stays stateless). Past the cap a blockquote is written in place without its>and without a buffer (appendInPlace), and a list item's content is written in place without the re-indent. The item-content loop moved intoappendItemContentso both paths share it. Output for anything up to eight levels is unchanged (HtmlToMarkdownConverterTestand the existing salvage tests pass untouched). After the fix the same inputs allocate 1.7x and 3.8x their flat equivalents.Rejected: rewriting the output model to stream prefixes (a line-prefix stack threaded through every appender) — far more code for depth no real document reaches, and the embedding gains nothing from a ninth
>.3. A hiding rule inside
@media screenevades the mail hidden-content pass (NEW-gap-modules-integrations-1)HiddenStylesheetRules.readRulesskipped every at-block whole. An inbound mail withhides the text from every human reader, yet it reached the model. The same held for
@media all,@layer,@supports. This pass is the indirect-prompt-injection defence for mail, and the class contract says "never a bypass".Fix. On
@, the keyword is read (escapes decoded, case-folded) and the prelude scanned to{or;as before.@layer,@supports(taken to hold whatever it tests — over-removal only), and@mediawith an empty query or a query ofall/screen(optionallyonly) ornot <other type>are entered: the scan continues just inside the block, its rules are read like top-level ones, and its closing}is skipped like any stray one. Every other at-block is skipped as before.@media screen {and 100,000@layer{@supports(x){read in linear time@mediablockBehaviour changes
|,",<,>,{,},\,^,`) are now fetched and ingested. Non-ASCII characters in such a URL are encoded along with them; a URL whose only unusual characters are non-ASCII already parsed and is passed on unchanged. A source that had such links stops reporting inconclusive errors for them, so deletion reconciliation can run again — operators may see orphaned documents removed on the next complete crawl, which is the intended behaviour that was being blocked. Document ids do not change (they were already encoded).@layer,@supportsor a screen-wide@mediablock are removed before the mail reaches an agent. A hiding rule behind a viewport or device feature query ((max-width:600px),(prefers-color-scheme:dark), also an always-true one such as(min-width:0)), behindprint, or in@containeris still not applied — stated in the class Javadoc and indocs/security.md.No stored configs, REST paths, MCP tools or properties change.
Where to look hardest
HiddenStylesheetRules.readAtRule/isScreenQuery: entering a block relies onreadRulesskipping a}it meets at the top level. Check that a}closing an entered block can never be mistaken for the end of a rule body (readRulereads its body withskipBlockfrom its own{).HtmlToMarkdownConverter.appendList: the item marker is now appended before the content is rendered rather than after. Nothing else writes tooutputin between, so the output is identical; the shallow-nesting test pins- innermost.Verification
./mvnw -o -q -DskipUi=true compile— exit 0 (formatter and Checkstyle gates included).Final:
./mvnw -o -DskipUi=true test -Dtest='HtmlToMarkdownConverterSalvageTest,HiddenContentFilterTest,HtmlToMarkdownConverterTest,CrawlUrlsTest,WebCrawlerTest,ImportStyleTest,BuildQualityGatesTest,ChangelogRotationTest,ChangelogFragmentTest,DocumentationLinksTest,DocumentationAccuracyTest,DocumentedRestPathsTest,DeploymentManifestsTest'— BUILD SUCCESS, 472 tests, 0 failures, 1 skipped (a pre-existing skip inDeploymentManifestsTest); all 13 classes produced a surefire report.Test-first: before the converter fix the two allocation tests failed at 339 MB and 239 MB; the escaped-media case (
scr\65 en) failed until the query reader tokenized by identifier instead of splitting on whitespace.Mutation check, all three at once, one run:
fetchablereverted tostripFragmentin both call sites (both newWebCrawlerTestcases fail: the fetcher is asked for.../my doc.html); the at-block test forced to skip (11 of the 12 new stripped cases fail; the 12th pins that the scan resumes after a block and is mutation-independent by design);MAX_PREFIXED_NESTING = Integer.MAX_VALUE(both allocation tests fail at 339 MB vs 25 MB flat and 239 MB vs 11 MB flat). Restored and re-run green.Independent review: the three mutations were re-applied (at-blocks forced to skip,
MAX_PREFIXED_NESTING = Integer.MAX_VALUE,fetchablereverted tostripFragmentinenqueueLinks) andHiddenContentFilterTest,HtmlToMarkdownConverterSalvageTest,WebCrawlerTestfailed with exactly 14 failures: 11 at-block cases, both allocation tests (339 MB and 239 MB) andfetchesUnencodedLinkEncoded. The code was then restored. The review madeWalk.prefixNestingprivate, matching the walk's other counters, and rewrote thedocs/security.mdsentence, whose three em dashes read as one aside closing and another opening. On the final branch, the same 13-class targeted run passed: BUILD SUCCESS, 472 tests, 0 failures, 1 pre-existing skip, and a surefire report for every class.Not run locally: the full unit suite, integration tests (
*IT) and the UI suites — left to CI.Follow-ups (out of scope)
appendBlock(everydiv/section) still renders into a buffer and copies it into its parent, so deepdivnesting costs content x depth — bounded byMAX_DEPTH, not growing with prefixes, but the remaining 3.8x in the list case is that..a{ .b{display:none} }) and@scopeblocks are not read byHiddenStylesheetRules; both are newer than most mail clients but would be the next bypass to close.(min-width:0),(color)) remain skipped; telling them apart from responsive ones would mean evaluating media features.[title="{"],@supports (content:";")) can still desynchronise it. This is not new here: before this PR, rules inside@supportswere never read at all. It needs string-aware scanning inreadRule,readAtRuleandskipBlocktogether.