Skip to content

refactor(kernel): restrict tape-anchor to topic-switch only (#1355)#1356

Merged
crrow merged 1 commit intomainfrom
issue-1355-anchor-topic-only
Apr 13, 2026
Merged

refactor(kernel): restrict tape-anchor to topic-switch only (#1355)#1356
crrow merged 1 commit intomainfrom
issue-1355-anchor-topic-only

Conversation

@crrow
Copy link
Copy Markdown
Collaborator

@crrow crrow commented Apr 13, 2026

Summary

  • Remove should_remind_tape_anchor + constants that injected anchor reminders on large tool outputs — large output ≠ topic switch
  • Remove did_create_anchor (dead code, never called in production)
  • Remove needs_anchor_reminder variable and dynamic injection block
  • Rewrite context_contract to frame anchor as topic-boundary checkpoint only, not a compression tool
  • Context compression remains handled by auto-fold at the code level

Type of change

Type Label
Refactor refactor

Component

core

Closes

Closes #1355

Test plan

  • cargo check -p rara-kernel passes
  • cargo test -p rara-kernel — 397 tests pass, 0 failures
  • cargo clippy clean
  • cargo +nightly fmt clean
  • Pre-commit hooks pass

🤖 Generated with Claude Code

@crrow crrow added refactor Code refactoring core Core system changes labels Apr 13, 2026
Remove code paths that pushed the LLM to anchor on large tool outputs,
conflating anchor (topic boundary marker) with context compression
(auto-fold's job). GPT models were especially susceptible, destroying
context and KV cache with excessive anchoring.

Removed:
- `should_remind_tape_anchor` function + LARGE/MEDIUM_TOOL_RESULT_CHARS constants
- `did_create_anchor` (dead code, never called in production)
- `needs_anchor_reminder` variable and dynamic injection block
- 4 associated tests

Changed:
- context_contract now frames anchor as topic-switch checkpoint only

Closes #1355
@crrow crrow force-pushed the issue-1355-anchor-topic-only branch from 69d1880 to 356e5ad Compare April 13, 2026 16:05
@crrow crrow merged commit 91c69a8 into main Apr 13, 2026
8 checks passed
@crrow crrow deleted the issue-1355-anchor-topic-only branch April 13, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core system changes refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(kernel): restrict tape-anchor to topic-switch only

1 participant