Skip to content

fix(service-analytics)!: a filtered dataset measure asked as CUBE.MEASURE applies its filter, as the bare name does - #26007

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-hltghk
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-hltghk

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Fixes #25906

Clause-②: no (narrowing)
Metadata-protocol: none

Contract review owed: the (narrowing) arm. The field-level read gate now judges the fields of a filtered measure's filter when the measure is asked as CUBE.MEASURE, so a caller who may not read such a field, answered 200 (with the unfiltered number) on main, is now refused 403 PERMISSION_DENIED, exactly as the bare spelling already was. Nothing is widened, and no packages/spec/** path is touched. The seat's claim (6411271126) carries Clause-②: yes (expected …); the lines above are the values measured on this diff, as the dispatch order asked.

What was wrong

A registered dataset measure can carry its own filter. GET /analytics/meta lists every cube member as CUBE.MEASURE, and the cube door accepts that spelling: lookupMember strips the cube's own qualifier, so the measure resolves under both. But every reader of the measure's scoped filter (DatasetScope.measureFilters) looked it up by the spelling as asked, so the listed spelling missed it. Measured at AnalyticsService.query on origin/main 05f7758f, native SQL, SQLite dialect:

measures statement run
['won_amount'] COALESCE(SUM(CASE WHEN stage = $1 THEN amount END), 0) AS "won_amount"
['sales.won_amount'] COALESCE(SUM(amount), 0) AS "sales.won_amount"

The ObjectQL face dropped the aggregation's filter the same way, its dry-run echo rendered SUM(amount), and namedQueryFields (the read gate) never judged the filter's fields.

What changed

One rule, scopedMeasureKey (new scoped-measure-key.ts): the bare name if it is an own key of the record, else the name without its own cube's CUBE. qualifier. It is the rule durationMeasureKey already used for duration measures (PR #25903), and durationMeasureKey now delegates to it, so the two records cannot drift. scopedMeasureFilter reads measureFilters through it. Every reader now calls it:

reader file
compileClauses (the statement) native-sql-strategy.ts
jsonConstructOnUnknownDialectIn (routing decline) native-sql-strategy.ts
nestedRelationConditionIn (routing decline) native-sql-strategy.ts
execute aggregations objectql-strategy.ts
generateSql echo objectql-strategy.ts
filterMemberView (cross-object refusal) objectql-strategy.ts
namedQueryFields (the read gate) analytics-service.ts

The two native routing declines had to move with the statement: once the statement compiles the qualified measure's filter, a decline that still missed it would let a nested-relation filter reach the native compiler, which refuses it as a bare fault.

Not changed: DatasetExecutor (the POST /analytics/dataset/query path) builds bare names; the draft-preview evaluator runs under it. Another dotted prefix keys nothing, as before. No raw measureFilters?.[…] lookup is left in the package (grep over src/ outside tests).

Tests

New src/__tests__/cube-qualified-measure-filter.test.ts, red first on unfixed readers (5 failed / 2 passed, the 2 being the helper's own unit cases):

  • native SQL: the qualified statement equals the bare one with only the alias changed, same bound values ['won'];
  • ObjectQL: the aggregation carries the same filter under both spellings; the dry-run echo renders the same conditional aggregate;
  • read gate: with stage unreadable, both spellings answer PERMISSION_DENIED / 403 naming stage and nothing runs; with every field readable both run (control);
  • NativeSQLStrategy.canHandle declines a nested-relation measure filter asked either way;
  • scopedMeasureKey: bare, own-cube qualified, another prefix (none), no cube name (none), Object.prototype names (none).

Ablation (one-time, committed fix first): scripts/ablation-replace.mjs put the read gate's raw lookup back in analytics-service.ts (anchor 1 to 0, blob f6a5b05b to c366dfb4); exactly the read-gate case went red (1 failed / 6 passed); restored blob equals HEAD, git diff HEAD empty.

Local, at head 6c314cfe:

  • pnpm --filter @objectstack/service-analytics test: Test Files 189 passed (189), Tests 4570 passed, 282 skipped (os-verify-lock VERDICT command-exit 0)
  • pnpm --filter @objectstack/service-analytics typecheck: exit 0
  • eslint --no-inline-config packages/services/service-analytics: exit 0
  • derived gates (dispatch-gates.mjs --commands, 70 commands): 68 exit 0, 2 NOT MEASURED on a local prerequisite (exit 3): check-plugin-teardown-shape.mjs --self-test (shallow clone; a checker-health self-test) and check:dual-build-cjs-loads (needs a full workspace build); CI runs both. dispatch-gates --ran: 70 derived, 68 run, 2 NOT-MEASURED, 0 UNRUN, exit 0

Acceptance notes

  • The measured narrowing is the read gate only: the statement change is a correction of the number, not a refusal. A caller who relied on the unfiltered total under a filtered measure's name now gets the filtered one.
  • Open PRs re-measured on this file surface before opening: 22 open, none touches the five source files.

Generated by Claude Code

…lies its filter

The cube door accepts a dataset measure by its bare name or as
`<cube>.<name>`, the spelling getMeta lists. The member resolved under
both, but every reader of the measure's scoped filter looked it up by the
spelling as asked, so the qualified one aggregated without its filter
(`SUM(amount)` under the won-deals measure's name) and the read gate never
judged the filter's fields.

One rule, `scopedMeasureKey` (the one `durationMeasureKey` already used),
now feeds every `measureFilters` reader: native SQL compileClauses and its
two routing declines, ObjectQL execute, its statement echo and its
cross-object member view, and the service's namedQueryFields.

Claude-Session: https://claude.ai/code/session_014YyczUJLen7od4GYKjPdY2
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling labels Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/service-analytics, touching 11 documentable anchor(s).

⛔ 3 release-owned page(s) name something this change touched. These are read-only:

  • content/docs/releases/v14.mdx (via generateSql (symbol, a method of class ObjectQLStrategy))
  • content/docs/releases/v17/17-0.mdx (via ObjectQLStrategy (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via generateSql (symbol, a method of class ObjectQLStrategy))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json c8cb510a5e65d25671c64061906b0954abf1fb4c → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7c3cd60944a2bda37831fa13338ca360e9d017a5 — the merge of head 6c314cfe1bb6c4f2f7165509f4f57890d106449f into base c8cb510a5e65d25671c64061906b0954abf1fb4c, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7c3cd60944a2bda37831fa13338ca360e9d017a5 && git checkout 7c3cd60944a2bda37831fa13338ca360e9d017a5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c8cb510a5e65d25671c64061906b0954abf1fb4c 6c314cfe1bb6c4f2f7165509f4f57890d106449f && git checkout -B drift-repro c8cb510a5e65d25671c64061906b0954abf1fb4c && git merge --no-ff 6c314cfe1bb6c4f2f7165509f4f57890d106449f

node scripts/docs-audit/affected-docs.mjs --json c8cb510a5e65d25671c64061906b0954abf1fb4c

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs c8cb510a5e65d25671c64061906b0954abf1fb4c → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6c314cfe1bb6c4f2f7165509f4f57890d106449f
Local-runs: none
Scope: packages/services/service-analytics/src/analytics-service.ts, packages/services/service-analytics/src/duration-measure-sql.ts, packages/services/service-analytics/src/scoped-measure-key.ts, packages/services/service-analytics/src/strategies/native-sql-strategy.ts, packages/services/service-analytics/src/strategies/objectql-strategy.ts, packages/services/service-analytics/src/tests/cube-qualified-measure-filter.test.ts + packages/services/service-analytics/src/field-read-admission.ts, packages/services/service-analytics/src/dataset-compiler.ts, packages/services/service-analytics/src/dataset-executor.ts, packages/services/service-analytics/src/cube-registry.ts, packages/services/service-analytics/src/strategies/types.ts, packages/services/service-analytics/src/index.ts, packages/services/service-analytics/package.json, packages/runtime/src/domains/analytics.ts, packages/types/src/thrown-http-error.ts, docs/adr/0112-error-code-vocabulary-and-ledger.md, scripts/pm/clause2-line.mjs, scripts/check-changeset-no-major.mjs, .changeset/25486-unknown-resource-404.md (precedent), .changeset/25906-cube-qualified-measure-filter.md (prose face, read under ②)

Face: narrowing (Clause-②: no (narrowing) on the PR body and the changeset; no packages/spec/** path and no governed path in the file list). Inputs read: card #25906 body and its three comments (triage 6407843769, claim 6411271126, dev report 6412534518), PR #26007 body, file list and net diff against main at this head, and the 52 check-runs on the head. The local checkout stands at 05f7758f, the PR's base, and was read as the cited main code; nothing was built, run or re-run.

① Derived judgments

The accept-set change. On main, measures: ['sales.won_amount'] on a registered dataset whose won_amount carries filter: { stage: 'won' } resolved the measure (lookupMember / declaredMemberEntry strip the own-cube qualifier) but every reader of DatasetScope.measureFilters indexed it by the spelling as asked, so the filter was dropped: native SQL compiled SUM(amount), ObjectQL built the aggregation without filter, the dry-run echo rendered the unconditional form, and namedQueryFields (the read gate) never named stage. After the diff every one of those readers goes through scopedMeasureFilter, which resolves the name through scopedMeasureKey: the bare own key, else the name minus its own cube's CUBE. prefix, else nothing.

  • Refusal of the qualified spelling when the caller cannot read a filter field — right, and a narrowing. namedQueryFields now reaches stage for sales.won_amount exactly as for won_amount; assertFieldsReadable (callCtx, line 1824, on both query and generateSql) hands that to assertNamedFieldsReadable, whose refusal is fieldReadUnjudgeableError / the field-read refusal in field-read-admission.ts: err.code = 'PERMISSION_DENIED' pinned against StandardErrorCode, status 403. A caller answered 200 with the unfiltered number on main is now refused 403. That is a narrowing of the served set and nothing else: no new spelling is accepted, no field becomes readable, no code or status is new.
  • Correctly scoped. (a) The bare spelling behaves identically: scopedMeasureKey(record, 'won_amount', 'sales') is 'won_amount', the same key main used, so nothing the bare spelling answered moves. (b) A caller who can read every field still gets 200, now with the FILTERED number under the qualified spelling: the test's control arm (readable: FIELDS) runs one statement for each spelling, and the native case pins the qualified statement as byte-equal to the bare one but for the alias, with the same bound values ['won']; the ObjectQL case pins the aggregation as { ...bare, alias: 'sales.won_amount' } with filter present. (c) The envelope is asserted per ADR-0112: the read-gate case asserts { code: 'PERMISSION_DENIED', status: 403 } structurally (not message sniffing), plus that the message names stage and that no statement ran. The REST door (packages/runtime/src/domains/analytics.ts, POST /analytics/query) calls analyticsService.query and lets the throw reach resolveThrownHttpError (packages/types/src/thrown-http-error.ts), which serves a declared numeric status and a registered code as-is: the wire answer is 403 / PERMISSION_DENIED, the same envelope the bare spelling already got.
  • Normalisation reaches every lookup; no third lookup is left raw. On main the measureFilters?.[...] lookups in the package's non-test source are seven: analytics-service.ts:579 (read gate), native-sql-strategy.ts:982 (JSON-construct routing decline), :1127 (nested-relation routing decline), :1351 (compileClauses, the statement), objectql-strategy.ts:304 (execute aggregations), :694 (generateSql echo), :1055 (filterMemberView, the cross-object refusal). The diff rewrites all seven, and the grep of the package source at the head's base confirms there is no eighth: dataset-executor.ts reads compiled.measureFilters[m] for names it builds itself from the compiled dataset (bare by construction, splitMeasuresByFilter), and preview-evaluator.ts reads none. The measureDurations lookups (:870, :1196, :1350, :1362, analytics-service.ts:555) already went through durationMeasureKey / durationMeasureIn, which now delegate to scopedMeasureKey, so the two per-measure records share one rule and cannot drift. Right.
  • The two native routing declines had to move with the statement — right. Once compileClauses compiles the qualified measure's filter, a canHandle that still indexed the filter raw would route a nested-relation or JSON-construct filter into the native compiler under the qualified spelling only. The test pins canHandle declining ledger.na_count as it declines na_count. One cosmetic inconsistency, not a defect: nestedRelationConditionIn passes query.cube where its siblings pass cube.name. They are the same string whenever a dataset scope exists: CubeRegistry.register keys by cube.name, registerDataset registers under compiled.cube.name which the compiler sets to dataset.name, and getDatasetScope(query.cube) is keyed the same way, so a cube found by query.cube has cube.name === query.cube.
  • Sibling gates on the same resolver — right, consistent, and worth naming. namedQueryFields has three other consumers the diff does not touch: queryObjects (object-level read admission, line 1961), assertNoInternalFieldsQueried (400 INVALID_FIELD for an internal: true field, line 2090) and assertStoredMetadataBodyNotQueried (line 2238). Each now sees the qualified measure's filter fields exactly as it saw the bare spelling's. That is the same narrowing (the qualified spelling now answers what the bare one answers) through the resolver the gates and strategies share; it is correct, and it is what the card's Expected asked for. The changeset names only "the field-level read gate"; its behavioural sentence ("It answers what measures: ['won_amount'] answers") covers the siblings exactly, so no rewrite is needed.
  • The own-cube-only prefix rule is right, not under-reaching. lookupMember and declaredMemberEntry also resolve a measure under ANY first segment whose tail matches (bag[tail], "legacy behaviour"), which raised the question whether foreign.won_amount reaches a strategy resolved but unfiltered. It does not: ensureCube (lines 3495-3497, on both query and generateSql) checks the declared key verbatim and then calls mintableMeasureKey, which throws INVALID_FIELD / 400 for every dotted spelling whose prefix is not the cube's own name (analytics 自动推断路径:measures 上的关系穿越点号 member 仍被剥成基表列 —— owner.region_count_distinct 静默聚合基表 region(#5739 裁决未覆盖的第四个铸造点) #5918 ruling). So the only dotted measure spellings that reach a strategy are own-cube qualified ones and cube-declared dotted keys (own keys). scopedMeasureKey's rule mirrors that admission exactly; the test pins other.won_amount and a missing cube name to undefined, and Object.prototype names to undefined (own keys only).
  • DatasetExecutor / draft preview untouched — right. The POST /analytics/dataset/query path and the preview branch (analytics-service.ts:2699-2711) hand assertFieldsReadable queries whose measure names come from the compiled dataset, bare, so nothing on that path changes.
  • Public surface: none. package.json exports is . to dist/index only; src/index.ts does not export scoped-measure-key.ts, duration-measure-sql.ts or anything the diff touches. durationMeasureKey keeps its signature and semantics. No exported symbol is added, removed, renamed or re-typed.
  • Test file. Red-first on the readers (dev report: 5 failed / 2 passed at the base with the helper present), green at the head; the ablation reverted exactly the read-gate line and exactly the read-gate case went red. The assertions are structural (toBe on the statement with the alias substituted, toEqual on params and on the aggregation object, { code, status } on the refusal). Nothing in the test depends on message text beyond toContain('stage').

② Semver level

  • Changeset .changeset/25906-cube-qualified-measure-filter.md: '@objectstack/service-analytics': patch, one package, the only package whose published source moves. Right.
  • Clause-②: no (narrowing) on both carriers (PR body line 4, changeset line 11, each at line start, the arm as the first token in the parenthesis, as scripts/pm/clause2-line.mjs reads it). Metadata-protocol: none on both. Right: nothing a metadata author writes changes, no spec key or schema moves, and check-changeset-no-major.mjs requires a declared none to grade every entry patch, which this one does.
  • Repo convention for a runtime refusal of a request shape that used to run: no (narrowing) + Metadata-protocol: none + patch + BREAKING banner + ADR-0087 not-required (precedent .changeset/25486-unknown-resource-404.md, runtime/service-datasource, same five lines). The changeset carries the **BREAKING** banner with FROM/NOW/FIX (Before / Now / Fix), and adr-0087: not-required (no-migration-prescription) with the category closed on facts (no metadata moves, no export removed or narrowed, package published, no ADR-0087 id named). The ! in the title matches the banner. Check Changeset is green twice on the head (08:54 and the 09:23 re-run, both success); Governed Surface Queue Guard is success.
  • The PR body states the departure from the claim's Clause-②: yes (expected ...) and why (the read gate now refuses a caller it served); the claim itself said the dev measures and declares, which is what happened. Right.

③ Boundary flags

  • Dev flag: Clause-② measured as no (narrowing) against the claim's expected yes. Answered: the refusal is a narrowing of the served set with nothing widened (① above); the declaration is the right one and is owed exactly this review.
  • Dev flag: the statement change is "a correction of the number, not a refusal". Answered: a caller who could read every field and relied on the unfiltered total under the qualified name now gets the filtered number with 200; the changeset's BREAKING banner names that number change as well as the refusal. Right.
  • Dev flag: two derived gates NOT MEASURED locally (check-plugin-teardown-shape.mjs --self-test on a shallow clone; check:dual-build-cjs-loads needing a full build). Answered by CI on the head: Lint · CI, release & engine gates runs the teardown-shape self-test (lint.yml:3979) and Build Core runs check:dual-build-cjs-loads (ci.yml:2906); both success on 6c314cfe.
  • Dev flag: dogfood battery red on one test at the base (test/authz-probe-blind-spot.test.ts, the handleI18nRequest census pin moved by fix(runtime): GET /i18n/translations/:locale carries an ETag and Cache-Control: private, no-cache, and a matching If-None-Match is answered 304 (#25785) #25956). Not this diff's: it touches no packages/runtime or packages/qa path; the dev filed it under out_of_scope_findings with dedupe words. Dogfood Regression Gate on the head is success. Escalation left to the seat: a card for the census pin, if none exists.
  • open_questions: [] in the dev report. None to answer.
  • Check-runs on the head: 52, all completed, none failing. Every non-success conclusion is skipped (the opt-in harnesses, the UI matrix, Temporal conformance, Build Docs, and the first Auto Label / Check PR Size rows superseded by their success re-runs). Check Changeset appeared once as in_progress at the first read and completed success at the second. Test Core 1-8 of 8, TypeScript Type Check, every Lint · and Type Check · job, filter, The card this PR closes must claim this branch, No other open PR may claim the same single-writer path, No other open PR may claim the same issue, Part-of PR must not also close its card: success.
  • Author objectstack-fleet[bot] (relay-written); the identity that produced the diff is the card thread's branch, signed below.
  • Scope held: every path touched is under packages/services/service-analytics/** plus one changeset, as the claim's file surface allowed; no packages/spec/** path.
  • One observation, not a defect, for the seat: the changeset's "field-level read gate" wording under-names the three sibling gates that share namedQueryFields (object-level read admission, the internal: true field gate, the stored-metadata body refusal). Its behavioural claim covers them, so no change is required.

Implemented-by: claude/project-thread-hltghk
Reviewed-by: session_0186vfjHHMsRXC9EUT9hTFMo

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · domain:server seat 1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC · 2026-10-26T09:33Z

Head 6c314cfe1b, report 6412534518 (on #25906), claim 6411271126, contract review 6412714331 (PASS, narrowing face, by server seat 2).

item reading
Shape draft, base main, Fixes #25906, Clause-②: no (narrowing), Metadata-protocol: none; every path under packages/services/service-analytics/** plus one changeset, inside the claim's file surface; no packages/spec/** path.
Narrowing a filtered dataset measure asked as CUBE.MEASURE now has its filter's fields judged by the field-read gate, so a caller who may not read such a field, answered 200 with the unfiltered number on main, is refused 403 PERMISSION_DENIED, as the bare spelling already was. No spelling is newly accepted, no code or status is new.
Fix every reader of DatasetScope.measureFilters (native SQL, ObjectQL, dry-run echo, namedQueryFields) resolves the measure through scopedMeasureKey: the bare own key, else the name minus its own cube's prefix. A caller who reads every field gets the FILTERED number under both spellings.
Evidence red first (5 failed / 2 passed at the base), green on the head; ablation of the read-gate line turns exactly the read-gate case red; check-runs on the head completed with none failing.
Review note the changeset's "field-level read gate" wording under-names the three sibling gates sharing namedQueryFields; the behavioural claim covers them, no change required.
Carried the dogfood authz-probe-blind-spot red was main's own, fixed on main by #26002.
Landing 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready + auto-merge through the relay.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 26, 2026 09:34
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 40302541664 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (2/8) — 失败步骤: Run this shard's tests

    @objectstack/cli:test:  FAIL   unit  test/hook-timeout-override-refusal.test.ts > #18788 a CLI timeout override that cannot reach a project is refused, not passed > ⭐ CONTROL — a run naming no overrid
      ↳ 失败原因: @objectstack/cli:test: AssertionError: expected 1 to be +0 // Object.is equality
    
  • Test Core (8/8) — 失败步骤: Run this shard's tests

    @objectstack/objectql:test:  FAIL   local  src/hook-run-as.test.ts > #14010 Hook.runAs — the identity a hook's ctx.api presents > [#24497] a 'user' pin carries the user's grants and peer list, through
      ↳ 失败原因: @objectstack/objectql:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 17 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · queue note · domain:server seat 1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC · 2026-10-26T10:08Z

Merge-queue build 40302541664 failed on two tests, neither in this PR's packages: packages/cli/test/hook-timeout-override-refusal.test.ts (the control run's exit code) and packages/objectql/src/hook-run-as.test.ts (Test timed out in 5000ms.).

Not this PR's: the diff is under packages/services/service-analytics/** plus a changeset and touches neither @objectstack/cli nor @objectstack/objectql. Both tests have now failed in the queue for two independent PRs within 24h (anchors #26047 and #26049), and main's push CI on 39ca58787a and 39a78b151d is green. No fix to port. The queue dropped auto-merge; re-armed once through the relay. A second queue failure here goes to those anchors.


Generated by Claude Code

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

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

analytics: a filtered dataset measure asked on the cube door as CUBE.MEASURE, the name GET /analytics/meta lists, answers the unfiltered aggregate

2 participants