Merge duplicate concept nodes and stop wikilink stubs taking the citing note as source #1568
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#1568
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
The vault graph holds duplicate concept nodes that graphify did not merge. It also holds stub nodes for wikilink targets that graphify attributes to the citing note, not to the target note. Both defects hide the right answer.
Evidence: /tmp/claude-1000/-home-jared-Documents-SecondBrain/b10276a0-3582-48b5-b0fe-f13795bdcc75/scratchpad/vault-graph-weak-retrieval-evidence.md and /tmp/claude-1000/-home-jared-Documents-SecondBrain/8a73b51f-d8a3-4dfc-9de7-e72ea77eacac/scratchpad/graph-test-results.md (copied below; do not depend on the paths).
Observed
dedup.py:273; cross-file labels of 12 or more characters use plain Jaro,dedup.py:1441-1443). They did not merge. The real link (user-guide/rubyllm-429-retry-after-cap.mdline 57, "conflicts with graceful-rate-limits-automation-standard") sits on the duplicate. A path call gave a spurious 4-hop route through unrelated nodes.graphify_reference_stub. The extraction prompt (llm.py:542-552) says to model a referenced file as a node attributed to the enclosing file. Stub "RuboCop Todo Exclude Masks Explicit Paths" has sourcerubocop-monorepo-config-discovery.md.reference/gitignore-trailing-slash-does-not-match-symlinks.md. A dangling stub "Git ignore trailing slash does not match symlinks" is attributed toreference/git-worktree-ignores-per-worktree-info-exclude.mdandclaude-code-worktrees-hub.md.rubocop-todo-exclude-masks-explicit-paths.mdis in the graph but not returned. The returned start node is the stub. The answer file name never appears.referencesedges come from the LLM.Reproduce
The start node is the stub, not the note.
Approach
Merge each duplicate pair into one node, and keep the edges of both. Attribute a wikilink stub to its target note, or replace it with an edge to the target note's own node. Do both in the vault build or in a step after the build. Do not rely on a lower threshold alone, because prefix-extension pairs are blocked by design (
dedup.py:1456).Required work: none beyond the acceptance criteria.
Orchestrator work: rebuild the vault graph and re-run questions 4, 6 and 11.
Acceptance criteria
conflicts_withedge from the RubyLLM note is on it.rubocop-todo-exclude-masks-explicit-paths.md.Non-goals
Graphify upstream fixes (see the upstream report ticket). Missing-note indexing (see the missing-nodes ticket).
Origin
path --undirectedto see the spurious route./os-backlog:ticket-decompose routed this to
/os-sdlc:ticket-takedownbecause the owner is a new object.One change: a model-free post-pass after the second update that folds reference stubs into note page nodes and merges duplicates through an explicit list. Owner: new object beside
stub_markdown_pages.py, working namefold_reference_stubs.py; its secret is the rule for what counts as the same thing. Measured on 2524 nodes: 176 stubs, all with the citing note as source, 73 naming an existing note; 46 exact-label groups, many legitimate ('Related', 'See Also', 'CC-OS'), so no threshold merge. Unverified: a post-step survivinggraphify update; incremental merge leaves old notes unmerged until a full rebuild. Runs after #1571.Resolution
Done: Closed by measurement. No fold or merge built.
Evidence: With #1571 on the current graph, Q4 (3 hops), Q6 (rank 1), Q11 (note rank 2) pass, so AC 3 already holds. All five reworded misses fail at start nodes on word mismatch: P-Q1 and S-Q9 have a duplicate or stub, but the question shares no term with it, and 4 of 5 stay absent at budget 40000. results-after-1571, rulings.tsv 69.
Follow-ups: none: the start-node gap is #1573