Repository navigation
fix(plugin): oneOf nullable outputs; reject non-array filter and unknown spec keys - #6
Merged
Merged
Conversation
…ng-aware extract_array
…lign minor contracts
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.
Summary
dsh-analyze-v015-defects.md(v0.1.4 / v0.1.5 联调), plus all review follow-up items from rounds 1 and 2 (blocker, items 1–3, and round-2 should-fixes; bothinmulti-value and the escape-aware scanners were folded in instead of opening issues). No version bump — release numbering is left for the maintainer (CHANGELOG records everything underUnreleased).outDatasetId/stratifyBy/label) are declaredoneOf: [{type:'string'},{type:'null'}]instead of JSON Schema type arrays or plainstring. Tools now register on DSH hosts (noUNSUPPORTED_SCHEMA) and CLInullvalues pass output validation.dataset_listdeclaresparentDatasetId(string | null) andsourceKind;dataset_dedupdeclareskeyColumns(string[] | null).filter(object / string /{}) used to be silently dropped and the full table returned withok:true.validateAggSpecand the Rust CLI now reject it withanalysis/invalid-args: filter must be an array; wrong-shapeselect/mutate/groupBy/aggs/orderBy/limitand unknown top-level spec keys are rejected the same way (CLI exit 2, never a silent full-table result).find_keyis depth- and string-aware, so key order cannot change results ({"filter":[{...,"limit":2}],"limit":1}both orders use the top-levellimit).limitenforced at parse — integer1..5000or exit 2, instead of silently clamping. Error texts unified across layers: type →limit must be a number, range →limit must be an integer 1..5000.filtervalue shapes +inmulti-value —valueis required for every op exceptis_null/not_null; onlyop: "in"accepts an array and every member matches (OR viavalues_eq; scalar = one-member set,[]= empty set); arrays for other ops and non-scalar members are rejected. Front-line checks also cover filtercolumn,selectentries, andorderByitems.extract_numberand theinmember parser sharelex_number: exponents (2e1,3e3) parse as JSON numbers everywhere (limit, filter value, in scalar/array), and trailing junk (2abc) is rejected instead of silently reading a prefix (2e1used to become2on the scalar paths whileJSON.parseon the tool layer read20).extract_arraybrackets,split_top_objectsitem splitting, andparse_string_arrayelements all track strings and escapes:]inselect ["A]B"]no longer truncates, and\"inside an item string no longer swallows laterfilter/aggs/orderBy/mutateitems (a swallowed second filter returned the whole table).orderBy.descmust be a boolean on the CLI too (was silentlyfalse; the tool layer already rejected it).docs/interface.mddocuments nullable fields asstring | nulland adds a "Spec key shapes" section covering filter array, value-shape, column,desc, andlimitcontracts; thetransform_aggspec description spells out filter and value shapes with examples.Verification
cargo test -p dsh-analyze— 67/67 green (25 unit tests, 10cli_agg.rsintegration tests against the real binary, plus 32 quality/relation/series integration tests). New regressions in this round:2e1/3e3exponents on every path,2abc→ exit 2bad number, escaped-quote filter items keep the second filter (rowCount 1, not the full table),orderBy.desc:"true"→ exit 2.node --test tests/analysis-*.test.mjs— 56/56 green: schema self-check (no type arrays), nullable/oneOffield declarations (incl.keyColumns), mock-CLInulloutputs (incl. dedup exactkeyColumns:null) pass output-schema validation, and every wrong-shape key / value /limiterror is rejected before CLI spawn.tscclean;dist/rebuilt.UNSUPPORTED_SCHEMA, output validation) comes from the Investigator-side real DSH 联调 that produced the defect list. A final real-host smoke (register + one call per nullable-output tool) is recommended before release; this PR's automated verification is mock CLI + realdsh-analyzebinary.