Skip to content

Studio 重构(1-2a):元数据列表响应加一个按名字索引的修改时间兄弟字段(服务端,协议新增) #36894

Description

@os-support-ai

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

③ topic child · Source: topic #36890 (decision 2: the list gets a 「修改时间」 column). Part of #36890.

为什么

专题的统一列表要一列「修改时间」(决定 2)。今天列表行拿不到这个时间。

今天(读代码确认,主干 0819cab)

  • 列表响应是 items: z.array(z.unknown())(packages/spec/src/api/protocol.zod.ts:368-370),每一项是整个元数据体。已有的附加信息(registrations、disabledActions)都放在「items 旁边、按名字索引」的兄弟字段里,说明写着「Beside the items, never inside one」(:371-389)。
  • 修改时间只在单项读取里从存储行取(packages/metadata-protocol/src/protocol-meta-item-reads.ts:1173-1174)。代码包里的项没有存储行。
  • 「有草稿」已有台账 GET /api/v1/meta/_drafts(protocol-drafts.ts:77),不在本卡范围。

要做的

  1. 在元数据列表响应加一个兄弟字段(建议名 changedAt: { <名>: ISO 时间 },开发者可定名,在 PR 里写明),只给有存储行的项;代码包自带、没有存储行的项不出现。
  2. 跨包列表(~all)和环境范围下一项可能有多层存储行:写明取哪一层的时间(建议:生效的那一层),并有测试。
  3. spec 的响应 schema、TSDoc、生成的 API 面、文档同步;列表类型钉测试更新。

不做的

  • 不改每一项的元数据体;不做客户端列(1-2b)。

验收

  • 自建包里改一项后列表响应带它的时间;代码包自带的项不带;~all 下取层规则有测试。
  • check:api-surface、check:docs 和列表类型钉测试通过;changeset 按协议新增定级。

Grading: area:ux · Feature · metadata list (builders cannot see what changed recently) · builders, often · evidence: read from code. Maintainer-sourced topic child ⇒ p2.
Dedupe: metadata list updatedAt / changedAt (no card on this field).
Reader: seat repo:objectstack#3, one os-dev card at contract tier (protocol added ⇒ L2 contract review). Size M. Metadata-protocol: added. Wave 0 (can start now).

Activity

  1. added
    enhancement
    priority:p2
    pm:queue
    domain:server
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Claim: PM loop round 1
    Session: session_01WGufzgNtKtppbRbXmHGH8x
    Account: os-support-ai
    Branch: claude/issue-36894-list-changed-at
    Worktree: objectstack-issue-36894
    Domain: domain:server
    Seat: repo:objectstack#3
    Area: ux-E2
    File surface: the metadata list read in packages/metadata-protocol/src/** (protocol-meta-list-reads.ts and a new helper/test file beside it), GetMetaItemsResponseSchema and its TSDoc in packages/spec/src/api/protocol.zod.ts plus its pin tests, the generated API surface / reference docs those regenerate, the REST/MCP list door only if it re-shapes the list envelope, and a changeset 36894-list-changed-at.md; no ui/** (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: default — dispatch-gates.mjs --tier: "Model tier — no path-derived mandate"; Clause ② SUSPECT surface packages/spec/src/api/protocol.zod.ts ⇒ L2 at CONTRACT_REVIEW_TIER by the L1-b (2) thread, effort: high (spec + protocol)
    Clause-②: yes
    Metadata-protocol: added
    Responsibility: n/a — not a defect card
    Thread-read: none
    Premise: holds (read on origin/main 4f7d6f7: GetMetaItemsResponseSchema is { type, items: z.array(z.unknown()), registrations?, disabledActions? } with the "Beside the items, never inside one" sibling precedent (packages/spec/src/api/protocol.zod.ts:355-389); the list response carries no change time; the stored row's updated_at reaches only the by-name read via served-row-changed-at.ts (#31196, a non-enumerable symbol that never leaves the process))
    Pre-claim lane: repo:objectstack seat 3 area ux-E2 (epic #36890, list side, seat order 08:58Z); server paths packages/metadata-protocol/** + packages/spec/src/api/**; lane-keep rule: Clause-②: yes stays in this area, the seat is told in one line, L2 by L1-b (2)
    Pre-claim deps: no Blocked-by: line; wave 0 of #36890
    Prior rulings read: check-prior-rulings --card 36894 --paths protocol.zod.ts,protocol-meta-list-reads.ts: card thread 0 rulings of 0 comments; ADR hits come from the title term studio only, none on list-response sibling fields; the surface's ⛔ lines are about other schemas; the governing shape is the sibling-field precedent above and epic #36890 decision 2 (code-shipped items have no row, so no entry). same-day churn: 151e812 (#36881) — 基于合并后的代码工作,issue 引用的片段可能已变,先核对当前 main。
    Serial constraints cleared: no open PR touches protocol-meta-list-reads.ts; open PR #36916 edits protocol.zod.ts at GetLocalesResponseSchema (:4817), far from GetMetaItemsResponseSchema (:368); #36860 part (b) (card thread, not yet a PR) widens the served list to 27 types in the console, not this server read; overlap-check re-run before the first push

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 24, 2026
  4. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x
    os-dev-report

    {
      "issue": 36894,
      "status": "done",
      "branch": "claude/issue-36894-list-changed-at",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36940",
      "pr_number": 36940,
      "remote_head": "origin/claude/issue-36894-list-changed-at @ 7a43945db5c334631fe1ee8d5703e03d3bf68c7f",
      "session": "session_01WGufzgNtKtppbRbXmHGH8x",
      "premise_still_valid": true,
      "summary": "GetMetaItemsResponseSchema gains optional `changedAt` (name kept from the card): item name to the ISO-8601 UTC Z instant of the stored row whose content the list serves; code-shipped/file-loaded items get no entry, absent when none. The row time rides each stored row's merge contribution (stamped after transform in mergePackageAwareOverlay), so ~all and package-scoped lists answer the EFFECTIVE layer (pinned: a newer package-less row does not win over A's served row); ?preview=draft answers the draft row's time where the draft is served; duplicate names take the latest; only the served effective face answers it and the time is stripped from every returned item. The REST/runtime /meta list chain (createMetaListAnswer step 8a) keys changedAt only by names it still lists, so per-caller-withheld or filtered items are not disclosed; MCP list_metadata_items (own summary envelope, carries no sibling fields) measured and left unchanged. Owed: L2 contract review at CONTRACT_REVIEW_TIER (not run by dev).",
      "tests": "metadata-protocol `pnpm test` 368 files passed/9 skipped, 23383 tests passed; rest `pnpm test` 429/429 files, 8812 passed; spec `pnpm test` 886/886, 28155 passed; typecheck metadata-protocol+rest+spec exit 0; runtime import-side meta-list-projection-parity + protocol-fault + read-gate-parity 3 files 1421 passed (runtime^... closure built). New: protocol.meta-list-changed-at.test.ts 18 tests; rest meta-list-names-filter.test.ts +3; spec meta-item-response-shapes.test.ts +2 + compile-time Eq pin. Ablations via scripts/ablation-replace.mjs (anchor 1->0, restore blob==HEAD, git diff HEAD empty): merge stamp removed -> protocol pin 15 failed/3 passed (the 3 assert absence); REST step 8a removed -> 2 failed/16 passed; tests import source modules (no dist in resolution path). Suites ran at e1e67934d..0469803ee; merge of origin/main (7a43945db) touched none of these packages.",
      "gates": "Local (exit captured before pipe), 38 families: engine-double-contract 0 after ledger --write (first 1: new double unrecorded), test-source-alias 0 after collection-time objectql import in the edited rest test (first 1), objectql-double-limit 0, durability-log-level 0, nul-bytes 0, issue-citations 0, doc-authoring 0, cross-package-test-inputs 0, route-envelope 0, spec-docblock-symbol-anchors 0, startup-registry-verdict 0, adr-0087-registration 0, changeset-no-major 0, empty-changeset 0, spec check:api-surface 0, check:authorable-surface 0, check:docs 0, check:exported-any 0, check:generated --fix 0 (regenerated protocol.mdx), docs-spec-enumerations 0, spec-parsed-alias 0, meta-type-normalized 0, slot-lookup 0, keyed-text-bounds 0, dispatcher-error-vocabulary 0, where-matcher 0, type-check-coverage 0, undeclared-dep-imports 0, adr-anchors 0, closing-keyword-parity 0, pm-prior-rulings 0, error-status-conformance 0, published-files 0, dts-closure 0, merge-driver 0, adr-links 0, corpus-claim-drift 0. dispatch-gates --ran (first 20 recorded): 127 derived, rest declared to CI. CI on head 7a43945db: 70 check-runs all success/skipped, incl. Lint & Repo Gates success, TypeScript Type Check success, Test Core 10/10 success, Build Core success, Governed Surface Queue Guard success, Type Check UI success, Test UI 16/16 success, Build & E2E UI success, Live E2E UI success, Check Changeset success, PR-body guards success, Lint UI skipped (no ui diff), Dogfood shards skipped on PR (queue-only).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm (Clause-②: yes)",
      "mcp_calls": "0 — no MCP GitHub calls",
      "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/pulls, draft, assignees os-support-ai, read back identical 8352 bytes); post-stamped issue comment on #36894 (this os-dev-report). git push is not a REST write.",
      "line_budget": "608 changed lines (+595/-13, 12 files) vs 1500 stop line / 3000 human-review line; one PR for the card",
      "files_changed": [
        ".changeset/36894-list-changed-at.md",
        "content/docs/references/api/protocol.mdx",
        "packages/metadata-protocol/src/listed-row-changed-at.ts",
        "packages/metadata-protocol/src/protocol-meta-list-reads.ts",
        "packages/metadata-protocol/src/protocol-overlay-merge.ts",
        "packages/metadata-protocol/src/protocol.meta-list-changed-at.test.ts",
        "packages/rest/src/meta-item-read-gate.ts",
        "packages/rest/src/meta-list-names-filter.test.ts",
        "packages/spec/authorable-surface/api.json",
        "packages/spec/src/api/meta-item-response-shapes.test.ts",
        "packages/spec/src/api/protocol.zod.ts",
        "scripts/engine-double-contract.pinned.json"
      ],
      "deviations": [
        "File surface: the stamp is 3 lines in protocol-overlay-merge.ts (the list read's merge, under the claim's packages/metadata-protocol/src/** list-read clause), the REST chain step in packages/rest/src/meta-item-read-gate.ts (the door re-shapes the list by dropping items, so the field must be pruned there), and scripts/engine-double-contract.pinned.json (gate-required ledger row for the new test double); all named in the PR Acceptance notes.",
        "test:repo (vitest repo project) not run locally; declared to CI (Test Core green).",
        "Merged origin/main (5 commits, none touching the three packages) before opening the PR; affected suites were run on the pre-merge head.",
        "Waited on CI in the foreground (dispatch said drive CI green) via REST polling; gh pr checks --watch refused (GraphQL 403)."
      ],
      "Dev-effort": "high",
      "Rounds": 1,
      "owed": "L2 contract review (Clause-② surface packages/spec/src/api/protocol.zod.ts) at CONTRACT_REVIEW_TIER — not run by dev",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: existing `registrations`/`disabledActions` siblings pass the list chain unpruned, but measured the per-caller gate drops no flow or object items (object is projected, not removed), so no disclosure today"
      ]
    }
  5. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x
    os-dev-report

    {
      "issue": 36894,
      "status": "done",
      "round": 2,
      "Rounds": 2,
      "branch": "claude/issue-36894-list-changed-at",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36940",
      "remote_head": "origin/claude/issue-36894-list-changed-at @ b6ae895c8baeef0c4c054e3374cdf4e5c6a07b14",
      "session": "session_01WGufzgNtKtppbRbXmHGH8x",
      "answers": "L1 REWORK 7129315458, L2 should-fix S1, S2 and nit N3 (7129296586)",
      "delta": {
        "S1": "protocol-meta-list-reads.ts: the app nav fold step takes the row time off each app (takeListedRowChangedAt), runs applyNavContributions, then puts the time back on what the fold returns (withListedRowChangedAt), so a stored app keeps its entry when the fold structuredClones it. Pinned by protocol.meta-list-changed-at.test.ts section 6: a contributed app and a plain app are both keyed, with a control for a code-shipped app.",
        "S2": "meta-item-read-gate.ts step 8a now counts the items of each name in the store answer and in the chain output, and drops the entry for any name the chain removed at least one item of (never recomputed). Pinned in meta-list-names-filter.test.ts: A's stored d is gated and B's code d is listed, so d gets no entry and ops keeps its entry; control: a permitted caller sees both d items and keeps d.",
        "N3": "listed-row-changed-at.ts module doc now says only spread copies carry the time, that structuredClone drops it, and names the nav fold as the one such step.",
        "N1": "schema description adds that a view a stored container expands has no entry, and that a door which leaves out some item of a name answers no entry for that name; protocol.mdx regenerated; changeset bullet updated to match."
      },
      "tests": "metadata-protocol pnpm test: 368 files passed, 9 skipped; 23385 tests passed. rest pnpm test: 429/429 files, 8813 tests passed. protocol pin 20/20, rest pin file 19/19, spec meta-item-response-shapes 37/37. typecheck metadata-protocol and rest: exit 0. Ablations via ablation-replace (restore blob == HEAD, git diff HEAD empty): S1 with the re-stamp removed fails 1 of 20 (section 6); S2 with the rule reverted to name-only fails 1 of 19 (the two-package case).",
      "gates": "local, exit 0: engine-double-contract, test-source-alias, durability-log-level, nul-bytes, issue-citations, doc-authoring, spec check:docs, spec check:api-surface, check-empty-changeset, check-adr-0087-registration; spec check:generated --fix regenerated protocol.mdx. overlap-check: clean against origin/main and PRs 36948, 36926, 36916. CI on b6ae895c8: 70 check-runs, 60 success and 10 skipped, none failed.",
      "line_budget": "699 changed lines in total (+685/-14, 12 files); round delta +124/-35 over 8 files",
      "files_changed_this_round": [
        ".changeset/36894-list-changed-at.md",
        "content/docs/references/api/protocol.mdx",
        "packages/metadata-protocol/src/listed-row-changed-at.ts",
        "packages/metadata-protocol/src/protocol-meta-list-reads.ts",
        "packages/metadata-protocol/src/protocol.meta-list-changed-at.test.ts",
        "packages/rest/src/meta-item-read-gate.ts",
        "packages/rest/src/meta-list-names-filter.test.ts",
        "packages/spec/src/api/protocol.zod.ts"
      ],
      "deviations": [
        "PR body not edited (the seat owns it); the Acceptance notes in the body still describe step 8a as name-only pruning, so the seat updates it.",
        "overlap-check ran once, after the round commits were pushed rather than before each push; result clean."
      ],
      "owed": "delta L1 and delta L2 on head b6ae895c8",
      "mcp_calls": "0",
      "api_writes": "1 — post-stamped os-dev-report comment on #36894 (this one)",
      "security_findings": "none"
    }
  6. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Close-out 2026-11-24T12:22Z: PR #36940 merged 2026-11-24T12:21Z (1cda7ea), closing this card by Fixes. Delivered: optional changedAt sibling on GetMetaItemsResponseSchema, { <name>: ISO-8601 UTC }, only for items served from a stored row (code-shipped / file-loaded items get none; the field is absent when no listed item has a row); the time is the effective (served) layer's row on ~all and package lists, the draft row's on ?preview=draft; latest wins for same-name items; the REST/runtime chain drops a name's entry whenever it removed any item of that name. L1 + contract-tier L2 PASS (7130358432, 7130335968). Open nits N2 / N5 stay in the review record. Nothing left on this card; the client column is #36898.

  7. removed
    pm:dispatched
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:serverenhancementpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions