Skip to content

fix(objectql)!: a roll-up summary field is read-only on update whether or not it declares readonly: true - #34752

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-sd08sq
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-sd08sq

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Part of #34672 (the update side; the create side stays open on the card, scope note 6949162788)

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — skills/** teaches readonly: true and summary fields but says nothing on what an update does with a value sent for a summary field; content/docs/data-modeling/fields.mdx now states it

维护者速读

  • 改了什么:汇总字段(Field.summary)在更新时一律只读,不管作者有没有写 readonly: true。人用 PATCH 改、导入用 writeMode: 'update' 改、批量条件更新改、更新预览,送来的汇总值都被丢掉,其余字段照写,droppedFields 里报 readonly;开了 strictReadonlyWrites 则整笔拒收。
  • 为什么改:卡上实测 18.5.0 里销售能把「累计已转吨数」「实际成交额」「客户订单合计」直接改成任意数,存下来被下游读,直到下次子记录变动才被重算覆盖。汇总值是引擎算的,不该能手填。
  • 风险与回滚:收窄(BREAKING):今天能写进汇总字段的非系统更新会被丢或被拒。系统上下文(isSystem)照写,汇总重算本身就是这条路,不受影响。新建记录时带的初值照旧保留(种子数据、历史导入的预算合计,按 rule-validator 里 RUNTIME_OWNED_FIELD_TYPES 的排除理由对 summary 是错的:summary 是「存储列」不是「读时计算」 #6014 的既有设计)。
  • 仍未覆盖:普通用户新建记录时,仍可给没写 readonly: true 的汇总字段带一个初值,直到下一次子记录变动重算为止;这一半留在 objectql: a Field.summary roll-up without readonly: true accepts a person's write — REST PATCH and import store the typed value until the next recompute #34672 继续处理(席位 6949162788),所以本 PR 写 Part of #34672,卡不随合并关闭。回滚即撤回本 PR,无数据迁移。
  • 先看:packages/objectql/src/engine-top-level.ts(updateStaticReadonlySubject 与新的 summaryFieldsLockedOnUpdate)、packages/objectql/src/engine-summary-update-lock.test.ts、packages/rest/src/import-summary-update-lock-34672.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/engine-summary-update-lock.test.ts,预期 11 条全过;把 engine-top-level.ts 里 summaryFieldsLockedOnUpdate(schema) 换成 [] 后其中 5 条变红。
  • 需要你做的:无。check-governed-merges 判定非受管,L1 与契约复审通过后由区自行落地。

What changes

A roll-up summary field is read-only on update whether or not the author declared readonly: true.

  • packages/objectql/src/engine-top-level.ts
    • updateStaticReadonlySubject(schema, wallJudgesOrganization) is the one schema view every update-side static readonly pass judges: the pre-hook hide pass (engine-update.ts, what beforeUpdate is shown), the by-id strip and the predicate (multi) strip (what is stored), staticReadonlyStoredView (read by the readonlyWhen strips and the master-detail settlement), and the update-mode preview in engine-validate.ts. It now also reads every summary field as readonly: true. So all five take the same key, report it through onFieldsDropped / droppedFields with reason readonly, and refuse it under strictReadonlyWrites (ERR_READONLY_FIELD_REJECTED).
    • New export summaryFieldsLockedOnUpdate(schema): the summary fields not already declared readonly: true, keyed on type === 'summary' literally.
    • The stripComputedWriteFields doc points at the new lock: that door runs in every context, so it would also take the recompute's own write; this one exempts isSystem.
  • content/docs/data-modeling/fields.mdx: one paragraph under the summary field section.
  • .changeset/34672-summary-readonly-on-update.md: patch on @objectstack/objectql, BREAKING, the one-line fix, ADR-0087 not-required (no-migration-prescription).

No new drop reason, no spec key: reason readonly, as autonumber already rides it without the flag (#5503).

Why

The card measured on 18.5.0: a sales rep's PATCH of crm_quote_line_item.cb_converted_quantity stored 90 with no order behind it; a manager's PATCH or an import update moved crm_opportunity.cb_actual_won_amount from 619469.03 to 2; crm_account.cb_order_amount took 55. Each value stayed until a child write recomputed the roll-up, and downstream defaults read it. The spec already says summary is "never client-written" (COMPUTED_VALUE_TYPES); the update path did not enforce it.

Why the readonly strip and not the computed door: stripComputedWriteFields runs in every context, isSystem included, so it would also take the roll-up recompute's write (recomputeSummaries writes the parent through update() with isSystem: true and SUMMARY_RECOMPUTE_WRITE), and the spec describes computed as a formula with no column. The static readonly strip already skips isSystem writes (staticReadonlyStripRuns = !isSystem), so the recompute, the backfill and the enable refresh keep writing without reading the marker.

Insert is NOT narrowed. A create keeps a caller's value as the field's starting value. The summary note on RUNTIME_OWNED_FIELD_TYPES (packages/objectql/src/validation/rule-validator.ts, the #6014 note) keeps the type out of the insert-side strip on purpose: seed data and a historical import may carry a pre-computed total, and initializeSummaryFields seeds only the roll-ups the caller left out. This PR does not overturn it; the insert half is reported to the seat as a finding.

Tests

  • packages/objectql/src/engine-summary-update-lock.test.ts (new, 11 cases), one account whose order_total is a sum roll-up with no readonly, beside the same roll-up declared readonly: true, written as a signed-in person:
    • by-id update (the PATCH door): the roll-up is dropped and reported as readonly, the rest of the payload is written;
    • predicate update (multi: true): dropped from every matched row, reported once;
    • strictReadonlyWrites: by-id and predicate both refused (code ERR_READONLY_FIELD_REJECTED, fields, drops, operation), nothing written;
    • the update-mode preview reports the same drop;
    • the next child write recomputes the roll-up after a dropped write;
    • an isSystem write of the column is kept;
    • CONTROL: the declared readonly: true roll-up answers the same, and a payload naming both reports both in one event;
    • insert keeps a caller's initial value;
    • two unit pins on summaryFieldsLockedOnUpdate.
  • packages/rest/src/import-summary-update-lock-34672.test.ts (new, 3 cases), real ObjectQL + protocol + SQLite :memory: through the HTTP routes as a signed-in person: PATCH /api/v1/data/:object/:id; POST /api/v1/data/:object/import with writeMode: 'update', dry run and commit (each row's droppedFields and the stored value); the declared readonly: true control on both doors.
  • Changed tests (forced by the narrowing), the two record write door: '' skips every type check, so a number, boolean, date, datetime or time column stores an empty string — normalise it to null at the door (seam from objectui#10813) #20308 blank-typed-value pins. Each sends a blank for every typed column, f_summary included, and asserted each lands null. On update the summary blank is now dropped, so:
    • packages/objectql/src/engine-blank-typed-value-door.test.ts, case "update by id and update by predicate": every other typed column reaches the driver as null, and no f_summary is sent;
    • packages/rest/src/rest-data-blank-typed-value.test.ts (SQLite), the PATCH, batch update and updateMany doors: every other typed column stores null, and f_summary keeps its seeded 7.
    • The insert / create cases of both files are unchanged.

Ablation (node scripts/ablation-replace.mjs, on 7aebcc3): const rollUps = summaryFieldsLockedOnUpdate(schema); replaced by const rollUps: string[] = []; (anchor x1 → x0, blob c112f3aea19e → b4d66f559710). The suites import the engine from source. Result: Tests 6 failed | 14 passed (20).

  • Red, as predicted: by-id, predicate, strict, preview, CONTROL (the undeclared roll-up is stored), and the forced blank-door case.
  • Green, as predicted: the baseline, the recompute, isSystem, insert and the two unit pins.
  • Restore: blob c112f3aea19e == HEAD, git diff HEAD empty.

Acceptance notes

Verification

Final head 8d567553: a merge of main (46991d0e, 63 first-parent commits) over 91202760, with no conflict (git show --remerge-diff empty). The PR's delta against main is byte-for-byte the delta 91202760 carried (same 7 files, +536 / -8). Records at 91202760: L1 delta ACCEPT 6948959772, contract review delta PASS 6949128257. The battery, the objectql suite and the PR's pins below ran on 8d567553.

Full dogfood battery
  • On 8d567553, under one os-verify-lock.sh hold (VERDICT command-exit 0): pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build exit 0, then pnpm --filter @objectstack/dogfood test (no shard, no path): Test Files 479 passed | 3 skipped (482), Tests 4072 passed | 68 skipped (4140), exit 0. No failure.
  • Earlier heads: 65f7837f gave Test Files 478 passed | 3 skipped (481), Tests 4055 passed | 68 skipped (4123); a4f80eb9 the same, all green.
Local runs
  • pnpm --filter @objectstack/objectql test on 8d567553 (same lock hold): exit 0, Test Files 607 passed (607), Tests 13667 passed (13667). Earlier, typecheck + suite on 65f7837f: exit 0, Tests 13617 passed (13617).
  • pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/import-summary-update-lock-34672.test.ts src/rest-data-blank-typed-value.test.ts on 8d567553: exit 0, Test Files 2 passed (2), Tests 10 passed (10).
  • pnpm check:facade-delegation-only on 8d567553: exit 0 (protocol.ts 11694 lines, ceiling 11705). node scripts/pm/overlap-check.mjs on 8d567553: VERDICT clean exit 0 against main 46991d0e, fix(audit): a search the server widens never names a column the caller may not query #34817 and fix(objectql)!: a predicate update judges each matched row against the parent roll-ups the rows before it move #34709.
  • pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/rest-data-blank-typed-value.test.ts src/import-summary-update-lock-34672.test.ts src/import-row-dropped-fields-20701.test.ts on 76acd4f2: Test Files 3 passed (3), Tests 20 passed (20).
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on 76acd4f2: 100 derived gate commands, each :: exit 0; --ran reconciliation: 100 derived famil(ies) accounted for — 100 run, 0 NOT-MEASURED. check:type-check-debt first exited 3 (lock queue timeout behind the dogfood run) and re-measured OK after it. The per-command log is kept with the seat.
  • The full @objectstack/rest suite and the other packages: CI Test Core.
  • CI on 91202760: every check-run success or skipped (59 runs).
  • CI on 8d567553 (55 runs): 38 success, 15 skipped, Test Core (7/10) failure and the Test Core aggregate cancelled. The one failing test is packages/qa/scenarios/test/skill-evals/skill-evals.test.ts ("--regrade … a reworded case keeps its record bytes"), Test timed out in 5000ms (it took 6810ms). That file landed on main today and this PR does not touch packages/qa/scenarios; Test Core (7/10) is green on main 46991d0e. Lint & Repo Gates, TypeScript Type Check, Build Core, Check Changeset, Dogfood Regression Gate and Governed Surface Queue Guard: success.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (packages/spec not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint is CI's run (not run locally).
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Taken over by repo:objectstack#3 area o3-J (claim 6948796553 on #34672, seat 2 hand-off 6948320778).


🤖 Generated with Claude Code

https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX

…r or not it declares readonly: true

The update's static-readonly schema view (updateStaticReadonlySubject) now
reads every `summary` field as `readonly: true`. A person's PATCH, an
import with writeMode 'update', a predicate update and the update-mode
preview drop the value and report it as `readonly`; strictReadonlyWrites
refuses it. The roll-up recompute writes under isSystem, which the static
strip exempts, so it keeps writing. Insert is unchanged: a caller's
initial value is kept, as the summary note on RUNTIME_OWNED_FIELD_TYPES
requires.

Claude-Session: https://claude.ai/code/session_01ADHkmNeSWABJwKsumBUZq9
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 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 — 21 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 fff0ad0c180c08ac8de7db8499863bdfb69842e2 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from a189267454139de981fa30aa66a4d47a948de8ab — the merge of head bfe6c78aa6ca6b2a2c1bc2c430ffb83599188b11 into base fff0ad0c180c08ac8de7db8499863bdfb69842e2, 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 a189267454139de981fa30aa66a4d47a948de8ab && git checkout a189267454139de981fa30aa66a4d47a948de8ab
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin fff0ad0c180c08ac8de7db8499863bdfb69842e2 bfe6c78aa6ca6b2a2c1bc2c430ffb83599188b11 && git checkout -B drift-repro fff0ad0c180c08ac8de7db8499863bdfb69842e2 && git merge --no-ff bfe6c78aa6ca6b2a2c1bc2c430ffb83599188b11

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

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

…ore copying rows and read without untyped options

check:objectql-double-limit graded the new find double as touching rows
before the bound; check:query-options-erasure counted the rest pin's
untyped findOne options.

Claude-Session: https://claude.ai/code/session_01ADHkmNeSWABJwKsumBUZq9
Co-authored-by: Claude <noreply@anthropic.com>
…s read-only on update

A caller's blank for a summary field is now dropped on PATCH, batch
update and updateMany, so the stored roll-up stays; every other typed
column still stores null, and the create doors are unchanged.

Claude-Session: https://claude.ai/code/session_01ADHkmNeSWABJwKsumBUZq9
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmSLi1reMd27fT62jJ3

Final head · PR #34752 · 2026-11-17T12:19Z

Final head for L1 and L2: 76acd4f2f680121c929adaf0074d038ffd9dfb7f. Check-runs on this head: 55, of which 40 success and 15 skipped, none red.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 76acd4f · 2026-11-17T12:20Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmTHGRTjPqZAcBuo9WH

席位核对

L1 first review · ACCEPT · head 76acd4f2f680121c929adaf0074d038ffd9dfb7f (final head 6947848777) · card #34672 · read 2026-11-17T12:21Z

Checklist (read on GitHub at this head, not from the report)

  • Shape:
    • Draft PR against main, mergeable_state: clean. The title carries !.
    • The only closing-keyword hit is Fixes #34672.
    • The route is the area's decision, recorded on the card in 6943935029: the static readonly strip on update, with no contract change.
    • The surface is amended twice, in 6943935029 and 6946301740. Both cover all 7 files.
  • Declarations:
    • Clause-②: no (narrowing) and Metadata-protocol: none hold, read from the diff. A non-system update that stored a value in a summary column on main now drops it, or refuses it under strictReadonlyWrites. No schema key or value moves.
    • The changeset is patch with **BREAKING** and FROM → TO, and gives the fix: leave the field out, or write with isSystem. Its ADR-0087 disposition is not-required (no-migration-prescription).
    • Skills-docs: none holds. skills/objectstack-data/rules/relationships.md teaches the recompute but not a caller write to the column.
  • Mechanism, read in the source:
    • updateStaticReadonlySubject now overlays readonly: true on every summary field that does not already declare it. It keeps the existing organization-sparing branch, now applied only when it is due.
    • Because every update-side static pass reads this one view, all five take the same keys: the pre-hook hide, the by-id strip, the predicate strip, staticReadonlyStoredView, and the update preview.
    • The strip already skips isSystem, so recomputeSummaries, the backfill and the enable refresh keep writing.
    • A before* hook's own write is recorded by hook-write-provenance and is not taken by the strip. So only caller writes move.
    • Insert is untouched, and the rule-validator 里 RUNTIME_OWNED_FIELD_TYPES 的排除理由对 summary 是错的:summary 是「存储列」不是「读时计算」 #6014 note on RUNTIME_OWNED_FIELD_TYPES stands. summaryFieldsLockedOnUpdate keys on type === 'summary' literally.
  • Tests:
  • Gates at this head:
    • Check-runs on 76acd4f2…: 59 runs, all completed: 42 success, 17 skipped, 0 failed.
    • git merge-tree --write-tree against today's origin/main is clean.
    • check-governed-merges.mjs --pr 34752, read here: 0 of 7 paths governed, 537 lines.
    • The full dogfood battery is pinned at 65f7837f (478 files, 4055 tests, VERDICT 0). The final head adds only the one REST test file on top of it, which the dogfood package does not read.

Before landing (body only, no head move)

  • The PR body has no attribution footer. It ends with the template checklist and the signed line. AGENTS.md's PR-body form is a blank line, ---, then _Generated by [Claude Code](https://claude.ai/code/session_<id>)_. Please add it, keep the signed line after it, and read the body back.

Residual (no change asked)

  • updateStaticReadonlySubject now returns a fresh schema view on every call for any object that has a summary field. Before, it returned the same object unless the organization branch applied. No caller I found caches by that view's identity. This is noted for the contract tier only.

Owed after this

  • L2: owed, CONTRACT_REVIEW_TIER (a declared narrowing).
  • Landing tier: narrowing, handed to the seat for Tier H. Not governed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 76acd4f2f680121c929adaf0074d038ffd9dfb7f
Local-runs: none
Scope: packages/objectql/src/engine-top-level.ts, packages/objectql/src/engine-summary-update-lock.test.ts, packages/objectql/src/engine-blank-typed-value-door.test.ts, packages/rest/src/import-summary-update-lock-34672.test.ts, packages/rest/src/rest-data-blank-typed-value.test.ts + read in the cited code, not reviewed: packages/objectql/src/engine-update.ts, packages/objectql/src/engine-validate.ts, packages/objectql/src/engine-master-detail-related.ts, packages/objectql/src/validation/rule-validator.ts, packages/objectql/src/engine-summaries-and-expansion.ts, packages/objectql/src/summary-enable-refresh.ts, packages/objectql/src/summary-backfill.ts, packages/objectql/src/engine.ts, packages/objectql/src/index.ts, packages/objectql/src/core.ts, packages/metadata-protocol/src/seed-loader.ts, packages/rest/src/import-prepare.ts, packages/rest/src/data-action-routes.ts, packages/spec/src/data/field-value.zod.ts, packages/spec/src/data/field.zod.ts, packages/spec/src/contracts/data-engine.ts

Inputs read: card #34672 body and all 6 comments (triage 6939838658, claim 6943806073, follow-up 6943855383, route amendment 6943935029, surface amendment 6946301740, dev report 6947820885; the card carries no maintainer ruling and no earlier contract record); PR #34752 body, 7-file list, the 3 PR comments, and the net diff from merge-base 6091b64 to the head; the check-runs on the head. Check-runs: 59 listed, all completed, every conclusion success or skipped, none failed, none pending. The Dogfood Regression Gate shards are among the skipped ones on this head (see ③).

① Derived judgments

The one behavioural hunk is updateStaticReadonlySubject in engine-top-level.ts: the schema view every update-side static readonly pass judges now carries each type === 'summary' field as readonly: true (summaryFieldsLockedOnUpdate). I traced each consumer of that view at the head: the pre-hook hide pass (engine-update.ts 569-592), the by-id strip (1474), the predicate strip (1866), staticReadonlyStoredView (the readonlyWhen strips and staticReadonlyStripTakes in the master-detail settlement), and the update-mode preview (engine-validate.ts 313). No other caller of stripReadonlyFields reads this view; the two insert-side callers read insertStaticReadonlySubject, which this diff does not touch.

Accept-set changes, each a narrowing, for a summary field that does not declare readonly: true (one that does is unchanged):

  • Engine update by id, any context without isSystem: true, a call with no context included: main stored the caller's value; the head drops the key before the driver and reports { reason: 'readonly' } through onFieldsDropped. RIGHT, pinned (new engine test, by-id case; forced edit 1 below shows the no-context call).
  • Engine update by predicate (multi: true): main stored it on every matched row; the head drops it from all rows and reports once. RIGHT, pinned.
  • REST PATCH /api/v1/data/:object/:id: main answered 200 and stored it; the head answers 200, stores the rest, and names the field in droppedFields. RIGHT, pinned on SQLite.
  • REST batch operation: 'update' and REST updateMany: main stored it; the head keeps the stored value. RIGHT, pinned by forced edit 2 (stored value only; droppedFields is not asserted on these two doors).
  • Import writeMode: 'update', dry run and commit: main reported ok and stored it; the head reports the row's droppedFields on both and stores the engine's value. RIGHT, pinned.
  • validate with mode: 'update': the preview reports the same drop. RIGHT, pinned.
  • Under strictReadonlyWrites, by id and by predicate: main wrote; the head refuses the whole update, nothing written. The refusal is the ordinary one: the strip is the same stripReadonlyFields call with the same strictReadonlyWrites option, and the test reads code ERR_READONLY_FIELD_REJECTED, fields, drops, operation: 'update', the shape any read-only field gets. RIGHT, pinned at the engine; no REST-level strict case is in the diff.
  • By construction, not pinned here: every other door that reaches engine.update without isSystem takes the same strip, such as the update arm of an upsert import, a hook's or action's ctx.api update and a flow's update step.

What is kept, read in the code:

  • System writes are exempt on every pass: the hide pass and both strips are gated on !opCtx.context?.isSystem, and staticReadonlyStoredView returns the payload untouched when the strip does not run. The roll-up recompute writes with { ...execCtx, isSystem: true } plus SUMMARY_RECOMPUTE_WRITE (engine-summaries-and-expansion.ts 603, 675); the enable refresh and backfillSummaryNulls write with { isSystem: true }; the seed loader writes every row under SEED_WRITE_EXECUTION_CONTEXT, system-elevated per its docblock. The lock never reads the marker, so no system writer depends on it. RIGHT.
  • A value a hook assigns is kept: the strip skips a key in hookWrittenKeys and a key whose value is no longer the caller's. Generic strip behaviour, unchanged; no new pin for a hook-written summary.
  • preserveAudit keeps a caller's summary value on update: isPreservableUnderAudit admits any field that is not system: true, so a historical import (treatAsHistorical, gated by importControlOptOutRefusal) in update mode still stores it. That is the declared contract of the readonly key, and a summary that declares readonly: true answers the same on main. See N1.
  • Insert is unchanged: insertStaticReadonlySubject and the runtime-owned strip are untouched, RUNTIME_OWNED_FIELD_TYPES still holds only autonumber, and the new test pins that a person's create keeps a supplied summary value with no drop event. The PR body and the changeset both state it. TRUE in the code.

Public surface: summaryFieldsLockedOnUpdate is exported from the module engine-top-level.ts only. engine.ts does not re-export it and neither package entry (index.ts, core.ts) names it, so it is not a published export, and the changeset is right not to name it. No spec path, no schema, no new drop reason.

The two forced test edits, as evidence of the narrowing:

  1. engine-blank-typed-value-door.test.ts, case "update by id and update by predicate": it used to assert that a blank sent for f_summary reached the driver as null on update and on updateMany, that is, the engine accepted a caller clearing a roll-up. It now asserts that neither driver call carries an f_summary key; every other typed column still lands null.
  2. rest-data-blank-typed-value.test.ts, the PATCH, batch update and updateMany doors on SQLite: each used to assert a stored null in f_summary over the seeded 7. Each now asserts the stored 7 stays. The create, batch create and createMany assertions are unchanged and still store null for a blank summary.

② Semver level

patch on @objectstack/objectql, with Clause-②: no (narrowing) and Metadata-protocol: none on both the PR body and the changeset. RIGHT.

  • none holds: nothing a metadata author can write is added, refused or tightened, and packages/spec is not touched. The published spec already classes summary under COMPUTED_VALUE_TYPES, "Server-computed types: never client-written", and the docs page already called summary fields server-owned; the engine now enforces that on update. Main carries the same pattern as precedent (for example .changeset/33922-install-local-namespace-gate.md, an enforcement of an existing declaration declared none).
  • Level: AGENTS.md Post-Task step 3, a non-protocol breaking change ships patch and keeps its BREAKING banner and ADR-0087 disposition. The changeset has the banner, the one-line fix (leave the field out, or write with isSystem: true) and exactly one ADR-0087 marker. Check Changeset is success on the head.
  • packages/rest changes tests only and publishes nothing; no second package is owed.
  • The changeset's account matches the code for the doors it names. Its two omissions are N1.

③ Boundary flags

Security-touching: yes
The diff changes a server-enforced write guard: which caller may store a value in a column.

  • open_questions in the dev report: empty. Nothing to answer.
  • Dev flag, insert half (out_of_scope_findings, "noted, not filed"): ESCALATE to the seat. The card's Expected names every person and import write, and its first repro is a value stored "while no order exists", which a create reproduces exactly: a person's POST with a summary value is still stored until the first child write. The update lock is therefore not parity with readonly: true, which strips on insert too. Leaving insert alone is consistent with the rule-validator 里 RUNTIME_OWNED_FIELD_TYPES 的排除理由对 summary 是错的:summary 是「存储列」不是「读时计算」 #6014 note and is the area's route (6943935029), not a maintainer ruling. The PR body says Fixes #34672, so landing closes the card with that half open. The insert half needs its own card, with the maintainer deciding whether the rule-validator 里 RUNTIME_OWNED_FIELD_TYPES 的排除理由对 summary 是错的:summary 是「存储列」不是「读时计算」 #6014 note stands, before the Tier H step; no change to this head is needed for that.
  • Dogfood battery: the claim says the PR owes the battery pinned to its head. The evidence is the lane's own run on 65f7837f; the head differs from it by packages/rest/src/rest-data-blank-typed-value.test.ts alone (I confirmed the one-file delta in git), and the CI dogfood shards are skipped on this head. I accept the one-test-file delta as immaterial to the dogfood package; the seat should know the battery is not a check-run verdict on this head.
  • Deviation, opened before fix(objectql)!: a predicate update judges each matched row against the parent roll-ups the rows before it move #34709 landed: answered by the lane's merge-tree note; not re-derived here. Whichever lands second re-merges.
  • SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join; summaryFieldsLockedOnUpdate is a walk of the in-memory field map.
  • Spec prose outside the diff, follow-up only: the onFieldsDropped docblock in packages/spec/src/contracts/data-engine.ts and the readonly key's description list what the readonly reason covers and do not name a summary on update.

④ Design judgment

No must-fix, no should-fix.

The narrowing makes the spec's own refusal real; it takes no declared capability away. Read on main: COMPUTED_VALUE_TYPES declares summary never client-written; the only caller-supplied summary value the tree declares as supported is the initial value on insert (the #6014 note on RUNTIME_OWNED_FIELD_TYPES), which this diff leaves alone and pins. The Console and the import template already treat the type as non-writable. Nothing on main declares a person's update of a roll-up as a capability; the comment on stripComputedWriteFields records it as measured behaviour and "a separate question".

The placement is sound. Putting the lock in the one view all five update-side passes read means the hook view, the readonlyWhen record view, the stored row and the preview cannot disagree about the column. Using the static readonly strip instead of the computed door is what keeps the recompute's own write: that door runs in every context. Reusing reason readonly follows the autonumber precedent and adds no vocabulary.

Attempts to break it, and what I found:

  • A system writer that loses its write: none. Recompute, enable refresh, backfill and the seed loader all write under isSystem.
  • A schema-shape dependency: the view now returns a fresh { name, fields } object whenever the object has a roll-up. The consumers read name and fields only, and the organization branch already returned that shape on main.
  • An explicit readonly: false on a summary is locked too. Intended by the card ("whether or not"), and readonly defaults to false, so the two spellings were never distinguishable.

N1 (nit) — prose faces. The changeset and the fields.mdx paragraph say an update drops the value and name isSystem as the one exemption. Three statements are missing: (a) a historical import (treatAsHistorical, hence preserveAudit) in update mode keeps a supplied summary value, as it keeps any business read-only value; (b) an upsert import drops it on rows it updates and keeps it on rows it creates; (c) undoing an import committed before this release restores its before snapshot through an ordinary update (data-action-routes.ts, the undo door), so a summary value that import overwrote is not put back by the undo and stays until the next child write. I read (c) in the code and did not trace whether the undo answer reports the dropped key. Fixable in the changeset and the docs page.

N2 (nit) — the lock keys on type === 'summary' alone, while the roll-up index (getSummaryDescriptors) also needs summaryOperations and a resolvable child relation. A summary the engine has no descriptor for is locked on update although nothing recomputes it, so "the next child write replaces it" does not hold for that field. Lint already reports a summary without summaryOperations as incomplete, so no working declaration is affected. Leave as an accepted deviation.

N3 (nit) — engine-validate.ts calls updateStaticReadonlySubject once per row, so a preview over an object with roll-ups now copies the field map per row where it returned the schema itself. Small beside the strip's own walk of the same map. Leave as an accepted deviation.

Implemented-by: claude/project-thread-sd08sq
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

…for a summary field on update

Claude-Session: https://claude.ai/code/session_01ADHkmNeSWABJwKsumBUZq9
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR

席位核对

L1 delta review · ACCEPT · Head-sha: 91202760fd51b93095440d60dcb68810e7a1ce83 · delta 76acd4f2..91202760 (one commit; 76acd4f2 is an ancestor) · card #34672 · read 2026-11-17T13:08Z

Prior records at 76acd4f2: L1 ACCEPT 6947895896 and L2 PASS 6948085736. Hand-off 6948320778, takeover 6948796553.

Delta read (prose only: the changeset and content/docs/data-modeling/fields.mdx, +9 / -2)

This commit answers L2 N1 (a)–(c). I checked each new sentence against code at this head.

  • (b) Upsert. "An import with writeMode: 'upsert' drops the value on the rows it updates and keeps it on the rows it creates." This matches L2's code read (the update lock acts on the update write, and the insert path is untouched). It also follows from the page's own two rules just above it (on update, dropped; on create, kept), which the docs sentence ties together with "therefore". True.
  • (a) Historical import. "A historical import (treatAsHistorical: true, which writes with preserveAudit) keeps a summary value on update as well, as it keeps any other read-only value it sends." This matches L2 ①: isPreservableUnderAudit admits any field that is not system: true. True.
  • (c) Undo, and the changeset's added clause "and so does the undo of such an import". I read packages/rest/src/data-action-routes.ts at this head:
    • The undo door restores log.updated through p.updateData({ data: u.before, context: writeCtx }) (:1046-1048).
    • writeCtx comes from importUndoWriteContext (:291-297), which adds preserveAudit: true only when the job is treat_as_historical.
    • So undoing an ordinary import is an ordinary update: a summary value that an earlier import overwrote is dropped, not put back. Undoing a historical import keeps it. Both sentences are true.
  • Wording. The changeset says "committed before this release" and the docs page says "committed before this rule". Both name the same set: imports written before the lock, the only ones that could have overwritten a summary. Neither is false.
  • Scope. Both files were already in the PR. Nothing else moved.

Findings

  • must-fix: none.
  • should-fix: none.
  • nit: none new. L2 N2 and N3 stay as accepted deviations, as L2 recorded them. L2's escalation of the insert half (a create still stores a supplied summary value, while the PR says Fixes #34672) is the seat's to settle before the Tier H step, as L2 6948085736 ③ says. This delta does not change it.

Gates at this head (read 2026-11-17T13:08Z)

  • Check-runs on 91202760…: 59, all completed, with 42 success and 17 skipped, none failed.

Owed after this (nothing here readies, queues or arms the PR)

  • Seat L2 delta: the face is Clause-②: no (narrowing), and the delta moves the changeset text, which is the narrowing's published statement. A CONTRACT_REVIEW_TIER delta read of these two prose files is owed. It is short.
  • Not governed (per the area). The narrowing goes to the seat for its record. The insert-half question in L2 ③ stays open for the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 91202760fd51b93095440d60dcb68810e7a1ce83
Local-runs: none
Scope: .changeset/34672-summary-readonly-on-update.md, content/docs/data-modeling/fields.mdx + read in the cited code, not reviewed: packages/rest/src/data-action-routes.ts, packages/rest/src/import-prepare.ts, packages/core/src/utils/import-runner.ts, packages/objectql/src/engine-update.ts, packages/objectql/src/engine-insert.ts, packages/objectql/src/engine-top-level.ts, packages/objectql/src/engine-summaries-and-expansion.ts, packages/objectql/src/validation/rule-validator.ts, packages/spec/src/kernel/execution-context.zod.ts

Delta record. It covers 76acd4f2..91202760 only. L2 6948085736 (PASS at 76acd4f2) stands for everything else and is not re-derived. The delta is one commit whose parent is 76acd4f2, with no merge of main in it, so no --remerge-diff was needed. It changes two prose files, +9 / -2, and no code or test.

Read for this record: card #34672 (body and all 9 comments, scope note 6948112119, hand-off 6948320778 and takeover 6948796553 included), PR #34752 (body, the 6 comments, L2 6948085736, L1 delta ACCEPT 6948959772), the delta diff, and the check-runs on the head: 59, all completed, 42 success and 17 skipped, none failed. Nothing was built or run.

① Derived judgments

The delta changes no accept-set and no public surface. It adds five statements to the narrowing's published text. Each is checked against the code at this head.

  • Upsert import: dropped on the rows it updates, kept on the rows it creates. TRUE. import-runner.ts sends a matched row through p.updateData (line 1663) and an unmatched row through p.createData (line 1689) under one writeCtx. The update takes the lock, and the insert path is untouched.
  • A historical import keeps a summary value on update. TRUE. The import writes with preserveAudit: true when treatAsHistorical is set (import-runner.ts:1135). Both update strips pass preserveAudit to stripReadonlyFields (engine-update.ts:1474, :1866), and isPreservableUnderAudit keeps any field that is not system: true (rule-validator.ts:2877). The synthesized readonly: true does not set system.
  • "And so does the undo of such an import" (changeset). TRUE. importUndoWriteContext adds preserveAudit: true for a treat_as_historical job, for every caller (data-action-routes.ts:291-297).
  • Undoing an ordinary import restores through an ordinary update, so the summary value is not put back. TRUE. The undo sends u.before through p.updateData with that context (data-action-routes.ts:1048). captureBefore keys the snapshot on the import's payload keys (import-runner.ts:898-900), so a summary column that an older import sent is in the snapshot, and the lock drops it on the restore. One case the sentence does not name: an in-process caller that undoes as the system principal writes under isSystem, so its restore is kept. "Ordinary" covers it, and no HTTP caller is the system principal.
  • "Committed before this release" (changeset) and "before this rule" (docs). Same set, neither false. Only an import committed before the lock could have overwritten a summary.
  • "It stays until the next child write recomputes it." True for a summary the engine has a descriptor for. L2's N2 (a summary without a descriptor is locked but never recomputed) applies to this sentence as it does to the earlier ones.

② Semver level

Unchanged and still right: patch on @objectstack/objectql, Clause-②: no (narrowing), Metadata-protocol: none, the BREAKING banner, the one-line fix and exactly one ADR-0087 marker. The delta touches none of those lines. Check Changeset is success on this head. The published statement of the narrowing is now complete for the update side.

③ Boundary flags

Security-touching: yes
The delta states which callers may store a value in a guarded column (the historical import, its undo, the upsert create rows).

  • N1 in the PR body. The Acceptance notes carry the three answers (upsert, historical import, undo) and say they were written by 91202760 over the reviewed head. They agree with the changeset and the docs page.
  • PR body, two stale lines (body only, no head change). The Verification section still opens with "Final head 76acd4f2", and the "CI on 76acd4f2" line is one head old. The seat can correct both when it edits the body.
  • Dogfood battery. The last battery ran on 65f7837f. The Dogfood Regression Gate is among the 17 skipped check-runs on this head. The hand-off (6948320778) says a fresh run on the landing head is owed, and I agree: it is the narrowing's landing gate and no check-run answers it here.
  • main has moved. The merge-base is still 6091b645. One commit on main since then (13057ce1, feat(spec, lint): a permission set can acknowledge a meant roll-up read with rollupSourceUnreadableReason #34775) edits content/docs/data-modeling/fields.mdx. GitHub reads the PR as mergeable (clean). If the landing merges main, that merge is read with --remerge-diff.
  • SQL push-down: not applicable, the delta is prose.

The escalation: is seat 2's scoping of the insert half (6948112119) sound?

Short answer: the scope is sound, one of its two reasons is not, and one thing is owed before landing. It is not a finding on this head.

What I verified in the code at this head:

  1. The hole is real and it is the card's own first repro. A signed-in person's POST (or an import in insert mode, or the create rows of an upsert) that carries a value for a summary field without readonly: true stores that value. initializeSummaryFields skips a field the caller supplied (engine-summaries-and-expansion.ts:491-503), RUNTIME_OWNED_FIELD_TYPES holds only autonumber, and the PR's own test pins it ("insert keeps a caller's initial value"). The card's first repro is "the stored value is 90 while no order exists". A create reproduces exactly that state, and on a record that never gets a child write the value never heals.
  2. The card's Expected does cover it. It reads "read-only for every person and import write". So the scope note's sentence "not a gap in this card" is wrong as written. It is a gap in the card's Expected, left open on purpose.
  3. Changing it does overturn a standing design statement, so it cannot be done under this card. The rule-validator 里 RUNTIME_OWNED_FIELD_TYPES 的排除理由对 summary 是错的:summary 是「存储列」不是「读时计算」 #6014 note (rule-validator.ts:1867-1899) says in words that supplying an initial summary value is "a SUPPORTED authoring path", and names "a plain (non-isSystem, non-preserveAudit) import of a parent carrying task_count: 42" as the case to protect. It also warns that a naive strip stores null, because the seed pass has already skipped the field. That is a declared capability on main. Taking it away is a second narrowing with its own design (strip and re-seed, or refuse), its own BREAKING changeset and a maintainer ruling. This part of the seat's reasoning holds.
  4. A fact the ruling should have, which neither the seat nor L2 states. The two beneficiaries the note and the PR prose name, seed data and historical imports, no longer need the carve-out. The seed loader writes under SEED_WRITE_EXECUTION_CONTEXT, which is isSystem: true (execution-context.zod.ts:829). A historical import is refused for every caller but the system principal (importControlOptOutRefusal, import-prepare.ts:431, security: any user who may import can send runAutomations: false and skip every trigger and metadata-bound hook, so a sales rep bypasses an approval gate and a closed-record freeze through POST /data/:object/import #24348). The system principal passes every create-side strip. So the only caller the insert carve-out still serves is an ordinary signed-in person or an ordinary import, which is the card's actor. The case for keeping rule-validator 里 RUNTIME_OWNED_FIELD_TYPES 的排除理由对 summary 是错的:summary 是「存储列」不是「读时计算」 #6014 as it stands is weaker than the scope note says.

Against the two tests the seat asked for:

  • Does landing the update half leave a false answer? Not in the product. The changeset and the docs page both say in plain words that a create keeps a sent value, and the code agrees. It would leave a false answer on the board: Fixes #34672 closes a card whose Expected is half met, and the scope note makes the insert card conditional ("if it is wanted"). No insert card exists today (searched). After the merge the open half would live only in a closed PR's notes.
  • Does it leave a security hole the card promised to close? It closes every write the card measured (all three repros are a PATCH or an import update). It leaves the create door, which the card's Expected names in words but did not measure. That door is not opened or widened by this PR, the declared mitigation works on it today (readonly: true is stripped on a non-system create, isSystem being the create strip's only exemption), and the card says the app is already adding readonly: true.

So it is a separate gap that needs its own card, and it is not an S item on this PR. The diff is correct and complete for what it claims, and no change to this head would close the gap. But the gap is not a nit either, so it may not stay open without a carrier. Owed by the seat before the Tier H step, none of it moving the head:

给维护者的一句话:本 PR 只锁「更新」,这部分正确、可以落地。「新建」时普通用户仍能给汇总字段带任意初值(卡片第一个复现「没有订单却存了 90」用新建同样能复现),这是卡片 Expected 写到、但本 PR 有意没做的另一半。它与 #6014 的既有设计冲突,需要你单独裁决,所以应另开一张卡,而不是算作本卡之外。另外,#6014 当初要保护的种子数据和历史导入,现在都以系统身份写入,本来就不受限制,所以保留这个口子的理由比席位说明里写的要弱。落地前请席位先把这张卡开出来。

④ Design judgment

No must-fix, no should-fix.

N1: closed. All three statements L2 asked for are in the changeset and in the docs page, each true against the code (see ①). The added text also names the undo of a historical import, which L2 did not ask for and which is true.

The added docs sentences sit in the right place. They follow the page's own two rules (dropped on update, kept on create), and the upsert sentence is tied to them with "therefore". A reader with an older import to undo learns the one surprising answer: the undo does not put the roll-up back, and the next child write does.

N2 and N3 from L2 stay as accepted deviations, as L2 recorded them. No new nit on the two delta files.

Implemented-by: claude/project-thread-sd08sq
Reviewed-by: session_01WGufzgh1zkZzDXL36ckWAG

VERDICT: PASS

Landing-prep merge for PR #34752 (main at 46991d0).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfr1xZSFZzCR8HnqXX

Red read · PR #34752 · head 8d5675537f · CI run 44136877597 · 2026-11-17T19:17Z

Test Core (7/10) fails on one test outside this PR: packages/qa/scenarios/test/skill-evals/skill-evals.test.ts ("--regrade grades an old answer only against the case that ran > the command: a reworded case keeps its record bytes…") timed out at the 5000 ms default after 6810 ms. That file landed on main today (f012183bc4). This PR touches nothing under packages/qa/scenarios (its delta is 7 files in objectql/rest, unchanged since 91202760), and the same shard is green on main 46991d0e. The Test Core aggregate was cancelled behind it. The full dogfood battery on this head is green (os-dev-report 6958275591). Judged a timing flake. The failed jobs are re-run once, and a second failure is read, not re-run.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

Regen-provenance: 6949128257 · 91202760fd51b93095440d60dcb68810e7a1ce83 → 8d5675537f479c0e47a2c0f0a3db3d07883441f9 · git diff --name-only → (empty)

Merge-only hop (main 46991d0): git merge-tree --write-tree 91202760 46991d0e = de155db1 = the merge commit's tree, so no hand resolution; the L2 record carries to this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

Regen-provenance: 6949128257 · 8d5675537f479c0e47a2c0f0a3db3d07883441f9 → bfe6c78aa6ca6b2a2c1bc2c430ffb83599188b11 · git diff --name-only → (empty)

Second merge-only hop (main fff0ad0): git merge-tree --write-tree of the parents = db98530f = the merge commit's tree; no hand resolution. The L2 record carries to this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfr1xZSFZzCR8HnqXX

Landing · PR #34752 (card #34672, Part of #34672) · head bfe6c78aa6 · 2026-11-17T20:12Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 20:13
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

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

    @objectstack/plugin-security:test:  FAIL  src/org-admin-assignment-boundary.posture.test.ts > [ADR-0090 D12, amended 2026-10-17] the three-officer split: an auditor set carrying a platform-scoped capa
      ↳ 失败原因: @objectstack/plugin-security: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,按失败测试文件聚合):

  • src/org-admin-assignment-boundary.posture.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

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

分诊清单:

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

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

@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

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

    @objectstack/scenarios:test:  FAIL  test/skill-evals/skill-evals.test.ts > --regrade grades an old answer only against the case that ran > the command: a reworded case keeps its record bytes and leave
      ↳ 失败原因: @objectstack/scenarios: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,按失败测试文件聚合):

  • test/skill-evals/skill-evals.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 33 个失败构建(不含本次)。

分诊清单:

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

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

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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants