Repository navigation
0.18 PR7: reject known-but-unsupported options - #34
Merged
Merged
Conversation
Known-but-inert options are a trap: the caller believes the run was configured and gets silence instead. Add assertUnsupportedOptions and use it wherever an option is accepted by the signature but can never apply: - folds (scan/reduce/scanSync/reduceSync) reject take, total, onProgress and onUndefined from planFold; - findSync rejects onProgress and onUndefined; - filter/filterSync reject onUndefined, which was previously forwarded to the series engine and silently inert; - enrich/enrichSync and join reject the whole run lifecycle before doing any work: enrich at pipeline construction, join before its first branch. The lifecycle list lives in run.js because it is the engine's contract; enrich option validation moved to enrich-options.js so enrich.js stays under the 180-line gate. recover keeps its dedicated per-API message. Only a real value is rejected: an explicit undefined is treated as omitted. This is a curated list of known options, not the 0.19 allowlist.
One table per consumer: folds, filter/filterSync, findSync, enrich and join each reject every unsupported key with its exact message. join is asserted against a branch spy to prove rejection happens before any branch starts; enrich is asserted at construction, with no operation run. The valid side is covered too: owned options keep working on every API, series/mapSeries still accept the core run options untouched, and every known key passed as undefined is not rejected.
Add an 'Unsupported options' section under shared behavior with an options x consumer matrix marking the rejected cells, plus per-API notes on filter, findSync, folds, enrich, join and the sync twins. The recover messages stay documented as their own case; anchors are unchanged.
ildella
marked this pull request as ready for review
November 24, 2026 15:56
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.
Plan:
/home/della/.opencode/plan/pipelean-0.18.md§PR 7. Follows #33 (drop/onUndefined), now on master.What
No known option is silently ignored any more. New
assertUnsupportedOptions(opts, keys, label)insrc/shared.js(guard is!== undefined, message${label}() does not support the "${key}" option), applied to:scan/reduce/scanSync/reduceSync(viaplanFold)take,total,onProgress,onUndefinedfindSynconProgress,onUndefinedfilter/filterSynconUndefined(was forwarded to the series engine and inert)enrich/enrichSyncsignal,pause,pauseOnErrors,onSourceError,onProgress,take,total,onUndefined— rejected, never forwardedjoinrecoverkeeps its dedicated messages onenrichandjoin(tested explicitly).series/mapSeriesuntouched: new tests prove they still accepttake,total,onProgress,onUndefined,signal.Notes
src/enrich.jswas at the 180-line gate: therecoverblock plus the new lifecycle assertion moved to a newsrc/enrich-options.js(enrich.js now 176 lines). No lint rule disabled.src/run.js(LIFECYCLE_OPTIONS), shared by enrich and join;FOLD_UNSUPPORTEDis a strict subset local toplanFold(folds do accept signal/pause/pauseOnErrors/onSourceError).filterSyncnames itself in the message, consistent with findSync/enrichSync/join.{strategy, onError?, onFailure?}, so the fold guard cannot fire from inside enrich.Tests
New
tests/unsupported-options.test.js, 25 cases, including a branch spy provingjoinrejects before starting work. No existing test changed. Mutation-checked: disabling theplanFoldguard fails the 4 fold tests, disabling thejoinguard fails all 8 join tests.Gates (local)
yarn lintexit 0 ·yarn vitest run76 files / 1075 tests passed ·yarn checkexit 0 (0 clones, knip clean).