Repository navigation
Description
repo:objectstack#7 · os-tesla · session_01L9qibvvVzM5KhCWkT5f45c
Filing gate: ④ an execution card of an accepted cross-layer ADR · Source: fleet (ADR-0155, accepted in PR #34735, merge 64ccf6b, ruling 6942854600). Part of #33787. Step 2 (#35786) merged as d7c257e via PR #35839 (2026-11-20, 14:40 UTC); its close-out 7042346562 lists what this step carries.
维护者速读
- 问题:一个成员在同一对象上被共享超过 5000 条后,多出来的共享静默失效(plugin-sharing: a member with more than 5000 share grants on one object silently loses access to the grants past 5000 (list misses rows, GET answers 404) #33787)。ADR-0155 分 6 步修,前两步(契约、引擎接口)已合并,这是第 3 步。
- 这一步做什么:让 SQL 驱动(含 Turso 远程)把"共享子查询叶子"编译成数据库内的子查询,覆盖读取和按条件批量更新;还没有地方真正生成这个叶子,用户可见行为不变。
- 不做会怎样:最后一步切换 plugin-sharing 时,SQL 库上的共享读没法走子查询,plugin-sharing: a member with more than 5000 share grants on one object silently loses access to the grants past 5000 (list misses rows, GET answers 404) #33787 修不了。
- 要你做的:无。
Why (business)
Inherits #33787: customers with large sharing volumes silently lose access past 5,000 grants per member per object. This is the step that makes the fix real on SQL databases, where nearly all production tenants live.
Scope (ADR-0155 Execution plan, step 3)
driver-sqland the Turso remote transport compile theSharedRecordIdsleaf: the subquery with no tenant scope (① ruled A), the update path (③ ruled A), pins per dialect, O2, O3, and D6's reading for a caller with no grant.- With ③ ruled A, pin the rows each of a predicate update's two statements answers (the prior-row read and the write), each evaluating the share arm for itself (Consequences, Freshness).
- Declare
fixedReadLeaves: ['SharedRecordIds']in the SAME change that compiles it. Until a driver declares it, the seam refuses every leaf. - Carry step 1's L2 N4: per-dialect witnesses for the not-equal-to-empty half of the blank-id guard and for the cross-organization nested case.
- Doc residue N5 if this card edits
driver.zod.tsorfixed-read-leaf.ts. - ⛔ No producer writes the leaf yet (step 6).
Reader
Seat repo:objectstack#7, a dedicated card thread (L program; area-lease 〈不入区〉). L1 by L1-a; contract (L2) review per contract-review.md. Governing text: docs/adr/0155-sharing-scope-share-grants-lower-to-an-engine-internal-semi-join-leaf.md (D1–D6, Execution plan). Carry-forward ledger: comment 7042346562 on #35786.
Order
Steps 3, 4 and 5 each depend only on step 2 and may run in parallel. Step 6 is #33787 itself and lands last, after O8's census is recorded in its body. ⛔ No card up to step 5 refuses a boot (plan step 5).
Dedupe
"ADR-0155" is:issue → #33787, #35571 and #35786 (steps 1 and 2, closed). No step-3 card exists.
Grade: p2, the grade of the card it unblocks (#33787, p2). Type: Task.
Activity
objectstack-fleet commentedon Nov 20, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in
domain:server(driver-sql, Turso remote) ·pm:queue; rationale: area:data · Task · ADR-0155 step 3: compile the share-grant leaf to an in-database subquery on reads and the predicate update path; no producer yet, so no user-visible change; part of #33787 (shares beyond 5,000 per member silently stop applying) → p2 as filed (the parent's grade) · size M. Steps 3–5 can run in parallel after step 2 (#35786, merged); step 6 switches.objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz
Claim: PM loop round 1
Session:
session_01L9qibyXo4gSy8DJPNz4ANzAccount:
os-teslaBranch:
claude/project-thread-thptm0(platform exception: this card thread can push only its assigned branch; theclaude/issue-35872-*name is not available here)Worktree:
objectstack-issue-35872Domain:
domain:serverSeat:
repo:objectstack#7Area:
card #35872File surface:
packages/drivers/driver-sql/src/**(thesupportsdeclaration atsql-driver.ts:415, the filter compilerapplyFilterConditionatsql-driver.ts:7694and its helpers, the predicate update path, a sibling module for the subquery if the file's size calls for one),packages/drivers/driver-turso/src/**(the remote compilerbuildWhereSQLatremote-transport.ts:3143, theTursoDriverdeclaration and its remote update path),packages/spec/src/data/fixed-read-leaf-conformance.ts(only the step-1 L2 N4 witness rows, if the per-dialect pins are fed from the shared case-set),scripts/check-tenant-chokepoint.mjsor its allow-list (D2: the subquery's absent tenant scope recorded as an exemption citing ADR-0155, or a pin if the guard does not read the builder),content/docs/references/data/**for the drivers' own pages if generated, tests beside each,scripts/adr-anchors/(new anchor files only), one new changeset.changeset/35872-*.md(stop on breach; explain in the report). ⛔ No producer writes the leaf (step 6), nodriver-memoryedit (step 4, #35873), no analytics ordriver-mongodbedit (step 5, #35874), no boot is refused,packages/objectql/src/engine.tsdoes not grow (6854 of 6854), nodocs/adr/**orskills/**edit.Container & model:
M,mode:subagent,model: default(dispatch-gates --tier at eb9f8ed: "no path-derived mandate"),effort: xhigh(seat 7's card brief for this card, card-35872.md, relayed by the seat thread 2026-11-20T14:45Z: "Dev: os-dev at xhigh (contract, driver-sql + Turso)")Clause-②: yes
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 7042499013
Premise: holds (origin/main eb9f8ed: no driver declares
fixedReadLeaves(zero hits underpackages/drivers);driver-sqldeclares onlyreadableIdsLeaf: trueatsql-driver.ts:415; neitherapplyFilterConditionnor the remotebuildWhereSQLnamesSharedRecordIds; the seam from step 2 (d7c257e) refuses every leaf until a driver declares)Serial constraints cleared: overlap-check (probe commit over
sql-driver.ts,remote-transport.ts,turso-driver.tsat the planned hunks, origin/main eb9f8ed): merges cleanly, 0 open PR heads share those files; overlap-check reruns before each push. Sibling step cards #35873 (driver-memory) and #35874 (analytics, storage rows) touch disjoint packages.Pre-claim lane:
repo:objectstackseat 7, card threadcard #35872(area-lease 〈不入区〉 for the L program); code paths aredomain:server(drivers/*);packages/spec/src/data/fixed-read-leaf-conformance.tsstays in this lane (area-lease 留道); noskills/**,docs/adr/**or workflow pathPre-claim deps: #35786 (ADR-0155 step 2) closed, merged as d7c257e via PR #35839; #35571 (step 1) closed, merged as c99156e; no
Blocked-by:line on the cardScope-review: exempt — a ruled route (ADR-0155, accepted, Execution plan step 3)
Prior rulings read: ADR-0155 D-0, D1, D2, D6, O2, O3 and plan step 3 (accepted in PR #34735; ruling record 6942854600: ① ruled A, no tenant scope on the subquery; ③ ruled A, the write form in a predicate
update'swhere); step 1's L2 7031725737 N4 (per-dialect witnesses for the not-equal-to-empty half of the blank-id guard and the cross-organization nested case, owed here); step 2's close-out 7042346562 and L2 7041395515 (declarefixedReadLeaves: ['SharedRecordIds']in the same change that compiles it); ADR-0139 D3 (theReadableIdssubquery these compilers already carry); ADR-0078 (no declared capability without its reader).check-prior-rulings.mjs --card 35872: 0 ruling comments on the card's thread.objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz
os-dev-report
{
"issue": 35872,
"status": "needs_decision",
"branch": "claude/project-thread-thptm0",
"pr": "#35893",
"session": "session_01L9qibyXo4gSy8DJPNz4ANz",
"premise_still_valid": true,
"summary": "driver-sql compiles a SharedRecordIds leaf in a field's $in to one bound subquery over sys_record_share, with no tenant scope inside it (ruling 1 A). The write form adds access_level IN (levels) (ruling 3 A). The rule has no cap, ordering, EXISTS, correlation or join; Oracle drops the empty-string half. Turso's RemoteTransport compiles the same subquery from the same exported predicates. SqlDriver.supports.fixedReadLeaves = ['SharedRecordIds'] lands in the same commit, and TursoDriver inherits it on both faces. A leaf in any other position is refused before any statement runs, with INTERNAL_ERROR / 500, logged once per driver. The shared case-set gains n5 plus a nested case under a tenant, and check:tenant-chokepoint carries one EXEMPT entry for the unwalled builder. Everything is done except one item: on PostgreSQL a non-string outer key (integer, uuid) does not keep today's rows (42883). Per D-0 that item is stopped and raised as needs_decision, so the PR says 'Part of #35872'.",
"tests": "All at head 9a099c3, through the verify lock. (1) driver-sql pnpm test, with OS_TEST_POSTGRES_URL set, a PG server on Asia/Shanghai and process TZ America/New_York: Test Files 276 passed | 4 skipped (280), Tests 5710 passed | 133 skipped (5843), VERDICT command-exit 0; live-dialect block: sqlite RAN, live postgres RAN, live mysql NOT RUN. A first run against a UTC PG server failed 6 live-PG timezone files on their own precondition ('the live postgres server runs at UTC ... this cell proves nothing'); the rerun with the skew passed. (2) driver-turso pnpm test: Test Files 103 passed | 1 skipped (104), Tests 2647 passed | 36 skipped (2683), exit 0. (3) spec vitest run src/data: 183 files, 6646 passed | 1 todo, exit 0. (4) typecheck for driver-sql, driver-turso and spec: each exit 0. The new suites: sql-driver-fixed-read-leaf-conformance.test.ts gives Tests 78 passed | 1 skipped (79) with PG (the skip is MySQL); turso-fixed-read-leaf-conformance.test.ts gives 54 passed. Ablation after both commits, via scripts/ablation-replace.mjs: deleted the notEmpty line in fixedReadLeafSubquery. Predicted red: 3 N4 tests plus the bindings pin on each live cell, plus the sqlite/pg/mysql/mssql compile-shape pins. Observed 'Tests 12 failed | 66 passed | 1 skipped (79)', the predicted set exactly, with Oracle and the shared cases green. The restored blob equals HEAD (bd8d9c663c2c) and git diff HEAD is empty. driver-sql's tests import src directly, so no dist leg was owed.",
"gates": "Local: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 9a099c3 derived 114 families. Each was run with its exit code captured before any pipe. --ran with codes recorded: '114 derived, 113 run, 1 NOT-MEASURED, 0 UNRUN'. On the first pass 111 exited 0, including check:tenant-chokepoint ('every unscoped one is an insert or one of 1 EXEMPT entr(ies)'), adr-anchors, nul-bytes, facade-delegation-only ('4 file(s) within their line ceiling'), driver-conformance, test-source-alias, error-status-conformance and where-matcher. check-plugin-teardown-shape --self-test exited 3 (a pinned control commit was missing from the shallow checkout); after fetching that one commit it exited 0. check:dts-closure exited 1, naming 55 packages without .d.ts: the CLI closure had been built with OS_SKIP_DTS=1 for the R9 bench, and none of the three touched packages was among them. Rebuilt with declarations, it exited 0 ('260/260 declared declaration file(s) present'). check:dual-build-cjs-loads exited 3 (PREREQUISITE NOT MET: no dist for some packages): NOT MEASURED locally, CI runs it. Overlap check before PR creation: VERDICT clean exit 0. CI on PR #35893 head 9a099c3 concluded with 69 check-runs: 58 success, 11 skipped, 0 failure. Among the successes: Check Changeset; PR-body guards (claim · duplicate · Part-of · single-writer path); Lint & Repo Gates; Lint · ESLint; Lint · PM dispatch-gates; Lint · CI, release & engine gates; Lint · docs & code guards; Lint · repo & tooling gates; Lint · scoped (3 jobs); Type Check · workspace, source gates, consumer gates and debt ledger; TypeScript Type Check; Build Core; Test Core plus Test Core 1/10 through 10/10; Test UI plus 1/16 through 16/16; Build & E2E UI; Live E2E UI; Dogfood Regression Gate; Spec property liveness; Flag docs affected by code changes; Governed Surface Queue Guard. Skipped by their own selectors: Temporal Conformance (live PG + MySQL), which runs on push and schedule only; Dogfood shards; Dogfood Verify CLI; Lint UI; Build Docs; UI Published Artifacts; the queue-verdict jobs; the opt-in harnesses. Foreground polling only; no red to repair.",
"dogfood_battery": "n/a — no '!' in the PR title and no (narrowing) arm (Clause-②: yes)",
"mcp_calls": "0",
"api_writes": "2 — (1) fleet-write relay POST /repos/objectstack-ai/objectstack/dispatches carrying pr_create, executed as objectstack-fleet[bot] POST /repos/objectstack-ai/objectstack/pulls, giving #35893 (draft; read back identical, 16419 bytes); (2) post-stamped comment POST /repos//issues/35872/comments (this report). The git pushes, 2 commits, are not REST writes.",
"open_questions": [
{
"question": "O2 / D-0: on PostgreSQL, an object whose id column is not text (a federated table keyed by integer or uuid; federated objects are sharing-scoped, see plugin-sharing federated-phantom-anchors.ts) fails the leaf with DATABASE_ERROR 42883 (integer = character varying), where today's list answers [7, 42] and both uuids. Which answer should the compile give?",
"options": [
"A. Type-aware inner read on PG: cast record_id to the outer key's base type, read once per object from the catalog. Same rows as the list, because PG parses each bound list literal with the same input function. A malformed grant id fails the statement the same way a list literal does. Effort M (catalog read and cache in driver-sql; a pin per type). Axes: real need — reachable once step 6 writes the leaf on a federated PG table; long term — keeps one statement and every grant for every key type; AI-safety — invisible to authors, no silent divergence; scope — new driver code for a niche path.",
"B. jsonb_populate_record-typed inner read on PG external objects. Same rows for int and uuid (measured), but it errors 'value too long for type character varying(10)' where the list answers no match. Effort S. Axes: a second, quieter divergence from the list; a workaround shape.",
"C. Cast the outer column to text (id::text IN subquery). Effort S. Gives different rows on non-canonical spellings (grant '07' no longer matches 7; an uppercase uuid grant does not match) and loses the outer pk index (full scan of the federated table). Axes: silent row change, the worst on AI-safety.",
"D. Leave this compile as is, and have step 6's producer keep today's id list (with its cap) for an object whose id is not text on a non-SQLite SQL dialect. Effort S here, cost at step 6. Axes: keeps the capped second path #33787 retires, and behaviour splits by key type."
],
"recommendation": "A, because it is the only option that meets D-0 as written (the same rows for an outer key of another type) without keeping the capped list alive (D) or changing rows silently (B, C). It can land as its own card before step 6, which is the first point where the case becomes reachable; until then the naive compile fails loudly (500), never with wrong rows."
},
{
"question": "The dispatch's invariant template says 'or a refusal with INVALID_FILTER', while ADR-0155 and step 2's seam say INTERNAL_ERROR / 500, 'never INVALID_FILTER' (no request can spell the leaf). The refusals here follow the ADR. Keep them?",
"options": [
"A. Keep INTERNAL_ERROR / 500 (ADR-0139 D3's envelope, as step 2's seam already answers).",
"B. Switch the driver refusals to INVALID_FILTER, diverging from the seam."
],
"recommendation": "A, because the ADR rules it and the seam in front of these drivers already answers that envelope; B would give two envelopes for one fault."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"class: none (dispatch-ordered O3 measurement, not a defect) · reach: exception: maintainer (the dispatch orders the reading) · evidence: R9 bench at scale 100k/1M and 900/9,000 member grants, plus an instrument variant adding 100,000 other-recipient grants (removed after; count read back). A covering (object_name, recipient_type, recipient_id, record_id) index makes the inner read index-only on SQLite and on PG (after VACUUM ANALYZE). Inner read at 900 grants: SQLite 0.237 -> 0.279 ms, PG 0.651 -> 0.895 ms (noise). At 9,000 grants: SQLite 4.19 -> 2.02 ms, PG 3.63 -> 2.96 ms. The flat page and total move by the same order. One PG plan flip in the nested position (a two-level parent chain, constructed), at 9,000 grants plus 100k others: 250.1 ms with the shipped index (hash joins, seq scans) against 12.8 ms with the covering index (nested loop), and 10.6 ms for today's list. Single observation, driven by estimates. The index was not edited · carrier: seat (the index lives with sys_record_share's definition) · dedupe words: sys_record_share covering index record_id, SharedRecordIds inner read, ADR-0155 O3",
"class: none (D6 reading the switch quotes) · reach: exception: maintainer (ADR-0155 D6 orders it on this card) · evidence: for a no-grant caller, PG 16 stops serving the total from idx_bench_account_owner_id once the subquery arm is present: Bitmap Index Scan becomes Seq Scan on bench_account (0.149 -> 0.346 ms at 1,000 accounts; 0.162 -> 0.972 and 0.394 -> 1.968 ms at 10,000), so the total's cost grows with the object's table. SQLite keeps the owner index (MULTI-INDEX OR) · carrier: #33787 (ADR-0155 plan step 6, the switch, which carries D6's pins) · dedupe words: no-grant caller owner index seq scan, SharedRecordIds subquery OR, ADR-0155 D6",
"class: a (the defect #33787 itself, already filed) · reach: R9 bench at --scale 1000000 --shares 9000 on main: the member reads 6,000 accounts of 10,000 expected, and ac00009999 answers 404 · carrier: #33787 · noted, not filed"
],
"line_budget": "packages/objectql/src/engine.ts untouched, 6854 of 6854. packages/drivers/driver-sql/src/sql-driver.ts 10053 -> 10067, ceiling 10071 (check:facade-delegation-only exit 0).",
"files_changed": [
".changeset/35872-shared-record-ids-sql-compile.md (new; patch: driver-sql, driver-turso, spec; Clause-② yes, Metadata-protocol none)",
"packages/drivers/driver-sql/src/fixed-read-leaf-compile.ts (new: findMisplacedFixedReadLeaf, misplacedFixedReadLeafMessage, fixedInnerReadPredicates)",
"packages/drivers/driver-sql/src/index.ts (exports the three)",
"packages/drivers/driver-sql/src/sql-driver.ts (declaration, refusal log flag, stub, host wiring)",
"packages/drivers/driver-sql/src/sql-driver-filter-helpers.ts (refusal walk in applyFilters, $in arm in applyFilterCondition)",
"packages/drivers/driver-sql/src/sql-driver-internal-helpers.ts (fixedReadLeafSubquery)",
"packages/drivers/driver-sql/src/sql-driver-fixed-read-leaf-conformance.test.ts (new)",
"packages/drivers/driver-turso/src/remote-transport.ts (fixedInnerReadSQL, $in arm, refusal)",
"packages/drivers/driver-turso/src/turso-driver.ts (toRemoteWhere refusal, supports note)",
"packages/drivers/driver-turso/src/turso-fixed-read-leaf-conformance.test.ts (new)",
"packages/spec/src/data/fixed-read-leaf-conformance.ts (n5, nested case under a tenant)",
"packages/spec/src/data/fixed-read-leaf-conformance.test.ts (inner-read-walled now fails 2 cases)",
"scripts/check-tenant-chokepoint.mjs (EXEMPT entry, ① A)",
"scripts/adr-anchors/ (3 new anchor files)"
],
"deviations": [
"PR body says 'Part of #35872', not the dispatch's 'Fixes #35872': O2's PG non-string key item is open (D-0, needs_decision), and os-dev's rule is that merging must not close a card with an item left. The seat can flip the line once it is ruled.",
"The branch claude/project-thread-thptm0 did not exist on origin; this run created it from origin/main eb9f8ed.",
"objectql engine-fixed-read-leaf-seam.test.ts was NOT MEASURED locally: the closure was not built (Cannot find package '@objectstack/metadata/view-container'). It reads only the case-set's .seam, which is byte-unchanged; CI Test Core runs it.",
"The private PG 16 cluster lived at /tmp/os-dev-35872-pg, outside the scratchpad, so the postgres user could own it. It was stopped and removed after CI concluded, and the bench work dirs were removed too. Its timezone was set to Asia/Shanghai after the O3/D6 readings, for the full driver-sql run.",
"The O3 instrument went past the bench's own legs: it added 100,000 other-recipient grants, then deleted them, and used VACUUM ANALYZE on PG. The R9 bench itself was used as the seeder (--only scoped_account_list --iterations 1 --warmup 0), and the timings come from the scratch instrument.",
"spec tests were narrowed to src/data, where the case-set's only spec consumers live; the full spec suite and test:repo were declared to CI.",
"Fetched one commit (621a487) into the shared .git, for check-plugin-teardown-shape --self-test's pinned control.",
"The dispatch's 'INVALID_FILTER' invariant text conflicts with ADR-0155 / the step-2 seam (INTERNAL_ERROR / 500). The ADR was followed; this is raised in open_questions."
],
"measurements": {
"A1": "Confirmed. The compile arm is in applyFilterCondition (now in sql-driver-filter-helpers.ts, called through the facade), and SqliteWasmDriver and Turso local inherit it. Ad hoc SqliteWasmDriver run: declares ['SharedRecordIds'], 14/14 shared cases OK. RemoteTransport.buildWhereSQL is an independent compiler: it now compiles the leaf, also inside a resolved remoteReadableIdsSemiJoin scope (pinned).",
"A2": "Confirmed. TursoDriver spreads super.supports, so remote mode would have declared the leaf. The declaration is true on both faces only because the remote compiler compiles it in the same commit. Pinned on both faces.",
"A3": "Measured. SHARED_RECORD_IDS_CASE_SET .cases are consumed by spec's self-test and now by both driver suites; .seam is consumed by objectql's seam test. driver-memory does not consume it yet, so the new n5 and nested-under-tenant rows cannot red step 4 on main. N4's empty-id witnesses are driver-local, because the shared doc table has no '' id row and adding one would change every evaluator's row set.",
"A4": "Measured. The two statements are the engine's prior-row read (driver.find) and the driver write (driver.updateMany), with the same AST. Both are pinned per case, plus the tenant write and freshness (grants inserted and deleted between the two).",
"A5": "SQLite live; PostgreSQL 16 live on a private local cluster; MySQL, SQL Server and Oracle are compile-shape only here. The MySQL live cell exists in the suite and runs in CI's Temporal Conformance job, which runs on push and schedule, not on PRs.",
"A6": "Measured. check:tenant-chokepoint reads this.getBuilder bindings in facet statics and flagged fixedReadLeafSubquery's inner builder, exit 1 as predicted. Resolved with one EXEMPT entry citing ① ruled A; exit 0, and its self-test exit 0."
},
"compile_surfaces": {
"1 driver-sql applyFilterCondition": "changed here",
"2 Turso RemoteTransport.buildWhereSQL": "changed here",
"3 service-analytics compileScopedFilterToSql": "out of scope (step 5, #35874)",
"4 service-analytics lowerAnalyticsWhere": "out of scope (step 5)",
"5 formula matchesFilterCondition": "already compliant by step 2's seam: objectql fixed-read-leaf-position.ts collectFixedReadLeaves refuses a leaf in having and aggregations[i].filter (INTERNAL_ERROR / 500) before in-memory evaluation, and having-filter.ts is the engine's only caller of the matcher; unchanged",
"half objectql applyHaving/matchesHaving": "already compliant by step 2's seam (the leaf is legal only in a read's where, never in having); unchanged",
"6 driver-memory": "out of scope (step 4, #35873)",
"7 driver-mongodb translateFieldOperators": "out of scope (step 5)"
},
"per_dialect": {
"sqlite": "live: the whole suite, plus an INTEGER outer key with the same rows as the list ('07' matches 7, via column affinity)",
"postgresql_16": "live: the whole suite except the INTEGER key. A non-string outer key does not keep the same rows (42883): open question 1",
"mysql": "compiled SQL and bindings pinned; live cell in the suite, run by CI Temporal Conformance after merge; no server here",
"mssql": "compiled SQL and bindings pinned",
"oracle": "compiled SQL and bindings pinned, without the empty-string half",
"turso_local": "live (libsql)",
"turso_remote": "live, against the in-process HTTP stub backed by SQLite; statement pinned at execute",
"sqlite_wasm": "inherits; ad hoc 14/14 shared cases"
},
"o3": "See out_of_scope_findings[0]. Index not edited.",
"d6": "Today's statement comes from the bench's --sql-log: 'owner_id = ?' with no grants. The leaf statement is '(owner_id = ?) or (id in inner read)'. Median of 15 runs (100k) or 9 runs (1M) after one warmup, on a shared box, plans from EXPLAIN. SQLite: the owner index still serves page and total (MULTI-INDEX OR); page x0.86-x1.34 (0.164 -> 0.190 ms up to 1.825 -> 1.954 ms); total 0.015-0.051 -> 0.047-0.123 ms (x1.8-x3.1). PostgreSQL 16: the owner index is no longer used. The page walks idx_bench_account_created_at_id backward with the OR as a filter (x0.65-x1.19). The total goes from a Bitmap Index Scan on idx_bench_account_owner_id to a Seq Scan on bench_account: x1.55-x2.5 at 1,000 accounts, x2.1-x6.0 at 10,000."
}
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz
os-dev-report
{
"round": "patch round 1",
"answers": "L1 REWORK comment 7046597905 on PR 35893, and the coordinator's patch round 1",
"issue": 35872,
"status": "done",
"branch": "claude/project-thread-thptm0",
"pr": "#35893",
"session": "session_01L9qibyXo4gSy8DJPNz4ANz",
"head_sha": "71324295d471099c8ab8926e1b44ddace72ce7ae",
"premise_still_valid": true,
"summary": "One new commit, 7132429. It touches only .changeset/35872-shared-record-ids-sql-compile.md: the code is byte-identical to 9a099c3 (git diff --stat 9a099c3 7132429 is 1 file, +1/-1). The changeset now says plainly which dialects were run live (SQLite and PostgreSQL), which are pinned at compile shape (MySQL, SQL Server, Oracle; MySQL also runs live in CI's Temporal Conformance job), and names the open case. On PostgreSQL, an object whose id column is not text (an integer- or uuid-keyed federated table) fails the compiled subquery with DATABASE_ERROR (42883). That case is open on #35906 (ADR-0155 D-0) and is settled before the sharing plugin writes the leaf. No sentence claims that every dialect answers today's rows for every key type. The PR body was rewritten through the relay issue_patch, attribution lines first and the signed trailer last, and read back identical (22162 bytes sent and stored). Its closing line is now Fixes #35872, followed by a sentence saying the O2 non-text-key item moved to decision card #35906. Acceptance notes point the O2 PostgreSQL item at #35906. The last line of the maintainer quick-read now says the open question sits on its own decision card. The Ablation section holds (a) through (d) as a table plus a details block. A round-1 gates block was added. The O3 and D6 readings are unchanged. check-closing-keyword-parity --body on the new body binds Fixes #35872 only.",
"tests": {
"setup": "All runs at 7132429 through os-verify-lock (slot os-dev-35872), heap 4096. The SQL suite ran with live SQLite plus live PostgreSQL 16 on a private local cluster (OS_TEST_POSTGRES_URL set; server TimeZone Asia/Shanghai), plus the 5 compile-shape pins. The skip is the MySQL cell. The Turso suite ran both faces. Baselines before any mutation: SQL Tests 78 passed | 1 skipped (79); Turso Tests 54 passed (54).",
"method": "Every mutation was made after the code was committed, through node scripts/ablation-replace.mjs. Each landing was proven by the anchor count falling 1 to 0 and the blob changing. Each restore was proven by the restored blob equalling the HEAD blob and git diff HEAD printing nothing. Each count was predicted before its run.",
"a_leaf_dropped": "Delete the whereIn line of the $in arm in sql-driver-filter-helpers.ts, so the leaf compiles to nothing. Predicted 50 failed | 28 passed | 1 skipped. Observed Tests 50 failed | 28 passed | 1 skipped (79), VERDICT command-exit 1. Red: 23 on sqlite, 22 on pg and all 5 compile-shape pins. The 23 on sqlite are 11 of 14 shared cases, aggregate, both write cases, the tenant write, freshness, the three N4 tests, the three O2 tests and the statement pin. The pg cell has one fewer O2 test. The D-0 list, $and with id d2 and readScope u3 stay green. A dropped disjunct narrows an $or, so the nested case answers [n2]. Restore blob 8dbf613e04b1, git diff HEAD empty.",
"a_leaf_as_true": "L1's literal reading, 'treated as no restriction': the arm compiles to 1 = 1 (whereRaw, or orWhereRaw inside an $or). Predicted 52 failed | 26 passed | 1 skipped. Observed Tests 52 failed | 26 passed | 1 skipped (79). Red: 24 on sqlite, 23 on pg and 5 compile-shape. That is (a)'s set plus readScope u3. The nested case answers [n1, n2, n3, n5]: n3 too, as L1 and the case's note predict. My row-level prediction also included n4, which was wrong, because n4 names no record. The count prediction was exact. Restore blob 8dbf613e04b1, git diff HEAD empty.",
"b_tenant_on_inner_read_sql": "At the $in arm, AND organization_id = options.tenantId onto fixedReadLeafSubquery's builder. options is threaded into nested ReadableIds scopes, so the nested position is mutated too. Predicted 10 failed | 68 passed | 1 skipped. Observed Tests 10 failed | 68 passed | 1 skipped (79). Red on each live cell: the tenant direct case (g7, stamped org_b), nested under tenant, aggregate under org_a, the tenant write and the statement pin. Compile-shape stays green, as predicted. Restore blob 8dbf613e04b1, git diff HEAD empty.",
"b_tenant_on_inner_read_turso_remote": "Two anchors in remote-transport.ts, the first held with --hold behind a bash trap restore. scopedWhereSQL hands its RemoteTenantScope to fixedInnerReadSQL for the length of one compile, and that call appends the scope inside the subquery. Turso's tests import remote-transport from src, and the red run proves the mutation was live. Predicted 4 failed | 50 passed. Observed Tests 4 failed | 50 passed (54). Red on the remote face only: the tenant direct case, nested under tenant, the tenant write and the transport statement pin. Restore blob bfafe299e93e, git diff HEAD empty; the trap's second restore was idempotent.",
"c_misplacement_walk_null_sql": "Insert if ((globalThis as any).ABLATION_C_SKIP_WALK !== 0) return null; at the head of findMisplacedFixedReadLeaf, held. Predicted 18 failed | 60 passed | 1 skipped. Observed Tests 18 failed | 60 passed | 1 skipped (79). Red on each live cell: the 7 misplaced-position pins, the message pin and log-once. No pin resolved with rows. Every printed failure is an envelope mismatch: another refusal (a list-operator, comparison or field refusal) or a database error, where INTERNAL_ERROR / 500 was expected.",
"c_misplacement_walk_null_turso": "Same held mutation. driver-sql was rebuilt (VERDICT command-exit 0). ablation-dist-preflight @objectstack/driver-sql ABLATION_C_SKIP_WALK exited 0, with hits in dist/index.js and dist/index.mjs. Predicted 13 failed | 41 passed. Observed Tests 13 failed | 41 passed (54). Red: the 4 misplaced pins and the message pin on each face, log-once on both faces, and the standalone RemoteTransport pin. Restore: blob ea97d9f49ecb equals HEAD and git diff HEAD is empty. driver-sql was rebuilt, and ablation-dist-preflight --absent exited 0: the marker is absent from all 6 built files and the tree is clean. The Turso suite then ran 54 passed (54) again.",
"d_blank_guard_dropped": "Round 0's record at 9a099c3, kept as it was. Delete the notEmpty line of fixedReadLeafSubquery. Predicted 12 red. Observed Tests 12 failed | 66 passed | 1 skipped (79). Red: the three N4 tests and the bindings pin on each live cell, plus the sqlite, pg, mysql and mssql compile-shape pins. L1 predicted that the shared case citing g10 goes red; it stays green, and the N4 tests carry the empty-id witness. Restore blob bd8d9c663c2c, git diff HEAD empty.",
"logs": "scratchpad issue-35872/abl-r1/ (base-sql, base-turso, a-sql, a2-sql, b-sql, b-turso, c, c-sql, c-turso, c-preflight-mut, c-preflight-absent, c-turso-after)"
},
"gates": {
"changed_path_local_at_71324295d": "dispatch-gates --repo objectstack-ai/objectstack matched 14 families through the changeset path, the only path round 1 changed. Each exit code was captured before any pipe. 13 exited 0: check:changeset-gate-self-tests, check:closed-ceremony-text, check:published-files, check-adr-0087-registration --base origin/main and --self-test, check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main and --self-test, the --self-test of snapshot-next, check-governed-queue-guard, release-rehearsal-clone and release-pending-publish, and check-governed-queue-guard --toolchain-needed. check-governed-queue-guard with no flag exited 1 ('could not read GITHUB_EVENT_PATH'): it reads only the workflow event payload. --ran classifies it, and the toolchain leg, as CI-measured only and outside the derived total. CI's Governed Surface Guard concluded success on this head. Outside the derivation, check-issue-citations and check-nul-bytes exited 0.",
"ran_reconciliation": "--ran on round 1's record alone: 114 derived, 12 run, 0 NOT-MEASURED, 102 UNRUN. The 102 read only paths that are byte-identical between 9a099c3 and 7132429. --ran on round 0's codes plus round 1's: 114 derived, 113 run, 1 NOT-MEASURED, 0 UNRUN. The NOT-MEASURED one is check:dual-build-cjs-loads (exit 3, PREREQUISITE NOT MET locally); CI built and ran Lint & Type Check green.",
"stale_tree_note": "dispatch-gates warned that the worktree is at least 5 commits behind origin/main, and that one gate file changed across that range (scripts/check-undeclared-dep-imports.mjs, a family that does not read the changeset). The branch was not merged with main in this round. CI judges the PR's merge ref.",
"ci_at_71324295d": "Concluded. 11 workflow runs, every one completed: CI, Lint & Type Check, PR Automation x2, PR-Body Guards x2, Governed Surface Guard, Spec Liveness Check and Docs Drift Check are success; Upgrade Harness and Pack Smoke (both opt-in) are skipped. Check-runs: 73 total, 60 success, 13 skipped, 0 failure. By name: Check Changeset 2/2 success, PR-body guards 2/2 success (the second pair re-ran on the body edit), Test Core 11/11, Test UI 17/17, Build Core 1/1, Type Check 5/5, Lint 9 success + 1 skipped (Lint UI), Governed 1/1. The 13 skipped are Auto Label, Check PR Size, Lint UI, Build Docs, UI Published Artifacts, Dogfood Regression Gate, Temporal Conformance (live PG + MySQL; push and schedule only), Dogfood Verify CLI, Borrowed queue verdict, Queue verdict, Schedule gate, and the two opt-in harnesses."
},
"dogfood_battery": "n/a: the PR title has no '!', and the claim's Clause-② line is 'yes', with no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "this round 2, cumulative 4. Round 1: issue_patch on PR 35893 through the relay (run 44790376036, read back identical) and this amendment comment through post-stamped. Round 0: pr_create and report comment 7046516194. git push 9a099c3..7132429 is not a REST write.",
"open_questions": [],
"deviations": "Ablation (a) ran twice. The plan's variant drops the leaf, which narrows a disjunct. The second variant compiles it as TRUE, which is L1's literal reading. Both records are kept. To match round 0's (d) population, a private PostgreSQL 16 cluster was re-created locally (port 55872); it is stopped at cleanup. CI was waited on in the foreground with gh run watch on the CI run (bounded by timeout 540), not with a background watcher.",
"security_findings": "none",
"out_of_scope_findings": ["unchanged from round 0's report (comment 7046516194). The O2 non-text-key item is no longer this card's: it is decision card #35906, which #33787 is Blocked-by."]
}
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz
Close-out: delivered by PR #35893, merged as 643fe3b · 2026-11-20T19:10Z
driver-sqlcompiles aSharedRecordIdsleaf in a field's$into one bound subquery oversys_record_share, with no tenant scope inside it (① A) andaccess_level IN (…)on the write form (③ A); Oracle drops the empty-string half. The Turso remote transport compiles the same subquery fromfixedInnerReadPredicates(exported bydriver-sql), also inside a resolvedReadableIdssemi-join scope.SqlDriver.supports.fixedReadLeaves = ['SharedRecordIds']landed in the same commit;SqliteWasmDriverandTursoDriver(both faces) inherit it. A leaf anywhere else is refused before any statement,INTERNAL_ERROR/500, logged once per driver. The predicate update's two statements are pinned (prior-row read andupdateMany, each evaluating the share arm, with freshness). The shared case-set gainsn5and a nested case under a tenant (step 1's L2 N4); the empty-id witnesses are driver-local.check:tenant-chokepointcarries oneEXEMPTentry citing ① A. Reviews: L1 REWORK 7046597905, delta ACCEPT 7047412922; L2 CONTRACT_REVIEW_TIER PASS 7047602668 (brief 7047621799), no must-fix, no should-fix. Declarations:Clause-②: yes,Metadata-protocol: none, patch on driver-sql, driver-turso, spec.idis integer or uuid (42883 where today's list answers the rows) is decision card [Decision] ADR-0155 O2: the share-grant subquery on PostgreSQL for an object whose id is not text (integer, uuid) #35906 (D-0); plugin-sharing: a member with more than 5000 share grants on one object silently loses access to the grants past 5000 (list misses rows, GET answers 404) #33787 carriesBlocked-by: #35906.INTERNAL_ERROR/500), andfixedInnerReadPredicatesis the one source of the inner read's predicates for any further SQL compiler (the analytics native compiler included) instead of a restatement.id = ANY(ARRAY(SELECT …))that may keep the owner index but sits outside D2's stated SQL (maintainer's to weigh). [Decision] ADR-0155 O2: the share-grant subquery on PostgreSQL for an object whose id is not text (integer, uuid) #35906's ruling before the leaf is written. L2 ③: O2 on MySQL, SQL Server and Oracle (RAW(16)) is unmeasured; [Decision] ADR-0155 O2: the share-grant subquery on PostgreSQL for an object whose id is not text (integer, uuid) #35906 or a card beside it owns them before step 6 is cut. The MySQL live cell runs only in CI's Temporal Conformance (push/schedule).(object_name, recipient_type, recipient_id, record_id)index makes the inner read index-only; noise at 900 grants, about ×2 at 9,000; one PG plan flip in the nested position (250.1 ms vs 12.8 ms covering vs 10.6 ms today's list, single observation). Recorded in the PR body.EXEMPTentries have no liveness check (the gate owner's); N3 thefixedReadLeavescomment insql-driver.tssays "every dialect" without naming [Decision] ADR-0155 O2: the share-grant subquery on PostgreSQL for an object whose id is not text (integer, uuid) #35906's class (fold into the card that lands [Decision] ADR-0155 O2: the share-grant subquery on PostgreSQL for an object whose id is not text (integer, uuid) #35906's ruling); N4 the misplacement walk runs once perapplyFilterslevel (linear).Fixes;pm:dispatchedremoved with this comment.