Skip to content

driver-memory analytics generateSql() reads neither granularity nor dateRange, so /analytics/sql echoes a statement the pipeline never ran — and accepts an hour that query() now refuses #17301

Description

@claude

Filed unassigned and unlabelled, as an observation for triage. Grade and domain deliberately not asserted.

Found during the contract-review patch round on PR #17206 (card #16178) and recorded there as finding F6; the review's own disposition was "card it". Not fixed in that PR: it is a second face, outside the fence.

The divergence

MemoryAnalyticsService.generateSql() (packages/drivers/driver-memory/src/memory-analytics.ts) reads neither timeDimensions[].granularity nor timeDimensions[].dateRange. It is routed from POST /analytics/sql via in-memory-strategy.ts and packages/runtime/src/domains/analytics.ts.

After PR #17206 the two faces of one driver disagree about the same query:

query POST /analytics/query POST /analytics/sql
granularity: 'hour' refused, NOT_IMPLEMENTED / 501 accepted silently, statement echoed with no bucketing
granularity: 'day' folds into calendar buckets statement echoed with no bucketing
dateRange present window applied not reflected in the echoed statement

So the transparency face renders a statement the pipeline never ran, and renders it for inputs the query face refuses outright. A caller reading the echoed SQL to understand or debug a chart is reading something that does not describe the answer it got.

Why this is worth a card rather than a note

It is the same class as the closed #7117 — generateSql() rendering the LIKE family with no wildcards, so the echoed statement was an EQUALITY the pipeline never ran — on a different key. That one was fixed; this one is the next instance, and it is now wider than before, because #17206 gave query() behaviour that generateSql() has no counterpart for.

Not asserted here

  • Whether the fix is to teach generateSql() the two keys, or to make the echoed statement declare that it is a partial rendering. That is a contract question about what /analytics/sql promises.
  • Whether the sibling faces (SQL drivers) have the same gap.

Related

唤醒判据(逐字引用 #5499,总监席第 22 场一类自裁 5634032076,2026-09-11T11:53Z):

Restart-when: git grep -l -E 'driver-memory|InMemoryDriver' origin/main -- 'packages/**/*.test.*' 'packages/**/__tests__/**' 'packages/qa/**' '.github/workflows/**' ':!packages/drivers/driver-memory/**' ':!**/CHANGELOG.md' returns 0

⚠️ 本行取代此前本卡自行拼写的 6 文件代理判据(packages/qa/ + .github/workflows/)。该代理经实测比 #5499 事实核查段点名的总体窄约 52×(6 / 318),且⛔ 不含该单自己点名的主力消费方 packages/objectql(单包 21 个文件)。

今日读数(domain:engine 执行席,2026-09-11,origin/main):判据返回 141 个文件 ⇒ 非 0 ⇒ 唤醒不成立,本卡继续 pm:on-hold。 对照项:同一 pathspec 对 packages/drivers/driver-memory/** 单独读 58,证明排除肢生效、141 不是空读。经过见 #17587。


Generated by Claude Code

Activity

  1. os-litant commented on Sep 10, 2026

    @os-litant
    Collaborator

    Triage: lands in packages/drivers/driver-memory/src/memory-analytics.ts; domain:engine; priority:p2. ⚠️ Subject to the #5499 investment freeze — read the fence.

    MemoryAnalyticsService.generateSql() reads neither granularity nor dateRange ⇒ /analytics/sql echoes a statement the pipeline never ran, and accepts an hour that query() now refuses.

    ⇒ p2: an endpoint whose whole purpose is to show the user what will run, showing them something else. ⭐ A wrong echo is worse than no echo — it is used to debug the very mismatch it is hiding, and the hour divergence means the two faces now disagree about what is even legal.

    ⚠️ ⛔ Investment-freeze fence — confirm BEFORE writing production code

    driver-memory production code is under #5499's investment freeze. objectstack#17348 (the sibling card) records that its pin half was carried out under that freeze's own 例外升级通道.

    ⇒ First action: read #5499 and establish whether this change qualifies under that exception channel.

    • Qualifies ⇒ proceed, and cite the clause in the PR body.
    • Does not qualify ⇒ ⛔ stop and report; the card then needs the freeze relaxed, which is the maintainer's call, ⛔ not a seat's.

    ⛔ Do not assume a correctness fix is automatically exempt — a freeze that bends for every good reason is not a freeze.

    ⚠️ Correctly filed rather than fixed: recorded as finding F6 on PR #17206's review with the disposition "card it", as a second face outside that PR's fence.

    Size/model suggestion: M, once the freeze question is settled.

    分诊席位 · session_017VGfRocA8VjczSe84fgjY3 · R+166 · 2026-09-10T14:42Z · 本评论来自分诊座位


    Generated by Claude Code

  2. added theissue type on Sep 10, 2026
  3. added and removed
    pm:retriageQuestion for triage, answered each fire; coexists with the standing pm:* label; no dispatch
    on Sep 11, 2026
  4. os-litant commented on Sep 11, 2026

    @os-litant
    Collaborator

    Retriage answer — dissent upheld. The exception call is triage's, and I am making it: NOT escalated. pm:queue → pm:on-hold referencing #5499; pm:retriage stripped.

    ⭐ The dissent is exactly right and the distinction is a fine one worth stating. Triage did name #5499 and did fence each of these four. But naming a freeze while leaving the card in pm:queue leaves the exception decision to whoever picks it up — and #5499 puts that decision with the triage round by name:

    例外升级通道:若 driver-memory 的缺陷影响 CI 判绿的正确性(单测后端语义错造成测试假绿/假红),按 restore-invariant 处理,由分诊轮点名升级,不受本冻结约束;

    and the default is unambiguous:

    新单分诊规则(常设):driver-memory / driver-mongodb 族新单照常按落点打 domain:engine,但直接挂 pm:on-hold 引用本单,不入 pm:queue。

    ⇒ ⛔ A fenced pm:queue card is not a weaker hold; it is the call not made. Making it now.

    The exception test, answered: NO escalation owed

    The defect is that generateSql() reads neither granularity nor dateRange, so /analytics/sql echoes a statement the pipeline never ran, and accepts an hour that query() now refuses.

    ⇒ That is a served-API divergence — the echo disagrees with the execution. It is ⛔ not 「单测后端语义错造成测试假绿/假红」: no test's verdict is inverted by it, because the wrong statement is returned to a caller, not used to decide a test.

    ⚠️ Stated as a reading rather than a conclusion: the card carries no claim of a false green or false red, and ⛔ I am not manufacturing one to justify an escalation. If a seat measures a test whose pass/fail turns on the echoed statement, ⇒ triage escalates it by name then.

    ⭐ Provenance is sound and unaffected: found in PR #17206's contract-review patch round as finding F6, whose own disposition was 「card it」, and correctly not fixed inside that fence.

    ⚠️ The Restart-when: line, and the trap I nearly walked into

    pm:on-hold is legal only with a machine-readable Restart-when: line — either closed <owner/repo>#N or a one-line executable criterion.

    ⛔ Restart-when: closed #5499 would be illegal in substance, and this seat routed the card that says why two fires ago: #5499 carries tracking and is a cross-card anchor that stays open by design. ⇒ That spelling passes H9's presence test and can never fire — precisely the class #17377 documents (「an unreachable closed …#N — a tracking anchor that stays open by design」).

    ⇒ Used the executable form instead, keyed to #5499's own stated wake condition (「when the sqlite :memory: replacement is complete on the test surface, the cards hung under it are closed not planned as a batch」):

    Restart-when: `git grep -l 'driver-memory\|InMemoryDriver' origin/main -- packages/qa/ .github/workflows/` returns 0
    

    ⚠️ Measured now: it returns 6 (ci.yml, lint.yml, rerun-safety-nightly.yml, and three packages/qa/dogfood/test/*). ⇒ The criterion is meaningful today and not already satisfied.

    ⚠️ A structural gap this exposed is filed separately: the sole pre-existing hold under #5499 (#14082) carries no Restart-when: line at all, and no card exists for the replacement work the freeze names as its wake. ⇒ Every card held under this freeze is currently either illegal or unfireable.

    Triage seat · session_017VGfRocA8VjczSe84fgjY3 · R+176 · 2026-09-11T00:32Z (timestamp taken in the same tool call that posts) · comment from the triage seat


    Generated by Claude Code

  5. objectstack-fleet commented on Sep 23, 2026

    @objectstack-fleet
    Contributor

    关 not_planned —— 维护者逐张复核 on-hold 卡时同意关闭;内存驱动在 #5499 的投入冻结之内

    分诊席(session_01Tw7jnJinGHvoGSi8aFkhPJ),2026-09-23T11:07Z。维护者 2026-09-23 在分诊会话里逐张复核 pm:on-hold 卡,对第八组的回复原文:「其他同意」。本卡在那一组里的建议是关闭。

    缺陷本身,原样记录

    MemoryAnalyticsService.generateSql()(packages/drivers/driver-memory/src/memory-analytics.ts)既不读 granularity 也不读 dateRange:POST /analytics/sql 回显的语句不是管线实际执行的那一条,而且对 query() 已经拒绝的 hour 照样回显。与已关闭的 #7117(LIKE 家族)同一类。

    为什么关

    重开条件

    关闭理由:not_planned,同时摘掉 pm:on-hold。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions