Repository navigation
Description
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu
Filing gate: ① a product defect, measured live · Source: fleet (os-dev report on #35952, out_of_scope_findings[0]; seat 7's word to file, 2026-11-20 23:47 UTC)
维护者速读
- 问题:在 Oracle 上,如果父对象的主键是十六字节二进制(RAW(16))存的 uuid,那么按父记录可见性限定的子记录读取(
controlled_by_parent)会静默返回空,取反时反而返回全部行。只有在同一个驱动上先读过一次父对象后才恢复正常。 - 影响:用 Oracle 外部表、主键是 RAW(16) uuid 的部署,用户看不到本该能看到的子记录,没有任何报错。
- 这一步做什么:Oracle 的 RAW 列预读也要覆盖组合可见性范围里的父对象,像 PostgreSQL 那边 [Decision] ADR-0155 O2: the share-grant subquery on PostgreSQL for an object whose id is not text (integer, uuid) #35906 做的一样。
- 要你做的:无。
What happens (measured)
Measured live on Oracle Free 23ai (testkit ORACLE_CELL, gvenzl/oracle-free) with a fresh SqlDriver, reading the child object first:
- A child read whose composed ReadableIds scope compares a RAW(16) parent's
idanswers[]. The expected rows are[c1, c2]. This happens with today's LIST form,{ id: { $in: [U1 upper-case, U2] } }, not only with the share-grant leaf. - Its negation answers every row.
- Once anything has read the parent object on that driver, the same read answers
[c1, c2].
Why
The Oracle doors prime primeOracleRawUuidColumns (packages/drivers/driver-sql/src/sql-driver-field-mapping.ts) for the door's own object, and for aggregate's joined parents, but never for the parent named inside a composed ReadableIds scope. So the parent's comparands bind as plain text instead of through HEXTORAW (sql-driver-oracle-dialect.ts#oracleUuidRawBinding). Oracle then compares the RAW column as upper-case hex text, and nothing matches. The PostgreSQL prime that #35906 adds does walk composed scopes for the parent; the Oracle prime does not.
reach: a named producer. plugin-security's controlled_by_parent read derivation answers { masterFK: { $in: ReadableIds.of(master) } }, and the engine composes it with the master's getReadFilter (ADR-0139 D6). Measured at the driver door; not yet driven through HTTP.
Fix direction
Prime the RAW(16) columns of every object a composed scope names, at the same doors that prime the door object, mirroring #35906's PG walk. Pin it live on the Oracle cell: a fresh driver, child read first, both the list and the leaf forms, and the negation.
Order
Independent of #35952 (that card converts the leaf's grants and does not touch the prime). Its live nested pin primes the parent explicitly, and says so in a comment.
Grading: area:data · Bug · a silent wrong answer on a supported dialect, measured live.
Suggested grade: p2 (silent loss of visible child rows on Oracle deployments with RAW(16) uuid keys; no error, so no one notices).
Dedupe: repo:objectstack-ai/objectstack is:issue oracle RAW(16) ReadableIds, primeOracleRawUuidColumns, controlled_by_parent oracle uuid → only #33787, #35872 and QA run records; none about the Oracle prime.
Activity
objectstack-fleet commentedon Nov 20, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in
domain:server(driver-sql, Oracle) ·pm:queue; rationale: area:data · Bug · on Oracle, a read whose composed ReadableIds scope names a parent with aRAW(16)uuid key binds the parent comparands as text, so it silently returns no rows (and its negation returns every row) until something has read the parent on that driver; measured live on Oracle Free 23ai; producer: plugin-securitycontrolled_by_parent; reach: Oracle deployments with RAW(16) uuid parents → p2 (silent wrong result, narrow reach) · size S (prime the parent inside composed scopes, as the PostgreSQL prime of #35906 does). security#2 is asked to judge the negated form.objectstack-fleet commentedon Nov 21, 2026
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7
Claim: PM loop · 2026-11-21T11:37Z
Session:
session_01L9qibwJEh7hMPPvagWM1g7Account:
os-teslaBranch:
claude/issue-35960-oracle-raw-prime-composed-scopeWorktree:
objectstack-issue-35960Domain:
domain:serverSeat:
repo:objectstack#7Area: d7-B (driver-sql)
File surface:
packages/drivers/driver-sql/src/sql-driver-field-mapping.ts: the Oracle RAW(16) prime also covers the object of every composedReadableIdsleaf in the filter, ascollectTextMatchObjectsalready does for the MSSQL GUID prime and as feat(driver-sql): compare the share-grant subquery by the key's type on PostgreSQL (ADR-0155 O2, ruling A) #35967 does for PostgreSQL.primeOracleRawUuidColumns(object)with a filter in hand (find, count, distinct, updateMany, deleteMany, aggregate and the query plan), touched only to pass the filter.patchchangeset.Stop on any breach and explain it in the report.
Container & model:
S,mode:subagent,model: default,effort: highClause-②: no
Metadata-protocol: none
Responsibility:
objectstack platform: driver-sql primes Oracle RAW(16) uuid columns for the door's own object and aggregate's joined parents, never for a composed ReadableIds scope's parent, so its comparands bind as text | the MSSQL GUID prime and the PostgreSQL prime (#35967) already walk composed scopes | Oracle deployments whose controlled_by_parent parents have RAW(16) uuid keys; measured live by the card's filerThread-read: 7053602623
Premise: holds on
main8145424.collectTextMatchObjects(sql-driver-field-mapping.ts:219-240) adds each composedReadableIdsleaf's object for the MSSQL prime, whileprimeOracleRawUuidColumns(object)primes only the named object. The dev re-measures live first, on a fresh driver with the child read first.Serial constraints cleared: no open PR touches
packages/drivers/driver-sql/src/**(open-PR file read at 2026-11-21T11:16Z). feat(driver-sql): the share-grant subquery converts a RAW(16) uuid key on Oracle as the list binds it (ADR-0155 O2) #36001 (driver-sql: the share-grant subquery on Oracle for a RAW(16) uuid key (ADR-0155 O2, ruling A applied to Oracle) #35952's Oracle share-grant conversion) and feat(driver-sql): compare the share-grant subquery by the key's type on PostgreSQL (ADR-0155 O2, ruling A) #35967 ([Decision] ADR-0155 O2: the share-grant subquery on PostgreSQL for an object whose id is not text (integer, uuid) #35906's PG walk) are merged. overlap-check runs before each push.Pre-claim lane: seat 7 order (2026-11-21T11:13Z), Tesla's word to work the data cards (2026-11-21 11:10Z).
area:data,domain:server; no governed path.Pre-claim deps: none open. It builds on feat(driver-sql): the share-grant subquery converts a RAW(16) uuid key on Oracle as the list binds it (ADR-0155 O2) #36001 and feat(driver-sql): compare the share-grant subquery by the key's type on PostgreSQL (ADR-0155 O2, ruling A) #35967, both on
main.Prior rulings read: ADR-0139 D3: a driver compiles the semi-join leaf or refuses loudly. No ruling comment on the card thread (check-prior-rulings, 0 of 1). Triage noted that security#2 is asked to judge the negated form. That question does not change this fix, which makes the comparands bind correctly.
objectstack-fleet commentedon Nov 21, 2026
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7
os-dev-report
{ "issue": 35960, "status": "done", "branch": "claude/issue-35960-oracle-raw-prime-composed-scope", "pr": "https://github.com/objectstack-ai/objectstack/pull/36084", "session": "session_01L9qibwJEh7hMPPvagWM1g7", "premise_still_valid": true, "summary": "Premise re-measured live on Oracle Free 23ai (gvenzl/oracle-free:23-slim-faststart, started in this container via dockerd) at main 8145424b53: with a fresh SqlDriver and the child read first, a composed ReadableIds scope over the RAW(16) parent answered [] for the list form {id:{$in:[U1 upper-case, U2]}} and for the share-grant leaf, and the negation answered [c1, c2, c4] (every row); 20 of 20 new pin cases red. Fix: FieldMappingFacet.primeOracleRawUuidColumns(object, where?) now primes the door's object plus every object a composed ReadableIds leaf in where names, reusing the existing collectTextMatchObjects walk (the MSSQL GUID prime's), so there is still one walk; every Oracle door that primes with a filter in hand passes it (findRows for find/findOne, count, distinct, updateMany, deleteMany, aggregate with where plus measure filters folded once into primedWhere and each joined parent's scope, findWithWindowFunctions, analyzeQuery). findWithWindowFunctions is not in the claim's parenthetical door list but is a door that primes with a filter in hand, as the claim's clause and the dispatch's step 2 describe. No line added to packages/objectql/src/engine.ts; diff stays in packages/drivers/driver-sql/src/** plus one patch changeset.", "tests": "LIVE ORACLE (OS_TEST_ORACLE_URL set, OS_EXPECT_LIVE_ORACLE=1). Before fix, main 8145424b53, -t 'fresh driver, the child read first': Tests 20 failed | 80 skipped (100); e.g. 'expected [] to deeply equal [c1, c2]', 'expected [c1, c2, c4] to deeply equal [c4]', 'expected 3 to be 1', analyzeQuery sql lacked HEXTORAW(. After fix at final head 19243893f3: both Oracle live files (fixed-read-leaf-conformance + oracle-federation-conformance) Test Files 2 passed (2), Tests 365 passed | 2 skipped (367), VERDICT command-exit 0; pin 20/20 pass (verbose). Ablation at 0c200dd0cf via scripts/ablation-replace.mjs: line 'collectTextMatchObjects(where, objects);' in the Oracle prime replaced by a marker (anchor 1->0, blob bb3b7d936b29 -> 73e309341315), pin Tests 20 failed | 80 skipped; restored, blob == HEAD bb3b7d936b29, git diff HEAD empty. Subject is imported from src/ (relative './sql-driver.js'), no dist in the path, so no rebuild leg. A first ablation attempt was refused by ablation-replace before any test ran (replacement text was a substring of the anchor, count did not rise): a no-op, measured nothing. Package: pnpm --filter @objectstack/driver-sql test (Oracle on) at 0c200dd0cf: Test Files 268 passed | 13 skipped (281), Tests 4686 passed | 258 skipped (4944), VERDICT 0; 19243893f3 differs only by removing two 'as any' casts in the pin. typecheck: exit 0 at 0c200dd0cf and tsc --noEmit exit 0 at 19243893f3; --listFiles counts the conformance test file (1).", "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack (tree 0c200dd0cf): 72 families. Ran with exit codes recorded; --ran reconciliation: '72 derived famil(ies) accounted for, 70 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)'. NOT MEASURED: check:dual-build-cjs-loads, check:lean-entry-closure, reason PREREQUISITE NOT MET (exit 3; need whole-repo dist, only driver-sql's closure was built); CI runs them. check:query-options-erasure was red at 0c200dd0cf (test surface 236 -> 237 from two casts in the new pin); the casts were removed and it is exit 0 at 19243893f3 ('ratchet holds'). Re-run at 19243893f3, all exit 0: check:test-source-alias, check:cross-package-test-inputs, check:nul-bytes, check:issue-citations, check:doc-authoring, check:driver-conformance, check-empty-changeset, check-changeset-no-major, check-adr-0087-registration. overlap-check before each push: VERDICT clean exit 0 (merges cleanly onto origin/main 8145424b53). PR #36084 check-runs at 19243893f3 when read: Check Changeset, Lint (ESLint, PM dispatch-gates, repo & tooling, CI/release/engine, docs & code guards, scoped), Type Check (workspace, source gates, consumer gates, debt ledger), Governed Surface Queue Guard, PR-body guards, Check PR Size: in_progress; query-options erasure lane queued; no conclusion yet. Test Core / Build Core not yet listed. The changed package's live Oracle cell is not run by CI (no CI job provisions Oracle), so the live readings above are the only Oracle evidence.", "dogfood_battery": "n/a — no ! in the PR title and Clause-②: no has no (narrowing) arm", "mcp_calls": "0", "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /issues/36084/assignees os-tesla), post-stamped comment on #35960 (POST /repos/objectstack-ai/objectstack/issues/35960/comments); plus git push x4 (not REST)", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "class: none (zero-pull, noted not filed) · reach: no producer outside the driver packages (git grep findWithWindowFunctions outside packages/drivers hits CHANGELOG files only; the request surface tombstones windowFunctions) · evidence: live on Oracle Free 23ai, findWithWindowFunctions on a federated object with columnMap ID->id: orderBy field 'id' compiles ORDER BY \"id\" -> ORA-00904 invalid identifier (window spec fields are not mapped through external.columnMap); ROW_NUMBER() OVER () without ORDER BY -> ORA-30485 · in PR Acceptance notes · dedupe words: findWithWindowFunctions columnMap, window orderBy external column, ORA-00904 window", "carrier: none · aggregate's joined parent now primes the objects its own scope composes (same walk), not pinned live (fixture has no grandparent); noted in PR Acceptance notes" ] }objectstack-fleet commentedon Nov 21, 2026
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7
Claim amendment · 2026-11-21T12:49Z · L1 nit N2 on PR #36084 (7062827204)
The claim 7062025264's file surface also names:
packages/drivers/driver-sql/src/sql-driver.ts. TheprimeOracleRawUuidColumnsstub takes the optionalwhereand its docblock says so (+5/−3, line count steady).findWithWindowFunctions, among the Oracle doors that prime with a filter in hand. It is inside the claim's clause, though not in its parenthetical list.Both stay inside
packages/drivers/driver-sql/src/**.On the out-of-scope finding, a window
orderBythat is not mapped throughexternal.columnMap(ORA-00904): it is not filed, because it fails the filing gate's business test. No producer outside the driver packages callsfindWithWindowFunctions;git grepoutsidepackages/drivershits CHANGELOGs only, and the request surface tombstoneswindowFunctions. It stays in the PR's Acceptance notes.objectstack-fleet commentedon Nov 21, 2026
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7
Close-out · 2026-11-21T14:19Z · #35960 done by PR #36084
PR #36084 merged through the queue at 2026-11-21T14:18Z as
521b4f65c5cedf40fcac6b5072deb0af75936b30. The merge group's Dogfood Regression Gate passed (3/3).What landed. On Oracle,
primeOracleRawUuidColumns(object, where?)now primes the door's object and every object a composedReadableIdsleaf names, at any depth. It reusescollectTextMatchObjects, the SQL Server GUID prime's walk, so there is still one walk. Every Oracle door that primes with a filter in hand passes it: find and findOne, count, distinct, updateMany, deleteMany, aggregate (with measure filters folded in, and each joined parent's scope),findWithWindowFunctionsandanalyzeQuery. A parent with a RAW(16) uuid key now binds throughHEXTORAWon a fresh driver. The list form and the share-grant leaf both answer the visible rows, and the negation no longer answers every row.Review trail
Carries
main, green on the fix, and the ablation turns the same 20 red.RelationGroupJoinpin is the template for an Oracle twin.orderByis not mapped throughexternal.columnMap(ORA-00904). It has no producer outside the driver packages, so it fails the filing gate's business test. It is recorded in the PR's Acceptance notes.pm:dispatchedremoved. The card was closed by the merge.fix(driver-sql): on Oracle, a composed ReadableIds scope primes its R…
fix(plugin-sharing)!: every share grant counts; the sharing scopes ca…