Skip to content

fix(objectql, lint): synced objects are told to drop write verbs, not to open userActions - #33517

Queued
objectstack-fleet[bot] wants to merge 1 commit into
mainfrom
claude/project-thread-88rfao
Queued

objectstack-fleet[bot] wants to merge 1 commit into
mainfrom
claude/project-thread-88rfao

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

domain:spec#1 · os-project-manager · session_01FEkQ5p6qE7Nt8wpjSGLqiC

Fixes #32134

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:managedBy: 'synced' 对象上,注册时剥除写动词的告警和 lint 规则 object/managed-api-method-unaffordable 的报错/修复行,不再让作者去 userActions 打开写权限,改为:列出要从 enable.apiMethods 删掉的动词,写入走声明的 action(ADR-0153 D5)。os explain 多一段说明。其他 bucket 的文字逐字不变。
  • 为什么改:feat(spec)!: one-way sync-in, the spec half — datasource source, paging and delete policy keys, the pull refusals, and the synced bucket (ADR-0153) #32118 之后,synced 对象上 userActions 打开写动词会在 parse 时被拒(ADR-0153 D4)。旧文案让作者去改 userActions,改完构建又报错,两条信息互相矛盾,作者无路可走。
  • 风险与回滚:只改文案,剥除行为、规则判定、规则 id/严重度/path、schema 都不变。回滚即还原本 PR。
  • 先看:packages/lint/src/validate-managed-api-methods.ts 的 writeLocked 分支;packages/objectql/src/registry.ts reconcileManagedApiMethods 的 remedy。
  • 两分钟验证:pnpm --filter @objectstack/lint exec vitest run src/validate-managed-api-methods.test.ts,预期 15 条全绿(含 synced 的两条新钉子)。
  • 需要你做的:无,席位落地。

What changes

Both sentences branch on MANAGED_BY_WRITE_LOCKED_BUCKETS (@objectstack/spec/data, today synced alone), the same set the parse refusal (refuseWriteLockedUserActions), resolveCrudAffordances and the core /me/permissions clamp already read, so the remedy text and the refusal can never disagree about which bucket is locked.

  • packages/objectql/src/registry.ts reconcileManagedApiMethods. On a write-locked bucket the warning's remedy reads: "userActions cannot open a write on this bucket (ADR-0153 D4): remove [VERBS] from enable.apiMethods and send writes through a declared action (ADR-0153 D5)." Every other bucket keeps "Declare userActions to open a verb the object legitimately takes from a user context." The rest of the line (object, bucket, stripped and kept verbs, the lint rule id) and the strip are unchanged.
  • packages/lint/src/validate-managed-api-methods.ts (object/managed-api-method-unaffordable). On a write-locked bucket the verdict reads "enable.apiMethods advertises [VERBS], which managedBy: 'synced' refuses, and userActions cannot open a write there, so the registry strips them", and the fix line reads "Remove [VERBS] from enable.apiMethods, and send writes through a declared action". Every other bucket keeps "(needs userActions …)" and both ways out. Rule id, severity, where, path and the verdict itself are unchanged.
  • packages/lint/src/rule-explanations.ts. os explain object/managed-api-method-unaffordable gains one paragraph: on synced userActions cannot open a write (ADR-0153 D4), so the fix line offers only the removal, and a write goes through a declared action (ADR-0153 D5).
  • .changeset/32134-synced-remedy-text.md: @objectstack/objectql patch, @objectstack/lint patch. Both packages ship dist/ (files: [dist, README.md, CHANGELOG.md]); the new text is in packages/objectql/dist/index.js and packages/lint/dist/index.js after build.

File surface. The order named managed-api-affordance.ts's describeManagedApiMethodConflicts as the lint sentence's source. Measured on origin/main f068cde8: the lint rule no longer reads it (it builds its own message and hint, validate-managed-api-methods.ts L110-114, and its CHANGELOG records the switch), and the helper has no production caller, only its own test. The seat amended the claim's surface to the lint rule, its test and the explain paragraph, and ruled the spec helper out of this PR (no parameter added to an export nobody calls). No packages/spec file moves, so there is no spec changeset.

Tests

  • packages/objectql/src/registry.test.ts: a synced fixture pins the whole warning line; a control on engine-owned pins today's line byte for byte.
  • packages/lint/src/validate-managed-api-methods.test.ts: a synced fixture pins the whole verdict, and one with every write verb pins the whole fix line (and that it never says userActions); the existing exact pins on platform (verdict) and better-auth (fix line) are the controls and are unchanged. The explanation's fact list gains ADR-0153 D4 and ADR-0153 D5. Both synced cases are recorded by the file's one-line, at-most-200-characters checks.
Ablation: each synced branch forced off, red, restored (head f127667)

Both suites import the subject from src/ (./registry, ./validate-managed-api-methods); MANAGED_BY_WRITE_LOCKED_BUCKETS comes from spec's built dist/ and was not mutated, so no rebuild sits in either leg.

registry.ts: "const remedy = MANAGED_BY_WRITE_LOCKED_BUCKETS.has(managedBy)" -> "const remedy = false"
  anchor x1 -> x0, replacement x0 -> x1, blob eb3b6f1d1036 -> 856148d4ab92
  x on a synced object, the warning names the verbs to drop and a declared action, never userActions
  Tests 1 failed | 106 passed (107)
  ok restored: blob == HEAD (eb3b6f1d1036) and `git diff HEAD` is empty

validate-managed-api-methods.ts: "const writeLocked = MANAGED_BY_WRITE_LOCKED_BUCKETS.has(bucket);" -> "const writeLocked = false;"
  blob 682b98ae055e -> 6f513b203589
  x on a synced object, the verdict says userActions cannot open a write, never "needs userActions"
  x on a synced object, the fix line offers only the removal and a declared action
  Tests 2 failed | 13 passed (15)
  ok restored: blob == HEAD (682b98ae055e) and `git diff HEAD` is empty

Control leg on the base: registry.ts at f068cde8 with this PR's test file, -t reconcileManagedApiMethods: only the synced pin fails (Tests 1 failed | 17 passed | 89 skipped), so the engine-owned control pins the line main prints today. Restored, git diff HEAD empty.

Acceptance notes

  • The spec helper still says "(needs userActions …)". describeManagedApiMethodConflicts (packages/spec/src/data/managed-api-affordance.ts L142-150) takes only the conflicts, which carry no bucket, and nothing in the platform calls it any more. Left as it is by the seat's ruling; reported to the seat to card.
  • No generated reference or skill renders either sentence. git grep for the rule id and for "Declare userActions" over skills/, content/ and docs/ answers nothing, so nothing is regenerated.

Verification

On head f127667d (branch claude/project-thread-88rfao, merge base origin/main f068cde8), each exit code captured before any pipe:

  • pnpm --filter @objectstack/objectql --filter @objectstack/lint test (under the verify lock): exit 0; lint Test Files 210 passed (210), Tests 8973 passed (8973); objectql Test Files 595 passed (595), Tests 13013 passed (13013).

  • pnpm --filter @objectstack/objectql --filter @objectstack/lint typecheck (tsc --noEmit plus check:test-typecheck over tsconfig.test.json): exit 0, no new pinned signature ("39 file(s) / 233 error(s) / 64 pinned signature(s) held" for objectql, "2 file(s) / 6 error(s) / 2 pinned signature(s) held" for lint).

  • eslint --no-inline-config on the five changed source and test files: exit 0.

  • Derived gates (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, 73 families): 72 exit 0; pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (needs every package's dist/), NOT MEASURED, CI runs it. --ran: "73 derived famil(ies) accounted for — 72 run, 1 NOT-MEASURED".

  • dispatch-gates --tier: no path-derived mandate; 121 changed lines, under the 3000 threshold; no governed surface.

  • origin/main moved to e40cd1e2 after the run; none of its commits touches the changed files or object.zod.ts.

  • CI families are read from this PR's check-runs, not re-run here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5p6qE7Nt8wpjSGLqiC

… to open userActions

On a managedBy 'synced' object the parse refuses a userActions entry that
opens a write (ADR-0153 D4), yet the registry's stripped-apiMethods warning
and the object/managed-api-method-unaffordable finding both prescribed
exactly that. Both now branch on MANAGED_BY_WRITE_LOCKED_BUCKETS: on synced
they name the verbs to remove from enable.apiMethods and point writes at a
declared action (ADR-0153 D5). Every other bucket keeps today's sentence.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5p6qE7Nt8wpjSGLqiC
@objectstack-fleet objectstack-fleet Bot added the domain:spec Domain lane — seat card indexed by label:pm:seat label Nov 14, 2026
@github-actions github-actions Bot added 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 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/lint, @objectstack/objectql, touching 2 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/data-modeling/objects.mdx (via reconcileManagedApiMethods (symbol, a top-level function))

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

  • content/docs/releases/v16.mdx (via reconcileManagedApiMethods (symbol, a top-level function))

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 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 — 25 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 e40cd1e28dd79e60e7f4be0db06f071f3f962574 → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 e40cd1e28dd79e60e7f4be0db06f071f3f962574 → 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

domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag

ACCEPT · PR #33517 (#32134) · head f127667d57f892250715fef4164103bc13274403 · 2026-11-14T23:53Z

席位核对

  • 形态: 6 files (read from the PR's file list, not the report): the reconcileManagedApiMethods warning in packages/objectql/src/registry.ts (+11/−4) and the object/managed-api-method-unaffordable message and hint in packages/lint/src/validate-managed-api-methods.ts (+16/−7) branch on MANAGED_BY_WRITE_LOCKED_BUCKETS; one os explain paragraph in rule-explanations.ts; tests beside each; one changeset (@objectstack/objectql patch, @objectstack/lint patch). No governed path, no packages/spec path (record-recognisers: no face; the changeset's Clause-②: no gives the declaration face, TIER_DEFAULT), under 3000 lines: Tier S, the seat's own ACCEPT.
  • 前提实测: the seat read the diff: on synced the warning and the finding now say userActions cannot open a write there (ADR-0153 D4, the parse refusal of PR feat(spec)!: one-way sync-in, the spec half — datasource source, paging and delete policy keys, the pull refusals, and the synced bucket (ADR-0153) #32118) and point at removal plus a declared action (D5); every other bucket keeps today's sentence byte for byte (the else arms are the old text). The strip and the rule's id, severity, path and verdict are untouched. Surface per the seat's amendment 6885418970 (the lint rule builds its own text; the spec helper has no production caller and is left alone).
  • 门禁 check-runs: latest attempt on this head 71 runs: 56 success, 15 skipped, 0 failed.
  • 契约复审: not required: no hits path, Clause-②: no. Seat ACCEPT at TIER_DEFAULT.
  • 接受的偏差: none beyond the amended surface. check:dual-build-cjs-loads not measured locally (needs every dist); CI's build and type-check runs answer it. Clause-②: no / Metadata-protocol: none.
  • 范围外去向: describeManagedApiMethodConflicts (a zero-caller published export whose sentence still names userActions) → spec: describeManagedApiMethodConflicts is a published export with no production caller, and its sentence still prescribes userActions on a synced object #33522 (p3, taken by spec seat 4).
  • 落地条款: ready + auto-merge now under the maintainer's standing order 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z). K = 3 commits on main past this head's affected-set base e40cd1e2 (< 15, no merge of main needed).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 23:53
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Any commits made after this event will not be merged.
@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

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

    @objectstack/plugin-approvals:test:  FAIL  src/action-page-member.integration.test.ts > [#22578] handleActionPage — the ADR-0043 action page from a Request > GET renders the confirm page for a live to
      ↳ 失败原因: @objectstack/plugin-approvals: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 队列共有 24 个失败构建(不含本次)。

分诊清单:

  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

domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag

重排一次:队列弹出原因是 @objectstack/plugin-approvals src/action-page-member.integration.test.ts 5000ms 超时(triage 6887787718,汇总 #33508),与本 PR 无关;修复 PR #33543 已合入 main。head 未变,原 ACCEPT 仍有效。

This branch has not been deployed

No deployments
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 domain:spec Domain lane — seat card indexed by label:pm:seat size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant