graphmark 0.3.3__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {graphmark-0.3.3 → graphmark-0.4.0}/CHANGELOG.md +112 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/PKG-INFO +39 -1
- {graphmark-0.3.3 → graphmark-0.4.0}/README.md +38 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/docs/ROADMAP.md +53 -30
- {graphmark-0.3.3 → graphmark-0.4.0}/pyproject.toml +1 -1
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/__init__.py +13 -1
- graphmark-0.4.0/src/graphmark/graph.py +329 -0
- graphmark-0.4.0/tests/test_diagnose.py +228 -0
- graphmark-0.4.0/tests/test_graph_catalogs.py +152 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_public_api.py +5 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_unresolved.py +103 -0
- graphmark-0.3.3/src/graphmark/graph.py +0 -183
- {graphmark-0.3.3 → graphmark-0.4.0}/.gitignore +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/LICENSE +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/check.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/cli.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/config.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/dismiss.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/export.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/interfaces.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/metrics.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/model.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/parse.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/src/graphmark/py.typed +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/README.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/config.toml +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/expected.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/daily/2026-07-01.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/docs/alpha.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/docs/center.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/misc/echo.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/misc/foxtrot.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/misc/orphan.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/misc/stub.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/refs/beta.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/refs/delta.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/alt/vault/refs/gamma.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/dismiss/expected.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/dismiss/vault/.claude/data/connect-dismissed.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/dismiss/vault/alpha.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/dismiss/vault/beta.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/dismiss/vault/gamma.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/config.toml +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/expected.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/expected_oog.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/similar.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/similar_oog.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/vault/docs/a.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/vault/docs/hub.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/vault/misc/c.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/vault/misc/d.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/vault/refs/b.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/gaps/vault/refs/e.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/scoped/config.toml +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/scoped/expected.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/scoped/vault/docs/one.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/scoped/vault/junk/ignored.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/scoped/vault/misc/excluded.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/scoped/vault/refs/two.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/selflink/config.toml +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/selflink/expected.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/selflink/vault/a.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/selflink/vault/b.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/simple/config.toml +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/simple/expected.json +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/simple/vault/brain/alpha.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/simple/vault/brain/hub.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/simple/vault/personal/beta.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/simple/vault/personal/gamma.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/simple/vault/reference/island.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/fixtures/simple/vault/reference/stub.md +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_build_filters.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_check.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_check_policy.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_cli.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_config.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_degenerate.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_dismiss.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_export.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_gaps.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_gaps_banding.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_gaps_oog.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_gaps_params.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_graph.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_metrics.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_model.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_packaging.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_pagerank.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_parse.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_scoped.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_selflink.py +0 -0
- {graphmark-0.3.3 → graphmark-0.4.0}/tests/test_smoke.py +0 -0
|
@@ -1,6 +1,118 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## v0.4.0 (2026-07-25)
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
- **graph**: Add diagnose() — why a link failed, not just that it did (#111)
|
|
9
|
+
([#114](https://github.com/cdcoonce/graphmark/pull/114),
|
|
10
|
+
[`1d124a3`](https://github.com/cdcoonce/graphmark/commit/1d124a3423fc5a6f3c8a0a084e8d15927dd1d828))
|
|
11
|
+
|
|
12
|
+
Track E slice 2. graph.unresolved conflates two problems needing opposite repairs: a link matching
|
|
13
|
+
NOTHING wants its target created or deleted, a link matching TOO MUCH wants disambiguating against
|
|
14
|
+
what it collided with. A consumer holding only unresolved cannot tell them apart, so it rebuilds
|
|
15
|
+
the resolver — the drift this track exists to end.
|
|
16
|
+
|
|
17
|
+
diagnose(graph, display) returns a frozen LinkDiagnosis: display echoed verbatim, target when
|
|
18
|
+
resolved, one of the six DIAGNOSIS_REASONS, and the rel_paths in play (the colliding notes for
|
|
19
|
+
ambiguous, the unindexed markdown for out-of-scope-note). The reason set is exported as a tuple in
|
|
20
|
+
decision order so a consumer can switch on it exhaustively.
|
|
21
|
+
|
|
22
|
+
build() now classifies through the same function rather than agreeing with it separately — two
|
|
23
|
+
classifiers in one package would recreate the drift inside the package. Two property tests pin
|
|
24
|
+
them together: unresolved is exactly the ambiguous+missing displays, edges are exactly the
|
|
25
|
+
resolved non-self targets.
|
|
26
|
+
|
|
27
|
+
candidates_for() consolidates the two-branch matching that _targets_out_of_scope_note had duplicated
|
|
28
|
+
from the resolver. It reports matches only; deciding uniqueness stays the Resolver's job, so the
|
|
29
|
+
two cannot disagree about which notes were in play. The graph now also retains the resolver it was
|
|
30
|
+
built with, so a diagnosis can never contradict its own graph.
|
|
31
|
+
|
|
32
|
+
Behavior is unchanged: on the live vault, 130 unresolved / 3582 edges both before and after, and all
|
|
33
|
+
six frozen fixtures byte-identical. What is new is the answer — 8 of those 130 are ambiguous
|
|
34
|
+
collisions ([[2026-W27-tasks]] existing under both personal/archive and work/archive,
|
|
35
|
+
[[RESOURCES]] under four learning folders), which the old surface reported as plain breaks.
|
|
36
|
+
|
|
37
|
+
- **graph**: Retain catalog + out_of_scope on the built graph (#110)
|
|
38
|
+
([#113](https://github.com/cdcoonce/graphmark/pull/113),
|
|
39
|
+
[`7f7a91c`](https://github.com/cdcoonce/graphmark/commit/7f7a91cae961a06155f565384a429c92356868fb))
|
|
40
|
+
|
|
41
|
+
* docs(roadmap): close Tracks C and D, open Track E (#110-#112)
|
|
42
|
+
|
|
43
|
+
afk-driver --expand reads this file verbatim, so a stale one makes the fleet propose already-built
|
|
44
|
+
work and pollutes the telemetry dataset. It still targeted "v0.2.0 — every error path tested"
|
|
45
|
+
while the package is 0.3.4 with Tracks C and D both fully shipped.
|
|
46
|
+
|
|
47
|
+
Track C closed (every item landed at 0.2.0). Track D marked shipped at 0.3.0, with its real
|
|
48
|
+
remaining risk named: the credibility of its flagship number. Four false-positive classes have now
|
|
49
|
+
been found by triaging a live vault against max_unresolved_links — #98 anchors (19%), #101
|
|
50
|
+
non-markdown (10%), #104 the .md extension, #107 out-of-scope notes (7%) — so "keep truthing the
|
|
51
|
+
metric before shipping a GitHub Action that fails someone's build" is the direction, not more
|
|
52
|
+
surface.
|
|
53
|
+
|
|
54
|
+
Track E opened: absorb the consumer's second link stack. graphmark says whether a link resolves; the
|
|
55
|
+
gardener needs to know why it failed and what to do about it, which is why it still carries its
|
|
56
|
+
own resolver and why #107 had to be fixed in two places. Sliced #110/#111/#112, with #112 flagged
|
|
57
|
+
not-autonomous-safe past freezing the baseline — its expected values are human judgment, not
|
|
58
|
+
oracle-derived.
|
|
59
|
+
|
|
60
|
+
* feat(graph): retain catalog + out_of_scope on the built graph (#110)
|
|
61
|
+
|
|
62
|
+
Track E slice 1. build() computed both mappings and threw both away, so a consumer that needs to say
|
|
63
|
+
anything about a link beyond "resolved / didn't" had to rebuild the entire parse/catalog/resolve
|
|
64
|
+
stack. the-vault's graph_gardener.py does exactly that, and the two stacks drift: #107 was the
|
|
65
|
+
fourth resolution fix that had to be applied in two places.
|
|
66
|
+
|
|
67
|
+
graph.catalog is normalized stem → in-scope rel_paths; a key with two or more paths IS an ambiguity
|
|
68
|
+
set, which is what lets a consumer say WHICH notes a bare link collided with instead of only that
|
|
69
|
+
it failed. graph.out_of_scope is the same for markdown outside the configured scope, retained from
|
|
70
|
+
#107. Both are constructor-optional, so three-positional construction keeps working.
|
|
71
|
+
|
|
72
|
+
Value lists are sorted by rel_path explicitly rather than inheriting the walk's order. Those
|
|
73
|
+
disagree: sorted(rglob) orders Path objects by parts tuple, yielding a/note.md before a-b/note.md,
|
|
74
|
+
while rel_path string order is the reverse ('-' < '/'). The first version of the ordering tests
|
|
75
|
+
used paths where the two agree, so deleting the sorts left the suite green — caught by mutation,
|
|
76
|
+
and the tests now use the discriminating case.
|
|
77
|
+
|
|
78
|
+
No behavior change: nothing about what resolves or what an edge is moves, and every frozen fixture
|
|
79
|
+
is byte-identical.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## v0.3.4 (2026-07-25)
|
|
83
|
+
|
|
84
|
+
### Bug Fixes
|
|
85
|
+
|
|
86
|
+
- **graph**: Links to existing out-of-scope notes are not broken (#107)
|
|
87
|
+
([#108](https://github.com/cdcoonce/graphmark/pull/108),
|
|
88
|
+
[`9e386f6`](https://github.com/cdcoonce/graphmark/commit/9e386f6df700b1d866b7d50854b0cc8734a08bf5))
|
|
89
|
+
|
|
90
|
+
build() dropped unscoped folders, excluded dirs and rules files from the catalog and then forgot
|
|
91
|
+
they existed, so a link to one failed the resolver and landed in unresolved. The link is correct —
|
|
92
|
+
Obsidian follows it — it just points somewhere graphmark deliberately does not index, so there was
|
|
93
|
+
nothing for anyone to fix. On the live vault that was 11 of 155 reported breaks: 8 [[CLAUDE]], 1
|
|
94
|
+
[[AGENTS]], 2 into templates/.
|
|
95
|
+
|
|
96
|
+
The same rglob that builds the catalog now records what it skipped, so no extra I/O buys the ability
|
|
97
|
+
to tell "exists but out of scope" apart from "exists nowhere". Consulted only AFTER the resolver
|
|
98
|
+
fails — mirroring _targets_non_note_file — so an in-graph note always wins over an out-of-scope
|
|
99
|
+
namesake and keeps its edge. Any candidate suppresses: out-of-scope notes are never link targets,
|
|
100
|
+
so ambiguity among them says nothing about whether the in-graph link is broken.
|
|
101
|
+
|
|
102
|
+
Alias/anchor/.md stripping moved into a shared _strip_display so the resolver and the new check
|
|
103
|
+
cannot drift on what a display names. That refactor also strips surrounding whitespace, which the
|
|
104
|
+
resolver did not: 13 column-aligned links of the form [[folder/note | alias]] were reported broken
|
|
105
|
+
while pointing at real notes, and now resolve into edges (3570 → 3583 on the live vault). Covered
|
|
106
|
+
by its own test class.
|
|
107
|
+
|
|
108
|
+
Fixtures are untouched: only the unresolved path changes shape, no expected.json carries an
|
|
109
|
+
unresolved key, and edges only grow via the whitespace fix. uv.lock catches up to the 0.3.3
|
|
110
|
+
release bump.
|
|
111
|
+
|
|
112
|
+
Live vault: 155 → 130 unresolved (12 suppressed, 13 resolved), no genuine break lost — verified by
|
|
113
|
+
diffing the full before/after sets.
|
|
114
|
+
|
|
115
|
+
|
|
4
116
|
## v0.3.3 (2026-07-25)
|
|
5
117
|
|
|
6
118
|
### Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphmark
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Deterministic knowledge-graph analysis for markdown / [[wikilink]] vaults.
|
|
5
5
|
Project-URL: Homepage, https://github.com/cdcoonce/graphmark
|
|
6
6
|
Project-URL: Repository, https://github.com/cdcoonce/graphmark
|
|
@@ -183,8 +183,46 @@ graphmark.siloed_notes(graph) # reachable only through a single
|
|
|
183
183
|
graphmark.neighborhood(graph, "a/b.md", depth=2)
|
|
184
184
|
graphmark.to_dot(graph) # Graphviz DOT
|
|
185
185
|
graph.unresolved # {rel_path: [broken link displays]}
|
|
186
|
+
graph.catalog # {normalized stem: [rel_paths]} — 2+ means ambiguous
|
|
187
|
+
graph.out_of_scope # same, for markdown outside the configured scope
|
|
186
188
|
```
|
|
187
189
|
|
|
190
|
+
`catalog` and `out_of_scope` are the resolution state the build consulted. They are what you need to
|
|
191
|
+
explain a link rather than just resolve it — which notes a bare `[[link]]` collided with, or whether
|
|
192
|
+
a link that failed to resolve points at a real file you deliberately excluded. Value lists are
|
|
193
|
+
sorted by rel_path.
|
|
194
|
+
|
|
195
|
+
## `diagnose` — why a link failed, not just that it did
|
|
196
|
+
|
|
197
|
+
`graph.unresolved` conflates two different problems. A link that matched _nothing_ needs its target
|
|
198
|
+
created or deleted; a link that matched _too much_ needs disambiguating against the notes it
|
|
199
|
+
collided with. `diagnose` separates them, and names the three cases that are not broken at all.
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
d = graphmark.diagnose(graph, "2026-W27-tasks|W27 tasks")
|
|
203
|
+
|
|
204
|
+
d.reason # 'ambiguous'
|
|
205
|
+
d.candidates # ('personal/archive/tasks/2026-W27-tasks.md', 'work/archive/2026/tasks/2026-W27-tasks.md')
|
|
206
|
+
d.target # None — set only when reason == 'resolved'
|
|
207
|
+
d.display # echoed verbatim: what a human has to go and fix
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
| `reason` | meaning | `candidates` |
|
|
211
|
+
| ------------------- | -------------------------------------------------------------- | ------------------- |
|
|
212
|
+
| `resolved` | names exactly one note; `target` is its rel_path | — |
|
|
213
|
+
| `ambiguous` | names several notes, so the resolver refused to pick | the colliding notes |
|
|
214
|
+
| `non-note-file` | targets a `.canvas` / `.base` / image / PDF — not indexed here | — |
|
|
215
|
+
| `out-of-scope-note` | targets real markdown outside the configured scope | the unindexed paths |
|
|
216
|
+
| `missing` | names nothing that exists — a genuine broken link | — |
|
|
217
|
+
| `intra-note` | `[[#Heading]]` / `[[#^block]]` — a same-note reference | — |
|
|
218
|
+
|
|
219
|
+
`DIAGNOSIS_REASONS` holds that set in decision order, so a consumer can switch on it exhaustively.
|
|
220
|
+
Alias, anchor and `.md` forms all diagnose identically to the bare form.
|
|
221
|
+
|
|
222
|
+
`VaultGraph.build` classifies its own links through this same function, so a diagnosis can never
|
|
223
|
+
contradict the graph it describes: `unresolved` is exactly the displays diagnosing as `ambiguous` or
|
|
224
|
+
`missing`, and the edges are exactly the `resolved` non-self targets.
|
|
225
|
+
|
|
188
226
|
## Configuration
|
|
189
227
|
|
|
190
228
|
```toml
|
|
@@ -156,8 +156,46 @@ graphmark.siloed_notes(graph) # reachable only through a single
|
|
|
156
156
|
graphmark.neighborhood(graph, "a/b.md", depth=2)
|
|
157
157
|
graphmark.to_dot(graph) # Graphviz DOT
|
|
158
158
|
graph.unresolved # {rel_path: [broken link displays]}
|
|
159
|
+
graph.catalog # {normalized stem: [rel_paths]} — 2+ means ambiguous
|
|
160
|
+
graph.out_of_scope # same, for markdown outside the configured scope
|
|
159
161
|
```
|
|
160
162
|
|
|
163
|
+
`catalog` and `out_of_scope` are the resolution state the build consulted. They are what you need to
|
|
164
|
+
explain a link rather than just resolve it — which notes a bare `[[link]]` collided with, or whether
|
|
165
|
+
a link that failed to resolve points at a real file you deliberately excluded. Value lists are
|
|
166
|
+
sorted by rel_path.
|
|
167
|
+
|
|
168
|
+
## `diagnose` — why a link failed, not just that it did
|
|
169
|
+
|
|
170
|
+
`graph.unresolved` conflates two different problems. A link that matched _nothing_ needs its target
|
|
171
|
+
created or deleted; a link that matched _too much_ needs disambiguating against the notes it
|
|
172
|
+
collided with. `diagnose` separates them, and names the three cases that are not broken at all.
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
d = graphmark.diagnose(graph, "2026-W27-tasks|W27 tasks")
|
|
176
|
+
|
|
177
|
+
d.reason # 'ambiguous'
|
|
178
|
+
d.candidates # ('personal/archive/tasks/2026-W27-tasks.md', 'work/archive/2026/tasks/2026-W27-tasks.md')
|
|
179
|
+
d.target # None — set only when reason == 'resolved'
|
|
180
|
+
d.display # echoed verbatim: what a human has to go and fix
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
| `reason` | meaning | `candidates` |
|
|
184
|
+
| ------------------- | -------------------------------------------------------------- | ------------------- |
|
|
185
|
+
| `resolved` | names exactly one note; `target` is its rel_path | — |
|
|
186
|
+
| `ambiguous` | names several notes, so the resolver refused to pick | the colliding notes |
|
|
187
|
+
| `non-note-file` | targets a `.canvas` / `.base` / image / PDF — not indexed here | — |
|
|
188
|
+
| `out-of-scope-note` | targets real markdown outside the configured scope | the unindexed paths |
|
|
189
|
+
| `missing` | names nothing that exists — a genuine broken link | — |
|
|
190
|
+
| `intra-note` | `[[#Heading]]` / `[[#^block]]` — a same-note reference | — |
|
|
191
|
+
|
|
192
|
+
`DIAGNOSIS_REASONS` holds that set in decision order, so a consumer can switch on it exhaustively.
|
|
193
|
+
Alias, anchor and `.md` forms all diagnose identically to the bare form.
|
|
194
|
+
|
|
195
|
+
`VaultGraph.build` classifies its own links through this same function, so a diagnosis can never
|
|
196
|
+
contradict the graph it describes: `unresolved` is exactly the displays diagnosing as `ambiguous` or
|
|
197
|
+
`missing`, and the edges are exactly the `resolved` non-self targets.
|
|
198
|
+
|
|
161
199
|
## Configuration
|
|
162
200
|
|
|
163
201
|
```toml
|
|
@@ -22,11 +22,13 @@ story** — the priority consumer is the owner's vault seam (`graph_cli.py`), no
|
|
|
22
22
|
|
|
23
23
|
## What's shipped (baseline — do not re-propose)
|
|
24
24
|
|
|
25
|
-
- **The full engine, v0.
|
|
26
|
-
`graph.py` (catalog + `NormalizeResolver` + `VaultGraph.build`), `metrics.py`
|
|
27
|
-
hubs, clusters, bridges, siloed_notes, neighborhood, pure-python pagerank,
|
|
28
|
-
`export.py` (JSON/DOT), `cli.py`, `config.py`
|
|
29
|
-
`dismiss.py` (content-hash weaklink
|
|
25
|
+
- **The full engine, v0.3.4 on PyPI**: `parse.py` (wikilink extraction, code-span skipping),
|
|
26
|
+
`graph.py` (catalog + `NormalizeResolver` + `VaultGraph.build` + `unresolved`), `metrics.py`
|
|
27
|
+
(stats, orphans, hubs, clusters, bridges, siloed_notes, neighborhood, pure-python pagerank,
|
|
28
|
+
gaps), `check.py` (policy evaluation), `export.py` (JSON/DOT), `cli.py`, `config.py`
|
|
29
|
+
(`VaultConfig` + `CheckPolicy` + `load_config`), and `dismiss.py` (content-hash weaklink
|
|
30
|
+
dismissal store). Tracks A, C and D are all closed — read their sections before proposing
|
|
31
|
+
anything in those areas.
|
|
30
32
|
- **Six frozen differential fixtures** — simple, alt, scoped, selflink, gaps (+ out-of-graph),
|
|
31
33
|
dismiss — plus live-vault parity diffs against the reference engine.
|
|
32
34
|
- **`gaps()` with injected similarity** — graphmark owns the deterministic ranking/filtering
|
|
@@ -41,38 +43,59 @@ story** — the priority consumer is the owner's vault seam (`graph_cli.py`), no
|
|
|
41
43
|
|
|
42
44
|
### Track A — Engine parity (CLOSED at v0.1.1 — do not re-propose engine work)
|
|
43
45
|
|
|
44
|
-
### Track C — Hardening & honest surface (
|
|
46
|
+
### Track C — Hardening & honest surface (CLOSED at v0.2.0 — do not re-propose)
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
Every item shipped: version single-sourcing, non-UTF8 notes, dismiss-store JSON guards,
|
|
49
|
+
`load_config` errors, DOT escaping, `neighborhood` on an unknown note, the dead-surface cut
|
|
50
|
+
(`model.Edge/Graph/Finding` gone — `Document` is the only model type; the no-op `wikilink_pattern`
|
|
51
|
+
/ `orphan_min_chars` knobs gone; the CLI `gaps` stub exits 2), the `GAPS_DEFAULT_*` banding
|
|
52
|
+
constants, and the `Similarity` Protocol. `py.typed`, the 3.11–3.13 CI matrix, `--version`, and
|
|
53
|
+
unified exit-code 2 for usage errors came with it.
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
- Robustness: non-UTF8 note handling in `parse_document`; JSON-corruption guards in
|
|
52
|
-
`dismiss.load_dismissed` / `active_dismissed_sigs`; `load_config` clear error on missing keys;
|
|
53
|
-
DOT identifier escaping in `to_dot`; defined behavior for `neighborhood` on an unknown note.
|
|
54
|
-
- Cut or wire dead surface: `model.Edge/Graph/Finding` (never consumed — **removed in the 0.2 API
|
|
55
|
-
cut; `Document` is the only model type**); the CLI `gaps` stub
|
|
56
|
-
(null `similar_fn` — always `[]`); the silent no-op config knobs `wikilink_pattern` and
|
|
57
|
-
`orphan_min_chars` (wire them or delete them); make the dismissal-store path injectable instead
|
|
58
|
-
of hardcoding `.claude/data/connect-dismissed.json`.
|
|
59
|
-
- Move the validated gaps banding policy (threshold / max-score / k / hub-degree defaults) from the
|
|
60
|
-
consumer's argparse into the package so any consumer gets the proven band.
|
|
61
|
-
- A `Similarity` Protocol in `interfaces.py` typing the injected `similar_fn`.
|
|
62
|
-
|
|
63
|
-
_The principle:_ each slice is single-purpose with its asserting test **pre-frozen by the
|
|
64
|
-
conductor before dispatch** — the oracle-first discipline that closed the zero-test hole.
|
|
65
|
-
|
|
66
|
-
### Track D — `graphmark check`: the deterministic CI gate (feature track)
|
|
55
|
+
### Track D — `graphmark check`: the deterministic CI gate (SHIPPED at v0.3.0)
|
|
67
56
|
|
|
68
57
|
The one unserved niche the ecosystem offers: **headless vault-health gating**. Obsidian's official
|
|
69
58
|
CLI requires the desktop app; the dormant Python incumbent has no CLI; link checkers do no graph
|
|
70
59
|
metrics.
|
|
71
60
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
61
|
+
Shipped: `graph.unresolved`, the `[check]` policy block (`max_orphans` /
|
|
62
|
+
`max_unresolved_links` / `max_siloed`, strict on unknown keys), `graphmark check` with exit 1
|
|
63
|
+
reserved for breach and a byte-stable JSON report, `graphmark.build()` + curated top-level
|
|
64
|
+
re-exports, and a README rewritten around the real surface.
|
|
65
|
+
|
|
66
|
+
_Where we are (0.3.4):_ the gate works and the vault dogfoods it. The remaining risk is the
|
|
67
|
+
**credibility of its flagship number**. Four false-positive classes have been found and fixed by
|
|
68
|
+
triaging a real vault against the metric — same-note anchors (#98, 19% of the count),
|
|
69
|
+
non-markdown targets (#101, 10%), the `.md` extension (#104), and links to notes that exist but
|
|
70
|
+
are out of graph scope (#107, 7%). A threshold nobody trusts is not a gate.
|
|
71
|
+
|
|
72
|
+
_Where we're going:_ keep truthing the metric against live vaults, then the thin GitHub Action
|
|
73
|
+
wrapper — but only once the count is trustworthy enough to fail someone's build.
|
|
74
|
+
|
|
75
|
+
### Track E — One resolver: absorb the consumer's second link stack (feature track)
|
|
76
|
+
|
|
77
|
+
_The problem:_ the-vault's `graph_gardener.py` (Lane A) carries its **own** parse / catalog /
|
|
78
|
+
normalize / resolve stack, independent of this package's. The two drift, and drift here is
|
|
79
|
+
user-visible: the gardener spent weeks proposing repairs for working links that graphmark had
|
|
80
|
+
already learned were fine. #107 is the fourth fix that had to be applied in two places.
|
|
81
|
+
|
|
82
|
+
The gardener's stack survives because it answers questions graphmark cannot yet answer. graphmark
|
|
83
|
+
says _whether_ a link resolves; Lane A needs to know **why it failed and what to do about it** —
|
|
84
|
+
the ambiguity set, the near-miss candidates behind a "did you mean", and the canonical title of
|
|
85
|
+
the note a display resolves to (so `[[ethan courtman]]` can be repaired to `[[Ethan Courtman]]`).
|
|
86
|
+
|
|
87
|
+
_Where we're going:_ a documented, typed **link-diagnosis** surface that makes the consumer a
|
|
88
|
+
formatter over graphmark's answers instead of a second resolver. The classification is already
|
|
89
|
+
implicit in `build` — resolved / ambiguous / out-of-scope note / non-note file / intra-note
|
|
90
|
+
reference / missing — it is simply thrown away. Candidate suggestion is the one genuinely new
|
|
91
|
+
behavior, and it is the piece a human must confirm: freeze a differential oracle from the current
|
|
92
|
+
gardener's hints on a real vault before changing anything.
|
|
93
|
+
|
|
94
|
+
Sliced as #110 (retain the catalogs), #111 (`LinkDiagnosis` + `diagnose()`), #112 (near-miss
|
|
95
|
+
suggestions — **not autonomous-safe past freezing the baseline**; the human annotation gate is the
|
|
96
|
+
point of it). The consumer-side deletion is hand-coded in the vault; the package side is afk-able.
|
|
97
|
+
|
|
98
|
+
_Constraint:_ this is additive. Nothing here may change what resolves or what an edge is.
|
|
76
99
|
|
|
77
100
|
### Track B — Judgment the oracle can't cover (human-validated)
|
|
78
101
|
|
|
@@ -26,7 +26,15 @@ from graphmark.dismiss import (
|
|
|
26
26
|
weaklink_sig,
|
|
27
27
|
)
|
|
28
28
|
from graphmark.export import to_dot, to_json
|
|
29
|
-
from graphmark.graph import
|
|
29
|
+
from graphmark.graph import (
|
|
30
|
+
DIAGNOSIS_REASONS,
|
|
31
|
+
LinkDiagnosis,
|
|
32
|
+
NormalizeResolver,
|
|
33
|
+
VaultGraph,
|
|
34
|
+
build_catalog,
|
|
35
|
+
candidates_for,
|
|
36
|
+
diagnose,
|
|
37
|
+
)
|
|
30
38
|
from graphmark.interfaces import LinkExtractor, Resolver, Similarity
|
|
31
39
|
from graphmark.metrics import (
|
|
32
40
|
GAPS_DEFAULT_BAND,
|
|
@@ -87,6 +95,8 @@ __all__ = [
|
|
|
87
95
|
"CheckPolicy",
|
|
88
96
|
"Document",
|
|
89
97
|
"LinkExtractor",
|
|
98
|
+
"DIAGNOSIS_REASONS",
|
|
99
|
+
"LinkDiagnosis",
|
|
90
100
|
"NormalizeResolver",
|
|
91
101
|
"Resolver",
|
|
92
102
|
"Similarity",
|
|
@@ -98,6 +108,8 @@ __all__ = [
|
|
|
98
108
|
"bridges",
|
|
99
109
|
"build",
|
|
100
110
|
"build_catalog",
|
|
111
|
+
"candidates_for",
|
|
112
|
+
"diagnose",
|
|
101
113
|
"clusters",
|
|
102
114
|
"gaps",
|
|
103
115
|
"hubs",
|