Skip to content

approvals: the record page composite lock still answers { locked } only, without the lockSource that #37151 adds to the lock doors #37195

Description

@objectstack-fleet

triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

Filing gate: ② carried out under an existing ruling. The maintainer chose route A on #37151 (record 7148474531, 「加一个『被谁锁』字段」), so no new decision is owed. Source: fleet, filing request 7151706305 from repo:objectstack#3, a carrier of PR #37191.

What happens

PR #37191 (#37151) adds lockSource: 'record' | 'master' to the four lock doors and to the client types. The record page's composite read in packages/rest/src/record-page-routes.ts (~485–489) builds its own lock answer and keeps only the flag:

let lock: { locked: boolean } | null = null;
...
lock = answer ? { locked: answer.locked === true } : null;

So, after #37191, a record page still cannot tell a line held by its own approval from a line of a held master. The first may be deleted; the second is refused RECORD_LOCKED. The record page offers a Delete the server then refuses, which is what #37151 fixes for the grid.

reach: read from code at main 3b4f0b9. It applies to every record page of a master-detail line whose master is under a locking approval.

Expected

The composite lock passes lockSource through unchanged, beside locked. null still means unreadable or missing. The record page hides Delete on lockSource: 'master', as the grid does.

Acceptance

  • A pin: the composite answers lockSource identically to the single lock door, in four cases:
    • a record held by its own approval;
    • a line of a held master;
    • a self-held line under a held master;
    • an unheld record.
  • The record page's Delete follows lockSource, with a pin.

Blocked-by: #37191

Grading: area:workflow · Feature · p2 (carrying out the #37151 ruling on a fifth door; same effect as #37151) · size XS.
Dedupe: "record-page lock lockSource" and "record-page-routes lock" (open) → only #37151.

Activity

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Row carried here 2026-11-25T04:16Z from #37151 (row 7148285178), at repo:objectstack#3's request (mailbox #36743, 7152670747). Seat ruling 7152650156 on #37151 takes this alignment out of #37151's build, and PR #37191 keeps each door's current anchor. This card is the next change on the same approvals lock surface, so the row now waits here.

    • 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". Aligning them either narrows the single door's served answer (strict) or costs one read per row at the batch door (loose). Pick one and pin parity across both doors.

    Grade reasoning is unchanged: the finding comes from code (PR #37145 L2 7148242072, item ③), and no reach was measured. It does not raise this card's grade. If the build here does not touch the doors' anchoring, leave the row open for the next change to these doors.

  3. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Row added 2026-11-25T04:41Z, at repo:objectstack#3's request (mailbox #36743, 7152943318). Source: PR #37191's contract review, L2 7152908694 item ③. It is in the same loose-id family as the readability-anchor row above (7152712740), so the two share this carrier.

    • The record-lock write hook keys a by-id write on the writer's spelling of the id. In packages/plugins/plugin-approvals/src/lifecycle-hooks.ts, the record-lock write hook and recordHeldByLockingApproval look the request table up by the id as the writer spelled it. A driver may match rows more loosely than the request table's record_id match: a numeric id asked as "07", or a case-insensitive collation. On such a driver, the write can reach a row that the lookup says is not held. Done when a probe settles it. Either it shows that no public write entry passes such an id through, or the hook keys on the stored row's id, with a pin.

    It is read from code, with no measured reach:: no public entry was shown to send such an id. So it does not raise this card's grade. Whoever takes this card measures the probe first. A measured reach makes it a card of its own, graded by what it lets through.

  4. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Unlocked 2026-11-25T05:35Z. PR #37191 (#37151, route A) merged at 2026-11-25T05:21Z, so both lock doors now carry lockSource. pm:blocked → pm:queue.

    No seat takes it now. It is area:workflow p2. Seat 3 takes workflow p1 only, on the maintainer's word (2026-11-25 02:44Z), and no other seat takes workflow. It waits in the queue until a seat opens for workflow p2. It carries two p3 loose-id rows (7152712740 and 7153086539), which ride with it.

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:workflow · domain:server · Feature · priority:p2 · pm:queue · size S; rationale: after #37151 the two lock doors carry lockSource, but the record page composite lock still answers { locked } only. It extends a ruled route, so it takes p2 with its source.

    Audit record in the shape the claim check reads. It restates the unlock of 2026-11-25T05:35Z, which used another opening. It carries two p3 loose-id rows (7152712740, 7153086539). area:workflow has no seat right now, so it waits in pm:queue.

  7. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

    Claim: PM loop round 1
    Session: session_01QSeKYnrQ7UMtHofKQVjcH2
    Account: os-justin
    Branch: claude/issue-37195-record-page-lock-source
    Worktree: objectstack-issue-37195
    Domain: domain:server
    Seat: repo:objectstack@os-justin
    File surface: packages/spec/src/api/record-page.zod.ts (reason: the composite's published lock shape gains lockSource), packages/rest/src/record-page-routes.ts, ui/packages/app-shell/src/views/recordPagePayload.ts, ui/packages/app-shell/src/hooks/useRecordApprovals.ts, ui/packages/app-shell/src/views/RecordDetailView.tsx (reason: the Delete affordance reads the lock through resolveApprovalLock; RecordDetailView is over 6,000 lines, so new logic goes in a helper beside it and the view only calls it), packages/rest/src/approvals-routes.ts (reason: amended 2026-12-01 after dev report 7299496375 — exports recordLockPayload, the lock doors' own projection, so the composite reuses it instead of copying it), ui/packages/app-shell/src/views/recordDeleteHeldByMaster.ts (reason: the new helper the view calls), ui/packages/types/src/data.ts (reason: amended at L1 — the published @object-ui/types RecordPagePayload.approvals.lock must carry lockSource too) (stop on breach; explain in the report). Not in scope: the two p3 loose-id rows (7152712740, 7153086539) in plugin-approvals/src/lifecycle-hooks.ts, which stay open on this card, as the card allows, because this build does not touch the doors' anchoring.
    Container & model: S, mode:subagent, model: opus (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable — default tier; a widening build stays at the default tier, its review is contract-tier), effort: medium
    Clause-②: yes (widening: the record page composite's published lock gains lockSource, and the published @object-ui/types RecordPagePayload.approvals.lock gains the same optional lockSource; amended 2026-12-01 at L1)
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Ruling-ref: 7148474531 (#37151, route A: 「加一个『被谁锁』字段」; "It widens a published return type, so it is Clause-②: yes (widening) with a contract-tier review")
    Thread-read: 7179917428
    Premise: holds (origin/main d97aaae, 2026-12-01T01:58Z: record-page-routes.ts:485-488 builds { locked } only; useRecordApprovals.ts:658 and :678 keep locked alone; record-page.zod.ts:321 declares lock: z.object({ locked: z.boolean() }).nullable(); recordPagePayload.ts:477 passes answer.lock through)
    Serial constraints cleared: #38776 (seat os-support-ai) names ui/packages/app-shell/src/views/metadata-admin/ files only — disjoint from recordPagePayload.ts; no in-flight claim names record-page-routes.ts or record-page.zod.ts; the lifecycle-hooks rows are left out, so PR #38810 and #37218 are not met

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2
    os-dev-report

    {
     "issue": 37195,
     "status": "done",
     "branch": "claude/issue-37195-record-page-lock-source",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38829",
     "session": "session_01QSeKYnrQ7UMtHofKQVjcH2",
     "premise_still_valid": true,
     "summary": "The record page composite (POST /data/:object/:id/page) now builds approvals.lock through recordLockPayload, the projection both lock doors serve (now exported from packages/rest/src/approvals-routes.ts). So lockSource passes through beside locked, and null still means unreadable, missing or no lock service. RecordPageApprovalsSchema.lock gains optional lockSource: 'record'|'master', declared inline. The PM hypothesis to reuse MetadataLockSourceSchema is falsified: that schema is the metadata-protection enum (artifact|package|env-forced), and the approval kind has no Zod schema in spec, so check:api-surface is unchanged. In the Console, useRecordApprovals keeps the kind: recordLock passes it through, and a new lockSource field keeps it beside a visible pending row on the composite path. A new helper, views/recordDeleteHeldByMaster.ts, hides Delete on 'master', mirroring the grid's heldByMaster, and RecordDetailView only calls it. recordPagePayload.ts needed no change: it already passes answer.lock by reference. The assignee field was left unwritten (rule 2). The container restarted mid-task; I resumed in the kept worktree with no uncommitted work lost.",
     "tests": "head 5463dda2f6. spec: vitest src/api/record-page.test.ts, 13 passed (new: parse keeps lockSource; refuses unknown kind at ['lock','lockSource']). rest: vitest record-page-routes.test.ts + rest-approvals-record-lock-route.test.ts, 63 passed (new parity pin: composite approvals.lock equals single door data in the 4 card cases + a locked no-kind case; null lock stays null). ui: useRecordApprovals.lockSource-37195 + answered-12220 + RecordDetailView.approvalLock-25934/-12220, 24 passed; harness block deleteFollowsLockSource-37195, 3 passed (88 skipped by -t); 37 consumer test files of useRecordApprovals/seedRecordApprovals/recordPagePayload, 331 passed. Ablations, restored via git checkout HEAD: route reverted to the old {locked} projection, 3 failed | 40 passed (the 3 locked-with-kind parity cases red); view call to recordDeleteHeldByMaster dropped, 1 failed (the master case). Typecheck: @objectstack/rest typecheck exit 0; @object-ui/app-shell type-check (tsc + tsconfig.test.json) exit 0.",
     "gates": "local, head 5463dda2f6: dispatch-gates --commands derived 97 families; dispatch-gates --ran with exit codes says 97 accounted, 95 run (all exit 0), 2 NOT-MEASURED: 'pnpm --dir ui exec vitest run scripts/' timed out at a 300s foreground cap (exit 124), 'pnpm check:dual-build-cjs-loads' PREREQUISITE NOT MET, no repo-wide dist (exit 3); both owed to CI. spec check:generated: exit 1 (content/docs/references stale), then gen:docs, then exit 0 (all up to date; check:api-surface and check:authorable-surface green; api-surface unmoved). Local-only check:dev-prereqs scan: exit 1, precondition unmet (9 ui workspace packages unbuilt, machine state, not this diff). CI check-runs on PR #38829: NOT MEASURED, reason: the report is delivered at the end of local verification, with no CI wait.",
     "mcp_calls": "0",
     "api_writes": "3: git push (not REST; branch probe + 4 commit pushes); relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST issues/38829/assignees) via repository_dispatch run 46566845908; relay comment (POST /repos/objectstack-ai/objectstack/issues/37195/comments) via post-stamped os-dev-report",
     "classifier_refusals": [],
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: @object-ui/types RecordPagePayload (ui/packages/types/src/data.ts) still types approvals.lock as { locked } only. The wire carries lockSource, and the hook narrows it at runtime. The file is outside the claim's file surface; recorded in PR Acceptance notes.",
      "carrier: none · noted, not filed: on the non-composite fallback read (an adapter without getRecordPage, or refresh() after a decision), the lock door is not asked beside a visible pending row, as before. A self-held line under a held master keeps Delete there until the next page read (fails open; the server refuses RECORD_LOCKED). Recorded in PR Acceptance notes."
     ],
     "deviations": "File surface: added packages/rest/src/approvals-routes.ts (export of recordLockPayload, the projection the lock doors already use, so the composite reuses it rather than copying it) and packages/spec/src/api/record-page.test.ts (spec pin). New test files: ui/.../hooks/useRecordApprovals.lockSource-37195.test.tsx and a block in RecordDetailView.harness.test.tsx (the harness rule for a component with a shared harness). recordPagePayload.ts is unchanged. The changeset names @objectstack/spec and @objectstack/rest only; @object-ui/app-shell is private.",
     "files_changed": [
      ".changeset/37195-record-page-lock-source.md",
      "packages/rest/src/approvals-routes.ts",
      "packages/rest/src/record-page-routes.ts",
      "packages/rest/src/record-page-routes.test.ts",
      "packages/spec/src/api/record-page.zod.ts",
      "packages/spec/src/api/record-page.test.ts",
      "packages/spec/docs/references/api/record-page.md",
      "ui/packages/app-shell/src/hooks/useRecordApprovals.ts",
      "ui/packages/app-shell/src/hooks/useRecordApprovals.lockSource-37195.test.tsx",
      "ui/packages/app-shell/src/views/RecordDetailView.tsx",
      "ui/packages/app-shell/src/views/recordDeleteHeldByMaster.ts",
      "ui/packages/app-shell/src/views/RecordDetailView.harness.test.tsx"
     ],
     "l2_routing": "contract-tier review owed: published RecordPageApprovalsSchema.lock widens (Clause-②: yes (widening)); not requested by this dev"
    }
  10. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

    ACCEPT → PR #38829 comment 7300518709 · head 6fae497e · ready + auto-merge 2026-12-01T04:16Z. L2 PASS 7300475574. Follow-up: #38841 (L2 nits, after merge). The two loose-id rows are carried to #38841 before merge.

  11. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

    Landed 2026-12-01T04:43Z: PR #38829 merged; this card closed by its Fixes. Delivered: the record page composite answers lockSource beside locked, identically to the single lock door (it reuses the doors' projection); the published spec schema and @object-ui/types type carry it; the record page hides Delete on lockSource: 'master', as the grid does. Carried elsewhere: #38841 (L2 nits, plus this card's two p3 loose-id rows, 7300539983). pm:dispatched removed in this stroke.

  12. removed
    pm:dispatched
    on Dec 1, 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