Repository navigation
perf: 畳んだ報告の末尾注記の抜粋を新しい側の2本までに絞る(1,620 字 → 800 字) - #5414
Merged
Merged
Conversation
背景処理の完了待ちで畳んだ報告の抜粋は、直後の本報告と重なることが多いのに最大約1,700字を占めていた。 字数の予算を 1500 から 600 へ下げ、新しい側だけを残し、古い側は既存の「古い N 本の冒頭は字数の予算で省いた」の1行へ回す。 本数・最初と最後の時刻・全文が日誌に在ることは毎回出し、journal_read の引き方(q=managerId と since/until)を一言足す。 外へ出した成果(マージ・PR)を含む報告はそもそも畳まれず受信箱へ回るので、重要な本文を落とさない設計は崩れない。
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.
目的
トークン節約。「背景処理の完了待ちで畳んだターンの報告を N 本配っていない」の末尾注記は、直後の本報告と重なる抜粋で最大約 1,700 字を占めていた。
変更
WITHHELD_REPORT_LISTING_BUDGETを 1500 から 600 へ。240 字の行は新しい側の 2 本までが残り、古い側は既存の「古い N 本の冒頭は字数の予算で省いた。全文は日誌に在る」の 1 行へ回る(既存の落とす仕組みをそのまま使う)。積む時点の詰め(trimWithheldExcerpts)も同じ定数なので、台帳の写しも小さくなる。journal_read q=<managerId> since=最初の少し前 until=最後の少し後の引き方を一言足した(約 +45 字)。「少し」としたのは、日誌のexchangeが在庫を積む前に書かれ、untilが含まないため、端の時刻そのままだと両端の報告を外すから。case 'report'がtype: 'exchange'に全文(reportFullTextOf)を、畳む判定より前に書く。追加試験で、落ちた 1 本目の全文が日誌に在ることを確かめている。効く量
既存試験の fake で、240 字超(300 字)の報告を 6 本畳んだ後の本報告の末尾注記(「(この間に」以降)の字数。
差 約 -820 字。測りの生出力は一時ファイルで取り、リポジトリには残していない。
倒れ側
抜粋で見えていた古い側の 3〜4 本の冒頭が、
journal_readを引かないと見えなくなる。ただし:outwardActions)は、そもそも畳まれず受信箱へ回る(case 'report'の判定)。そのためrenderWithheldExcerptsの旧コメントの「マージの報告が後続で消える」は、最新 2 本に入らない場合でも、畳まれた側にはマージの報告が来ない構造になっている。excerptsのコメント)は保っている(2 本残る。上書きではない)。ただしoutwardActionsを取り逃がしたマージ報告が古い側に落ちる可能性は残る。その場合も本数と日誌の引き方は注記に出る。確認(revert 試験)
追加試験 2 本を、
manager.tsの本変更を退避した(origin/main の)状態で回すと両方落ちる。expected 1620 to be less than 900変更を戻すと、manager-withheld-reports / manager-flush-activity / manager の 3 ファイル 429 本が通る。既存試験は字面・予算に依存せず更新不要(assert は弱めていない)。build / typecheck / lint / format:check 通過。実時間待ちは使っていない。
他 PR との重なり
gh pr list --state openは #5412(usage 系。manager.ts に触れない)と #5344(docs のみ)。ALT-DEV-Y(mgr-b071b83c)の PR は開いていない。origin/perf/*に manager.ts を触る既存枝があるかは差分までは見ていない。docs
docs/に該当の語(畳んだ報告の冒頭・予算 1500)は無い(grep 0 件)。docs は編集していない。