Skip to content

fix(provenance): keep archived pages out of the graph - #709

Merged
plind-junior merged 3 commits into
vouchdev:testfrom
dripsmvcp:fix/provenance-archived-pages
Jul 31, 2026
Merged

fix(provenance): keep archived pages out of the graph#709
plind-junior merged 3 commits into
vouchdev:testfrom
dripsmvcp:fix/provenance-archived-pages

Conversation

@dripsmvcp

Copy link
Copy Markdown
Contributor

closes #701

what

provenance.graph.build_graph walked store.list_pages() with no lifecycle
filter and emitted an EMBEDS edge for every page, archived ones included.

Archived pages are intentional retirements. Leaving them in the graph undoes
archive for anything that renders it — vouch impact still names a page the
wiki no longer carries — and disagrees with recall, digest, context,
search and neighbors, which all read the same live set.

the fix

Skip PageStatus.ARCHIVED when adding page nodes and their edges.

Draft pages deliberately stay in: unreviewed is not retired, and the existing
_seed fixture's breakage assertions already depend on that distinction
(page-draft is excluded from --if archive breakage but is still a
dependent).

tests

Three in tests/test_provenance.py:

  • an archived page contributes no node and no edge (the issue's repro)
  • live and draft pages still embed — the filter is archive-only, not a
    blanket drop
  • the user-visible consequence: archiving a page removes it from impact's
    dependents while its live sibling stays

Full gate green locally: pytest tests/ --ignore=tests/embeddings, mypy src,
ruff check src tests.

Sibling of #700 (same archive leak in compile's TAKEN TOPICS) — separate PR,
separate file, no overlap.

`build_graph` walked `store.list_pages()` with no lifecycle filter and
emitted an EMBEDS edge for every page, archived ones included.

archived pages are intentional retirements. leaving them in the
provenance graph undoes archive for anything that renders it — impact
still names a page the wiki no longer carries — and disagrees with
recall, digest, search and neighbors, which all read the same live set.

skip `PageStatus.ARCHIVED` when adding page nodes and their edges. draft
pages stay: unreviewed is not retired, and the existing seed's breakage
assertions depend on that distinction.
@github-actions github-actions Bot added tests tests and fixtures size: S 50-199 changed non-doc lines labels Jul 31, 2026
@plind-junior

Copy link
Copy Markdown
Member

checked the completeness question this fix turns on: pages enter the graph at exactly one site. node_kinds is populated at provenance/graph.py:163 (claim), :194-195 (evidence/source), :215 (session), :220 (event) and :224 (page) — :224 is the loop you patch, and nothing else in build_graph writes a page id. so an archived page cannot leak back in through the audit-event or proposal walk. the fix is complete, not just locally correct.

keeping draft pages in is the right call and the reasoning holds — the _seed fixture's breakage assertions already depend on page-draft being a dependent, so a blanket "live only" filter would have silently changed an unrelated test's meaning.

test_archiving_a_page_removes_it_from_impact is the one that earns its place: it passes use_cache=False on the second call, so it exercises the graph rebuild rather than a stale cache. easy to get wrong, and getting it wrong would have made the test vacuous.

one cross-cutting note, same on all five archived-page PRs: context._page_is_live already exists for exactly this predicate, and its docstring says that keeping it in more than one place is what let kb.context keep serving archived pages after #581 fixed kb.search. this cluster adds five more copies. worth converging on one shared page_is_live(page) before the next surface turns up — longer note on #710.

nothing blocking.

@github-actions
github-actions Bot disabled auto-merge July 31, 2026 16:08
@plind-junior
plind-junior merged commit d7cdcba into vouchdev:test Jul 31, 2026
11 checks passed
@github-actions github-actions Bot added the ci: passing ci is green label Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

diff coverage: n/a — this PR changes no python under src/vouch/, so there is nothing for the gate to measure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: passing ci is green size: S 50-199 changed non-doc lines tests tests and fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(provenance): build_graph includes archived pages in EMBEDS

2 participants