opt(goal): minutes feeds do no word work; word rail goes count-only [cold-turkey-full-tokenization] #188

Merged
AlexKucera merged 4 commits from opt/cold-turkey-full-tokenization into main 2026-11-13 16:51:06 +01:00
Owner

User description

opt(goal): minutes feeds do no word work; word rail goes count-only

Finding — cold-turkey-full-tokenization

Unticketed digest finding (cold-turkey-full-tokenization, @argus opt pass 2026-11-09, scanned at efbde25c), implemented by @daedalus on opt/cold-turkey-full-tokenization.

The focused editor's per-keystroke feed drove whole-document word counting for every Cold Turkey goal type: PostEditorView.onTextChange → WritingLockState.feed (Museion/WritingLockState.swift:86) → WritingGoalRun.update (Museion/WritingGoal.swift:51 at base 5915178) → DraftStats.words → tokens(in:) (Museion/DraftStats.swift:112 at base) — split(whereSeparator:) + map(lowercased()), the full lowercased token array materialized per keystroke on the main actor. Minutes goals never read that count: isMet, progress, readout, and completionNoteText all ride the clock (consumer audit below). Before-cost, cited from the finding's probe (@argus, not re-measured here): ~0.32 / 3.07 / 16.64 ms per update at 1k / 10k / 50k words — linear in document size, per keystroke.

Fix (RED-first)

  • dde99c8 — pins first: injectable per-call word-rail seam on update(text:countWords:) (default = the real rail, repo's established seam style alongside spawnsTicker / injectable at:; a global counter would race the hosted parallel suite's DraftStats.compute calls) + the zero-trips pin, RED at base exactly as designed.
  • 9f4d9ef — fix: update guards on .words; a minutes run does zero word work on feed (its accounting freezes at the arm-time baseline — currentWords was dead state for minutes runs). DraftStats.words becomes a count-only Character pass over maximal isLetter/isNumber runs — no array, no lowercasing; equal by construction to the old split (omitting empty subsequences yields exactly the maximal runs).
  • 7de8e2f — devlog + docs. Main (2cfd8b9, post-#187) merged in at 7cd5e69; INDEX.md both-added-row resolved keep-both, newest-first.

Tests (+3, suite 681 → 684)

  • a minutes update takes zero word-rail trips — the complexity-class pin: O(document) → O(1) per feed.
  • a words update takes exactly one word-rail trip — the skip boundary, and the count lands.
  • word rail equals the split tokenizer over a mixed corpus — the old split expression kept alive as the inline reference: empty, whitespace-only, punctuation-only, Latin/diacritics/Cyrillic/CJK/Arabic, emoji-ZWJ, decimal/comma numbers, contiguous alnum runs.

Review verification (@athena, reviewer's own runs, fresh clone in the review seat)

  • Unit target (-only-testing:MuseionTests, -destination 'platform=macOS') at merge tip 7cd5e69: 689 executed / 689 passed / 0 failed — ** TEST SUCCEEDED **. Count drift vs the branch run (684 → 689) reconciled by test-name inventory diff: +5 are #187's LibrarySearchSnapshotTests from the main side; nothing lost.
  • Same target at reviewed branch tip 7de8e2f: 684/684 passed; all 3 new pins green.
  • swiftformat --lint .: 0 dirty (141 files). swiftlint: 279 violations / 60 serious in 141 files — identical counts to pristine base 5915178 (all pre-existing).
  • Merge structural proof: parents of 7cd5e69 verified = 7de8e2f + 2cfd8b9; git diff 2cfd8b9 7cd5e69 -- Museion/ MuseionTests/ byte-identical (cmp match) to the reviewed git diff 5915178 7de8e2f -- Museion/ MuseionTests/ — the merge contributed zero code bytes; the PR footprint vs main is exactly the branch's 7 files (165 insertions / 10 deletions); zero conflict markers in the tree.
  • Mergeability: git merge-tree --write-tree clean (exit 0) against trunk 2cfd8b9 — sign-off scoped to that trunk SHA; re-probe if main moves into this seam before merge.
  • Consumer audit (grep over Museion/ + MuseionTests/, patterns: update(text, currentWords, netNewWords|netWords, DraftStats.words|\.words(in): currentWords is read only by netNewWords; netNewWords is read only inside .words branches (isMet, progress, readout at WritingLockState.swift:158-164) — minutes paths never read word state, so the freeze is observationally identical. Every pre-existing update(text:) pin is a words run or asserts clock-only facts.

Evidence classes: reviewer's own runs above; implementer's devlog runs at 7de8e2f (684/684, lint identical — independently reproduced here); @argus before-probe quoted from the finding.

Unverified / scope

  • MuseionUITests target not run — neither in the handoff's gate nor in this review (unit target only).
  • The words-rail constant-factor gain is structural (no array, no lowercasing — by construction), not slope-measured in this review; the minutes-side win is a complexity-class elimination pinned by the zero-trips test.
  • Deliberately not folded in (correct scope): DraftStats.compute's store-time sentence-length tokenization still allocates per chunk — once per pass at capture, not per keystroke; separate finding if it ever shows hot.
  • Disjoint case vs #187 (zero code-file overlap; only the INDEX.md row).

Devlog: docs/devlog/20261113-cold-turkey-full-tokenization_log.md · CHANGELOG: [Unreleased] › Changed.

Reviewer: @athena — verdict clean (zero findings; round 1 at 7de8e2f full review, round 2 at 7cd5e69 structural merge proof). Alexander merges.

[Generated by AI]


PR Type

Enhancement, Tests, Documentation


Description

  • Skip per-keystroke word counting for minutes goals.

  • Count words without allocating lowercased token arrays.

  • Add counting-boundary and mixed-script equivalence tests.

  • Document optimization and verification results.


Diagram Walkthrough

flowchart LR
  edit["Editor text update"]
  goal["WritingGoalRun.update"]
  minutes["Minutes goal: skip word counting"]
  words["Words goal: count Character runs"]
  count["Update live word count"]
  edit --> goal
  goal -- "minutes" --> minutes
  goal -- "words" --> words
  words --> count

File Walkthrough

Relevant files
Enhancement
2 files
DraftStats.swift
Count word runs without building token arrays                       
+20/-2   
WritingGoal.swift
Skip minutes counting and inject word counter                       
+19/-8   
Tests
2 files
DraftStatsTests.swift
Verify count equivalence across mixed text corpus               
+37/-0   
WritingGoalTests.swift
Pin minutes skips and single word-count calls                       
+35/-0   
Documentation
3 files
CHANGELOG.md
Describe Cold Turkey word counting performance improvements
+2/-0     
20261113-cold-turkey-full-tokenization_log.md
Record optimization rationale and regression verification results
+51/-0   
INDEX.md
Index Cold Turkey word counting optimization log                 
+1/-0     


🛠️ Relevant configurations:


These are the relevant configurations for this tool:

[config]


max_webhook_request_body_bytes: 5242880
model: gpt-6.1-sol
fallback_models: [gpt-6-luna]
git_provider: gitea
publish_output: True
publish_output_progress: True
progress_gif_url: 
progress_gif_width: 48
verbosity_level: 0
use_extra_bad_extensions: False
log_level: INFO
use_repo_settings_file: True
use_global_settings_file: True
enable_per_directory_settings: False
per_directory_settings_max_files: 20
per_directory_settings_max_tree_pages: 10
disable_auto_feedback: False
ai_timeout: 120
retry_same_model_on_timeout: True
retry_same_model_on_length: False
custom_reasoning_model: False
response_language: en-US
repo_context_files: [AGENTS.md]
repo_context_from_default_branch: True
repo_context_max_lines: 500
repo_context_expand_imports: False
repo_context_max_glob_matches: 20
patch_extension_skip_types: [.md, .txt]
allow_dynamic_context: True
max_extra_lines_before_dynamic_context: 10
patch_extra_lines_before: 5
patch_extra_lines_after: 1
cli_mode: False
output_run_details: False
output_run_cost: False
large_patch_policy: clip
duplicate_prompt_examples: False
persistent_inline_comments: False
seed: -1
temperature: 0.2
ignore_pr_title: ['^\[Auto\]']
ignore_pr_target_branches: []
ignore_pr_source_branches: []
ignore_pr_labels: []
ignore_pr_authors: []
reaction_on_start: eyes
reaction_on_success: 
reaction_on_failure: 
ignore_repositories: []
ignore_language_framework: []
bot_user_indicators: [codium, bot_, bot-, _bot, -bot]
restricted_mode: False
is_auto_command: True
propagate_tool_errors: False
enable_ai_metadata: False
add_user_to_requests: False
reasoning_effort: medium
additional_reasoning_effort_models: []
no_temperature_models: [deepseek/deepseek-reasoner, o1-mini, o1-mini-2024-09-12, o1, o1-2024-12-17, o3-mini,
  o3-mini-2025-01-31, o3, o3-2025-04-16, o4-mini, o4-mini-2025-04-16, gpt-5.1-codex,
  gpt-5.1-codex-mini, gpt-5.2-codex, gpt-5.3-codex, gpt-5-mini, moonshotai.kimi-k3,
  us.moonshotai.kimi-k3, global.moonshotai.kimi-k3, kimi-k3, kimi-k3.1-pro, zai.glm-5]
enable_claude_extended_thinking: False
enable_claude_adaptive_thinking: False
claude_adaptive_thinking_models_override: []
claude_extended_thinking_models_override: []
extract_issue_from_branch: True
branch_issue_regex: 
output_relevant_configurations: True

[pr_description]


add_original_user_description: True
extra_instructions: 
enable_pr_type: True
enable_pr_description: True
final_update_message: True
enable_help_text: False
enable_help_comment: False
enable_pr_diagram: True
pr_diagram_direction: adaptive
pr_diagram_direction_threshold: 5
publish_description_as_comment: False
publish_description_as_comment_persistent: True
enable_semantic_files_types: True
collapsible_file_list: adaptive
collapsible_file_list_threshold: 6
file_table_collapsible_open_by_default: False
use_description_markers: False
enable_large_pr_handling: True
include_generated_by_header: True
max_ai_calls: 4
async_ai_calls: True
publish_labels: True
generate_ai_title: False

<!-- pr-agent-generated --> ### **User description** # opt(goal): minutes feeds do no word work; word rail goes count-only ## Finding — `cold-turkey-full-tokenization` Unticketed digest finding (`cold-turkey-full-tokenization`, @argus opt pass 2026-11-09, scanned at `efbde25c`), implemented by @daedalus on `opt/cold-turkey-full-tokenization`. The focused editor's per-keystroke feed drove whole-document word counting for **every** Cold Turkey goal type: `PostEditorView.onTextChange` → `WritingLockState.feed` (`Museion/WritingLockState.swift:86`) → `WritingGoalRun.update` (`Museion/WritingGoal.swift:51` at base `5915178`) → `DraftStats.words` → `tokens(in:)` (`Museion/DraftStats.swift:112` at base) — `split(whereSeparator:)` + `map(lowercased())`, the full lowercased token array materialized per keystroke on the main actor. Minutes goals never read that count: `isMet`, `progress`, `readout`, and `completionNoteText` all ride the clock (consumer audit below). Before-cost, cited from the finding's probe (@argus, not re-measured here): ~0.32 / 3.07 / 16.64 ms per update at 1k / 10k / 50k words — linear in document size, per keystroke. ## Fix (RED-first) - `dde99c8` — pins first: injectable per-call word-rail seam on `update(text:countWords:)` (default = the real rail, repo's established seam style alongside `spawnsTicker` / injectable `at:`; a global counter would race the hosted parallel suite's `DraftStats.compute` calls) + the zero-trips pin, RED at base exactly as designed. - `9f4d9ef` — fix: `update` guards on `.words`; a minutes run does **zero** word work on feed (its accounting freezes at the arm-time baseline — `currentWords` was dead state for minutes runs). `DraftStats.words` becomes a count-only `Character` pass over maximal `isLetter`/`isNumber` runs — no array, no lowercasing; equal by construction to the old split (omitting empty subsequences yields exactly the maximal runs). - `7de8e2f` — devlog + docs. Main (`2cfd8b9`, post-#187) merged in at `7cd5e69`; INDEX.md both-added-row resolved keep-both, newest-first. ## Tests (+3, suite 681 → 684) - `a minutes update takes zero word-rail trips` — the complexity-class pin: O(document) → O(1) per feed. - `a words update takes exactly one word-rail trip` — the skip boundary, and the count lands. - `word rail equals the split tokenizer over a mixed corpus` — the old split expression kept alive as the inline reference: empty, whitespace-only, punctuation-only, Latin/diacritics/Cyrillic/CJK/Arabic, emoji-ZWJ, decimal/comma numbers, contiguous alnum runs. ## Review verification (@athena, reviewer's own runs, fresh clone in the review seat) - Unit target (`-only-testing:MuseionTests`, `-destination 'platform=macOS'`) at merge tip `7cd5e69`: 689 executed / 689 passed / 0 failed — `** TEST SUCCEEDED **`. Count drift vs the branch run (684 → 689) reconciled by test-name inventory diff: +5 are #187's `LibrarySearchSnapshotTests` from the main side; nothing lost. - Same target at reviewed branch tip `7de8e2f`: 684/684 passed; all 3 new pins green. - `swiftformat --lint .`: 0 dirty (141 files). `swiftlint`: 279 violations / 60 serious in 141 files — identical counts to pristine base `5915178` (all pre-existing). - Merge structural proof: parents of `7cd5e69` verified = `7de8e2f` + `2cfd8b9`; `git diff 2cfd8b9 7cd5e69 -- Museion/ MuseionTests/` byte-identical (`cmp` match) to the reviewed `git diff 5915178 7de8e2f -- Museion/ MuseionTests/` — the merge contributed zero code bytes; the PR footprint vs main is exactly the branch's 7 files (165 insertions / 10 deletions); zero conflict markers in the tree. - Mergeability: `git merge-tree --write-tree` clean (exit 0) against trunk `2cfd8b9` — sign-off scoped to that trunk SHA; re-probe if main moves into this seam before merge. - Consumer audit (grep over `Museion/` + `MuseionTests/`, patterns: `update(text`, `currentWords`, `netNewWords|netWords`, `DraftStats.words|\.words(in`): `currentWords` is read only by `netNewWords`; `netNewWords` is read only inside `.words` branches (`isMet`, `progress`, `readout` at `WritingLockState.swift:158-164`) — minutes paths never read word state, so the freeze is observationally identical. Every pre-existing `update(text:)` pin is a words run or asserts clock-only facts. Evidence classes: reviewer's own runs above; implementer's devlog runs at `7de8e2f` (684/684, lint identical — independently reproduced here); @argus before-probe quoted from the finding. ## Unverified / scope - `MuseionUITests` target not run — neither in the handoff's gate nor in this review (unit target only). - The words-rail constant-factor gain is structural (no array, no lowercasing — by construction), not slope-measured in this review; the minutes-side win is a complexity-class elimination pinned by the zero-trips test. - Deliberately not folded in (correct scope): `DraftStats.compute`'s store-time sentence-length tokenization still allocates per chunk — once per pass at capture, not per keystroke; separate finding if it ever shows hot. - Disjoint case vs #187 (zero code-file overlap; only the INDEX.md row). Devlog: `docs/devlog/20261113-cold-turkey-full-tokenization_log.md` · CHANGELOG: `[Unreleased] › Changed`. Reviewer: @athena — verdict clean (zero findings; round 1 at `7de8e2f` full review, round 2 at `7cd5e69` structural merge proof). Alexander merges. [Generated by AI] ___ ### **PR Type** Enhancement, Tests, Documentation ___ ### **Description** - Skip per-keystroke word counting for minutes goals. - Count words without allocating lowercased token arrays. - Add counting-boundary and mixed-script equivalence tests. - Document optimization and verification results. ___ ### Diagram Walkthrough ```mermaid flowchart LR edit["Editor text update"] goal["WritingGoalRun.update"] minutes["Minutes goal: skip word counting"] words["Words goal: count Character runs"] count["Update live word count"] edit --> goal goal -- "minutes" --> minutes goal -- "words" --> words words --> count ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>DraftStats.swift</strong><dd><code>Count word runs without building token arrays</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/opt/cold-turkey-full-tokenization/Museion/DraftStats.swift">+20/-2</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>WritingGoal.swift</strong><dd><code>Skip minutes counting and inject word counter</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/opt/cold-turkey-full-tokenization/Museion/WritingGoal.swift">+19/-8</a>&nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>DraftStatsTests.swift</strong><dd><code>Verify count equivalence across mixed text corpus</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/opt/cold-turkey-full-tokenization/MuseionTests/DraftStatsTests.swift">+37/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>WritingGoalTests.swift</strong><dd><code>Pin minutes skips and single word-count calls</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/opt/cold-turkey-full-tokenization/MuseionTests/WritingGoalTests.swift">+35/-0</a>&nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>3 files</summary><table> <tr> <td><strong>CHANGELOG.md</strong><dd><code>Describe Cold Turkey word counting performance improvements</code></dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/opt/cold-turkey-full-tokenization/CHANGELOG.md">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>20261113-cold-turkey-full-tokenization_log.md</strong><dd><code>Record optimization rationale and regression verification results</code></dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/opt/cold-turkey-full-tokenization/docs/devlog/20261113-cold-turkey-full-tokenization_log.md">+51/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>INDEX.md</strong><dd><code>Index Cold Turkey word counting optimization log</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/opt/cold-turkey-full-tokenization/docs/devlog/INDEX.md">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr></tbody></table> </details> ___ <hr> <details> <summary><strong>🛠️ Relevant configurations:</strong></summary> <br>These are the relevant [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml) for this tool: **[config**] ```yaml max_webhook_request_body_bytes: 5242880 model: gpt-6.1-sol fallback_models: [gpt-6-luna] git_provider: gitea publish_output: True publish_output_progress: True progress_gif_url: progress_gif_width: 48 verbosity_level: 0 use_extra_bad_extensions: False log_level: INFO use_repo_settings_file: True use_global_settings_file: True enable_per_directory_settings: False per_directory_settings_max_files: 20 per_directory_settings_max_tree_pages: 10 disable_auto_feedback: False ai_timeout: 120 retry_same_model_on_timeout: True retry_same_model_on_length: False custom_reasoning_model: False response_language: en-US repo_context_files: [AGENTS.md] repo_context_from_default_branch: True repo_context_max_lines: 500 repo_context_expand_imports: False repo_context_max_glob_matches: 20 patch_extension_skip_types: [.md, .txt] allow_dynamic_context: True max_extra_lines_before_dynamic_context: 10 patch_extra_lines_before: 5 patch_extra_lines_after: 1 cli_mode: False output_run_details: False output_run_cost: False large_patch_policy: clip duplicate_prompt_examples: False persistent_inline_comments: False seed: -1 temperature: 0.2 ignore_pr_title: ['^\[Auto\]'] ignore_pr_target_branches: [] ignore_pr_source_branches: [] ignore_pr_labels: [] ignore_pr_authors: [] reaction_on_start: eyes reaction_on_success: reaction_on_failure: ignore_repositories: [] ignore_language_framework: [] bot_user_indicators: [codium, bot_, bot-, _bot, -bot] restricted_mode: False is_auto_command: True propagate_tool_errors: False enable_ai_metadata: False add_user_to_requests: False reasoning_effort: medium additional_reasoning_effort_models: [] no_temperature_models: [deepseek/deepseek-reasoner, o1-mini, o1-mini-2024-09-12, o1, o1-2024-12-17, o3-mini, o3-mini-2025-01-31, o3, o3-2025-04-16, o4-mini, o4-mini-2025-04-16, gpt-5.1-codex, gpt-5.1-codex-mini, gpt-5.2-codex, gpt-5.3-codex, gpt-5-mini, moonshotai.kimi-k3, us.moonshotai.kimi-k3, global.moonshotai.kimi-k3, kimi-k3, kimi-k3.1-pro, zai.glm-5] enable_claude_extended_thinking: False enable_claude_adaptive_thinking: False claude_adaptive_thinking_models_override: [] claude_extended_thinking_models_override: [] extract_issue_from_branch: True branch_issue_regex: output_relevant_configurations: True ``` **[pr_description]** ```yaml add_original_user_description: True extra_instructions: enable_pr_type: True enable_pr_description: True final_update_message: True enable_help_text: False enable_help_comment: False enable_pr_diagram: True pr_diagram_direction: adaptive pr_diagram_direction_threshold: 5 publish_description_as_comment: False publish_description_as_comment_persistent: True enable_semantic_files_types: True collapsible_file_list: adaptive collapsible_file_list_threshold: 6 file_table_collapsible_open_by_default: False use_description_markers: False enable_large_pr_handling: True include_generated_by_header: True max_ai_calls: 4 async_ai_calls: True publish_labels: True generate_ai_title: False ``` </details>
AlexKucera added 4 commits 2026-11-13 16:44:51 +01:00
The argus opt pass (2026-11-09, unticketed digest finding
cold-turkey-full-tokenization): every editor keystroke feeds the whole
document through WritingGoalRun.update, which counted words for ALL
goal types — a minutes verdict ignores the count, so the feed paid
whole-document tokenization (lowercased [String] allocation) per
keystroke on the main actor for nothing (argus probe: ~16.6 ms/update
at 50k words, linear in document size).

Pins, RED-first where constructible:
- WritingGoalTests 'a minutes update takes zero word-rail trips' —
  RED at base (base takes one trip per update).
- WritingGoalTests 'a words update takes exactly one word-rail trip' —
  the skip boundary: words goals keep live accounting.
- DraftStatsTests 'word rail equals the split tokenizer over a mixed
  corpus' — semantic equivalence pin (old split expression as inline
  reference over mixed scripts, emoji, punctuation, numbers,
  empties); green at base by design — it is the equivalence proof.

Instrument: update(text:countWords:) gains an injectable word-rail
seam (default DraftStats.words) — per-call counting instead of a
global counter, which would race the hosted suite's parallel
DraftStats calls. No behavior change in this commit; update still
counts for every goal.
Root cause (re-derived live at 5915178): WritingLockState.feed ->
WritingGoalRun.update counted words for EVERY goal type, and
DraftStats.words built the complete lowercased token array
(text.split(whereSeparator:).map(lowercased)) just to return .count —
O(document) allocation + lowercasing per keystroke on the main actor
for minutes goals whose verdict/progress/readout never read the count
(argus probe at efbde25c: minutes ~0.32/3.07/16.64 ms per update at
1k/10k/50k words, linear in document size).

Fix, two halves, semantics byte-stable:
- update(text:) guards on .words — a minutes run does no word work
  on feed at all; its accounting freezes at the arm-time baseline
  (currentWords was dead state for minutes runs: readout, isMet,
  progress, and the completion note all ride the clock).
- DraftStats.words becomes a count-only Character pass over maximal
  isLetter/isNumber runs — never materializing the lowercased
  [String]. Identical count by construction: the tokenizer's split
  (which always omits empty subsequences) yields exactly the maximal
  runs; equivalence pinned against the split expression over a
  mixed-script/emoji/punctuation/number corpus in DraftStatsTests.

WritingGoalRun.init (arm-time baseline) keeps counting once per arm
through the same rail — now also allocation-free. Callers unchanged
(update's countWords defaults to DraftStats.words); the words-goal
net accounting is pinned unchanged ('a words update takes exactly
one word-rail trip' + all existing net-delta pins).
CHANGELOG [Unreleased] > Changed entry + session log + INDEX row for
the unticketed opt pass (minutes feeds skip word counting; word rail
count-only; no token array per keystroke). Suite 684.
merge main (2cfd8b9) into opt branch
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s
7cd5e6964e
Fold origin/main (2cfd8b9, #187 library-search stale-after-mutation)
into opt/cold-turkey-full-tokenization. Only conflict was the
docs/devlog/INDEX.md both-added-row; resolved keep-both in
newest-first order. No code files touched by the resolution:
Museion/ and MuseionTests/ carry #187's hunks verbatim.
pr-agent added the Enhancement label 2026-11-13 16:45:03 +01:00
Collaborator

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🏅 Score: 96
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

🛠️ Relevant configurations:


These are the relevant configurations for this tool:

[config]


max_webhook_request_body_bytes: 5242880
model: gpt-6.1-sol
fallback_models: [gpt-6-luna]
git_provider: gitea
publish_output: True
publish_output_progress: True
progress_gif_url: 
progress_gif_width: 48
verbosity_level: 0
use_extra_bad_extensions: False
log_level: INFO
use_repo_settings_file: True
use_global_settings_file: True
enable_per_directory_settings: False
per_directory_settings_max_files: 20
per_directory_settings_max_tree_pages: 10
disable_auto_feedback: False
ai_timeout: 120
retry_same_model_on_timeout: True
retry_same_model_on_length: False
custom_reasoning_model: False
response_language: en-US
repo_context_files: [AGENTS.md]
repo_context_from_default_branch: True
repo_context_max_lines: 500
repo_context_expand_imports: False
repo_context_max_glob_matches: 20
patch_extension_skip_types: [.md, .txt]
allow_dynamic_context: True
max_extra_lines_before_dynamic_context: 10
patch_extra_lines_before: 5
patch_extra_lines_after: 1
cli_mode: False
output_run_details: False
output_run_cost: False
large_patch_policy: clip
duplicate_prompt_examples: False
persistent_inline_comments: False
seed: -1
temperature: 0.2
ignore_pr_title: ['^\[Auto\]']
ignore_pr_target_branches: []
ignore_pr_source_branches: []
ignore_pr_labels: []
ignore_pr_authors: []
reaction_on_start: eyes
reaction_on_success: 
reaction_on_failure: 
ignore_repositories: []
ignore_language_framework: []
bot_user_indicators: [codium, bot_, bot-, _bot, -bot]
restricted_mode: False
is_auto_command: True
propagate_tool_errors: False
enable_ai_metadata: False
add_user_to_requests: False
reasoning_effort: medium
additional_reasoning_effort_models: []
no_temperature_models: [deepseek/deepseek-reasoner, o1-mini, o1-mini-2024-09-12, o1, o1-2024-12-17, o3-mini,
  o3-mini-2025-01-31, o3, o3-2025-04-16, o4-mini, o4-mini-2025-04-16, gpt-5.1-codex,
  gpt-5.1-codex-mini, gpt-5.2-codex, gpt-5.3-codex, gpt-5-mini, moonshotai.kimi-k3,
  us.moonshotai.kimi-k3, global.moonshotai.kimi-k3, kimi-k3, kimi-k3.1-pro, zai.glm-5]
enable_claude_extended_thinking: False
enable_claude_adaptive_thinking: False
claude_adaptive_thinking_models_override: []
claude_extended_thinking_models_override: []
extract_issue_from_branch: True
branch_issue_regex: 
output_relevant_configurations: True

[pr_reviewer]


require_estimate_effort_to_review: True
require_can_be_split_review: False
require_estimate_contribution_time_cost: False
require_todo_scan: False
require_ticket_analysis_review: True
require_risk_assessment: False
require_merge_recommendation: False
require_failure_modes: False
require_priority_files: False
publish_output_no_suggestions: True
publish_review_failure_comment: True
review_heading: PR Reviewer Guide
persistent_finding_state: True
max_previous_findings_chars: 8000
extra_instructions: 
num_max_findings: 3
final_update_message: True
enable_review_labels_security: True
enable_review_labels_effort: True
require_all_thresholds_for_incremental_review: False
minimal_commits_for_incremental_review: 0
minimal_minutes_for_incremental_review: 0
enable_intro_text: True
enable_help_text: False
enable_review_coverage_footer: True
require_score_review: True
require_tests_review: True
require_security_review: True
persistent_comment: True
enable_large_pr_chunking: True
max_number_of_calls: 100

## PR Reviewer Guide 🔍 <!-- pr-agent:review:full --> Here are some key observations to aid the review process: <table> <tr><td>⏱️&nbsp;<strong>Estimated effort to review</strong>: 2 🔵🔵⚪⚪⚪</td></tr> <tr><td>🏅&nbsp;<strong>Score</strong>: 96</td></tr> <tr><td>🧪&nbsp;<strong>PR contains tests</strong></td></tr> <tr><td>🔒&nbsp;<strong>No security concerns identified</strong></td></tr> <tr><td>⚡&nbsp;<strong>No major issues detected</strong></td></tr> </table> <hr> <details> <summary><strong>🛠️ Relevant configurations:</strong></summary> <br>These are the relevant [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml) for this tool: **[config**] ```yaml max_webhook_request_body_bytes: 5242880 model: gpt-6.1-sol fallback_models: [gpt-6-luna] git_provider: gitea publish_output: True publish_output_progress: True progress_gif_url: progress_gif_width: 48 verbosity_level: 0 use_extra_bad_extensions: False log_level: INFO use_repo_settings_file: True use_global_settings_file: True enable_per_directory_settings: False per_directory_settings_max_files: 20 per_directory_settings_max_tree_pages: 10 disable_auto_feedback: False ai_timeout: 120 retry_same_model_on_timeout: True retry_same_model_on_length: False custom_reasoning_model: False response_language: en-US repo_context_files: [AGENTS.md] repo_context_from_default_branch: True repo_context_max_lines: 500 repo_context_expand_imports: False repo_context_max_glob_matches: 20 patch_extension_skip_types: [.md, .txt] allow_dynamic_context: True max_extra_lines_before_dynamic_context: 10 patch_extra_lines_before: 5 patch_extra_lines_after: 1 cli_mode: False output_run_details: False output_run_cost: False large_patch_policy: clip duplicate_prompt_examples: False persistent_inline_comments: False seed: -1 temperature: 0.2 ignore_pr_title: ['^\[Auto\]'] ignore_pr_target_branches: [] ignore_pr_source_branches: [] ignore_pr_labels: [] ignore_pr_authors: [] reaction_on_start: eyes reaction_on_success: reaction_on_failure: ignore_repositories: [] ignore_language_framework: [] bot_user_indicators: [codium, bot_, bot-, _bot, -bot] restricted_mode: False is_auto_command: True propagate_tool_errors: False enable_ai_metadata: False add_user_to_requests: False reasoning_effort: medium additional_reasoning_effort_models: [] no_temperature_models: [deepseek/deepseek-reasoner, o1-mini, o1-mini-2024-09-12, o1, o1-2024-12-17, o3-mini, o3-mini-2025-01-31, o3, o3-2025-04-16, o4-mini, o4-mini-2025-04-16, gpt-5.1-codex, gpt-5.1-codex-mini, gpt-5.2-codex, gpt-5.3-codex, gpt-5-mini, moonshotai.kimi-k3, us.moonshotai.kimi-k3, global.moonshotai.kimi-k3, kimi-k3, kimi-k3.1-pro, zai.glm-5] enable_claude_extended_thinking: False enable_claude_adaptive_thinking: False claude_adaptive_thinking_models_override: [] claude_extended_thinking_models_override: [] extract_issue_from_branch: True branch_issue_regex: output_relevant_configurations: True ``` **[pr_reviewer]** ```yaml require_estimate_effort_to_review: True require_can_be_split_review: False require_estimate_contribution_time_cost: False require_todo_scan: False require_ticket_analysis_review: True require_risk_assessment: False require_merge_recommendation: False require_failure_modes: False require_priority_files: False publish_output_no_suggestions: True publish_review_failure_comment: True review_heading: PR Reviewer Guide persistent_finding_state: True max_previous_findings_chars: 8000 extra_instructions: num_max_findings: 3 final_update_message: True enable_review_labels_security: True enable_review_labels_effort: True require_all_thresholds_for_incremental_review: False minimal_commits_for_incremental_review: 0 minimal_minutes_for_incremental_review: 0 enable_intro_text: True enable_help_text: False enable_review_coverage_footer: True require_score_review: True require_tests_review: True require_security_review: True persistent_comment: True enable_large_pr_chunking: True max_number_of_calls: 100 ``` </details>
Collaborator

PR Code Suggestions ✨

No code suggestions found for the PR.

## PR Code Suggestions ✨ <!-- pr-agent:improve:no-suggestions --> No code suggestions found for the PR.
AlexKucera merged commit 7ed304124e into main 2026-11-13 16:51:06 +01:00
AlexKucera deleted branch opt/cold-turkey-full-tokenization 2026-11-13 16:51:06 +01:00
Sign in to join this conversation.