You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
aggregate_records with a 4-hop dotted groupBy (purchase_order.requisition.requester.department.name) answers 500 DATABASE_ERROR instead of a 4xx #34886
In the scenario half of qa#1 routine round 2 (requisition_to_receipt ordered_by_department, Run and Iterate, subject f6f5b50a), the MCP tool aggregate_records on a child object, with groupBypurchase_order.requisition.requester.department.name, answered 500 DATABASE_ERROR. The agent recovered on its own, so no check failed.
Repro:aggregate_records on a child object with a 4-hop dotted groupBy path.
Expected: either the grouping works, or the door refuses the path with a 4xx that names the hop limit or the unsupported path, so an MCP agent can change its approach. Related closed cards on dimensions through lookups, all different shapes: #33664, #29304, #21232.
Found by: qa#1 routine round 2, scenario half (round record on #31433).
First touch (R1198, 15:5xZ): p2 · domain:server → pm:queue.
Theme: MCP. A 4-hop dotted groupBy answers 500 instead of a 4xx naming the limit, so an MCP agent cannot change its approach. No named customer effect, so p2.
Claim: PM loop round 10 · area data-1 (the maintainer, verbatim, 2026-11-19T04:35Z project chat: 「再开 area:data」; standing 「暂时都只派 p1 p2 的卡」) · 2026-11-19T09:31Z
Area: data-1
Session: session_01Utp6Ca1jJvsA1dHsPwMiQb
Account: os-bill
Branch: claude/issue-34886-deep-groupby-refusal
Worktree: objectstack-issue-34886 (os-dev worktree in the data-1 container)
Domain: domain:server
Seat: repo:objectstack#5
File surface: located by the dev's re-measure. The dotted-groupBy resolution for aggregate in packages/objectql/src/** (⛔ excluding engine-insert.ts and engine-delete-and-aggregate.ts, which open PR #35386 holds; stop and report if the fix needs them), the SQL driver's groupBy join builder under packages/plugins/driver-sql/src/**, the MCP aggregate_records door's refusal mapping if the 4xx is shaped there; a new test named for this card; root .changeset/. Stop on breach and report.
Container & model: M, mode:subagent, model: default — no path-derived mandate, effort: high
Clause-②: no (a 500 becomes a typed 4xx refusal or a working grouping; measure on the diff)
Metadata-protocol: none
Responsibility: platform — aggregate_records with a 4-hop dotted groupBy (purchase_order.requisition.requester.department.name) answered 500 DATABASE_ERROR, so an MCP agent can't tell it should change approach; every MCP/REST caller grouping across deep lookups.
Thread-read: 6953040589
Premise: unmeasured on current main. The dev re-measures first; if a 4-hop groupBy no longer 500s on origin/main, the dev stops and reports with the reading (the card then closes as not reproducible).
Serial constraints cleared: no open data-1 claim holds the dotted-path or driver-sql groupBy files; #35386 holds engine-delete-and-aggregate.ts (excluded above).
Pre-claim lane: domain:server (packages/objectql/**, packages/plugins/driver-sql/**)
Pre-claim deps: none. Related closed cards #33664, #29304, #21232 (different shapes; dev reads them).
Prior rulings read: check-prior-rulings 146 ADR candidates, none on a groupBy hop limit (top: ADR-0029 D9.7, ADR-0041 §4, ADR-0103 D3, ADR-0130 D8); thread: 1 (triage p2)
{
"issue": 34886,
"status": "done",
"branch": "claude/issue-34886-deep-groupby-refusal",
"pr": "https://github.com/objectstack-ai/objectstack/pull/35479",
"session": "session_01Utp6Ca1jJvsA1dHsPwMiQb",
"premise_still_valid": true,
"a0_reading": "REPRODUCED on origin/main b3247ddbdc. Driver level, SqlDriver on SQLite: groupBy 'nosuch', 1 hop and 2 hops answered INVALID_FIELD/400 (the missing-column backstop, no path). 3 hops and 4 hops answered DATABASE_ERROR/500. MCP-bridge level (buildMcpBridge -> callData -> real ObjectQL -> real SqlDriver, new test at 6f8c1651b9 against main's objectql): purchase_order.requisition.requester.department.name -> DATABASE_ERROR/500. The 1-hop case was 400 only after the statement ran. PostgreSQL cell NOT MEASURED (no live PG in this container).",
"summary": "Took the refusal arm. engine.aggregate's existing groupBy door (assertGroupByTargetsAreStored, aggregate-query-shape-door.ts; engine-delete-and-aggregate.ts untouched) now refuses a groupBy entry naming a dotted path the object does not declare, in the name form or the {field} form. The answer is INVALID_FIELD/400 at groupBy.N or groupBy.N.field, with field = the path. The message names the path, its depth in relation hops and the depth groupBy serves (0 hops), and when the head is a reference field it tells the caller to group by that field or to aggregate the related object. This is the REST door's existing rule (assertGroupByFieldsExist), held at the engine for the MCP bridge and other callers that bypass that door. No statement reaches the database, and genuine driver faults keep DATABASE_ERROR/500.",
"tests": "New packages/runtime/src/mcp-aggregate-relation-path-group-by.test.ts (HTTP MCP bridge + real ObjectQL + real SqlDriver/SQLite). Pins: 4/3/1 hops refused {code INVALID_FIELD, status 400, field PATH, path groupBy.0}, with zero GROUP BY statements run. The object form is refused at groupBy.1.field. aggregateGroups (orderBy/limit) is refused the same way. CONTROL: groupBy ['purchase_order'] is served by 1 statement. On main code: Tests 5 failed | 1 passed (6). Ablation at 338e378846 via ablation-replace.mjs (anchor 1->0, blob 003067de->fe264256, objectql rebuilt, dist-preflight marker present in 4 files): Tests 5 failed | 1 passed (CONTROL). Restore: blob == HEAD, git diff HEAD empty, rebuild, --absent: 0 of 14 files and the tree clean, then 6/6. Final head 1af59bd01f, one locked run: objectql test Test Files 615 passed (615), Tests 13888 passed (13888); objectql typecheck exit 0; runtime vitest on the new file + mcp-aggregate-order-cut.test.ts 15/15; runtime typecheck exit 0; VERDICT command-exit 0. An earlier full objectql run at 12e7094169 had 1 failure (federated-injected-column-readers: referenceTargetOf is a ledgered seam). It was fixed by reading the head's declared type against REFERENCE_VALUE_TYPES. Full runtime suite and test:repo were not run locally and are declared to CI.",
"gates": "Local, at final head 1af59bd01f: dispatch-gates --commands derived 66 and all 66 ran with exit 0. --ran reconciliation: '66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN' (a derived zero; every line carries an exit code). At pre-merge b3531dac68, check:dual-build-cjs-loads exited 3 (PREREQUISITE NOT MET) and was re-run green at the final head. eslint --no-inline-config on both changed files: exit 0. overlap-check --branch=HEAD: VERDICT clean exit 0. CI at PR open: every gate-carrying check-run was in_progress (Check Changeset, Lint x8, Type Check x4, Governed Surface Queue Guard, PR-body guards), plus opt-in and queue-only checks skipped. No conclusion yet.",
"dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
"line_budget": "n/a — no skills/** or ratcheted ledger touched; diff 3 files +196/-2",
"files_changed": [
".changeset/34886-group-by-relation-path-refusal.md",
"packages/objectql/src/aggregate-query-shape-door.ts",
"packages/runtime/src/mcp-aggregate-relation-path-group-by.test.ts"
],
"head": "1af59bd01f394549873875423019680a2aa86203",
"a1_reading": "No hop limit is declared for the public groupBy. Its depth is 0 by the REST door (protocol-query-validation assertGroupByFieldsExist: 'a related record's column cannot be a grouping target'). The MCP bridge reaches engine.aggregate via callData past that door. assertGroupByTargetsAreStored skipped undeclared names, so the dotted name reached driver-sql as a qualified identifier. SQLite's no-such-column parse attributed 1-2 hops; 3+ fell to the terminal DATABASE_ERROR.",
"a2_reading": "The related cards' mechanism (RELATION_GROUP_BY / relation-group-join.ts) is an engine-internal symbol-keyed ONE-hop request used by the analytics strategy, not a public groupBy key. Extending it to N hops would widen the public vocabulary, so the PR refuses instead, as the ruling's second arm allows.",
"a3_reading": "driver-sql's aggregateBackendFault / DATABASE_ERROR mapping is untouched. The path is refused before the driver runs, so a genuine driver error still answers 500.",
"deviations": [
"os-dev.md six-line 维护者速读 (with a 先看 line naming files) was followed over the dispatch's '≤4 lines, no paths' rule (seat-practice.md §1). os-dev.md says it wins on conflict; flagged here rather than choosing silently.",
"The claim's file surface names packages/plugins/driver-sql/src/**; the driver is at packages/drivers/driver-sql and was not touched. The new test sits in packages/runtime (the only package with the MCP bridge, the engine and SqlDriver together), read as 'a new test named for this card'.",
"Commit trailers are spelled 'Co-authored-by: Claude' (the AGENTS.md form, model-free) rather than the dispatch's 'Co-Authored-By' casing.",
"The first local gate sweep was cut at 580s by my own timeout after 48 of 66 commands; the rest were run separately. The final-head sweep ran all 66.",
"Merged origin/main (a1b14cdff8) into the branch before opening the PR (AGENTS §10), because incoming commits touched objectql's aggregate doors."
],
"mcp_calls": "0",
"api_writes": "2 — fleet-write relay: pr_create (POST /repos/objectstack-ai/objectstack/pulls + its assignees leg, run 44512831352); post-stamped os-dev-report comment on #34886 (POST /repos/objectstack-ai/objectstack/issues/34886/comments). Plus git push (not REST).",
"open_questions": [
{
"question": "Which form does the PR body's 维护者速读 take when the dispatch (≤4 lines, no paths) and os-dev.md (six fixed lines, 先看 names files) disagree?",
"options": [
"A: os-dev.md six lines (taken)",
"B: the dispatch's four lines; reword the PR body in a seat edit"
],
"recommendation": "A for this PR, because os-dev.md says it wins on conflict. Reconcile the two texts in one place."
}
],
"security_findings": "none",
"out_of_scope_findings": [],
"dedupe_words": [
"groupBy dotted path",
"aggregate_records DATABASE_ERROR",
"relation hop groupBy",
"INVALID_FIELD groupBy relation"
]
}
{
"issue": 34886,
"status": "done",
"branch": "claude/issue-34886-deep-groupby-refusal",
"pr": "https://github.com/objectstack-ai/objectstack/pull/35479",
"session": "session_01Utp6Ca1jJvsA1dHsPwMiQb",
"premise_still_valid": true,
"a0_reading": "REPRODUCED on origin/main b3247ddbdc. Driver level, SqlDriver on SQLite: groupBy 'nosuch', 1 hop and 2 hops answered INVALID_FIELD/400 (the missing-column backstop, no path). 3 hops and 4 hops answered DATABASE_ERROR/500. MCP-bridge level (buildMcpBridge -> callData -> real ObjectQL -> real SqlDriver, new test at 6f8c1651b9 against main's objectql): purchase_order.requisition.requester.department.name -> DATABASE_ERROR/500. The 1-hop case was 400 only after the statement ran. PostgreSQL cell NOT MEASURED (no live PG in this container).",
"summary": "Fix round 1. R1: the changeset and the PR body now declare 'Clause-②: no (narrowing)', with 'Metadata-protocol: none' at patch. Both carry a **BREAKING** line: a dotted groupBy reaching engine.aggregate past the REST door is now refused where it used to answer. It ships patch as a non-protocol breaking change. The changeset holds exactly one ADR-0087 marker, not-required (no-migration-prescription). R2 was measured and closes with no code change: an own-qualified analytics dimension never reaches the engine door dotted. Undeclared, the analytics door refuses it 400 before any strategy runs; declared, the qualifier is stripped. Code is unchanged since 1af59bd01f; the only file the round touched is the changeset. Original fix: engine.aggregate's groupBy door (assertGroupByTargetsAreStored) refuses a dotted path the object does not declare with INVALID_FIELD/400 at groupBy.N or groupBy.N.field, naming the path, its hop depth and the 0-hop limit.",
"tests": "Fix round 1 changed no code or test. R2 probe readings are in r2_reading. Prior, at 1af59bd01f (same code): objectql test 615/615 files and 13888/13888 tests; objectql and runtime typecheck exit 0; the new runtime file plus mcp-aggregate-order-cut 15/15. The new pin file is 5 failed / 1 passed on main code. The ablation at 338e378846 went red 5/1 and was restored with blob == HEAD, rebuilt, and --absent clean.",
"gates": "Fix round at 874d01cae4: 'node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0', verdict line: \"✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition.\" Its row: \".changeset/34886-group-by-relation-path-refusal.md [BREAKING+clause-②-narrowing] not-required (no-migration-prescription)\". Also exit 0: check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main, check:changeset-gate-self-tests, check:nul-bytes, check:doc-authoring. overlap-check --branch=HEAD: VERDICT clean exit 0. At 1af59bd01f, 66 derived families ran, all exit 0, with --ran '66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN'. CI at 874d01cae4 when read: success=37, skipped=18, in_progress=2 (Check Changeset, and the PR-body guards re-running after the body edit), failure=0.",
"dogfood_battery": "874d01cae499de151b1d58c4993048873639bc7a · os-verify-lock: VERDICT command-exit 0 (held 2280s) · pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test, no OS_TEST_SHARD, no path · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · 0 failures",
"line_budget": "n/a — no skills/** or ratcheted ledger touched; diff vs main 3 files (changeset grew by the BREAKING line and the ADR-0087 marker)",
"files_changed": [
".changeset/34886-group-by-relation-path-refusal.md",
"packages/objectql/src/aggregate-query-shape-door.ts",
"packages/runtime/src/mcp-aggregate-relation-path-group-by.test.ts"
],
"head": "874d01cae499de151b1d58c4993048873639bc7a",
"a1_reading": "No hop limit is declared for the public groupBy. Its depth is 0 by the REST door (protocol-query-validation assertGroupByFieldsExist: 'a related record's column cannot be a grouping target'). The MCP bridge reaches engine.aggregate via callData past that door. assertGroupByTargetsAreStored skipped undeclared names, so the dotted name reached driver-sql as a qualified identifier. SQLite's no-such-column parse attributed 1-2 hops; 3+ fell to the terminal DATABASE_ERROR.",
"a2_reading": "The related cards' mechanism (RELATION_GROUP_BY / relation-group-join.ts) is an engine-internal symbol-keyed ONE-hop request used by the analytics strategy, not a public groupBy key. Extending it to N hops would widen the public vocabulary, so the PR refuses instead, as the ruling's second arm allows.",
"a3_reading": "driver-sql's aggregateBackendFault / DATABASE_ERROR mapping is untouched. The path is refused before the driver runs, so a genuine driver error still answers 500.",
"deviations": [
"The PR body carries the ADR-0087 disposition in words, not as the marker itself: os-dev.md forbids HTML comments in GitHub text. The marker lives in the changeset, where the gate reads it.",
"For the R2 main reading, main's aggregate-query-shape-door.ts was restored into the tree unstaged (git restore --source=a1b14cdff8). After the run it was restored from HEAD, and git diff HEAD was empty before the commit.",
"The R2 probe's 'objectql-only' composition (data service with execute hidden) did not remove the native strategy. Its ObjectQL-strategy cells are the month-bucket ones, which the native strategy declines.",
"Two R2 probe runs queue-timed out (exit 99) behind a sibling's dogfood run. The third, under the same slot, ran.",
"Earlier (round 0): the maintainer brief form was resolved by the coordinator as B (seat-practice.md §1), and the PR body was rewritten through post-stamped --body."
],
"mcp_calls": "0",
"api_writes": "Fix round: 2 — post-stamped --body=35479 (PATCH /repos/objectstack-ai/objectstack/issues/35479, relay run 44528570377, 11176/11176 bytes identical, --ack-through=7008122771 after reading it in full); this os-dev-report comment on #34886 (POST /repos/objectstack-ai/objectstack/issues/34886/comments). Plus git push of 874d01cae4 (not REST).",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [],
"dedupe_words": [
"groupBy dotted path",
"aggregate_records DATABASE_ERROR",
"relation hop groupBy",
"INVALID_FIELD groupBy relation"
],
"round": "fix round 1 (L1-a comment 7008122771: R1 + R2)",
"r2_reading": "Probe: real ObjectQL + SqlDriver/SQLite + AnalyticsServicePlugin + dispatcher POST /api/v1/analytics/query, counting engine.aggregate calls; deleted after the run, not in the diff. Main a1b14cdff8 (main's door restored into the tree, closure rebuilt): dimensions ['CUBE.region'] and ['OBJECT.region'], region a field the cube does not declare, each answered 400 INVALID_FIELD from the analytics door (\"Dimension 'CUBE.region' on cube 'CUBE' walks relationship 'CUBE' (path 'CUBE') ...\"). engine.aggregate was called 0 times. The same holds with a month timeDimension (ObjectQL-strategy route). Head (this door, objectql rebuilt, dist-preflight marker present in 4 files): identical answers for the same four queries, engine.aggregate 0 calls. CONTROL on head: a declared member behind the cube's or the object's qualifier, with a month bucket, is served by the ObjectQL strategy with the qualifier stripped. engine.aggregate groupBy was ['stage', {field:'closed_on', dateGranularity:'month'}], answering 200 with counts a=2, b=1. Verdict: refused before the engine, or stripped; R2 closes and is recorded in the PR's Acceptance notes."
}
{
"issue": 34886,
"status": "done",
"branch": "claude/issue-34886-deep-groupby-refusal",
"pr": "https://github.com/objectstack-ai/objectstack/pull/35479",
"session": "session_01Utp6Ca1jJvsA1dHsPwMiQb",
"premise_still_valid": true,
"a0_reading": "REPRODUCED on origin/main b3247ddbdc. Driver level, SqlDriver on SQLite: groupBy 'nosuch', 1 hop and 2 hops answered INVALID_FIELD/400 (the missing-column backstop, no path). 3 hops and 4 hops answered DATABASE_ERROR/500. MCP-bridge level (buildMcpBridge -> callData -> real ObjectQL -> real SqlDriver, new test at 6f8c1651b9 against main's objectql): purchase_order.requisition.requester.department.name -> DATABASE_ERROR/500. The 1-hop case was 400 only after the statement ran. PostgreSQL cell NOT MEASURED (no live PG in this container).",
"summary": "Fix round 2. S1(a): two pins enter the non-relation arm, `address.city` (a declared JSON head) and `rp_po_line.amount` (the object's own name as a qualifier, an undeclared head); each is refused INVALID_FIELD/400 at groupBy.0 with zero statements run, and both went red under ablation. S1(b): the refusal picks its wording by the head's declared type; a non-relation head gets no 'relation hops' wording (pinned with not.toMatch(/relation hop/)). S1(c): the BREAKING line in the changeset and the PR body names all three refused shapes and what each answered before, with no null-group claim for the JSON sub-path or the own-name qualifier. REWORK: the PR body carries 'Skills-docs: none — REASON'. N1 (multi-value lookup hint), N2 (shorter message, 260-339 chars) and N3 (aggregateGroups asserts path) are taken. The CI red on Test Core (7/10), @objectstack/scenarios#test, is not this change: it is a 5000 ms timeout in refresh.test.ts that also hits main's merge queue on PR #35459, and the case passes locally in about 0.5 s at both the head and the merge-base.",
"tests": "At e8b311e4c0 (code byte-identical to ce0a9509e5), one locked run, VERDICT command-exit 0: pnpm --filter @objectstack/objectql exec vitest run --project local --maxWorkers=2 -> Test Files 615 passed (615), Tests 13888 passed (13888); pnpm --filter @objectstack/objectql typecheck -> exit 0 ('check:test-typecheck: OK — @objectstack/objectql's test layer compiles'); pnpm --filter @objectstack/runtime typecheck -> exit 0 (test layer OK); pnpm --filter @objectstack/scenarios test -> 40/40 files, 1182/1182 tests (and the same at the merge-base). At ce0a9509e5: runtime src/mcp-aggregate-relation-path-group-by.test.ts + src/mcp-aggregate-order-cut.test.ts -> Test Files 2 passed (2), Tests 17 passed (17), VERDICT command-exit 0. Ablation: see the ablation field. Not run locally: the full runtime suite and test:repo, declared to CI (Test Core).",
"gates": "Local, at e8b311e4c0: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 66; all 66 run, 65 exit 0. check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET (no dist/ for studio, client-react, embedder-openai, knowledge-memory, knowledge-ragflow, service-knowledge), so NOT MEASURED; it was exit 0 at 1af59bd01f. --ran: '✓ dispatch-gates --ran: 66 derived famil(ies) accounted for — 65 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).' check-adr-0087-registration --base origin/main exit 0: '✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition.' overlap-check --branch=HEAD: VERDICT clean exit 0. CI at e8b311e4c0 (run 44540499020): Test Core (7/10) failure, the refresh.test.ts timeout above (not ours); the other check-runs were not re-read for this report and are in_progress/as CI shows.",
"dogfood_battery": "e8b311e4c0 · os-verify-lock: VERDICT command-exit 0 (pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test, no OS_TEST_SHARD, no path) · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · no failures",
"line_budget": "n/a — no skills/** or ratcheted ledger touched; diff vs main 3 files (changeset grew by the BREAKING line and the ADR-0087 marker)",
"files_changed": [
".changeset/34886-group-by-relation-path-refusal.md",
"packages/objectql/src/aggregate-query-shape-door.ts",
"packages/runtime/src/mcp-aggregate-relation-path-group-by.test.ts"
],
"head": "e8b311e4c0",
"a1_reading": "No hop limit is declared for the public groupBy. Its depth is 0 by the REST door (protocol-query-validation assertGroupByFieldsExist: 'a related record's column cannot be a grouping target'). The MCP bridge reaches engine.aggregate via callData past that door. assertGroupByTargetsAreStored skipped undeclared names, so the dotted name reached driver-sql as a qualified identifier. SQLite's no-such-column parse attributed 1-2 hops; 3+ fell to the terminal DATABASE_ERROR.",
"a2_reading": "The related cards' mechanism (RELATION_GROUP_BY / relation-group-join.ts) is an engine-internal symbol-keyed ONE-hop request used by the analytics strategy, not a public groupBy key. Extending it to N hops would widen the public vocabulary, so the PR refuses instead, as the ruling's second arm allows.",
"a3_reading": "driver-sql's aggregateBackendFault / DATABASE_ERROR mapping is untouched. The path is refused before the driver runs, so a genuine driver error still answers 500.",
"deviations": [
"The first push of the changeset commit was refused by check:commit-card-trailers: my co-author trailer named a model. The commit was unpublished, so I amended it to the model-free pair (Claude, at the noreply anthropic.com address, no model name) and pushed e8b311e4c0. Nothing published was rewritten.",
"For the base scenarios leg, I restored the merge-base door file into my worktree, not a separate checkout at a1b14cdff8. The other two diff files are a runtime test and the changeset, which scenarios does not read. Restore proof: blob == HEAD, empty git diff HEAD, rebuild, marker present again.",
"The seat's L1-a correction 7011563941 says the battery is recorded at e8b311e4c0 in 7010069867. At that time the last battery had run at 874d01cae4. The battery at e8b311e4c0 is the one in this report. Noted, not corrected: not my record.",
"The 4-line 维护者速读 is kept verbatim, as ordered. It describes relation-path grouping only; the widened refused set is in the BREAKING line and What changes."
],
"mcp_calls": 0,
"api_writes": "Fix round 2: 2. post-stamped --body=35479 (PATCH /repos/objectstack-ai/objectstack/issues/35479, relay run 44557488604, 15370/15370 bytes identical, --ack-through=7011563941 after reading it in full); this os-dev-report comment on #34886 (POST /repos/objectstack-ai/objectstack/issues/34886/comments). Plus git push of e8b311e4c0 (not REST). Read-only REST: the two failing CI job logs and the merge-queue job logs cited above.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none · noted in the PR's Acceptance notes, not filed: scenarios test/export/refresh.test.ts 'does not skip when one listed app is on an older version…' runs about 0.5 s locally but 5.0–5.7 s on CI shards and times out at vitest's 5000 ms default. Seen 4 times on 2026-11-19 (2 on this PR, 2 in main's merge queue for #35459). It is a CI timing margin, not a reproducible defect class (a/b/c), so it is not filed."
],
"dedupe_words": [
"groupBy dotted path",
"aggregate_records DATABASE_ERROR",
"groupBy own-name qualifier",
"refresh.test.ts timed out 5000ms"
],
"round": "fix round 2 (L2 7010069867 S1 + REWORK + N1-N3), plus the CI scenarios red",
"r2_reading": "Probe: real ObjectQL + SqlDriver/SQLite + AnalyticsServicePlugin + dispatcher POST /api/v1/analytics/query, counting engine.aggregate calls; deleted after the run, not in the diff. Main a1b14cdff8 (main's door restored into the tree, closure rebuilt): dimensions ['CUBE.region'] and ['OBJECT.region'], region a field the cube does not declare, each answered 400 INVALID_FIELD from the analytics door (\"Dimension 'CUBE.region' on cube 'CUBE' walks relationship 'CUBE' (path 'CUBE') ...\"). engine.aggregate was called 0 times. The same holds with a month timeDimension (ObjectQL-strategy route). Head (this door, objectql rebuilt, dist-preflight marker present in 4 files): identical answers for the same four queries, engine.aggregate 0 calls. CONTROL on head: a declared member behind the cube's or the object's qualifier, with a month bucket, is served by the ObjectQL strategy with the qualifier stripped. engine.aggregate groupBy was ['stage', {field:'closed_on', dateGranularity:'month'}], answering 200 with counts a=2, b=1. Verdict: refused before the engine, or stripped; R2 closes and is recorded in the PR's Acceptance notes.",
"pins_added": [
"it.each 'a path into a stored value (a json head)': groupBy ['address.city'] -> {code:'INVALID_FIELD',status:400,field:'address.city',path:'groupBy.0'}, message names the path, not.toMatch(/relation hop/), 0 statements",
"it.each 'the object's own name as a qualifier (no field by that name)': groupBy ['rp_po_line.amount'] -> same envelope at groupBy.0, no relation-hop wording, 0 statements",
"aggregateGroups (ordered and cut) case now asserts path:'groupBy.0' as well as code/status/field, 0 statements"
],
"ablation": "At ce0a9509e5 under the lock: ablation-replace.mjs swapped the arm's guard for `field === 'ABLATION_34886_R2'` (anchor x1->x0, blob 196c1d38->de7fae20); objectql rebuilt; ablation-dist-preflight found the marker in 4 dist files. The runtime file went 7 failed / 1 passed (the CONTROL). The JSON pin answered the driver backstop's INVALID_FIELD without path after the statement ran, and the own-name pin was answered ('expected the aggregate to be refused, but it answered'). Restore: git checkout HEAD -- FILE, blob == HEAD 196c1d38, git diff HEAD empty, rebuilt, preflight --absent 0 of 14 dist files, file 8/8 green.",
"scenarios_ci_reading": "NOT OURS. CI run 44531427092 job 135586800061 (ce0a9509e5) and run 44540499020 job 135618491647 (e8b311e4c0) both failed one case: test/export/refresh.test.ts > galleryRefresh — the quiet skip > does not skip when one listed app is on an older version, or when the index lists no app — 'Test timed out in 5000ms' (5493 ms and 5065 ms). The same case timed out in main's merge queue on runs without this change: 44530279296 job 135583056016 (5395 ms) and 44533961485 job 135595686454 (5714 ms), both for PR #35459, which changes only the seed loader. Local, under the lock: pnpm --filter @objectstack/scenarios test at e8b311e4c0 = Test Files 40 passed (40), Tests 1182 passed (1182); at the merge-base a1b14cdff8 (the door file restored to its base blob 99b3bf59, objectql rebuilt, marker absent 0 of 14 dist files; the other two diff files are a runtime test and the changeset, which scenarios does not read) = 40/40, 1182/1182. The case alone, verbose: 510 ms at the head, 532 ms at the base. The restore was proved by blob 196c1d38 == HEAD and an empty git diff HEAD, then a rebuild with the marker present again. The case loads objectql (src/score/scenario-tags.ts imports standaloneActionOwnerKey), but its app harness is a stub and aggregate never runs. An earlier local 2-failed reading at ce0a9509e5 was my own error: I built only the package's dependencies, so built-consumer.test.ts and packed-tarball.test.ts refused for a missing dist/; with the package built, 40/40.",
"skills_docs": "Skills-docs: none — no skill or docs page teaches a dotted engine or MCP groupBy entry: skills/objectstack-query teaches bare column names only, and the relationship.field dimensions in content/docs/data-modeling/analytics.mdx are the analytics cube surface, which this PR leaves as it was (R2). The refusal itself names the path and the fix."
}
Close-out 2026-11-19T16:36Z: PR #35479 merged, and Fixes closed this card.
Before this fix, a dotted groupBy entry that is not itself a field answered 500 DATABASE_ERROR or a misleading grouping. The engine's aggregate door now refuses it with INVALID_FIELD / 400 at groupBy.N, before any statement runs. The entry can take three shapes: a relation path such as the card's 4-hop path, a sub-path into a JSON field, or a qualifier using the object's own name. The refusal names the path, and its wording depends on what the head is: a relation counted in hops, a multi-value relation, or a non-relation field.
This is a narrowing: Clause-②: no (narrowing), BREAKING plus an ADR-0087 marker, Skills-docs: none. The dogfood battery ran green on the fix head.
L1-a ACCEPT, then the seat's contract review: round 1 7010069867, delta 7014726320 PASS. N4 is an accepted deviation: the multi-value relation sentence has no pin, because no fixture declares a multiple relation. pm:dispatched off.
Activity
objectstack-fleet commentedon Nov 17, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
First touch (R1198, 15:5xZ): p2 · domain:server →
pm:queue.Theme: MCP. A 4-hop dotted groupBy answers 500 instead of a 4xx naming the limit, so an MCP agent cannot change its approach. No named customer effect, so p2.
objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
Claim: PM loop round 10 · area data-1 (the maintainer, verbatim, 2026-11-19T04:35Z project chat: 「再开 area:data」; standing 「暂时都只派 p1 p2 的卡」) · 2026-11-19T09:31Z
Area: data-1
Session:
session_01Utp6Ca1jJvsA1dHsPwMiQbAccount:
os-billBranch:
claude/issue-34886-deep-groupby-refusalWorktree:
objectstack-issue-34886(os-dev worktree in the data-1 container)Domain:
domain:serverSeat:
repo:objectstack#5File surface: located by the dev's re-measure. The dotted-groupBy resolution for
aggregateinpackages/objectql/src/**(⛔ excludingengine-insert.tsandengine-delete-and-aggregate.ts, which open PR #35386 holds; stop and report if the fix needs them), the SQL driver's groupBy join builder underpackages/plugins/driver-sql/src/**, the MCPaggregate_recordsdoor's refusal mapping if the 4xx is shaped there; a new test named for this card; root.changeset/. Stop on breach and report.Container & model:
M,mode:subagent,model: default — no path-derived mandate,effort: highClause-②: no (a 500 becomes a typed 4xx refusal or a working grouping; measure on the diff)
Metadata-protocol: none
Responsibility: platform —
aggregate_recordswith a 4-hop dottedgroupBy(purchase_order.requisition.requester.department.name) answered500 DATABASE_ERROR, so an MCP agent can't tell it should change approach; every MCP/REST caller grouping across deep lookups.Thread-read: 6953040589
Premise: unmeasured on current main. The dev re-measures first; if a 4-hop groupBy no longer 500s on
origin/main, the dev stops and reports with the reading (the card then closes as not reproducible).Serial constraints cleared: no open data-1 claim holds the dotted-path or driver-sql groupBy files; #35386 holds
engine-delete-and-aggregate.ts(excluded above).Pre-claim lane:
domain:server(packages/objectql/**,packages/plugins/driver-sql/**)Pre-claim deps: none. Related closed cards #33664, #29304, #21232 (different shapes; dev reads them).
Prior rulings read: check-prior-rulings 146 ADR candidates, none on a groupBy hop limit (top: ADR-0029 D9.7, ADR-0041 §4, ADR-0103 D3, ADR-0130 D8); thread: 1 (triage p2)
objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
os-dev-report
{ "issue": 34886, "status": "done", "branch": "claude/issue-34886-deep-groupby-refusal", "pr": "https://github.com/objectstack-ai/objectstack/pull/35479", "session": "session_01Utp6Ca1jJvsA1dHsPwMiQb", "premise_still_valid": true, "a0_reading": "REPRODUCED on origin/main b3247ddbdc. Driver level, SqlDriver on SQLite: groupBy 'nosuch', 1 hop and 2 hops answered INVALID_FIELD/400 (the missing-column backstop, no path). 3 hops and 4 hops answered DATABASE_ERROR/500. MCP-bridge level (buildMcpBridge -> callData -> real ObjectQL -> real SqlDriver, new test at 6f8c1651b9 against main's objectql): purchase_order.requisition.requester.department.name -> DATABASE_ERROR/500. The 1-hop case was 400 only after the statement ran. PostgreSQL cell NOT MEASURED (no live PG in this container).", "summary": "Took the refusal arm. engine.aggregate's existing groupBy door (assertGroupByTargetsAreStored, aggregate-query-shape-door.ts; engine-delete-and-aggregate.ts untouched) now refuses a groupBy entry naming a dotted path the object does not declare, in the name form or the {field} form. The answer is INVALID_FIELD/400 at groupBy.N or groupBy.N.field, with field = the path. The message names the path, its depth in relation hops and the depth groupBy serves (0 hops), and when the head is a reference field it tells the caller to group by that field or to aggregate the related object. This is the REST door's existing rule (assertGroupByFieldsExist), held at the engine for the MCP bridge and other callers that bypass that door. No statement reaches the database, and genuine driver faults keep DATABASE_ERROR/500.", "tests": "New packages/runtime/src/mcp-aggregate-relation-path-group-by.test.ts (HTTP MCP bridge + real ObjectQL + real SqlDriver/SQLite). Pins: 4/3/1 hops refused {code INVALID_FIELD, status 400, field PATH, path groupBy.0}, with zero GROUP BY statements run. The object form is refused at groupBy.1.field. aggregateGroups (orderBy/limit) is refused the same way. CONTROL: groupBy ['purchase_order'] is served by 1 statement. On main code: Tests 5 failed | 1 passed (6). Ablation at 338e378846 via ablation-replace.mjs (anchor 1->0, blob 003067de->fe264256, objectql rebuilt, dist-preflight marker present in 4 files): Tests 5 failed | 1 passed (CONTROL). Restore: blob == HEAD, git diff HEAD empty, rebuild, --absent: 0 of 14 files and the tree clean, then 6/6. Final head 1af59bd01f, one locked run: objectql test Test Files 615 passed (615), Tests 13888 passed (13888); objectql typecheck exit 0; runtime vitest on the new file + mcp-aggregate-order-cut.test.ts 15/15; runtime typecheck exit 0; VERDICT command-exit 0. An earlier full objectql run at 12e7094169 had 1 failure (federated-injected-column-readers: referenceTargetOf is a ledgered seam). It was fixed by reading the head's declared type against REFERENCE_VALUE_TYPES. Full runtime suite and test:repo were not run locally and are declared to CI.", "gates": "Local, at final head 1af59bd01f: dispatch-gates --commands derived 66 and all 66 ran with exit 0. --ran reconciliation: '66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN' (a derived zero; every line carries an exit code). At pre-merge b3531dac68, check:dual-build-cjs-loads exited 3 (PREREQUISITE NOT MET) and was re-run green at the final head. eslint --no-inline-config on both changed files: exit 0. overlap-check --branch=HEAD: VERDICT clean exit 0. CI at PR open: every gate-carrying check-run was in_progress (Check Changeset, Lint x8, Type Check x4, Governed Surface Queue Guard, PR-body guards), plus opt-in and queue-only checks skipped. No conclusion yet.", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "line_budget": "n/a — no skills/** or ratcheted ledger touched; diff 3 files +196/-2", "files_changed": [ ".changeset/34886-group-by-relation-path-refusal.md", "packages/objectql/src/aggregate-query-shape-door.ts", "packages/runtime/src/mcp-aggregate-relation-path-group-by.test.ts" ], "head": "1af59bd01f394549873875423019680a2aa86203", "a1_reading": "No hop limit is declared for the public groupBy. Its depth is 0 by the REST door (protocol-query-validation assertGroupByFieldsExist: 'a related record's column cannot be a grouping target'). The MCP bridge reaches engine.aggregate via callData past that door. assertGroupByTargetsAreStored skipped undeclared names, so the dotted name reached driver-sql as a qualified identifier. SQLite's no-such-column parse attributed 1-2 hops; 3+ fell to the terminal DATABASE_ERROR.", "a2_reading": "The related cards' mechanism (RELATION_GROUP_BY / relation-group-join.ts) is an engine-internal symbol-keyed ONE-hop request used by the analytics strategy, not a public groupBy key. Extending it to N hops would widen the public vocabulary, so the PR refuses instead, as the ruling's second arm allows.", "a3_reading": "driver-sql's aggregateBackendFault / DATABASE_ERROR mapping is untouched. The path is refused before the driver runs, so a genuine driver error still answers 500.", "deviations": [ "os-dev.md six-line 维护者速读 (with a 先看 line naming files) was followed over the dispatch's '≤4 lines, no paths' rule (seat-practice.md §1). os-dev.md says it wins on conflict; flagged here rather than choosing silently.", "The claim's file surface names packages/plugins/driver-sql/src/**; the driver is at packages/drivers/driver-sql and was not touched. The new test sits in packages/runtime (the only package with the MCP bridge, the engine and SqlDriver together), read as 'a new test named for this card'.", "Commit trailers are spelled 'Co-authored-by: Claude' (the AGENTS.md form, model-free) rather than the dispatch's 'Co-Authored-By' casing.", "The first local gate sweep was cut at 580s by my own timeout after 48 of 66 commands; the rest were run separately. The final-head sweep ran all 66.", "Merged origin/main (a1b14cdff8) into the branch before opening the PR (AGENTS §10), because incoming commits touched objectql's aggregate doors." ], "mcp_calls": "0", "api_writes": "2 — fleet-write relay: pr_create (POST /repos/objectstack-ai/objectstack/pulls + its assignees leg, run 44512831352); post-stamped os-dev-report comment on #34886 (POST /repos/objectstack-ai/objectstack/issues/34886/comments). Plus git push (not REST).", "open_questions": [ { "question": "Which form does the PR body's 维护者速读 take when the dispatch (≤4 lines, no paths) and os-dev.md (six fixed lines, 先看 names files) disagree?", "options": [ "A: os-dev.md six lines (taken)", "B: the dispatch's four lines; reword the PR body in a seat edit" ], "recommendation": "A for this PR, because os-dev.md says it wins on conflict. Reconcile the two texts in one place." } ], "security_findings": "none", "out_of_scope_findings": [], "dedupe_words": [ "groupBy dotted path", "aggregate_records DATABASE_ERROR", "relation hop groupBy", "INVALID_FIELD groupBy relation" ] }objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
os-dev-report
{ "issue": 34886, "status": "done", "branch": "claude/issue-34886-deep-groupby-refusal", "pr": "https://github.com/objectstack-ai/objectstack/pull/35479", "session": "session_01Utp6Ca1jJvsA1dHsPwMiQb", "premise_still_valid": true, "a0_reading": "REPRODUCED on origin/main b3247ddbdc. Driver level, SqlDriver on SQLite: groupBy 'nosuch', 1 hop and 2 hops answered INVALID_FIELD/400 (the missing-column backstop, no path). 3 hops and 4 hops answered DATABASE_ERROR/500. MCP-bridge level (buildMcpBridge -> callData -> real ObjectQL -> real SqlDriver, new test at 6f8c1651b9 against main's objectql): purchase_order.requisition.requester.department.name -> DATABASE_ERROR/500. The 1-hop case was 400 only after the statement ran. PostgreSQL cell NOT MEASURED (no live PG in this container).", "summary": "Fix round 1. R1: the changeset and the PR body now declare 'Clause-②: no (narrowing)', with 'Metadata-protocol: none' at patch. Both carry a **BREAKING** line: a dotted groupBy reaching engine.aggregate past the REST door is now refused where it used to answer. It ships patch as a non-protocol breaking change. The changeset holds exactly one ADR-0087 marker, not-required (no-migration-prescription). R2 was measured and closes with no code change: an own-qualified analytics dimension never reaches the engine door dotted. Undeclared, the analytics door refuses it 400 before any strategy runs; declared, the qualifier is stripped. Code is unchanged since 1af59bd01f; the only file the round touched is the changeset. Original fix: engine.aggregate's groupBy door (assertGroupByTargetsAreStored) refuses a dotted path the object does not declare with INVALID_FIELD/400 at groupBy.N or groupBy.N.field, naming the path, its hop depth and the 0-hop limit.", "tests": "Fix round 1 changed no code or test. R2 probe readings are in r2_reading. Prior, at 1af59bd01f (same code): objectql test 615/615 files and 13888/13888 tests; objectql and runtime typecheck exit 0; the new runtime file plus mcp-aggregate-order-cut 15/15. The new pin file is 5 failed / 1 passed on main code. The ablation at 338e378846 went red 5/1 and was restored with blob == HEAD, rebuilt, and --absent clean.", "gates": "Fix round at 874d01cae4: 'node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0', verdict line: \"✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition.\" Its row: \".changeset/34886-group-by-relation-path-refusal.md [BREAKING+clause-②-narrowing] not-required (no-migration-prescription)\". Also exit 0: check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main, check:changeset-gate-self-tests, check:nul-bytes, check:doc-authoring. overlap-check --branch=HEAD: VERDICT clean exit 0. At 1af59bd01f, 66 derived families ran, all exit 0, with --ran '66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN'. CI at 874d01cae4 when read: success=37, skipped=18, in_progress=2 (Check Changeset, and the PR-body guards re-running after the body edit), failure=0.", "dogfood_battery": "874d01cae499de151b1d58c4993048873639bc7a · os-verify-lock: VERDICT command-exit 0 (held 2280s) · pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test, no OS_TEST_SHARD, no path · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · 0 failures", "line_budget": "n/a — no skills/** or ratcheted ledger touched; diff vs main 3 files (changeset grew by the BREAKING line and the ADR-0087 marker)", "files_changed": [ ".changeset/34886-group-by-relation-path-refusal.md", "packages/objectql/src/aggregate-query-shape-door.ts", "packages/runtime/src/mcp-aggregate-relation-path-group-by.test.ts" ], "head": "874d01cae499de151b1d58c4993048873639bc7a", "a1_reading": "No hop limit is declared for the public groupBy. Its depth is 0 by the REST door (protocol-query-validation assertGroupByFieldsExist: 'a related record's column cannot be a grouping target'). The MCP bridge reaches engine.aggregate via callData past that door. assertGroupByTargetsAreStored skipped undeclared names, so the dotted name reached driver-sql as a qualified identifier. SQLite's no-such-column parse attributed 1-2 hops; 3+ fell to the terminal DATABASE_ERROR.", "a2_reading": "The related cards' mechanism (RELATION_GROUP_BY / relation-group-join.ts) is an engine-internal symbol-keyed ONE-hop request used by the analytics strategy, not a public groupBy key. Extending it to N hops would widen the public vocabulary, so the PR refuses instead, as the ruling's second arm allows.", "a3_reading": "driver-sql's aggregateBackendFault / DATABASE_ERROR mapping is untouched. The path is refused before the driver runs, so a genuine driver error still answers 500.", "deviations": [ "The PR body carries the ADR-0087 disposition in words, not as the marker itself: os-dev.md forbids HTML comments in GitHub text. The marker lives in the changeset, where the gate reads it.", "For the R2 main reading, main's aggregate-query-shape-door.ts was restored into the tree unstaged (git restore --source=a1b14cdff8). After the run it was restored from HEAD, and git diff HEAD was empty before the commit.", "The R2 probe's 'objectql-only' composition (data service with execute hidden) did not remove the native strategy. Its ObjectQL-strategy cells are the month-bucket ones, which the native strategy declines.", "Two R2 probe runs queue-timed out (exit 99) behind a sibling's dogfood run. The third, under the same slot, ran.", "Earlier (round 0): the maintainer brief form was resolved by the coordinator as B (seat-practice.md §1), and the PR body was rewritten through post-stamped --body." ], "mcp_calls": "0", "api_writes": "Fix round: 2 — post-stamped --body=35479 (PATCH /repos/objectstack-ai/objectstack/issues/35479, relay run 44528570377, 11176/11176 bytes identical, --ack-through=7008122771 after reading it in full); this os-dev-report comment on #34886 (POST /repos/objectstack-ai/objectstack/issues/34886/comments). Plus git push of 874d01cae4 (not REST).", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [], "dedupe_words": [ "groupBy dotted path", "aggregate_records DATABASE_ERROR", "relation hop groupBy", "INVALID_FIELD groupBy relation" ], "round": "fix round 1 (L1-a comment 7008122771: R1 + R2)", "r2_reading": "Probe: real ObjectQL + SqlDriver/SQLite + AnalyticsServicePlugin + dispatcher POST /api/v1/analytics/query, counting engine.aggregate calls; deleted after the run, not in the diff. Main a1b14cdff8 (main's door restored into the tree, closure rebuilt): dimensions ['CUBE.region'] and ['OBJECT.region'], region a field the cube does not declare, each answered 400 INVALID_FIELD from the analytics door (\"Dimension 'CUBE.region' on cube 'CUBE' walks relationship 'CUBE' (path 'CUBE') ...\"). engine.aggregate was called 0 times. The same holds with a month timeDimension (ObjectQL-strategy route). Head (this door, objectql rebuilt, dist-preflight marker present in 4 files): identical answers for the same four queries, engine.aggregate 0 calls. CONTROL on head: a declared member behind the cube's or the object's qualifier, with a month bucket, is served by the ObjectQL strategy with the qualifier stripped. engine.aggregate groupBy was ['stage', {field:'closed_on', dateGranularity:'month'}], answering 200 with counts a=2, b=1. Verdict: refused before the engine, or stripped; R2 closes and is recorded in the PR's Acceptance notes." }objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
os-dev-report
{ "issue": 34886, "status": "done", "branch": "claude/issue-34886-deep-groupby-refusal", "pr": "https://github.com/objectstack-ai/objectstack/pull/35479", "session": "session_01Utp6Ca1jJvsA1dHsPwMiQb", "premise_still_valid": true, "a0_reading": "REPRODUCED on origin/main b3247ddbdc. Driver level, SqlDriver on SQLite: groupBy 'nosuch', 1 hop and 2 hops answered INVALID_FIELD/400 (the missing-column backstop, no path). 3 hops and 4 hops answered DATABASE_ERROR/500. MCP-bridge level (buildMcpBridge -> callData -> real ObjectQL -> real SqlDriver, new test at 6f8c1651b9 against main's objectql): purchase_order.requisition.requester.department.name -> DATABASE_ERROR/500. The 1-hop case was 400 only after the statement ran. PostgreSQL cell NOT MEASURED (no live PG in this container).", "summary": "Fix round 2. S1(a): two pins enter the non-relation arm, `address.city` (a declared JSON head) and `rp_po_line.amount` (the object's own name as a qualifier, an undeclared head); each is refused INVALID_FIELD/400 at groupBy.0 with zero statements run, and both went red under ablation. S1(b): the refusal picks its wording by the head's declared type; a non-relation head gets no 'relation hops' wording (pinned with not.toMatch(/relation hop/)). S1(c): the BREAKING line in the changeset and the PR body names all three refused shapes and what each answered before, with no null-group claim for the JSON sub-path or the own-name qualifier. REWORK: the PR body carries 'Skills-docs: none — REASON'. N1 (multi-value lookup hint), N2 (shorter message, 260-339 chars) and N3 (aggregateGroups asserts path) are taken. The CI red on Test Core (7/10), @objectstack/scenarios#test, is not this change: it is a 5000 ms timeout in refresh.test.ts that also hits main's merge queue on PR #35459, and the case passes locally in about 0.5 s at both the head and the merge-base.", "tests": "At e8b311e4c0 (code byte-identical to ce0a9509e5), one locked run, VERDICT command-exit 0: pnpm --filter @objectstack/objectql exec vitest run --project local --maxWorkers=2 -> Test Files 615 passed (615), Tests 13888 passed (13888); pnpm --filter @objectstack/objectql typecheck -> exit 0 ('check:test-typecheck: OK — @objectstack/objectql's test layer compiles'); pnpm --filter @objectstack/runtime typecheck -> exit 0 (test layer OK); pnpm --filter @objectstack/scenarios test -> 40/40 files, 1182/1182 tests (and the same at the merge-base). At ce0a9509e5: runtime src/mcp-aggregate-relation-path-group-by.test.ts + src/mcp-aggregate-order-cut.test.ts -> Test Files 2 passed (2), Tests 17 passed (17), VERDICT command-exit 0. Ablation: see the ablation field. Not run locally: the full runtime suite and test:repo, declared to CI (Test Core).", "gates": "Local, at e8b311e4c0: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 66; all 66 run, 65 exit 0. check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET (no dist/ for studio, client-react, embedder-openai, knowledge-memory, knowledge-ragflow, service-knowledge), so NOT MEASURED; it was exit 0 at 1af59bd01f. --ran: '✓ dispatch-gates --ran: 66 derived famil(ies) accounted for — 65 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).' check-adr-0087-registration --base origin/main exit 0: '✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition.' overlap-check --branch=HEAD: VERDICT clean exit 0. CI at e8b311e4c0 (run 44540499020): Test Core (7/10) failure, the refresh.test.ts timeout above (not ours); the other check-runs were not re-read for this report and are in_progress/as CI shows.", "dogfood_battery": "e8b311e4c0 · os-verify-lock: VERDICT command-exit 0 (pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test, no OS_TEST_SHARD, no path) · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · no failures", "line_budget": "n/a — no skills/** or ratcheted ledger touched; diff vs main 3 files (changeset grew by the BREAKING line and the ADR-0087 marker)", "files_changed": [ ".changeset/34886-group-by-relation-path-refusal.md", "packages/objectql/src/aggregate-query-shape-door.ts", "packages/runtime/src/mcp-aggregate-relation-path-group-by.test.ts" ], "head": "e8b311e4c0", "a1_reading": "No hop limit is declared for the public groupBy. Its depth is 0 by the REST door (protocol-query-validation assertGroupByFieldsExist: 'a related record's column cannot be a grouping target'). The MCP bridge reaches engine.aggregate via callData past that door. assertGroupByTargetsAreStored skipped undeclared names, so the dotted name reached driver-sql as a qualified identifier. SQLite's no-such-column parse attributed 1-2 hops; 3+ fell to the terminal DATABASE_ERROR.", "a2_reading": "The related cards' mechanism (RELATION_GROUP_BY / relation-group-join.ts) is an engine-internal symbol-keyed ONE-hop request used by the analytics strategy, not a public groupBy key. Extending it to N hops would widen the public vocabulary, so the PR refuses instead, as the ruling's second arm allows.", "a3_reading": "driver-sql's aggregateBackendFault / DATABASE_ERROR mapping is untouched. The path is refused before the driver runs, so a genuine driver error still answers 500.", "deviations": [ "The first push of the changeset commit was refused by check:commit-card-trailers: my co-author trailer named a model. The commit was unpublished, so I amended it to the model-free pair (Claude, at the noreply anthropic.com address, no model name) and pushed e8b311e4c0. Nothing published was rewritten.", "For the base scenarios leg, I restored the merge-base door file into my worktree, not a separate checkout at a1b14cdff8. The other two diff files are a runtime test and the changeset, which scenarios does not read. Restore proof: blob == HEAD, empty git diff HEAD, rebuild, marker present again.", "The seat's L1-a correction 7011563941 says the battery is recorded at e8b311e4c0 in 7010069867. At that time the last battery had run at 874d01cae4. The battery at e8b311e4c0 is the one in this report. Noted, not corrected: not my record.", "The 4-line 维护者速读 is kept verbatim, as ordered. It describes relation-path grouping only; the widened refused set is in the BREAKING line and What changes." ], "mcp_calls": 0, "api_writes": "Fix round 2: 2. post-stamped --body=35479 (PATCH /repos/objectstack-ai/objectstack/issues/35479, relay run 44557488604, 15370/15370 bytes identical, --ack-through=7011563941 after reading it in full); this os-dev-report comment on #34886 (POST /repos/objectstack-ai/objectstack/issues/34886/comments). Plus git push of e8b311e4c0 (not REST). Read-only REST: the two failing CI job logs and the merge-queue job logs cited above.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted in the PR's Acceptance notes, not filed: scenarios test/export/refresh.test.ts 'does not skip when one listed app is on an older version…' runs about 0.5 s locally but 5.0–5.7 s on CI shards and times out at vitest's 5000 ms default. Seen 4 times on 2026-11-19 (2 on this PR, 2 in main's merge queue for #35459). It is a CI timing margin, not a reproducible defect class (a/b/c), so it is not filed." ], "dedupe_words": [ "groupBy dotted path", "aggregate_records DATABASE_ERROR", "groupBy own-name qualifier", "refresh.test.ts timed out 5000ms" ], "round": "fix round 2 (L2 7010069867 S1 + REWORK + N1-N3), plus the CI scenarios red", "r2_reading": "Probe: real ObjectQL + SqlDriver/SQLite + AnalyticsServicePlugin + dispatcher POST /api/v1/analytics/query, counting engine.aggregate calls; deleted after the run, not in the diff. Main a1b14cdff8 (main's door restored into the tree, closure rebuilt): dimensions ['CUBE.region'] and ['OBJECT.region'], region a field the cube does not declare, each answered 400 INVALID_FIELD from the analytics door (\"Dimension 'CUBE.region' on cube 'CUBE' walks relationship 'CUBE' (path 'CUBE') ...\"). engine.aggregate was called 0 times. The same holds with a month timeDimension (ObjectQL-strategy route). Head (this door, objectql rebuilt, dist-preflight marker present in 4 files): identical answers for the same four queries, engine.aggregate 0 calls. CONTROL on head: a declared member behind the cube's or the object's qualifier, with a month bucket, is served by the ObjectQL strategy with the qualifier stripped. engine.aggregate groupBy was ['stage', {field:'closed_on', dateGranularity:'month'}], answering 200 with counts a=2, b=1. Verdict: refused before the engine, or stripped; R2 closes and is recorded in the PR's Acceptance notes.", "pins_added": [ "it.each 'a path into a stored value (a json head)': groupBy ['address.city'] -> {code:'INVALID_FIELD',status:400,field:'address.city',path:'groupBy.0'}, message names the path, not.toMatch(/relation hop/), 0 statements", "it.each 'the object's own name as a qualifier (no field by that name)': groupBy ['rp_po_line.amount'] -> same envelope at groupBy.0, no relation-hop wording, 0 statements", "aggregateGroups (ordered and cut) case now asserts path:'groupBy.0' as well as code/status/field, 0 statements" ], "ablation": "At ce0a9509e5 under the lock: ablation-replace.mjs swapped the arm's guard for `field === 'ABLATION_34886_R2'` (anchor x1->x0, blob 196c1d38->de7fae20); objectql rebuilt; ablation-dist-preflight found the marker in 4 dist files. The runtime file went 7 failed / 1 passed (the CONTROL). The JSON pin answered the driver backstop's INVALID_FIELD without path after the statement ran, and the own-name pin was answered ('expected the aggregate to be refused, but it answered'). Restore: git checkout HEAD -- FILE, blob == HEAD 196c1d38, git diff HEAD empty, rebuilt, preflight --absent 0 of 14 dist files, file 8/8 green.", "scenarios_ci_reading": "NOT OURS. CI run 44531427092 job 135586800061 (ce0a9509e5) and run 44540499020 job 135618491647 (e8b311e4c0) both failed one case: test/export/refresh.test.ts > galleryRefresh — the quiet skip > does not skip when one listed app is on an older version, or when the index lists no app — 'Test timed out in 5000ms' (5493 ms and 5065 ms). The same case timed out in main's merge queue on runs without this change: 44530279296 job 135583056016 (5395 ms) and 44533961485 job 135595686454 (5714 ms), both for PR #35459, which changes only the seed loader. Local, under the lock: pnpm --filter @objectstack/scenarios test at e8b311e4c0 = Test Files 40 passed (40), Tests 1182 passed (1182); at the merge-base a1b14cdff8 (the door file restored to its base blob 99b3bf59, objectql rebuilt, marker absent 0 of 14 dist files; the other two diff files are a runtime test and the changeset, which scenarios does not read) = 40/40, 1182/1182. The case alone, verbose: 510 ms at the head, 532 ms at the base. The restore was proved by blob 196c1d38 == HEAD and an empty git diff HEAD, then a rebuild with the marker present again. The case loads objectql (src/score/scenario-tags.ts imports standaloneActionOwnerKey), but its app harness is a stub and aggregate never runs. An earlier local 2-failed reading at ce0a9509e5 was my own error: I built only the package's dependencies, so built-consumer.test.ts and packed-tarball.test.ts refused for a missing dist/; with the package built, 40/40.", "skills_docs": "Skills-docs: none — no skill or docs page teaches a dotted engine or MCP groupBy entry: skills/objectstack-query teaches bare column names only, and the relationship.field dimensions in content/docs/data-modeling/analytics.mdx are the analytics cube surface, which this PR leaves as it was (R2). The refusal itself names the path and the fix." }objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
Close-out 2026-11-19T16:36Z: PR #35479 merged, and
Fixesclosed this card.Before this fix, a dotted
groupByentry that is not itself a field answered 500DATABASE_ERRORor a misleading grouping. The engine's aggregate door now refuses it withINVALID_FIELD/ 400 atgroupBy.N, before any statement runs. The entry can take three shapes: a relation path such as the card's 4-hop path, a sub-path into a JSON field, or a qualifier using the object's own name. The refusal names the path, and its wording depends on what the head is: a relation counted in hops, a multi-value relation, or a non-relation field.This is a narrowing:
Clause-②: no (narrowing), BREAKING plus an ADR-0087 marker,Skills-docs: none. The dogfood battery ran green on the fix head.L1-a ACCEPT, then the seat's contract review: round 1 7010069867, delta 7014726320 PASS. N4 is an accepted deviation: the multi-value relation sentence has no pin, because no fixture declares a multiple relation.
pm:dispatchedoff.