Lab numbers now follow the same cases as Cases and Tasks: a case the lab started itself is included, and a step already handed to another lab is not. Day labels stay inside the charts, the grid follows the dashboard width, and the progress rings share one thin stroke.
assertCanEditCases checks TAB_CASES_EDIT but threw PERMISSION_ACCESS_CASES —
"you do not have access to cases" — at a member who holds TAB_CASES_READ and can
open and read every case. It sent them to the wrong setting. Nine call sites:
start, delete, assign, external code, important flag and the rest.
assertCanReadCases (:1378) keeps PERMISSION_ACCESS_CASES, which is accurate
there, and so do both lab-case-activity.service.ts sites — those check READ.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cases was the one feature with no edit-specific error code, so cases.service.ts
throws PERMISSION_ACCESS_CASES for a failed read check (:1375) and for a failed
edit check (:1391) alike. The lab voice branch checks TAB_CASES_EDIT, so reusing
it told a member holding TAB_CASES_READ "you do not have access to cases" — false,
and it points them at the wrong setting.
All three layers: the code in error-codes.ts, the throw in assertCanDictate, and
errors.PERMISSION_EDIT_CASES in en, fa and nl.
The two voice.service.spec cases asserting the old code failed on the change and
were updated — they are the guard that caught it.
cases.service.ts:1391 has the same mismatch and is left alone; it is an existing
endpoint's message, not this task's.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a lab-mode narrowing of the catalog for voice extraction,
lab case line draft/apply helpers, and a shared review sheet reused
by both treatment and lab case flows.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI installs via local Verdaccio and prefers Gitea copies of node/postgres/nginx so staging and prod can still ship when Docker Hub and npmjs are unreachable.
Lockfiles still pointed at registry.npmmirror.com after switching the
Docker registry, which caused ECONNRESET on victory-vendor during frontend builds.
Co-authored-by: Cursor <cursoragent@cursor.com>
Staging Docker builds were hanging ~25m then dying with Exit handler never
called because registry.npmjs.org resets TLS from the runner. Point npm ci
at npmmirror (rewrite lockfile tarball hosts for the build only).
Alpine npm ci kept dying with Exit handler never called on Docker
Desktop; nested retries only burned hours. Use Debian + a single
cached npm ci, and update the Gitea node image mirror.
Docker Desktop OOM can kill npm mid-install on the Windows staging
runner. Retry npm ci, then fall back to install, and document the
≥8GB RAM requirement.
Two reports from live dictation in fa.
The locale trigger vocabulary listed only verbs that ask for a note ("بنویس",
"یادداشت کن"). Naming the field itself — "توی یادداشتها بنویس", "در توضیحات" —
reported no commentTrigger, and the resolver discards a comment without one, so
the note was silently dropped. Added the field-name shape to fa, en and nl.
Where the dictated note ends was never stated, so the model answered it
inconsistently: "توی توضیحات بنویس سلام چطوری و بفرست برای لابراتوآر سانشاین"
sometimes put the lab dispatch inside the comment. Added a no-overlap rule — a
clause reported as a lab, tooth, prosthesis or deadline is an instruction and
must not appear in comment as well — with that sentence as a worked example.
Both rules go in the prompt and in the JSON-schema field descriptions, because
the schema description is what the model reads while filling the field. No code
enforcement for the second: stripping an extracted clause out of free-speech
note text by string matching is guesswork, and the review sheet shows the note
before it is saved.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The comment instruction told the model to sweep up leftovers: "clinical
notes, in the language spoken. Omit the parts already captured as treatment
type, teeth, prosthesis work or deadline." So filler, small talk and an
unrequested diagnosis all became a persisted clinical note — and comment is
the one durable trace a recording leaves (§10).
The model now reports the exact words that asked for the note in a new
commentTrigger field, and comment holds only what was dictated after them.
resolveVoiceIntent keeps comment only when a trigger is present, so the rule
is enforced by code instead of trusted to the prompt: a model that decides
leftover speech was a note loses that note.
Per-locale trigger vocabulary goes in the prompt's locale notes, beside the
tooth vocabulary — «بنویس که», "write this in the notes", "noteer". The
resolver only checks that a trigger was reported, so it needs no per-locale
knowledge and stays locale-neutral, as §6 requires.
Also adds HARD RULE 7: never decide something is a note; speech that fits no
field is simply not reported.
Four resolver tests. The two that drop an unasked note fail without the
guard; the trigger-only and trigger-with-note cases pass either way and exist
to prove the guard does not swallow a real note.
Frontend untouched — it only ever saw the resolved comment, never the
trigger.
Spec: §5 gains the rule and the field, decision 54 added.
Gates: backend 220 tests, nest build, ESLint clean on the voice module;
frontend tsc --noEmit clean, 52 Vitest tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>