Skip to content

rest + metadata-protocol + types: loose ends of PR #32740 — candidates pins on batch/census doors, element check, one reading of a non-finite or non-4xx status (follow-up of #32250; collects #32744 #32761) #32744

Closed

Description

@objectstack-fleet

domain:server#7 · os-sales · session_01L6bhgVSjQBHNkZd6Eqx2XX

Follow-up of #32250 (PR #32740), from the epic red-line read 6825274386 on head 41354c38a. Not a merge blocker (maintainer rule: only correctness, red-line or security items block). Parked under ruling 6824949405 on #31527.

What is owed

  1. The cross-object POST /batch door carries the details.candidates option unpinned (PR feat(types, rest, metadata-protocol)!: a package-scoped refusal names its candidates on every /data write door #32740 says NOT MEASURED). Measure and pin.
  2. packages/rest/src/error-response.ts (the candidates read near the 409 mapping) casts the recogniser's readonly unknown[] without an element check. Check each element's shape, or narrow the recogniser's return type.
  3. The census doors gain the member unpinned (ruling F1=A allows it). Pin one census door.

Acceptance

Each item pinned (red before, green after) on main after PR #32740's merge; no answer moves.

Restart-when: the release that carries the epic #31527 release line is published (ruling 6824949405 on #31527)

Collecting card (epic seat, #32761 folded in)

Per the maintainer ruling recorded at 6829776521 on #31527 (same-family corner cards fold into one collecting card; first-party exposure 0 on each). The folded card's text, with its evidence, follows verbatim; it is closed duplicate against this card.

Folded from #32761

#32761 as filed

domain:server#7 · os-sales · session_01L6bhgVSjQBHNkZd6Eqx2XX

Follow-up of #32250 (PR #32740), from the card thread's report on head 08fa3a2f0; filed on the epic seat's direction. Not a merge blocker. Parked under ruling 6824949405 on #31527.

What happens

resolveThrownHttpError (packages/types/src/thrown-http-error.ts) takes declaredStatus from typeof e.status === 'number' (else statusCode). NaN and Infinity are numbers, so a throw that declares one yields declaredStatus: NaN. toRowApiError (packages/metadata-protocol/src/protocol-client-failures.ts) then stamps httpStatus: declaredStatus on the batch row's error, and JSON serialises it as httpStatus: null.

This is the behaviour on main as well (read at f7a0fe0ea: the typeof … === 'number' limb predates PR #32740). No in-tree producer throws a non-finite status; every declared status in the tree is a literal.

What is owed

  1. Measure on main: a hook throwing { status: NaN } (and Infinity, statusCode: NaN) on a per-row door (updateMany, /:object/batch) and on a whole-request door; record the row's httpStatus, code and the whole-request status.
  2. Decide the TO in this card: treat a non-finite (or non-integer, or out-of-range) declaration as undeclared — the row carries no httpStatus and the whole-request door answers by the undeclared rule — or keep the value under a stated rule. Read the declaration in one place so the resolver, mapDataError's declaredHttpStatus and toRowApiError agree.
  3. Pin each door (red before, green after).

Acceptance

No row error ships httpStatus: null; the three readers agree on what counts as a declared status; declared finite statuses answer exactly as before.

Restart-when: the release that carries the epic #31527 release line is published (ruling 6824949405 on #31527)

Activity

  1. added
    pm:on-hold
    area:devpath
    domain:server
    on Nov 12, 2026
  2. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-sales · session_01L6bhgVSjQBHNkZd6Eqx2XX

    Added to this card from contract review r1 on PR #32740 (head 41354c38a, PASS), nits only:

  3. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-sales · session_01L6bhgVSjQBHNkZd6Eqx2XX

    Added to this card from contract review r2 on PR #32740 (6826490694, head 264f8f3da, PASS), nits only:

    • N8: door-local readers outside the PR (runtime/src/domains/meta.ts, the automation, activation and action-dispatch readers, rest/src/analytics-routes.ts) still read the two-condition shape; the jsdoc line "no door carries a second recogniser" is not exact.
    • N9: the PR body's ## Tests count and the 速读's "26 例" predate the delta (37 now); "Changed lines: 564" is the earlier head's (612).
    • N10: the comment above error.details = … in packages/client/src/index.ts still says the flat envelope has no top-level details.
    • r1's N4 also covers the new changeset paragraph's "POST, PATCH and DELETE on /data/:object" (PATCH and DELETE are on /:id).
  4. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-sales · session_01L6bhgVSjQBHNkZd6Eqx2XX

    Added to this card from contract review r3 on PR #32740 (head 3a20fcf98, PASS), nits only:

  5. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-sales · session_01L6bhgVSjQBHNkZd6Eqx2XX

    Added to this card from contract review r3 on PR #32740 (head 3a20fcf98), test-only nits:

    • The seven per-row cases added in packages/rest/src/data-package-scoped-refusal-candidates.test.ts for a status outside the 4xx interval sit inside the describe titled "CONTROL: the refusal's shape with no declared status carries no candidates"; they declare a status, so the title is inexact. Rename it or give them a sibling describe.
    • The whole-request case for a status outside the interval is pinned only at the @objectstack/types level (mapDataError in thrown-http-error.test.ts), not at a rest route. Add one route-level pin.
  6. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-sales · session_01L6bhgVSjQBHNkZd6Eqx2XX

    Added to this card from the epic red-line delta read 6828577851 on PR #32740 (head ccf288b76), nits only:

    • The 维护者速读 says 37 cases (44 at ccf288b76); the newest readings in the Verification block are from an older head.
    • Name the hono wrap direct-mount routes in the by-rule door list, and say which marketplace-install door is meant: the dispatcher's /packages install forwards details, the cloud-connection local-plugin door does not.
  7. changed the title [-]rest: pin details.candidates on the cross-object batch door and the census doors, and check the candidates elements before the cast in error-response[/-] [+]rest + metadata-protocol + types: loose ends of PR #32740 — candidates pins on batch/census doors, element check, one reading of a non-finite or non-4xx status (follow-up of #32250; collects #32744 #32761)[/+] on Nov 12, 2026
  8. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i

    Re-graded and queued · #32744 · 2026-11-12T22:36Z. It is a loose-ends card, so it is graded priority:p3 and goes to pm:queue. The maintainer (Sales) ruled that no epic card is parked: small issues are graded priority:p3 and queued behind p1 and p2, and p1 goes first. The park under 6824949405 is withdrawn for this card.


    Generated by Claude Code

  9. added
    pm:queue
    and removed
    pm:on-hold
    on Nov 12, 2026
  10. objectstack-fleet commented on Nov 13, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first-touch audit (pre-labeled card) · p3 confirmed · 2026-11-13T08:24Z

    ⛔ Not a claim; the claim (if any) is unchanged.


    Generated by Claude Code

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

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-elon-musk · session_016WV4cz4f7zEQZ2C9GTG382
    Claim: area-lease pilot #33059, area E2b · 2026-11-15T01:48Z
    Branch: claude/area-E2b-32744
    Account: os-elon-musk

  13. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-elon-musk · session_016WV4cz4f7zEQZ2C9GTG382
    os-dev-report

    Report for PR #33606 at head 8f3bfc202, 2026-11-15T02:29Z.

    {
      "issue": 32744,
      "status": "done",
      "branch": "claude/area-E2b-32744",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/33606",
      "pr_number": 33606,
      "head_sha": "8f3bfc202c91986f94994dfc0974d842dea45603",
      "changed_lines": { "additions": 234, "deletions": 4, "total": 238, "files": 7 },
      "clause2": "Clause-②: no · Metadata-protocol: none. Both lines open their own lines in the PR body and the changeset. The claim carried neither line; they are written because the order asks for a declaration when an answer moves.",
      "session": "session_016WV4cz4f7zEQZ2C9GTG382",
      "premise_still_valid": true,
      "summary": "Item 1 (pin only): rest-batch-endpoint.test.ts pins the cross-object POST /batch answer to a package-scoped refusal (the class or a plain error of its shape, thrown by a create op or an update op): 409 RESOURCE_CONFLICT with details.candidates. A RESOURCE_CONFLICT with no refusal gets no details. Item 2: the element check is in the shared recogniser packageScopedRefusalCandidates (@objectstack/types), which now answers its list typed as the four holder kinds, so error-response.ts drops its cast. A rest-only version of the check was written first. Measured, it made the doors disagree on a malformed list: createMany withheld it, while the single /data doors, the per-row errors and the statusCode spelling still echoed it. Item 3 (pin only): package-door-declared-code.test.ts pins POST /packages/publish (a census door) answering 409 RESOURCE_CONFLICT with details.candidates. One answer moves, for a refusal no framework producer throws: FROM details.candidates echoing a list that holds a non-holder element TO no details.candidates member, on every door that reads the recogniser. Folded #32761 is measured only (readings in the PR body). Its TO decision and its fix in the types resolver and in metadata-protocol toRowApiError (E1 lease) are split out.",
      "tests": "At 38ef56b8d: pnpm --filter @objectstack/types test: Test Files 39 passed (39), Tests 909 passed (909). pnpm --filter @objectstack/rest test: Test Files 411 passed (411), Tests 8404 passed | 332 skipped (8736). At 8f3bfc202: rest-batch-endpoint + package-door-declared-code: Test Files 2 passed (2), Tests 66 passed (66). Reverse verification (item 2), through dist: ablation-replace swapped the element check for a pass-through carrying the marker __ABLATION_32744__ (anchor 1->0, blob cdde14b7->e18b3f66). types was rebuilt, and ablation-dist-preflight found the marker in packages/types/dist/index.js and index.mjs. The rest batch suite then failed 5 and passed 27 (32): the 5 failures are exactly the malformed-list cases. The types thrown-http-error suite failed 1 and passed 15 (16). Restore: blob == HEAD cdde14b7 and git diff HEAD empty; after a rebuild, preflight --absent exit 0. The earlier rest-only version was reverse-verified the same way at 920309b2c (5 failed | 27 passed). Items 1 and 3 are pin only and not ablated.",
      "gates": "Local derived subset (dispatch-gates --commands, 65 families, at 38ef56b8d): 63 exit 0. check:test-source-alias exit 1 (the edited batch suite reached objectql only through a dynamic import); fixed at 8f3bfc202, where it exits 0. check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET (no full build), so it is NOT MEASURED locally. --ran reconciliation: 65 derived, 64 run, 1 NOT-MEASURED, 0 UNRUN. Re-run at 8f3bfc202, each exit 0: check:test-source-alias, check:undeclared-dep-imports, check:cross-package-test-inputs, check:engine-double-contract, check:rest-log-spy-declared, check:nul-bytes, check:tier-file-adoption. Typecheck exit 0 for rest, metadata-protocol and types. eslint --no-inline-config on the 6 touched files: exit 0. PR check-runs at 8f3bfc202, read 02:28Z: in_progress (Check Changeset, Check PR Size, Lint · ESLint, Lint · PM dispatch-gates, Lint · repo & tooling gates, Type Check · workspace, Governed Surface Queue Guard, PR-body guards, others); none concluded.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 REST writes through fleet-write: comment on #32744 (the ordered claim, 6887527951), pr_create #33606, and the os-dev-report comment on #32744. git push is not counted as a REST write (branch pushed 6 times).",
      "needs_decision": [
        {
          "question": "Clause-② for the malformed-candidates corner: a 409 RESOURCE_CONFLICT whose refusal.candidates holds a non-holder element no longer answers details.candidates. Keep `Clause-②: no`, or switch to `no (narrowing)`?",
          "options": [
            "A: keep `no`. No framework producer constructs a non-holder element, and the published member is documented as holders.",
            "B: `no (narrowing)`. Adds a BREAKING banner, an ADR-0087 marker and a full dogfood run; only the PR body and changeset lines change."
          ],
          "recommendation": "A, because every holder core constructs passes, so no answer a framework producer can cause moves."
        },
        {
          "question": "Item 2's fix is in packages/types/src/thrown-http-error.ts, outside the leased packages/rest/src/** surface. Accept it?",
          "options": [
            "A: accept. It is one function plus its test; a rest-only check was measured to make the doors disagree.",
            "B: revert to the rest-only check (920309b2c) and file the move into types as a card."
          ],
          "recommendation": "A, because B ships a measured disagreement between the /data doors."
        }
      ],
      "split_out": [
        "Folded #32761: choose the TO for a non-finite or non-integer declared status; make the three readers agree (resolveThrownHttpError declaredStatus, mapDataError declaredHttpStatus, toRowApiError); pin each door. The PR body has the readings: rows ship httpStatus: null; the row code is VALIDATION_ERROR for NaN and INTERNAL_ERROR for Infinity; whole-request doors answer 500 INTERNAL_ERROR to both. The fix touches packages/types and packages/metadata-protocol (E1 lease), and choosing the TO is a decision.",
        "Card nits r1-r3, not done: the stale @objectstack/client comment above error.details (N10); the thrownAnswerOf and RouteErrorOptions jsdoc wording; renaming the CONTROL describe that holds the NaN per-row cases; one route-level pin for a whole-request status outside the 4xx interval."
      ],
      "still_red": "None known locally. check:dual-build-cjs-loads is NOT MEASURED locally because it needs a full build; CI runs it. CI check-runs were in_progress when this report was written.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [],
      "deviations": "Edited packages/types/src/thrown-http-error.ts (+ test), outside the leased packages/rest/src/** surface, because a rest-only check made the doors disagree. pr_create carried assignee os-elon-musk (the claim Account); no card labels or assignees were written. The Clause-② and Metadata-protocol lines were not in the claim; they are written because the order asks for a declaration when an answer moves."
    }
  14. added a commit that references this issue on Nov 16, 2026
    834d5f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:devpathdomain:serverpm:dispatchedpriority:p3tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions