docs(spec,approvals): ApprovalEscalation.timeoutHours names its clock — calendar (wall-clock) hours - #14542
Conversation
… — calendar (wall-clock) hours The ruled A-half of the business-hours question, consumption-side: the unit is carried by the declaration's own contract text (the timeoutHours describe, which gen:schema emits to the JSON schema and build-docs to the reference page), the one runtime site that turns the number into a deadline (slaDueAt) says the same in its JSDoc and is pinned by a wall-clock test through the real code path (Friday 17:00 + 4 h is due Friday 21:00; a 168-hour deadline spans the weekend; a DST transition changes nothing because the arithmetic is elapsed time), and the handwritten approvals page carries one sentence. No key is added, renamed or defaulted differently; plugin-approvals has no logic change. The system-context census page is re-anchored mechanically for the line shift the JSDoc introduced. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
…s limit The read-and-append engine double answered a `limit: 1` read with every row; `check:objectql-double-limit` names that shape limit-blind. The bound is now applied by presence, after the filter. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
…ration-unit-declaration
…/main The merge brought main's own re-anchoring of the same page beside this branch's; the census is regenerated from the merged tree so every elevation-read anchor resolves again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
📓 Docs Drift Check1 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 128 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 92bab48cf484449e3567d6f1640e79795125000a && git checkout 92bab48cf484449e3567d6f1640e79795125000a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9acddde94c5242db560913aa2d2c2e8f7b843511 fb5c8a4a3dad3363f9583f447ecc67a36fdebb6f && git checkout -B drift-repro 9acddde94c5242db560913aa2d2c2e8f7b843511 && git merge --no-ff fb5c8a4a3dad3363f9583f447ecc67a36fdebb6f
node scripts/docs-audit/affected-docs.mjs --json 9acddde94c5242db560913aa2d2c2e8f7b843511 |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 33623906645 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
Queue build 33623906645 red — not this PR's; no change needed here. ( The failing check The queue has already rebuilt this PR on the post-ejection stack (queue head Generated by Claude Code |
… tree Regeneration commit after merging origin/main (the merge driver deferred content/docs/permissions/system-context.mdx). Both sides had re-anchored row 42 for approval-service.ts line shifts — this branch's recall-gate hunk and #14542's JSDoc hunk — so the anchors are re-derived from the merged code by the gate's own --fix; no row content changed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
Part of #13801
Clause-②: no — describe-only. No key is added, renamed or defaulted differently; the authorable surface and the JSON-schema manifest are unchanged; only the contract text of an existing key moves.
Ruling implemented (quoted)
From the
domain:specseat's ruling on the phase-1 measurement (issue 13801, comment 5506987580, 2026-09-02):The maintainer's ruling of record behind it (2026-08-31, decision batch #18, verbatim 「其他同意」 on the split of the business-hours question): the A-half is that "this number is wall-clock hours" must be part of the declaration, not ambient prose. ⛔ Nothing here grows toward a business-hours calendar; ⛔ no
clockkey, because a key with a single legal value would be declared-but-inert (ADR-0049).The four items
packages/spec/src/automation/approval.zod.ts:624-633—timeoutHoursgains a JSDoc (:624-632) and itsdescribe(:633) now reads: Calendar (wall-clock) hours before escalation triggers — nights, weekends and holidays count. The platform ships no business-hours calendar: a request opened at 17:00 on a Friday with timeoutHours 4 escalates at 21:00 that same Friday. That string is the JSON-schemadescriptionand the reference-page cell;pnpm --filter @objectstack/spec check:generated --fixregeneratedcontent/docs/references/automation/approval.mdx:41,105and nothing else (authorable-surface anchor, api-surface, spec-changes all current).check:doc-authoringrule 3 (no tracker ids in customer-facing text): green.minApprovalsin the same file belongs to the sibling PR for spec:ApprovalNodeConfigSchema.minApprovalsdescribes "Default 1", but the quorum runtime defaults to ALL resolvable approvers #13809 and is untouched.packages/plugins/plugin-approvals/src/approval-service.ts:610-624— JSDoc aboveslaDueAt(the one runtime site that turns the declared number into a deadline) names the clock; no logic change (15 lines added, 1 removed, all comment). Newpackages/plugins/plugin-approvals/src/approval-service-sla-calendar-clock.test.ts(208 lines, 5 tests) pins the arithmetic through the real pathopenNodeRequest→getRequest→runEscalationswith an injected clock: Friday 2026-01-16 17:00Z +timeoutHours: 4→ Friday 21:00Z, not escalated at 20:59:59.999Z, escalated at 21:00:00.000Z (before Monday's first working hour); a 168-hour deadline lands the next Friday at the same hour with Saturday and Sunday inside the window and no escalation on Monday 09:00Z; two DST cases (America/New_York spring-forward 2026-03-08 and fall-back 2026-11-01) show four elapsed hours regardless of what the local wall reads. Timezone assumption, stated in the file header: none is required — every instant is an ISO-8601 UTC string and the arithmetic is elapsed milliseconds, so the assertions hold under anyTZ; the DST comments document the local-time reading. The engine double declaresfind+insertonly (noupdate/deletemember, so nothing forcheck:engine-double-contractto pin) and honours the caller'slimitby presence (check:objectql-double-limit).content/docs/automation/approvals.mdx:633-636— one sentence in "Timeouts and escalation"..changeset/approval-escalation-calendar-clock.md—@objectstack/specpatch (published contract text). No changeset for@objectstack/plugin-approvals: comment + test only.Mechanical companion:
content/docs/permissions/system-context.mdxis re-anchored bynode scripts/check-system-context-census.mjs --fix(the JSDoc in item 2 shifted every latercontext.isSystemanchor inapproval-service.ts; re-done from the merged tree after mergingorigin/main, as the os-regen pre-commit hook required).Declared cross-domain limb
packages/plugins/plugin-approvalsis adomain:servicespackage. This PR touches it with a JSDoc and a new test file only — no runtime logic changes — as the ruling's "pin the one runtime site" leg; the services seat is named on the claim amendment for #13801.Not in this PR (the other two limbs, both open)
skills/**is a governed surface and is not touched here.Gates — derived union on the final head
git rev-parse --short HEAD=fb5c8a4a3(branch merged withorigin/mainat9c7d9d4b3viascripts/pm/os-regen-merge.sh; the census page regenerated afterwards as its own commit). Union derived withnode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon that head (74 commands; stderr line: "gate list derived from the tree of 'objectstack-ai/objectstack' at commit fb5c8a4"), each exit captured to a file before any pipe.Must-haves, under
scripts/pm/os-verify-lock.sh(VERDICT linescommand-exit 0):pnpm --filter @objectstack/spec typecheck— exit 0 (check:test-typecheck: OK — 54 file(s) / 262 error(s) / 146 pinned signature(s)), sha fb5c8a4.pnpm --filter @objectstack/plugin-approvals typecheck— exit 0 (check:test-typecheck: OK — 8 file(s) / 324 error(s) / 27 pinned signature(s);tsc -p tsconfig.test.json --listFileslists the new test file, so the test-typecheck leg measured it), sha fb5c8a4.pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/approval-service-sla-calendar-clock.test.ts src/approval-service.test.ts—Test Files 2 passed (2) · Tests 303 passed (303), sha fb5c8a4.pnpm --filter @objectstack/spec check:generated— exit 0, 0 stale artifacts;pnpm check:doc-authoring— exit 0 (14496 customer-facing string(s) across 705 spec sources clean);pnpm check:nul-bytes— exit 0 (7922 tracked, no raw ASCII control bytes);node scripts/check-system-context-census.mjs— exit 0 (145 anchors resolve);pnpm check:objectql-double-limit— exit 0 (305 double(s) graded);pnpm check:quick-reference-counts— exit 0.Union: 68 of 74 green on fb5c8a4. The other six exited with their own PREREQUISITE-NOT-MET / NOT-MEASURED text and are recorded as NOT MEASURED, not red (each names the unbuilt workspace or a missing CI log as its precondition; CI owns those runs):
node scripts/check-dev-prereqs.mjs(exit 1, "45 of 67 workspace packages declare an entry point under dist/ that is not on disk"),node scripts/check-test-completeness.mjs(exit 3, needs a savedturbo run testlog),pnpm --filter @objectstack/spec run check:skill-examples(exit 1,packages/client-react/distnot built),pnpm check:dual-build-cjs-loads(exit 3),pnpm check:i18n(exit 1, "Nothing was checked" — dist closure missing),pnpm check:type-check-debt(exit 3).Two reds surfaced by a first pass on the pre-merge tree and fixed before the final head:
check:objectql-double-limit(the new test'sfinddouble was limit-blind → applies the bound by presence) andcheck-system-context-census(line rot from the JSDoc →--fix). One declared caveat: the plugin-approvals readings ran againstpackages/objectqlandpackages/runtimedist built from pre-merge sources (the nine upstream commits touched theirsrc; my rebuild filter mis-cut top-level package dirs and skipped them) — neither package is imported by the two suites run, and the CI build is the authoritative run.Relay: sibling on the same file
After the merge at
9c7d9d4b3,origin/mainadvanced 14 more commits at PR time; none touchedapproval.zod.tsor its generated products (git log 9c7d9d4b3..origin/main -- packages/spec/src/automation/approval.zod.tsis empty; #13809 has not landed). The only watched path that moved iscontent/docs/permissions/system-context.mdx(953a81f, one anchor line), which the queue's pre-commit regen re-derives; a second resync was not chased so the branch stops moving.Session: https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
🤖 Generated with Claude Code
https://claude.ai/code/session_01GDA48PuRFrHyRfdkBz8m21
Generated by Claude Code