Repository navigation
feat(extract): --frontmatter-only — schema-pack-driven link extraction without legacy typed inference - #2040
Closed
JiraiyaETH wants to merge 4 commits into
Closed
JiraiyaETH wants to merge 4 commits into
JiraiyaETH wants to merge 4 commits into
Conversation
added 4 commits
June 10, 2026 07:03
Use the shared loadActivePackBestEffort path for extract frontmatter-link wiring and carry resolution provenance so callers can distinguish unconfigured default/back-compat fallback from configured pack load failure. Configured pack load failures now warn loudly and skip frontmatter link extraction for that run instead of passing undefined into extractFrontmatterLinks and resurrecting FRONTMATTER_LINK_MAP legacy verbs. Legacy fallback remains for no configured schema_pack and for packs declaring zero frontmatter_links. The existing extractStaleFromDB skipFrontmatter threading is intentionally retained: stale extraction still runs body/timeline extraction while frontmatter extraction stays gated by --include-frontmatter and is forced off for D4 pack-load failures.
This was referenced Jul 21, 2026
Collaborator
|
Really thorough PR — the dry-run receipt and the note that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--frontmatter-onlyforgbrain extract linksso the strict Phase 2 graph backfill lane can run deterministic frontmatter extraction without also firing legacy markdown/bare-link typed inference.The new flag is valid only with
--include-frontmatter; otherwise the CLI exits with a clear usage error. When enabled,runExtract -> extractLinksFromDB -> extractPageLinksthreadsfrontmatterOnly: true, skipping the markdown entity-ref and bare-slug passes while preservingextractFrontmatterLinksand active schema-packfrontmatter_linkssemantics.I checked
src/core/operations.ts;extract linksis not exposed as a shared MCP operation, so this is CLI-only for now. That keeps scope tight and avoids inventing a second operation surface.Rationale
This implements the preferred shape from the Phase 2 strict extraction decision packet. The packet blocked full Option A because
--include-frontmatterstill ran the legacy typedinferLinkTypepath, where previous falseinvested_in/foundedrisk lived. This patch creates the native strict switch needed before approval gate #3.It also matches the schema/ontology calibration direction: Option A remains the operationally safe first-write posture, while Option C is the durable schema-pack-first typed extraction direction.
--frontmatter-onlyis the small bridge: it lets the Option A gate use pack-declared frontmatter semantics now, without broad legacy inference noise.Lineage:
phase2-strict-extraction-decision-packet-20260610T000000Z/phase2-decision-packet.md90-schema-ontology-calibration-plan.mdOption A -> Option C directionTODOS.mdT1.5 / TODO-1 pack-aware runtime migration patternTests
bun test test/link-extraction.test.ts test/extract-db.test.ts-> 142 pass / 0 failbun run typecheck-> exit 0Phase 2 dry-run receipt
Command:
Result: 265 frontmatter edges, all
link_source=frontmatter.By type:
about: 231related_to: 14derived_from: 11sourced_from: 5discussed_in: 2works_at: 2attended: 0Receipts are in the Phase 2 specs directory:
phase2-frontmatter-only-strict.ndjsonphase2-frontmatter-only-strict.stderrphase2-frontmatter-only-strict-summary.jsonphase2-frontmatter-only-relevant-tests.txtphase2-frontmatter-only-typecheck.txt🤖 Generated with Claude Code