Repository navigation
test(core): observe の入力で空文字を断ると約束した欄を、一覧のとおりに縛る - #2095
Merged
Merged
Conversation
ObserveInputSchema(observation.ts)に変異を当てたところ、utterance の externalId から min(1) を外す形が、observation.ts に触れる core の試験34ファイルと、observe を呼ぶ92ファイルのどこでも赤にならなかった。既存の対照の試験は、空文字を断ることを utterance.subjectId と memory_usage.recallId の2欄でしか見ていなかった。 約束はすでに書かれている。Ctx の TSDoc(ctx.ts)は、observe の入力 schema が空文字を ZodError にする欄を列挙している。subjectId・externalId(4種類すべての kind)、utterance の speaker、document の title、memory_usage の recallId、配列の要素としての subjectCandidates・usedMemoryIds である。この一覧のとおりに1欄ずつ見る。
takecchi
marked this pull request as ready for review
October 11, 2026 11:29
takecchi
enabled auto-merge (squash)
October 11, 2026 11:29
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.
packages/core/src/observation.tsのObserveInputSchemaに当てた変異のうち、空文字の扱いの1形を塞ぐ。生き残っていた変異
ObserveUtteranceInputSchemaのexternalId: z.string().min(1).optional()からmin(1)を外す(空文字の externalId を通す)。observation.ts に触れる core の試験34ファイル(805件)と、observe(を呼ぶ92ファイル(1269件)がすべて緑のままだった。既存の対照の試験(
observe-whitespace-only-ids-still-accepted.test.tsの「対照: 同じ欄でも、空文字は断る」)は、utterance.subjectIdとmemory_usage.recallIdの2欄しか見ていなかった。約束はすでに書かれている
Ctxの TSDoc(ctx.ts)は、observe の入力 schema が空文字をZodErrorにする欄を列挙している。subjectId・externalId(4種類すべてのkind。memory_usageはsubjectIdを持たない)、utteranceのspeaker・text、eventのname、documentのtitle・content、memory_usageのrecallIdsubjectCandidates・memory_usageのusedMemoryIdsなど足したもの
同じファイルに、この一覧の欄(本文の欄と、
claimKeyの入れ子の欄を除く12欄)を1欄ずつ空文字にして、断ることを見るit.eachを足した。本文の欄(text・name・content)は ADR 0502 の試験が、claimKeyのknownPredicates・knownSubjectsの空文字の要素はzod-schema-constraints-tsdoc-edges.test.tsが、すでに見ている。変異で確かめたこと
externalIdからmin(1)を外す: 4つの kind のexternalIdの試験だけが、それぞれ赤(4件)。4か所を同時に外し、落ちた試験の名前で1対1に対応することを確かめた。