Repository navigation
test(core): observe の attributes の上限は両端を含むことを縛る - #2093
Merged
Merged
Conversation
AttributesSchema(attributes.ts)に変異を当てたところ、上限を内側へ1つ締める3形(キー数を 16 未満にする・キー長を 63 までにする・値長を 255 までにする)と、空の値を断る形が、attributes に触れる core の試験29ファイルのどこでも赤にならなかった。既存の試験は上限を1つ超える側(17キー・65文字・257文字)しか見ていなかった。 約束はすでに書かれている。ADR 0312 の上限の表は、キー数を最大16、キー長を1〜64文字、値長を0〜256文字(空文字は許す)としている。attributes.ts の ATTRIBUTE_VALUE_MAX_LENGTH の TSDoc も、空文字は許すと書いている。締めるのは破壊的変更になる、と同じ ADR が書いている。 observe を通して、上限ちょうどと空の値が受け付けられ、Memory まで同じ値で届くことを見る。
takecchi
marked this pull request as ready for review
October 11, 2026 10:57
takecchi
enabled auto-merge (squash)
October 11, 2026 10:57
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.
変異の記録の地図(#1963)で「厚い(自動)」とされていた
packages/core/src/attributes.tsを照合したところ、直接の記録は PR #1360 の B5・B6(キーの文字種と最短)しか無かった。そこで変異を10形当てた。その結果、上限の内側の端が縛られていなかった。生き残っていた変異
AttributesSchemaに当てた。流したのは attributes に触れる core の試験29ファイル(1108件)。/を足す:を外す$を外す既存の試験は、上限を1つ超える側(17キー・65文字・257文字)しか見ていなかった。
約束はすでに書かれている
attributes.tsのATTRIBUTE_VALUE_MAX_LENGTHの TSDoc: 空文字は許す。足したもの
observe-attributes.test.tsに、observe を通して上限ちょうど(16キー・64文字のキー・256文字の値)と空の値が受け付けられ、Memory まで同じ値で届くことを見る4件を足した。変異で確かめたこと
observe-attributes.test.ts10件すべて緑。関連3ファイル(zod-schema-constraints-tsdoc-edges・observe-schema-rejects-before-writeを含む)45件すべて緑。