@@ -294,6 +294,136 @@ test("data model detector ignores query-only and non-semantic docs changes", ()
294294 assert . deepEqual ( detection , { change : false , surfaces : [ ] } ) ;
295295} ) ;
296296
297+ test ( "data model detector ignores runtime repair, telemetry, and test vocabulary" , ( ) => {
298+ const detection = dataModelChangeFromPullFilesForTest ( {
299+ pullFiles : [
300+ {
301+ filename : "src/agents/embedded-agent-runner/run/code-mode-tool-call-repair.ts" ,
302+ patch : "@@\n+ return repairSmallModelToolCall(payload);" ,
303+ } ,
304+ {
305+ filename : "src/agents/tool-search-runtime.ts" ,
306+ patch : "@@\n+ const repaired = repairToolResult(result);" ,
307+ } ,
308+ {
309+ filename : "src/agents/tool-search-telemetry.ts" ,
310+ patch : "@@\n+ metadata: toolMetadata,\n+ cacheRead: usage.cacheRead," ,
311+ } ,
312+ {
313+ filename : "src/agents/code-mode-tool-input-repair.ts" ,
314+ patch : "@@\n+ return JSON.parse(candidate);" ,
315+ } ,
316+ {
317+ filename : "extensions/qa-lab/src/code-mode-model-matrix.options.test.ts" ,
318+ patch : "@@\n+ it('preserves cache fields', () => JSON.stringify(result));" ,
319+ } ,
320+ ] ,
321+ } ) ;
322+
323+ assert . deepEqual ( detection , { change : false , surfaces : [ ] } ) ;
324+ } ) ;
325+
326+ test ( "data model detector keeps explicit repair and persistence surfaces" , ( ) => {
327+ const detection = dataModelChangeFromPullFilesForTest ( {
328+ pullFiles : [
329+ {
330+ filename : "src/doctor/repair.ts" ,
331+ patch : "@@\n+ await repair(database);" ,
332+ } ,
333+ {
334+ filename : "src/cache/schema.ts" ,
335+ patch : "@@\n+ entryFingerprint: string;" ,
336+ } ,
337+ {
338+ filename : "src/runtime/checkpoint.ts" ,
339+ patch :
340+ "@@\n+ const raw = await readFile(checkpointPath, 'utf8');\n+ return JSON.parse(raw);" ,
341+ } ,
342+ {
343+ filename : "scripts/config-fixture.ts" ,
344+ patch :
345+ "@@\n+ await writeFile(configPath, JSON.stringify(config));\n+ return readFile(resultPath, 'utf8');" ,
346+ } ,
347+ ] ,
348+ } ) ;
349+
350+ assert . deepEqual ( detection , {
351+ change : true ,
352+ surfaces : [
353+ "migration/backfill/repair: src/doctor/repair.ts" ,
354+ "persistent cache schema: src/cache/schema.ts" ,
355+ "serialized state: src/runtime/checkpoint.ts" ,
356+ ] ,
357+ } ) ;
358+ } ) ;
359+
360+ test ( "data model detector keeps production snapshot schemas" , ( ) => {
361+ const detection = dataModelChangeFromPullFilesForTest ( {
362+ pullFiles : [
363+ {
364+ filename : "src/storage/snapshots/schema.sql" ,
365+ patch : "@@\n+ALTER TABLE snapshots ADD COLUMN format_version INTEGER;" ,
366+ } ,
367+ ] ,
368+ } ) ;
369+
370+ assert . deepEqual ( detection , {
371+ change : true ,
372+ surfaces : [ "database schema: src/storage/snapshots/schema.sql" ] ,
373+ } ) ;
374+ } ) ;
375+
376+ test ( "data model detector recognizes semantic prose forms" , ( ) => {
377+ const detection = dataModelChangeFromPullFilesForTest ( {
378+ pullFiles : [
379+ {
380+ filename : "docs/storage.md" ,
381+ patch :
382+ "@@\n+The cache version changes when persisted entries become incompatible.\n+The embedding dimension remains part of stored vector metadata." ,
383+ } ,
384+ ] ,
385+ } ) ;
386+
387+ assert . deepEqual ( detection , {
388+ change : true ,
389+ surfaces : [
390+ "persistent cache schema: docs/storage.md" ,
391+ "vector/embedding metadata: docs/storage.md" ,
392+ ] ,
393+ } ) ;
394+ } ) ;
395+
396+ test ( "data model detector recognizes compound persisted path identifiers" , ( ) => {
397+ const detection = dataModelChangeFromPullFilesForTest ( {
398+ pullFiles : [
399+ {
400+ filename : "src/runtime/load-checkpoint.ts" ,
401+ patch :
402+ "@@\n+ const raw = await readFile(checkpointFilePath, 'utf8');\n+ return JSON.parse(raw);" ,
403+ } ,
404+ {
405+ filename : "src/runtime/load-state.ts" ,
406+ patch :
407+ "@@\n+ const raw = await readFile(state_file_path, 'utf8');\n+ return JSON.parse(raw);" ,
408+ } ,
409+ {
410+ filename : "src/runtime/load-cache.ts" ,
411+ patch :
412+ "@@\n+ const raw = await readFile(cacheDirectoryPath, 'utf8');\n+ return JSON.parse(raw);" ,
413+ } ,
414+ ] ,
415+ } ) ;
416+
417+ assert . deepEqual ( detection , {
418+ change : true ,
419+ surfaces : [
420+ "serialized state: src/runtime/load-cache.ts" ,
421+ "serialized state: src/runtime/load-checkpoint.ts" ,
422+ "serialized state: src/runtime/load-state.ts" ,
423+ ] ,
424+ } ) ;
425+ } ) ;
426+
297427test ( "data model detector flags path-hinted persisted field declarations" , ( ) => {
298428 const detection = dataModelChangeFromPullFilesForTest ( {
299429 pullFiles : [
0 commit comments