Skip to content

v0.4.0 — LLM extraction + write path, MCP parity, retrieval quality, analytics, watch mode - #1

Merged
jeremymcs merged 22 commits into
mainfrom
feat/v0.3.0-llm-extraction-and-fixes
Aug 5, 2026
Merged

jeremymcs merged 22 commits into
mainfrom
feat/v0.3.0-llm-extraction-and-fixes

Conversation

@jeremymcs

@jeremymcs jeremymcs commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Ships v0.3.0 (LLM extraction, Anthropic adapter, export/why) plus the full v0.4.0 recommendation set from the team evaluation — 8 high-impact features, 6 foundational items, and the polish list.

High-impact (v0.4.0)

  • Agent/user write path: assert/retract CLI + MCP graph_assert/graph_retract (new --allow-assert gate); facts flow through the normal ontology/review gates into append-only episodes.jsonl and survive full rebuilds
  • MCP parity: graph_why, graph_resolve, graph_diff, graph_communities read tools; gated graph_sync; gsd-graph://report + gsd-graph://communities resources
  • Global theme answers: overview questions answer from community detection (mode global) instead of abstaining
  • Retrieval recall: stem-aware seeding + did-you-mean suggestions on abstain; opt-in embedding sidecar behind a SeedScorer fallback seam (ask --semantic)
  • Relevance-ranked trimming + [EXTRACTED ×3] citation trust tags
  • Conflict surfacing + supersession (conflict review kind, gsd-graph supersede, provenance first_seen/last_seen)
  • YAML + frontmatter extraction via a new pluggable extractor registry

Foundations

Store migration registry + built_at_commit, mtime-keyed graph cache + GsdGraph.open() facade, gsd-graph eval QA harness, ontology single-level extends + project-local packs + ontology eject, prompts/*.md wired into LLM stages with prompt_version provenance

Polish

Friendly first-run error (STORE_NOT_FOUND instead of path_escape), human TTY output for ask/why/status/query/top, review-queue triage (review summary), watch mode + plain git post-commit hook, export --open, top (PageRank/degree), why --k alternative routes, graph-first routing in SKILL.md

Test plan

  • 429 tests pass (up from 373); coverage gate at 84% lines (≥80% required)
  • New suites: migrations, graph-cache, extract-yaml, retrieval-recall, relevance-ranking, global-answer, conflict-supersede, mcp-parity, assert-retract, eval-harness, prompt-templates, ontology-eject, embeddings, top-analytics, watch-githook

🤖 Generated with Claude Code

…, ontology + extraction fixes

Fixes:
- init --ontology is persisted and honored by build/sync (was always 'general');
  --ontology flag added to build and sync
- engineering pack gains blocked_by/requires/uses/implements/delivers/precedes/
  supports/mentions/Topic; depends_on domain opened
- headings no longer emit degenerate Document--about-->Topic self-echo triples
- IDF-weighted seed scoring; distinct abstain reasons (no_seeds_matched /
  seeds_disconnected / empty_subgraph)
- citations project all provenance sources with line spans (path:line)
- linear-time budget trim + path materialization; removed dead answerHttp branch

Features:
- build/sync --llm [prompt|http]: LLM-assisted extraction — prompt-file mode for
  host agents (merge via 'prompt apply extract') or live HTTP mode; candidates
  clamped to INFERRED with llm/* provenance, still ontology/review gated
- Anthropic-native /v1/messages adapter (provider: anthropic); ask --llm http
  now performs live grounded answers
- gsd-graph why <a> <b>: shortest path explained as cited prose
- gsd-graph export --format mermaid|graphml|cypher|html (self-contained viewer)
- review accept/reject --all/--kind/--predicate batch resolve under one lock
- alias/acronym suggest-only entity_merge review items
- hooks: sync_on_feature_branches opt-in; failed syncs keep logs + stderr_tail
…rst-run error

- forward-only graph.v1 migration registry (registerGraphMigration) applied in loadGraphV1; newer-engine stores fail closed
- build/mergeCandidates stamp built_at_commit from git HEAD (null outside a repo)
- missing store now raises STORE_NOT_FOUND with 'run gsd-graph enable' hint instead of schema_invalid/path_escape
- confineUnderRoot no longer misreports first-run lookups under a not-yet-created store root as PATH_ESCAPE
- loadGraphV1Cached keyed on (mtime,size,ino) of graph.v1.json; read pipelines (query/pack/why/status/communities) reuse the parsed doc until republish
- buildAdjacencyMap memoized per document via WeakMap — pack path-pairs and long-lived MCP servers stop re-indexing every call
- GsdGraph.open() embedding facade: status/query/pack/ask/why/communities from one handle
- extension-keyed extractor registry (registerExtractor); built-ins markdown/jsonl/json-document/yaml; discovery defaults derive from the registry
- dependency-free flat-YAML extractor: title/description as Document fields, tags→mentions Topic edges, relational keys (depends_on, blocked_by, requires, …) as ontology-gated Concept edges, other scalars folded into searchable description
- markdown frontmatter routed through the YAML mapping; frontmatter no longer leaks junk Concept definitions; body structure attaches to the frontmatter Document
- plural/singular variant matching in seed scoring ('phases' seeds 'phase', 'dependency' seeds 'dependencies') via multi-variant stems on both sides
- no_seeds_matched abstains now carry top-5 near-miss labels (bounded edit distance over label/alias word stems) as pack.seed_suggestions and answer.suggestions
- applyBudget accepts a relevance scorer; pack trims by confidence-dominant score with seed proximity, predicate weight (mentions=noise), and provenance count as tie-breakers — the budget stops evicting the answering triple
- PackCitation carries confidence + source_count; answer markdown renders [EXTRACTED ×3]-style trust tags; why citations show tier
- ask/answer now falls back to community detection (mode 'global') when an overview-shaped question packs empty, or --global/global:true forces it
- theme sections list key nodes, main relationships, and representative cited triples; citations stay a subset of pack triples
- 'conflict' review kind: reciprocal cycles on directional predicates and supports/contradicts on same endpoints go to the review queue (both triples still written — surfacing, not suppression); accept is record-only
- gsd-graph supersede <winner> <loser> records decision reversals; superseded facts rank a full confidence tier lower, citations flag [superseded]
- provenance entries stamp first_seen/last_seen at normalize; re-observed evidence bumps last_seen
…ed graph_sync, store resources

- default read tools now include graph_why (cited path prose), graph_resolve (term→id with did-you-mean), graph_diff, graph_communities (read-only unless write=true)
- graph_sync incremental project sync behind the allow-build gate; graph_answer gains global flag
- GRAPH_REPORT.md and community theme reports exposed as MCP resources (gsd-graph://report, gsd-graph://communities)
- gsd-graph assert <s> <p> <o>: resolves/creates endpoints, merges through the normal ontology/review/provenance gates, records to append-only episodes.jsonl; --supersedes records reversals
- gsd-graph retract <tripleId>: removes and logs; full rebuilds replay episodes so asserts survive and retractions keep holding (last action per key wins)
- MCP graph_assert/graph_retract behind new --allow-assert gate (actor agent/mcp)
- runEval executes a QA case file (evals/gsd-graph.json) against the store: pass/fail per case, seed recall, citation-validity invariant, abstain/mode expectations, why-path checks
- CLI 'gsd-graph eval' exits non-zero when cases fail; evals/example.json documents the format
…t_version

- extract/answer system prompts now compose from prompts/<stage>.md (store-local prompts/ override wins over shipped default) — the main LLM quality lever is finally user-tunable
- template content hash recorded as prompt_version on every LLM-derived provenance entry (schema + types)
- packs may extend one base (collision-error on duplicate predicate ids; node types dedupe; child policies win); base may not itself extend
- pack ids resolve project-local ontology-packs/<id>/ first, then the shipped pack
- gsd-graph ontology eject materializes active pack + accepted lock extensions into a committable ontology-packs/<id>-local/ pack and repoints store config
- embeddings.v1.json sidecar: node labels/aliases embedded via any OpenAI-compatible endpoint (store config llm.embeddings), incremental by text hash, disposable and offline-default
- SeedScorer interface + registry; semantic candidates consulted ONLY when lexical seeding finds nothing — expand/budget/citations stay deterministic
- answerSemantic + ask --semantic retry a no_seeds_matched abstain with sidecar candidates; embeddings build/status CLI
- review summary (counts by kind, top proposed predicates, batch-accept hints), review list --kind/--limit, sync wrap-up nudge at 25+ pending items
- ask/why/status/query render human text on an interactive TTY (JSON when piped/--json/CI); abstains print did-you-mean suggestions
- status prints prescriptive next steps; export --open launches the html viewer
- gsd-graph top: degree + PageRank ranking (pure TS, damped iteration, deterministic tie-breaks); GRAPH_REPORT gains a Central nodes section
- why --k <n>: up to k-1 distinct alternative routes via edge-removal re-search, rendered as 'Alternative routes'
- gsd-graph watch: fs.watch over corpus roots, debounced incremental sync under the ordinary build lock — freshness for Cursor/Codex/plain editors
- gsd-graph hook install-git [--remove]: guarded marker block in .git/hooks/post-commit running detached sync; append-safe with existing user hooks
- SKILL.md gains a routing table: agents route project questions through graph_answer/graph_why/graph_communities (or CLI ask/why/top) before re-reading planning docs; abstain+suggestions is the fallback signal
- mcp install/doctor output names the tools and the graph-first rule
@jeremymcs jeremymcs changed the title v0.3.0 — LLM-assisted extraction, Anthropic adapter, export/why commands, ontology & extraction fixes v0.4.0 — LLM extraction + write path, MCP parity, retrieval quality, analytics, watch mode Aug 5, 2026
@jeremymcs
jeremymcs merged commit 6997cc1 into main Aug 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant