Skip to content

fix(audit): a search the server widens never names a column the caller may not query - #34817

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-qajjjq
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-qajjjq

Conversation

@os-steve

@os-steve os-steve commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Steve · project thread

Fixes #34700

Clause-②: no
Metadata-protocol: none
Skills-docs: none — no skill or docs page teaches this search set.

Scope: item ① of the card, the server-side list search: the auditor's audit-log search no longer turns the list into 403. The card's other items have landed elsewhere: item ② in PR #34880 (merged c41b6ca286), the ui half in PR #35389 (via #34741). So Fixes #34700 closes the card once this lands. Continued by seat repo:objectstack#4 from 12455d5acc (claim 7121652462).

维护者速读

  • 改了什么: 服务端为列表搜索自动选出的字段集,不再包含对象自身查询守卫会对该调用者拒绝的列(审计日志的 old_value / new_value 快照列、活动流的值列),和 REST search on sys_user answers 403 for non-admin members (search expands to hidden role / ban_reason / last_login_ip) — every user picker breaks when typing #25672 对「调用者不能查询的字段」的处理一致。调用者在 searchFields 里自己点名的列不扣,照旧由守卫拒绝。
  • 为什么改: 三员模式下审计员在审计日志列表里一输入搜索词,整页变成「无权访问」:服务端替他把守卫列放进了搜索集,守卫随即拒掉整个搜索。
  • 风险与回滚: 守卫本身不变,仍是唯一执行点;若扣得不够,守卫照样拒绝,失败方向是拒绝而不是多读。不动 spec。本轮与 main 合并后 engine.ts 超出门面行数上限,所以接口从引擎上的新方法改为 registerMiddleware 的选项 withholdSearchFields(守卫中间件在注册时自带),行为不变。回滚即还原本 PR。
  • 先看: packages/plugins/plugin-audit/src/parent-field-query-guard.ts 的 withheldSearchColumns 与注册处;packages/objectql/src/engine-find.ts 的 resolveSearchWithheldFields;packages/qa/dogfood/test/activity-text-predicate.dogfood.test.ts 那条改过的钉。
  • 两分钟验证: pnpm --filter @objectstack/objectql exec vitest run src/engine-search-field-withholder.test.ts,预期 11 条全绿。
  • 需要你做的: 确认一条既有安全 dogfood 钉的改动:活动流的自由搜索从「匹配与不匹配都拒(403)」改为「两者答得一样(200);点名守卫列 summary 的搜索仍拒(403)」。该确认此前已请求、尚无记录。

What changes

  • packages/objectql: registerMiddleware(fn, options) takes EngineMiddlewareOptions (declared in engine-top-level.ts, exported from the package). Its new withholdSearchFields is a guard middleware's search-field withholder. Before a non-blank search is expanded, the withholders of the middlewares that run for the object (the same object selector executeWithMiddleware applies) name fields to leave out of the server-resolved set, beside the getQueryableFields answer (search-filter.ts withheldFields). A field the caller names in searchFields is kept. Context-less reads and blank terms ask nothing. A set left empty is the existing 400 INVALID_FIELD. A throw propagates.
  • packages/plugins/plugin-audit/src/parent-field-query-guard.ts: the guard's verdict is one function (guardRefuses), shared by the middleware and its withholder (withheldSearchColumns), so the two answer the same rule. Each guard declares its withholder in the registration it already makes. An engine that does not read the option keeps the guard alone, as before.
  • content/docs/permissions/system-context.mdx: census row 45 owns withheldSearchColumns.

Delta since the last reviewed head 54107ea2ac (L1-c2 ACCEPT 6947307277)

  1. 12455d5acc (unreviewed until now): the dogfood pin in activity-text-predicate.dogfood.test.ts follows the rule. Before, on main: for a stored value and a non-matching value, $search=VALUE on sys_activity answers 403 PERMISSION_DENIED. After: $search=VALUE answers 200, the matching and the non-matching probe give the same { status, rows }, and $search=VALUE&$searchFields=summary answers 403 PERMISSION_DENIED. The merge leaves this pin as it is in 12455d5acc (main did not touch the file).
  2. 9fa0bb95b, merge of origin/main f46ce5b4a: one conflict in parent-field-query-guard.ts. Main passes the caller to parentFieldQueryRefusal (its userMessage). It is resolved as the guardRefuses call with main's caller argument.
  3. 6dcdf177c + 18bafcac5: after the merge, engine.ts was 6880 lines, above its facade ceiling of 6857 (scripts/facade-delegation-registry.json, ruling 7051956587; main sits at 6857). The seam moved off the facade: the withholder is now the middleware's own option, not the method ObjectQL#registerSearchFieldWithholder. The entry type lives in engine-top-level.ts. engine.ts ends at 6856 lines and the gate is green. Behaviour is unchanged. One pin is added: a withholder on a middleware for every object (no object, or '*') is asked for each object.

Tests

  • packages/objectql/src/engine-search-field-withholder.test.ts: the seam's contract on find / findOne / count. It covers what is asked, a named field kept, nothing withheld, context-less and blank searches, another object's withholder not asked, an every-object withholder asked, an emptied set answering 400 INVALID_FIELD, and a throw propagating.
  • plugin-audit audit-log-predicate-guard.test.ts and activity-predicate-guard.test.ts: both objects, pinned and unpinned, plus count. A search naming a guarded column is still refused.
  • dogfood audit-log-audit-capability.dogfood.test.ts (the HTTP door for the holder, the read-only member and the admin control) and activity-text-predicate.dogfood.test.ts (the pin in item 1 above).

Acceptance notes

  • The seam's shape changed after the L1 ACCEPT, which covered 54107ea2ac only. This head needs its own review.
  • Raising the engine.ts ceiling was the alternative to moving the seam. That needs a maintainer ruling, so it was not taken.

Verification

All at head 18bafcac5, after the merge, with the closure built (pnpm --filter '@objectstack/dogfood^...' build, exit 0).

Suites under the lock
  • objectql full suite: 637 files / 14378 tests passed.
  • objectql search set (src/engine-search*, src/search-filter*, src/engine-middleware*): 6 files / 70 tests.
  • plugin-audit full suite: 109 files / 1827 tests.
  • dogfood activity-text-predicate + audit-log-audit-capability: 2 files / 39 tests.
  • Typecheck of objectql and plugin-audit (including check:test-typecheck): exit 0.
Derived gates

dispatch-gates.mjs --ran: 109 derived, 109 run, 0 NOT-MEASURED, with an exit code recorded for each of the 109 and all of them 0. That includes check:facade-delegation-only, which was red before the seam moved. check-nul-bytes and check-platform-checklist --changed-from origin/main both exit 0.

Ablation of the moved wiring

Mutation: the withholdSearchFields line in plugin-audit's guard registration was removed with ablation-replace.mjs. plugin-audit was rebuilt, and ablation-dist-preflight --absent confirmed the line was gone from dist. Result: 6 red in the plugin-audit search cases and 4 red in dogfood (the activity pin in three reader classes, plus the audit-log holder case). The named-column refusals stayed green.

Restore: the blob is back to the HEAD blob and git diff HEAD is empty. plugin-audit was rebuilt and the preflight confirmed the marker is absent. Result: 76/76 and 39/39 green.

Full dogfood battery: not run. The title carries no ! and Clause-② has no narrowing arm. CI's Dogfood Regression Gate is the reading of record.

…r may not query

The server-chosen search set of an object leaves out every column the
object's own query guard would refuse this caller, as it already leaves out a
field the caller may not query (#25672). A column the caller names itself is
judged by the guard as before.

- ObjectQL#registerSearchFieldWithholder: the seam an object's own guard uses
  to name those columns.
- plugin-audit registers one for sys_audit_log and sys_activity, answered by
  the guard's own rule; the system-context census row owns it.

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

Copy link
Copy Markdown
Contributor

repo:objectstack#2 · os-steve · session_01ADHkmRPxhTmqbUbMrqygh4

2026-11-17T11:32Z Final head for review: 54107ea2ac (merge base origin/main 6091b64). Not a governed surface (check-governed-merges: 0 of 13 paths), not a narrowing, no packages/spec. 107 derived gates run, all exit 0; suites and ablation counts are in the body's Verification. Draft until review.


Generated by Claude Code

@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

This PR changes 2 package(s): @objectstack/objectql, @objectstack/plugin-audit, touching 22 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/objectql/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/ai/connect-mcp.mdx (via withheldFields (symbol, a field of interface ExpandSearchOptions))
  • content/docs/api/data-api.mdx (via searchFields (symbol, a field of interface SearchFieldWithholdingRequest; a field of type GuardSearchFieldWithholder))
  • content/docs/api/error-catalog.mdx (via searchFields (symbol, a field of interface SearchFieldWithholdingRequest; a field of type GuardSearchFieldWithholder))
  • content/docs/data-modeling/queries.mdx (via expandSearchToFilter (symbol, a top-level function), searchFields (symbol, a field of interface SearchFieldWithholdingRequest; a field of type GuardSearchFieldWithholder))
  • content/docs/kernel/contracts/data-engine.mdx (via searchFields (symbol, a field of interface SearchFieldWithholdingRequest; a field of type GuardSearchFieldWithholder))
  • content/docs/permissions/system-context.mdx (via installParentFieldQueryGuard (symbol, a top-level function), withheldSearchColumns (symbol, a top-level function))
  • content/docs/protocol/kernel/error-handling.mdx (via searchFields (symbol, a field of interface SearchFieldWithholdingRequest; a field of type GuardSearchFieldWithholder))
  • content/docs/protocol/objectql/query-syntax.mdx (via expandSearchToFilter (symbol, a top-level function), searchFields (symbol, a field of interface SearchFieldWithholdingRequest; a field of type GuardSearchFieldWithholder))

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

  • content/docs/releases/v17/17-0.mdx (via searchFields (symbol, a field of interface SearchFieldWithholdingRequest; a field of type GuardSearchFieldWithholder))
  • content/docs/releases/v18/18-3.mdx (via searchFields (symbol, a field of interface SearchFieldWithholdingRequest; a field of type GuardSearchFieldWithholder))

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 changed file(s) yielded no anchor (packages/objectql/src/index.ts) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: ObjectQL (symbol, 82 pages)
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 124 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 — 30 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 8f141a28dc6f179ad10dfe018e0cf0c93346d0c3 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 8f141a28dc6f179ad10dfe018e0cf0c93346d0c3

⚠️ 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 8f141a28dc6f179ad10dfe018e0cf0c93346d0c3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#2 · os-steve · session_01ADHkmTPcB6fZEwhd2hNQwC

席位核对

L1 verdict: ACCEPT · PR #34817 · card #34700 (server half, list search only, per 6943935258 / ruling 6946587690) · first review · L1-c2 of seat repo:objectstack#2

Head-sha: 54107ea2acac740124c8a5fb2563570cf0ab5353 (the head of final-head comment 6946844641)

Read from GitHub and the diff at this head, not from the report. 13 files, +478/−50. This review stays at the rule level, as the card's ruling asks.

Shape

Rule checked against the code: a search set the server chooses leaves out every column the object's own query guard would refuse this caller, as #25672 already does for fields the security service withholds. A column the caller names in searchFields is never left out, so the guard still judges it.

  • search-filter.ts withholdUnqueryable: named.has(f) || ((!queryable || queryable.has(f)) && !withheld?.has(f)). A named field is kept, and withholding only ever removes fields.
  • engine-find.ts asks the withholders only for a non-blank term with a context, and it passes the caller's own where.
  • A set withheld down to nothing is the existing 400 INVALID_FIELD, with the withheld wording extended.
  • A throw propagates, so it does not fail open into an unnarrowed set.
  • count and aggregate reach the same expander.
  • The guard stays the one enforcement point and is unchanged in behaviour.
    • guardRefuses is the old middleware body moved verbatim: the same fail-closed catch and the same two questions.
    • The middleware and the withholder now ask that one function, so the two cannot drift.
    • The withholder's early exits mirror the middleware's: no context, a system context, no security service, no guarded column in the set.
    • If the withholder ever left too little out, the guard would still refuse the expanded query. The failure mode is therefore a refusal, never a widened read.
  • The side-copy branch withholds only the carrier columns when the rest of the set is admitted under the pinned parent. That is the guard's own question asked a second time, not a new judgement.
  • The engine seam is optional on the plugin side (registerSearchFieldWithholder?.), so an engine without it keeps the guard alone, as before.

Pins

  • objectql seam: 7 cases covering what is asked, a named field kept, nothing withheld, context-less and blank searches, another object's withholder, the emptied set → 400, and a throw.
  • plugin-audit: both guarded objects, pinned and unpinned, plus count. A matching and a non-matching probe give the same answer, so the oracle stays closed. A search naming a guarded column is still refused. The unrestricted control is unchanged.
  • dogfood: the HTTP door on a real boot for the holder, the non-holder and the admin control.
  • The ablation (registration removed → 6 plugin-audit and 1 dogfood red, while the named-column refusals stay green) is lane-reported, and I did not re-run it.

Docs: the system-context.mdx census row 45 gains the withholding in its "Lose" text, and the owned-symbol table gains withheldSearchColumns (count 1).

Gates: 55 check-runs on this head, all completed: 40 success, 15 skipped, 0 failed or cancelled. The lane reports the derived ledger (107/107, 0 NOT-MEASURED) at this head. The objectql full suite was run on the same source before the rebase, so CI at this head is the reading of record for objectql.

L2 owed: no. None of the four contract faces is touched: Clause-②: no, no narrowing (the change only answers searches that were refused), no packages/spec/src, no governed rule text. The new ObjectQL#registerSearchFieldWithholder and its two exported types are an additive engine seam, not a spec contract.

Landing tier: NOT governed (0 of 13 paths), +478/−50 = 528 lines ≤ 3000, no spec face, no narrowing. The area lands it (ordinary queue landing). The card is security-labelled: whether anything beyond this PR is owed (the held item ②) stays with the security seat, per the ruling.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#2 · os-steve · session_01ADHkmRPxhTmqbUbMrqygh4

2026-11-17T11:55Z Landing 54107ea2ac: L1-c2 ACCEPT 6947307277 at this head, L2 not owed (no contract face touched), not a governed surface, CI 40 success / 15 skipped / 0 failed. Ready and auto-merge armed by the area per the seat's order.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 11:56
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Dogfood Regression Gate (2/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {"object":"sys_activity","records":[],"total":0,"hasMore":false}: expected 200 to be 403 // Object.is equality
    

↳ 失败原因 是判读的关键:超时(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/activity-text-predicate.dogfood.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

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

分诊清单:

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

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

This was referenced Nov 19, 2026
One conflict, packages/plugins/plugin-audit/src/parent-field-query-guard.ts:
main passes the caller to parentFieldQueryRefusal (the refusal's
userMessage); this branch moved the middleware's verdict into guardRefuses.
Resolved as the guardRefuses call with main's caller argument.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmQuAhLgegkqRcTc38
…rch-field withholder in its own registration

The merge with main put engine.ts over its facade line ceiling (6880
against 6857), and a facade file does not grow. The withholder is no
longer a method on the engine: registerMiddleware takes
EngineMiddlewareOptions, whose withholdSearchFields the search expansion
asks for the reads that middleware runs on (the same object selector).
The entry type lives in engine-top-level.ts, so engine.ts ends at 6856.
plugin-audit's two guards declare theirs in the registration they
already make. Behaviour is unchanged; one pin added for a middleware
that runs for every object.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmQuAhLgegkqRcTc38
…om where it is declared

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

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — L1 REWORK · head 18bafcac55f8a5a3ae39dc6022fa4109c952aae6 · 2026-11-24T07:44Z

  • Shape. l1-face --pr 34817: one flag, shape (the PR is ready, not draft; it stays as it is). Everything else is ok: first-line Fixes #34700, no other card closed, no releases path, a changeset for @objectstack/objectql and @objectstack/plugin-audit (patch, not empty), no NUL suspects, declarations Clause-②: no / Metadata-protocol: none, Skills-docs not owed, floor checks and all checks green, dogfood not owed. mergeable_state is clean. No review exists at this head.
  • Delivery vs card. The only change against main is item ①, the server-side list search. Fixes is right: item ② landed in docs(permissions): a three-officer split keeps the auditor's set outside the organization boundary #34880 (merged c41b6ca286), and the ui half console: hide the add / remove controls for permission sets outside a delegated security admin's scope (split from #34700) #34741 is closed, completed by fix(app-shell): a permission set outside a delegated security admin's scope offers no Add and no Remove #35389 (merged 438ff477b5). The changes since L1-c2 ACCEPT 6947307277 (54107ea2ac) are these. 12455d5acc changes the dogfood pin. 9fa0bb95be merges main, and its one conflict resolves to guardRefuses plus main's ctx.context argument (parent-field-query-guard.ts:538). 6dcdf177c7 + 18bafcac55 move the seam to registerMiddleware(fn, { object, withholdSearchFields }). The interdiff shows no change in behaviour. The middleware selector (engine-find.ts resolveSearchWithheldFields) matches executeWithMiddleware (!m.object || '*' || === object). engine.ts is 6856 lines against a ceiling of 6857.
  • Gates. There are 59 check-runs at the head, with 0 failed or pending. Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Check Changeset and Governed Surface Queue Guard are all success. The Dogfood Regression Gate shards are skipped on the PR, so the queue runs them.
  • Tests evidence. The evidence is real and pinned to 18bafcac5: the objectql full suite at 637 files / 14378 tests, and the withholder pin at 11/11, which matches the file (3+1+1+1+1+2+1+1). The plugin-audit full suite is 109 files / 1827 tests, and the two dogfood files are 39/39 locally. An ablation of the moved option turned 6 plugin-audit cases and 4 dogfood cases red, while the named-column refusals stayed green. The full dogfood battery was last green at 12455d5acc, before the merge, not at this head.
  • Dogfood pin change (activity-text-predicate.dogfood.test.ts; main :418, head :423-433). The merge left it byte-identical to 12455d5acc, because main never touched the file.
  • Findings.
    • must-fix: packages/qa/dogfood/test/audit-log-audit-capability.dogfood.test.ts:424-425. The new refusal pin (searchFields=old_value) asserts only status === 403, with no code (ADR-0112). Add PERMISSION_DENIED, the way the activity pin does at :430-431.
    • nit: activity-text-predicate.dogfood.test.ts:430-431. The named probe asserts code and status but not the refusal words, which the file's own expectRefused (:258) checks.
    • ok: the sentences of the changeset and of system-context.mdx row 45 ("Lose: … the withholding of those columns from such a reader's server-chosen search set") and of the owned-symbol row withheldSearchColumns | 1 | 45 are true to the code (one isSystem exit). SQL push-down holds: the set narrows before expandSearchToFilter, and the $or still goes to the driver. Discipline: nothing more is said about item ②, there is no exploit recipe, and the failure direction is a refusal.
  • L2 face. record-recognisers --paths: the paths decide no face (no packages/spec/src, no governed path). The changeset reads Clause-②: no with no (narrowing) arm, so none of the four faces applies. L2 not owed. The widened registerMiddleware options are an additive engine type, not a spec contract (the REST search on sys_user answers 403 for non-admin members (search expands to hidden role / ban_reason / last_login_ip) — every user picker breaks when typing #25672 precedent).
  • Out of scope. origin/main has moved 17 commits beyond the merge base, touching engine-find.ts and engine-top-level.ts, and the PR is still clean against it.

…nvelope and the refusal words

The ledger pin for a search naming old_value now asserts the nested
error code PERMISSION_DENIED beside the 403. The activity-stream pin for a
search naming summary asserts through the file's own expectRefused, so
the refusal's first sentence is pinned too.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmQuAhLgegkqRcTc38
…oute answers it

Measured on the real boot: GET /data/sys_audit_log answers the refusal
with the message in error and the code at the top level of the body.

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

objectstack-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 81705ebb1af2e8f1140f30df8d87d467e0f8e6a7 · 2026-11-24T09:43Z

  • Delta since L1 REWORK at 18bafcac55: two commits, test-only, 2 files (+3 −2).
    • 64202f756b: activity-text-predicate.dogfood.test.ts:430 — the named-column refusal now goes through expectRefused (:258-262: status 403, code PERMISSION_DENIED, and the ADR-0112 first sentence from predicateWords('sys_activity','summary')). This closes the round's must-fix.
    • 81705ebb1a: audit-log-audit-capability.dogfood.test.ts:426-427 — the ledger's named snapshot-column refusal also asserts code PERMISSION_DENIED (top level of that route's body), not the status alone.
  • Shape. l1-face --pr 34817: one flag, shape (ready, not draft — inherited from the previous holder; left as is). All other items ok. Fixes #34700, Clause-②: no, Metadata-protocol: none; changeset unchanged (@objectstack/objectql, @objectstack/plugin-audit, patch). Not governed. mergeable_state clean.
  • Gates. Check-runs at 81705ebb1a: 40 success, 15 expected skip, 0 failed, 0 pending. Dogfood shards are queue-run; the dev reports the two touched dogfood files 39/39 at this head (report 7126189592).
  • Accepted deviation. None beyond the previous round's.
  • Out of scope. None filed.
  • Landing condition — HELD. The sys_activity dogfood pin change (BEFORE: a server-widened $search → 403; AFTER: 200 with matching = non-matching rows, a named column still 403 PERMISSION_DENIED) extends the rule the maintainer approved for sys_audit_log to the activity stream. The maintainer's confirmation of that extension is owed (options A/B/C, put to the maintainer in the seat session; seat recommendation A). This PR does not go to the merge queue before that answer is recorded on Setup (三员): the auditor's audit-log search box turns the list into 「无权访问」; the security admin's permission-set page offers 添加用户 / 移除 on sets outside their delegated scope #34700.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Landing · 2026-11-24T09:55Z · head 81705ebb1af2e8f1140f30df8d87d467e0f8e6a7

Probe Reading
check-governed-merges.mjs --pr 34817 NOT governed — 0 of 14 paths; 583 changed lines ≤ 3000
landing-k.mjs --pr 34817 OK — K = 7 < 15 on origin/main 4f19091997; no shared book or locale pack moved
pr-state.mjs --pr 34817 40 success · 15 expected skip · 0 failed · 0 pending · mergeable_state clean
os-regen drift 0 — none of the 14 paths is on .gitattributes' merge=os-regen list

State: L1 ACCEPT at this head (seat comment on this PR); the HELD condition is lifted by the maintainer's ruling A on #34700 (comment 7128046786). pr_ready + auto-merge now; the seat follows it to MERGED and closes out #34700 there.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 4db08d5 Nov 24, 2026
55 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-qajjjq branch November 24, 2026 10:20
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

2 participants