Skip to content

docs(views): name the priorities the SLA-at-risk filter actually selects - #1340

Merged
os-trump merged 1 commit into
mainfrom
claude/issue-1333-case-priority-vocabulary
Aug 27, 2026
Merged

docs(views): name the priorities the SLA-at-risk filter actually selects#1340
os-trump merged 1 commit into
mainfrom
claude/issue-1333-case-priority-vocabulary

Conversation

@os-trump

Copy link
Copy Markdown
Collaborator

Fixes #1333

The sla_at_risk JSDoc on crm_case named a priority the object does not have.

src/views/case.view.ts:233   /** SLA-at-risk: open, high/urgent priority cases needing attention */
src/objects/case.object.ts:138-142   low · medium · high · critical      ⇒ there is NO `urgent`
src/views/case.view.ts (filter)      { field: 'priority', operator: 'in', value: ['high', 'critical'] }

urgent is crm_task vocabulary. The comment now names High and Critical — what the filter
actually selects — and records why the two vocabularies have to stay apart, because this is the
second time they have crossed in prose and the first time cost something real.

Comment only. No filter, option list or colour key changed; the code was correct on both sides.

The two-directional sweep

The card asked for the crossing to be swept in both directions across src/, with a control
proving the search reached the code. Surface: all 170 files under src/ — 166 .ts plus the 4
.md under src/docs/. Discriminating terms are the values the two vocabularies do not share:
critical/medium are Case-only, urgent/normal are Task-only.

Controls (a zero is not a finding until these are non-zero):

control expectation reading
critical inside Case-domain files non-zero 57 hits
urgent inside Task-domain files non-zero 25 hits

Both positive, so the scan demonstrably reached the code.

Direction A — Task-only values (urgent, normal) in a Case context — 7 raw hits, 1 real:

site verdict
src/views/case.view.ts:233 THE DEFECT — names urgent as a crm_case priority. Fixed here.
src/objects/case.hook.ts:386 ✅ correct — priority: 'urgent' inside api.object('crm_task').insert(...), a Task record
src/objects/case.hook.ts:346 ✅ correct — prose about task rows in All Tasks
src/objects/case.hook.ts:171 ✅ correct — deliberate cross-reference naming the difference (medium vs normal)
src/flows/case-escalation.flow.ts:118 ✅ correct — prose about the priorities of two competing tasks
src/docs/crm_service.md:60 ✅ correct — describes the urgent task created on escalation
src/flows/case-csat-followup.flow.ts:27 ✅ not a value — the English phrase "the NORMAL path"

Direction B — Case-only values (critical, medium) in a Task context — 2 raw hits, 0 real:

site verdict
src/views/task.view.ts:35 ✅ correct — the source record of the already-fixed mirror crossing
src/objects/task.hook.ts:54 ✅ correct — deliberate cross-reference ("The vocabularies differ (normal vs medium)")

Code-side crossings: zero. Every priority: literal in src/ was read together with its
enclosing api.object(...) / objectName: / defineSeed(...) binding, including both blocks of
src/data/service.seed.ts — the tasks seed (urgent/normal/high/low) and the cases seed
(critical/medium/high/low) each use their own vocabulary. severity: 'critical' on the notify
nodes is a notification-severity vocabulary, not a priority. Nothing to stop and report.

case.view.ts:233 was the only live crossing in either direction. The two comments that
legitimately name the other object's values both do so to state the contrast explicitly, which is
the pattern this fix follows.

Verification

pnpm verify — the whole &&-joined chain — green on the final commit 809ef5f, tree clean at
measurement time:

os-verify-lock: VERDICT command-exit 0 · held the lock 137s (2m17s) · waited 0s
  ✓ Validation passed          ✓ i18n lint gate: 0 `i18n/missing-*` issues
  ✓ source hygiene clean       ✓ source token ratchet clean
  Test Files  142 passed (142)
      Tests  2997 passed | 1 skipped (2998)

Token ratchet coupling, measured rather than assumed. case.view.ts sits inside the
interaction layer the ratchet measures, so the claim that a comment edit cannot move it was tested
directly: the base version of the file was checked out over the branch version, the mutation was
confirmed on disk (High or Critical → 0 hits, the old high/urgent JSDoc → 1 hit), and the
ratchet re-run. Both readings are byte-identical —

branch (809ef5f) : interaction layer  33 files  4,600  149,724  37,431 tokens
base   (08613ad) : interaction layer  33 files  4,600  149,724  37,431 tokens

— so the ratchet is comment-stripped as documented, and this PR adds 11 comment lines while moving
the reading by zero. The file was then restored and the restore proven three ways: git diff HEAD
empty, working-tree blob hash 9b9ae6e… equal to the HEAD blob hash, and git status clean.

Changeset

Empty frontmatter — the sanctioned "releases nothing" declaration. Prose only: no object, field,
view, label, filter, option list or colour key changed.

Generated by Claude Code


Generated by Claude Code

The `sla_at_risk` JSDoc on `crm_case` described the view as "open, high/urgent
priority cases". `crm_case.priority` is low/medium/high/critical — there is no
`urgent` on this object; that value belongs to `crm_task` — and the filter
underneath selects `['high', 'critical']`. The comment now names High and
Critical, matching what the code does.

It also records why the two vocabularies must stay apart. This is the second
time they have crossed in prose, and the first time cost something real: the
task view once carried Case colour keys (`critical`/`medium`), which left every
`urgent` and `normal` task row uncoloured (`src/views/task.view.ts:35`). The
direction that shipped a defect was the one where the comment was believed.

Comment only — no filter, option list or colour key changed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ED4cusQ7pxZ7d7TCLKrZb
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Aug 27, 2026 1:55am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

2 participants