Skip to content

37180 跟进:资料包(ai_context)进入按包分桶的四张表,get_record_context 按应用+名字选包 #37216

Todo

Description

@objectstack-fleet

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

Filing gate: ③ maintainer-directed (topic #36996 handed to seat 3). Source: step 3 of #37180, carried by the ADR-0150 addendum in PR #37209 ("Follow-up, one card, after the merge"), and nit N3 of the #37209 contract review (7152486548).
Grading: area:ai · Task · p2 (topic child; blocks row 8, #37141) · evidence: read.

Blocked-by: #37209

维护者速读

What

Measured on main at 886e9707.

  1. Add ai_context to the four lists the addendum names:
    • PACKAGE_SCOPED_TYPES — packages/core/src/package-scoped-resolution.ts:245 (the one rule; packages/objectql/src/package-scoped-resolver.ts:149 throws for a type outside it);
    • PACKAGE_SCOPED_READ_TYPES — packages/objectql/src/package-scoped-read.ts:88 (the /meta by-name read and its ?package= qualifier);
    • PACKAGE_SLOTTED_METADATA_TYPES — packages/spec/src/api/protocol.zod.ts:2753 (the metadata service's slot, packages/metadata/src/package-slotted-store.ts:797 storeWriteKey; uninstall packages/metadata/src/metadata-manager.ts:2880);
    • NAMESPACE_UNIQUE_TYPES — packages/objectql/src/namespace-co-owner-names.ts:96 (child N's install and os validate refusal; its header reserves a new type to the maintainer, and the docs(adr): ADR-0150 addendum — ai_context joins the package-scoped bucket beside skill #37209 merge is that admission).
  2. Move reader 1, pack selection behind get_record_context (packages/services/service-record-context/src/read-set.ts:65 selectContextPack): candidates stay the packs rooted on objectName; context is read as a skill prompt's name is (packages/mcp/src/skill-prompts.ts lookupSkillPrompt): a face (NS-NAME, deriveAiFaceName) answers its one pack; a bare name resolves by D3 as a caller with no package (environment pack, else the one package holder, else 409 naming each candidate by its face). With context omitted, the "several" answer spells each name as its face.
  3. Declare each narrowing with a measured count (Clause-②: no (narrowing) arms): D2's install refusal of a second holder in one namespace; the /meta by-name read of a bare name two packages hold, which today serves the first (getItem) and becomes a refusal.
  4. State and measure the overlay consequence (nit N2): a package-less ai_context row under a name one package holds becomes that holder's customization and is not served (ai_context is not in SEALED_ROW_SERVED_OVERRIDE_TYPES, packages/metadata-protocol/src/protocol-package-bindings.ts), and the rule is read at (type, name) while selection narrows by root, so an environment pack on another root stops being served when a package holding its name installs. That is ADR-0150 D4 as ruled for skill.

Acceptance

Out of scope

Parent: #36996. Related: #37180, #37209, #37140, #37141.
Dedupe words: ai_context PACKAGE_SCOPED_TYPES · context pack package-scoped · get_record_context pack selection face · PACKAGE_SLOTTED_METADATA_TYPES ai_context.


Generated by Claude Code

Activity

  1. added
    area:ai
    on Nov 25, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: first touch 2026-11-25T04:12Z (repo:objectstack#3's request 7152609034)

  3. added
    domain:server
    pm:blocked
    priority:p2
    on Nov 25, 2026
  4. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Row added 2026-11-25T06:13Z, at repo:objectstack#3's request (mailbox #36743, 7154521857). It is a conformance gap against ADR-0160 D4 step 3 as amended by #37196. This card rewrites how get_record_context selects a pack, so the several-packs answer rides here.

    • The several-packs answer gives names only. packages/services/service-record-context/src/sentences.ts:44 (en) and :75 (zh-Hans) severalPacks join the pack names alone. The amended D4 step 3 says each pack is named with its label. Done when both locales list each pack by name with its label, pinned for a pack with a label and one without (the fallback stated). The package-plus-name selection here may change how a pack is named, so write the sentence after that.

    Read on main (the lines are confirmed), not yet measured through the tool.

  5. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Unlocked 2026-11-25T06:38Z. PR #37209 (the ADR-0150 addendum) merged. pm:blocked → pm:queue. Goes to seat 3 zone ai-A. It also carries the severalPacks label row. #37141 (row 8) unlocks when this lands.

  6. added
    pm:queue
    and removed
    pm:blocked
    on Nov 25, 2026
  7. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Claim: PM loop round 7 (area:ai zone ai-A, topic #36996 non-cloud rows) · 2026-11-25T06:55Z
    Session: session_01WGufzi13yZRqVcp2mGonWK
    Account: os-support-ai
    Branch: claude/issue-37216-ai-context-package-scope
    Worktree: objectstack-issue-37216
    Domain: domain:server
    Seat: repo:objectstack#3
    Area: ai-A
    File surface: the four lists (packages/core/src/package-scoped-resolution.ts PACKAGE_SCOPED_TYPES :245; packages/objectql/src/package-scoped-read.ts PACKAGE_SCOPED_READ_TYPES :88; packages/spec/src/api/protocol.zod.ts PACKAGE_SLOTTED_METADATA_TYPES :2753; packages/objectql/src/namespace-co-owner-names.ts NAMESPACE_UNIQUE_TYPES :96, its type union and header) and the code those lists key where a new type needs a row; packages/services/service-record-context/src/** (read-set.ts selectContextPack :65, record-context-tools.ts several answer :265, sentences.ts severalPacks :44/:75 with labels per the triage row 7154571964); packages/mcp/src/skill-prompts.ts only to share the face lookup, never to change skill behaviour; the CLI os validate row for D2's refusal if it is per-type; tests in card-named files unless the shared-harness rule says otherwise; generated spec artefacts; .changeset/.
    Container & model: L, mode:subagent, model: default, effort: high
    Clause-②: no (narrowing) — declared by the ruled ADR-0150 addendum (PR #37209, merged by the maintainer 06:29Z): D2's install / os validate refusal of a second holder of a pack name in one namespace, and the /meta by-name read of a bare name two packages hold turning from first match into a refusal; each with its measured first-party count (expected 0: examples/app-showcase holds two differently named packs in one package; hotcrm declares none). Reader 1 narrows nothing (the interim rule already refuses a shared name on a root). Owes the L2 at CONTRACT_REVIEW_TIER in L1-w.
    Metadata-protocol: narrowed
    Responsibility: n/a — not a defect card (the several-packs label row is a conformance gap against ADR-0160 D4 step 3 as amended by #37196; owner: service-record-context in objectstack; no other path covers it; every MCP caller who omits context on a root with several packs, no first-party root has several today)
    Thread-read: 7155008959
    Premise: holds. Re-measured at d7f299c: the four lists and selectContextPack sit at the card's lines; ai_context is in none of the four lists; severalPacks joins names only (sentences.ts:44, :75). The ruling the card executes is the merged ADR-0150 addendum (6211ddf).
    Serial constraints cleared: Blocked-by: #37209 merged 06:29Z. This zone's #37243 (in flight) edits both doors' listContextPacks and the door.ts docblock, not read-set.ts / sentences.ts; #37233 (queued) will touch body-outline / sentences.ts and goes after this. Overlap check runs at the first push and before each push.
    Pre-claim lane: domain:server (core, objectql, service-record-context); the spec list row stays here by the lane-keep rule and owes the L2.
    Pre-claim deps: Blocked-by: #37209, met (merged 6211ddf)
    Prior rulings read: ADR-0150 addendum of 2026-11-25 (merged, points 1–3 accepted by the maintainer's merge), ADR-0150 D2–D5, D9; ADR-0160 D4 step 3 as amended by #37196; none conflicting

    Done when: two packages each ship a pack of one name on one root: each reached by its face, the bare name answers 409 naming both faces, uninstall keeps the other; a second holder in one namespace refused at install and by os validate; the several-packs answer names each pack with its label in both locales; narrowing counts stated in the PR; #37141 is told it may start.

  8. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
  9. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Release: hand-off · 2026-11-25T07:50Z · zone ai-A of seat repo:objectstack#3 stops this card on the maintainer's order (「那这个新任务就可以停了」「只处理收尾的」, 2026-11-25 07:48Z). Released, not finished; no PR.

    • Backup branch: claude/issue-37216-ai-context-package-scope at 5162430c, base d7f299c0, 5 commits. Resume from it.
    • Declared (carry into the PR): Clause-②: no (narrowing) · Metadata-protocol: narrowed · Skills-docs: follow-up #37177. Narrowings, each measured at 0 first-party (objectstack d7f299c0: the one declarer, examples/app-showcase, holds two differently named packs in one package; hotcrm 9b735103: none): D2's install / os validate refusal of a second holder in one namespace; the /meta by-name read of a bare name two packages hold (first match → refusal); a package-less row under a held name. Owes the L2 at CONTRACT_REVIEW_TIER and the dogfood battery for the narrowing arm.
    • Done on the branch:
      • ai_context in all four lists: PACKAGE_SCOPED_TYPES (core), PACKAGE_SCOPED_READ_TYPES (objectql), PACKAGE_SLOTTED_METADATA_TYPES (spec), NAMESPACE_UNIQUE_TYPES (objectql, union and header noting the addendum's admission); the pins that enumerate these types updated (objectql full suite green, core green).
      • Pack selection (read-set.ts): contextPackCandidates gives each pack its holder (_packageId; the sys_metadata sentinel = environment) and its face (deriveAiFaceName); selectContextPack narrows to packs rooted on objectName, then a face answers its one pack, a bare name resolves by D3 as a caller with no package (environment pack, else the one holder, else 409 naming each face), a face two packs derive is refused naming each holder; RecordContextDoor gains an optional packageNamespace member; the tool description teaches NAMESPACE-NAME. service-record-context tests 82/82, typecheck clean.
      • The several-packs answer (triage row 7154571964): face plus label in en and zh-Hans; a blank label lists the face alone (pinned at the sentence seam).
      • The overlay consequence (card What 4): a new §5 pin in packages/metadata-protocol/src/protocol.reads-environment-only.test.ts with a control (result unread, see owed).
      • Changeset .changeset/37216-ai-context-package-scoped.md (spec, core, objectql, service-record-context minor), marker ai-context-package-scoped-name.
    • Owed:
      1. Three packages/metadata pins the slot list turned red: metadata-manager-keyed-plural-read.test.ts (the live slotted-set enumeration needs ai_context); database-loader.test.ts metadata: the boot priming pass primes one holder per name for unbundled slotted types, so a bare read of a two-holder name answers the last row saved instead of 409 (epic red line 2) #32521 priming, two ai_context cases asserting the pre-slot behaviour (re-read them as slotted).
      2. The metadata-protocol full suite (stopped mid-run; the §5 pin is unread).
      3. Both doors implement packageNamespace (packages/runtime/src/domains/mcp.ts via packageNamespaceOf, packages/mcp/src/stdio-data-bridge.ts), after get_record_context finds no context pack a real protocol serves: getMetaItems adds _diagnostics, the strict AiContextSchema parse drops every pack #37243 lands in the same regions; without them a real door spells package packs by bare name and same-name packs are not reachable by face. This widens the claimed surface.
      4. The ADR-0087 semantic entry packages/spec/src/migrations/entries/semantic/18.ai-context-package-scoped-name.ts (check:adr-0087-registration is red until it exists).
      5. The dogfood battery; the rest of the local gate sweep (52 of 101 ran, 50 exit 0); then a draft PR, Fixes #37216.
    • Noted for 记录 AI 问询 8:技能键 context,MCP 技能提示词可带记录参数 #37141: record-context-tools.zod.ts's context describe still says "by name"; the addendum makes it a face or a bare name.
  10. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 25, 2026
  11. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr

    Claim: PM loop round 6 · 2026-11-25T08:45Z · resume (topic #36996 non-cloud rows, handed to seat 4 by triage 7157351103)
    Area: a4-A
    Session: session_01QSeKYo86w1wqy2z2fMrryr
    Account: os-justin
    Branch: claude/issue-37216-ai-context-package-scope (resumed)
    Worktree: the cloud session's own checkout
    Domain: domain:server
    Seat: repo:objectstack#4
    Resume-from: claude/issue-37216-ai-context-package-scope@5162430c2bdbd77af2efd661ef63eb7687897d70 (hand-off 7156321844; head re-read unchanged, 4 behind main)
    File surface: as claim 7155305628 (the four lists and the code they key; packages/services/service-record-context/src/**; packages/mcp/src/skill-prompts.ts only to share the face lookup; the CLI os validate row for D2's refusal; tests; generated spec artefacts; .changeset/), plus what the hand-off's owed list adds: the three packages/metadata pins (metadata-manager-keyed-plural-read.test.ts, database-loader.test.ts), the metadata-protocol §5 pin, the ADR-0087 semantic entry packages/spec/src/migrations/entries/semantic/18.ai-context-package-scoped-name.ts and its registration, and both doors' packageNamespace (packages/runtime/src/domains/mcp.ts, packages/mcp/src/stdio-data-bridge.ts) — the doors only after PR #37255 (#37243) merges (stop on breach; explain in the report)
    Container & model: L, mode:cloud, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: no (narrowing) — declared by the ruled ADR-0150 addendum (PR #37209, merged): D2's install / os validate refusal of a second holder of a pack name in one namespace; the /meta by-name read of a bare name two packages hold (first match → refusal); a package-less row under a held name; each measured at 0 first-party (hand-off 7156321844). Owes the L2 at CONTRACT_REVIEW_TIER (packages/spec/src/api/protocol.zod.ts) and the dogfood battery for the narrowing arm.
    Metadata-protocol: narrowed
    Responsibility: n/a — not a defect card
    Thread-read: 7156321844
    Premise: holds (hand-off 7156321844; the backup branch carries the four lists, the selection and the several-packs labels; owed items 1–5 as listed there)
    Serial constraints cleared: overlap-check at 5162430c vs origin/main 1b91538bb2 and open PR #37255 (shares service-record-context/src/door.ts): VERDICT clean exit 0; the door step (owed 3) waits for PR #37255 to merge, then merges main first
    Pre-claim lane: domain:server (core, objectql, metadata, service-record-context, runtime, mcp); the spec row stays here by the lane-keep rule and owes the L2
    Pre-claim deps: Blocked-by: #37209 — merged
    Prior rulings read: ADR-0150 addendum (PR #37209, merged by the maintainer), ADR-0150 D2–D5, D9; ADR-0160 D4 step 3 as amended by #37196

  12. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
  13. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr

    Dispatched · 2026-11-25T08:46Z · mode:cloud: cloud session session_01QSeKYohZLmQ1Ug9FKcQtVu (TIER_DEFAULT, effort high), outcome branch claude/issue-37216-ai-context-package-scope, resumed from 5162430c under claim 7157432984. It does the hand-off's owed items 1, 2, 4 and 5; item 3 (both doors' packageNamespace) waits for PR #37255 (#37243) to merge and is reported as owed if it has not. The contract review at CONTRACT_REVIEW_TIER runs after the draft PR, in a separate session.

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

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpm:dispatchedpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions