fix(service): carry the case SLA wall-clock unit in identifiers and one test, collapse the prose warnings to one - #1987
Merged
objectstack-fleet[bot] merged 3 commits intoOct 2, 2026
Conversation
…ot four prose copies The case SLA matrix is wall-clock (calendar) hours. Say it once, in the _case-sla.ts header; carry the unit in CASE_SLA_CALENDAR_HOURS, caseSlaCalendarHours and the hook-body slaCalendarHours literal; pin it with a fixed Friday 17:00 clock run through the shipped body; and tell the operator in the sla_due_date field description (and its four pack help strings). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ER8ntXZhYebyQ66aXWdjfT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ER8ntXZhYebyQ66aXWdjfT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ER8ntXZhYebyQ66aXWdjfT
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1974
The case SLA matrix is counted in calendar (wall-clock) hours. Until now the app said so in four dev-prose copies, and a test pinned two of them by regex. This PR says it once, carries the unit in names, pins it with a fixed clock, and tells the operator. It is the app half of objectstack-ai/objectstack#13801 (mechanism B). It makes no spec change and renames no published metadata key.
What changed
src/service/objects/_case-sla.tsmodule header keeps the warning and now also names where the unit lives. Four copies are deleted:case.hook.tsmodule-header bullet;case.hook.tscomment above the matrix literal;case.object.tscomment abovesla_due_date;celCaseSlaDuedoc comment insrc/service/data/service.seed.ts.CASE_SLA_HOURS→CASE_SLA_CALENDAR_HOURSandcaseSlaHours→caseSlaCalendarHours, both in_case-sla.ts.slaHours→slaCalendarHours.src/service/data/service.seed.ts,test/case-sla-matrix.test.tsandtest/seed-consistency.test.ts.test/case-sla-matrix.test.tsthe two-file prose regex is gone. In its place:vi.setSystemTimesets the clock to Friday 2026-10-02 17:00Z. The hook runs through its shipped body:runHookBodyexecutes the loweredbody.sourcein QuickJS, which is where production computes the deadline. A Critical case (4 h) is due Friday 21:00. A Medium case (48 h, smb column) is due Sunday 17:00. A Low case (168 h) is due the next Friday at 17:00.const slaCalendarHours. The body comes fromextractSandboxBody, which wraps the CLI's ownextractHookBody.sla_due_dategetsdescription: 'Set from the case priority and the account’s Customer Tier, in calendar hours: nights, weekends and holidays count.'. The same text is mirrored ashelpin the four locale packs.Premises measured
The card's line numbers predate the
src/PKG/move, so each premise was re-measured on the tree.Prose sites.
cf422b83the acceptance grep returned 7 lines in 3 files:_case-sla.ts4/20/23,case.hook.ts16/216/219 andcase.object.ts231.service.seed.ts:50-52). It spells the unitCALENDAR hours, so the case-sensitive grep misses it.test/case-guest-branch-leftovers.test.ts:140andtest/seed-consistency.test.ts:468. Each is a one-line unit note on a test's own value, not a copy of the no-business-hours warning.Where the operator text lives. Measured offline in the installed
@objectstack/console17.6.0:n.help||n.description(theplugin-formchunk).e.helpText??s.help??s.description.inlineHelpText.translateObject(@objectstack/spec/system) copies a pack'shelponto the served field ashelp.So in each locale the operator sees the pack's
help, with the inlinedescriptionas the fallback. That is the repo's existing convention, andtest/i18n-references.test.tsrequires every inlinedescriptionto have ahelpin all four packs.The handler clock.
case_sla_defaultsstampsnew Date(Date.now() + hours * 3_600_000). The seed'scelCaseSlaDueis a seed-time CEL expression (daysAgo(n) + duration('Nh')), not the runtime clock. The fixed-clock test therefore drives the hook's shipped body.Acceptance
Prose grep.
grep -rn "CALENDAR HOURS\|business-hours calendar" src/returns 3 lines, all in the_case-sla.tsheader: one site. The user-doc paragraph still exists atsrc/docs/crm_service.md:32-35. Its wording ("calendar hours, not business hours … no working-day calendar") does not match the grep.Build output. A deep JSON diff of
dist/objectstack.json, basecf422b83against head, finds exactly 6 changed leaf paths:objects[crm_case].fields.sla_due_date.description(new);translations[0].{en,zh-CN,ja-JP,es-ES}.objects.crm_case.fields.sla_due_date.help(new, four paths);hooks[case_sla_defaults].body.source.The
body.sourcechange is the identifier rename that work item 2 asks for. A probe replacedslaCalendarHourswithslaHoursin the head source and compared it with the base source: byte-identical (true). Comments never reachbody.source.Verification (HEAD
1e00b183)pnpm verifyunder the shared lock:os-verify-lock: VERDICT command-exit 0.✓ Validation passed1 warning(s), 16 suggestion(s), none oncrm_case✓ i18n lint gate: 0 i18n/missing-* issues✓ source hygiene clean✓ source token ratchet clean✓ Build completeTest Files 174 passed (174),Tests 3731 passed | 1 skipped (3732)src/servicebusiness semantics: ~12,601 → ~12,646 (ceiling 14,000).src/serviceauthored total: ~20,691 → ~20,736 (ceiling 22,000).src/serviceinteraction layer: unchanged at ~5,784.src/sales: unchanged at 54,323 / 28,003 / 97,805, because the packs are outside the ratchet.src/revenueandsrc/marketing: untouched.b85218e5throughablation-replace.mjs. The anchor must hit, and the restore is proven by a blob hash equal to HEAD and an emptygit diff HEAD.slaCalendarHours→slaHoursincase.hook.ts(2 hits) gaveTests 1 failed | 34 passed (35). Only the identifier check went red.Tests 3 failed | 32 passed (35). Only the three fixed-clock rows went red. The ±1 min matrix cells and the ±60 s elapsed-ms assertion stayed green, so the fixed-clock rows are the stricter check.Date-only fake clock reaches inside QuickJS. The real clock at run time was 22:04Z, which could not produce a Friday 21:00Z deadline.Acceptance notes (seen in passing, not fixed here)
Stale paths in comments. Pre-
src/PKG/paths remain in comments this PR does not otherwise rewrite:_case-sla.ts:18(src/views/account.view.ts) and:65(src/data/service.seed.ts);case.object.ts:203and:397;case.hook.ts:120;test/seed-consistency.test.ts:471.The path in the
case.object.tscomment abovesla_due_datesits in lines this PR rewrites, and it now reads./_case-sla.ts. This is comment drift only, and no one has taken it on.Token ceiling.
pnpm hygiene:tokenssuggests re-anchoring thesrc/salesinteraction-layer ceiling (headroom ~2,997). This PR does not touch that layer.Generated by Claude Code