Repository navigation
fix(plugin-approvals): a locked record's refusal names it only by a field the writer may read - #38555
Conversation
…nly by a field the writer may read Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov
…ield the writer may read A display field declared internal or of a credential type never titles the refusal, and a field-visibility source that cannot answer gives no title. Code, status and the rest of the sentence are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract-review-claim: session_017xRBcW9L8Noz9BxEwjwiov · head 33765d4 · 2026-11-29T09:22Z The full round at |
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 620f0359ae603e04ba38abdd44542ed1eba2c56c && git checkout 620f0359ae603e04ba38abdd44542ed1eba2c56c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9e5be7bb461274c8adf3204f2a179f86a485cf7d 33765d47cf9765fa845da2a1f3b137ad1360e73a && git checkout -B drift-repro 9e5be7bb461274c8adf3204f2a179f86a485cf7d && git merge --no-ff 33765d47cf9765fa845da2a1f3b137ad1360e73a
node scripts/docs-audit/affected-docs.mjs --json 9e5be7bb461274c8adf3204f2a179f86a485cf7d
|
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier: What the reviewer measured:
No must-fix, no should-fix. Nits (optional): the changeset's "cannot answer" means a throw only; the JSDoc on the lock hook still describes the old behaviour when no source is wired. VERDICT: PASS |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov 席位核对ACCEPT · head
|
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Landing 2026-11-29T09:47Z, head
State: ready, with auto-merge through the merge queue. |
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
A locked record's refusal names it only by a field the writer may read.
RECORD_LOCKEDrefusal names the record by its display field only when that field is one a caller can be served at all. A display field declaredinternal: true, or of a credential type (secret,password), never titles the refusal, whether it is the object's explicitnameFieldor the derived one.RECORD_LOCKED), its status (409) and its sentence. Without a title it names the object's label ("This Vault Entry is locked while an approval is in progress, ..."). An ordinary display field still names the record as before, with or without a field-visibility source wired.@objectstack/plugin-approvalspatch.Read first, by risk:
packages/plugins/plugin-approvals/src/lifecycle-hooks.ts: the newisWithheldTitleFieldand its one call inrecordTitleOf, plus thefailClosedOnThrowargument at the per-row refusal.packages/plugins/plugin-approvals/src/payload-redaction.ts: the opt-infailClosedOnThrowbranch. Callers that do not pass it are unchanged.packages/plugins/plugin-approvals/src/record-lock-refusal-writer-fls.integration.test.ts: the new top-leveldescribe.Tests
The new pins sit in the existing harness file as a top-level
describe. They run against a realObjectQL, a real sqlite driver and the real lock hooks:Red on base, green on head:
Readings
record-lock-user-facing-message,detail-row-lock): 3 files, 54/54.scripts/ablation-replace.mjs, then restored (blob equals HEAD,git diff HEADempty):false: 1 failed, 13 passed. That one is the throw pin.pnpm --filter @objectstack/plugin-approvals test: 131/131 files, 1997/1997 tests.pnpm --filter @objectstack/plugin-approvals typecheck: exit 0. That covers tsc, the scripts project andcheck:test-typecheckOK.Acceptance notes
origin/mainmoved 7 commits past the base. None of them touchespackages/plugins/plugin-approvals,packages/core/srcorpackages/spec/src/data, so the branch was not merged.Verification
Gates
node scripts/pm/dispatch-gates.mjs --commands(head 33765d4) derived 71 families. Local results: 69 exit 0. 2 exit 3 (PREREQUISITE NOT MET, a whole-repo build is absent), so they are NOT MEASURED locally and CI carries them:pnpm check:dual-build-cjs-loads,pnpm check:i18n.--ranreconciliation: 71 accounted, 69 run, 2 NOT-MEASURED, 0 UNRUN.pnpm --filter @objectstack/dogfood test, after building its closure): the lock VERDICT reads command-exit 0. Test Files: 495 passed, 3 skipped (498). Tests: 4183 passed, 68 skipped (4251). No failures. The lock was held 3602 s on a shared box, closure build included, and it flagged holder-side starvation for that length.Two-minute check:
Expect 14 passed. Revert the fix files to
origin/mainand expect 6 failed.🤖 Generated with Claude Code
https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov