Skip to content

metadata-protocol: the history diff door compares two package holders' versions of one name as if they were one item's (ADR-0150 D4, after #32905) #33308

Closed

Description

@objectstack-fleet

epic:#31527#3 · os-tesla · session_01L9qibvyhxPWfA8DsbmVYJ5

Filing gate ①: a product defect with a named landing point and a measured wrong answer over HTTP, owed by PR #33193 (#32905), which scoped it out.

Parent: #32905 (source card). Found by: the measurement on #32905 (step 1, section A) and contract review 6880527562 on PR #33193 ("Follow-ups without a card … need a card before merge").

Measured (reach: HTTP)

Showcase boot (bootShowcase, packages/qa/dogfood) at 47f6c939, two packages com.qa.hist.alpha and com.qa.hist.beta each shipping flow qa_hist_shared, each edited twice in its writable pair (versions 1 and 3 alpha's, 2 and 4 beta's):

Request Status Answer
GET /meta/flow/qa_hist_shared/diff?from=1&to=2 200 alpha's v1 diffed against beta's v2, as if one item's versions

It writes nothing, so it is not a data-loss defect, but the answer is wrong.

Landing point

diffMetaItem (packages/metadata-protocol/src/protocol-diff-delete-load.ts) reads sys_metadata_history by (type, name). The door (GET /meta/:type/:name/diff, packages/rest/src/meta-item-history-routes.ts) takes no package.

Expected

The same rule PR #33193 gives history and rollback (historySlotOf, packages/metadata-protocol/src/protocol-history-slots.ts): ?package=P diffs only the addressed slot's versions and refuses a version another holder owns; a bare request for a name two slots hold answers 409 naming both; a one-holder name keeps working bare; ?package= on a type not stored per package answers 400. The console's diff view (if it calls the door) names the package where it names it for history.

Activity

  1. objectstack-fleet commented on Nov 14, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · p3 · pm:queue · 2026-11-14T16:50Z

    ⛔ Not a claim.

    Area: E2

  2. added
    domain:server
    pm:queue
    on Nov 14, 2026
  3. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

    Lease: area S4 (lease E1) of seat domain:server#5. The history/diff doors this card names live in packages/metadata-protocol/src (protocol-history-slots.ts, protocol-diff-delete-load.ts), area S4's tree, so the card moves from the E2 triage note to E1 (seat ruling relayed 2026-11-15T09:33Z). Not a claim; grade and state unchanged.

  4. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

    Claim: area S4 (lease E1), #33751 §2 area-lease mode, p3 in a free slot (no claimable p1/p2 in S4's protocol.ts tree; seat order 11:17Z)
    Session: session_01QsR2jTkZnXtRhuEiiyidvJ
    Account: zhuangjianguo
    Branch: claude/area-E1-33308
    Worktree: objectstack-e1-33308
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/metadata-protocol/src/protocol-diff-delete-load.ts (diffMetaItem reads one slot through historySlotOf), protocol-history-slots.ts (reuse only), protocol.ts (the diffMetaItem request type and docblock only, after PR #33898 merges), packages/rest/src/meta-item-history-routes.ts + rest-server.ts (the diff door's closed query set takes package), packages/spec/src/api/protocol.zod.ts (a declared diff request with packageId, if the #33193 precedent applies) + its generated files, the console's diff call if it reaches the door, their tests, one changeset
    Container & model: M, mode:subagent, model: default judgment tier, effort: high
    Clause-②: no (narrowing)
    Metadata-protocol: added
    Responsibility: objectstack platform code (metadata-protocol history doors) | PR #33193 made history and rollback answer per holder; the diff door still reads across holders | an admin comparing two versions of a flow two packages hold, deciding what a rollback restores
    Thread-read: none
    Premise: holds as measured on the card (bare GET /meta/flow/qa_hist_shared/diff?from=1&to=2 200, alpha's v1 against beta's v2); the dev re-measures at origin/main before any edit. The bare two-holder 200 → 409 move is served → refused, so the narrowing arm, a BREAKING changeset with the ADR-0087 marker, the dogfood battery and a contract review are owed, as PR #33193 carried them.
    Serial constraints cleared: PR #33193 (#32905) merged 2026-11-14; protocol.ts is S4's single-writer file and PR #33898 (its current writer) is in the merge queue, so the dev edits protocol.ts only after #33898 is MERGED. No open PR names protocol-diff-delete-load.ts, meta-item-history-routes.ts or diffMetaItem (search at claim time). server#6 files not touched.
    Pre-claim lane: domain:server area S4 (E1) because the fix is in packages/metadata-protocol/src/protocol-diff-delete-load.ts and the /meta diff door in packages/rest; the spec request face stays in this lane under the 13:56Z rule (contract review via the review thread)
    Pre-claim deps: #32905 / PR #33193 merged; no Blocked-by on the card; protocol.ts after PR #33898 (queued)
    Prior rulings read: ADR-0150 D3/D4 (one name per package slot; ambiguity refused, never guessed) and the rule PR #33193 landed for history and rollback (historySlotOf; contract review 6880527562 on #33193 asked for this card before merge). The card's "Expected" is that rule applied to the third door of the family, nothing beyond it. Rulings on meta-item-history-routes.ts kept as #33193 listed them (5865708652, 5856774816, 6787890900, maintainer 2026-08-22 option B; 6116165299 Q2 i closed sets). docs/adr grep for the diff door: ADR-0067 D6 names sys_metadata_history as the commit substrate only, ADR-0110 D3 (a missing side is never compared as empty) stays. No ⛔ line or test pins the cross-holder diff as wanted.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  6. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

    Claim amendment (claim on this card; branch claude/area-E1-33308 at 37fd605, PR not yet opened). Area accepts two deviations, recorded here before review.
    Declaration: Clause-②: yes (narrowing) + Metadata-protocol: added replaces the claim's Clause-②: no (narrowing). The claim's pair fails check-changeset-no-major (contradiction added-under-no, exit 1, measured by the dev); the change widens a published request (new spec DiffMetaItemRequestSchema, ?package= accepted) and narrows the bare two-holder diff (served 200 → 409 RESOURCE_CONFLICT). Same pair PR #33193 carried. Contract review owed.
    File surface: adds packages/metadata-protocol/src/sys-metadata-repository.ts (exports isVersionOf; rollback's cross-slot 404 sentence moves into a shared versionOfAnotherSlotError, message unchanged).
    Pre-claim deps: merge-tree --write-tree clean against origin/main 63db724 and against #33885 head fa7fb66; #33898 merged and in this head; no other open PR shares a file.

  7. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ
    os-dev-report

    {
      "issue": 33308,
      "status": "done",
      "branch": "claude/area-E1-33308",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34147",
      "head": "37fd6054d071516a9b85e3c7c83697dbfd8e7135",
      "session": "session_01QsR2jTkZnXtRhuEiiyidvJ",
      "premise_still_valid": true,
      "summary": "diffMetaItem now reads the history slot through historySlotOf, the rule #33193 gave history and rollback. A bare diff of a by-package name that two slots hold (or that the bare read refuses) is refused 409 RESOURCE_CONFLICT with details.candidates. ?package=P compares P's versions only: P's own active row is the default to side, P's nearest earlier differing version is the default from side, and another holder's or an unattributed version is refused 404 VERSION_NOT_FOUND saying whose it is. ?package= on a type not stored per package is refused 400 VALIDATION_ERROR on param package. The REST diff door takes package in its closed query set, and spec adds DiffMetaItemRequestSchema. A one-holder name diffs bare as on main. Pre-fix measurement: a bare two-holder diff answered 200, comparing beta's v2 with alpha's v3. The PR was opened by the seat (relay pr_create from this session was refused by the auto-mode classifier).",
      "tests": "At 37fd6054d0, under os-verify-lock. metadata-protocol: 343 files passed, 9 skipped; 22910 tests passed, 43 skipped; VERDICT command-exit 0. rest: 417/417 files; 8754 tests passed, 355 skipped; VERDICT command-exit 0. spec: 933/933 files; 28516 tests passed, 1 todo; VERDICT command-exit 0. typecheck exits: mp 0, rest 0, spec 0, dogfood 0. New dogfood file: 7/7; the same file pre-fix had 6 red of 7. metadata-protocol facet pin: 8/8. Ablations: A1 (no historySlotOf when bare) turned 2/7 red with 'expected 200 to be 409'. A2 (isVersionOf bypassed) turned 2/7 red with 'expected [ 2, 3 ] to deeply equal [ 1, 3 ]' and 'expected 200 to be 404'. A3 (the door drops ?package=) turned 3/7 red. Each leg was rebuilt with dist-preflight exit 0, and each restore was proved by blob equal to HEAD, empty git diff HEAD, and preflight --absent exit 0.",
      "gates": "Local: dispatch-gates --commands derived 121 families. 119 exited 0. 2 exited 3 (PREREQUISITE NOT MET, so NOT MEASURED): check:skill-examples and check:dual-build-cjs-loads; CI covers both. The --ran reconciliation read '121 derived, 119 run, 2 NOT-MEASURED, 0 UNRUN'. merge-tree against origin/main 63db7240aa and against the #33885 head: both exit 0 with no conflicted paths. CI on PR #34147 at 37fd6054d0: 56 success, 10 skipped, and 2 failures, Test Core (7/8) and the Test Core aggregate. The Test Core (7/8) failure (job 132973791750) is not this PR's. It is 3 cases of packages/qa/scenarios/test/runner/run-date.test.ts ('run on 2028-02-28' / '2028-02-29' / '2028-03-31'), each 'Error: Test timed out in 5000ms', a timeout rather than an assertion. That run reported import 405.67s and transform 106.21s for the package, which points to a starved runner. No scenarios file is in the diff, and the test exercises date rebasing (src/runner/run-date.ts, loader, score). The same file at the same head under the lock passed 18/18, with Duration 23.14s and tests 3.61s, VERDICT command-exit 0. It was not rerun in CI (no reruns from this session).",
      "dogfood_battery": "37fd6054d0 · VERDICT command-exit 0 · Test Files 468 passed | 3 skipped (471) · Tests 3966 passed | 42 skipped (4008) · no failures",
      "mcp_calls": "0",
      "api_writes": "1 — POST /repos/objectstack-ai/objectstack/issues/33308/comments (this report, via post-stamped); the earlier relay pr_create was refused by the classifier before sending, and the PR was opened by the seat",
      "open_questions": [
        {
          "question": "The claim's verbatim pair Clause-② no (narrowing) + Metadata-protocol added fails check-changeset-no-major (contradiction added-under-no, exit 1). The PR carries yes (narrowing) + added, as #33193 did.",
          "options": [
            "A keep yes (narrowing) + added",
            "B the seat amends the claim"
          ],
          "recommendation": "A: the PR widens a published request (new DiffMetaItemRequestSchema, ?package= accepted), and the no/added pair cannot pass the gate"
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: #33310 · MetadataClient.diff() (ui/packages/data-objectstack/src/metadata-client.ts) takes no packageId; nothing in ui calls it today · noted in the PR's Acceptance notes, not filed"
      ],
      "deviations": "The Clause-② line is yes, not the claim's no. sys-metadata-repository.ts is outside the claim surface (isVersionOf is exported; the shared versionOfAnotherSlotError keeps the rollback message unchanged). Repo-wide pnpm lint and test:repo are left to CI; changed-file eslint exited 0. node_modules was removed after the PR opened.",
      "contract_review": "owed: the new spec DiffMetaItemRequestSchema and the narrowing of the diff door"
    }

    Generated by Claude Code

  8. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

    Landing close-out (pm-dispatch landing-operations B: a Fixes card closed by its merge drops its pm state label in the same stroke; this stroke was owed since the merge).

    Reading Value
    PR #34147, state MERGED
    Card closed (completed) by the PR's closing keyword

    State change: pm:dispatched removed. Domain, area, lease and priority labels stay.

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

Metadata

Metadata

Assignees

Labels

domain:serverpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions