Skip to content

Commit fd400e1

Browse files
rustyconoverclaude
andcommitted
Bump vgi-python to 0.8.4, enrich catalog metadata, wire vgi-lint CI gate
Bump the vgi-python floor to >=0.8.4 (deps, http extra, and the PEP 723 inline deps in anomaly_worker.py) and refresh uv.lock. Add catalog- and schema-level metadata so vgi-lint reports 0 findings (100/100): catalog comment, source_url, and the vgi.* provenance tags (description_llm/description_md/author/copyright/license/support_contact/ support_policy_url), plus per-schema description tags. The scalar functions already carry catalog-qualified examples. Add a separate metadata-quality CI job that builds the worker and runs Query-farm/vgi-lint-check@v1 with fail-on: info. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0782af3 commit fd400e1

4 files changed

Lines changed: 74 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,27 @@ jobs:
6161
- name: Docstring lint (pydoclint)
6262
run: uvx pydoclint --config pyproject.toml vgi_anomaly/ anomaly_worker.py
6363

64+
metadata-quality:
65+
name: Metadata quality (vgi-lint)
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v6
69+
70+
- name: Install uv
71+
uses: astral-sh/setup-uv@v8.2.0
72+
73+
- name: Set up Python 3.13
74+
run: uv python install 3.13
75+
76+
- name: Install the worker (with the http extra)
77+
run: uv sync --frozen --python 3.13 --extra http
78+
79+
- name: vgi-lint
80+
uses: Query-farm/vgi-lint-check@v1
81+
with:
82+
location: "uv run --python 3.13 anomaly_worker.py"
83+
fail-on: info
84+
6485
# Resolve the latest published haybarn release once, so the whole matrix tests
6586
# the same version (and we never hardcode/pin it).
6687
resolve-haybarn:

anomaly_worker.py

Lines changed: 46 additions & 1 deletion
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.3",
4+
# "vgi-python[http]>=0.8.4",
55
# "stumpy>=1.12",
66
# "ruptures>=1.1.9",
77
# "numpy",
@@ -50,13 +50,58 @@
5050
from vgi_anomaly import detectors
5151
from vgi_anomaly.scalars import SCALAR_FUNCTIONS
5252

53+
_CATALOG_DESCRIPTION_LLM = (
54+
"Time-series anomaly detection over a numeric series passed as a single DOUBLE[] argument "
55+
"(build it in SQL with array_agg(value ORDER BY t)). Find the most anomalous subsequence "
56+
"(discord) and the most repeated pattern (motif) with the matrix profile, compute the full "
57+
"matrix profile, detect change points (regime shifts) with ruptures PELT/Dynp, and flag "
58+
"individual outliers beyond a z-score threshold. Use for outlier detection, motif/discord "
59+
"discovery, regime-change detection, and series quality checks in SQL."
60+
)
61+
62+
_CATALOG_DESCRIPTION_MD = (
63+
"# anomaly\n\n"
64+
"Time-series anomaly detection for DuckDB/SQL, backed by `stumpy` (matrix profile), "
65+
"`ruptures` (change points) and `numpy` (z-score).\n\n"
66+
"Each function takes a whole numeric series as a single `DOUBLE[]` argument "
67+
"(`array_agg(value ORDER BY t)`).\n\n"
68+
"Scalars: `matrix_profile`, `discord_index`, `motif_index`, `change_points`, "
69+
"`zscore_anomalies`."
70+
)
71+
72+
_SCHEMA_DESCRIPTION_LLM = (
73+
"Anomaly-detection scalar functions operating on a whole numeric series (DOUBLE[]): "
74+
"matrix profile, top discord (anomaly) index, top motif index, change-point detection, "
75+
"and z-score outlier indices."
76+
)
77+
78+
_SCHEMA_DESCRIPTION_MD = (
79+
"Time-series anomaly-detection scalar functions: matrix profile, discords, motifs, "
80+
"change points, and z-score outliers."
81+
)
82+
5383
_ANOMALY_CATALOG = Catalog(
5484
name="anomaly",
5585
default_schema="main",
86+
comment="Time-series anomaly detection: matrix profile, change points, z-score for SQL.",
87+
source_url="https://github.com/Query-farm/vgi-anomaly",
88+
tags={
89+
"vgi.description_llm": _CATALOG_DESCRIPTION_LLM,
90+
"vgi.description_md": _CATALOG_DESCRIPTION_MD,
91+
"vgi.author": "Query.Farm",
92+
"vgi.copyright": "Copyright 2026 Query Farm LLC - https://query.farm",
93+
"vgi.license": "MIT",
94+
"vgi.support_contact": "https://github.com/Query-farm/vgi-anomaly/issues",
95+
"vgi.support_policy_url": "https://github.com/Query-farm/vgi-anomaly/blob/main/README.md",
96+
},
5697
schemas=[
5798
Schema(
5899
name="main",
59100
comment="Time-series anomaly detection: matrix profile, change points, z-score for SQL",
101+
tags={
102+
"vgi.description_llm": _SCHEMA_DESCRIPTION_LLM,
103+
"vgi.description_md": _SCHEMA_DESCRIPTION_MD,
104+
},
60105
functions=list(SCALAR_FUNCTIONS),
61106
),
62107
],

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ classifiers = [
3030
]
3131
requires-python = ">=3.13"
3232
dependencies = [
33-
"vgi-python>=0.8.3",
33+
"vgi-python>=0.8.4",
3434
"stumpy>=1.12",
3535
"ruptures>=1.1.9",
3636
"numpy",
@@ -42,7 +42,7 @@ dependencies = [
4242
# in addition to stdio. That path needs vgi-python's `http` extra (waitress).
4343
# CI's http transport leg installs this via `uv sync --extra http`.
4444
http = [
45-
"vgi-python[http]>=0.8.3",
45+
"vgi-python[http]>=0.8.4",
4646
]
4747
dev = [
4848
"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.

0 commit comments

Comments
 (0)