Repository navigation
fix(plugin-approvals): sys_approval_request.record_id declares referenceDeletedWhen on cancel_reason = record_deleted - #23798
Conversation
…nceDeletedWhen on cancel_reason = record_deleted One key on the pointer's id half, beside referenceVia: a request cancelled because its record was deleted says so in the served object definition, so a renderer draws the option's label instead of a link. Pinned beside the object, together with the object's parse through ObjectSchema. Claude-Session: https://claude.ai/code/session_018VqJPGA1NDNSCZsnecsChP Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. 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 a47e71ba2d75db160c8a08130237e3066bf92710 && git checkout a47e71ba2d75db160c8a08130237e3066bf92710
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 46ca793edbef645731bebadb1bd7a63564cafba2 194e9effe787bad775627bd51561c328d562b672 && git checkout -B drift-repro 46ca793edbef645731bebadb1bd7a63564cafba2 && git merge --no-ff 194e9effe787bad775627bd51561c328d562b672
node scripts/docs-audit/affected-docs.mjs --json 46ca793edbef645731bebadb1bd7a63564cafba2 |
席位核对 · ACCEPT ·
|
Fixes #23736
Clause-②: no
What
One key on
sys_approval_request.record_id, beside itsreferenceVia: 'object_name':A request the platform cancelled because its record was deleted (
cancel_reason: record_deleted) now says, in the served object definition, that the pointer names a record that no longer exists, so a renderer can draw the sibling option's label (Related record deleted) instead of a link. This is the services half of the objectui#12489 ruling, letter A (batch #352 item 4); the spec key is #23735 (8776119bdc). No page edit and nothing in objectui: the served page's Details tab draws the pair throughrecord:details, and the renderer reads the key.Landing place:
packages/plugins/plugin-approvals/src/sys-approval-request.object.ts, as the card expected. The producer is there; no other package needed a change.Files: the object (3 lines: the key and a 2-line comment), the pin test beside it (
sys-approval-request-pointer-pair.test.ts, +28 lines, one new describe with two tests), and.changeset/23736-record-id-deleted-when.md. Line budget: 43 additions, 0 deletions.Measured assumptions
The line parses. Measured on
origin/maind3df3ba (the card cited 0b1179f): the key isfield.zod.ts:1494, its field-half refusal:2294(noreferenceViais refused), and the sibling half isrefuseDishonestReferenceDeletedWheninobject.zod.ts:1862(the sibling must be a declared single-valueselectwith inlineoptionsholdingvalue).record_iddeclaresreferenceVia: 'object_name';cancel_reasonisField.select(APPROVAL_CANCEL_REASONS.map(...))holdingrecord_deleted.ObjectSchema.createparses the object at import and the pin re-parses the exported object withObjectSchema.safeParse: success.Clause-② no holds: the emitted declaration closure of
@objectstack/plugin-approvalsis byte-identical. Built the package before (on the base) and after (on this head),dist/index.d.tsanddist/index.d.mts, the only two declaration files it emits:Positive control: after the second build
dist/index.jsanddist/index.mjseach carry thereferenceDeletedWhenline (1 hit each), so that build did pick the change up. The key is already in the declarations (45 hits in both builds, from the spec's field type), which is why they do not move. No export, type or accept set changes.The pin, and its ablations
The pin:
fields.record_id.referenceDeletedWhenequals{ field: 'cancel_reason', value: 'record_deleted' };cancel_reasonis aselectdeclaring therecord_deletedoption; the exported object parses throughObjectSchema.Both ablations ran through
scripts/ablation-replace.mjs(anchor hit 1 time, blob changed, restore proven: blob equals HEAD andgit diff HEADempty), after the fix was committed. The pin's subject is this package's source (./sys-approval-request.object.js), so no rebuild is in the path. Direction in both: red.Delete the line -> the presence test is red (1 failed, 5 passed):
Point
valueat an option that does not exist (record_gone) -> the spec refuses the parse at import, so the whole file is red (0 tests run) with the located issue:Restored tree: the pin file passes 6 of 6 (4 existing pointer-pair tests and the 2 new ones); the whole
@objectstack/plugin-approvalssuite passes 78 files, 1082 tests (vitest run --maxWorkers=2, under the shared verify lock, exit 0).Gates (all at head 194e9ef)
pnpm --filter @objectstack/plugin-approvals typecheck: exit 0 (the test-layer debt ledger holds at 8 files, 324 errors, 27 signatures: unchanged).eslint --no-inline-configon the two changed source files: exit 0. Control-byte scan of all three changed files: no hits.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 65 commands from the diff; every one was run with its exit code recorded before any pipe;--ranreconciles: 65 derived, 65 run, 0 NOT-MEASURED, 0 UNRUN. Two families first exited 3 (PREREQUISITE NOT MET:check:i18nandcheck:dual-build-cjs-loadsread built output of packages not yet built). Their prerequisites were built (turbo run build, 61 and 75 tasks) and both were re-run: exit 0 (check:i18n: 10 packages in sync;check:dual-build-cjs-loads: 110 entry points load). The four other dist-reading families (check:dts-closure,check:published-files,check:lean-entry-closure,check:sourcemap-no-sources-content) were re-run on the fully built tree too: exit 0.origin/mainmoved to 46ca793 during the run (a version-packages commit and two others; underpackages/plugins/plugin-approvalsit touches onlyCHANGELOG.mdandpackage.json, the version bump, and nothing underpackages/spec/src/data). The three changeset gates were re-run against it: exit 0. No merge of main into this branch.Lint & Repo Gatesfarm,Test Core,Build Core) is left to the PR's check-runs; none was re-run locally.Acceptance notes
packages/spec/liveness/field.jsonkeepsreferenceDeletedWhenasplanned: its own note says it flips toliveon the objectui#12489 step 4 renderer landing, citing this declaration asproducer. That flip belongs to the renderer's landing, not to this PR; not edited here.cancel_reasonis servedrecord_idwithout the predicate. Nothing to do here; recorded so the renderer card reads it.skip-changesetdoes not apply).Generated by Claude Code