fix(search): re-key the mounted sweep on Home + library content revision (museion/library-search-stale-after-mutation) #187

Merged
AlexKucera merged 3 commits from fix/library-search-stale-after-mutation into main 2026-11-13 10:00:59 +01:00
Owner

User description

Finding — museion/library-search-stale-after-mutation (medium; no Gitea ticket — the slug is the key)

PostsPaneView's mounted library search stored its sweep in a matches snapshot keyed ONLY to the trimmed query — .task(id: trimmedQuery) at PostsPaneView.swift:333 on base 5915178 (matches @State at :200). Nothing but a query change or a view remount ever restarted the sweep, so library mutations left the snapshot stale:

  • archiving or trashing a piece (including from a result row's own context menu) left it rendering in the non-archived results after the rescan had already moved model.posts;
  • new, renamed, or externally edited pieces never entered or left the results until the query changed;
  • body-only edits were invisible by construction: a rewritten post.md that parses to an equal Post is skipped by #143's equality-gated posts assignment, so no Post-metadata signal exists for them at all.

Fix (c0cd60b RED pins → becad45 fix → 93d97f2 docs; branch off trunk 5915178)

Search identity = query + Home + a library content revision riding the existing #179 write rail — no parallel invalidation mechanism:

  • PostsModel.swift — contentRevision (private(set)), bumped inside rescan() (the only Post.scan caller; the write rail's performWrite pairs exactly one rescan with every landed write, and the FS watcher routes through the same rescan) whenever the scan sees the library change: a Post-list change OR any re-read post.md, detected as a delta of the scan cache's miss counter across the detached scan (a miss = one disk read + parse; a hit requires path+mtime+size to match — so a metadata-equal body edit still bumps). The #143 posts-assignment skip is untouched: panes never regroup on autosave echoes; only the mounted search re-keys. An unchanged rescan (all cache hits) does not bump.
  • LibrarySearch.swift — pure seam: SearchKey (query, homePath, revision) and Snapshot (key + results) with isFresh(for:) — a landed sweep renders only under the key that computed it.
  • PostsPaneView.swift — the sweep's .task(id:) now keys on the full searchKey (trimmed query + Home + revision), so library writes and Home repoints restart the sweep; the task captures its key at start and lands the snapshot under it; the body renders a snapshot only while isFresh(for: searchKey) — stale rows drop to the recompute spinner, never linger. A mid-sweep key change cancels at the existing Task.isCancelled guards, and even a raced assignment cannot render (the gate refuses it).
  • Tests — MuseionTests/LibrarySearchTests.swift, new LibrarySearchSnapshotTests (+5): the pure key/gate pin; controller-level archive / trash / same-query body-edit pins driving the real rescan rail; an unchanged-rescan guard. RED-first: at c0cd60b the pins ran against a stub contentRevision that is never bumped and failed exactly 3/5 for that reason.

Diff footprint: 7 files, +224/−11 (LibrarySearch.swift, PostsModel.swift, PostsPaneView.swift, LibrarySearchTests.swift, CHANGELOG.md, devlog log + INDEX).

Verification — independently re-run at the review seat (2026-11-12 00:07–00:09 CET, own clone, fresh derived data)

Runner: xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' -derivedDataPath <dd> -resultBundlePath <bundle> -only-testing:MuseionTests test; counts from xcrun xcresulttool get test-results summary:

  • Baseline @ 5915178: TEST SUCCEEDED, exit 0 — totalTestCount 681 / passed 681 / failed 0 / skipped 0.
  • RED @ c0cd60b (focused -only-testing:MuseionTests/LibrarySearchSnapshotTests): TEST FAILED, exit 65 — failed 3 / passed 2; failures exactly archive / trash / same-query body edit (the isFresh expectation), passes the pure pin + unchanged-rescan guard.
  • GREEN focused @ head 93d97f2: TEST SUCCEEDED, exit 0 — 5/5, 0 failed.
  • GREEN full @ head 93d97f2: TEST SUCCEEDED, exit 0 — totalTestCount 686 / passed 686 / failed 0 / skipped 0 (baseline 681 + the 5 new pins, zero confounds). The known EditorSessionTests debounce real-clock flake did not fire in either full run.
  • swiftlint: 279 violations / 60 serious in 141 files — identical counts at base and head (the two PostsModel warnings + the PostsPaneView file-length warning pre-exist; only line counts grew). swiftformat --lint: 0 files require formatting at base and head, touched and whole-tree.
  • Mergeability: git merge-tree --write-tree 5915178 93d97f2 clean (exit 0), moment-scoped to trunk 5915178 — which is also the branch's merge-base (trunk unmoved at review time, ls-remote verified).

Implementer disclosures (verbatim from the handoff)

  • Baseline on pristine 5915178 (changes stashed): TEST SUCCEEDED, exit 0, totalTestCount 681, result Passed.
  • RED @ c0cd60b (-only-testing:MuseionTests/LibrarySearchSnapshotTests): TEST FAILED, exit 65, failedTests 3 / passedTests 2 — exactly archive/trash/body-edit.
  • GREEN focused @ becad45: 5/5 passed, 0 failed, exit 0.
  • GREEN full @ becad45: 686 passed / 0 failed / 0 skipped, exit 0 (681 + 5 new, zero confounds; the known EditorSessionTests debounce real-clock flake was NOT hit — if you hit it under concurrent load, rerun focused and disclose; do not chase it into this diff).
  • Lint deltas vs base: none — swiftlint 279 violations / 60 serious both sides (PostsModel ×2 + PostsPaneView file-length pre-exist, only line counts grew); swiftformat 0 files rewritten, touched and whole-tree.
  • Unverified by design: no UI-automation run of the SwiftUI column (house style — invalidation pinned at controller level, which is what the view consumes).

Unverified (keyed museion/library-search-stale-after-mutation)

  • No UI-automation run of the SwiftUI column itself (house style): the invalidation contract is pinned at controller level — contentRevision demonstrably moves through the real rescan rail on archive/trash/body-edit — and the view consumes exactly that signal via .task(id: searchKey) + the isFresh gate, verified by reading the wiring, not by driving the UI.
  • Inherited ceiling (pre-existing, documented in PostScanCache): the revision rides the scan cache's mtime+size invalidation, so a body-only edit that lands within APFS timestamp granularity at identical size bumps nothing. After this PR, search freshness is exactly as strong as list freshness — no weaker, no stronger.

AGENTS.md (owner-apply patch, not in this diff)

git apply ~/daedalus-builds/museion/brief-16-agentsmd-library-search-stale-after-mutation.patch — root AGENTS.md session-log window row (window pruned to exactly 10), Museion/AGENTS.md PostsPaneView + PostsModel bullet clauses, MuseionTests/AGENTS.md suite-map line. git apply --check CLEAN against branch head 93d97f2 (re-verified at the review seat).

Merge is Alexander's — nobody else merges or pushes main.


PR Type

Bug fix, Tests, Documentation


Description

  • Refresh library search after mutations and Home changes.

  • Detect body-only edits through rescan cache misses.

  • Hide stale snapshots while searches recompute.

  • Add five regression tests and verification documentation.


Diagram Walkthrough

flowchart TD
  library["Library changes"]
  rescan["Rescan detects list changes or cache misses"]
  revision["Content revision"]
  key["Search key: query, Home, revision"]
  sweep["Restart search sweep"]
  gate["Render only fresh snapshots"]
  library --> rescan
  rescan --> revision
  revision --> key
  key --> sweep
  sweep --> gate
  key --> gate

File Walkthrough

Relevant files
Bug fix
3 files
LibrarySearch.swift
Add search identity and snapshot freshness checks               
+27/-0   
PostsModel.swift
Track library content revisions during rescans                     
+24/-1   
PostsPaneView.swift
Restart searches and suppress stale result snapshots         
+33/-10 
Tests
1 files
LibrarySearchTests.swift
Test snapshot invalidation and unchanged rescan behavior 
+110/-0 
Documentation
3 files
CHANGELOG.md
Document stale search fix and regression coverage               
+2/-0     
20261111-fix-library-search-stale-after-mutation_log.md
Record invalidation design and red-first verification results
+27/-0   
INDEX.md
Index library search invalidation fix session 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** ## Finding — museion/library-search-stale-after-mutation (medium; no Gitea ticket — the slug is the key) PostsPaneView's mounted library search stored its sweep in a `matches` snapshot keyed ONLY to the trimmed query — `.task(id: trimmedQuery)` at PostsPaneView.swift:333 on base 5915178 (`matches` @State at :200). Nothing but a query change or a view remount ever restarted the sweep, so library mutations left the snapshot stale: - archiving or trashing a piece (including from a result row's own context menu) left it rendering in the non-archived results after the rescan had already moved `model.posts`; - new, renamed, or externally edited pieces never entered or left the results until the query changed; - body-only edits were invisible by construction: a rewritten post.md that parses to an equal `Post` is skipped by #143's equality-gated `posts` assignment, so no Post-metadata signal exists for them at all. ## Fix (c0cd60b RED pins → becad45 fix → 93d97f2 docs; branch off trunk 5915178) Search identity = query + Home + a library content revision riding the existing #179 write rail — no parallel invalidation mechanism: - **PostsModel.swift** — `contentRevision` (private(set)), bumped inside `rescan()` (the only `Post.scan` caller; the write rail's `performWrite` pairs exactly one rescan with every landed write, and the FS watcher routes through the same rescan) whenever the scan sees the library change: a Post-list change OR any re-read post.md, detected as a delta of the scan cache's miss counter across the detached scan (a miss = one disk read + parse; a hit requires path+mtime+size to match — so a metadata-equal body edit still bumps). The #143 `posts`-assignment skip is untouched: panes never regroup on autosave echoes; only the mounted search re-keys. An unchanged rescan (all cache hits) does not bump. - **LibrarySearch.swift** — pure seam: `SearchKey` (query, homePath, revision) and `Snapshot` (key + results) with `isFresh(for:)` — a landed sweep renders only under the key that computed it. - **PostsPaneView.swift** — the sweep's `.task(id:)` now keys on the full `searchKey` (trimmed query + Home + revision), so library writes and Home repoints restart the sweep; the task captures its key at start and lands the snapshot under it; the body renders a snapshot only while `isFresh(for: searchKey)` — stale rows drop to the recompute spinner, never linger. A mid-sweep key change cancels at the existing `Task.isCancelled` guards, and even a raced assignment cannot render (the gate refuses it). - **Tests** — MuseionTests/LibrarySearchTests.swift, new `LibrarySearchSnapshotTests` (+5): the pure key/gate pin; controller-level archive / trash / same-query body-edit pins driving the real rescan rail; an unchanged-rescan guard. RED-first: at c0cd60b the pins ran against a stub `contentRevision` that is never bumped and failed exactly 3/5 for that reason. Diff footprint: 7 files, +224/−11 (LibrarySearch.swift, PostsModel.swift, PostsPaneView.swift, LibrarySearchTests.swift, CHANGELOG.md, devlog log + INDEX). ## Verification — independently re-run at the review seat (2026-11-12 00:07–00:09 CET, own clone, fresh derived data) Runner: `xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' -derivedDataPath <dd> -resultBundlePath <bundle> -only-testing:MuseionTests test`; counts from `xcrun xcresulttool get test-results summary`: - Baseline @ 5915178: TEST SUCCEEDED, exit 0 — totalTestCount 681 / passed 681 / failed 0 / skipped 0. - RED @ c0cd60b (focused `-only-testing:MuseionTests/LibrarySearchSnapshotTests`): TEST FAILED, exit 65 — failed 3 / passed 2; failures exactly archive / trash / same-query body edit (the isFresh expectation), passes the pure pin + unchanged-rescan guard. - GREEN focused @ head 93d97f2: TEST SUCCEEDED, exit 0 — 5/5, 0 failed. - GREEN full @ head 93d97f2: TEST SUCCEEDED, exit 0 — totalTestCount 686 / passed 686 / failed 0 / skipped 0 (baseline 681 + the 5 new pins, zero confounds). The known EditorSessionTests debounce real-clock flake did not fire in either full run. - swiftlint: 279 violations / 60 serious in 141 files — identical counts at base and head (the two PostsModel warnings + the PostsPaneView file-length warning pre-exist; only line counts grew). swiftformat --lint: 0 files require formatting at base and head, touched and whole-tree. - Mergeability: `git merge-tree --write-tree 5915178 93d97f2` clean (exit 0), moment-scoped to trunk 5915178 — which is also the branch's merge-base (trunk unmoved at review time, ls-remote verified). ### Implementer disclosures (verbatim from the handoff) - Baseline on pristine 5915178 (changes stashed): TEST SUCCEEDED, exit 0, totalTestCount 681, result Passed. - RED @ c0cd60b (-only-testing:MuseionTests/LibrarySearchSnapshotTests): TEST FAILED, exit 65, failedTests 3 / passedTests 2 — exactly archive/trash/body-edit. - GREEN focused @ becad45: 5/5 passed, 0 failed, exit 0. - GREEN full @ becad45: 686 passed / 0 failed / 0 skipped, exit 0 (681 + 5 new, zero confounds; the known EditorSessionTests debounce real-clock flake was NOT hit — if you hit it under concurrent load, rerun focused and disclose; do not chase it into this diff). - Lint deltas vs base: none — swiftlint 279 violations / 60 serious both sides (PostsModel ×2 + PostsPaneView file-length pre-exist, only line counts grew); swiftformat 0 files rewritten, touched and whole-tree. - Unverified by design: no UI-automation run of the SwiftUI column (house style — invalidation pinned at controller level, which is what the view consumes). ## Unverified (keyed museion/library-search-stale-after-mutation) - No UI-automation run of the SwiftUI column itself (house style): the invalidation contract is pinned at controller level — `contentRevision` demonstrably moves through the real rescan rail on archive/trash/body-edit — and the view consumes exactly that signal via `.task(id: searchKey)` + the `isFresh` gate, verified by reading the wiring, not by driving the UI. - Inherited ceiling (pre-existing, documented in PostScanCache): the revision rides the scan cache's mtime+size invalidation, so a body-only edit that lands within APFS timestamp granularity at identical size bumps nothing. After this PR, search freshness is exactly as strong as list freshness — no weaker, no stronger. ## AGENTS.md (owner-apply patch, not in this diff) `git apply ~/daedalus-builds/museion/brief-16-agentsmd-library-search-stale-after-mutation.patch` — root AGENTS.md session-log window row (window pruned to exactly 10), Museion/AGENTS.md PostsPaneView + PostsModel bullet clauses, MuseionTests/AGENTS.md suite-map line. `git apply --check` CLEAN against branch head 93d97f2 (re-verified at the review seat). Merge is Alexander's — nobody else merges or pushes main. ___ ### **PR Type** Bug fix, Tests, Documentation ___ ### **Description** - Refresh library search after mutations and Home changes. - Detect body-only edits through rescan cache misses. - Hide stale snapshots while searches recompute. - Add five regression tests and verification documentation. ___ ### Diagram Walkthrough ```mermaid flowchart TD library["Library changes"] rescan["Rescan detects list changes or cache misses"] revision["Content revision"] key["Search key: query, Home, revision"] sweep["Restart search sweep"] gate["Render only fresh snapshots"] library --> rescan rescan --> revision revision --> key key --> sweep sweep --> gate key --> gate ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><details><summary>3 files</summary><table> <tr> <td><strong>LibrarySearch.swift</strong><dd><code>Add search identity and snapshot freshness checks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/library-search-stale-after-mutation/Museion/LibrarySearch.swift">+27/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>PostsModel.swift</strong><dd><code>Track library content revisions during rescans</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/library-search-stale-after-mutation/Museion/PostsModel.swift">+24/-1</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>PostsPaneView.swift</strong><dd><code>Restart searches and suppress stale result snapshots</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/library-search-stale-after-mutation/Museion/PostsPaneView.swift">+33/-10</a>&nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>LibrarySearchTests.swift</strong><dd><code>Test snapshot invalidation and unchanged rescan behavior</code>&nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/library-search-stale-after-mutation/MuseionTests/LibrarySearchTests.swift">+110/-0</a>&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>Document stale search fix and regression coverage</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/library-search-stale-after-mutation/CHANGELOG.md">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>20261111-fix-library-search-stale-after-mutation_log.md</strong><dd><code>Record invalidation design and red-first verification results</code></dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/library-search-stale-after-mutation/docs/devlog/20261111-fix-library-search-stale-after-mutation_log.md">+27/-0</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>INDEX.md</strong><dd><code>Index library search invalidation fix session log</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://git.babylondreams.de/AlexKucera/museion/src/branch/fix/library-search-stale-after-mutation/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 3 commits 2026-11-12 00:10:39 +01:00
test(search): red pin for snapshot invalidation
CI / ci (push) Canceled after 0s
c0cd60b798
The mounted search snapshot is keyed only to the trimmed query, so
library mutations never restart the sweep: archived/trashed rows
linger in the results and edited bodies never enter them until the
query changes or the view remounts.

Pin the invalidation contract at controller level, the way the pure
seam is pinned: LibrarySearch.SearchKey (query + Home + the model's
content revision) and the LibrarySearch.Snapshot isFresh gate decide
whether a landed sweep may render. The rail pins drive the real
rescan path and prove archive, trash, and a same-query body edit
each move PostsModel.contentRevision. The property is a stub here —
never bumped — so those three pins fail red on this commit.
The snapshot's only task identity was the trimmed query, so library
mutations never restarted the sweep: archived and trashed rows kept
rendering in the results, and renamed, new, or since-edited pieces
never entered them until the query changed or the view remounted.

Extend the #179 write rail's rescan with the missing signal: every
scan that changes the Post list OR re-reads any post.md (a body-only
edit compares equal as a Post — #143's skip) bumps
PostsModel.contentRevision. Key the mounted sweep to the full
LibrarySearch.SearchKey (query + Home + revision) and gate rendering
on Snapshot.isFresh, so a landed sweep drops to the recompute state
the moment the library moves under it. The posts-assignment skip
stays: panes never regroup on the bumps, only the search re-keys.
docs(devlog): library search stale-after-mutation fix
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s
93d97f2e35
Session log + INDEX row + CHANGELOG entry for the snapshot
invalidation fix: the rescan-rail content revision and the mounted
key/gate, with the red-first verification trail.
Collaborator

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🏅 Score: 94
🧪 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: 10

## 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>: 3 🔵🔵🔵⚪⚪</td></tr> <tr><td>🏅&nbsp;<strong>Score</strong>: 94</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: 10 ``` </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 2cfd8b9f79 into main 2026-11-13 10:00:59 +01:00
Sign in to join this conversation.