Skip to content

Wiki multi level#200

Merged
kenforthewin merged 4 commits into
mainfrom
wiki-multi-level
May 16, 2026
Merged

Wiki multi level#200
kenforthewin merged 4 commits into
mainfrom
wiki-multi-level

Conversation

@kenforthewin
Copy link
Copy Markdown
Owner

No description provided.

bk-ty and others added 4 commits April 30, 2026 10:44
…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.
@kenforthewin kenforthewin merged commit ce533f7 into main May 16, 2026
3 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.

2 participants