Repository navigation
Add a generator evaluator for web detection runs that suspend - #3236
Draft
GuiltyDolphin wants to merge 4 commits into
Draft
GuiltyDolphin wants to merge 4 commits into
GuiltyDolphin wants to merge 4 commits into
Conversation
Contributor
Build Branch
Static preview entry points
QR codes (mobile preview)
Integration commandsnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", branch: "pr-releases/gd-c-web-detection-generator-evaluator")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/gd-c-web-detection-generator-evaluator
git -C submodules/content-scope-scripts checkout origin/pr-releases/gd-c-web-detection-generator-evaluatorPin to exact commitnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", revision: "dfa8de8fe129ce2d856830f411eb602a3479d98e")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/gd-c-web-detection-generator-evaluator
git -C submodules/content-scope-scripts checkout dfa8de8fe129ce2d856830f411eb602a3479d98e |
Contributor
[Beta] Generated file diffTime updated: Mon, 30 Nov 2026 12:59:31 GMT Android
File has changed AppleFile has changed Chrome-mv3File has changed FirefoxFile has changed IntegrationFile has changed WindowsFile has changed |
This was referenced Nov 23, 2026
GuiltyDolphin
force-pushed
the
gd-c-web-detection-generator-evaluator
branch
3 times, most recently
from
November 25, 2026 13:28
7bd0558 to
ede1c66
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-generator-evaluator
branch
from
November 25, 2026 17:46
ede1c66 to
1c41f0c
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-generator-evaluator
branch
from
November 25, 2026 19:18
1c41f0c to
e70df8d
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-generator-evaluator
branch
from
November 25, 2026 20:50
e70df8d to
2377061
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-generator-evaluator
branch
from
November 25, 2026 21:54
2377061 to
389587c
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-generator-evaluator
branch
from
November 25, 2026 22:29
389587c to
aa2b74d
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-generator-evaluator
branch
from
November 30, 2026 10:47
aa2b74d to
851a32c
Compare
This marks the expressions a run can suspend in at compile time, from actions down to each source that suspends, and evaluates only those as generators. Runs with no source that suspends evaluate synchronously as before, ending in the first step of runDetectorSteps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A value of the wrong type now fails rather than errors, so the spec for an error after a run resumes uses an invalid selector instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator evaluator dropped the failure checkType returns, so a suspended value of the wrong type was used as it was. A run now fails there, as it does for the same value read synchronously. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An invalid selector now fails as aborted, so this test made the run's reads throw after resuming instead, which is how an error from this code arises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GuiltyDolphin
force-pushed
the
gd-c-web-detection-generator-evaluator
branch
from
November 30, 2026 12:57
851a32c to
4064635
Compare
This branch has not been deployed
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.


Asana Task/Github Issue: https://app.asana.com/1/137249556945/task/1220838326064413
Description
Builds on #3235.
wait(next PR) pauses a run partway through an expression and resumes it in a later task. This adds the evaluator that can do that, without changing how runs that never pause evaluate:suspends. Itsreadgives what the run waits on, and the run resumes with the value passed tonextmarkSuspensionsmarks the expressions fromactionsdown to each source that suspends, through the elements of a sequence, anif's condition and branches,expr, the value besideusing, and the values ofdefine,done,fireEventandbreakageReportData. A source that suspends anywhere else (underanyorsum, in a list, ausingoperand, a source body, a predicate, ormatch) is a parse error, so predicates and sources stay synchronousevaluateStepsandoccurrenceStepsevaluate marked expressions as generators, and hand unmarked ones to the synchronousevaluate. The logic after each value (is,define,done, sending a payload) is shared between the tworunDetectorStepsruns a detector that can suspend as a generator.runDetectorkeeps the synchronous path for every other detector, and throws for one that can suspend, as it has no schedulerNo source suspends yet, so nothing in config reaches the generator path.
The design has
waitanywhere an expression goes inactions. This limits it to the positions above, which cover each example in the design (anifcondition, adefinevalue, a payload, an action of its own). The privacy-configuration validator forwaitwill need the same rule.On a small detector with no page reads,
runDetectortakes the same time as on #3235 (about 1.6 µs a run in Node), and the Apple isolated bundle (unminified) grows by about 6 KB.Testing Steps
apisource markedsuspendsto cover suspending and resuming in adefine, in sources reached in order, in anifcondition and only in the branch taken, in a payload value, besideusingand indone, a failure and an error after resuming, a resumed value of the wrong type for its position (an object orundefinedin anifcondition) failing, as it would when read synchronously, run names bound before suspending, which expressions are marked,runDetectorfor detectors that can and can't suspend, and the parse error in each rejected positionChecklist
Please tick all that apply:
🤖 Generated with Claude Code