Repository navigation
fix(data-objectstack): the entry-form filter refuses an empty or non-string icontains comparand, reading the spec's own predicate (objectui#9048) - #11192
Conversation
…string icontains comparand, reading the spec's own predicate (objectui#9048)
objectFilterEntryToAST lowered `[{ field, operator: 'icontains', value: '' }]`
to `['name','icontains','']` and sent it, while the object form of the same
condition has been refused since objectui#9001. It now asks
@objectstack/spec's isRefusedTextComparand after the operator fold and throws
MalformedFilterError carrying textComparandRefusalReason verbatim, so the rule
entry, the `$` dialect and ValueDataSource judge one set with one reason.
MalformedFilterError takes an optional refusal sentence that replaces its
shape advice; the default message is unchanged.
Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec
Co-authored-by: Claude <noreply@anthropic.com>
…omparand refusal (objectui#9048) Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
…nd the 9048 pins without any (objectui#9048) Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Inputs: card #9048 (body and every comment, ruling D Check-runs on the head, waited to completion: 43 in all — 40 success, 3 skipped by design (the two coverage jobs and ① Derived judgments
② Semver level
③ Boundary flags
Findings
Everything else judged in ① is right and stays as landed; the fix itself is correct, complete across every caller, reads the spec's predicate and reason bytes, and is green on every check-run on the head. Implemented-by: VERDICT: FAIL Generated by Claude Code |
…vately, keeping MalformedFilterError's published signature (objectui#9048) Contract review 5908617443, finding 1, option B. The optional third constructor argument grew a published class's signature for an internal need. MalformedFilterError goes back to its base constructor and JSDoc; the refusal is now an ordinary MalformedFilterError built by the module-private refuseTextComparandEntry, whose message is replaced by the refusal sentence. The constructor's entry serialisation is BigInt-safe through a module-private describer, so the BigInt pin still reaches the contract reason. The changeset text is corrected to match. Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
…efusal in the README (objectui#9048) Contract review 5908617443, finding 2 (AGENTS.md #2). "Rule-shaped arrays" now says an icontains rule with an empty or non-string value throws MalformedFilterError (INVALID_FILTER / 400) before any request, naming the spelling that arrived, as the README already says for the $ dialect; the export-listing comment and the INVALID_FILTER code line are widened to match. Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Round 2, judging the WHOLE PR at the new head. The round-1 record was Check-runs on the head, all completed before judging: 43 in all — 40 success, 3 skipped by design (the two coverage jobs and ① Derived judgments
② Semver level
③ Boundary flags
Both round-1 findings are closed at this head, everything judged in ① is right, the level and the Implemented-by: VERDICT: PASS Generated by Claude Code |
Fixes #9048
Clause-②: no
What this lands
This is the open half of maintainer ruling D (comment
5658597078, decision batch #133 item 1). The ruling asks for one implementation and three envelopes.objectFilterEntryToASTis the rule-entry arm oftranslateFilterArray. It now asks@objectstack/spec/data'sisRefusedTextComparandaftertoAstFilterOperator's fold. On a refusal it throwsMalformedFilterError(INVALID_FILTER/ 400) carryingtextComparandRefusalReason(field, ARRIVED_SPELLING, value)byte for byte, and it throws before any request is sent. The three envelopes are now:FilterOperatorErrorfromconvertFiltersToASTandviewFilterRuleToNode;ValueDataSource;MalformedFilterErrorhere.All three read the spec's two functions. ⛔ No new export from
@object-ui/core.objectFilterEntryToASTitself, so every caller meets it:find()routes, plain and$expand;exportDownload;aggregate()'s analytics lowering;and/or. A bare rule now carries its position in the parent array as the index, which is whytranslateFilterChildgained anindexargument.ICONTAINS. The tail names the$-dialect twin'$icontains', so the row'smustMentionholds. This is the seatingviewFilterRuleToNodealready uses for the same vocabulary.MalformedFilterError's published signature is unchanged. The built.d.ts/.d.ctsare byte-identical to BASEe978ed5ea, and a control on the round-0 head shows the instrument sees a difference. The refusal is an ordinaryMalformedFilterError, built by the module-privaterefuseTextComparandEntry, which replaces its message with the refusal sentence. Soinstanceof,name,codeINVALID_FILTERandhttpStatus400 are the class's own. The constructor's entry serialisation goes through a module-private describer that is BigInt- and cycle-safe, and its output is byte-identical for every entry that serialised before. (Patch round 1, answering contract review5908617443.)valuegets no carve-out. The stored-view lowering has one because it emits a 2-tuple for a valueless operator. This translator always emits a 3-tuple, so an absent value went out as JSONnull, which is a non-string comparand (the table's second row).ValueDataSourcerefuses the same rule.Premises re-measured at BASE
e978ed5ea(installed@objectstack/spec17.5.0)packages/core/src/utils/text-comparand.tsre-exports both functions from@objectstack/spec/data. The only otherisRefusedTextComparand/textComparandRefusalReasonhits incoreare call sites and one pin that reads them. Verified, ⛔ not redone.typeof require('@objectstack/spec').isRefusedTextComparandreadsundefined); the/datasubpath has both (function). This PR imports from/data, ascoredoes.@object-ui/data-objectstackalready declares"@objectstack/spec": "^17.5.0"directly. There is no manifest or lockfile change.pnpm check:spec-floorsfetched 17.5.0 and inspected this package's builtdist, which now imports both names from@objectstack/spec/data, with no finding.FILTER_OPERATOR_ALIASEShas exactly one row whose value isicontains, the identity row. Case variants fold throughtoLowerCase.$icontains,containsCaseInsensitiveandi_containsdo not fold; they pass through raw, before and after this change.Before and after, measured by a throwaway probe driving
find()(deleted, not committed)Both routes gave identical answers, so they are shown once.
e978ed5eaicontains,''["name","icontains",""]MalformedFilterErrorINVALID_FILTER/400, nothing senticontains,42/null/true/["a"]/{}icontains,valueabsent["name","icontains",null]ICONTAINS/iContains/IContains/op:key,''and; nested rule groupicontains,'acme'(CONTROL)["name","icontains","acme"]contains,''(SCOPE)["name","contains",""]{ name: { $icontains: '' } }/42ValueDataSource, same entry filter, each comparand above'acme'Tests (round 0, HEAD
d7bd5a111; the patch-round readings at the final head26de698a1are in the next section)All runs are from the worktree root, under
os-verify-lock.sh. Pass COUNTS are read, not exit codes.pnpm exec vitest run packages/data-objectstack/ scripts/__tests__/spec-symbol-ledger-data-objectstack-7265.test.ts: Test Files 74 passed (74), Tests 1017 passed (1017),VERDICT command-exit 0.packages/data-objectstack/src/filter-entry-text-comparand-9048.test.ts: 52 passed (52). It covers:FILTER_TEXT_CASESwith each row'scodeandmustMentionasserted;''and42refused, with'acme'as the control;icontains, plus two case variants, each paired with its own control;ValueDataSourceover nine comparands;aggregate();aggregate().pnpm --filter @object-ui/data-objectstack type-check: exit 0, run afterpnpm --workspace-concurrency=2 --filter '@object-ui/data-objectstack^...' build.tsc --noEmit --listFilesincludes the new test file.pnpm --filter @object-ui/data-objectstack build: exit 0.scripts/__tests__/suite ran once because the diff adds a markdown changeset. It ran in three chunks whose union equals the 179-file population read fromgit ls-treeat HEAD: 177 files passed and 2 were skipped by design (the network-escape fixtures, inert outside the pin that spawns them); 5371 tests passed and 2 were skipped.node scripts/markdown-test-inputs.mjs --audit: exit 0.node scripts/check-changeset-presence.mjs("2 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)");check-changeset-no-major,check-changeset-fixed,check-changeset-overwrite,check-changeset-claims,check-pending-changeset-literals;pnpm check:new-line-citations("0 new citation(s)"),check:control-bytes,check:spec-symbols,check:phantom-deps,check:unused-deps,check:self-import,check:test-path-roots.pnpm check:readme-exports(exit 1) andpnpm check:spec-floors(exit 1) both went red only on sibling packages whosedist/is not built here. The first reports 480 self-imports it could not judge; the second reports 17[no-artifact]findings. This package itself was judged by both, with no finding (README rows: 0 unjudged, 0 wrong-path, 0 fabricated). The full reading is CI's.Ablation, on the committed fix (HEAD
75db0a505). The direction was predicted before running: 37 red and 15 green, where the 15 are the two derivation guards plus every control or scope pin.ablation-replace.mjs, which disabled the guard's condition. The anchor fell from 1 to 0 and the blob moved fromd4ad4247to92aaf4e2.d4ad4247(equal to HEAD),git diff HEADwas empty, and the marker count was 0../index), so it resolves to source and nodiststaleness applies.Lint, a declared narrowing. The package's
lintiseslint .resolving the root flat config. That config lints**/*.{ts,tsx}, and this diff adds or changes exactly two such files.pnpm exec eslint --format jsonover both files at HEADd7bd5a111read 2 files and 0 errors. The new test has 0 warnings.index.tshas 123no-explicit-anywarnings, the same count as BASEindex.tslinted through stdin.tseslint.configs.recommended, not a type-checked variant, andlanguageOptionscarries onlyecmaVersionandglobals, with noparserOptions.projectand noprojectService.eslint-rules/reads the filesystem: a grep forfsreads matched no rule file, while the same grep matched a positive control. So this diff cannot move a verdict on any file it does not contain.Patch round 1 (final head
26de698a1), answering contract review5908617443MalformedFilterError's published constructor is back to(entry, index), and the built.d.ts/.d.ctsare byte-identical to BASE (0 diff lines; the control ond7bd5a111differs). This keeps'@object-ui/data-objectstack': patchandClause-②: no.icontainsentry whose value is empty, a number,nullor missing throwsMalformedFilterError(INVALID_FILTER/ 400) before any request, naming the spelling that arrived. The export-listing comment is widened to match.26de698a1:vitest packages/data-objectstack/plus the spec-symbol ledger: 74 files, 1019 tests. The pin file has 54 tests.scripts/__tests__suite is green, andmarkdown-test-inputs --auditexits 0.Acceptance notes
These are recorded rather than filed: none has a demonstrated public entrance or named producer.
$filter: ['name','icontains','']reaches the wire unchanged, both before and after this change.translateFilterArraydeliberately leaves an already-lowered comparison tuple for the server ("the server decides").ValueDataSource's AST arm refuses the same tuple. The in-tree AST producersconvertFiltersToASTandtoFilterNodeboth refuse the shape first. Owner: none.find()throws a bareTypeErrorwhen its params hold a BigInt. The throw comes from its request-coalescing key (stableStringify(params)), before any translation, and for any operator,containsincluded. No JSON-sourced filter can carry a BigInt. Owner: none.toFilterNodethrows surface remains that card's decision.Generated by Claude Code