Skip to content

fix(plugin-chatbot): a lapsed AI pending action reads Expired, not Rejected, in the AI Approvals inbox and the chat card - #38246

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-ttee3l
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-ttee3l

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #34255
repo:objectstack#2 · os-sales · session_01L6bhgVC7KKvrgZyWpM75L8

Clause-②: yes (widening)
Metadata-protocol: none

Widened: @object-ui/plugin-chatbot's exported ToolDecisionState gains the member expired (read from useHitlInChat().decisions, passed in through ChatbotEnhancedProps.toolDecisions); @object-ui/i18n gains aiApprovals.statusExpired and aiApprovals.expiredDetail in every locale pack. The changeset says the same; it stays patch.

维护者速读

  • 控制台用户在「AI 审批」收件箱和聊天里的确认卡片上,看到 7 天没人处理而自动失效的 AI 操作显示为「已过期」,并写明原因(没在期限内处理,或发起人已没有权限);以前显示成「已拒绝,原因 lapsed」,像是有人拒绝了。
  • 这是云端「AI 待确认操作自动失效」的界面半边,按已有裁决:失效条目显示为过期,不显示成被拒绝。
  • 只改显示,不动服务端、不动审批判断;本人亲手拒绝的仍显示「已拒绝」,点通过或拒绝时撞上已失效的条目,也显示「已过期」而不是报错。有问题可直接撤回。
  • 无

What changes

  • ui/packages/plugin-chatbot/src/pendingActionLapse.ts (new, not on the package barrel): the one test both surfaces use. isLapsedPendingAction(row) is status === 'rejected' && rejection_reason === 'lapsed' && !decided_by; isPendingActionLapsedConflict(status, body) is HTTP 409 with error.details.reason === 'pending_action_lapsed'. Any other 409 keeps its error.
  • AiPendingActionsInbox.tsx (the ai:approvals inbox): StatusBadge takes the row, so a lapsed row reads "Expired" in the table, the phone card and the drawer. The drawer drops the "Decided by" cell for a lapsed row and shows the Expired reason in place of the raw lapsed rejection reason. An approve or reject answered by the lapse 409 sets a neutral outcome line ("… Expired · reason") instead of the destructive conflict alert and closes the reject sheet; the hook already re-reads the list after every decision, so the row turns "Expired" on that read.
  • useHitlInChat.ts + chat/types.ts + chat/toolDetail.tsx + ChatbotEnhanced.tsx (the chat's inline approval card): a decision answered by the lapse 409 sets a new ToolDecisionState value, { state: 'expired', decision }; both the generic approval strip and the record-write card draw "Expired · reason" in the muted style with a clock icon, and the buttons stay gone. No continuation turn is sent.
  • ui/packages/i18n/src/locales/*.ts: two keys, aiApprovals.statusExpired and aiApprovals.expiredDetail, in all 11 packs (zh-Hant regenerated with gen-zh-hant.mjs); the inbox defaults map repeats the en values.
  • ui/e2e/ai-approvals-inbox-phone-35449.spec.ts: the phone-layout spec reads the inbox source by regex; its badge extractor now matches the new call <StatusBadge row={row} (was status={row.status}). Same class string, same shrink-0 requirement. Not run locally (it builds the console first); all 23 of its inbox extractors were tried against the new source by script and each matched, and CI's Build & E2E UI passed at e3c122b.
  • .changeset/34255-ai-approvals-lapsed-expired.md: patch for @object-ui/plugin-chatbot and @object-ui/i18n.

Small calls this PR made (listed for review)

  1. The chat card learns of a lapse only from its own decision. It never reads the pending-action row, so a card rehydrated after the lapse still shows its buttons; pressing one answers "Expired". Reading the row on rehydrate would be a new request per approval card and is not in the card's ask; it is carried by plugin-chatbot: a chat approval card restored after its pending action lapsed still offers Approve and Reject until someone presses one #38250.
  2. ToolDecisionState gains expired (public type, additive; declared above as Clause-②: yes (widening), as the held member was). In this repo countWritesAwaitingApproval counts it as settled and the pending-question reader as answered, both by their existing tests on undefined / error / pending.
  3. onDecided on a lapse gets the same synthesized envelope as any other non-2xx, { id, status: 'failed', error }, with error: 'pending_action_lapsed', so a host can tell the two apart without a contract change (the open question on that envelope stays with objectui#3790).
  4. The inbox outcome line reuses the existing outcomeApprove / outcomeReject sentence with the message "Expired · reason", in the default (not destructive) alert style.
  5. Copy: "Expired" / "Not answered in time, or the person who asked for it lost access." The nine non-English translations were written here (zh-Hant generated from zh-Hans).

Read first

  1. ui/packages/plugin-chatbot/src/pendingActionLapse.ts: the two predicates; a wrong one either hides a person's rejection or misses the lapse.
  2. ui/packages/plugin-chatbot/src/AiPendingActionsInbox.tsx: StatusBadge, isLapsedConflict / expiredOutcome, and the selectedLapsed drawer branches.
  3. ui/packages/plugin-chatbot/src/useHitlInChat.ts: the new branch at the top of if (!response.ok).

Tests

New tests (local, head a867146)
  • ui/packages/plugin-chatbot/src/__tests__/AiPendingActionsInbox.lapsed-34255.test.tsx (zh): a lapsed row reads 已过期 with no 处理人 cell and the reason in the drawer; a row with decided_by and reason lapsed reads 已拒绝; a lapsed row whose decided_by is null or '' reads 已过期 too; an approve answered by the lapse 409 shows the Expired outcome, not the server's conflict message, the list is read again and the row reads 已过期.
  • ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.lapsedApproval-34255.test.tsx (zh, useHitlInChat and ChatbotEnhanced run together through the real button): the lapse 409 draws data-state="expired" with 已过期 and the reason, no 409 text, no buttons, and onDecided gets error: 'pending_action_lapsed'; a person's reject still draws the rejection; the record-write card draws Expired.
cd ui && pnpm exec vitest run --maxWorkers=2 packages/plugin-chatbot/src/__tests__/AiPendingActionsInbox.lapsed-34255.test.tsx packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.lapsedApproval-34255.test.tsx
 Test Files  2 passed (2)
      Tests  6 passed (6)
Ablation

pendingActionLapse.ts mutated on disk so both predicates answer false (return false && (…), if (true || status !== 409 …)), the two files re-run at a91ac87: 3 failed / 2 passed (the lapsed-row, inbox-409 and chat-409 cases; the person-rejection and record-write cases do not read the predicates), exit 1. Restored with git checkout.

The null / '' decider case, separately: !row.decided_by mutated to row.decided_by === undefined, the inbox file re-run: 1 failed / 2 passed (that case), exit 1. Restored with git checkout.

Package runs, type-check, lint

The package runs are at a91ac87; a867146 adds only the new inbox test case and the changeset's declaration lines. At a867146 pnpm --filter @object-ui/plugin-chatbot run type-check and eslint --no-inline-config on the changed test file both exit 0 again.

  • pnpm exec vitest run --maxWorkers=3 packages/plugin-chatbot/ packages/i18n/ packages/app-shell/src/console/ai/ packages/app-shell/src/assistant/: 226 files passed, 2 failed on a missing @objectstack/client dist while the dependency build was still running; after turbo run build --filter='@object-ui/plugin-chatbot^...' --filter='@object-ui/app-shell^...' (exit 0) those 2 files re-run: 2 passed, 49 tests. The packages/i18n/ run includes all-locales-key-parity and zh-hant-generated; the plugin-chatbot run includes the defaults-map-against-en comparison in AiPendingActionsInbox.i18n.test.tsx.
  • pnpm --filter @object-ui/plugin-chatbot run type-check and pnpm --filter @object-ui/i18n run type-check: exit 0 (both tsc --noEmit and tsc -p tsconfig.test.json).
  • eslint --no-inline-config on the 9 changed plugin-chatbot files: exit 0, 0 errors, 1 warning on an existing re-export line this PR does not touch.
Derived gate families (local)

node scripts/pm/dispatch-gates.mjs --commands at head e3c122b derived 41 families (the same list as at a91ac87 and a867146); each run locally, exit code captured before any pipe:

node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-expected-skips :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

dispatch-gates --ran: 41 derived famil(ies) accounted for — 41 run, 0 NOT-MEASURED (a DERIVED zero — all 41 recorded an exit code and none of them is 3).

At a91ac87 the same 41 were run; pnpm --dir ui exec vitest run scripts/ was SIGKILLed once inside that loop and passed alone. Also run there (outside the derived list): pnpm --dir ui run check:i18n-keys, check:i18n-drift, check:i18n-dead-keys, each exit 0 (neither new key is listed as dead).

CI at e3c122b: 13 skipped, 45 success (58 check-runs), including all 16 Test UI shards, Build & E2E UI and Type Check UI.

Acceptance notes

  • No server change: the open edition's AI service does not lapse items today (no pending_action_lapsed in packages/), so on a self-hosted open-edition server nothing reads differently until it does; the hosted service already answers this shape.
  • The card named the chat card as ChatPane.tsx or the component it renders; ChatPane.tsx is untouched, the change is in the plugin-chatbot card and hook it renders.
  • test:repo (vitest repo project) not run locally: this diff touches none of its tests; CI's Test Core runs it.
  • Root pnpm check:i18n, check:i18n-coverage, check:i18n-walk-parity answer exit 3 (prerequisite: a full build) here; they read the server-side bundles, not these packs, and are not in the derived list. check:i18n-stale-fill exit 0.

Verification

Two minutes: run the two new test files above from ui/; expect 6 passing tests, the lapsed rows and both 409 paths reading 已过期.


Generated by Claude Code

…jected, in the inbox and the chat card

Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet
objectstack-fleet Bot requested a review from os-sales November 28, 2026 09:51
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: TIER_DEFAULT
Head-sha: a91ac87d62da8660d700a2c17b3149c8d7313a44
Local-runs: none

Inputs: card #34255 (its body, triage 6905932338, claim 7237134153, dev report 7237525239), the PR #38246 body, its 21-file list and its net diff against main, and the check-runs on the head. Code outside the diff on main was read to judge the diff but not reviewed.

① Derived judgments

  • Lapse test, pendingActionLapse.ts isLapsedPendingAction: right. It matches the card's three-part condition exactly: status === 'rejected' && rejection_reason === 'lapsed' && !decided_by. !decided_by treats undefined, null and '' the same way, so it holds whichever "no decider" shape the server sends. A person's rejection can never read "Expired". On main, IAIService.rejectPendingAction(id, actorId, reason?) takes a required actorId, and the contract (packages/spec/src/contracts/ai-service.ts, semantic migration 18 in-app-pending-action-decided-by-person) lets only the signed-in proposer decide. So every rejection by a person records a decider. That stays true even when the person typed lapsed as their reason, which the inbox test pins with the pa_person row. The open edition has no lapse writer (pending_action_lapsed is not in packages/), so the hosted server's shape as the card restates it is the reference.

  • 409 test, isPendingActionLapsedConflict: right. It checks HTTP 409 and error.details.reason === 'pending_action_lapsed' with a null and type guard at each level. Any other 409 keeps its error. Both callers give it the right inputs: the inbox gets err.status and err.body from call() in usePendingActions.ts, which sets both on every non-2xx; the chat gets response.status and the parsed payload.

  • Inbox (AiPendingActionsInbox.tsx): right. StatusBadge now takes the row. The table, the phone card and the drawer all read "Expired" for a lapsed row. The drawer drops "Decided by" and shows the reason instead of the raw lapsed. A lapse 409 on approve or reject sets a neutral outcome with no mutationError, and the reject sheet closes. The card asks to "refresh the item": that already happens, because approve and reject in usePendingActions call refresh() in finally. The second test pins the re-read and the row turning Expired.

  • Chat surface: right surface. ChatPane.tsx on main imports ChatbotEnhanced and useHitlInChat from @object-ui/plugin-chatbot (lines 29, 32, 445, 808), so the card's chat card is the plugin-chatbot strip and record-write card the diff changes. useHitlInChat puts the lapse branch before the generic error and sends no continuation turn. Both branches in toolDetail.tsx draw "Expired · reason" in the muted style, and the buttons stay hidden because isAwaitingApproval requires no decision.

  • Public surface: ToolDecisionState gains { state: 'expired', ... }, an additive widening of an exported type. It is on the package barrel (ui/packages/plugin-chatbot/src/index.tsx line 312, re-exported from ChatbotEnhanced). Hosts read it from useHitlInChat().decisions and pass it in through ChatbotEnhancedProps.toolDecisions. In this repo it breaks no exhaustive consumer:

    • countWritesAwaitingApproval (app-shell/src/assistant/writeApprovalPending.ts) reads state: string and counts expired as settled. That is correct: a lapsed item no longer awaits approval.
    • hasPendingApproval (chat/pendingQuestion.ts) checks only pending, so expired counts as answered. Also correct.
    • Both switches in toolDetail.tsx handle expired before falling through to the result read on the record-write card.
    • No never assertion and no Record keyed by the state union exists anywhere in the repo.

    ToolDetailContext gains two required fields, but it is not on either entry (index.tsx, core.ts), so that change is internal.

  • The onDecided envelope on a lapse carries error: 'pending_action_lapsed', not a message string. It keeps the shape of every other non-2xx envelope. It only changes which string appears there, and that question stays with objectui#3790 as the PR says. Acceptable.

  • Locale keys: right. aiApprovals.statusExpired and aiApprovals.expiredDetail are in all 11 packs (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant). All nine non-English, non-generated packs are real translations, not English copies. zh-Hant is generated from zh-Hans, and its 訪問權限 matches the 25 existing uses in that pack. The inbox defaults map repeats the en values.

② Semver level

  • patch for @object-ui/plugin-chatbot and @object-ui/i18n is right. Metadata-protocol: none holds, because nothing a metadata author writes changes, and under AGENTS.md Post-Task Checklist step 3 a none kind takes patch. Check Changeset concluded success.
  • Clause-②: wrong. must-fix. The PR body and the changeset both declare Clause-②: no. CONTRIBUTING.md Human Minimum item 5 defines the line as "does this change widen or narrow what a published package accepts or exposes (its accept set or public surface)?". ToolDecisionState is exported from @object-ui/plugin-chatbot's public entry. It is exposed through useHitlInChat().decisions and accepted through ChatbotEnhancedProps.toolDecisions, and this diff adds the member expired to it. That widens both the surface and the accept set. The PR body itself calls it a "public type, additive". There is a precedent for the same type: the held member came in with 6180c87 under Clause-②: yes (widening). Similar optional additions to ChatbotEnhancedProps are declared the same way in this package's CHANGELOG.
    • Fix: in both the PR body and .changeset/34255-ai-approvals-lapsed-expired.md, change the line to Clause-②: yes (widening), followed by a note that @object-ui/plugin-chatbot ToolDecisionState gains the member expired.
    • Keep patch and Metadata-protocol: none. No BREAKING banner is owed, because no exhaustive consumer exists in the repo and the member is additive, as with held.

③ Boundary flags

  • open_questions: none. The dev report lists none ([]).

  • Small call 1 and out-of-scope finding 1. should-fix (carrier). A chat approval card rehydrated after its item lapsed still shows Approve and Reject until someone presses one. The card never reads the row, so it can only find out from its own decision. The call is reasonable for this card, because on main the chat card never reads the row, so for the chat the card's ask comes down to the 409. But the dev report leaves it as carrier: none - ... not filed, so a user-visible gap has nowhere to live. File a follow-up card for the chat card reading its pending-action row on rehydrate, or record a ruling that it is wanted as is.

  • Small calls 2 to 5: answered.

    • 2 (expired is public and additive) is answered in ① and needs the ② fix.
    • 3 (the onDecided envelope) is acceptable and deferred to objectui#3790.
    • 4 (the outcome line reuses outcomeApprove / outcomeReject in the default style) is right.
    • 5 (the copy) is right.
  • Out-of-scope finding 2 (the open edition does not lapse items): answered. It is a cloud-side fact the card already names (consumer cloud#4608). Nothing is owed here.

  • Test coverage. nit. The lapsed fixture leaves out decided_by entirely. The null and '' shapes are covered by the !decided_by logic but not pinned by a test.

  • SQL push-down: no finding. The diff is client rendering only. It adds no query, no id materialisation and no in-app join.

  • Check-runs on the head: 29 completed. 16 are success, including Check Changeset, Type Check · workspace, Type Check · source gates, Lint · ESLint, Live E2E UI and Build UI Deps. 13 are skipped. None failed. 26 had no conclusion when I read them (in_progress):

    • Build & E2E UI
    • Lint UI
    • Lint · CI, release & engine gates
    • Lint · PM dispatch-gates
    • Lint · repo & tooling gates
    • Lint · scoped · query-options erasure
    • Lint · scoped · slot lookup & corpus
    • Lint · scoped · tooling self-tests
    • Test UI (1/16) to Test UI (16/16)
    • Type Check UI
    • Type Check · consumer gates

    Their verdicts are not part of this record. Type Check UI and Type Check · consumer gates are the ones that would catch an exhaustive consumer at type level.

Implemented-by: claude/project-thread-ttee3l
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA (isolated contract-review sub-agent)

VERDICT: FAIL

…psed row with a null or empty decider

Co-authored-by: Claude <noreply@anthropic.com>
…w row prop

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the tests label Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: TIER_DEFAULT
Head-sha: e3c122b92d5e8319235dee1df5cf1a4162a02abc
Local-runs: none

Delta review against round 1 (record 7237583182, FAIL at a91ac87d62da8660d700a2c17b3149c8d7313a44).

Inputs:

The head is 9 commits behind main. None of those 40 files on main overlaps the PR's 22 files, so the net diff against main is round 1's 21 files plus the e2e spec. Round 1's judgments on the unchanged 20 files stand.

① Derived judgments

  • The delta changes no production code.
    • The only shipped-surface edit is the changeset's declaration and its note.
    • The rest is one unit test and one e2e spec.
    • The accept set and public surface are as round 1 judged: ToolDecisionState gains expired, and two locale keys are added in every pack. Nothing more is added.
  • ui/e2e/ai-approvals-inbox-phone-35449.spec.ts: right. The update does not weaken what the spec pins.
    • What it pins. badgeBox gets the class string of the phone card's badge wrapper out of the inbox source with grab(). grab() throws when nothing matches, and throws again when the captured class lacks shrink-0.
    • The change. It changes only the literal it anchors on, from StatusBadge status=\{row\.status\} to StatusBadge row=\{row\}, so it tracks the new prop.
    • It still lands on the same element. It is the first match in the cards slice, which starts at data-testid="ai-inbox-cards".
      • The drawer's badge is row={selected}, so it does not match.
      • The table's badge sits in a TableCell, not in a div className.
    • It still fails loudly. It still requires shrink-0, and if the call moves it still fails rather than skipping.
    • The fixture is unchanged. The spec draws its fixture from r.status, so its measurement of the phone layout is unchanged.

② Semver level

  • M1, the Clause-② line (round 1 must-fix): closed.
    • The changeset and the PR body (revision 2) both carry Clause-②: yes (widening) as a line of its own.
    • Both carry a Widened: note. It names @object-ui/plugin-chatbot's exported ToolDecisionState gaining expired, read through useHitlInChat().decisions and passed in through ChatbotEnhancedProps.toolDecisions. It also names the two @object-ui/i18n keys, aiApprovals.statusExpired and aiApprovals.expiredDetail, in every pack.
    • patch for both packages and Metadata-protocol: none stay unchanged, which is right.
    • The claim amendment 7237596355 records the same line on the card.
    • No BREAKING banner is owed. The member is additive, as held was, and the repo has no exhaustive consumer of the type.
  • Check Changeset on this head had no conclusion when read (see ③), so its verdict on the new line is not part of this record.

③ Boundary flags

  • S2, the restored chat card has no carrier (round 1 should-fix): closed.
  • N1, the null and empty decider (round 1 nit): closed.
    • The new inbox test renders two lapsed rows, decided_by: null and decided_by: ''. Each must read 已过期 and not 已拒绝 in its table row.
    • The null row is cast through unknown, because the spec type is string | undefined. That is right for a wire shape the type does not name.
    • The dev's ablation, !row.decided_by changed to row.decided_by === undefined, fails this test (1 failed / 2 passed), so the test pins the predicate.
  • open_questions: none. The second dev report lists [].
  • SQL push-down: no finding. The delta is a declaration and tests only.
  • New findings: none.
  • Check-runs on e3c122b92, when read: 18 completed (5 success, 13 skipped), none failed. 18 had no conclusion (in_progress):
    • Build UI Deps
    • Check Changeset
    • Dogfood Regression Gate
    • Lint · CI, release & engine gates
    • Lint · ESLint
    • Lint · PM dispatch-gates
    • Lint · docs & code guards
    • Lint · repo & tooling gates
    • Lint · scoped · query-options erasure
    • Lint · scoped · slot lookup & corpus
    • Lint · scoped · tooling self-tests
    • Live E2E UI
    • Plan Test UI shards
    • Test Core
    • Type Check · consumer gates
    • Type Check · debt ledger
    • Type Check · source gates
    • Type Check · workspace
  • Check-runs not yet created on this head: Test UI shards, Build & E2E UI, Lint UI and Type Check UI. These carry the e2e spec and the type-level consumer check.
  • None of these gates' verdicts is part of this record. They gate the merge on their own conclusions.

Implemented-by: claude/project-thread-ttee3l
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA (isolated contract-review sub-agent)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head e3c122b · card #34255 · area s2-ai · 2026-11-28T10:50Z

L1 checklist

  • Shape and checks. Every check on the head is green apart from expected skips (Test UI shards, Build & E2E UI and Type Check UI included); mergeable. The PR is a draft. It changes @object-ui/plugin-chatbot (the inbox, the in-chat approval detail, ToolDecisionState, a new pendingActionLapse.ts helper), two locale keys in every @object-ui/i18n pack, one e2e spec anchor, two new unit tests and one changeset. Dev report 7238150832 carries the derived gates on this head (41 of 41 exit 0).
  • Contract review at TIER_DEFAULT (declaration face). Round 1 (7237583182) was a FAIL on M1, the Clause-② line. The delta record 7237918137 on this head closes M1 and is a PASS: no must-fix, no should-fix. The e2e spec change only moves its anchor to the new StatusBadge row={row} prop and still fails loudly when the badge moves. The seat adopts the record.
  • What changes for a user. An in-app AI pending action whose confirmation window has passed now shows as Expired, not Rejected, in the chat card and the AI Approvals inbox. Nothing else on the approvals page changes. A chat card restored after its action lapsed still offering Approve and Reject is follow-up plugin-chatbot: a chat approval card restored after its pending action lapsed still offers Approve and Reject until someone presses one #38250, held on this PR.
  • Declarations. Clause-②: yes (widening) (exported ToolDecisionState gains expired; two locale keys added in every pack), amended on the claim (7237596355). Metadata-protocol: none, both packages patch. Fixes #34255 is right.

Tier: M. Landing: ready and auto-merge in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 10:51
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 6123f2b Nov 28, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-ttee3l branch November 28, 2026 11:15
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…in-app pending-action queue leaves IAIService (objectstack-ai#38273)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu6r4hvzNtEmw2nzZexBmkpy)_

Refs objectstack-ai#33806

Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: changes with step 3 of objectstack-ai#33806 —
skills/objectstack-ai/SKILL.md, content/docs/ai/actions-as-tools.mdx
(the runtime answer changes there; Tier H then)

## 维护者速读

- 用户能看到什么变化:用户无感。这是四步里的第一步,只改平台的规范契约:应用内助手和外部 AI
两条「待本人确认」的登记通道合成一个服务,界面、客户端、云端和文档在后面三步跟着改。
- 为什么做:你在决策卡上选了「现在合并成一套」,赶在 v19 正式版之前把这次不兼容改动做掉,以后改确认规则只写一处。
-
出错会怎样:只有自己实现过平台确认服务、或直接读旧答案字面量的宿主代码会编译不过,升级说明和迁移条目写了逐项改法;写应用元数据的人不受影响;本
PR 可整体撤回。
- 要你做什么:契约审核档评审通过后,由你批准合并(这次是收窄性改动,按 Tier H 走)。

## What changes

Step 1 of 4 of objectstack-ai#33806 (maintainer ruling 7237978621, option A): the spec
contract only. UI and SDK, cloud storage and routes, and docs are steps
2–4, each its own card.

- `packages/spec/src/contracts/ai-service.ts`
- `IActionConfirmationService` (still registered under
`ACTION_CONFIRMATION_SERVICE`, `'ai.actionConfirmation'`) is the ONE
pending-confirmation service for every AI door and carries the whole
lifecycle: `submit` (unchanged), `list`, `get`, `approve`, `reject`, all
required. The three deciding points (only the person the call ran as
decides, only on a signed-in session, the call runs as that person with
every gate re-checked) and the `held` outcome are stated on the
service's members. The decider is the `context: ExecutionContext` passed
in (it was an `actorId` string on the queue).
- `ActionConfirmationHandOff` gains optional `toolName`,
`conversationId`, `messageId` for an in-app item; `door` is `mcp` or
`assistant`.
- The service docblock says how a hand-off from every door becomes a
`PendingActionRow` (row shape unchanged): `tool_name` is the tool the
call was made through (the model's tool on an in-app item; `run_action`,
or `resume_run` when the hand-off carries a run, on an MCP item);
`tool_input` is that call's input as JSON, so the record, the namespace
and the run ride there and get no column; `object_name` is the empty
string for an action on no object; the door is not on the row (the host
approves from the hand-off it kept).
- Rule 1 of the confirmation contract now says every door hands off to
the same service, the in-app door never eliciting.
- New types `ActionConfirmationListFilter`,
`ActionConfirmationApproveOutcome`.
- `IAIService` loses `proposePendingAction`, `approvePendingAction`,
`rejectPendingAction`, `listPendingActions`; `ProposePendingActionInput`
is removed.
- `PendingActionStatus` (six states, `held` included, no `expired`: a
lapse stays the host's to define) and `PendingActionRow` keep their
shape and now describe the service's items.
- The confirmation contract's in-app section now reads "the same rule,
the same channel": the in-app door hands off through `submit` with
`door: 'assistant'` and answers `ActionConfirmationPending`
(`pending_confirmation` + `pendingId`). A new paragraph retires the
`pending_approval` + `pendingActionId` answer and states that a reader
of stored conversations reads it through the SAME recogniser that reads
`pending_confirmation` (`pendingActionId` taken as `pendingId`), with no
second reader. "Its bounds" and "When it binds" are updated (the FROM
half of the merge is named).
- `packages/spec/src/api/protocol.zod.ts`: comments only. The
`/api/v1/ai/pending-actions` route schemas are unchanged; they now front
the pending-confirmation service.
- `packages/spec/src/kernel/execution-context.zod.ts`:
`performedBy.confirmationId` describes one store (TSDoc + `.describe`),
regenerated into `content/docs/references/kernel/execution-context.mdx`.
-
`packages/spec/src/migrations/entries/semantic/19.ai-pending-action-queue-merged-into-confirmation-service.ts`:
the D3 entry, FROM → TO per member.
- Generated: `api-surface/contracts.json`,
`export-origins/contracts.json` (+2 `ActionConfirmation*` interfaces,
−`ProposePendingActionInput`).
- Tests: `ai-service.test.ts` re-points the held-outcome and
deciding-point pins to the service members and adds type pins
(`IAIService` declares none of the four members; the service's keys are
exactly the five; a submit-only service is refused);
`action-confirmation-contract.pin.test.ts` follows the prose;
`ai-store-caller-context.pin.test.ts` re-points the inbox read to
`list`/`get` (context required).
- `ui/packages/plugin-chatbot/src/usePendingActions.ts`: one comment
re-pointed from the retired `IAIService.proposePendingAction` /
`.listPendingActions` to `IActionConfirmationService.list` / `.get`
(`ui`'s `check:spec-symbols` reads spec members cited in comments and
went red on bf6f12e; AGENTS.md: a removal that breaks `ui/` ships with
the `ui/` fix). Comment only; not a file open PR objectstack-ai#38246 edits.
- Changeset `.changeset/33806-pending-confirmation-service-one-seam.md`:
`@objectstack/spec` patch, BREAKING banner, FROM → TO table, `adr-0087:
registered`.

Shape decisions taken by this thread (no product call; the seat accepted
them, the row mapping after the first contract review): extend the
existing service rather than a new service name; keep the row, status
and route shapes so `ui/` does not move in this PR; state the hand-off →
row mapping in words instead of making `object_name` / `tool_name`
optional (which would move the console inbox, the file open PR objectstack-ai#38246
edits); no new spec export for the retired literal.

## Why

The maintainer ruled the merge now, inside the open 19 prerelease window
(`@objectstack/spec` 19.0.0-next.2), so the breaking change lands before
19.0.0 and a confirmation rule lives in one place.

## Acceptance notes

- Premise check (ruling's step-1 condition): open PR objectstack-ai#38246 (objectstack-ai#34255,
head e3c122b) touches only `ui/**` and its own changeset; this PR
touches `packages/spec/**`, its generated docs page, one `ui/` comment
(`usePendingActions.ts`) and a changeset. Zero overlap.
- `ui/` imports `PendingActionRow`, `PendingActionStatus` and the
`AiPendingAction*` response types from spec and none of the four retired
members (`git grep` over `ui/`, `packages/client`), so the removal does
not red `Type Check UI`; `packages/runtime` uses
`IActionConfirmationService` only to cast and call `submit`.
- The 18 D3 entry `in-app-pending-action-decided-by-person` still names
the old members: it is 18's record and is left as written.
- ADR-0011's revision note ("Merging the two seams was not ruled") is
now stale; it is `docs/adr/**` and belongs to step 4. The docs-drift
comment's list (`content/docs/ai/actions-as-tools.mdx` and the pages
that merely share a field name such as `messageId`) is the docs step's
too.
- Contract review round 1 (7238295862, FAIL) answered at 5d82277: M1
row mapping (above), S1 rule 1, S2 the `Skills-docs:` line, N1 the `{ id
}` → `{ pendingId }` answer in the changeset's FROM → TO table.

## Verification

Local, at head 5d82277 unless a line says otherwise (ff98353 adds the
`ui/` comment only; `node ui/scripts/check-spec-symbol-derivation.mjs`
exit 0 there):
- `pnpm --filter @objectstack/spec build` — VERDICT command-exit 0.
- `pnpm --filter @objectstack/spec check:generated --fix` — at bf6f12e
3 stale (api-surface, export-origins, docs) regenerated; at 5d82277
none stale.
- `pnpm --filter @objectstack/spec check:test-typecheck` and `vitest run
src/contracts src/migrations` — Test Files 62 passed, Tests 719 passed
(VERDICT command-exit 0).
- Derived gate list (`dispatch-gates.mjs --commands`, 117 commands),
full run 11:11–11:53Z (ff98353, a `ui/` comment only, was committed
during it): 109 exit 0, 1 exit 1, 7 exit 3. All eight non-zero were
PREREQUISITE, not findings: the CLI `migrate-meta-engine-guidance` test
(exit 1) could not load the unbuilt `@objectstack/lint` dist, and seven
gates refused on missing built output. After `pnpm turbo run build`
(exit 0) at ff98353, seven of them were re-run there and all exit 0:
`migrate-meta-engine-guidance` (3 tests passed),
`check:doc-formula-expressions`, `check:doc-security-posture`,
`check:skill-examples` (351 examples), `check:docs-transcript-drift`,
`check:dual-build-cjs-loads`, `check:lean-entry-closure`. Total 116 of
117 exit 0. One NOT MEASURED locally: `check-plugin-teardown-shape
--self-test` needs an unshallow clone; read from this PR's check-runs.
- Dogfood, at ff98353 (final head): the CI `Dogfood Regression Gate` is
green there, but its shards were skipped by the PR filter, so it was run
locally: `pnpm turbo run build --filter=@objectstack/dogfood` exit 0,
then `pnpm turbo run test --filter=@objectstack/dogfood` exit 0 (cache
miss, executed): Test Files 491 passed, 3 skipped; Tests 4148 passed, 68
skipped.

CI families: read from this PR's check-runs.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgTrYJvLJfdjfWhNMMV)_

<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgTrYJvLJfdjfWhNMMV -->

---------

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/l 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.

Console AI approvals: show a lapsed pending action as Expired, not Rejected, in the chat card and the AI Approvals inbox

2 participants