Skip to content

feat(plugin-approvals): approval steps reach the record activity stream as approval feed items - #37188

Merged
objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/issue-35723-approval-feed-items
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/issue-35723-approval-feed-items

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #35723

repo:objectstack#3 · os-support-ai · session_01WGufzg3KqwSpt61Y8ovKK7

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在走审批的记录详情页「动态」里,每个审批步骤(提交、通过、驳回、退回修改、重新提交、撤回、取消)都显示为一行,按读者的语言显示(中文读者看到「已批准 · 经理审批」),点「看审批」直接打开该记录的「审批」页签;以前这里看不到任何审批。
  • 为什么做:记录详情页专题里「动态流审批一行」那一半——上一张卡只画了这一行的样子,但没有任何地方产出审批条目,这张卡补上产出方。
  • 出错会怎样:最坏情况是动态里少了或多了审批行,或某行显示成英文;审批本身、审批页签和锁定都不受影响。撤回本 PR 后,已写入的审批行仍在动态表里保留最多 14 天,且失去本 PR 的可见性限制,会以普通系统行的样子展示给所有能看该记录的人。
  • 要你做什么:无

What changes

  • Producer (plugin-approvals, new module approval-activity-feed.ts). An afterInsert hook on the decision log sys_approval_action appends one sys_activity row per step of kind submit, approve, reject, revise (sent back for revision), resubmit, recall and cancel, about the record the request governs. Other kinds (reminder, reassign, thread comment, ...) write none, and no decision comment rides on the row. An object with enable.activities: false gets 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_id naming the request.
  • In the reader's language (route b, round 2). summary stores the English sentence from plugin-approvals' own catalog (approvalActivity* in translations/messages.ts, ten ids added to all eleven shipped packs); a new sys_activity middleware (bindApprovalActivityLocale) re-composes it on find / findOne for a non-system read that carries a locale, with the approvals door's own lookup (readerLabelsFor): the sentence is messages.approvalActivity* in the reader's locale, and the step label is flows.FLOW.approvals.NODE.label read the way the approvals tab reads it, else the stored label. A list that projects summary alone borrows the recognition columns and hands back only what it asked for. A system read, a read with no locale or no i18n service, or a key the pack misses serves the stored line. No sys_activity on the deployment (no plugin-audit) means no write; a failed append never fails the step and is logged once at error with consequence and fix. approval-service.ts is untouched (overlap with PR fix(plugin-approvals): the batch lock read answers a line of a held master as locked #37145 and branch claude/project-thread-x90m5y avoided).
  • Read gate (same module). A sys_activity middleware narrows find / findOne / count / aggregate so 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 pinning object_name + record_id asks with that record, so an object that opts into enable.approvalsVisibleToReaders serves 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.
  • Console (plugin-detail). activityRowToFeedItem reads the triple type: 'system' + metadata.kind: 'approval' + source_object: 'sys_approval_request' as the approval feed kind (APPROVAL_ACTIVITY_FEED_TYPE), so PRODUCED_FEED_TYPES now contains approval and the unproduced-kind diagnostic no longer names it. New RecordViewApprovalsContext carries the stream's 「看审批」 callback into RecordActivityRenderer and RecordChatterPanel.
  • Host (app-shell RecordDetailView). The approval tag's opener is extracted as openRecordApprovals (approvals panel if drawn, else the 审批 tab) and supplied through RecordViewApprovalsContext only when the reader is served approvals; otherwise the line has no link.
  • Docs. content/docs/frontend/plugins/plugin-detail.mdx: approval joins the produced-kinds table (six produced, seven not); the unproduced example becomes call.
  • Ledgers. approver-address-readers.test.ts classifies the two new actor_id reads as display; the tenant-audit write census for plugin-approvals is regenerated (one new elevated sys_activity insert); content/docs/permissions/system-context.mdx row 17 owns the new middleware's isSystem read (its register regenerated with --write).

Round 2 (L1 REWORK on dc76347)

  • S1, route (b): the server re-composes on read. It is the plugin-audit: an activity summary is rendered once, at write time, in the workspace locale — store it as a key and render it in the reader's language #26167 precedent's own shape: plugin-audit's activity-summary-message.ts stores the sentence plus its code and re-composes it per reader in a sys_activity middleware, and this row's code is already on it (metadata.action, now with flow_name / step_name). The step label must be translated through the app's flows pack, which lives in the server's i18n service and is read by the approvals door's reader-locale-labels lookup; 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.
  • S2: handled by the zone (claim amended).
  • N1: done in the same code path: revise, resubmit and cancel write entries (Sent back for revision · STEP, Resubmitted for approval, Approval request cancelled, the last attributed to no one), each pinned.
  • N2: the flag is honored, as the CRUD mirror honors it (audit-writers.ts writes no activity row for an object with enable.activities: false); pinned.
  • N3: the step half is pinned exactly (Approved · Manager review, Rejected · Manager review), plus the stored metadata.
  • N4: the 维护者速读 revert sentence now says rows already written stay up to 14 days and, without the read gate, are served to every record reader as generic system lines.

Tests

Readings, round 2 (head 06a3c76)

All local runs went through scripts/pm/os-verify-lock.sh; verdict lines quoted. Round-2 head 06a3c7640b (after merging origin/main at 93bd45957b).

  • pnpm --filter @objectstack/plugin-approvals exec vitest run + typecheck (head 06a3c764 minus 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.ts at 06a3c7640b: 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).
  • Ablation (S1): node scripts/ablation-replace.mjs replaced the bindApprovalActivityLocale(...) call in approvals-plugin.ts with 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 HEAD empty).
  • Local gate subset: dispatch-gates --ran reconciles 106 derived, 104 run, 2 UNRUN; 101 exit 0. check:i18n first 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 on 05d82f29) fixed in f0b51c92: 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/ and check:type-check-debt (declared narrowing: the first was OOM-killed in round 1, the second needs a whole-workspace build; no ui/ file and no package's type-check set changed this round).
  • overlap-check --branch=claude/issue-35723-approval-feed-items: VERDICT clean exit 0.
  • Round 1 readings (UI suites, record-page ablation) stand for the unchanged ui/ files: RecordDetailView.* 100 files / 858 tests, plugin-detail 417 files, both type-check exit 0.
  • Full dogfood: not owed (no ! in the title, no (narrowing) arm).

Acceptance notes

  • sys_activity keeps its own lifecycle (rows reaped after 14 days); the 审批 tab keeps the full history. Steps taken before this lands write no backfilled rows.
  • The console restates the three writer values (recordActivityFeed.ts) because plugin-detail cannot depend on the server plugin; both sides are pinned by tests.
  • The producer reads the decision log rather than calling in from each decision method, so a step the service learns to record elsewhere reaches the stream with no second call site.
  • New UI pin for the mapper and stream lives in a card-named file recordActivityFeed.approvalStep-35723.test.tsx (it renders React; the shared recordActivityFeed.test.ts is a non-JSX file). The record-page pin joined the shared RecordDetailView.harness.test.tsx as its own top-level block.

Verification

First read (by risk):

  1. 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.
  2. ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts — isApprovalStepRow, the mapping branch.
  3. 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

…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
… 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
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-approvals, touching 57 documentable anchor(s).

42 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 93bd45957bc4a43eb54d8fec2b36f1cbef41dc5f.

⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 anchor(s) matched too much of the corpus to be a work list: organization_id (literal, 41 pages), sys_user (literal, 56 pages)
  • 15 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 93bd45957bc4a43eb54d8fec2b36f1cbef41dc5f → packageMentionDocs.

Which tree this was computed on

This run read content/docs from f78bd2362da8903b27ee8f09c04776c7d15170a2 — the merge of head 06a3c7640b5de8e8d3c0d665d426137e8d42077b into base 93bd45957bc4a43eb54d8fec2b36f1cbef41dc5f, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 93bd45957bc4a43eb54d8fec2b36f1cbef41dc5f → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

席位核对 — REWORK · repo:objectstack#3 · head dc76347 · 2026-11-25T03:11Z

L1: REWORK (L1-w, zone wf-A)
Head-sha: dc763477535b0b6aa3397c14bc827154979afcc9

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 packages/spec/src/** moves, the declaration is Clause-②: no, there is no narrowing arm, and approval was already a FeedItemType. This is Tier S: no governed path, and 1,072 changed lines on this card's only PR. wf-A lands it after ACCEPT.

Should-fix

  • S1. Every reader sees the approval line in English, whatever their language. The producer stores summary as fixed English text: Submitted for approval, Approved · <step>, Rejected · <step> and Recalled the approval request (APPROVAL_ACTIVITY_STEPS). The console draws that text as it is: renderApprovalLine shows item.body, which is row.summary (activityRowToFeedItem).

  • S2. The claim's file surface was not amended for the files outside it. Claim 7147655087 names plugin-approvals/src/**, plugin-detail/src/renderers/**, app-shell/** and the changesets. The diff also moves these files:

    • ui/packages/plugin-detail/src/RecordChatterPanel.tsx
    • ui/packages/plugin-detail/src/index.tsx
    • ui/packages/plugin-detail/src/recordTimelineStream.ts
    • content/docs/frontend/plugins/plugin-detail.mdx
    • the tenant-audit write census docs/audits/2026-08-tenant-audit-write-call-sites.counts/plugins/plugin-approvals.md

    The PR body already describes each of them. The zone amends the claim in the same round. This is the same gap as L1 S1 on feat(service-automation)!: a sync-in pull marks the rows the source deleted (ADR-0153 D3, #32062 slice 6) #37179.

Nits (fix any that ride the same push; each one left needs a follow-up card under the nit rule)

  • N1. revise (sent back for changes), resubmit and cancel write no entry. A record sent back and then resubmitted shows Approved · Step 1 and then nothing, while the request is pending again. The card's four kinds are delivered, so Fixes holds. The rest is a follow-up card.
  • N2. The producer writes for an object with enable.activities: false, whose timeline is hidden (object.zod.ts: "explicit false stops mirroring and hides the timeline"). Those rows are never read. Either honor the flag, or say in the module header why the flag does not apply.
  • N3. The integration test pins the approved entry only as /^Approved/. The · <step> half, which the changeset names, is unpinned.
  • N4. The PR body's 维护者速读 says 「撤回本 PR 即恢复原样」. Rows already written stay in sys_activity for up to 14 days after a revert. Without this PR's read gate, they are served to every record reader, and they draw as generic system lines. The sentence should say so.

Read and found right (head dc76347)

  • l1-face --pr 37188: 13 items clean. Draft, base main. Fixes #35723 binds only this card. The declarations are Clause-②: no · Metadata-protocol: none. The changeset names plugin-approvals and plugin-detail, both published, and app-shell, which is private and harmless. patch is right for kind none. Floors and all checks are green: 58 success, 9 expected skips, 0 failed. mergeable_state clean.
  • Fixes is right, once the findings close. Every Done-when line is in the tree:
  • Producer. It is an afterInsert on sys_approval_action.
    • actionRow is called with the pre-decision request, because the decision is audited before the tally, so step_label is the step decided.
    • The hook is code-registered (no meta), so it opens no after-abort unit (opensAfterAbortUnit: "Code-registered hooks (no meta) open no unit"). approval-service.ts threads no transaction, so a failed append is caught and cannot roll the decision log back.
    • It writes nothing without plugin-audit (the has(ACTIVITY_OBJECT, 'type') probe). The tenant is threaded and the census was regenerated. Both new actor_id reads are classified display.
  • Read gate. It adds a conjunct on find / findOne / count / aggregate, so the record page's count and rows agree.
    • Rows with a null or other source_object pass, and approval rows are kept by source_id ∈ visibleRequestIdsFor(context, target). That is the same source and the same unbounded-$in pattern as the request-table gate.
    • A read with object_name and record_id pinned asks with the record, so approvalsVisibleToReaders serves readers.
    • It fails closed for approval rows only. It is bound beside the producer inside the middleware branch, so no entry is written where reads cannot be narrowed.
  • Console. It reads the full triple (system + metadata.kind: 'approval' + sys_approval_request). system is platform-only, so an app's own row cannot draw as an approval. viewApprovals is null when the reader is served no requests. openRecordApprovals is a plain function below the early returns (no hook-order change), and the tag and the stream share it. The ablation reported in the body turns the harness pin red.
  • Changeset and plugin-detail.mdx, sentence by sentence.
    • The four kinds, "no decision comment", the ADR-0052 §5 shape, the no-plugin-audit case, "logged once at error", the visibility tiers, count/rows agreement, the triple, APPROVAL_ACTIVITY_FEED_TYPE and the 14-day reap all hold. The reap is retention: { maxAge: '14d' } in sys-activity.object.ts.
    • In the docs: "six produced", the seven unproduced kinds listed (13 − 6) and types: ['call'] as the unproduced example all hold.
    • After S1, the changeset's Approved · <step> wording needs one more read against the fix.

Path to ACCEPT

  1. Card thread: one push for S1 with its pin, plus any nits it takes.
  2. Zone: amend the claim (S2), and file a card for each nit left.
  3. L1-w: I read the delta on that head.

…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
…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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgv2LZN1W2qSYTZvYs

席位核对 — ACCEPT · repo:objectstack#3 · head 06a3c76 · 2026-11-25T05:24Z

L1: ACCEPT (L1-w, delta read, zone wf-A)
Head-sha: 06a3c7640b5de8e8d3c0d665d426137e8d42077b

No must-fix, no should-fix. No L2 is owed: nothing under packages/spec/src/** moves, Clause-②: no, and no narrowing arm. Tier S: no governed path; the PR's own net diff is 19 files, +1409/−52, on this card's only PR. wf-A lands it after green.

Round 1 (7151680146), closed

  • S1 closed (route b, the plugin-audit: an activity summary is rendered once, at write time, in the workspace locale — store it as a key and render it in the reader's language #26167 shape). The stored summary is the English sentence from plugin-approvals' own catalog (approvalActivity*, translations/messages.ts, in all eleven packs), composed through approvalActivityMessage + interpolate(enMessages…).
    • The row now also carries flow_name / step_name in metadata.
    • bindApprovalActivityLocale (a sys_activity middleware on find / findOne, non-system reads with a locale only) re-composes the line through readerLabelsFor, the approvals door's own lookup. The step label comes from flows.<flow>.approvals.<node>.label, else the stored label.
    • It recognises an entry by the full triple. A read projecting summary alone borrows type / source_object / metadata and strips them again before the rows return.
    • A missing key, no locale, no i18n service or a throw all leave the stored line.
    • The pins cover a zh-CN reader (已批准 · 经理审批, with an app-pack step label), a summary-only projection, a reader with no locale and a system read. The reported ablation turns the zh-CN pin red.
  • S2 closed. The claim is amended; the latest amendment, 7153690278, also adds content/docs/permissions/system-context.mdx. Row 17 of that census now names bindApprovalActivityLocale and the isSystem read that skips it, and the per-file count row is added.
  • N1 closed. revise, resubmit and cancel write entries (APPROVAL_ACTIVITY_STEPS), each pinned. cancel is written only when the governed record is deleted (approval-service.ts, the deleted-record path), which matches the changeset's "cancelled (the record was deleted)".
  • N2 closed. objectMutesActivities honours enable.activities: false at write, as audit-writers.ts does.
  • N3 closed. The approved and rejected lines are pinned exactly.
  • N4 closed. The 维护者速读 now says rows already written stay up to 14 days after a revert and are then served to every record reader as generic system lines.

Read and found right (head 06a3c76)

  • l1-face --pr 37188: 13 items clean. 60 success, 11 expected skips, 0 failed, 0 pending. mergeable_state was not yet computed at my read; wf-A reports it clean. The head carries a merge of main.

  • Changeset, sentence by sentence, against approval-activity-feed.ts at this head:

    • the seven kinds and their lines;
    • the enable.activities: false sentence;
    • the metadata it carries;
    • "the stored summary is the English line from plugin-approvals' own catalog";
    • the reader-locale re-composition and its step-label source;
    • "A system read, or a read with no locale, gets the stored English line";
    • the unchanged failed-append sentence.

    The system-context.mdx row reads the same as the middleware's context.isSystem skip.

  • Round 1's reads still stand on the parts that did not move: the producer, the read gate, the console mapping and the RecordViewApprovalsContext wiring.

Landing to-do

Fixes #35723 closes the card on merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzg3KqwSpt61Y8ovKK7

Landing · zone wf-A · 2026-11-25T05:25Z · head 06a3c7640b5de8e8d3c0d665d426137e8d42077b

Probe Reading
check-governed-merges.mjs --pr 37188 NOT governed; 1461 changed lines (+1409 / −52) ≤ 3000
landing-k.mjs --pr 37188 OK — K = 7 < 15, no new locale pack under a label PR, no shared book moved

L1 ACCEPT 7153741928 on this head, no L2 owed (Tier S). Checks 60 success / 11 skipped / 0 failed, mergeable_state clean. State change: ready for review + auto-merge; Fixes #35723 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 25, 2026 05:25
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit a03c3d4 Nov 25, 2026
72 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35723-approval-feed-items branch November 25, 2026 05:47
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…dio-design reads and writes send the stored bearer token (objectstack-ai#37185)

Fixes objectstack-ai#37080

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:浏览器里只剩登录令牌(会话 Cookie 被替换、拦截或清掉)的用户,侧边栏、应用头部、命令面板和 Studio
入口里的应用包列表不再消失,AI 对话列表、建议权限绑定、提交历史、草稿面板等也正常加载;只用 Cookie 登录的用户看不到任何变化。
-
为什么做:控制台其它请求都会带上登录令牌,这一批读写漏带,属于"控制台登录状态体验"这一块的缺陷,替所有处于这种登录状态的用户解决,并加了一道测试防止以后再写出漏带令牌的请求。
- 出错会怎样:最坏情况是这些地方重新读不到数据,与修复前一样;不改服务端接受什么、不改登录方式,可以直接撤回。
- 要你做什么:无。

## What changes

Same-server `/api/` reads and writes in app-shell and the console that
called the bare global `fetch` with `credentials: 'include'` (the
session cookie and nothing else) now go through
`createAuthenticatedFetch` from `@object-ui/auth`, exactly as objectstack-ai#37077 did
for the Setup pages: built per call (`createAuthenticatedFetch()(input,
init)`, a local `authFetch` in each module), `credentials: 'include'`
kept on every call, so the cookie still rides along and a `401` now
reaches the console's session-ended check. No second auth-fetch helper
and no new export. Nothing changes in what the server accepts.

The measured case: under a bearer-only session, `readPackagesPayload`
(`GET /api/v1/packages`, the session's held package list read by the
sidebar, the app header, the command palette and the Studio entries)
sends the bearer and the list loads (pinned below).

### The family, measured at `origin/main` 63ab479

79 non-test files under `ui/packages/app-shell/src` and
`ui/apps/console/src` contain `credentials: 'include'`. Read call by
call (AST scan of every `credentials: 'include'` property and the call
it is handed to):

**Converted here: 64 calls in 39 files.**

| File | Calls |
|---|---|
| `app-shell/.../studio-design/packages-io.ts` | `readPackagesPayload`
(`GET /api/v1/packages`, the measured case),
`ensureCustomizationPackage`, `duplicatePackage` |
| `app-shell/.../studio-design/packageCustomizations-io.ts`,
`PackageSwitcher.tsx`, `AutomationsPillar.tsx`, `FlowItemMoreMenu.tsx` |
1 each (customizations read, switcher list, automation status, flow
clone) |
| `app-shell/src/hooks/useConversationList.ts` | 4 (list, detail,
rename, delete) |
| `app-shell/src/hooks/useChatConversation.ts` | 3 (read, create,
update) |
| `app-shell/src/console/ai/buildDebugApi.ts` | 1 (build-debug report) |
| `app-shell/src/hooks/useAiUsage.ts` | 1 |
| `app-shell/src/services/suggestedBindingsApi.ts` | 4 (list, confirm,
dismiss, reopen) |
| `app-shell/src/preview/commitHistory.ts` | 2 (timeline, revert) |
| `app-shell/src/preview/DraftChangesPanel.tsx`,
`UnpublishedAppBar.tsx`, `usePendingDrafts.ts` | 2, 1, 1 |
| `app-shell/src/preview/flowDraftChecks.ts` | the default transport
(`opts.fetchImpl ?? createAuthenticatedFetch()`) |
| `app-shell/src/views/changeOwner.ts` | the fallback transport
(`apiFetch ?? createAuthenticatedFetch()`) |
| `app-shell/src/views/metadata-admin/` `PackageFormDialog.tsx`,
`catalog-activation.ts`, `permission-set-clone.ts`,
`sharing-rule-catalog.ts` | 1, 2, 1, 1 |
| `app-shell/src/views/metadata-admin/inspectors/`
`FlowReferenceField.tsx`, `connector-input-fields.ts` | 2, 1 |
| `app-shell/src/views/metadata-admin/previews/` `FlowRunsPanel.tsx`,
`useFlowNodePalette.ts`, `PagePreview.tsx` | 1, 1, 2 |
| `app-shell/src/views/setup/` `packagedActionLedger.ts`,
`packagedFlowLedger.ts` | 2, 1 |
| `app-shell/src/hooks/` `useRecordApprovals.ts`, `sharedUserFeeds.ts`,
`useInboxBell.ts` | 1 each |
| `app-shell/src/console/` `AppNoAccessEmptyState.tsx`,
`connect/ConnectAgentWidget.tsx`,
`deployment-notice/deploymentNoticeState.ts` | 1, 2, 2 |
| `app-shell/src/console/marketplace/marketplaceApi.ts` | 5 same-server
calls onto the existing `serverFetch` (`/cloud-connection/install`,
`install-namespace`, `installation`, and on the control plane its own
`install_package` action and installed-state route) |
| `app-shell/src/layout/designModeMenuSave.ts` | 1
(`/api/v1/i18n/locales`) |
| `app-shell/src/layout/ContextSelectors.tsx` | 1, with `{
sameOriginOnly: true }`: the endpoint is author-written
(`optionsSource.endpoint`) and may name another host |
| `console/src/pages/developer/` `AgentConnectSection.tsx`,
`IntegrationsPage.tsx` | 2, 1 |
| `console/src/pages/auth/DeviceAuthPage.tsx` | 3 (claim, approve, deny:
a signed-in act) |

Of the card's named ones: `packages-io.ts` `readPackagesPayload`,
`useConversationList`, `useChatConversation`, `suggestedBindingsApi` and
the studio-design writes (ensure-customization, duplicate,
customizations, flow clone) are all converted. `suggestedBindingsApi`,
`useRecordApprovals`, `sharedUserFeeds`, `useInboxBell`,
`ConnectAgentWidget`, `deploymentNoticeState` and three `marketplaceApi`
calls already set the bearer header by hand (`authHeaders` /
`bearerAuthHeaders` / `withEnvAuth`), so those were not cookie-only;
they are converted anyway for the session-ended check and the one
mechanism, and their hand-rolled header is left in place (the wrapper
sets the same value).

**Already authenticated or injected (not the family): 24 files.**
`settings/api.ts`, `AuditLogPage.tsx`, `approvalsApi.ts`,
`studioEntry.ts`, `ExcelImportBar.tsx`, `CloudAiModelStatus.tsx`,
`useEnvironmentEntitlements.ts`, `storageUsageEndpoint.ts`,
`ImpersonationBanner.tsx`, `useImpersonationExit.ts`,
`RecordAttachmentsPanel.tsx`, `RecordDetailView.tsx`,
`useConsoleActionRuntime.tsx`, `AccessExplainPanel.tsx`,
`MetadataTypeActions.tsx`, `PackagesPage.tsx`,
`DatasourceResourcePage.tsx`, `personalViews.ts`,
`connectorConnections.ts`, `connectorCredentials.ts`, and the injected
transports of `myPreferences.ts`, `slackDoors.ts`, `orgEnvironments.ts`,
`useLauncherApps.tsx`. `App.tsx` names the string in a comment only.

**Left, on the pin's shrink-only list: 21 calls in 15 files**, each with
its reason in the pin (`sameServerFetch.bearer.ratchet.test.ts`,
`ALLOWED`):

- `console/src/LocalizationFetchProvider.tsx` (1) and
`console/src/languageSeed.ts` (not counted by the pin: it hands
`sharedGetJson` a transport argument that may be `undefined`): the boot
read of `/api/v1/auth/me/localization`, shared in flight by a key built
from the init with the early request `index.html` sends. A session it
cannot see reads `authenticated: false` and falls back to the browser
language rather than failing. Its transport is its own decision
(Acceptance notes).
- `console/src/components/FormPage.tsx` (1): the bare channel is the
public form route's on purpose.
- `console/src/lib/auth-preflight.ts`,
`console/src/lib/early-discovery.ts` (1 each): set the bearer header
themselves on purpose.
- `console/src/pages/auth/OAuthConsentPage.tsx` (3),
`followAuthorize.ts` (1), `handoffClientName.ts` (1): the OAuth
hand-off, whose authorize step is a top-level navigation that can only
carry the cookie.
- `console/src/pages/auth/SetupPage.tsx`,
`app-shell/src/console/auth/bootstrapStatus.ts`,
`console/src/pages/auth/VerifyEmailPage.tsx`,
`app-shell/src/chrome/ConditionalAuthWrapper.tsx`,
`app-shell/src/runtime-config.ts` (1 each): read before or without a
session.
- `app-shell/src/console/ai/AiChatPage.tsx` (1): an open PR (objectstack-ai#37123)
edits this file; its call moves with that work.
- `app-shell/src/console/marketplace/marketplaceApi.ts` (5): each
targets `getCloudBase() || SERVER_URL`, the cloud control plane's own
origin whenever one is configured, which must never see this runtime's
bearer.
- `app-shell/src/views/metadata-admin/previews/ActionPreview.tsx` (1):
the test request of an `api` action preview, sent to the author-written
target; its transport is not decided here.

The other two fenced files hold no family call: `RecordDetailView.tsx`
and `useConsoleActionRuntime.tsx` already route every `credentials:
'include'` call through their `authFetch`. Neither was edited.

## Tests

- `ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts`
(new, the enumeration pin; runs in **Test UI**, app-shell's `unit`
project): parses every non-test source file of both trees with the
TypeScript parser and refuses a bare cookie-only call (the transport is
the global `fetch`, `window.fetch`, `globalThis.fetch`, `self.fetch`,
one of those as a `??` / `||` fallback, or `sharedGetJson` without its
transport argument; the init carries `credentials: 'include'`, inline or
as a `const` of the file, `as const` included). The URL is not judged: a
call that must stay bare is a counted row with its reason. Four cases:
the scan reads both trees (more than 500 and 100 files); a 13-case
detector battery (each bare spelling found, each authenticated one not);
every bare call is a counted row; every row is still exact (a file that
sheds a call must shrink its row).
-
`ui/packages/app-shell/src/views/studio-design/packages-io.bearerSession.test.ts`
(new): against a server that refuses any request without the bearer,
with a token stored, `fetchPackages` loads the list and its one request
carries `Authorization: Bearer TOKEN` and `credentials: 'include'`;
`fetchListedPackageIds` likewise; the duplicate write, the commit
timeline and revert, suggested bindings and the build-debug report carry
the bearer. Each with a cookie-only control (no token stored: no
`Authorization`, `credentials: 'include'`).

Test doubles that moved (118 files, no assertion weakened):

- 102 files: hand-rolled `Response` doubles (`{ ok, status, json }`)
gain `headers: new Headers()`, the headers a real `Response` carries and
the authenticated fetch reads (`set-auth-token`), as objectstack-ai#37077 did. The
102nd, `StudioPaletteGroups.surfaceScope-36900` (the command-palette
suite that reached `main` after round 0), doubles `GET
/api/v1/packages`: without the headers the converted
`readPackagesPayload` threw on the double and the palette drew no
Packages group. For `fetchInstalledPackageRow-7881` and
`StudioDesignSurface.readOnlyPosture-12453` the headers are added at the
one stub instead of each answer.
- 8 files whose `@object-ui/auth` mock answered
`createAuthenticatedFetch: () => vi.fn()` (a transport that answers
nothing) now hand the authenticated fetch's requests to the global
`fetch` the file already stubs: the four `RecordApprovalsPanel` suites
and `RecordDetailView` `editLockedByState-32756`, `phoneFace-27058`,
`userActionPredicates`, `harness`.
- 5 `RecordDetailView` approval suites whose `authFetchSpy` stands for
the action door: approvals reads (now through the authenticated fetch
too) are handed to the file's wire double, as before
(`approvalRecallGate`, `accessEndedAfterDecision-26589`,
`approvalDeclaredActions`, `approvalLock-12220`, `approvalLock-25934`).
- `StudioRoute.searchPalette-11863` (console): its auth mock answers the
Studio permissions read and hands every other request (the package list)
to the wire double.
- 3 assertions read the init the wire received (the last two files are
also among the 101): `useConversationList` and `BuildDebugDrawer` assert
`{ credentials: 'include', headers: expect.any(Headers) }` (exact keys,
as before); `DraftChangesPanel.flowChecks-34818` reads `Accept-Language`
off a `Headers`.
- `RecordDetailView.headerApiInterpolation`: the flow-trigger case
asserts exactly one call to the trigger door, filtered by its path,
since the page's own reads now share that spy.

## Acceptance notes

- Same defect family outside the two trees, not touched (the card scopes
the `plugin-*` hooks out unless measured here): `credentials: 'include'`
with the bare `fetch` remains in `ui/packages/plugin-chatbot`
(`useAgents`, `useAiModels`, `useHitlInChat`, `usePendingActions`),
`plugin-detail` (`queueClaim`, `stageChangeStarts`,
`useRecordEditable`), `plugin-grid` (`useRecordCrudVerdicts`,
`useRowApprovalLocks`), `plugin-dashboard` (`DatasetWidget`),
`plugin-charts` (`ObjectChart`), `fields` (`ShareableObjectRefField`,
`preferenceOptions`), `components` (`ShareDialog`) and `permissions`
(`MePermissionsProvider`). Not each read call by call.
- A bare `fetch('/api/…')` with no init at all is cookie-only as well
(the default `same-origin` credentials) and is outside the pin's
spelling: `views/metadata-admin/widgets.tsx` `fetchFieldSelectorOptions`
(`GET /api/v1/objects/:name/fields`).
- `LocalizationFetchProvider` and `languageSeed` read
`/api/v1/auth/me/localization` cookie-only; under a bearer-only session
that read answers anonymously and the console falls back to the browser
language instead of the user's own locale. Not measured in a browser;
left because the request key is shared with the early request
`index.html` sends.
- The hand-rolled bearer helpers left beside converted calls
(`authHeaders` in `suggestedBindingsApi`, `bearerAuthHeaders`,
`withEnvAuth`) are now redundant there; not removed here.

## Verification

<details><summary>The measured case and the pins (green at the
head)</summary>

`packages-io.bearerSession.test.ts` and the ratchet are in the rerun
below (all green). The ratchet's detector battery first went red on a
real detector issue: at a script's top level `await (x)(…)` parses as a
call of `await`, so the `(apiFetch ?? fetch)` case read 0; the cases now
run inside an async function.
</details>

<details><summary>Ablation: one conversion reverted, both pins
red</summary>

Through `scripts/ablation-replace.mjs` on `packages-io.ts`: anchor
`const res = await authFetch('/api/v1/packages', {` hit 1 → 0, blob
`d3c93d771344` → `42f8862ba05e`; the ratchet and the bearer-session file
run under the lock:

```text
FAIL sameServerFetch.bearer.ratchet.test.ts > every bare cookie-only call is a counted row of the shrink-only allow-list
  + "packages/app-shell/src/views/studio-design/packages-io.ts:398 :: fetch('/api/v1/packages', …)"
FAIL packages-io.bearerSession.test.ts > loads the package list, sending the stored bearer beside the cookie
FAIL packages-io.bearerSession.test.ts > answers the listed-id read from the same authenticated request
Test Files  2 failed (2)
     Tests  3 failed | 14 passed (17)
```

The cookie-only control stayed green. Restored: blob `d3c93d771344`
equal to `HEAD`, `git diff HEAD` empty.
</details>

<details><summary>Suites</summary>

The whole `@object-ui/app-shell` and `@object-ui/console` suites, under
the shared verify lock, in six shards (`cd ui && pnpm exec vitest run
--maxWorkers=3 --shard=k/6 packages/app-shell apps/console`) at
`32505939` (the final source; only test files changed after it). These
are the readings BEFORE the doubles moved, and they are how the moved
doubles were found:

```text
shard 1/6: Test Files  21 failed | 440 passed (461) · Tests  121 failed | 4304 passed (4425)
shard 2/6: Test Files  16 failed | 446 passed (462) · Tests  64 failed | 4352 passed | 1 skipped (4417)
shard 3/6: Test Files  23 failed | 439 passed (462) · Tests  104 failed | 4111 passed (4215)
shard 4/6: Test Files  17 failed | 445 passed | 1 skipped (463) · Tests  87 failed | 4383 passed | 8 skipped (4478)
shard 5/6: Test Files  26 failed | 436 passed (462) · Tests  116 failed | 4636 passed (4752)
shard 6/6: Test Files  14 failed | 448 passed (462) · Tests  77 failed | 4286 passed (4363)
```

The 117 failing files are exactly the 117 moved doubles. Each was re-run
after its fix (the two new pin files with them): `Test Files 116 passed
| 3 failed (119)`, then the three fixed again `Test Files 3 passed (3)`.
After the last two type fixes `Test Files 2 passed (2)`, and after the
collection-time imports the 34 files that gained one `Test Files 34
passed (34)` / `Tests 319 passed (319)`, at `5dde589a8c`. The 2,655
files that passed in the shards were not edited. A full re-run after the
fixes was not done locally (NOT MEASURED, reason: about 90 minutes of
shared lock); Test UI runs the full affected set on this PR.

Type-check through turbo (dependency closure built):
`@object-ui/app-shell` and `@object-ui/console` `type-check` `Tasks: 77
successful, 77 total` at `3080a68173`; `@object-ui/app-shell` again at
`5dde589a8c` after the last test edits, `Tasks: 69 successful, 69
total`. The first run found two type errors in my test edits (a typed
tuple, an object literal against a declared parameter type), fixed in
`3080a68173`.

`pnpm --dir ui exec vitest run scripts/` after building the seven
`@objectstack` packages as Test UI does: `Test Files 172 passed | 2
skipped (174)`, `Tests 5131 passed | 2 skipped (5133)`.
</details>

<details><summary>Gates</summary>

`node scripts/pm/dispatch-gates.mjs --commands` (no paths, merge base
`63ab4794`): 39 families. All 39 run locally, each exit captured before
any pipe; 37 lock-free families re-run at `5dde589a8c`, all exit 0;
`pnpm check:type-check-debt` exit 0 (`0 raw tsc error(s) total, none
above its recorded number`); the ui `scripts/` suite above exit 0.
Reconciled: `dispatch-gates --ran`: `39 derived famil(ies) accounted for
— 39 run, 0 NOT-MEASURED (a DERIVED zero)`.

`check:test-source-alias` first went red on the edited suites (exit 1):
34 of them reach a dynamic `import('@objectstack/lint')`,
`import('@objectstack/formula')` or `import('@object-ui/plugin-detail')`
in the source under test with no collection-time load. Each gained the
module-top side-effect import the gate prescribes (`5dde589a8c`), then
exit 0.

`overlap-check` before every push: at `4a990ef7` it merges cleanly with
`origin/main` (`93bd4595`) and with objectstack-ai#37204, objectstack-ai#37188 and objectstack-ai#37148, and exits
1 on textual conflicts with three open Studio PRs that edit the same
test files: objectstack-ai#37166, objectstack-ai#37168, objectstack-ai#37169 (in `StudioDesignSurface.*`,
`BuilderLanding.*`, `CommandPalette.studioScope-11863`,
`StudioRoute.searchPalette-11863`, and objectstack-ai#37166/objectstack-ai#37169 also in
`PackageSwitcher.tsx`, `FlowItemMoreMenu.tsx`). Whichever lands second
takes the merge.
</details>

<details><summary>Round 1: main merged at 3b4f0b9, re-measured at
e055596</summary>

CI at `5dde589a` was red on two causes, both from `main` moving (the ⌘K
palette work):

- `check:test-source-alias` exit 1: four edited suites
(`StudioDesignSurface` `entryReadsOnce-11797`, `itemDraftLine-12725`,
`notFound-26708`, `readOnlyPosture-12453`) now reach
`import('@object-ui/plugin-detail')` through the surface's command
palette and its record preview. Each gained the prescribed module-top
`import '@object-ui/plugin-detail';` (38 files carry a collection-time
import in all). Then exit 0.
- `StudioPaletteGroups.surfaceScope-36900`: 3 failed, 8 passed; after
its package-list double gained `headers` (above), 11 passed. No
assertion changed.

Readings at `e0555965`, under the shared verify lock:

```text
ratchet + bearer-session pin + main's 35 incoming app-shell/console test files + the 5 edited files:
  Test Files  41 passed (41) · Tests  394 passed (394)
whole @object-ui/app-shell + @object-ui/console (cd ui && pnpm exec vitest run --maxWorkers=3 packages/app-shell/ apps/console/):
  Test Files  1 failed | 2779 passed | 1 skipped (2781) · Tests  2 failed | 26745 passed | 9 skipped (26756)
```

The one failing file is `ReportNewPage-36692.test.tsx`, which this
branch does not touch (nor its page); it passed 3 of 3 runs alone
(`Tests 6 passed (6)` each). Its second failure received the first
case's save call, late: its cases flush by `setTimeout(0)` rounds while
the page loads its Han romanizer lazily, so on a loaded box the save can
land after the case ends.

`@object-ui/app-shell` `type-check` through turbo: `Tasks: 69
successful, 69 total`. `pnpm --dir ui exec vitest run scripts/`: `Test
Files 172 passed | 2 skipped (174)`, `Tests 5131 passed | 2 skipped
(5133)`.

Gates: `dispatch-gates --commands` (merge base `3b4f0b98`): 39 families,
all run, each exit captured before any pipe, all exit 0.
`check:type-check-debt` first answered exit 3 (its closure build queued
behind the suite above and never got the lock: not measured), then exit
0 under the lock (`0 raw tsc error(s) total, none above its recorded
number`). `dispatch-gates --ran`: `39 derived famil(ies) accounted for —
39 run, 0 NOT-MEASURED (a DERIVED zero …)`.
</details>

## Read first

1. `ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts`:
the detector and the `ALLOWED` rows (each reason is a claim about a call
left bare).
2. `ui/packages/app-shell/src/layout/ContextSelectors.tsx`: the one
conversion with `sameOriginOnly`, because its URL is author-written.
3. `ui/packages/app-shell/src/console/marketplace/marketplaceApi.ts`:
which calls moved onto `serverFetch` and which stay bare because they
may target the cloud origin.

Two-minute check: `cd ui && pnpm exec vitest run
packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts
packages/app-shell/src/views/studio-design/packages-io.bearerSession.test.ts`,
expect `Test Files 2 passed (2)`.


<details><summary>Round 2: main merged at 93bd459, re-measured at
4a990ef</summary>

- objectstack-ai#37089 landed on `main` after round 1 and left this PR conflicting in
`StudioDesignSurface.notFound-26708` and
`StudioDesignSurface.readOnlyPosture-12453`: both sides add the same
`import '@object-ui/plugin-detail';` with a different comment. The merge
(`48321c62`) keeps one import with `main`'s comment, so against `main`
those two files differ only by round 0's doubles.
- Main's ten new commits add no `credentials: 'include'` line under
`ui/packages/app-shell/src` or `ui/apps/console/src`, and their one new
hand-rolled Response double already carries `headers: new Headers()`.
- The two changesets (`4a990ef7`) now name every converted door in user
terms (flow clone, permission-set clone, page preview, the no-access
state and the design-mode language list were missing) and claim only
"the other same-server console requests", since the 21 listed calls stay
cookie-only.

Readings at `4a990ef7`, under the shared verify lock (`packages/spec`
moved on `main`: the seven `@objectstack` packages Test UI builds were
rebuilt first, and `pnpm --filter @objectstack/spec check:generated`
reads `All 14 generated artifacts are up to date`):

```text
the ratchet, the bearer-session pin, the 5 test files edited in round 1, every existing test file the merge touched
in the two trees, and the suites named for each source file it touched:
  Test Files  311 passed (311) · Tests  2133 passed (2133)
```

`check:test-source-alias` exit 0. `@object-ui/app-shell` `type-check`
through turbo: `Tasks: 69 successful, 69 total`. `dispatch-gates
--commands` (merge base `93bd4595`): the same 39 families, all run, each
exit captured before any pipe, all exit 0 (`check:type-check-debt`: `0
raw tsc error(s) total, none above its recorded number`; the ui
`scripts/` suite `Test Files 172 passed | 2 skipped (174)`).
`dispatch-gates --ran`: `39 derived famil(ies) accounted for — 39 run, 0
NOT-MEASURED (a DERIVED zero …)`. The whole app-shell and console suites
were not re-run this round (NOT MEASURED, reason: about 70 minutes of
shared lock for a merge that changed no source line of this PR); Test UI
runs the affected set on this PR.
</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D)_
<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYmRepQK9DkZeU7F53D -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record activity shows no approvals: emit approval feed items from plugin-approvals so the one-line approval row appears (follow-up to #35602)

2 participants