Skip to content

Keep merge inside --optimize - #377

Merged
rejojer merged 1 commit into
mainfrom
fix/optimize-owns-merge
Aug 2, 2026
Merged

Keep merge inside --optimize#377
rejojer merged 1 commit into
mainfrom
fix/optimize-owns-merge

Conversation

@rejojer

@rejojer rejojer commented Aug 2, 2026

Copy link
Copy Markdown
Member

Merge now belongs to --optimize rather than running on every build, so the
three levels each mean something distinct:

tree
default the extracted tree, as-is
--optimize merge deterministic merge, no LLM
--optimize merge, then the LLM expansion pass

Previously the default collapsed the tree too, which left --optimize merge
with almost nothing extra to do and made the search-cost metrics credit
--optimize with a gain the default already delivered.

The tradeoff is that the default now summarises every extracted node: about 16%
more summary calls across the example corpus, and up to 48% on a document whose
outline has many one-page subsections. Callers who want the cheaper, flatter
tree ask for it with --optimize merge, which costs nothing beyond the merge
itself.

key_items only appears once a merge has run, so it is now documented as an
--optimize field. The non-Flash pipeline in page_index.py is unchanged: it
has no optimize switch and has always collapsed, so it keeps doing so.

@rejojer
rejojer merged commit 1b2fdad into main Aug 2, 2026
4 checks passed
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