Session: you-are-a-senior-bright-bengio-subagent-aeffc046 — 2026-04-21

doctolib-doctolib · Claude · branch .invalid · claude-sonnet-4-6 · 2026-04-21 08:03 · 1 msgs · 25 tools · 15 min read · updated 2 weeks ago

Analyze the test coverage quality and completeness for PR #240065 on the...

tools: Bash, Read
← doctolib-doctolib Download .md .txt .json
Tool calls
Bash Bash: 13 calls (52.0%) 13 Read Read: 12 calls (48.0%) 12
Token usage857.7K total
Input37
Cache creation60.7K
Cache read792.1K
Output4.9K
Cache hit ratio93%· healthy

Project: doctolib-doctolib · Branch: .invalid · Mode: ` · **Model:**claude-sonnet-4-6`

Stats: 1 user messages, 25 tool calls, tools used: Bash, Read.

Conversation

Turn 1 — User

Analyze the test coverage quality and completeness for PR #240065 on the fhir-2208_fix-document-category-filter-options branch of the monolith repo at /Users/USER/workspace/doctolib/doctolib.

Context

This PR fixes the DMP Document Category filter/column in packages/@doctolib/national-health-records. Key domain facts: - DMP_CLASS_CODES: 9 DMP class codes (JDV_J07 ANS value set) — what the DMP API's categories field expects - DMP_CLASS_CODE_LABELS: French labels derived from LOINC_CODES_TO_KIND; 60568-3 uses a hardcoded fallback since it's absent from that map - DMP_CATEGORY_OPTIONS: the 9 filter options built from DMP_CLASS_CODES/DMP_CLASS_CODE_LABELS, sorted alphabetically in French locale - createNhrDocumentCategoryColumn's getTypeCode prop must return a human-readable label (not a raw code); previously a silent no-op labelMap prop was passed instead

Files changed (all under packages/@doctolib/national-health-records/src/variants/dmp/)

Production code: - constants.tsDMP_CLASS_CODE_LABELS now derived from LOINC_CODES_TO_KIND + fallback for 60568-3 - factories/dmpCategoryOptions.ts — NEW: exports DMP_CATEGORY_OPTIONS built from DMP_CLASS_CODES - factories/filtersFactory.ts — passes DMP_CATEGORY_OPTIONS to createNhrDocumentCategoryFilterConfig - factories/columnsFactory.tsxgetTypeCode prop now resolves code → French label via DMP_CLASS_CODE_LABELS

Test files added/modified: - constants.test.ts — NEW - factories/dmpCategoryOptions.test.ts — NEW - factories/filtersFactory.test.ts — added mock + one new test - factories/columnsFactory.test.ts — replaced stale labelMap test with two behavioral tests

Please read all six test files and the four production files, then assess: 1. Whether the tests adequately cover the new functionality and edge cases 2. Whether any critical paths are untested 3. Test quality (isolation, specificity, false-positive risk) 4. Any gaps worth filling before merging

Turn 1 — Assistant

I'll start by reading all the relevant files in parallel to get a complete picture.

Tools used:

  • Bash: ls /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/

Tools used:

  • Bash: ls /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/factories/

Tool results:

→ result (ok): constants.test.ts constants.ts factories index.ts mappers useDmpDocumentListVariant.ts

Tool results:

→ result (ok): columnsFactory.test.ts columnsFactory.tsx dmpCategoryOptions.test.ts dmpCategoryOptions.ts filtersFactory.test.ts filtersFactory.ts

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/constants.ts

Tool results:

→ result (ok): 1 import { LOINC_CODES_TO_KIND } from 'monolith_DEPRECATED/models/document/fr/DocumentLoincCodesToKind' 2
3 // Real dmp:classCode values from JDV_J06/JDV_J07 ANS value set (DMP certification) 4 export const DMP_CLASS_CODES = [ 5 '11502-2', // CR d'examens biologiques (lab report) 6 '70004-7', // CR d'acte diagnostique – autre (diagnostic/imaging) 7 '11488-4', // CR ou fiche de consultation ou de visite (consultation report) 8 '11505-5', // CR d'acte thérapeutique – autre (therapeutic ac …(truncated, 1025 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/factories/dmpCategoryOptions.ts

Tool results:

→ result (ok): 1 import type { Option } from '@doctolib/design-system/Option' 2 import { DMP_CLASS_CODES, DMP_CLASS_CODE_LABELS } from '../constants' 3
4 export const DMP_CATEGORY_OPTIONS: Option[] = DMP_CLASS_CODES.map((code) => ({ 5 value: code, 6 label: DMP_CLASS_CODE_LABELS[code], 7 })).sort((a, b) => a.label.localeCompare(b.label, 'fr')) 8

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/factories/filtersFactory.ts

Tool results:

→ result (ok): 1 import { 2 type FilterConfig, 3 createNhrDateSelectionFilterConfig, 4 createNhrDocumentCategoryFilterConfig, 5 createNhrDocumentStatusFilterConfig, 6 createNhrDocumentVisibilityFilterConfig, 7 } from '@doctolib/tpf-national-health-records-ui' 8 import { DMP_CATEGORY_OPTIONS } from './dmpCategoryOptions' 9
10 type FiltersOptions = { 11 lastAccessDate?: string 12 } 13
14 export function filtersFactory({ lastAccessDate = '' }: FiltersOptions = {}): FilterConfig[] { 15 return [ 16
…(truncated, 1435 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/factories/columnsFactory.tsx

Tool results:

→ result (ok): 1 import type { ColumnConfig } from '@doctolib/tpf-national-health-records-ui' 2 import { 3 createNhrDocumentCategoryColumn, 4 createNhrDocumentNameColumn, 5 createNhrProcedureDateColumn, 6 createNhrShareDateColumn, 7 createNhrSharedByColumn, 8 createNhrStatusColumn, 9 createNhrVisibilityColumn, 10 } from '@doctolib/tpf-national-health-records-ui' 11 import { DOCUMENT_STATUS } from '@doctolib/dmp' 12 import type { DesignSystemIconComponent } from '@doctolib/design-system-icons' 13
…(truncated, 2473 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/constants.test.ts

Tool results:

→ result (ok): 1 import { DMP_CLASS_CODES, DMP_CLASS_CODE_LABELS } from './constants' 2
3 describe('DMP_CLASS_CODE_LABELS', () => { 4 it('has an entry for every code in DMP_CLASS_CODES', () => { 5 for (const code of DMP_CLASS_CODES) { 6 expect(DMP_CLASS_CODE_LABELS[code]).toBeDefined() 7 } 8 }) 9
10 it('pulls French labels from LOINC_CODES_TO_KIND for codes present in that map', () => { 11 expect(DMP_CLASS_CODE_LABELS['11502-2']).toBe("CR d'examens biologiques") 12 expect(DMP_CLAS …(truncated, 500 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/factories/dmpCategoryOptions.test.ts

Tool results:

→ result (ok): 1 import { DMP_CLASS_CODES } from '../constants' 2 import { DMP_CATEGORY_OPTIONS } from './dmpCategoryOptions' 3
4 describe('DMP_CATEGORY_OPTIONS', () => { 5 it('has exactly one option per DMP class code', () => { 6 expect(DMP_CATEGORY_OPTIONS).toHaveLength(DMP_CLASS_CODES.length) 7 }) 8
9 it('each option has a non-empty string value and label', () => { 10 for (const option of DMP_CATEGORY_OPTIONS) { 11 expect(typeof option.value).toBe('string') 12 expect(option.value …(truncated, 664 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/factories/filtersFactory.test.ts

Tool results:

→ result (ok): 1 import { filtersFactory } from './filtersFactory' 2
3 jest.mock('./dmpCategoryOptions', () => ({ 4 DMP_CATEGORY_OPTIONS: [ 5 { value: '11488-4', label: 'CR ou fiche de consultation ou de visite' }, 6 { value: 'CERT_DECL', label: 'Certificat, déclaration' }, 7 ], 8 })) 9
10 jest.mock('@doctolib/tpf-national-health-records-ui', () => ({ 11 createNhrDocumentCategoryFilterConfig: jest.fn(), 12 createNhrDateSelectionFilterConfig: jest.fn(), 13 createNhrDocumentStatusFilterConfig …(truncated, 5159 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/factories/columnsFactory.test.ts

Tool results:

→ result (ok): 1 import { createNhrDocumentCategoryColumn } from '@doctolib/tpf-national-health-records-ui' 2 import { DMP_CLASS_CODE_LABELS } from '../constants' 3 import { columnsFactory } from './columnsFactory' 4
5 jest.mock('@doctolib/dmp', () => ({ 6 DOCUMENT_STATUS: { 7 validated: 'validated', 8 obsolete: 'obsolete', 9 archived: 'archived', 10 }, 11 })) 12
13 jest.mock('../mappers/dmpDocumentHelpers', () => ({ 14 getTypeCode: jest.fn(), 15 getProcedureDate: jest.fn(), 16 getShare …(truncated, 2983 more chars)

Now let me look at the source dependencies and mappers to fully understand what's being tested.

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/mappers/dmpDocumentHelpers.ts

Tool results:

→ result (ok): 1 import type { NhrDocument } from '@doctolib/tpf-national-health-records' 2 import type { NhrVisibilityEntry } from '@doctolib/tpf-national-health-records-ui' 3 import { DOCUMENT_STATUS, DOCUMENT_VISIBILITY } from '@doctolib/dmp' 4
5 const DMP_SYSTEM = 'dmp:classCode' 6 const PATIENT_CODE = '90' // EX_3.1-1040: class code for patient-authored documents 7
8 export const getTypeCode = (doc: NhrDocument): string | undefined => 9 doc.classification?.codes.find((c) => c.system === DMP_SYSTEM)?.c …(truncated, 2367 more chars)

Tools used:

  • Bash: find /Users/USER/workspace/doctolib/doctolib -path "*/models/document/fr/DocumentLoincCodesToKind*" 2>/dev/null | head -5

Tool results:

→ result (ok): /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/models/document/fr/DocumentLoincCodesToKind.ts /Users/USER/workspace/doctolib/doctolib/.claude/worktrees/crazy-volhard/app/assets/javascripts/models/document/fr/DocumentLoincCodesToKind.ts

Tools used:

  • Bash: grep -n "60568-3\|11502-2\|70004-7\|11488-4\|11505-5\|34112-3\|11369-6\|34874-8\|REMB" /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/models/document/fr/DocumentLoincCodesToKind.t …(truncated, 12 more chars)

Tool results:

→ result (ok): 9: 'REMB', 26: '11369-6', 27: '11488-4', 29: '34112-3', 30: '11502-2', 31: '11505-5', 42: '34874-8', 55: '70004-7', 134: REMB: { 135: code: 'REMB', 219: '11369-6': { 220: code: '11369-6', 224: '11488-4': { 225: code: '11488-4', 234: '34112-3': { 235: code: '34112-3', 239: '11502-2': { 240: code: '11502-2', 244: '11505-5': { 245: code: '11505-5', 299: '34874-8': { 300: code: '34874-8', 364: '70004-7': { 365: code: '70004-7',

Tools used:

  • Bash: git log --oneline -10 -- "packages/@doctolib/national-health-records/src/variants/dmp/"

Tool results:

→ result (ok): e14da5390963 chore(FHIR-2208): add tests for DMP_CLASS_CODE_LABELS and DMP_CATEGORY_OPTIONS 10385f4b6a36 chore(FHIR-2208): restrict DMP category filter to class codes matching the column 69fd45b52a2c chore(FHIR-2208): derive DMP_CLASS_CODE_LABELS from LOINC_CODES_TO_KIND for label consistency 872db7d4c5b6 chore(FHIR-2208): add explicit Option[] annotation to DMP_CATEGORY_OPTIONS 049c14dcb22c chore(FHIR-2208): populate Document Category filter with DMP LOINC options e8751c790841 feat(HAPI-4540): …(truncated, 55 more chars)

Tools used:

  • Bash: grep -A 5 "'REMB'\|'11369-6'\|'11488-4'\|'34112-3'\|'11502-2'\|'11505-5'\|'34874-8'\|'70004-7'" /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/models/document/fr/DocumentLoincCode …(truncated, 42 more chars)

Tool results:

→ result (ok): displayName: 'Données de remboursement', displayName: 'Historique de vaccinations', displayName: 'CR ou fiche de consultation ou de visite', displayName: 'CR hospitalier (séjour)', displayName: "CR d'examens biologiques", displayName: "CR d'acte thérapeutique (autre)", displayName: 'CR opératoire', displayName: "CR d'acte diagnostique (autre)",

Tools used:

  • Bash: grep -n "displayName" /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/models/document/fr/DocumentLoincCodesToKind.ts | head -20

Tool results:

→ result (ok): 94: displayName: string 101: displayName: "CR de bilan d'évaluation de la perte d'autonomie", 106: displayName: 'Certificat, déclaration', 111: displayName: 'Dispensation (autre)', 116: displayName: 'Volontés et droits du patient', 121: displayName: 'Autre document du patient', 126: displayName: 'Directives anticipées', 131: displayName: 'Protocole de soins ALD', 136: displayName: 'Données de remboursement', 141: displayName: 'Synthèse', 146: displayName: 'Synthèse …(truncated, 565 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/models/document/fr/DocumentLoincCodesToKind.ts (215–295)

Tool results:

→ result (ok): 215 code: 'PRESC-ORTHOPTIE', 216 displayName: "Prescription d'actes d'orthoptie", 217 doctolib_kind: 'paramedics_prescription', 218 }, 219 '11369-6': { 220 code: '11369-6', 221 displayName: 'Historique de vaccinations', 222 doctolib_kind: 'other', 223 }, 224 '11488-4': { 225 code: '11488-4', 226 displayName: 'CR ou fiche de consultation ou de visite', 227 doctolib_kind: 'report', 228 }, 229 '11490-0': { 230 code: '11490-0', 231 displayName: …(truncated, 1874 more chars)

Tools used:

  • Bash: grep -n "'34874-8'\|'70004-7'" /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/models/document/fr/DocumentLoincCodesToKind.ts

Tool results:

→ result (ok): 42: '34874-8', 55: '70004-7', 299: '34874-8': { 300: code: '34874-8', 364: '70004-7': { 365: code: '70004-7',

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/models/document/fr/DocumentLoincCodesToKind.ts (298–308)

Tool results:

→ result (ok): 298 }, 299 '34874-8': { 300 code: '34874-8', 301 displayName: 'CR opératoire', 302 doctolib_kind: 'report', 303 }, 304 '47420-5': { 305 code: '47420-5', 306 displayName: 'CR de bilan fonctionnel (par auxiliaire médical)', 307 doctolib_kind: 'report',

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/models/document/fr/DocumentLoincCodesToKind.ts (363–373)

Tool results:

→ result (ok): 363 }, 364 '70004-7': { 365 code: '70004-7', 366 displayName: "CR d'acte diagnostique (autre)", 367 doctolib_kind: 'report', 368 }, 369 '75468-9': { 370 code: '75468-9', 371 displayName: 'Renouvellement ordonnance par pharmacien correspondant', 372 doctolib_kind: 'other',

Now I have everything I need. Let me also check one critical detail — the constants.test.ts imports path (it uses ./constants but it's in the parent directory):

Tools used:

  • Bash: head -3 /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/constants.test.ts

Tool results:

→ result (ok): import { DMP_CLASS_CODES, DMP_CLASS_CODE_LABELS } from './constants'

describe('DMP_CLASS_CODE_LABELS', () => {

Tools used:

  • Bash: ls /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/

Tool results:

→ result (ok): constants.test.ts constants.ts factories index.ts mappers useDmpDocumentListVariant.ts

Good - constants.test.ts is in the same directory as constants.ts, so the ./constants import is correct. Now let me check if any prior test file existed for columnsFactory and whether the getTypeCode fallback path (unknown code) is tested:

Tools used:

  • Bash: git show HEAD~5:packages/@doctolib/national-health-records/src/variants/dmp/factories/columnsFactory.test.ts 2>/dev/null || echo "NOT FOUND"

Tool results:

→ result (ok): import { createNhrDocumentCategoryColumn } from '@doctolib/tpf-national-health-records-ui' import { DMP_CLASS_CODE_LABELS } from '../constants' import { columnsFactory } from './columnsFactory'

jest.mock('@doctolib/dmp', () => ({ DOCUMENT_STATUS: { validated: 'validated', obsolete: 'obsolete', archived: 'archived', }, }))

jest.mock('../mappers/dmpDocumentHelpers', () => ({ getTypeCode: jest.fn(), getProcedureDate: jest.fn(), getShareDate: jest.fn(), getAuthorName: jest. …(truncated, 2090 more chars)

Tools used:

  • Bash: git log --oneline -5 -- "packages/@doctolib/national-health-records/src/variants/dmp/factories/columnsFactory.test.ts"

Tool results:

→ result (ok): 69fd45b52a2c chore(FHIR-2208): derive DMP_CLASS_CODE_LABELS from LOINC_CODES_TO_KIND for label consistency e8751c790841 feat(HAPI-4540): Provide a url parameter for isBrowser=boolean (#239801)

Now I have a thorough picture. Let me do one final check to understand the exact behavior of getTypeCode for an unknown code (the passthrough fallback):

Tools used:

  • Bash: grep -n "DMP_CLASS_CODE_LABELS\|loincLookup\|LOINC_FALLBACK" /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/constants.ts

Tool results:

→ result (ok): 18:const loincLookup = LOINC_CODES_TO_KIND as Record<string, { displayName: string } | undefined> 21:const LOINC_FALLBACK_LABELS: Partial<Record<string, string>> = { 25:export const DMP_CLASS_CODE_LABELS: Record<DmpClassCode, string> = Object.fromEntries( 26: DMP_CLASS_CODES.map((code) => [code, loincLookup[code]?.displayName ?? LOINC_FALLBACK_LABELS[code] ?? code])

I now have a complete picture of all six files. Here is the full analysis.


Summary

The test coverage is solid for a change of this scope. The critical path that was broken before (passing labelMap as a silent no-op instead of a functioning getTypeCode prop) is now properly exercised, and the new data-building modules (constants.ts, dmpCategoryOptions.ts) have dedicated, well-focused test files. There are no critical showstoppers, but there is one notable gap with a real regression risk, one behavioral hole in columnsFactory.test.ts, and a handful of minor issues worth noting.


Critical Gaps

1. getTypeCode passthrough for an unknown-but-present code — Criticality: 7

The production code in columnsFactory.tsx (line 40) includes this expression:

(DMP_CLASS_CODE_LABELS as Record<string, string | undefined>)[code] ?? code

When getTypeCode from dmpDocumentHelpers returns a non-undefined value that is not a key in DMP_CLASS_CODE_LABELS (e.g. a legacy code like '11526-1' or 'CERT_DECL' that the DMP API may legitimately return), the UI falls back to rendering the raw code string. This is the original bug the PR is fixing — the entire point is that users should see French labels, not raw codes.

The existing test for "resolves a class code to its French label" only exercises a known code (11488-4). The test for undefined return is also covered. But the case where getTypeCode returns an unknown code string (not undefined) is completely untested. This path silently renders a raw code in the UI — exactly the problem this PR set out to prevent.

A test to add in /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/national-health-records/src/variants/dmp/factories/columnsFactory.test.ts:

it('getTypeCode prop falls back to the raw code when code is not in DMP_CLASS_CODE_LABELS', () => {
  const { getTypeCode: mockGetCode } = jest.requireMock('../mappers/dmpDocumentHelpers')
  mockGetCode.mockReturnValue('UNKNOWN-CODE')

  columnsFactory()
  const [{ getTypeCode: getTypeCodeProp }] = (createNhrDocumentCategoryColumn as jest.Mock).mock.calls[0]

  expect(getTypeCodeProp({})).toBe('UNKNOWN-CODE')
})

This makes the fallback behavior explicit and ensures it does not accidentally become undefined in a future refactor.


Important Improvements

2. constants.test.ts asserts hardcoded expected values for only 2 of 9 codes — Criticality: 5

The test at line 10–13 of constants.test.ts spot-checks 11502-2 and 11488-4 against their exact French labels. Eight other codes (70004-7, 11505-5, 34112-3, 11369-6, 34874-8, REMB, 60568-3 [covered separately]) are not explicitly asserted.

There is a real regression risk here: if LOINC_CODES_TO_KIND were to change a displayName for any unchecked code (e.g. '34112-3' changing from 'CR hospitalier (séjour)' to something else), the tests would not catch the label drift. The test "never falls back to a raw code string" (line 19) would still pass because any non-empty string satisfies it.

The 60568-3 fallback is well-tested individually. Adding one extra assertion per unchecked code (or a full snapshot of the nine entries) would lock in the contract with LOINC_CODES_TO_KIND.

3. dmpCategoryOptions.test.ts does not assert that value fields are the actual DMP class codes — Criticality: 5

The test "each option has a non-empty string value and label" (line 9–16) only checks typeof option.value === 'string'. The test "contains every DMP class code as an option value" (line 23–28) does check containment in both directions, which partially covers this. However, value is not explicitly asserted to equal the corresponding DMP_CLASS_CODES entry — only that all codes appear somewhere in the values array. If the mapping accidentally swapped value and label, the containment test would still pass because the labels are not codes. This is a low-probability issue but worth noting.

4. filtersFactory.test.ts — mock passes a non-DMP option value — Criticality: 3

The mock at line 3–8 includes { value: 'CERT_DECL', label: 'Certificat, déclaration' }, which is not a real DMP class code. The test at line 49–55 (creates a category filter with a non-empty options array) inspects only structural shape, not actual content. This is fine for the factory wiring test, but a reader might be confused about why CERT_DECL appears in a DMP-specific test. Using a real DMP code as the second option would make the mock self-documenting without any test logic change.


Test Quality Issues

Most of the 13 tests cover the date, status, and visibility filters (fromLabel, toLabel, visibilityModes[0].label, etc.) which are not changed in this PR. These tests are testing the inputs to static mock functions; they would never catch a real regression because the mock returns whatever mockReturnValue gives regardless of the inputs. They do document intent, but they're testing expect.objectContaining against hardcoded strings that are just echoes of the production source — they'll only ever fail if the production code's string literal is copy-pasted into the test differently. These tests are overly coupled to the exact label text, and changes to labels (e.g. i18n migration) will require updating both source and test without any actual behavioral difference being caught.

The new test "creates a category filter with a non-empty options array" (line 49–55) is the most valuable new addition in filtersFactory.test.ts because it tests the wiring contract (options actually flow from DMP_CATEGORY_OPTIONS) rather than implementation details.

6. columnsFactory.test.ts dropped the labelMap test without a documented note explaining why — Criticality: 2

The old test 'passes DMP_CLASS_CODE_LABELS as labelMap to createNhrDocumentCategoryColumn' was removed because labelMap is no longer passed — getTypeCode is used instead. This is correct, and the two new behavioral tests for getTypeCode directly replace it. No concern here on correctness, just noting that a comment in the test file (e.g. // labelMap is no longer passed; label resolution happens inside getTypeCode) would make the intentional removal obvious to future reviewers rather than appearing as an accidental omission.


Positive Observations

  • The constants.test.ts test "never falls back to a raw code string as a label" (line 19–23) is the single most valuable test in the PR. It is a contract-level assertion that will catch the original bug if any code loses its label mapping in the future, regardless of which specific label is affected.

  • The dmpCategoryOptions.test.ts test for French alphabetic sort order (line 18–21) correctly re-sorts and compares, rather than asserting a hardcoded order. This is resilient to future additions to DMP_CLASS_CODES.

  • The mocking strategy in columnsFactory.test.ts is clean: dmpDocumentHelpers.getTypeCode is mocked so tests exercise only the getTypeCode closure defined in columnsFactory.tsx — this is proper behavioral isolation.

  • The beforeEach pattern in filtersFactory.test.ts with restoreMocks:true awareness is a good defensive move that prevents cross-test contamination.

  • The 60568-3 fallback label has its own dedicated test assertion (line 15–17 in constants.test.ts), which is exactly right given it is the single code whose label path diverges from all others.

Keyboard shortcuts

⌘K / Ctrl+KOpen command palette
/Focus search
g hGo to home
g pGo to projects
g sGo to sessions
j / kNext / prev row (tables)
?Show this help
EscClose dialogs

Structured queries

Mix key:value filters with free text in the palette:

type:sessionOnly session pages
project:llm-wikiFilter by project name (substring)
model:claudeFilter by model name (substring)
date:>2026-03-01Sessions after a date
date:<2026-04-01Sessions before a date
tags:rustPages mentioning a tag/topic
sort:dateSort results by date (newest first)

Example: type:session project:llm-wiki date:>2026-04 sort:date