Keep heading edges when a re-extraction replaces a note's node #1577
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1577
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A re-extraction deletes the old node of a note. In 12 notes that old node was the parent of the Markdown
containsedges to the headings. The edges go with the node, so correct structure is lost, and the note's new nodes do not join its page node.Observed
The V4 re-extraction of 2026-11-05 removed 95
containsedges and 12 parent nodes. 87 headings and 13 page nodes became isolated. Example:2026-03-13-oo-principles-plugin-concept-design-recommendations.mdhas 9 headings at degree 0. A fresh parse of that note gives 11 edges. The twographify update --forcesteps did not repair them. A what-if in memory: restoring the 95 edges gives 212 isolated nodes and 59.7% largest component, against 305 and 53.7%. Full analysis:plugins/os-vault/eval/graph-retrieval/diff-reextract.mdsections 4 and 5.Reproduce
n/a: the state is in the live vault graph; see the report.
Approach
Chain correction: the cause is the node replace in graphify
build.py:2836-2848, notupdate --forceskipping notes. Repair stays in os-vault because graphify is outside this repo.Required work:
extract_pageinplugins/os-vault/hooks/stub_markdown_pages.pyalso returns each heading and its parent from the Markdown parse.stub_pageskeeps its signature and re-adds a missingcontainsedge from the parsed parent, or from the page node when the parent id is absent from the graph.home_jared_documents_secondbrain_prefix and the page_mdform, to match graph ids. Set_origin: astand the note's relativesource_fileon each edge.source_fileandL<n>, because old headings have nonode_kind.Acceptance criteria
graph.json, after the stub step and two forced updates, the 87 listed heading ids each have degree 1 or more.documentnodes go from 184 to 97 or fewer, andcontainsedges go from 157 to 244.graph.json.Owner sketch
stub_markdown_pages.pyowns graph repair after extract. No new object. Keepstub_pages(graph, canonical_id_of, extract_page).Origin
update --forceskips notes with semantic nodes ← UPSTREAM-TOOL (graphify 0.9.102)VERDICT: CREATE
Deferred, ruling 71. After #1571 no question fails because of lost heading edges: 12/12 original pass, and the five reworded misses fail at start nodes on word mismatch. Reopen the work only if a question fails from it.