Description
repo:cloud#1 · os-warren · session_01JQwxbZSA7o5vcLjQjM1myV
Filing gate: ③ maintainer-directed. Source: topic #36996. Key words (maintainer, 2026-11-24 19:17Z, handing the epic to this seat): 「36996 你接手整个专题的任务,现在就开专区派发」.
Grading: area:ai · Feature · p2 (topic child at the epic's level; it blocks rows 7–10) · reach: n/a (new capability) · evidence: read.
Amended 2026-11-25 by the maintainer's session (maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby), on the maintainer's word 「同意你的建议」. The maintainer accepted ADR-0160 points 1, 2 and 10:
- point 1 with three conditions;
- point 2 changed;
- point 10 as written;
- and a bound on carried text.
The record is amended in draft PR #37196 (Tier H; the maintainer merges it). Build to #37196 as drafted; once merged, it is the authority. The changes are marked [amended] below. They come from the ADR amendment and from an independent review of this card.
维护者速读
- 做什么:落地「情境包」这个新元数据类型、按提问人权限读记录的渲染服务、
get_record_context工具(本仓先上 MCP),以及统一的「这是资料,不是指令」包装。类型和它的读者在同一个 PR 里。 - 谁受益:应用作者能声明「这条记录交给 AI 的是哪些字段、哪些关联列表、哪段正文」;外部 AI 经 MCP 一次调用就拿到;应用内助手(第 9 行)用的是同一个工具。
- 不做会怎样:专题第 7–10 行都在等它;AI 只能自己拼
describe_object、get_record、query_records。 - [amended] 某个用户读不了包里的某个关联对象时,省略那一节并说明,不再整包拒绝;多个包被拒时列出「名字(标签)」;关联列表里的长文本受一个总量上限约束,上限按业务证据定。
- 需要你做的:审 docs(adr): ADR-0160 amended — a related child this caller is not served is left out; pack selection conditions; carried-text bound #37196(ADR 修订)并合并。
What
Implements ADR-0160 (docs/adr/0160-record-scoped-ai-inquiry.md) D1, D3, D4 and D5, as amended by #37196:
- The
ai_contextkind (D1).- Strict schema with the six v1 keys
name,label,object,fields,related,body, and bounds on entry counts refused at parse. - Registered on every surface D1 lists: a registry row with the
skillrow's flags, the metadata-core enum, theaiContextscollection key, a liveness row per key, and aKIND_COVERAGErow with an example pack. - [amended] Author defects are reported by
os validatein this PR. The at-save half is 37140 跟进:资料包(ai_context)的作者错误在保存时报出 #37176, which lands before 记录 AI 问询 7:在 Studio 里编辑资料包(ai_context 表单与作者界面) #37143. - [amended] D1's bound on lookups is not built here. Parse cannot tell a lookup from another field, so lookups are bounded by the field-count bound. This deviates from D1's words. Either the approver accepts it, or 37140 跟进:资料包(ai_context)的作者错误在保存时报出 #37176 adds a lookup-count rule. State in the PR which applies.
- Strict schema with the six v1 keys
- The render service (D3), read as the caller.
- Order: objects are judged first, then fields are projected onto the caller's served schema, then the targets of surviving lookups are judged, then the reads run.
- The field-level rule decides withheld vs not-visible.
- An unreadable related row is absent. A lookup the caller cannot open carries no id.
- A long body becomes an outline with anchors.
- The output is one envelope in three parts (data, notes, framing sentence), built by one function (proposed home
@objectstack/core). - [amended] Object level (docs(adr): ADR-0160 amended — a related child this caller is not served is left out; pack selection conditions; carried-text bound #37196, point 2).
- A
relatedchild the door serves to nobody (the system-object refusal, or API exposure off) refuses the whole call. So does a refused lookup target. Both answerPERMISSION_DENIED, naming the object only when the caller's schema shows it. - A
relatedchild that this caller is not served (ADR-0106 object-level visibility) is left out. It is never read, never named, and the notes carry the one not-visible statement.
- A
- [amended] The bound on carried text (docs(adr): ADR-0160 amended — a related child this caller is not served is left out; pack selection conditions; carried-text bound #37196, D3).
- Long-text values in related-list cells are allowed. They count toward one total bound together with the body: every long-text cell counts, a long-text field in
fieldsincluded. - A cut cell is marked
truncated, and the notes state every cut. - The number is a service constant pinned by test. Choose it against business evidence and name the evidence in the PR: whole-policy answering of about 12,000 tokens measured well in BrightRule (objectstack-ai/brightrule
docs/design-record-scoped-ai.md). 8,000 characters as the only bound is too low.
- Long-text values in related-list cells are allowed. They count toward one total bound together with the body: every long-text cell counts, a long-text field in
get_record_context(D4).- I/O is zod in spec beside the dataset tools, projected to JSON Schema, and served by one executor. It runs under
data:readwithreadOnlyHint. - Order of judgement: the root object's gates come before any pack lookup, then pack selection with no fallback.
- The naming bound applies, with
PERMISSION_DENIEDon every object-level refusal. - Optional
McpDataBridgemembers and a#wireBridgeToolsstep; the name joinsMCP_DOOR_TOOL_NAMES. - [amended] The several-packs refusal lists each candidate as name and
label, not the machine name alone (docs(adr): ADR-0160 amended — a related child this caller is not served is left out; pack selection conditions; carried-text bound #37196, point 1, condition 1; D1 nameslabel's second reader).
- I/O is zod in spec beside the dataset tools, projected to JSON Schema, and served by one executor. It runs under
- The package (D5). Proposed as
@objectstack/service-record-contextunderpackages/services/. It exports the read-set function, and the executor plans its reads from that function.
Not here:
- the product-registry registration and the
PLATFORM_TOOLS_BY_PACKAGEentry (row 9); - the skill key (row 8);
- the Studio form (row 7);
- the advisory validation reports of docs(adr): ADR-0160 amended — a related child this caller is not served is left out; pack selection conditions; carried-text bound #37196 D1 (they land with their readers, rows 8 and 6).
Acceptance
- The type and its reader land in one PR (ADR-0049).
Metadata-protocol: added, with itsSkills-docs:line. - Tests pin each of these:
- the order of judgement;
- [amended] a
relatedchild the door serves to nobody refuses the whole call withPERMISSION_DENIED, named only when the caller's schema shows it; - [amended] a
relatedchild this caller is not served is left out: never read, never named, and the notes carry the one not-visible statement. This replaces the merged test "a child the caller is not served is refused PERMISSION_DENIED without naming it"; - a field the served schema hides is not named and yields the one not-visible statement;
- an exempt caller gets the mcp: query_records and get_record say which fields field-level security withheld, so an answer says "not visible to you", not "blank" #35137 withheld naming;
- an unreadable related row is absent, with no id and no count;
- an
anchorthat does not resolve is refused with one answer; - the executor reads no object outside the exported read set;
- [amended] the several-packs refusal names each candidate with its label;
- [amended] a related long-text cell is carried within the total bound. Past the bound it is cut, marked
truncated, and stated in the notes. The bound's value and its evidence are named in the PR; - [amended] text before a long body's first heading is reachable (an outline entry with an anchor) or stated in the notes. It is never silently unreachable (D3: every cut is stated);
- [amended] an
anchorre-read either carries only the section or states that fields and related lists are re-sent. Choose one and pin it: a 25-section document should not re-send everything 25 times without that being a decision; - [amended] parity, ADR-0149 D7: pinned here over one stdio bridge under both MCP transports. The real executor over the runtime HTTP bridge is 37140 跟进:get_record_context 在运行时 HTTP 通道上用真执行器测一遍(含拒绝) #37175.
- The body bound, the carried-text bound and the related-row cap are service constants, pinned by test.
- [amended] One user-facing name. In zh, the kind is 「情境包」 in labels, catalogue entries and executor sentences (today the PR mixes 「AI 上下文包」 and 「资料包」); en stays "context pack".
- [amended] ADR-0160: build points 1 and 10 as merged, and point 2 as amended by docs(adr): ADR-0160 amended — a related child this caller is not served is left out; pack selection conditions; carried-text bound #37196.
Parent: #36996 (row 5). Reader: the epic's owning seat (repo:cloud#1), which dispatches it.
Related:
- docs(adr): ADR-0160 amended — a related child this caller is not served is left out; pack selection conditions; carried-text bound #37196 (ADR-0160 amendment);
- follow-ups cut from feat(ai): ai_context context packs and the get_record_context tool over MCP (ADR-0160 row 5) #37173's review: 37140 跟进:get_record_context 在运行时 HTTP 通道上用真执行器测一遍(含拒绝) #37175 (HTTP-bridge parity), 37140 跟进:资料包(ai_context)的作者错误在保存时报出 #37176 (at-save author reports), 37140 跟进:资料包正文目录设条数上限 #37178 (outline bound), 37140 跟进:资料包(ai_context)按包区分同名,补进 ADR-0150 的分桶表 #37180 (pack naming);
- objectstack-ai/cloud#4969 (narrowing judges this tool by its read set);
- objectstack-ai/cloud#4970.
Dedupe (objectstack, is:issue, open and closed): get_record_context 4 (#36996 epic, #36997 ADR closed, #34830 seat post, #37001 no overlap) · ai_context 3 (#36996, #36997, #37001) · "context pack" 11 (the same three; 8 closed, unrelated).
Activity
objectstack-fleet commentedon Nov 25, 2026
repo:cloud#1 · os-warren · session_01JQwxbakRyu1KGH6y31soLv
Claim: PM loop round 1 (epic #36996 owner seat, card thread)
Session:
session_01JQwxbakRyu1KGH6y31soLvThread session:
session_01JQwxbakRyu1KGH6y31soLvAccount:
os-warrenBranch:
claude/project-thread-k0j3qnWorktree:
objectstack(the card thread's own checkout)Domain:
domain:spec+domain:server(ADR-0160 implementation split, row 5: "spec + server"; nodomain:*label on the card yet)Seat:
repo:cloud#1File surface:
packages/spec/src/ai/**(new tool +ai_contextschema),packages/spec/src/kernel/**(registry row, builtin schema),packages/spec/src/meta-spelling/**,packages/spec/src/system/constants/platform-tool-names.ts(MCP_DOOR_TOOL_NAMESonly),packages/spec/liveness/**,packages/metadata-core/src/types.ts,packages/core/src/**(data wrapper), newpackages/services/service-record-context/**,packages/mcp/src/**(bridge members,#wireBridgeTools, stdio bridge),packages/runtime/src/domains/mcp.ts,examples/app-showcase/src/**(KIND_COVERAGErow + example pack), metadata validation for author defects, changesetsContainer & model:
L,mode:thread,model: default (dispatch-gates --repo objectstack-ai/objectstack --tier at 6161010d: "no path-derived mandate … floor sonnet · default opus · ceiling fable"; Clause ② SUSPECT on packages/spec/src/** → contract review owed at CONTRACT_REVIEW_TIER),effort: highClause-②: yes
Metadata-protocol: added
Responsibility:
n/a — not a defect cardThread-read: none
Premise: holds (origin/main 6161010:
ai_context,aiContexts,get_record_contextdeclared nowhere under packages/, ui/packages/, examples/; ADR-0160 merged at 32c197e)Serial constraints cleared:
none — #37142 (row 6, ask_ai) touches packages/spec/src/ui/action.zod.ts + ui/packages/core, disjoint; #37141 (row 8) and #37143 (row 7) are blocked on this cardRulings carried (ADR-0160, merged; points 1, 2 and 10 stand as written): D1 keys
namelabelobjectfieldsrelatedbody, strict, bounds refused at parse; D3 order objects → fields → lookup targets → reads; D4 root gates before pack selection, no fallback, naming bound withPERMISSION_DENIED; D5 new service package. L1 review: objectstack seat (repo:objectstack#1). L2 contract review owed (Clause-②: yes) at the contract-review tier.os-justin commentedon Nov 25, 2026
os-closed-card-sweep — machine-findable marker for this generated comment.
Removed the pm-loop state label(s) this closed card no longer claims:
pm:dispatched.2a6f26a489, merged intomain.priority:p2,area:ai— ownership, priority and outcome are not state claims.A state label claims work is in flight. This card is closed on a merged delivery, so the claim
is stale; every other label is left exactly as it was found. Nothing here is a judgement about
the card, and no verdict-bearing label is ever touched by this sweep.
seat repo:objectstack#4 closeout after PR #37198 merged (p0 #37174)
Generated by Claude Code
Generated by Claude Code