Repository navigation
feat(documents): add okf.<key> filter alias for OKF frontmatter extensions - #303
Open
shirshanka wants to merge 1 commit into
Open
shirshanka wants to merge 1 commit into
shirshanka wants to merge 1 commit into
Conversation
Open
2 tasks done
This branch has not been deployed
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.
Stacked on #301. Review that one first; this PR only adds the commit on top.
What
Agents can filter OKF documents by any custom frontmatter key with
okf.<key>:The server side is datahub-project/datahub#21886, which indexes those keys as
key=valueentries in theokfExtensionsfield.How it maps
okf.<key> = v(andIN) becomesokfExtensions IEQUAL ["<key>=v", "x-<key>=v"]. It's case-insensitive, like the otherokf_*aliases.x-(x-domain), while earlier bundles use bare keys (domain). The index keeps keys as written, sookf.domainandokf.x-domainboth send both spellings. This costs one extra value in the same criterion, and agents don't need to know which version a bundle uses.!=/NOTnegates that condition.IS NOT NULLbecomesokfExtensions START_WITH ["<key>=", "x-<key>="], which finds documents that declare the key.IS NULLis its negation.>,<and similar operators are rejected with a clear error, since values are stored as text. So areokf.andokf.x-without a key.analysts, engineers), and a nested key uses dots (x-team.lead), as indexed by feat(okf): make OKF frontmatter extensions searchable and filterable datahub-project/datahub#21886.The
search_documentstool description andFILTER_DOCSdescribeokf.<key>and add an example. On a server without datahub-project/datahub#21886, the field doesn't exist and the filter matches nothing.Tests
tests/test_mcp/test_okf_documents.py: both spellings,INwith a joined value, nested keys, negation, null checks, combining withokf_type, rejected forms, andFILTER_DOCSnamingokf.<key>.IEQUALandSTART_WITHcriteria this alias sends against a live server, on Search V3 and V2.Local:
make lintanduv run pytest(780 pass) are clean. The same alias for the DataHub CLI and agent context is datahub-project/datahub#21888. CHANGELOG updated.🤖 Opened with cclaude on behalf of @shirshanka