Wiki multi level#200
Merged
Merged
Conversation
…ance Three related fixes to wiki generation and the update proposal flow: Multi-level heading support (section_ops.rs, wiki/mod.rs): - Parser now recognises h3+ headings as addressable sections instead of swallowing them into the nearest h2 body. heading and after_heading fields in ops can now reference any ## or deeper heading. - extract_current_headings returns (level, text) pairs; the prompt renders sub-headings with indentation so the LLM sees the hierarchy. - apply_section_ops switches to a soft-fail mode per op: if a single op references a hallucinated heading, the rest still apply and the bad op is reported in the returned error list rather than aborting the whole update. - Prompt wording updated: '## headings' -> 'section headings' to avoid confusing models that generate h3+ content. Tag hierarchy scope (sqlite/wiki.rs, postgres/wiki.rs): - get_new_atoms_since and atom_count queries now use a recursive CTE to span the full tag descendant tree, matching the scope used by generation and get_article_status. Previously these queries only looked at atoms directly tagged with the exact tag_id, causing the 'N new atoms' banner to miscount atoms in child tags and fire spuriously. Advance baseline on no-op updates (lib.rs, storage/traits.rs, storage/mod.rs, sqlite/wiki.rs, postgres/wiki.rs): - When generate_wiki_update finds no changes worth proposing, it now calls advance_wiki_baseline to bump atom_count and updated_at to current values. This clears the 'N new atoms' banner and prevents the same atoms from being re-evaluated on every subsequent 'Generate Update' click. - accept_wiki_proposal: use proposal.created_at instead of a fresh Utc::now() for updated_at so the stored timestamp matches the proposal's age rather than the accept time.
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.
No description provided.