Repository navigation
Closed
Copy link
Labels
area:workflowApprovals and automation — the work that runs without a person driving itpriority:p1High: required for production / M2
Description
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
③ maintainer-directed task · Source: maintainer ruling on #35340 (comment #35340 (comment); sub-cards approved 2026-11-19 06:03Z 「同意」「都是 p1」).
Blocked-by: #35354
Waits on #35354 (the ADR) and on the calendar service from ②. Ships in the same release as ② and ③.
维护者速读
- 问题: 审批超时按自然小时算,夜里、周末、节假日都算进去。
- 要做: 给审批升级加一个时钟选项,可以按工作时间算;日历算不出时不升级,并在到期时间处写明原因。
- 不做会怎样: 周五下午提交的审批周五晚上就升级,客户看到的到期时间不对。
- 你要做的: 无。
Scope
ApprovalEscalationSchema(packages/spec/src/automation/approval.zod.ts~855-875): addclock: 'wall_clock' | 'working_time'(defaultwall_clock) and an optionalcalendar(code). Rewrite thetimeoutHoursdescribe text and the code comment that say the platform ships no calendar.- The default stays
wall_clock. The sweep reads stored node-config snapshots (packages/plugins/plugin-approvals/src/approval-service.ts~8055), so existing requests keep their deadlines. - Sweep, with
working_time: compute the deadline fromcreated_atthrough the calendar service (addWorkingHours), and recompute it on every sweep rather than storing it (ADR-0157 D12; ADR-0042 §1 single-shot escalation and §3 stand). - Calendar resolution follows the ADR: explicit code, then the org default, then refuse. There is never a silent wall-clock fallback.
- When the calendar can't answer (it is missing, or not maintained that far; ADR-0157 D8/D9, ruling record 7003541720): the sweep does not escalate, retries on the next sweep, and the displayed due time shows 「日历算不出」 with the reason. The publish-time lint checks only static authoring errors, e.g. a
calendarcode withoutclock: 'working_time'. ⛔ No publish-time check that the calendar exists. That is per-org runtime data, and the lint is a pure(stack) => Finding[]. (Corrected 2026-11-19 from "aworking_timeescalation with no resolvable calendar is a lint/validation error", per ADR-0157 D9.) - Studio designer field for the clock and calendar; docs and skills teaching text.
- Only
timeoutHoursgets a clock key. Other duration keys get one card each, later.
Done when
A working_time escalation opened Friday 17:00 with 4 hours fires on the next working day per the calendar, including across a holiday and a 调休 make-up Saturday. A request whose calendar can't answer doesn't escalate and shows the reason where the due time is displayed. wall_clock behaviour is unchanged.
Non-goals
Flipping the default clock; clock keys on other duration keys.
Metadata
Metadata
Assignees
Labels
area:workflowApprovals and automation — the work that runs without a person driving itpriority:p1High: required for production / M2
Activity
objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
Unblocked 2026-11-19T13:53Z: blocker #35354 is closed. ADR-0157 merged as PR #35364 (
f727061b88), and this card is one of its named enforcement cards.pm:blocked→pm:queue. Area data-1 dispatches the three siblings (#35355, #35356, #35357) on sibling branches and lands them together, as ADR-0157 D4 requires (same release).objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#4 · os-elon-musk · session_016WV4czKnDE6hsyXQzB9wB2
Claim: PM loop round 6 · area a4-W · p1 (maintainer ruling on #35340, 7000950747: sub-cards 「同意」「都是 p1」; current dispatch rule p1 only, maintainer 2026-11-20T16:55Z 「暂时只处理 p1」, routed to a4-W by the seat): Working calendars ④, the approval escalation clock key (
wall_clock|working_time) · 2026-11-20T16:58ZSession:
session_016WV4czKnDE6hsyXQzB9wB2Account:
os-elon-muskBranch:
claude/area-a4W-35357Worktree:
objectstack-issue-35357Domain:
domain:serverArea: a4-W
Seat: repo:objectstack#4
File surface:
packages/spec/src/automation/approval.zod.ts(ApprovalEscalationSchema:clock, optionalcalendar; rewrittentimeoutHoursdescribe text and comment) plus the spec's generated artifacts and the approval lint;packages/plugins/plugin-approvals/src/approval-service.ts(slaDueAt, thesla_due_atread projection andrunEscalations), with its tests; the Studio escalation inspector inui/packages/app-shell/src/views/metadata-admin/inspectors/(clock and calendar fields) with i18n in every pack;content/docs/automation/approvals.mdxand the generated reference page. Skills teaching text goes to a domain:skills sub-card for area a4-A, not this PR (lane rule). OnlytimeoutHoursgets a clock key. Stop on breach.Container & model: L,
mode:subagent, model: TIER_DEFAULT, effort: highClause-②: yes (widening)
Metadata-protocol: added
Responsibility: feature, maintainer-directed (③), an enforcement card named by ADR-0157 (merged as PR #35364).
Pre-claim lane: area:workflow ·
pm:queue(unblocked 7011117022 when #35354 closed).Pre-claim deps: #35354 (ADR-0157) closed; #35355 (② calendar service) closed, and
WorkCalendarService.addWorkingHoursis on origin/main (packages/objectql/src/work-calendar-service.ts). Release note: the card ships in the same release as ② and ③ (#35356, open, area:formula). Only the maintainer releases.Prior rulings read:
check-prior-rulings.mjs --card 35357(ADR-0157 D4, D5, D8, D9, D12; ADR-0042 §1 and §3); the card's 2026-11-19 correction per ADR-0157 D9: no publish-time check that a calendar exists.Thread-read: 7011117022
Premise: holds on origin/main.
slaDueAtaddstimeoutHours × 3_600_000tocreated_at, and the schema text says the platform ships no calendar. Both are now false, because ② shipped the calendar service. The dev re-measures first.Serial constraints cleared: open PR #35789 also edits
approval-service.ts(messaging surface neargetChannel, not the SLA or sweep code). Run overlap-check before push, and merge origin/main if #35789 lands first.objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#4 · os-elon-musk · session_016WV4czKnDE6hsyXQzB9wB2
os-dev-report
{ "issue": 35357, "status": "done", "branch": "claude/area-a4W-35357", "pr": "https://github.com/objectstack-ai/objectstack/pull/35929", "session": "session_016WV4czKnDE6hsyXQzB9wB2", "premise_still_valid": true, "summary": "PR #35929 (draft, head 1d5c6fcf0895d9b205ac1dbd98f44aca4968c2a9; +866/-45 over 35 files, net-added 821, tests and generated files included, under the ~900 soft size). Premise re-measured on origin/main 8c18a362a2: ApprovalEscalationSchema had only timeoutHours with the 'platform ships no business-hours calendar' comment and describe text, slaDueAt added timeoutHours x 3_600_000 to created_at for both the sweep and the sla_due_at projection, runEscalations read the node_config_json snapshot, the clock test pinned wall-clock, and the console showed sla_due_at only in ApprovalsInboxPage's queue cell; WorkCalendarService.addWorkingHours was on main. Built: spec keys escalation.clock ('wall_clock' default | 'working_time') and optional escalation.calendar (WORK_CALENDAR_CODE_PATTERN), rewritten timeoutHours text; one deadline function ApprovalService.slaDeadline shared by runEscalations and the read projection (open, list, single read), working_time counted through the lazily resolved WORK_CALENDAR_SERVICE with the request's organization_id and calendar code, recomputed every sweep and read, never stored, slaDueAt answering nothing for working_time so there is no wall-clock fallback; a calendar refusal skips the escalation, counts into one warn per sweep, retries next sweep, and is served as the new additive ApprovalRequestRow.sla_due_refusal {code, reason?, calendar?, date?, message}; lint rule approval-escalation-calendar-without-working-time (error, static only, no calendar-existence check); Studio inspector fields 'Count hours as' and 'Working calendar' (calendar gated on clock = working_time in both descriptor sources via SIBLING_GATES) with zh overlay; inbox shows 'Calendar can't compute' + reason in all 11 locale packs (zh-Hans 日历算不出); docs approvals.mdx + regenerated reference page; ADR anchor; changeset (spec, plugin-approvals, lint, console, i18n minor). Deviations: the PR carries no assignee (the frame forbids assignees on pr_create and os-dev's write budget has no further stroke; seat to set Account os-elon-musk); branch was created with tracking per the frame's command rather than --no-track; not merged with origin/main (7 commits ahead, disjoint packages, overlap-check clean).", "tests": "plugin-approvals approval-service-sla-calendar-clock.test.ts: 6 new working_time cases red first on wall-clock (e.g. expected '2026-04-03T13:00:00.000Z' to be '2026-04-07T04:00:00.000Z'), then 12 passed; full plugin-approvals vitest: Test Files 125 passed (125), Tests 1793 passed; lint full: Test Files 222 passed (222), Tests 9346 passed; spec full `pnpm --filter @objectstack/spec test` on head 1d5c6fc: Test Files 866 passed (866), Tests 27798 passed | 1 todo (approval-describe-business-words caught the first describe draft, fixed); ui inspectors + ApprovalsInboxPage: Test Files 256 passed (256), Tests 3254 passed | 1 skipped; ui scripts/: 172 passed | 2 skipped. Re-measured pins: gated-field census 33->35, declared-default surface ten->eleven, round-trip parse materializes clock:'wall_clock'. Ablations (source imported relatively by the test, no dist hop), via scripts/ablation-replace.mjs with on-disk proof and restore to HEAD blob ecfd18ef803f (git diff HEAD empty): working-time branch (`if (!escalationCountsWorkingTime(cfg))` -> `if (true)`) 6 of 12 red; cannot-answer guard (drop the `continue` after calendarRefused++) 3 of 12 red, `expected { scanned: 1, escalated: 1 } to match object { escalated: +0 }`; a first guard attempt whose replacement was a substring of its anchor was refused by the tool before running (no-op, not counted).", "gates": "Local on head 1d5c6fc: `node scripts/pm/dispatch-gates.mjs --commands` = 131 families, each run with its exit captured before any pipe, all exit 0; `--ran` reconciliation: 131 derived, 131 run, 0 NOT-MEASURED (derived zero). An earlier pass on an older head found and I fixed: check:where-matcher (calendar read double now refuses combinators), check:test-source-alias (two edited inspector tests now import '@objectstack/lint' at module top); its exit-3 readings (spec check:api-surface, check:skill-examples, check:dual-build-cjs-loads, check:i18n) were build-prerequisite refusals from a concurrent closure build and are all exit 0 on the final pass. Also: `pnpm --filter @objectstack/spec check:generated --fix` regenerated content/docs/references only; typecheck spec, lint, plugin-approvals (incl. check:test-typecheck) exit 0; type-check @object-ui/i18n, app-shell, console exit 0; check:i18n OK 10 packages; check:adr-0087-registration: no declared-breaking changeset; overlap-check VERDICT clean exit 0 (origin/main, #35789, #35909, #35910). CI check-runs on #35929: in_progress at report time, not awaited.", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "0", "api_writes": "2 — POST /repos/objectstack-ai/objectstack/dispatches (fleet-write relay, pr_create -> PR #35929, read back byte-identical); the os-dev-report comment on #35357 via scripts/pm/post-stamped.mjs", "open_questions": [ { "question": "approval-escalation-calendar-without-working-time is an error with no localized user sentence (the user-text catalog is for advisory findings only, pinned by finding-user-text.test.ts), so a Studio author who keeps a calendar after switching back to the wall clock reads the English developer message at the save door. Keep it?", "options": [ "A keep error, English message (as other error findings such as approval-decision-outputs-reserved)", "B make it a warning with user text in all 11 platform locales (no refusal; the calendar stays inert)" ], "recommendation": "A, because ADR-0157 D2 forbids a silent wrong clock and the Studio inspector hides the calendar under the wall clock, so the state is reachable only by a retained value the inspector already flags as not in effect." } ], "security_findings": "none", "out_of_scope_findings": [] }objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Half-state cleanup · 2026-11-24T10:33Z: this card is closed as completed but still carried
pm:dispatched; a closed card carries no pm state (the close strips it in the same stroke). Stripped here, nothing else changed. Found while closing out its parent #35340 (7128933005).