Skip to content

Commit e25bfa9

Browse files
rustyconoverclaude
andcommitted
chore: vgi-lint 0.37.0 clean
Make vgi-nlp pass vgi-lint-check 0.37.0 at fail-on=info: - VGI138: emit vgi.keywords as a JSON array of strings everywhere (catalog and schema tags in nlp_worker.py; object_tags now serializes its comma-separated keywords via json.dumps in vgi_nlp/meta.py). - VGI139: drop the redundant per-object vgi.source_url (removed from the schema tags and from object_tags); source_url stays only on the Catalog. - VGI312: every function/macro argument already carries an accurate doc (Param/ConstParam/Arg doc=...); verified clean. - Bump the VGI SDK floor to vgi-python>=0.8.5 (pyproject extras + the PEP 723 header in nlp_worker.py) so per-argument docs serialize; uv.lock updated. - Pin the vgi-lint-check action to version "0.37.0" in CI. Verified: vgi-lint --execute --fail-on info reports score 100, 0 findings; ruff/mypy/pydoclint and pytest all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1646f71 commit e25bfa9

5 files changed

Lines changed: 61 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,5 +214,6 @@ jobs:
214214
- name: vgi-lint
215215
uses: Query-farm/vgi-lint-check@v1
216216
with:
217+
version: "0.37.0"
217218
location: "uv run --python 3.13 nlp_worker.py"
218219
fail-on: info

nlp_worker.py

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# /// script
22
# requires-python = ">=3.13"
33
# dependencies = [
4-
# "vgi-python[http]>=0.8.4",
4+
# "vgi-python[http]>=0.8.5",
55
# "spacy>=3.7",
66
# "fasttext-wheel",
77
# "vaderSentiment",
@@ -35,6 +35,7 @@
3535

3636
from __future__ import annotations
3737

38+
import json
3839
from typing import Any
3940

4041
from vgi import Worker
@@ -97,10 +98,23 @@
9798
source_url="https://github.com/Query-farm/vgi-nlp",
9899
tags={
99100
"vgi.title": "Classical NLP for SQL",
100-
"vgi.keywords": (
101-
"nlp, natural language processing, language detection, sentiment analysis, "
102-
"named entity recognition, ner, tokenization, lemmatize, stop words, "
103-
"noun chunks, spacy, fasttext, vader, text enrichment"
101+
"vgi.keywords": json.dumps(
102+
[
103+
"nlp",
104+
"natural language processing",
105+
"language detection",
106+
"sentiment analysis",
107+
"named entity recognition",
108+
"ner",
109+
"tokenization",
110+
"lemmatize",
111+
"stop words",
112+
"noun chunks",
113+
"spacy",
114+
"fasttext",
115+
"vader",
116+
"text enrichment",
117+
]
104118
),
105119
"vgi.doc_llm": _CATALOG_DESCRIPTION_LLM,
106120
"vgi.doc_md": _CATALOG_DESCRIPTION_MD,
@@ -116,16 +130,29 @@
116130
comment="Classical NLP: language ID, sentiment, NER, tokenization for SQL",
117131
tags={
118132
"vgi.title": "NLP Functions (main)",
119-
"vgi.keywords": (
120-
"nlp, language detection, sentiment, ner, entities, tokens, "
121-
"sentences, noun chunks, lemmatize, strip stopwords, normalize, "
122-
"spacy, fasttext, vader"
133+
"vgi.keywords": json.dumps(
134+
[
135+
"nlp",
136+
"language detection",
137+
"sentiment",
138+
"ner",
139+
"entities",
140+
"tokens",
141+
"sentences",
142+
"noun chunks",
143+
"lemmatize",
144+
"strip stopwords",
145+
"normalize",
146+
"spacy",
147+
"fasttext",
148+
"vader",
149+
]
123150
),
124151
# VGI123 classifying tags use BARE keys (not vgi.-namespaced).
125152
"domain": "text-analytics",
126153
"category": "natural-language-processing",
127154
"topic": "language-detection-sentiment-ner",
128-
"vgi.source_url": "https://github.com/Query-farm/vgi-nlp/blob/main/nlp_worker.py",
155+
# VGI139: source_url lives only on the catalog object, not here.
129156
"vgi.doc_llm": _SCHEMA_DESCRIPTION_LLM,
130157
"vgi.doc_md": _SCHEMA_DESCRIPTION_MD,
131158
"vgi.example_queries": _SCHEMA_EXAMPLE_QUERIES,

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = { file = "LICENSE" }
88
authors = [{ name = "Query Farm", email = "hello@query.farm" }]
99
keywords = ["vgi", "duckdb", "nlp", "spacy", "fasttext", "sentiment", "ner"]
1010
dependencies = [
11-
"vgi-python>=0.8.4",
11+
"vgi-python>=0.8.5",
1212
"spacy>=3.7",
1313
"fasttext-wheel",
1414
"vaderSentiment",
@@ -19,7 +19,7 @@ dependencies = [
1919
# addition to stdio. That path needs vgi-python's `http` extra (waitress).
2020
# CI's http transport leg installs this via `uv sync --extra http`.
2121
http = [
22-
"vgi-python[http]>=0.8.4",
22+
"vgi-python[http]>=0.8.5",
2323
]
2424
dev = [
2525
"pytest>=8",

uv.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vgi_nlp/meta.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,26 @@
88
- ``vgi.doc_llm`` (VGI112) -- Markdown narrative aimed at LLMs/agents
99
- ``vgi.doc_md`` (VGI113) -- Markdown narrative for human docs (distinct
1010
content from ``doc_llm``)
11-
- ``vgi.keywords`` (VGI126) -- comma-separated search terms/synonyms
12-
- ``vgi.source_url`` (VGI128) -- link to the implementing source file
11+
- ``vgi.keywords`` (VGI126/VGI138) -- a JSON array of search-term/synonym strings
1312
14-
``source_url(file)`` builds the canonical GitHub blob URL so every object points
15-
at exactly where it is implemented.
13+
Per-object ``vgi.source_url`` is intentionally NOT emitted here: VGI139 requires
14+
``source_url`` to live only on the catalog object (set on ``Catalog(...)`` in
15+
``nlp_worker.py``), not on every function/schema.
1616
""" # noqa: D205
1717

1818
from __future__ import annotations
1919

20-
#: Base GitHub blob URL for source files in this repo (pinned to ``main``).
21-
SOURCE_BASE = "https://github.com/Query-farm/vgi-nlp/blob/main"
20+
import json
2221

2322

24-
def source_url(relative_path: str) -> str:
25-
"""Build the implementation ``vgi.source_url`` for a repo-relative file.
23+
def keywords_array(keywords: str) -> str:
24+
"""Serialize comma-separated keywords as a JSON array of strings (VGI138).
2625
27-
e.g. ``source_url("vgi_nlp/scalars.py")``.
26+
``keywords`` is a comma-separated list (e.g. ``"ner, entities, spacy"``);
27+
each term is trimmed and emitted as one element of a JSON string array.
2828
"""
29-
return f"{SOURCE_BASE}/{relative_path}"
29+
terms = [k.strip() for k in keywords.split(",") if k.strip()]
30+
return json.dumps(terms)
3031

3132

3233
def object_tags(
@@ -36,14 +37,15 @@ def object_tags(
3637
keywords: str,
3738
relative_path: str,
3839
) -> dict[str, str]:
39-
"""Build the five standard per-object discovery/description tags.
40+
"""Build the standard per-object discovery/description tags.
4041
41-
``relative_path`` is the implementing file relative to the repo root.
42+
``relative_path`` is the implementing file relative to the repo root; it is
43+
retained for call-site documentation but no longer emitted as a per-object
44+
``vgi.source_url`` (VGI139 keeps ``source_url`` on the catalog only).
4245
"""
4346
return {
4447
"vgi.title": title,
4548
"vgi.doc_llm": doc_llm,
4649
"vgi.doc_md": doc_md,
47-
"vgi.keywords": keywords,
48-
"vgi.source_url": source_url(relative_path),
50+
"vgi.keywords": keywords_array(keywords),
4951
}

0 commit comments

Comments
 (0)