Skip to content

Adaptive resolution + live-image policy#27

Open
antra-tess wants to merge 1 commit into
mainfrom
feat/adaptive-resolution
Open

Adaptive resolution + live-image policy#27
antra-tess wants to merge 1 commit into
mainfrom
feat/adaptive-resolution

Conversation

@antra-tess
Copy link
Copy Markdown
Contributor

Integration PR for the feat/adaptive-resolution branch (21 commits ahead of main). The V1 scaffold landed earlier via #19, but the full feature plus subsequent work never reached main — this brings it all in.

Adaptive resolution

  • Picker + chunker + strategies scaffold; wired into AutobiographicalStrategy via the adaptiveResolution flag and the ingestion path.
  • Recursive bottom-up pre-producer for unbounded L_n; OverBudgetError when the picker is exhausted over hard budget.
  • Resolutions + locks persisted via chronicle state slots.
  • Q+A recall pairs emitted as separate messages within bodyGroups; raw-shard merge across all emission paths.

Compression quality

  • KV-preserving compression prompt (per hermes-autobio spec); merge prompt shows one-level-deeper content + chronological prefix.
  • Reading-mode instructions for sub-message chunks and bodyGroup-rooted merges (kills voice drift).
  • Always include head window in compression; always-on JSONL logging of compression LLM calls.

Live-image policy (new)

  • imageStripDepthTokens (default 30000) — strip images deeper than this many tokens from the newest message to a placeholder, even though surrounding text stays verbatim out to recentWindowTokens.
  • maxLiveImages (default 6) — hard ceiling on live images, newest-first.
  • Single post-pass in select() covering all compile paths; per-image token estimate corrected 1000 → 1600.

Tests

Adaptive integration coverage (branching, long-chronicle, doc+chat) + image-stripping (count cap, depth cutoff, disabled). Full suite: 117/120 pass (3 pre-existing failures unrelated to this branch).

🤖 Generated with Claude Code

Add a live-image policy to the autobiographical strategy so image payload
stays bounded independently of the text horizon:

- imageStripDepthTokens (default 30000): strip images deeper than this many
  tokens from the newest message to a "[image dropped from live context]"
  placeholder, even though surrounding text stays verbatim out to
  recentWindowTokens. Lets the text horizon (e.g. 200k) far exceed the
  image horizon.
- maxLiveImages (default 6): hard ceiling on live images, counted
  newest-first, for dense bursts inside the window.

Applied as a single post-pass in select() so all compile paths
(legacy/hierarchical/adaptive) and KnowledgeStrategy are covered. Also
corrects the per-image token estimate (1000 -> 1600) to match a 1568px
image, so window math no longer under-counts.

Adds test/image-stripping.test.ts (count cap, depth cutoff, disabled).
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.

1 participant