kbforge-sql 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: kbforge-sql
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: SQL source connector for kbforge
5
5
  Author-email: Qing <qingye779@gmail.com>
6
6
  License: MIT
7
7
  Requires-Python: >=3.12
8
- Requires-Dist: kbforge>=0.8.0
8
+ Requires-Dist: kbforge>=0.14.1
9
9
  Requires-Dist: pydantic>=2.0
10
10
  Requires-Dist: sqlalchemy>=2.0
11
11
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "kbforge-sql"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "SQL source connector for kbforge"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -9,7 +9,7 @@ license = { text = "MIT" }
9
9
  dependencies = [
10
10
  # 0.8.0: cursor slots keyed per config instance, so two `sql` sources never
11
11
  # share a manifest; `synthesize.OKF_OWNED` and `canonical.is_blank` exist.
12
- "kbforge>=0.8.0",
12
+ "kbforge>=0.14.1",
13
13
  "pydantic>=2.0",
14
14
  "sqlalchemy>=2.0",
15
15
  ]
@@ -12,7 +12,7 @@ from collections.abc import Mapping, Sequence
12
12
  from pydantic import BaseModel, ConfigDict, Field, ValidationError
13
13
 
14
14
  from kbforge.canonical import is_blank
15
- from kbforge.synthesize import OKF_OWNED
15
+ from kbforge.synthesize import OKF_OWNED, OKF_RESERVED
16
16
  from kbforge_sql.errors import SqlSourceError
17
17
 
18
18
  # Same shapes as kbforge-mcp's config: an ALL_CAPS env var name, and a `system`
@@ -134,7 +134,7 @@ def problems_for(config: dict) -> list[str]:
134
134
  # string becomes one tag). A `tags` facet reaches the rendered concept, so
135
135
  # rejecting it here would be a false positive -- exactly the failure mode
136
136
  # this check exists to prevent for every OTHER owned key.
137
- if owned := sorted(set(cfg.facets) & (OKF_OWNED - {"tags"})):
137
+ if owned := sorted(set(cfg.facets) & ((OKF_OWNED - {"tags"}) | OKF_RESERVED)):
138
138
  problems.append(
139
139
  f"config 'facets' must not use OKF-owned key(s) {owned}: the emitter "
140
140
  "drops them, so the facet would silently never appear"
@@ -105,6 +105,16 @@ def test_a_facet_named_like_an_okf_key_is_rejected():
105
105
  )
106
106
 
107
107
 
108
+ def test_a_facet_named_like_a_reserved_okf_key_is_rejected():
109
+ # The emitter drops `stale_after` like an owned key, so the config must
110
+ # refuse it for the same reason: the facet would silently never appear.
111
+ problems = problems_for(_cfg(facets=["family", "stale_after"]))
112
+ assert any(
113
+ p.startswith("config 'facets' must not use OKF-owned key(s) ['stale_after']")
114
+ for p in problems
115
+ ), problems
116
+
117
+
108
118
  def test_a_tags_facet_is_allowed():
109
119
  # `tags` is OKF-owned too, but unlike the other owned keys the emitter does
110
120
  # not drop it: `assemble` reads `structured["tags"]` and ships it,
File without changes
File without changes