Repository navigation
feat(approvals): an escalation deadline can count working time on an org calendar (clock: working_time) - #35929
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…alendar lint Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
… load at collection Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
📓 Docs Drift CheckThis PR changes 3 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 5 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 174 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 08d3b7996a7c4fbb18d52715131f5a8e490b05b3 && git checkout 08d3b7996a7c4fbb18d52715131f5a8e490b05b3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 17ed9e7bfd65532d83109273837e4a44624dee5c f079e341ff364bdac211e75e39f9950987007303 && git checkout -B drift-repro 17ed9e7bfd65532d83109273837e4a44624dee5c && git merge --no-ff f079e341ff364bdac211e75e39f9950987007303
node scripts/docs-audit/affected-docs.mjs --json 17ed9e7bfd65532d83109273837e4a44624dee5c
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…refusal strings Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
… (119) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
|
repo:objectstack#4 · os-elon-musk · session_016WV4cwxJaQdC11ABGtTez8 L1 verdict (L1-a): ACCEPT at head Gates on this head: The card's Done-when, checked against the code and my own runs:
Scope and declarations:
Sentence-by-sentence reads (changeset,
Notes (not owed; a4-W's call whether to fold any in or file them):
Landing: not governed and not a narrowing. The seat's contract read comes next, as a4-W said, and then a4-W lands. Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF Served-tier: Contract review — PASS at f079e34Head-sha: PR #35929 ( Tier. The committed tree changes two published schema files under No must-fix, no should-fix. Seven nits are listed under ④; none of them asks for a change on this head. The narrowing question, answered first: this is not a narrowing. The new lint error refuses nothing that ① Derived judgments
② Semver level
Both declaration lines stand line-initial in the PR body and in the changeset. No ADR-0087 marker is owed: the changeset declares nothing breaking, and ③ Boundary flags
④ Design judgment
Implementing files:
Nits. None affects correctness or the contract on this head. N1 and N2 are worth one follow-up card.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-elon-musk · session_016WV4czKnDE6hsyXQzB9wB2 Landing (area a4-W) · 2026-11-20T22:54Z
State change: ready for review + auto-merge on the maintainer's area line 「本区通过复审的 PR 都可以 ready + auto-merge」 (a4-W thread, 2026-11-19T21:59Z). On MERGED: #35357 closes via |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44833967939 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#4 · os-elon-musk · session_016WV4czKnDE6hsyXQzB9wB2 Queue build 44833967939 failed in Test Core (10/10) on |
Requested by Elon · project thread
Fixes #35357
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #35931 — skills/objectstack-automation/references/state-machines-and-approvals.md (the escalation row), domain:skills sub-card, Blocked-by this PR
维护者速读
What changes
ADR-0157 D5, D9 and D12, on the approval escalation:
ApprovalEscalationSchema): two optional keys.clock: 'wall_clock' | 'working_time', default'wall_clock'(a stored snapshot carries noclock, so every open request keeps its deadline), andcalendar, a working-calendar code (WORK_CALENDAR_CODE_PATTERN). ThetimeoutHoursdescribe text and comment no longer say the platform ships no calendar; they say the clock decides how the hours count. The describe first sentences stay in business words.plugin-approvals): one deadline function,ApprovalService.slaDeadline, serves both the escalation sweep and the request read projection (D12).wall_clockis the unchangedslaDueAt(created_at + timeoutHourselapsed).working_timecountstimeoutHoursworking hours fromcreated_atthrough the calendar service (WORK_CALENDAR_SERVICE, resolved lazily like the other providers), naming the request's ownorganization_idandescalation.calendar; the service resolves the named code, else the organization default, else refuses. It is recomputed on every sweep and every read, never stored.slaDueAtanswers nothing for aworking_timeescalation, so no path can fall back to wall-clock hours (D2). Single-shot escalation (ADR-0042 §1) is untouched: theescalateaudit row is still the only marker, and it does not record the due time.ERR_WORK_CALENDAR_UNRESOLVED,ERR_WORK_CALENDAR_NOT_MAINTAINED,ERR_WORK_CALENDAR_INVALID) is not an escalation: the sweep skips the request, counts it in onewarnper sweep, and asks again next sweep. A kernel with no calendar service refuses the same way. New served field (additive):sla_due_refusalonApprovalRequestRow(code,reasonon unresolved,calendar,dateon not-maintained,message), present in place ofsla_due_at.@objectstack/lint):approval-escalation-calendar-without-working-time(error) refuses acalendarbeside the wall clock, where nothing reads it. Static only: no check that the calendar exists (D9).SIBLING_GATESinjson-schema-to-fields.tsserves the hand-written table and the engine-publishedconfigSchema). zh overlay added; thetimeoutHourszh help no longer says there is no calendar.sla_due_refusalshows "Calendar can't compute" with the reason (no calendar "X" / no default calendar / not maintained for DATE / fix the calendar in Setup), in all eleven locale packs (zh-Hans: 「日历算不出」). The zh-Hant pack is generated from zh-Hans bygen:zh-hant, never hand-edited.content/docs/automation/approvals.mdx(Timeouts and escalation) and the generated reference page. ADR anchor for the deadline function.Not released alone: ships in the same release as the calendar objects and service (#35355) and the working-day formula functions (#35356), ADR-0157 D4.
Evals
None: no agent-facing prompt or skill text changes here. The skills text is owed as a follow-up (the
Skills-docs:line).Tests
approval-service-sla-calendar-clock.test.ts, a new top-level describe on the REALWorkCalendarServiceover a read double: Friday 17:00 + 4 working hours with Monday a holiday fires Tuesday 12:00 and not at any earlier instant; before a make-up (调休) Saturday it fires that Saturday 12:00; a holiday entered later moves the deadline (D12); a missing calendar servessla_due_refusal(not_found), escalates nothing past every deadline, and the next sweep escalates once the calendar exists;no_defaultandERR_WORK_CALENDAR_NOT_MAINTAINED(with its date); no calendar service refuses; an explicitwall_clockequals the default. The four existing wall-clock pins are unchanged and green.wall_clock; its control (working_timewith a calendar that does not exist, andworking_timewith none) is clean.ApprovalNodeConfigSchema, from both descriptor sources. Inbox: the reason renders in place of the countdown in English and zh-CN, and a served due time keeps its countdown.escalation.clock), the escalation round-trip now parses withclock: 'wall_clock'materialized, and the de quote-pairing pin 118 → 119 (the newapprovalsInbox.slaCalendarNotFoundadds one correctly paired „{{calendar}}“ span, U+201E … U+201C; ledger line added, assertion unchanged).Ablations (both red, both restored to HEAD by `scripts/ablation-replace.mjs`)
slaDeadlineanswers wall-clock for every clock): 6 of 12 tests red, the sixworking_timecases; restore blob equals HEAD,git diff HEADempty.continues the sweep): 3 of 12 red, eachexpected { scanned: 1, escalated: 1 } to match object { escalated: +0 }; restored to HEAD. A first attempt whose replacement was a substring of its anchor was refused by the tool before running and is not counted.Verification
Read first:
packages/plugins/plugin-approvals/src/approval-service.ts(slaDeadline,projectWorkingTimeDue, therunEscalationshunk),packages/spec/src/automation/approval.zod.ts,ui/apps/console/src/pages/system/ApprovalsInboxPage.tsx(slaRefusalLabel).Two-minute check:
pnpm --filter @objectstack/plugin-approvals exec vitest run src/approval-service-sla-calendar-clock.test.tsshows 12 passed.Local readings
Fix round on head
f079e34(origin/mainmerged at753091e,zh-Hant.tsregenerated, de pin re-measured), in this container (shared box), throughscripts/pm/os-verify-lock.sh:zh-hant-generated.test.tsred before the regeneration (src/locales/zh-Hant.ts is stale, 1 failed | 10 passed), green after;de-quote-pairing-3876.test.tsred with the old pin (expected 119 to be 118,{ open: 119, close: 119, rdq: 0 }vs 118), green after.vitest run packages/i18n/(ui root): Test Files 105 passed (105), Tests 1957 passed, 13 skipped.pnpm check:i18n: OK, 10 packages, all bundles in sync.node scripts/pm/dispatch-gates.mjs --commands(131 families) onf079e34, each with its exit code;--ran: 131 derived, 131 run, 0 NOT-MEASURED (a derived zero). Eight families first refused for missing builds (exit 3, and uiscripts/red for an unbuilt@objectstack/client) and are exit 0 after building./packages/**.overlap-check: VERDICT clean.Earlier readings, on head
1d5c6fc:pnpm --filter @objectstack/spec test: Test Files 866 passed (866), Tests 27798 passed, 1 todo.pnpm --filter @objectstack/plugin-approvals exec vitest run: Test Files 125 passed (125), Tests 1793 passed (one commit earlier; the later commits touch only this package's clock test file, rerun green: 12 passed).pnpm --filter @objectstack/lint exec vitest run: Test Files 222 passed (222), Tests 9346 passed.vitest run packages/app-shell/src/views/metadata-admin/inspectors/ apps/console/src/pages/system/ApprovalsInboxPage: Test Files 256 passed (256), Tests 3254 passed, 1 skipped;vitest run scripts/(ui): 172 passed, 2 skipped.@objectstack/spec,@objectstack/lint,@objectstack/plugin-approvals(incl.check:test-typecheck) green;type-checkof@object-ui/i18n,@object-ui/app-shell,@object-ui/consolegreen after building their closure.pnpm --filter @objectstack/spec check:generated --fix: regeneratedcontent/docs/references/**only; every other artifact current.pnpm check:i18n: OK, 10 packages, all bundles in sync.node scripts/pm/dispatch-gates.mjs --commands(131 families) run on this head, each exit 0;--ranreconciliation: 131 derived, 131 run, 0 NOT-MEASURED (a derived zero, every line carries its exit code).node scripts/pm/overlap-check.mjs --branch=claude/area-a4W-35357: VERDICT clean (origin/main, feat(messaging): Slack DM delivery — slack channel, per-person link store, approval requests by DM (Part of #34730) #35789, fix(plugin-list): a list's column header opens a menu and keeps a multi-level sort; a sort chip opens the sort panel #35909, feat(console)!: one way to open a record from an object's list; navigation.mode deprecated there #35910).f079e34, against mergedorigin/main): +875 / -48 across 35 files, tests and generated files included.Acceptance notes
sla_due_refusalis new and optional;sla_due_atkeeps its meaning underwall_clock.escalateaudit row does not record the due time it fired on (the ADR left this to this card); the deadline is never stored anywhere.messageis served but not shown.origin/mainis merged in (at753091e, a clean merge);overlap-checkreports clean merges againstorigin/main, feat(messaging): Slack DM delivery — slack channel, per-person link store, approval requests by DM (Part of #34730) #35789, the open locale-pack PRs and the two open lint PRs.🤖 Generated with Claude Code