Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
2fcd010
wip(plugin-approvals): approval steps write sys_activity entries, rea…
claude Nov 24, 2026
dc72068
wip(ui): approval activity rows read as the approval feed kind; 看审批 o…
claude Nov 25, 2026
51c3592
wip: changeset and the record page's approval-line wiring pin
claude Nov 25, 2026
28f459e
test(plugin-detail): the census pin names approval among the produced…
claude Nov 25, 2026
2be3793
Merge remote-tracking branch 'origin/main' into claude/issue-35723-ap…
claude Nov 25, 2026
8fb5c70
fix(plugin-approvals): classify the activity entry's actor reads; log…
claude Nov 25, 2026
6c337e9
fix(app-shell): the approvals opener is a plain function, below the r…
claude Nov 25, 2026
cda33a9
chore(audit): regenerate plugin-approvals' tenant-audit write census …
claude Nov 25, 2026
8307d85
fix(plugin-approvals): the activity feed's logger keeps a guaranteed …
claude Nov 25, 2026
720f298
test(app-shell): the record page's approval line pin renders in the s…
claude Nov 25, 2026
dc76347
test(plugin-detail), docs: approval has a producer now; the unproduce…
claude Nov 25, 2026
5d33473
Merge origin/main into claude/issue-35723-approval-feed-items
claude Nov 25, 2026
bb2bb13
feat(plugin-approvals): an approval entry's line is re-composed in th…
claude Nov 25, 2026
05d82f2
test(plugin-approvals): pin the zh-CN reader's line and step label, t…
claude Nov 25, 2026
f0b51c9
docs(permissions): the system-context page owns the approval entry's …
claude Nov 25, 2026
06a3c76
test(plugin-approvals): pin the cancelled entry; changeset names the …
claude Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/35723-approval-activity-feed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@objectstack/plugin-approvals': patch
'@object-ui/plugin-detail': patch
'@object-ui/app-shell': patch
---

feat(plugin-approvals): a record's activity shows its approval steps, to the users who can read its approvals

Clause-②: no
Metadata-protocol: none

A record under approval used to show no approval in its activity: nothing wrote an activity entry for an approval step, so the activity stream's one-line approval entry was reachable only from items a host supplied by hand.

- **One activity entry per approval step.** plugin-approvals now appends one `sys_activity` entry for each step it records in its decision log, about the record the request governs: submitted, approved (`Approved · Manager review`, the step's label after the dot), rejected (`Rejected · Manager review`), sent back for revision (`Sent back for revision · Manager review`), resubmitted, recalled, and cancelled (the record was deleted). Other actions (a reminder, a reassignment, a thread comment, …) write none, and an object that sets `enable.activities: false` gets none, as the CRUD mirror writes none for it. The entry carries no decision comment. It follows ADR-0052 §5, so no published vocabulary changes: `type` is the built-in `system`, the domain kind is `metadata.kind: 'approval'` (with the step's action, its label and the flow and step names beside it), and `source_object` / `source_id` name the request. A deployment without plugin-audit has no `sys_activity` and gets no entries.
- **Each entry reads in the reader's language.** The stored `summary` is the English line from plugin-approvals' own catalog (`approvalActivity*` messages, shipped in all eleven of its locales). A read that carries a locale is served the line re-composed in that locale, and the step's label is read from the app's language pack (`flows.<flow>.approvals.<node_id>.label`) the way the approvals tab reads it, else the stored label: a zh-CN reader sees `已批准 · 经理审批`. A system read, or a read with no locale, gets the stored English line. A failed append never fails the approval step; it is logged once at `error`.
- **Only the users who can read the record's approvals read those entries.** A read of `sys_activity` keeps an approval entry only when the approvals service would serve the caller its request: a participant (submitter, current or past approver), the override actor, or a reader of the record where the object opts into `enable.approvalsVisibleToReaders`. Every other entry is served as before, and plugin-audit's rule that the record must be readable still applies. The record page's activity count and its rows agree.
- **The stream draws each entry as the approval line, and 「看审批」 opens the approvals.** The console reads an activity row with `type: 'system'`, `metadata.kind: 'approval'` and a `sys_approval_request` source as the `approval` feed kind (`APPROVAL_ACTIVITY_FEED_TYPE`, exported from `@object-ui/plugin-detail`), so `approval` now counts as produced. The record page supplies the new `RecordViewApprovalsContext`, and the approval line's 「看审批」 opens the record's 审批 tab, the same place the approval tag in the header opens; with no approvals the reader is served, the line has no link. The entry keeps `sys_activity`'s own lifecycle (reaped after 14 days); the 审批 tab keeps the full history.
11 changes: 6 additions & 5 deletions content/docs/frontend/plugins/plugin-detail.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ edited (`is_edited` on the row).

### Feed kinds with no producer

`FeedItemType` publishes thirteen kinds. ObjectUI produces **five** of them:
`FeedItemType` publishes thirteen kinds. ObjectUI produces **six** of them:

| kind | produced by |
|---|---|
Expand All @@ -519,22 +519,23 @@ edited (`is_edited` on the row).
| `event` | `sys_activity` type `scheduled` |
| `system` | `sys_activity` type `system`, **and** any author-extended type the map has never seen (it renders through the generic presentation rather than vanishing), **and** a `completed` row a milestone fired (`metadata.kind: 'milestone'`) |
| `comment` | `sys_comment` rows, merged in by the console's record page and handed to the block through the discussion context |
| `approval` | `sys_activity` type `system` with `metadata.kind: 'approval'` and `source_object: 'sys_approval_request'`, which plugin-approvals writes once per approval step (submitted, approved, rejected, recalled); served only to the users who can read the record's approvals |

The other eight — `email`, `call`, `note`, `file`, `record_create`,
`record_delete`, `approval`, `sharing` — have no producer on any ObjectUI
The other seven — `email`, `call`, `note`, `file`, `record_create`,
`record_delete`, `sharing` — have no producer on any ObjectUI
surface. A `types` list of only such kinds renders a **permanently empty**
timeline. Since objectui#5877 it also emits one `console.warn` per distinct
kind, so the emptiness is diagnosable instead of looking like "a working
feature with no data yet".

Beside the default composer such a list is refused before it ever renders.
`types: ['approval']` leaves out `'comment'` while `showCommentInput` defaults
`types: ['call']` leaves out `'comment'` while `showCommentInput` defaults
to `true`, so `os lint`, `os validate`, `os build`, the page save door and the
console's schema mirror report it at error as `component-props-invalid` at
`properties.showCommentInput` (`properties.feed.showCommentInput` on
`record:chatter` / `record:discussion`). Add `'comment'` to `types` when the
block should take comments, or set `showCommentInput: false` when it should
stay comment-free; `types: ['approval']` with `showCommentInput: false` parses
stay comment-free; `types: ['call']` with `showCommentInput: false` parses
and renders the empty timeline above. A page already stored with the shape
still loads; its next save is refused.

Expand Down
3 changes: 2 additions & 1 deletion content/docs/permissions/system-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bugs — it is the protection or the side effect that silently does not happen.
| 13 | Per-request performance timings disclosed | observability | Get: timing headers a normal caller cannot pull | `isPerfDisclosurePrincipal` |
| 15 | MCP stdio bridge skips the object API-exposure gate | mcp | Get: the bridge reaches objects whose `apiEnabled` / `apiMethods` would refuse an external caller | `enforceApiExposure` |
| 16 | **Read-audit rows are not written** | plugin-audit | Lose: the "a person opened this record" trail. `sudo()` keeps the caller's `userId`, so this flag is the only thing separating a human read from a platform one | `installReadAuditWriter` |
| 17 | Approval snapshot payload redaction skipped, and so is the snapshot query guard and the reader-locale label overlay | plugin-approvals | Get: the whole snapshot on `find` / `findOne` — the audit/replay channel — and a filter, sort or grouping by it on any read; and a request's `process_label` / `current_step_label` as stored, never in a locale the context carries, so nothing the platform reads back and writes again holds a reader's language. Lose: field-visibility redaction over approval payloads, the refusal of a query over the snapshot for a reader withheld a field of the objects it can reach, and the flow and step labels in the reader's language | `bindSnapshotRedactionMiddleware`, `bindSnapshotPredicateGuard`, `bindReaderLocaleLabelsMiddleware` |
| 17 | Approval snapshot payload redaction skipped, and so is the snapshot query guard and the reader-locale label overlay | plugin-approvals | Get: the whole snapshot on `find` / `findOne` — the audit/replay channel — and a filter, sort or grouping by it on any read; a request's `process_label` / `current_step_label` as stored, and an approval entry's `sys_activity.summary` as stored (its English line), never in a locale the context carries, so nothing the platform reads back and writes again holds a reader's language. Lose: field-visibility redaction over approval payloads, the refusal of a query over the snapshot for a reader withheld a field of the objects it can reach, and the flow and step labels and the approval entry's line in the reader's language | `bindSnapshotRedactionMiddleware`, `bindSnapshotPredicateGuard`, `bindReaderLocaleLabelsMiddleware`, `bindApprovalActivityLocale` |
| 18 | REST anonymous-deny seam satisfied | rest | Get: `enforceAuth` passes with no `userId`. Not reachable from the wire — `isSystem` is never set on an inbound request | `enforceAuth` |
| 18b | Settings namespace read scope not applied | service-settings | Get: a read of `sys_setting`, `sys_setting_audit` or `sys_platform_setting` across every namespace, whatever each namespace's `readPermission` names — the settings service's own reads of its stores take this path. Lose: the per-namespace read gate the generic data API applies to every other caller, the same rule the settings routes enforce | `settingsReadDoorMiddleware` |
| 18c | **Credential-column filter / sort refusal not applied** — a `where`, `orderBy`, per-aggregation `filter` or `expand` entry naming a `password` / `secret` column is evaluated | objectql | Get: the server's own match on a stored credential value, a lookup that never returns it. Every other caller, administrators included, is refused `400 INVALID_FIELD` for anything but a has-a-value check (ADR-0100). Lose: nothing a wire caller reaches — `isSystem` is never set on an inbound request | `rejectCredentialEvaluation` |
Expand Down Expand Up @@ -572,6 +572,7 @@ and CI refuses one that differs from what the tree produces.
| `packages/objectql/src/stored-metadata-type-read-gate.ts#storedMetadataTypeReadFilter` | 1 | 18d |
| `packages/observability/src/perf-timing.ts#isPerfDisclosurePrincipal` | 1 | 13 |
| `packages/plugins/organizations/src/organizations-plugin.ts#start` | 1 | 62 |
| `packages/plugins/plugin-approvals/src/approval-activity-feed.ts#bindApprovalActivityLocale` | 1 | 17 |
| `packages/plugins/plugin-approvals/src/approval-service.ts#assertAttachmentsUploadedByCaller` | 1 | 43 |
| `packages/plugins/plugin-approvals/src/approval-service.ts#comment` | 1 | 43 |
| `packages/plugins/plugin-approvals/src/approval-service.ts#isOverrideActor` | 1 | 43 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ a row or a number here — fix the code, or the census, and regenerate.

| Measure | Value |
|---|---:|
| Write call sites | 41 |
| Object name statically decidable | 39 |
| Write call sites | 42 |
| Object name statically decidable | 40 |
| Object name chosen at run time | 2 |
| Object name spelled inline | 38 |
| Object name spelled through a `const` | 1 |
| Object name spelled through a `const` | 2 |
| Object name is an `object: string` parameter | 1 |
| Object name is some other run-time expression | 1 |
| Against a tenancy-enabled object | 39 |
| Against a tenancy-enabled object | 40 |
| Against an object declaring tenancy off | 0 |
| Threading a tenant context | 41 |
| Threading a tenant context | 42 |
| Provably carrying none (options read, no context key) | 0 |
| …and decidably tenancy-enabled | 0 |
| Options argument unreadable | 0 |
| …and decidably tenancy-enabled | 0 |
| Threading a decidably elevated (`isSystem`) context | 39 |
| Threading a decidably elevated (`isSystem`) context | 40 |
| Threading a decidably non-elevated context | 0 |
| Threading a context of undecidable elevation | 2 |
| Receiver carried a readable engine type | 41 |
| Receiver carried a readable engine type | 42 |
| Receiver erased, placed by the object NAME | 0 |
| Receiver erased, placed by an `object: string` PARAMETER | 0 |
| Receiver erased, placed by an `UNTYPED_RECEIVERS` row | 0 |
Expand All @@ -48,6 +48,7 @@ a row or a number here — fix the code, or the census, and regenerate.
| file | verb | object | tenancy | tenant context | n |
|---|---|---|---|---|---:|
| `packages/plugins/plugin-approvals/src/action-slot-backfill.ts` | `update` | `sys_approval_action` | enabled | elevated | 2 |
| `packages/plugins/plugin-approvals/src/approval-activity-feed.ts` | `insert` | `sys_activity` | enabled | elevated | 1 |
| `packages/plugins/plugin-approvals/src/approval-service.ts` | `update` | `object` | undecidable | context, elevation undecidable | 1 |
| `packages/plugins/plugin-approvals/src/approval-service.ts` | `insert` | `sys_approval_action` | enabled | elevated | 17 |
| `packages/plugins/plugin-approvals/src/approval-service.ts` | `delete` | `sys_approval_approver` | enabled | elevated | 2 |
Expand Down
Loading
Loading