Repository navigation
feat(plugin-approvals): approval steps reach the record activity stream as approval feed items - #37188
Conversation
…d-gated by request visibility Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…pens the record's approvals Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
… kinds Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…proval-feed-items
… through the kernel logger's error signature Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…ecord page's early returns Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…for the activity entry insert Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…warn; the test reads entries with typed options Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…hared harness, on the 动态 tab The declared-actions file stubs SchemaRenderer, so the page body (and its stream) never drew there; the pin moves to RecordDetailView.harness.test.tsx. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…d-kind examples name call Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
📓 Docs Drift CheckThis PR changes 1 package(s): 42 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. 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 f78bd2362da8903b27ee8f09c04776c7d15170a2 && git checkout f78bd2362da8903b27ee8f09c04776c7d15170a2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 93bd45957bc4a43eb54d8fec2b36f1cbef41dc5f 06a3c7640b5de8e8d3c0d665d426137e8d42077b && git checkout -B drift-repro 93bd45957bc4a43eb54d8fec2b36f1cbef41dc5f && git merge --no-ff 06a3c7640b5de8e8d3c0d665d426137e8d42077b
node scripts/docs-audit/affected-docs.mjs --json 93bd45957bc4a43eb54d8fec2b36f1cbef41dc5f
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs 席位核对 — REWORK · repo:objectstack#3 · head dc76347 · 2026-11-25T03:11ZL1: REWORK (L1-w, zone wf-A) There is no must-fix. Two should-fix findings are open, so under the merge standard this head is REWORK. No L2 is owed: nothing under Should-fix
Nits (fix any that ride the same push; each one left needs a follow-up card under the nit rule)
Read and found right (head dc76347)
Path to ACCEPT
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…e reader's language, step label included The stored summary is the English catalog sentence (approvalActivity* in every shipped pack); a non-system read with a locale is served it re-composed by the approvals door's own lookup, the step label read from the flows pack. Entries for revise, resubmit and cancel; none for an object with enable.activities false. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…he step half, send-back/resubmit and the muted timeline Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…locale overlay Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
…new kinds, the muted timeline and the reader's language Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs 席位核对 — ACCEPT · repo:objectstack#3 · head 06a3c76 · 2026-11-25T05:24ZL1: ACCEPT (L1-w, delta read, zone wf-A) No must-fix, no should-fix. No L2 is owed: nothing under Round 1 (7151680146), closed
Read and found right (head 06a3c76)
Landing to-do
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzg3KqwSpt61Y8ovKK7 Landing · zone wf-A · 2026-11-25T05:25Z · head
L1 ACCEPT 7153741928 on this head, no L2 owed (Tier S). Checks 60 success / 11 skipped / 0 failed, |
Requested by Yibo Wang · project thread
Fixes #35723
repo:objectstack#3 · os-support-ai · session_01WGufzg3KqwSpt61Y8ovKK7
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
approval-activity-feed.ts). AnafterInserthook on the decision logsys_approval_actionappends onesys_activityrow per step of kindsubmit,approve,reject,revise(sent back for revision),resubmit,recallandcancel, about the record the request governs. Other kinds (reminder, reassign, thread comment, ...) write none, and no decision comment rides on the row. An object withenable.activities: falsegets no entry, as the CRUD mirror writes none for it. Shape follows ADR-0052 section 5, so no published vocabulary moves:type: 'system'(platform-only; the app activity door refuses it),metadata.kind: 'approval'plus the step's action, its stored label and the two machine names its label is translated by (flow_name,step_name),source_object: 'sys_approval_request'/source_idnaming the request.summarystores the English sentence from plugin-approvals' own catalog (approvalActivity*intranslations/messages.ts, ten ids added to all eleven shipped packs); a newsys_activitymiddleware (bindApprovalActivityLocale) re-composes it onfind/findOnefor a non-system read that carries a locale, with the approvals door's own lookup (readerLabelsFor): the sentence ismessages.approvalActivity*in the reader's locale, and the step label isflows.FLOW.approvals.NODE.labelread the way the approvals tab reads it, else the stored label. A list that projectssummaryalone borrows the recognition columns and hands back only what it asked for. A system read, a read with no locale or noi18nservice, or a key the pack misses serves the stored line. Nosys_activityon the deployment (no plugin-audit) means no write; a failed append never fails the step and is logged once aterrorwith consequence and fix.approval-service.tsis untouched (overlap with PR fix(plugin-approvals): the batch lock read answers a line of a held master as locked #37145 and branchclaude/project-thread-x90m5yavoided).sys_activitymiddleware narrowsfind/findOne/count/aggregateso an approval row is served only when the approvals service would serve the caller its request (RequestVisibilitySource, the same source the request-table gates read). A read pinningobject_name+record_idasks with that record, so an object that opts intoenable.approvalsVisibleToReadersserves its readers too. Every non-approval row passes untouched; plugin-audit's parent-record gate still applies on top; failure to resolve fails closed for approval rows only. Count and rows agree.activityRowToFeedItemreads the tripletype: 'system'+metadata.kind: 'approval'+source_object: 'sys_approval_request'as theapprovalfeed kind (APPROVAL_ACTIVITY_FEED_TYPE), soPRODUCED_FEED_TYPESnow containsapprovaland the unproduced-kind diagnostic no longer names it. NewRecordViewApprovalsContextcarries the stream's 「看审批」 callback intoRecordActivityRendererandRecordChatterPanel.RecordDetailView). The approval tag's opener is extracted asopenRecordApprovals(approvals panel if drawn, else the 审批 tab) and supplied throughRecordViewApprovalsContextonly when the reader is served approvals; otherwise the line has no link.content/docs/frontend/plugins/plugin-detail.mdx:approvaljoins the produced-kinds table (six produced, seven not); the unproduced example becomescall.approver-address-readers.test.tsclassifies the two newactor_idreads asdisplay; the tenant-audit write census for plugin-approvals is regenerated (one new elevatedsys_activityinsert);content/docs/permissions/system-context.mdxrow 17 owns the new middleware'sisSystemread (its register regenerated with--write).Round 2 (L1 REWORK on dc76347)
activity-summary-message.tsstores the sentence plus its code and re-composes it per reader in asys_activitymiddleware, and this row's code is already on it (metadata.action, now withflow_name/step_name). The step label must be translated through the app's flows pack, which lives in the server'si18nservice and is read by the approvals door'sreader-locale-labelslookup; the console holds no such pack. Server-side, every reader of the column (the record page, the API, an export) gets the same line, and no console locale pack moves. Pinned for a zh-CN reader:已批准 · 经理审批and已提交审批, with the step label from an app flows pack.revise,resubmitandcancelwrite entries (Sent back for revision · STEP,Resubmitted for approval,Approval request cancelled, the last attributed to no one), each pinned.audit-writers.tswrites no activity row for an object withenable.activities: false); pinned.Approved · Manager review,Rejected · Manager review), plus the stored metadata.Tests
Readings, round 2 (head 06a3c76)
All local runs went through
scripts/pm/os-verify-lock.sh; verdict lines quoted. Round-2 head06a3c7640b(after mergingorigin/mainat93bd45957b).pnpm --filter @objectstack/plugin-approvals exec vitest run+typecheck(head06a3c764minus the cancel pin):Test Files 129 passed (129),Tests 1929 passed (1929),check:test-typecheck: OK,VERDICT command-exit 0.src/approval-activity-feed-35723.integration.test.tsat06a3c7640b:Tests 7 passed (7)(approve/reject/recall, send back + resubmit, cancel on record delete, muted timeline, zh-CN reader, reader without approval access, record-reader opt-in).node scripts/ablation-replace.mjsreplaced thebindApprovalActivityLocale(...)call inapprovals-plugin.tswith a no-op (anchor 1 to 0, blob changed); the zh-CN pin went red (Tests 1 failed | 6 passed (7), the six others green), restore verified (blob == HEAD,git diff HEADempty).dispatch-gates --ranreconciles106 derived, 104 run, 2 UNRUN; 101 exit 0.check:i18nfirst exit 3 (PREREQUISITE NOT MET), then its own one-command prerequisite build and re-run:check-i18n-bundles: OK (10 package(s) — all bundles in sync, no undeclared authoring keys),VERDICT command-exit 0.check:system-context-census(red in CI on05d82f29) fixed inf0b51c92:OK — 202 elevation read sites ... the generated register (178 symbol(s)) matches the tree, self-test all cases passed. NOT MEASURED locally, CI runs them:check:dual-build-cjs-loads,spec check:skill-examples(exit 3, unbuilt dist outside the closure);pnpm --dir ui exec vitest run scripts/andcheck:type-check-debt(declared narrowing: the first was OOM-killed in round 1, the second needs a whole-workspace build; noui/file and no package's type-check set changed this round).overlap-check --branch=claude/issue-35723-approval-feed-items:VERDICT clean exit 0.ui/files:RecordDetailView.*100 files / 858 tests, plugin-detail 417 files, bothtype-checkexit 0.!in the title, no(narrowing)arm).Acceptance notes
sys_activitykeeps its own lifecycle (rows reaped after 14 days); the 审批 tab keeps the full history. Steps taken before this lands write no backfilled rows.recordActivityFeed.ts) because plugin-detail cannot depend on the server plugin; both sides are pinned by tests.recordActivityFeed.approvalStep-35723.test.tsx(it renders React; the sharedrecordActivityFeed.test.tsis a non-JSX file). The record-page pin joined the sharedRecordDetailView.harness.test.tsxas its own top-level block.Verification
First read (by risk):
packages/plugins/plugin-approvals/src/approval-activity-feed.ts—bindApprovalActivityReadGate(who sees an approval row),bindApprovalActivityLocale(the system-read pass-through and the borrowed columns), and the producer hook's transaction and tenant context.ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts—isApprovalStepRow, the mapping branch.ui/packages/app-shell/src/views/RecordDetailView.tsx—openRecordApprovals/viewApprovals, a plain function below the page's early returns (a hook there breaks hook order).Two-minute check:
pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/approval-activity-feed-35723.integration.test.ts— expect 7 passed: one entry per step (approve / reject / recall, send back and resubmit, cancel on record delete), none on a muted timeline, a zh-CN reader served已批准 · 经理审批, none served to a reader without approval access while other entries stay, and served under the record-reader opt-in.Generated by Claude Code
https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7