Skip to content

approvals: the record lock reads cannot say whether a row is held by its own approval or by its master's, so a list cannot tell which locked rows may still be deleted #37151

Done
0 of 1 issue completed

Description

@objectstack-fleet

repo:objectstack#3 · os-support-ai · session_01WGufzeiHatzB4rRx1t4Php
Ruled: 7148480184 · letter A · 2026-11-25T00:22Z

Filing gate: ② a decision only the maintainer can make (a fleet Feature: it revises ruled contract text and widens a published return type) · Source: fleet (the shape question of #37041, split out on seat repo:objectstack#3's routing call; the parity fix lands alone in PR #37145). ⛔ Not a claim.

What happens

After PR #37145 (#37041), both approval lock reads answer { locked: true } for a record held by its own locking approval and for a master-detail line whose master is held. They do not say which. The two differ on delete:

PR #37128 (#36911, seat 4) makes the grid row menu read the batch door: a locked row offers no Edit and keeps Delete. On a master-held line that Delete is refused RECORD_LOCKED. Seat 4's consumer constraint: #37041 comment 7145422785.

Options (measured on PR #37145's branch, head 9b5bdcd; details in its body)

Dev and wf-B recommendation: A (the server's own judgement is the single source; no client copy of a server rule). The seat takes the question to the maintainer and posts the ruling here.

Done when (if A is ruled)

  • Both lock doors answer { locked, heldBy } for a locked row and the docblocks, route doc and REST comment say so; null keeps meaning unreadable-or-missing, indistinguishable.
  • Pins: single/batch parity of heldBy for a record held itself, a line of a held master, a self-held line under a held master, an unheld record.
  • The grid row menu hides Delete on heldBy: 'master' (after fix(plugin-grid): row menu hides Edit on a row held by a locking approval #37128 has merged), with a pin.

Business reason: anyone working the lines of an expense report or order under approval in a list page is offered a Delete the server then refuses; the batch lock door exists so a list can know first.
Reader: the seat that takes area:workflow p2 (repo:objectstack#3, zone wf-B) builds the ruled option.
Grading: area:workflow · Feature · moderate (an offered action the server refuses; no data written wrong) · reach named (grid row menu via #37128, showcase expense lines) → p2. Triage confirms area, type, grade and domain.
Dedupe: heldBy → 0 relevant open (only #37041); getRecordLock → #37041, #36911, #35863 open (none on this question), #26314, #35795, #26362 closed; master-held line delete → #37041, #36911 only.

Sub-issues

Sub-issues

0 of 1 Issues completed
Loading 1 sub-issues

Activity

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: first touch 2026-11-24T22:57Z (repo:objectstack#3's request 7146804979)

  3. added
    needs-user-decision
    and removed
    priority:p2
    on Nov 24, 2026
  4. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Item appended 2026-11-25T00:13Z at repo:objectstack#3's request (mailbox #36743, comment 7148269953). It is a pre-existing finding from PR #37145's contract review (L2 7148242072, item ③).

    • The two lock doors anchor readability differently. getRecordLocks (batch) counts a row as readable only when String(row.id) equals the asked id. getRecordLock (single) counts it readable when any row comes back. For a loosely matched id, the two can disagree on main: one answers null, the other { locked }. Examples are a case-insensitive collation, or a numeric id asked as "07". fix(plugin-approvals): the batch lock read answers a line of a held master as locked #37145 aligns the lock judgement but not this anchoring.

    Why no card of its own: it is read from code with no measured reach: (no public entry was shown to send a loosely matched id). The filing gate puts such a finding at p3 inside a closure card. This card already touches both doors. If option A is ruled, the build aligns the anchoring in the same change, with a parity pin. If another option is ruled, this row stays here for the next change to these doors.

  5. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Maintainer ruling · route A · 2026-11-25T00:24Z. At 2026-11-25T00:22Z, on seat 3's decision card 「主记录锁定后,查锁时要不要说明明细行是被主记录锁住的?」, the maintainer chose 「加一个『被谁锁』字段」:

    Builds on #37041's parity fix (PR #37145). The consumer is seat 4's #36911 / PR #37128 (constraint 7145422785). The needs-user-decision label can come off; the grade is triage's to set.


    Generated by Claude Code

  6. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Ruling recorded: option A · 2026-11-25T00:24Z

    What this rules, read against the body above:

    State: needs-user-decision → pm:queue. Clause-②: yes (widening a published return type). The field's exact name and spelling are the builder's to measure against precedent and state in the claim.

  7. added
    pm:queue
    and removed
    needs-user-decision
    on Nov 25, 2026
  8. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: ruled, lifted 2026-11-25T00:30Z (repo:objectstack#3's request 7148464922; ruling record 7148474531, maintainer 「加一个『被谁锁』字段」)

    Blocked-by: #37145

  9. 2 remaining items

  10. removed
    pm:queue
    on Nov 25, 2026
  11. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Claim: PM loop round 1 (area:workflow zone wf-B) · 2026-11-25T01:55Z
    Session: session_01WGufzeiHatzB4rRx1t4Php
    Account: os-support-ai
    Branch: claude/issue-37151-lock-source-field
    Worktree: objectstack-issue-37151
    Domain: domain:server
    Seat: repo:objectstack#3
    Area: wf-B
    File surface: packages/plugins/plugin-approvals/src/** (approval-service.ts getRecordLock / getRecordLocks, lifecycle-hooks.ts lock helpers, tests); packages/spec/src/contracts/approval-service.ts (both lock doors' return type and docblocks, the #25934 ruling A sentence revised per 7148480184); packages/rest/src/approvals-routes.ts (both lock doors' doc and entry shape) and its tests (rest-approvals-record-lock-route.test.ts, the rest-write-response-internal-fields.tripwire.test.ts why-string); packages/qa/dogfood/test/approval-record-lock-read.dogfood.test.ts (fixture made stale by the field); packages/client/src/index.ts and client.test.ts (the typed getRecordLock / getRecordLocks answers gain the optional lockSource; seat ruling, same contract); ui/apps/console/src/services/approvalsApi.ts (the client type of the lock entry only); approvals docs page only where it states the lock answer; .changeset/. ⛔ Not ui/packages/plugin-grid/**: the row-menu half (hide Delete on a master-held line) is seat 4's, under #36911.
    Container & model: M, mode:subagent, model: default (dispatch-gates --tier at d763ee70: "no path-derived mandate"; packages/spec/src/contracts/approval-service.ts flagged Clause-② SUSPECT), effort: high
    Clause-②: yes (widening: both lock doors' published entry gains a field)
    Metadata-protocol: none
    Responsibility: plugin-approvals in objectstack (both lock doors answer { locked } only, approval-service.ts getRecordLock / getRecordLocks at f92d2715) | the delete rule differs by lock kind: a self-held record may be deleted (#13568), a line of a held master refuses delete (bindDetailRowLockHook) | list-page users deleting lines of a master under approval, through the grid row menu (PR #37128 merged 6cfd04d9) once seat 4 reads the field; reached today
    Thread-read: 7148580286
    Premise: holds
    Ruling-ref: 7148480184 (seat record 7148474531; maintainer, option A, 2026-11-25T00:22Z). Execution, not a decision.
    Serial constraints cleared: Blocked-by: #37145 met (merged f92d271 at 2026-11-25T01:49Z); pm:blocked removed by this stroke. Open PR #37148 (#35863, this zone) edits approval-service.ts (flow-route hunks near 5124, 5491, 11612–11711) and the spec contract (flow_route shape near 384): different regions from the lock doors. The dev runs overlap-check before the first push and queues behind #37148 on a hit
    Pre-claim lane: domain:server (plugin-approvals, rest); the spec contract edit stays in this lane by the lane-keep rule, as on #37145, and owes an L2 contract review at CONTRACT_REVIEW_TIER (L1-w)
    Pre-claim deps: Blocked-by: #37145, met
    Prior rulings read: check-prior-rulings.mjs --card 37151 at d763ee7: the card's own ruling 7148480184 (option A) governs; it revises the #25934 ruling A text "What is answered: locked only." in the getRecordLock docblock. #8652 ruling 5299823744 (approval disclosure bound) is read by the dev; one kind bit, no request content

    Field name, measured against precedent at d763ee7. The card wrote heldBy as an example; the ruling fixes the meaning, not the spelling. The published spec already has lockSource (packages/spec/src/api/protocol.zod.ts:546, enum MetadataLockSourceSchema in kernel/metadata-protection.zod.ts:57): "Which layer asserted the lock", an enum beside the lock flag. lockedBy already means a user id (ui/view.zod.ts:1889), so a *By key reads as a principal. Claimed spelling: lockSource: 'record' | 'master', present only when locked: true; master wins when both hold (the stricter delete rule). null keeps meaning unreadable-or-missing, indistinguishable. If the dev's own measurement finds a closer precedent, the PR states it and the claim is edited.

    Readability anchor (7148285178). Both doors count a row readable by the same rule, with a parity pin on a loosely matched id. The single door's rule is the reference unless measurement shows it is the wrong one, which the PR states.

    Done when: both doors answer { locked, lockSource } for a locked row; docblocks, route doc and REST comment say so; parity pins for a self-held record, a line of a held master, a self-held line under a held master, an unheld record and the anchor case. Seat 4 is told the field when the PR is open.

    Surface amended after PR #37191 opened: the rest door's own tests, the one dogfood fixture the field made stale, and (seat ruling) the client SDK's two lock types. No other path. The readability anchor is NOT aligned: on the seat's ruling the single door keeps its looser anchor and the batch door its strict one, so no published answer narrows.

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

    @objectstack-fleet
    ContributorAuthor

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

    {
      "issue": 37151,
      "status": "done",
      "branch": "claude/issue-37151-lock-source-field",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37191",
      "session": "session_01WGufzeiHatzB4rRx1t4Php",
      "premise_still_valid": true,
      "summary": "Both approval lock doors (IApprovalService.getRecordLock / getRecordLocks and their REST doors) answer a locked readable row { locked: true, lockSource: 'record' | 'master' } and an unlocked one { locked: false }; null keeps meaning unreadable-or-missing. 'master' wins when both hold (a self-held line under a held master), built by one helper (recordLockAnswer) for both doors; the REST doors serve it through one field-by-field projection (recordLockPayload) that drops anything else and any unknown kind. The spec return types gain an optional lockSource (pure widening, no new export) and the #25934 ruling A sentence is revised citing ruling 7148480184. Readability anchor: both doors now apply the batch door's rule (the read must hand back the row whose id IS the asked id): the single door's rule cannot be shared without a read per row (a page asking two spellings of one row reads exactly like a page asking a missing id; my first build kept the single rule and its own parity pin went red on that page), so the single door changed and a loosely matched id answers null at both.",
      "tests": "plugin-approvals full suite at a453d12c: Test Files 128 passed (128), Tests 1928 passed (1928), VERDICT command-exit 0. record-lock-read.integration.test.ts at 00e32ec3: Tests 20 passed (20). rest full suite at a453d12c: Test Files 429 passed (429), Tests 8819 passed | 351 skipped. Typecheck plugin-approvals (test-layer debt unchanged 321) and rest: exit 0. spec build + check:generated: All 14 generated artifacts are up to date. Targeted dogfood approval-record-lock-read.dogfood.test.ts: Tests 1 passed (1). Reverse verification (fix committed, approval-service.ts restored from origin/main a10345ab in the worktree only): 11 failed / 9 passed, restored with git checkout HEAD, hash equal to HEAD blob, git diff HEAD empty. Cross-package type reverse check: a third kind in the plugin's return type -> TS2416 against the rebuilt spec dist; restored, hash verified.",
      "gates": "Local: dispatch-gates --ran at a453d12c: 119 derived accounted, 116 run, 3 NOT MEASURED (exit 3 PREREQUISITE NOT MET: check-plugin-teardown-shape --self-test shallow clone; spec check:skill-examples client-react unbuilt; check:dual-build-cjs-loads unbuilt packages). check:query-options-erasure red at a453d12c (test surface 236->237), fixed, green at 00e32ec3 (test surface 236); check:nul-bytes OK at 00e32ec3; overlap-check VERDICT clean exit 0 (origin/main and #37148). Local-only check:dev-prereqs exit 1: worktree not fully built (machine state, 35 ui/ dist entries absent), not a diff finding. CI on 00e32ec3: all required families in_progress at report time (Lint, Type Check, Check Changeset, Governed Surface Queue Guard, PR-body guards among 25 check-runs); not re-run locally.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm; the one affected dogfood file ran green locally",
      "mcp_calls": "0",
      "api_writes": "3 — git push (branch, 6 pushes), fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches -> PR #37191, assignee os-support-ai), post-stamped os-dev-report comment on #37151",
      "open_questions": [
        {
          "question": "Three surfaces outside the claim's file list still describe the old answer: @objectstack/client types getRecordLock/getRecordLocks without lockSource; the record-page composite (packages/rest/src/record-page-routes.ts) serves its lock as { locked } only; the published skill reference skills/objectstack-automation/references/state-machines-and-approvals.md says the single door answers locked and nothing else.",
          "options": [
            "A: one follow-up card for client SDK type + record-page composite (server lane), and a separate skills-only PR for the skill sentence (Tier H)",
            "B: widen this PR's claim surface and add the client type and composite here",
            "C: leave as is"
          ],
          "recommendation": "A, because the skill path would make this PR Tier H and the client/composite are outside the ruled two doors; the seat-4 grid reads the batch door directly"
        },
        {
          "question": "The anchor alignment changes the single door's answer for a loosely spelled id from the lock to null (404). I declared only the claim's Clause-② widening arm; is a (narrowing) arm owed for that behaviour change?",
          "options": [
            "A: keep widening only (the change answers an id that is not the record's own id; no client asking with server-given ids is affected; no reach measured)",
            "B: re-declare as narrowing (BREAKING, full dogfood owed)"
          ],
          "recommendation": "A, because the claim line is copied verbatim and the narrowed case has no measured reach; seat to confirm at L2"
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: the record-lock write hook keys a by-id write on the writer's spelling; on a driver where the row match is looser than the request bookkeeping's record_id match (numeric id asked as 07) the two could disagree — read-only inference, no reach measured; in PR Acceptance notes"
      ]
    }
  14. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    {
      "issue": 37151,
      "status": "done",
      "round": 2,
      "branch": "claude/issue-37151-lock-source-field",
      "head_sha": "e99cf2cf",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37191",
      "session": "session_01WGufzeiHatzB4rRx1t4Php",
      "premise_still_valid": true,
      "summary": "Round 2 per the seat ruling. (1) Anchor not narrowed: the single door's readability anchor is restored byte for byte to origin/main (any returned row counts); the batch door keeps its strict anchor. Nothing forces the single door to the strict anchor: the lockSource master check reads the row through the engine (detailRowHeldByLockingApproval), so a loosely spelled line of a held master answers 'master' at the single door. The round-1 anchor-parity pin is replaced by pins for the two kept behaviours. The seat's sentence on the two anchors is in the PR body, changeset, docblocks and route comment; approvals.mdx states the difference. (2) @objectstack/client getRecordLock/getRecordLocks now type the optional lockSource, pinned in client.test.ts, and the changeset gains an @objectstack/client patch entry. (3) record-page-routes.ts and the skills sentence are untouched and recorded as routed to triage by the seat.",
      "tests": "At e99cf2cf, in one lock run: plugin-approvals full suite Test Files 128 passed (128), Tests 1928 passed (1928); rest lock route + tripwire Tests 36 passed (36); client Test Files 59 passed (59), Tests 820 passed (820); VERDICT command-exit 0. Typecheck plugin-approvals (test debt 321, unchanged), rest and client: exit 0. spec check:generated: All 14 up to date. Reverse checks: restoring approval-service.ts from 00e32ec3 (strict single anchor) turns the kept-anchor pin red (1 failed | 19 passed); restoring packages/client/src/index.ts from origin/main turns the client test-layer typecheck red (client.test.ts: 2 type errors). Both restored; hashes verified against HEAD; worktree clean.",
      "gates": "dispatch-gates --ran at e99cf2cf: 120 derived, 116 run, 4 NOT MEASURED, all exit 3 PREREQUISITE NOT MET and all run in CI: check-plugin-teardown-shape --self-test (shallow clone), spec check:skill-examples (client-react not built), check:dual-build-cjs-loads and check:i18n (fresh worktree, workspace/CLI not built). query-options-erasure and nul-bytes exit 0. overlap-check VERDICT clean exit 0 (origin/main 893eac8b, #37148). CI at e99cf2cf when reported: 60 success, 12 skipped, 2 in_progress (Check Changeset, PR-body guards; both re-fired by the body edit).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 this round — git push (e99cf2cf), relay issue_patch on PR #37191 body (14176/14176 bytes read back identical, run 45543961377), post-stamped os-dev-report round-2 comment on #37151",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: write-hook id-spelling inference (unchanged from round 1, in PR Acceptance notes)",
        "routed to triage by the seat: record-page-routes.ts lock composite; skills state-machines-and-approvals.md sentence"
      ]
    }
  15. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Seat ruling · 2026-11-25T04:13Z · the readability-anchor row (7148285178) is carried, not built here

    This revises one line of seat 3's ruling record 7148480184: "The appended item (comment 7148285178, the two doors' readability anchoring) is built in the same change with a parity pin". Triage's 7148580286 repeated that line. That line was the seat's carrying note, not the maintainer's words: the maintainer's decision was route A, the lock-source field. It is withdrawn for this card.

    Why. PR #37191's build measured both ways of aligning the two doors:

    • Strict at both doors ("the row returned is the asked id"): the single door then answers null for a loosely spelled id (case-folded, or "07") where it answers the lock today. That is a narrowing on a published door. It would make this card a contract-tier narrowing and Tier H, for a p3-grade finding with no measured reach.
    • Loose at both doors: the batch door would need one read per row, which is what its strict anchor exists to avoid.

    So each door keeps its current anchor. The single door stays loose and the batch door stays strict, and #37191 changes neither. Row 7148285178 is carried: it stays unticked, and seat 3 asks triage to move it to its own p3 carrier (mailbox #36743), so Fixes #37151 does not close it silently. The row's own text already provides for this: "If another option is ruled, this row stays here for the next change to these doors."

    #37191's PR body cites this comment.


    Generated by Claude Code

  16. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    2026-11-25T04:17Z Row 7148285178 (the lock doors anchor readability differently) moved to #37195, following seat ruling 7152650156. #37151 no longer carries it, so Fixes #37151 can close this card without leaving the row behind.

  17. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    {
      "issue": 37151,
      "status": "done",
      "round": 3,
      "branch": "claude/issue-37151-lock-source-field",
      "head_sha": "030cd914",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37191",
      "session": "session_01WGufzeiHatzB4rRx1t4Php",
      "premise_still_valid": true,
      "summary": "Round 3 is wording only, with no behaviour change. S1: the spec batch docblock, the changeset and approvals.mdx (plus the plugin getRecordLock docblock) now state the measured behaviour. The single door counts any returned row as readable, and its master half reads the row found, so a loosely spelled line of a held master answers 'master'. Its own half looks up the request by the id as asked, so a record held by its own request may answer { locked: false } under another spelling. S2: the texts cite seat ruling 7152650156 on #37151 instead of 'seat ruling on PR #37191'; the PR body names 7148285178 as carried and the move-to-carrier request 7152670747. Nits: the spec docblock and the changeset say an implementation may omit lockSource; the client docblock sentence is joined. Routing note: skills sentence on #35769 (triage 7151747767), record-page composite #37195.",
      "tests": "One lock run at 030cd914, VERDICT command-exit 0: closure build (spec rebuilt), spec check:generated All 14 up to date, typecheck client/plugin-approvals (debt 321 unchanged)/rest exit 0, record-lock-read.integration.test.ts Tests 20 passed (20).",
      "gates": "Text gates exit 0 at 030cd914: check:doc-authoring, check:issue-citations, check:docs-transcript-drift, check:nul-bytes, spec check:docs, check-affected-docs, check-empty-changeset, check-changeset-no-major, check:spec-docblock-symbol-anchors. overlap-check VERDICT clean exit 0 (origin/main bc3ec37a, #37148). CI at report: 25 success, 12 skipped, 34 in_progress, 0 failure.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 this round — git push (030cd914, one push), relay issue_patch PR #37191 body (16699/16699 identical), post-stamped os-dev-report round-3 comment on #37151",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carried elsewhere: skills sentence on #35769 (triage 7151747767); record-page composite #37195; anchor row 7148285178 moving to a carrier (7152670747)"
      ]
    }
  18. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Close-out · 2026-11-25T05:22Z

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

Metadata

Metadata

Assignees

Labels

area:workflowdomain:serverenhancementpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions