Repository navigation
fix(events): detect a rewind to the conversation root - #37
Merged
Merged
Conversation
…ompt was seen A rewind to the conversation root (parentUuid null, e.g. Esc-Esc on the first message) was never flagged, so the repeat-read gate could answer "Unchanged" to a model whose context was gone. A false positive costs one full outline; a false negative serves a stub with no base in context. Closes #31
5 tasks
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.
Closes #31
What
Tracker::feedflagged a rewind only when the new prompt's parent depth was known. A real prompt withparentUuid: null(rewind to the start, or Esc-Esc on the first message) was not recorded, so the repeat-read gate could serve a stub or delta to a model whose context was gone.Now, once the tracker has seen a prompt (
tip > 0), a real prompt whose parent is missing or unknown is a rewind. A false positive costs one full outline; a false negative costs a hallucination.Tests (red, then green)
a_rewind_to_the_conversation_root_is_a_rewind: root-level prompt after earlier turns yields onerewind; the next prompt on the new branch is not another.a_prompt_whose_parent_is_unknown_is_a_rewind_once_a_prompt_was_seenthe_first_prompt_of_a_transcript_is_never_a_rewind: guards the false-positive edge (resumed transcript opening with a foreign parent).Both detection tests failed before the change, for the reason in the issue.
Optimization impact
None on the happy path: linear conversations, parallel tool results, sidechains, meta records and compaction are unchanged (existing tests pass). The only behavior change is a full outline instead of a stub where a rewind was previously missed. The gate already maps a recorded rewind to the full result (
repeat_reads::a_rewind_between_two_reads_yields_the_full_outline).Local CI
cargo fmt --check,cargo clippy --workspace --all-targets --exclude Lumen -- -D warnings,cargo test -p lumen-core -p lumen-cli -p lumen-daemon -p lumen-mcp -p lumen-stats --all-targets --no-fail-fast, includinge2e_read_to_screen,e2e_pipeline,ranked_metering,repeat_reads: all pass exceptefficiency::the_recorded_ledger_agrees_with_itself, which fails on the maintainer's local ledger independent of this change (#35).