Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ All notable changes to vouch are documented here. Format follows
artifact the caller could not already retrieve, and it touches no write path.

### Fixed
- **session-split ignores archived pages in TAKEN TOPICS / collisions** (#712):
prompts and `_file_drafts` treated every on-disk page as taken, so archiving
a session summary permanently blocked redraft under the same title. Both
now reuse `compile._live_pages` (same live set as compile post-#700).
- **`kb.neighbors` drops archived pages** (#696):
`_neighbor_ok` already filtered retracted claims but accepted any
on-disk page, so archived titles still appeared in neighbors while
Expand Down
6 changes: 3 additions & 3 deletions src/vouch/session_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def build_split_prompt(
if git_stat:
lines += ["GIT STAT:", "```", git_stat, "```", ""]

pages = store.list_pages()
pages = compile_mod._live_pages(store)
pending = compile_mod._pending_page_names(store)
taken = [f"- {p.title}" for p in pages] + [f"- {n} [pending]" for n in sorted(pending)]
lines += ["TAKEN TOPICS (do NOT redraft any of these):"]
Expand Down Expand Up @@ -434,7 +434,7 @@ def build_renarrate_prompt(store: KBStore, body: str, *, title: str, max_pages:
if title:
lines += [f"SESSION RECORD TITLE: {title}", ""]
lines += ["SESSION RECORD (markdown):", body, ""]
pages = store.list_pages()
pages = compile_mod._live_pages(store)
pending = compile_mod._pending_page_names(store)
taken = [f"- {p.title}" for p in pages] + [f"- {n} [pending]" for n in sorted(pending)]
lines += ["TAKEN TOPICS (do NOT redraft any of these):"]
Expand Down Expand Up @@ -492,7 +492,7 @@ def _file_drafts(
max_pages: int,
origin: Path | None = None,
) -> tuple[list[str], list[dict[str, Any]]]:
existing = store.list_pages()
existing = compile_mod._live_pages(store)
taken = {p.title.strip().lower() for p in existing}
taken |= {p.id.strip().lower() for p in existing}
taken |= compile_mod._pending_page_names(store)
Expand Down
32 changes: 31 additions & 1 deletion tests/test_session_split_renarrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from vouch import capture, session_split
from vouch import compile as compile_mod
from vouch.llm_draft import LLMDraftError
from vouch.models import Page, Proposal, ProposalKind, ProposalStatus
from vouch.models import Page, PageStatus, Proposal, ProposalKind, ProposalStatus
from vouch.session_split import SPLIT_ACTOR, SplitConfig, load_split_config
from vouch.storage import KBStore

Expand Down Expand Up @@ -154,6 +154,36 @@ def test_renarrate_prompt_lists_durable_and_pending_topics(
assert "- retrieval backends [pending]" in prompt


def test_renarrate_prompt_and_file_drafts_ignore_archived_pages(
store: KBStore,
) -> None:
"""Archived pages must not block TAKEN TOPICS or draft collision (#712)."""
store.put_page(Page(
id="archived-session-topic",
title="retired session topic XYZ",
status=PageStatus.ARCHIVED,
))
store.put_page(Page(
id="live-topic",
title="landed the review gate",
status=PageStatus.ACTIVE,
))
prompt = session_split.build_renarrate_prompt(
store, "body", title="t", max_pages=3,
)
assert "retired session topic XYZ" not in prompt
assert "landed the review gate" in prompt

ids, dropped = session_split._file_drafts(
store,
"s-arch",
[{"title": "retired session topic XYZ", "body": "rewrote the retired topic"}],
max_pages=3,
)
assert len(ids) == 1
assert dropped == []


# --- _try_renarrate ------------------------------------------------------


Expand Down
Loading