Skip to content

fix(events): detect a rewind to the conversation root - #37

Merged
HackPoint merged 1 commit into
mainfrom
agents/tracker-rewind-detection-fix
Oct 11, 2026
Merged

HackPoint merged 1 commit into
mainfrom
agents/tracker-rewind-detection-fix

Conversation

@HackPoint

Copy link
Copy Markdown
Owner

Closes #31

What

Tracker::feed flagged a rewind only when the new prompt's parent depth was known. A real prompt with parentUuid: 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 one rewind; the next prompt on the new branch is not another.
  • a_prompt_whose_parent_is_unknown_is_a_rewind_once_a_prompt_was_seen
  • the_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, including e2e_read_to_screen, e2e_pipeline, ranked_metering, repeat_reads: all pass except efficiency::the_recorded_ledger_agrees_with_itself, which fails on the maintainer's local ledger independent of this change (#35).

…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
@HackPoint
HackPoint merged commit 31e7dd5 into main Oct 11, 2026
17 checks passed
@HackPoint
HackPoint deleted the agents/tracker-rewind-detection-fix branch October 11, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewind to the conversation root is not detected

1 participant