Skip to content

analytics: the cube-measure door's refusal for a sum over a formula may still suggest counting rows instead of the stored-field remedy #35353

Closed

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Filing gate: ② out-of-scope finding (class b, named producer) from the os-dev report on #34414 (comment 7000701790), owed by the L1-a ACCEPT on PR #35338 (comment 7001168986). Nested under #34414.
Reader: domain:server (packages/services/service-analytics, published @objectstack/service-analytics). Suggested-grade: p2 · same reach and reason as #34414 (misleading × rare: an AI follows the count hint), if the door is reachable for a formula.
Dedupe: cube-measure-field-type-door remedy, VIRTUAL_FIELD_AGGREGATE_REMEDY cube, count the rows formula measure in open issues: none.

维护者速读

  • 用户能看到什么变化:如果分析模型里有对「公式」字段求合计的度量,被拒时的提示会从「改成数记录条数」改成「把它建成按同一公式存值的字段再合计」;如果这条路根本走不到,就只记一句说明然后关卡。
  • 为什么做:引擎那一处已经改成和你对「公式字段求合计」的裁决一致,分析服务里还有一处同样的旧提示。
  • 出错会怎样:只改一句拒绝提示,哪些查询被拒不变;回滚即恢复旧提示。
  • 要你做什么:无。

Facts (origin/main, read, not run)

Ask

  1. Measure first: can a cube measure over a formula field reach assertCubeMeasureFieldTypesAccepted past the dataset-compile refusal (a hand-built cube, a stored cube definition, any path that skips the dataset compiler)?
  2. If it can: when virtualFieldAggregateRemedy(fn, fieldType) holds, the route is VIRTUAL_FIELD_AGGREGATE_REMEDY verbatim, as PR fix(objectql): the aggregate door answers sum / avg / min / max over a formula with the virtual-field remedy, not a count #35338 did for the engine door. Pin it, plus a CONTROL that a stored-type refusal keeps today's wording. Ablate red.
  3. If it cannot: record the reading on this card and close it (not_planned), or add one docblock line saying why the formula pair never arrives.

Clause-②: no expected (one route sentence). Related: #34414 / PR #35338, #32443 (ruling B), #24426.

⛔ Not a claim.

Activity

  1. added
    priority:p2
    pm:queue
    finding
    domain:server
    on Nov 19, 2026
  2. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

    Claim: PM loop round 15 · area data-1 (the maintainer, verbatim, 2026-11-19T04:35Z project chat: 「再开 area:data」; standing 「暂时都只派 p1 p2 的卡」) · 2026-11-19T12:49Z
    Area: data-1
    Session: session_01Utp6Ca1jJvsA1dHsPwMiQb
    Account: os-bill
    Branch: claude/issue-35353-cube-measure-formula-remedy
    Worktree: objectstack-issue-35353 (os-dev worktree in the data-1 container)
    Domain: domain:server
    Seat: repo:objectstack#5
    File surface: packages/services/service-analytics/src/cube-measure-field-type-door.ts (the refusal sentence, or one docblock line if the formula pair cannot arrive), a new test in packages/services/service-analytics/src/ named for this card, root .changeset/. ⛔ Not objectql-strategy.ts / cube-member-key.ts (PR #35479's R2 may need them). Stop on breach and report.
    Container & model: S, mode:subagent, model: default — no path-derived mandate, effort: medium
    Clause-②: no (one route sentence; which queries are refused does not change; measure on the diff)
    Metadata-protocol: none
    Responsibility: platform — the cube-measure door's refusal for a sum over a formula may tell an AI to count rows instead of the stored-field remedy of ruling B; analytics callers and AI agents.
    Thread-read: none
    Premise: read from code; reachability past the dataset compiler's own refusal is unmeasured, so the dev measures it first and the card closes not_planned (or with one docblock line) if the pair cannot arrive.
    Serial constraints cleared: #34414 / PR #35338 merged (engine door, same remedy); no open PR holds cube-measure-field-type-door.ts.
    Pre-claim lane: domain:server (packages/services/service-analytics/**)
    Pre-claim deps: #34414 closed.
    Prior rulings read: #32443 ruling B (formula aggregate remedy); PR #35338 L1-a ACCEPT 7001168986; #24426; thread: none

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 19, 2026
  4. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
    os-dev-report

    {
      "issue": 35353,
      "status": "done",
      "branch": "claude/issue-35353-cube-measure-formula-remedy",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35521",
      "head": "8079c387bd",
      "session": "session_01Utp6Ca1jJvsA1dHsPwMiQb",
      "premise_still_valid": true,
      "readings": {
        "A0": "REACHABLE, measured: real AnalyticsServicePlugin over real ObjectQL + SqlDriver (SQLite) at base 895dd437f4, the unmodified door. Two paths skip the dataset compiler and reach assertCubeMeasureFieldTypesAccepted with a formula column: (1) a configured cube (plugin config cubes / manifest), measure { type: sum|avg|min|max, sql: formula_field }; (2) an inferred cube, cube = object name, suffix measure expected_sum (no cube authored at all). Both refused INVALID_FIELD / 400 with '...; aggregate a field of one of those types, or count the rows with count.' (test 2 failed | 1 passed before the fix). service.query is the handler POST /api/v1/analytics/query calls; the HTTP route itself was not driven. A dataset measure whose formula sits a relationship hop away is a third path by reading (the header says the dataset compile check leaves relationship paths unjudged), not measured.",
        "A1": "Confirmed: cube-measure-field-type-door.ts:205-209 built the count-the-rows route for every refused pair and never asked virtualFieldAggregateRemedy.",
        "A2": "Confirmed: dataset-compiler.ts REMEDY_BY_SOURCE_CLASS asks virtualFieldAggregateRemedy first (#24426)."
      },
      "summary": "A0 found the formula pair reachable (configured cube, inferred suffix cube), so the Ask's step 2 was taken: when virtualFieldAggregateRemedy answers, the cube door's route after the accepted set is VIRTUAL_FIELD_AGGREGATE_REMEDY verbatim, with no count route and no dialect reason, as PR #35338 did for the engine door. The refused set, the code, the status and the attached member/field/object are unchanged; every stored-type refusal keeps its words byte for byte. New pin with a stored-type CONTROL; ablation red.",
      "files_changed": [
        "packages/services/service-analytics/src/cube-measure-field-type-door.ts (+10 / -2)",
        "packages/services/service-analytics/src/cube-measure-formula-remedy.test.ts (new, +157)",
        ".changeset/35353-cube-measure-formula-remedy.md (new, @objectstack/service-analytics patch)"
      ],
      "line_budget": "181 changed lines (+179 / -2), 3 files; inside the claim's file surface; objectql-strategy.ts and cube-member-key.ts untouched; no skills/** touched",
      "tests": "head 8079c387bd. Pre-fix probe: vitest run src/cube-measure-formula-remedy.test.ts -> Tests 2 failed | 1 passed (3). After: pnpm --filter @objectstack/service-analytics test -> Test Files 219 passed (219), Tests 5609 passed | 345 skipped (5954); typecheck tsc --noEmit exit 0; lock VERDICT command-exit 0. Ablation on the committed fix via scripts/ablation-replace.mjs (door resolved from src by relative import, no dist leg): anchor x1 -> x0, blob 0b40ef51d09b -> e09549c4d11a, card test 2 failed | 1 passed (CONTROL green); restored, git diff HEAD empty, file hash = HEAD blob.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack: 63 families derived at 8079c387bd, all run locally, 62 exit 0; --ran reconciliation with exit codes: 63 derived, 62 run, 1 NOT-MEASURED, 0 UNRUN. NOT MEASURED: pnpm check:dual-build-cjs-loads, reason: exit 3 PREREQUISITE NOT MET (needs every package's dist). check-nul-bytes OK; overlap-check VERDICT clean exit 0. PR check-runs: in_progress at report time (not waited on).",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm; Clause-② no measured on the diff (the refused set is untouched)",
      "mcp_calls": "0",
      "api_writes": "3 — git push (branch); relay pr_create (POST pulls + POST issues/35521/assignees, run 44535919947); post-stamped os-dev-report comment on #35353",
      "deviations": [
        "PR body follows the dispatch order's shape (signature first, Fixes second, four-line 维护者速读, technical under 席位核对), not os-dev.md's six-line shape, as the order directs.",
        "test:repo not run locally (diff does not touch that project); CI Test Core runs it."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  5. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

    Close-out 2026-11-19T14:36Z: PR #35521 merged, and Fixes closed this card.

    A cube measure that applies sum, avg, min or max to a formula field is still refused INVALID_FIELD / 400. The refusal now gives the virtual-field remedy (VIRTUAL_FIELD_AGGREGATE_REMEDY) word for word instead of the count route, so it says what the dataset compiler and the engine's aggregate door already say (#35338). The verdict, the code, and every other refused pair's wording are unchanged.

    Reachability was measured before the fix at both entry points, a configured cube and an inferred cube's suffix measure. The fix is pinned on both, with a CONTROL (sum over text keeps the count route) and an ablation.

    L1-a ACCEPT 7011523120. pm:dispatched off.

  6. removed
    pm:dispatched
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:serverfindingpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions