Repository navigation
test(core): Memory の strength の値域は 0 を含まないことを、isStrengthInRange と schema の両方で縛る - #2097
Merged
Merged
Conversation
…ema の両方で縛る memory.ts に変異を当てたところ、isStrengthInRange の value > 0 を >= 0 にする形と、MemorySchema の strength の gt(0) を min(0) にする形が、memory.ts に触れる core の試験11ファイル(701件)のどこでも赤にならなかった。strength が 0 の入力を試す試験が無かった。 約束はすでに書かれている。Memory.strength の TSDoc と isStrengthInRange の TSDoc は、値域を (0, MAX_STRENGTH] とし、0 を含めない理由(status: 'forgotten' と同じことを言う道を2つ作らない)を書いている(ADR 0078)。0・Number.MIN_VALUE・MAX_STRENGTH の3点で、isStrengthInRange・MemorySchema・NewMemorySchema が同じ判定をすることを見る。
takecchi
marked this pull request as ready for review
October 11, 2026 12:14
takecchi
enabled auto-merge (squash)
October 11, 2026 12:14
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/memory.tsを照合したところ、直接の記録は薄かった(PR #98 のisStrengthInRangeの A1〜A3、#736・#764 の schema の数形)。そこで変異を15形当てた。そのうち4形が生き残り、2形は約束が書かれていた。この PR はその2形を塞ぐ。生き残っていた変異
流したのは memory.ts に触れる core の試験11ファイル(701件)。
isStrengthInRangeのvalue > 0をvalue >= 0にする(0 を通す)MemorySchemaのstrength: z.number().gt(0)をmin(0)にするstrength が 0 の入力を試す試験が無かった。(同じ回で生き残った M8〔空文字の tag を断る〕と M13〔
decayBaseSeqを整数に限る〕は、約束が書かれていないので塞がず、別の Issue にまとめる。)約束はすでに書かれている
Memory.strengthの TSDoc: 値域は(0, MAX_STRENGTH](ADR 0078)。isStrengthInRangeの TSDoc: 0 を含めないのは、strength = 0が「二度と引かれない」という意味になり、それはstatus: 'forgotten'がすでに表しているため。足したもの
memory.test.tsに、0(範囲外)・Number.MIN_VALUE(範囲内)・MAX_STRENGTH(範囲内)の3点で、isStrengthInRange・MemorySchema・NewMemorySchemaが同じ判定をすることを見る3件を足した。変異で確かめたこと
memory.test.ts22件すべて緑。isStrengthInRangeの行で赤。MemorySchemaの行で赤。